var Ae=Object.defineProperty;var Be=(m,o,e)=>o in m?Ae(m,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):m[o]=e;var a=(m,o,e)=>Be(m,typeof o!="symbol"?o+"":o,e);import{T as Fe,a as he,b as F,S as ue,M as pe,c as oe,W as ne,B as H,d as z,L as Te,E as O,e as ce,p as q,f as Ee,g as fe,A as Q,h as me,i as De,j as V,s as re,G as we,k as $,l as Y,m as Le,P as Ie,n as Re,o as Ne,C as X,q as be,r as _e,t as Ue,u as Ye,v as Xe,w as ee,x as j,y as ke,z as Ve,D as J,F as ge,V as Ge,H as ae,I as We,J as $e,U as xe,K as E,R as ve,N as ye,O as Pe,Q as Oe,X as He,Y as ze,Z as qe,_ as Ke}from"./index-Bx8XTHrS.js";import{$ as bt,a0 as kt,a1 as vt,a2 as yt,a3 as Pt,a4 as St,a5 as Mt,a6 as At,a7 as Bt,a8 as Ft,a9 as Et,aa as Dt,ab as Lt,ac as It,ad as Rt,ae as Nt,af as _t,ag as Ut,ah as Yt,ai as Xt,aj as Vt,ak as Gt,al as Wt,am as $t,an as Ot,ao as Ht,ap as zt,aq as qt,ar as Kt,as as Zt,at as Jt,au as Qt,av as jt,aw as es,ax as ts,ay as ss,az as os,aA as ns,aB as as,aC as rs,aD as is,aE as ls,aF as hs,aG as cs,aH as ds,aI as us,aJ as ps,aK as fs,aL as ms,aM as gs,aN as xs,aO as Cs,aP as Ts,aQ as ws,aR as bs,aS as ks,aT as vs,aU as ys,aV as Ps,aW as Ss,aX as Ms,aY as As,aZ as Bs,a_ as Fs,a$ as Es,b0 as Ds,b1 as Ls,b2 as Is,b3 as Rs,b4 as Ns,b5 as _s,b6 as Us,b7 as Ys,b8 as Xs,b9 as Vs,ba as Gs,bb as Ws,bc as $s,bd as Os,be as Hs,bf as zs,bg as qs,bh as Ks,bi as Zs,bj as Js,bk as Qs,bl as js,bm as eo,bn as to,bo as so,bp as oo,bq as no,br as ao,bs as ro,bt as io,bu as lo,bv as ho,bw as co,bx as uo,by as po,bz as fo,bA as mo,bB as go,bC as xo,bD as Co,bE as To,bF as wo,bG as bo,bH as ko,bI as vo,bJ as yo,bK as Po,bL as So,bM as Mo,bN as Ao,bO as Bo,bP as Fo,bQ as Eo,bR as Do,bS as Lo,bT as Io,bU as Ro,bV as No,bW as _o,bX as Uo,bY as Yo,bZ as Xo,b_ as Vo,b$ as Go,c0 as Wo,c1 as $o,c2 as Oo,c3 as Ho}from"./index-Bx8XTHrS.js";import{SkeletonClipping as de,SkeletonPhysicsMovement as Ze,AnimationStateData as Je,AtlasAttachmentLoader as Qe,SkeletonBounds as je}from"./index-BOcdShQh.js";import{AssetCache as qo,AssetManagerBase as Ko,Downloader as Zo,SkeletonRendererCore as Jo,Triangulator as Qo}from"./index-BOcdShQh.js";if(typeof window<"u"&&window.PIXI){const m=window.require;window.require=o=>{if(m)return m(o);if(o.startsWith("@pixi/"))return window.PIXI}}const _=class _ extends Fe{constructor(e){super(e.resource.source);a(this,"texture");this.texture=he.from(e)}static from(e){return _.textureMap.has(e)?_.textureMap.get(e):new _(e)}setFilters(e,t){this.texture.baseTexture.scaleMode=_.toPixiTextureFilter(e),this.texture.baseTexture.mipmap=_.toPixiMipMap(e)}setWraps(e,t){this.texture.baseTexture.wrapMode=_.toPixiTextureWrap(e)}dispose(){this.texture.destroy()}static toPixiTextureFilter(e){switch(e){case F.Nearest:case F.MipMapNearestLinear:case F.MipMapNearestNearest:return ue.NEAREST;case F.Linear:case F.MipMapLinearLinear:case F.MipMapLinearNearest:return ue.LINEAR;default:throw new Error(`Unknown texture filter: ${String(e)}`)}}static toPixiMipMap(e){switch(e){case F.Nearest:case F.Linear:return pe.OFF;case F.MipMapNearestLinear:case F.MipMapNearestNearest:case F.MipMapLinearLinear:case F.MipMapLinearNearest:return pe.ON;default:throw new Error(`Unknown texture filter: ${String(e)}`)}}static toPixiTextureWrap(e){switch(e){case oe.ClampToEdge:return ne.CLAMP;case oe.MirroredRepeat:return ne.MIRRORED_REPEAT;case oe.Repeat:return ne.REPEAT;default:throw new Error(`Unknown texture wrap: ${String(e)}`)}}static toPixiBlending(e){switch(e){case H.Normal:return z.NORMAL;case H.Additive:return z.ADD;case H.Multiply:return z.MULTIPLY;case H.Screen:return z.SCREEN;default:throw new Error(`Unknown blendMode: ${String(e)}`)}}};a(_,"textureMap",new Map);let G=_;const K="spineTextureAtlasLoader",et={extension:O.Asset,resolver:{test:m=>V(m,".atlas"),parse:m=>{var e,t;const o=m.split(".");return{resolution:parseFloat(((t=(e=re.RETINA_PREFIX)==null?void 0:e.exec(m))==null?void 0:t[1])??"1"),format:o[o.length-2],src:m}}},loader:{name:K,extension:{type:O.LoadParser,priority:Te.Normal,name:K},test(m){return V(m,".atlas")},async load(m){const o=await re.ADAPTER.fetch(m);if(!o.ok)throw new Error(`[${K}] Failed to fetch ${m}: ${o.status} ${o.statusText}`);return await o.text()},testParse(m,o){const e=V(o.src,".atlas"),t=typeof m=="string",s=o.loadParser===K;return Promise.resolve((e||s)&&t)},unload(m){m.dispose()},async parse(m,o,e){var p;const t=o.data||{};let s=q.dirname(o.src);s&&s.lastIndexOf("/")!==s.length-1&&(s+="/");const n=new Ee(m);if(t.images instanceof fe||typeof t.images=="string"){const h=t.images;t.images={},t.images[n.pages[0].name]=h}const r=[];let l=!0;for(const h of e.parsers)if(h.name==="loadTextures"){l=(p=h.config)==null?void 0:p.preferCreateImageBitmap;break}Q.setPreferences({preferCreateImageBitmap:!1});for(const h of n.pages){const u=h.name,c=t!=null&&t.images?t.images[u]:void 0;if(c instanceof fe)h.setTexture(G.from(c));else{const i=c??q.normalize([...s.split(q.sep),u].join(q.sep)),g={src:De(i,o.src),data:{...t.imageMetadata,alphaMode:h.pma?me.PMA:me.UNPACK}},x=e.load(g).then(d=>{h.setTexture(G.from(d.baseTexture))});r.push(x)}}return await Promise.all(r),Q.setPreferences({preferCreateImageBitmap:l}),n}}};ce.add(et);const Z="spineSkeletonLoader";function tt(m){return m.hasOwnProperty("bones")}function st(m){return m instanceof Uint8Array}const ot={extension:O.Asset,loader:{name:Z,extension:{type:O.LoadParser,priority:Te.Normal,name:Z},test(m){return V(m,".skel")},async load(m){const o=await re.ADAPTER.fetch(m);if(!o.ok)throw new Error(`[${Z}] Failed to fetch ${m}: ${o.status} ${o.statusText}`);return new Uint8Array(await o.arrayBuffer())},testParse(m,o){const e=V(o.src,".json")&&tt(m),t=V(o.src,".skel")&&st(m),s=o.loadParser===Z;return Promise.resolve(e||t||s)}}};ce.add(ot);class nt extends we{constructor(o=!1){super();const e=new $(void 0),t=new $(void 0,!0),s=new $(void 0,!0,!0);this.addAttribute("aVertexPosition",e,2,!1,Y.FLOAT),this.addAttribute("aTextureCoord",t,2,!1,Y.FLOAT),this.addIndex(s)}}const at=` attribute vec2 aVertexPosition; attribute vec2 aTextureCoord; uniform mat3 projectionMatrix; uniform mat3 translationMatrix; uniform mat3 uTextureMatrix; varying vec2 vTextureCoord; void main(void) { gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy; } `,rt=` varying vec2 vTextureCoord; uniform vec4 uColor; uniform vec4 uDarkColor; uniform sampler2D uSampler; void main(void) { vec4 texColor = texture2D(uSampler, vTextureCoord); gl_FragColor.a = texColor.a * uColor.a; gl_FragColor.rgb = ((texColor.a - 1.0) * uDarkColor.a + 1.0 - texColor.rgb) * uDarkColor.rgb + texColor.rgb * uColor.rgb; } `;class it extends Le{constructor(e){const t={uSampler:e??he.EMPTY,alpha:1,uTextureMatrix:Re.IDENTITY,uColor:new Float32Array([1,1,1,1]),uDarkColor:new Float32Array([0,0,0,0])},s={tint:16777215,darkTint:0,alpha:1,pluginName:"darkTintBatch"};super(Ie.from(at,rt),t);a(this,"uvMatrix");a(this,"batchable");a(this,"pluginName");a(this,"_tintRGB");a(this,"_darkTintRGB");a(this,"_colorDirty");a(this,"_alpha");a(this,"_tintColor");a(this,"_darkTintColor");this._colorDirty=!1,this.uvMatrix=new Ne(t.uSampler),this.batchable=!0,this.pluginName=s.pluginName,this._tintColor=new X(s.tint),this._darkTintColor=new X(s.darkTint),this._tintRGB=this._tintColor.toLittleEndianNumber(),this._darkTintRGB=this._darkTintColor.toLittleEndianNumber(),this._alpha=s.alpha,this._colorDirty=!0}get texture(){return this.uniforms.uSampler}set texture(e){this.uniforms.uSampler!==e&&(!this.uniforms.uSampler.baseTexture.alphaMode!=!e.baseTexture.alphaMode&&(this._colorDirty=!0),this.uniforms.uSampler=e,this.uvMatrix.texture=e)}set alpha(e){e!==this._alpha&&(this._alpha=e,this._colorDirty=!0)}get alpha(){return this._alpha}set tint(e){e!==this.tint&&(this._tintColor.setValue(e),this._tintRGB=this._tintColor.toLittleEndianNumber(),this._colorDirty=!0)}get tint(){return this._tintColor.value}set darkTint(e){e!==this.darkTint&&(this._darkTintColor.setValue(e),this._darkTintRGB=this._darkTintColor.toLittleEndianNumber(),this._colorDirty=!0)}get darkTint(){return this._darkTintColor.value}get tintValue(){return this._tintColor.toNumber()}get darkTintValue(){return this._darkTintColor.toNumber()}update(){this._colorDirty&&(this._colorDirty=!1,X.shared.setValue(this._tintColor).premultiply(this._alpha,!0).toArray(this.uniforms.uColor),X.shared.setValue(this._darkTintColor).premultiply(this._alpha,!0).premultiply(1,!1).toArray(this.uniforms.uDarkColor)),this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)}}class lt extends be{constructor(e){super(new nt,new it(e),void 0,void 0);a(this,"_darkTintRGB",0)}get darkTint(){return"darkTint"in this.shader?this.shader.darkTint:null}set darkTint(e){this.shader.darkTint=e}get darkTintValue(){return this.shader.darkTintValue}_renderToBatch(e){const t=this.geometry,s=this.shader;s.uvMatrix&&(s.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=t.indexBuffer.data,this._tintRGB=s._tintRGB,this._darkTintRGB=s._darkTintRGB,this._texture=s.texture;const n=this.material.pluginName;e.batch.setObjectRenderer(e.plugins[n]),e.plugins[n].render(this)}}const y=class y extends lt{constructor(){super();a(this,"name","")}updateFromSpineData(e,t,s,n,r,l,p,h){var C,T;this.texture=e.texture;const u=r/(h?12:8)*2,c=this.geometry.getBuffer("aTextureCoord");((C=c.data)==null?void 0:C.length)!==u&&(c.data=new Float32Array(u));const i=this.geometry.getBuffer("aVertexPosition");((T=i.data)==null?void 0:T.length)!==u&&(i.data=new Float32Array(u));let g=0;const x=c.data,d=i.data;for(let k=0;k0){const l=new Ve("custom-skin");for(const p of this.skins){const h=n.findSkin(p);h!=null&&l.addSkin(h)}t.setSkin(l)}t.setupPose();const r=this.animation!=null?n.findAnimation(this.animation):null;if(r==null){t.updateWorldTransform(j.update);const l=t.getBoundsRect(s);return l.width===Number.NEGATIVE_INFINITY?{x:0,y:0,width:0,height:0}:l}else{let l=Number.POSITIVE_INFINITY,p=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY;e.clearTracks(),e.setAnimation(0,r,!1);const c=Math.max(r.duration/this.timeStep,1);for(let g=0;g0?this.timeStep:0;e.update(x),e.apply(t),t.update(x),t.updateWorldTransform(j.update);const d=t.getBoundsRect(s);l=Math.min(l,d.x),p=Math.min(p,d.y),h=Math.max(h,d.x+d.width),u=Math.max(u,d.y+d.height)}const i={x:l,y:p,width:h-l,height:u-p};return i.width===Number.NEGATIVE_INFINITY?{x:0,y:0,width:0,height:0}:i}}}const w=class w extends J{constructor(e){super();a(this,"skeleton");a(this,"state");a(this,"skeletonPhysics");a(this,"darkTint",!1);a(this,"hasNeverUpdated",!0);a(this,"_debug");a(this,"slotMeshFactory",()=>new le);a(this,"beforeUpdateWorldTransforms",()=>{});a(this,"afterUpdateWorldTransforms",()=>{});a(this,"_autoUpdate",!1);a(this,"_ticker",ge.shared);a(this,"meshesCache",new Map);a(this,"lightColor",new ae);a(this,"darkColor",new ae);a(this,"clippingVertAux",new Float32Array(6));a(this,"_boundsProvider");a(this,"_boundsPoint",new We);a(this,"_boundsSpineID",-1);a(this,"_boundsSpineDirty",!0);a(this,"slotsObject",new Map);a(this,"verticesCache",xe.newFloatArray(1024));a(this,"clippingSlotToPixiMasks",{});e instanceof $e?e={skeletonData:e}:"skeleton"in e&&(e=new.target.createOptions(e));const{autoUpdate:t=!0,boundsProvider:s,darkTint:n,skeletonData:r,ticker:l}=e;this.skeleton=new ee(r),this.skeletonPhysics=new Ze(this.skeleton,{readTransform:(p,h)=>this.readPhysicsTransform(p,h),worldToSkeleton:p=>this.pixiWorldCoordinatesToSkeleton(p)}),this.state=new ke(new Je(r)),l&&(this._ticker=l),this.autoUpdate=t,this.boundsProvider=s,this.darkTint=n===void 0?this.skeleton.slots.some(p=>!!p.data.setupPose.darkColor):n,this.darkTint&&(this.slotMeshFactory=()=>new ie)}get debug(){return this._debug}set debug(e){this._debug&&this._debug.unregisterSpine(this),e&&e.registerSpine(this),this._debug=e}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e&&!this._autoUpdate?this._ticker.add(this.internalUpdate,this):!e&&this._autoUpdate&&this._ticker.remove(this.internalUpdate,this),this._autoUpdate=e}get ticker(){return this._ticker}set ticker(e){e=e??ge.shared,this._ticker!==e&&(this._autoUpdate&&(this._ticker.remove(this.internalUpdate,this),e.add(this.internalUpdate,this)),this._ticker=e)}get boundsProvider(){return this._boundsProvider}set boundsProvider(e){this._boundsProvider=e,e?(this._boundsSpineID=-1,this._boundsSpineDirty=!0,this.interactiveChildren=!1):(this.interactiveChildren=!0,this.hitArea=null),this.hasNeverUpdated||this.calculateBounds()}update(e){this.internalUpdate(0,e)}internalUpdate(e,t){this.hasNeverUpdated=!1;const s=t??this._ticker.deltaMS/1e3;this.state.update(s),this.state.apply(this.skeleton),this.skeletonPhysics.applyTransformMovement(),this.beforeUpdateWorldTransforms(this),this.skeleton.update(s),this.skeleton.updateWorldTransform(j.update),this.afterUpdateWorldTransforms(this)}readPhysicsTransform(e,t){const s=this.worldTransform;if(e.x=s.tx,e.y=s.ty,e.z=0,!t)return;let n=0;for(let r=this;r;r=r.parent)n+=r.rotation+(r.skew.y-r.skew.x)/2;e.rotation=n*180/Math.PI}updateTransform(){var e;this.renderMeshes(),this.sortChildren(),(e=this.debug)==null||e.renderDebug(this),super.updateTransform()}destroy(e){this.autoUpdate&&(this.autoUpdate=!1),this._ticker=null;for(const[,t]of this.meshesCache)t==null||t.destroy();this.state.clearListeners(),this.debug=void 0,this.meshesCache.clear(),this.slotsObject.clear();for(const t in this.clippingSlotToPixiMasks)this.clippingSlotToPixiMasks[t].destroy(),delete this.clippingSlotToPixiMasks[t];super.destroy(e)}unloadFromCache(){var s;const e=(s=this.skeleton)==null?void 0:s.data;if(!e)return!1;const t=w.skeletonDataCacheKeys.get(e);return!t||w.skeletonCache[t]!==e?!1:(delete w.skeletonCache[t],w.skeletonDataCacheKeys.delete(e),!0)}resetMeshes(){for(const[,e]of this.meshesCache)e.zIndex=-1,e.visible=!1}_calculateBounds(){this.hasNeverUpdated&&(this.internalUpdate(0,0),this.renderMeshes())}hasMeshForSlot(e){return this.meshesCache.has(e)}getMeshForSlot(e){let t=this.hasMeshForSlot(e)?this.meshesCache.get(e):null;return t?t.visible=!0:(t=this.slotMeshFactory(),this.addChild(t),this.meshesCache.set(e,t)),t}getSlotFromRef(e){let t;if(typeof e=="number"?t=this.skeleton.slots[e]:typeof e=="string"?t=this.skeleton.findSlot(e):t=e,!t)throw new Error(`No slot found with the given slot reference: ${e}`);return t}addSlotObject(e,t,s){var l;const n=this.getSlotFromRef(e),r=(l=this.slotsObject.get(n))==null?void 0:l.container;if(!(r&&r===t)){for(const[p,{container:h}]of this.slotsObject)if(p!==n&&h===t){this.removeSlotObject(p,t);break}r&&this.removeChild(r),this.slotsObject.set(n,{container:t,followAttachmentTimeline:(s==null?void 0:s.followAttachmentTimeline)||!1,followSlotColor:(s==null?void 0:s.followSlotColor)||!1}),this.addChild(t)}}getSlotObject(e){const t=this.slotsObject.get(this.getSlotFromRef(e));return t?t.container:void 0}removeSlotObject(e,t){var r;const s=this.getSlotFromRef(e),n=(r=this.slotsObject.get(s))==null?void 0:r.container;n&&(t&&t!==n||(this.removeChild(n),this.slotsObject.delete(s)))}removeSlotObjects(){for(const[,e]of this.slotsObject)e.container.removeFromParent();this.slotsObject.clear()}pixiMaskCleanup(e){const t=this.clippingSlotToPixiMasks[e.data.name];t&&(delete this.clippingSlotToPixiMasks[e.data.name],t.destroy())}updateSlotObject(e,t,s){const{container:n,followAttachmentTimeline:r}=e,l=t.appliedPose,p=r?!!l.attachment:!0,h=this.skeleton.drawOrder.appliedPose;if(n.visible=h.includes(t)&&p,n.visible){const u=t.bone.appliedPose,c=n.localTransform;c.a=u.a,c.b=u.c,c.c=-u.b,c.d=-u.d,c.tx=u.worldX,c.ty=u.worldY,n.transform.setFromMatrix(c),n.zIndex=s+1,n.alpha=this.skeleton.color.a*l.color.a,e.followSlotColor&&this.setSlotObjectTint(n,255*this.skeleton.color.r*l.color.r<<16|255*this.skeleton.color.g*l.color.g<<8|255*this.skeleton.color.b*l.color.b)}}setSlotObjectTint(e,t){const s=e;"tint"in s&&(s.tint=t);for(const n of s.children??[])this.setSlotObjectTint(n,t)}updateAndSetPixiMask(e,t){if(w.clipper.isClipping()&&e){let s=this.clippingSlotToPixiMasks[e.slot.data.name];if(s||(s=new E,this.clippingSlotToPixiMasks[e.slot.data.name]=s,this.addChild(s)),!e.computed){e.computed=!0;const n=e.slot.appliedPose.attachment,r=n.worldVerticesLength;this.clippingVertAux.length>1)*C,A>this.verticesCache.length&&(this.verticesCache=xe.newFloatArray(A)),S.computeWorldVertices(W,i,0,S.worldVerticesLength,this.verticesCache,0,C),e=S.triangles;const v=T.sequence,R=v.resolveIndex(d);t=v.getUVs(R),b=(p=v.regions[R])==null?void 0:p.texture}else if(T instanceof Pe){w.clipper.clipStart(W,i,T),s={slot:i,computed:!1};continue}else{this.hasMeshForSlot(i)&&(this.getMeshForSlot(i).visible=!1),w.clipper.clipEnd(i),this.pixiMaskCleanup(i);continue}if(b!=null){const S=W.color,v=d.color,R=S.a*v.a*k.a;this.lightColor.set(S.r*v.r*k.r,S.g*v.g*k.g,S.b*v.b*k.b,R),d.darkColor!=null?this.darkColor.set(d.darkColor.r,d.darkColor.g,d.darkColor.b,1):this.darkColor.set(0,0,0,1);let D,N,P,B;if(w.clipper.isClipping()&&w.clipper.clipTriangles(this.verticesCache,e,e.length,t,this.lightColor,this.darkColor,f,C))D=w.clipper.clippedVertices,N=D.length,P=w.clipper.clippedTriangles,B=P.length;else{const L=this.verticesCache;for(let te=2,se=0,Me=A;te{if(this.drawEvents){const n=Math.abs(o.scale.x||o.scale.y||1),r=new Ke(s.data.name,{fontSize:this.eventFontSize/n,fill:this.eventFontColor,fontFamily:"monospace"});r.scale.x=Math.sign(o.scale.x),r.anchor.set(.5),e.eventText.addChild(r),setTimeout(()=>{r.destroyed||r.destroy()},250)}}}};e.parentDebugContainer.addChild(e.bones),e.parentDebugContainer.addChild(e.skeletonXY),e.parentDebugContainer.addChild(e.regionAttachmentsShape),e.parentDebugContainer.addChild(e.meshTrianglesLine),e.parentDebugContainer.addChild(e.meshHullLine),e.parentDebugContainer.addChild(e.clippingPolygon),e.parentDebugContainer.addChild(e.boundingBoxesRect),e.parentDebugContainer.addChild(e.boundingBoxesCircle),e.parentDebugContainer.addChild(e.boundingBoxesPolygon),e.parentDebugContainer.addChild(e.pathsCurve),e.parentDebugContainer.addChild(e.pathsLine),e.parentDebugContainer.addChild(e.eventText),e.parentDebugContainer.zIndex=9999999,e.parentDebugContainer.accessibleChildren=!1,e.parentDebugContainer.eventMode="none",e.parentDebugContainer.interactiveChildren=!1,o.addChild(e.parentDebugContainer),o.state.addListener(e.eventCallback),this.registeredSpines.set(o,e)}renderDebug(o){this.registeredSpines.has(o)||this.registerSpine(o);const e=this.registeredSpines.get(o);if(!e)return;o.addChild(e.parentDebugContainer),e.skeletonXY.clear(),e.regionAttachmentsShape.clear(),e.meshTrianglesLine.clear(),e.meshHullLine.clear(),e.clippingPolygon.clear(),e.boundingBoxesRect.clear(),e.boundingBoxesCircle.clear(),e.boundingBoxesPolygon.clear(),e.pathsCurve.clear(),e.pathsLine.clear();for(let n=e.bones.children.length;n>0;n--)e.bones.children[n-1].destroy({children:!0,texture:!0,baseTexture:!0});const t=Math.abs(o.scale.x||o.scale.y||1),s=this.lineWidth/t;if(this.drawBones&&this.drawBonesFunc(o,e,s,t),this.drawPaths&&this.drawPathsFunc(o,e,s),this.drawBoundingBoxes&&this.drawBoundingBoxesFunc(o,e,s),this.drawClipping&&this.drawClippingFunc(o,e,s),(this.drawMeshHull||this.drawMeshTriangles)&&this.drawMeshHullAndMeshTriangles(o,e,s),this.drawRegionAttachments&&this.drawRegionAttachmentsFunc(o,e,s),this.drawEvents)for(const n of e.eventText.children)n.alpha-=.05,n.y-=2}drawBonesFunc(o,e,t,s){const n=o.skeleton,r=n.x,l=n.y,p=n.bones;e.skeletonXY.lineStyle(t,this.skeletonXYColor,1);for(let u=0,c=p.length;uC&&fC&&f>T?M=-N:dT?M=N:f===T&&dC?M=-90*D:d===C&&fT&&(M=0),P.rotation=M,P.lineStyle(t+B/2.4,this.bonesColor,1),P.beginFill(0,.6),P.drawCircle(0,v,B*1.2),P.endFill()}const h=t*3;e.skeletonXY.moveTo(r-h,l-h),e.skeletonXY.lineTo(r+h,l+h),e.skeletonXY.moveTo(r+h,l-h),e.skeletonXY.lineTo(r-h,l+h)}drawRegionAttachmentsFunc(o,e,t){const n=o.skeleton.slots;e.regionAttachmentsShape.lineStyle(t,this.regionAttachmentsColor,1);for(let r=0,l=n.length;r0){g=(g>>1)*2;let x=c[g-2],d=c[g-1];for(let f=0,C=g;f{if(e.boundingBoxesPolygon.lineStyle(t,this.boundingBoxesPolygonColor,1),e.boundingBoxesPolygon.beginFill(this.boundingBoxesPolygonColor,.1),h<3)throw new Error("Polygon must contain at least 3 vertices");const u=[],c=t*2;for(let i=0,g=l.length;i