@esotericsoftware/spine-pixi-v8 4.2.90 → 4.2.91

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,4 +24,4 @@
24
24
 
25
25
  finalColor.a = outColor.a * vColor.a;
26
26
  finalColor.rgb = ((outColor.a - 1.0) * vDarkColor.a + 1.0 - outColor.rgb) * vDarkColor.rgb + outColor.rgb * vColor.rgb;
27
- `}},Ri=class extends Pi{constructor(e){const t=ki({name:"dark-tint-batch",bits:[Si,Ei,Mi(e),Fi]}),s=Ti({name:"dark-tint-batch",bits:[Ai,Bi,Ii(e),Xi]});super({glProgram:t,gpuProgram:s,resources:{batchSamplers:Yi(e)}})}},Zs=null,Li=class fr extends gi{static extension={type:[bi.Batcher],name:"darkTint"};geometry=new Ci;shader=Zs||(Zs=new Ri(this.maxTextures));name=fr.extension.name;vertexSize=7;packAttributes(t,s,i,r,l){const o=l<<16|t.roundPixels&65535,n=t.transform,a=n.a,h=n.b,c=n.c,f=n.d,d=n.tx,m=n.ty,{positions:u,uvs:p}=t,b=t.color,w=(b>>24&255)/255,g=pi.shared.setValue(t.darkColor).premultiply(w,!0).toPremultiplied(1,!1),x=t.attributeOffset,y=x+t.attributeSize;for(let v=x;v<y;v++){const C=v*2,A=u[C],k=u[C+1];s[r++]=a*A+c*k+d,s[r++]=f*k+h*A+m,s[r++]=p[C],s[r++]=p[C+1],i[r++]=b,i[r++]=g,i[r++]=o}}packQuadAttributes(t,s,i,r,l){const o=t.texture,n=t.transform,a=n.a,h=n.b,c=n.c,f=n.d,d=n.tx,m=n.ty,u=t.bounds,p=u.maxX,b=u.minX,w=u.maxY,g=u.minY,x=o.uvs,y=t.color,v=t.darkColor,C=l<<16|t.roundPixels&65535;s[r+0]=a*b+c*g+d,s[r+1]=f*g+h*b+m,s[r+2]=x.x0,s[r+3]=x.y0,i[r+4]=y,i[r+5]=v,i[r+6]=C,s[r+7]=a*p+c*g+d,s[r+8]=f*g+h*p+m,s[r+9]=x.x1,s[r+10]=x.y1,i[r+11]=y,i[r+12]=v,i[r+13]=C,s[r+14]=a*p+c*w+d,s[r+15]=f*w+h*p+m,s[r+16]=x.x2,s[r+17]=x.y2,i[r+18]=y,i[r+19]=v,i[r+20]=C,s[r+21]=a*b+c*w+d,s[r+22]=f*w+h*b+m,s[r+23]=x.x3,s[r+24]=x.y3,i[r+25]=y,i[r+26]=v,i[r+27]=C}};xi.add(Li);import{extensions as Di,ExtensionType as ls}from"pixi.js";var Vi=class{indexOffset=0;attributeOffset=0;indexSize;attributeSize;batcherName="darkTint";topology="triangle-list";packAsQuad=!1;renderable;positions;indices;uvs;roundPixels;data;blendMode;darkTint;texture;transform;_textureId;_attributeStart;_indexStart;_batcher;_batch;get color(){const e=this.data.color,t=this.renderable.groupColor,s=this.renderable.groupAlpha;let i;const r=e.a*s*255;if(t!==16777215){const l=t>>16&255,o=t>>8&255,n=t&255,a=e.r*n,h=e.g*o,c=e.b*l;i=r<<24|c<<16|h<<8|a}else i=r<<24|e.b*255<<16|e.g*255<<8|e.r*255;return i}get darkColor(){const e=this.data.darkColor;return e.b*255<<16|e.g*255<<8|e.r*255}get groupTransform(){return this.renderable.groupTransform}setData(e,t,s,i){if(this.renderable=e,this.transform=e.groupTransform,this.data=t,t.clipped){const r=t.clippedData;this.indexSize=r.indicesCount,this.attributeSize=r.vertexCount,this.positions=r.vertices,this.indices=r.indices,this.uvs=r.uvs}else this.indexSize=t.indices.length,this.attributeSize=t.vertices.length/2,this.positions=t.vertices,this.indices=t.indices,this.uvs=t.uvs;this.texture=t.texture,this.roundPixels=i,this.blendMode=s,this.batcherName=t.darkTint?"darkTint":"default"}},Ni={0:"normal",1:"add",2:"multiply",3:"screen"},tr=class{static extension={type:[ls.WebGLPipes,ls.WebGPUPipes,ls.CanvasPipes],name:"spine"};renderer;gpuSpineData={};_destroyRenderableBound=this.destroyRenderable.bind(this);constructor(e){this.renderer=e}validateRenderable(e){if(e._validateAndTransformAttachments(),e.spineAttachmentsDirty)return!0;if(e.spineTexturesDirty){const t=e.skeleton.drawOrder,s=this.gpuSpineData[e.uid];for(let i=0,r=t.length;i<r;i++){const l=t[i],o=l.getAttachment();if(o instanceof nt||o instanceof ct){const n=e._getCachedData(l,o),a=s.slotBatches[n.id],h=n.texture;if(h!==a.texture&&!a._batcher.checkAndUpdateTexture(a,h))return!0}}}return!1}addRenderable(e,t){const s=this._getSpineData(e),i=this.renderer.renderPipes.batch,r=e.skeleton.drawOrder,l=this.renderer._roundPixels|e._roundPixels;e._validateAndTransformAttachments(),e.spineAttachmentsDirty=!1,e.spineTexturesDirty=!1;for(let o=0,n=r.length;o<n;o++){const a=r[o],h=a.getAttachment(),c=Ni[a.data.blendMode];if(h instanceof nt||h instanceof ct){const d=e._getCachedData(a,h),m=s.slotBatches[d.id]||=new Vi;m.setData(e,d,c,l),d.skipRender||i.addToBatch(m,t)}const f=e._slotsObject[a.data.name];if(f){const d=f.container;d.includeInBuild=!0,d.collectRenderables(t,this.renderer,null),d.includeInBuild=!1}}}updateRenderable(e){const t=this.gpuSpineData[e.uid];e._validateAndTransformAttachments(),e.spineAttachmentsDirty=!1,e.spineTexturesDirty=!1;const s=e.skeleton.drawOrder;for(let i=0,r=s.length;i<r;i++){const l=s[i],o=l.getAttachment();if((o instanceof nt||o instanceof ct)&&!e._getCachedData(l,o).skipRender){const a=t.slotBatches[e._getCachedData(l,o).id];a._batcher?.updateElement(a)}}}destroyRenderable(e){this.gpuSpineData[e.uid]=null,e.off("destroyed",this._destroyRenderableBound)}destroy(){this.gpuSpineData=null,this.renderer=null}_getSpineData(e){return this.gpuSpineData[e.uid]||this._initMeshData(e)}_initMeshData(e){return this.gpuSpineData[e.uid]={slotBatches:{}},e.on("destroyed",this._destroyRenderableBound),this.gpuSpineData[e.uid]}};Di.add(tr);import{Assets as er,Cache as hs,Container as Oi,fastCopy as _i,Graphics as Ui,Texture as qi,Ticker as Kt,ViewContainer as Wi}from"pixi.js";var Qt=new Xt;kt.yDown=!0;var Tt=new $t,zi=class{constructor(e,t,s,i){this.x=e,this.y=t,this.width=s,this.height=i}calculateBounds(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},Gi=class{constructor(e=!1){this.clipping=e}calculateBounds(e){if(!e.skeleton)return{x:0,y:0,width:0,height:0};const t=new kt(e.skeleton.data);t.setToSetupPose(),t.updateWorldTransform(2);const s=t.getBoundsRect(this.clipping?new $t:void 0);return s.width==Number.NEGATIVE_INFINITY?{x:0,y:0,width:0,height:0}:s}},Hi=class{constructor(e,t=[],s=.05,i=!1){this.animation=e,this.skins=t,this.timeStep=s,this.clipping=i}calculateBounds(e){if(!e.skeleton||!e.state)return{x:0,y:0,width:0,height:0};const t=new Le(e.state.data),s=new kt(e.skeleton.data),i=this.clipping?new $t:void 0,r=s.data;if(this.skins.length>0){let o=new Et("custom-skin");for(const n of this.skins){const a=r.findSkin(n);a!=null&&o.addSkin(a)}s.setSkin(o)}s.setToSetupPose();const l=this.animation!=null?r.findAnimation(this.animation):null;if(l==null){s.updateWorldTransform(2);const o=s.getBoundsRect(i);return o.width==Number.NEGATIVE_INFINITY?{x:0,y:0,width:0,height:0}:o}else{let o=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,h=Number.NEGATIVE_INFINITY;t.clearTracks(),t.setAnimationWith(0,l,!1);const c=Math.max(l.duration/this.timeStep,1);for(let d=0;d<c;d++){const m=d>0?this.timeStep:0;t.update(m),t.apply(s),s.update(m),s.updateWorldTransform(2);const u=s.getBoundsRect(i);o=Math.min(o,u.x),n=Math.min(n,u.y),a=Math.max(a,u.x+u.width),h=Math.max(h,u.y+u.height)}const f={x:o,y:n,width:a-o,height:h-n};return f.width==Number.NEGATIVE_INFINITY?{x:0,y:0,width:0,height:0}:f}}},sr=new Ct(()=>new Ui),$i=class ms extends Wi{batched=!0;buildId=0;renderPipeId="spine";_didSpineUpdate=!1;beforeUpdateWorldTransforms=()=>{};afterUpdateWorldTransforms=()=>{};skeleton;state;skeletonBounds;darkTint=!1;_debug=void 0;_slotsObject=Object.create(null);clippingSlotToPixiMasks=Object.create(null);getSlotFromRef(t){let s;if(typeof t=="number"?s=this.skeleton.slots[t]:typeof t=="string"?s=this.skeleton.findSlot(t):s=t,!s)throw new Error(`No slot found with the given slot reference: ${t}`);return s}spineAttachmentsDirty=!0;spineTexturesDirty=!0;_lastAttachments=[];_stateChanged=!0;attachmentCacheData=[];get debug(){return this._debug}set debug(t){this._debug&&this._debug.unregisterSpine(this),t&&t.registerSpine(this),this._debug=t}_autoUpdate=!1;get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t&&!this._autoUpdate?Kt.shared.add(this.internalUpdate,this):!t&&this._autoUpdate&&Kt.shared.remove(this.internalUpdate,this),this._autoUpdate=t}_boundsProvider;get boundsProvider(){return this._boundsProvider}set boundsProvider(t){this._boundsProvider=t,t&&(this._boundsDirty=!1),this.updateBounds()}hasNeverUpdated=!0;constructor(t){t instanceof Bt&&(t={skeletonData:t}),super({}),this.allowChildren=!0;const s=t instanceof Bt?t:t.skeletonData;this.skeleton=new kt(s),this.state=new Le(new Fs(s)),this.autoUpdate=t?.autoUpdate??!0,this.darkTint=t?.darkTint===void 0?this.skeleton.slots.some(r=>!!r.data.darkColor):t?.darkTint;const i=this.skeleton.slots;for(let r=0;r<i.length;r++)this.attachmentCacheData[r]=Object.create(null);this._boundsProvider=t.boundsProvider}update(t){this.internalUpdate(0,t)}internalUpdate(t,s){this._updateAndApplyState(s??Kt.shared.deltaMS/1e3)}get bounds(){return this._boundsDirty&&this.updateBounds(),this._bounds}setBonePosition(t,s){const i=t;if(typeof t=="string"&&(t=this.skeleton.findBone(t)),!t)throw Error(`Cant set bone position, bone ${String(i)} not found`);if(Qt.set(s.x,s.y),t.parent){const r=t.parent.worldToLocal(Qt);t.x=r.x,t.y=-r.y}else t.x=Qt.x,t.y=Qt.y}getBonePosition(t,s){const i=t;return typeof t=="string"&&(t=this.skeleton.findBone(t)),t?(s||(s={x:0,y:0}),s.x=t.worldX,s.y=t.worldY,s):(console.error(`Cant set bone position! Bone ${String(i)} not found`),s)}_updateAndApplyState(t){this.hasNeverUpdated=!1,this.state.update(t),this.skeleton.update(t);const{skeleton:s}=this;this.state.apply(s),this.beforeUpdateWorldTransforms(this),s.updateWorldTransform(2),this.afterUpdateWorldTransforms(this),this.updateSlotObjects(),this._stateChanged=!0,this.onViewUpdate()}_validateAndTransformAttachments(){this._stateChanged&&(this._stateChanged=!1,this.validateAttachments(),this.transformAttachments())}validateAttachments(){const t=this.skeleton.drawOrder,s=this._lastAttachments;let i=0,r=!1;for(let l=0;l<t.length;l++){const n=t[l].getAttachment();n&&(n!==s[i]&&(r=!0,s[i]=n),i++)}i!==s.length&&(r=!0,s.length=i),this.spineAttachmentsDirty||=r}currentClippingSlot;updateAndSetPixiMask(t,s){const i=t.attachment;if(i&&i instanceof bt){const o=this.clippingSlotToPixiMasks[t.data.name]||={slot:t,vertices:new Array};o.maskComputed=!1,this.currentClippingSlot=o;return}let r=this.currentClippingSlot,l=this._slotsObject[t.data.name];if(r&&l){let o=r.mask;if(o||(o=sr.obtain(),r.mask=o,this.addChild(o)),!r.maskComputed){let n=r.slot,a=n.attachment;r.maskComputed=!0;const h=a.worldVerticesLength,c=r.vertices;a.computeWorldVertices(n,0,h,c,0,2),o.clear().poly(c).stroke({width:0}).fill({alpha:.25})}l.container.mask=o}else l?.container.mask&&(l.container.mask=null);if(r&&r.slot.attachment.endSlot==t.data&&(this.currentClippingSlot=void 0),s){for(const o in this.clippingSlotToPixiMasks){const n=this.clippingSlotToPixiMasks[o];(!(n.slot.attachment instanceof bt)||!n.maskComputed)&&n.mask&&(this.removeChild(n.mask),sr.free(n.mask),n.mask=void 0)}this.currentClippingSlot=void 0}}transformAttachments(){const t=this.skeleton.drawOrder;for(let s=0;s<t.length;s++){const i=t[s];this.updateAndSetPixiMask(i,s===t.length-1);const r=i.getAttachment();if(r){if(r instanceof ct||r instanceof nt){const l=this._getCachedData(i,r);r instanceof nt?r.computeWorldVertices(i,l.vertices,0,2):r.computeWorldVertices(i,0,r.worldVerticesLength,l.vertices,0,2),l.uvs.length<r.uvs.length&&(l.uvs=new Float32Array(r.uvs.length)),_i(r.uvs.buffer,l.uvs.buffer);const n=i.bone.skeleton.color,a=i.color,h=r.color,c=n.a*a.a*h.a;if(l.color.set(n.r*a.r*h.r,n.g*a.g*h.g,n.b*a.b*h.b,c),this.alpha===0||c===0)l.skipRender=!0;else{i.darkColor&&l.darkColor.setFromColor(i.darkColor),l.skipRender=l.clipped=!1;const f=r.region?.texture.texture||qi.EMPTY;l.texture!==f&&(l.texture=f,this.spineTexturesDirty=!0),Tt.isClipping()&&this.updateClippingData(l)}}else if(r instanceof bt){Tt.clipStart(i,r);continue}}Tt.clipEndWithSlot(i)}Tt.clipEnd()}updateClippingData(t){t.clipped=!0,Tt.clipTrianglesUnpacked(t.vertices,t.indices,t.indices.length,t.uvs);const{clippedVertices:s,clippedUVs:i,clippedTriangles:r}=Tt,l=s.length/2,o=r.length;t.clippedData||(t.clippedData={vertices:new Float32Array(l*2),uvs:new Float32Array(l*2),vertexCount:l,indices:new Uint16Array(o),indicesCount:o},this.spineAttachmentsDirty=!0);const n=t.clippedData,a=n.vertexCount!==l||o!==n.indicesCount;t.skipRender=l===0,a&&(this.spineAttachmentsDirty=!0,n.vertexCount<l&&(n.vertices=new Float32Array(l*2),n.uvs=new Float32Array(l*2)),n.indices.length<o&&(n.indices=new Uint16Array(o)));const{vertices:h,uvs:c,indices:f}=n;for(let d=0;d<l;d++)h[d*2]=s[d*2],h[d*2+1]=s[d*2+1],c[d*2]=i[d*2],c[d*2+1]=i[d*2+1];n.vertexCount=l;for(let d=0;d<o;d++)f[d]!==r[d]&&(this.spineAttachmentsDirty=!0,f[d]=r[d]);n.indicesCount=o}updateSlotObjects(){for(const t in this._slotsObject){const s=this._slotsObject[t];s&&this.updateSlotObject(s)}}updateSlotObject(t){const{slot:s,container:i}=t,r=t.followAttachmentTimeline?!!s.attachment:!0;if(i.visible=this.skeleton.drawOrder.includes(s)&&r,i.visible){let l=s.bone;i.position.set(l.worldX,l.worldY),i.angle=l.getWorldRotationX();let o=1,n=1;for(;l;)o*=l.scaleX,n*=l.scaleY,l=l.parent;o<0&&(i.angle-=180),i.scale.set(s.bone.getWorldScaleX()*Math.sign(o),s.bone.getWorldScaleY()*Math.sign(n)),i.alpha=this.skeleton.color.a*s.color.a}}_getCachedData(t,s){return this.attachmentCacheData[t.data.index][s.name]||this.initCachedData(t,s)}initCachedData(t,s){let i;return s instanceof nt?(i=new Float32Array(8),this.attachmentCacheData[t.data.index][s.name]={id:`${t.data.index}-${s.name}`,vertices:i,clipped:!1,indices:[0,1,2,0,2,3],uvs:new Float32Array(s.uvs.length),color:new V(1,1,1,1),darkColor:new V(0,0,0,0),darkTint:this.darkTint,skipRender:!1,texture:s.region?.texture.texture}):(i=new Float32Array(s.worldVerticesLength),this.attachmentCacheData[t.data.index][s.name]={id:`${t.data.index}-${s.name}`,vertices:i,clipped:!1,indices:s.triangles,uvs:new Float32Array(s.uvs.length),color:new V(1,1,1,1),darkColor:new V(0,0,0,0),darkTint:this.darkTint,skipRender:!1,texture:s.region?.texture.texture}),this.attachmentCacheData[t.data.index][s.name]}onViewUpdate(){if(this._didViewChangeTick++,this._boundsProvider||(this._boundsDirty=!0),this.didViewUpdate)return;this.didViewUpdate=!0;const t=this.renderGroup||this.parentRenderGroup;t&&t.onChildViewUpdate(this),this.debug?.renderDebug(this)}addSlotObject(t,s,i){t=this.getSlotFromRef(t);for(const l in this._slotsObject)this._slotsObject[l]?.container===s&&this.removeSlotObject(this._slotsObject[l].slot);this.removeSlotObject(t),s.includeInBuild=!1,this.addChild(s);const r={container:s,slot:t,followAttachmentTimeline:i?.followAttachmentTimeline||!1};this._slotsObject[t.data.name]=r,this.updateSlotObject(r)}removeSlotObject(t){let s;if(t instanceof Oi){for(const i in this._slotsObject)if(this._slotsObject[i]?.container===t){this._slotsObject[i]=null,s=t;break}}else{const i=this.getSlotFromRef(t);s=this._slotsObject[i.data.name]?.container,this._slotsObject[i.data.name]=null}s&&(this.removeChild(s),s.includeInBuild=!0)}removeSlotObjects(){Object.entries(this._slotsObject).forEach(([t,s])=>{s&&s.container.removeFromParent(),delete this._slotsObject[t]})}getSlotObject(t){return t=this.getSlotFromRef(t),this._slotsObject[t.data.name]?.container}updateBounds(){this._boundsDirty=!1,this.skeletonBounds||=new rs;const t=this.skeletonBounds;if(t.update(this.skeleton,!0),this._boundsProvider){const s=this._boundsProvider.calculateBounds(this),i=this._bounds;i.clear(),i.x=s.x,i.y=s.y,i.width=s.width,i.height=s.height}else if(t.minX===1/0){this.hasNeverUpdated&&(this._updateAndApplyState(0),this._boundsDirty=!1),this._validateAndTransformAttachments();const s=this.skeleton.drawOrder,i=this._bounds;i.clear();for(let r=0;r<s.length;r++){const l=s[r],o=l.getAttachment();if(o&&(o instanceof nt||o instanceof ct)){const n=this._getCachedData(l,o);i.addVertexData(n.vertices,0,n.vertices.length)}}}else this._bounds.minX=t.minX,this._bounds.minY=t.minY,this._bounds.maxX=t.maxX,this._bounds.maxY=t.maxY}addBounds(t){t.addBounds(this.bounds)}destroy(t=!1){super.destroy(t),Kt.shared.remove(this.internalUpdate,this),this.state.clearListeners(),this.debug=void 0,this.skeleton=null,this.state=null,this._slotsObject=null,this._lastAttachments.length=0,this.attachmentCacheData=null}skeletonToPixiWorldCoordinates(t){this.worldTransform.apply(t,t)}pixiWorldCoordinatesToSkeleton(t){this.worldTransform.applyInverse(t,t)}pixiWorldCoordinatesToBone(t,s){this.pixiWorldCoordinatesToSkeleton(t),s.parent?s.parent.worldToLocal(t):s.worldToLocal(t)}static from({skeleton:t,atlas:s,scale:i=1,darkTint:r,autoUpdate:l=!0,boundsProvider:o}){const n=`${t}-${s}-${i}`;if(hs.has(n))return new ms({skeletonData:hs.get(n),darkTint:r,autoUpdate:l,boundsProvider:o});const a=er.get(t),h=er.get(s),c=new Ls(h),f=a instanceof Uint8Array?new zs(c):new $s(c);f.scale=i;const d=f.readSkeletonData(a);return hs.set(n,d),new ms({skeletonData:d,darkTint:r,autoUpdate:l,boundsProvider:o})}};import{Container as cs,Graphics as ot,Text as ji}from"pixi.js";var Ji=class{registeredSpines=new Map;drawMeshHull=!0;drawMeshTriangles=!0;drawBones=!0;drawPaths=!0;drawBoundingBoxes=!0;drawClipping=!0;drawRegionAttachments=!0;drawEvents=!0;lineWidth=1;regionAttachmentsColor=30975;meshHullColor=30975;meshTrianglesColor=16763904;clippingPolygonColor=16711935;boundingBoxesRectColor=65280;boundingBoxesPolygonColor=65280;boundingBoxesCircleColor=65280;pathsCurveColor=16711680;pathsLineColor=16711935;skeletonXYColor=16711680;bonesColor=61132;eventFontSize=24;eventFontColor=0;registerSpine(e){if(this.registeredSpines.has(e)){console.warn("SpineDebugRenderer.registerSpine() - this spine is already registered!",e);return}const t={parentDebugContainer:new cs,bones:new cs,skeletonXY:new ot,regionAttachmentsShape:new ot,meshTrianglesLine:new ot,meshHullLine:new ot,clippingPolygon:new ot,boundingBoxesRect:new ot,boundingBoxesCircle:new ot,boundingBoxesPolygon:new ot,pathsCurve:new ot,pathsLine:new ot,eventText:new cs,eventCallback:{event:(s,i)=>{if(this.drawEvents){const r=Math.abs(e.scale.x||e.scale.y||1),l=new ji({text:i.data.name,style:{fontSize:this.eventFontSize/r,fill:this.eventFontColor,fontFamily:"monospace"}});l.scale.x=Math.sign(e.scale.x),l.anchor.set(.5),t.eventText.addChild(l),setTimeout(()=>{l.destroyed||l.destroy()},250)}}}};t.parentDebugContainer.addChild(t.bones),t.parentDebugContainer.addChild(t.skeletonXY),t.parentDebugContainer.addChild(t.regionAttachmentsShape),t.parentDebugContainer.addChild(t.meshTrianglesLine),t.parentDebugContainer.addChild(t.meshHullLine),t.parentDebugContainer.addChild(t.clippingPolygon),t.parentDebugContainer.addChild(t.boundingBoxesRect),t.parentDebugContainer.addChild(t.boundingBoxesCircle),t.parentDebugContainer.addChild(t.boundingBoxesPolygon),t.parentDebugContainer.addChild(t.pathsCurve),t.parentDebugContainer.addChild(t.pathsLine),t.parentDebugContainer.addChild(t.eventText),t.parentDebugContainer.zIndex=9999999,t.parentDebugContainer.accessibleChildren=!1,t.parentDebugContainer.eventMode="none",t.parentDebugContainer.interactiveChildren=!1,e.addChild(t.parentDebugContainer),e.state.addListener(t.eventCallback),this.registeredSpines.set(e,t)}renderDebug(e){this.registeredSpines.has(e)||this.registerSpine(e);const t=this.registeredSpines.get(e);if(!t)return;e.addChild(t.parentDebugContainer),t.skeletonXY.clear(),t.regionAttachmentsShape.clear(),t.meshTrianglesLine.clear(),t.meshHullLine.clear(),t.clippingPolygon.clear(),t.boundingBoxesRect.clear(),t.boundingBoxesCircle.clear(),t.boundingBoxesPolygon.clear(),t.pathsCurve.clear(),t.pathsLine.clear();for(let r=t.bones.children.length;r>0;r--)t.bones.children[r-1].destroy({children:!0,texture:!0,textureSource:!0});const s=Math.abs(e.scale.x||e.scale.y||1),i=this.lineWidth/s;if(this.drawBones&&this.drawBonesFunc(e,t,i,s),this.drawPaths&&this.drawPathsFunc(e,t,i),this.drawBoundingBoxes&&this.drawBoundingBoxesFunc(e,t,i),this.drawClipping&&this.drawClippingFunc(e,t,i),(this.drawMeshHull||this.drawMeshTriangles)&&this.drawMeshHullAndMeshTriangles(e,t,i),this.drawRegionAttachments&&this.drawRegionAttachmentsFunc(e,t,i),this.drawEvents)for(const r of t.eventText.children)r.alpha-=.05,r.y-=2}drawBonesFunc(e,t,s,i){const r=e.skeleton,l=r.x,o=r.y,n=r.bones;t.skeletonXY.strokeStyle={width:s,color:this.skeletonXYColor};for(let h=0,c=n.length;h<c;h++){const f=n[h],d=f.data.length,m=l+f.worldX,u=o+f.worldY,p=l+d*f.a+f.worldX,b=o+d*f.b+f.worldY;if(f.data.name==="root"||f.data.parent===null)continue;const w=Math.abs(m-p),g=Math.abs(u-b),x=Math.pow(w,2),y=g,v=Math.pow(g,2),C=Math.sqrt(x+v),A=Math.pow(C,2),k=Math.PI/180,T=Math.acos((A+v-x)/(2*y*C))||0;if(C===0)continue;const Y=new ot;t.bones.addChild(Y);const M=C/50/i;Y.context.poly([0,0,0-M,C-M*3,0,C-M,0+M,C-M*3]).fill(this.bonesColor),Y.x=m,Y.y=u,Y.pivot.y=C;let F=0;m<p&&u<b?F=-T+180*k:m>p&&u<b?F=180*k+T:m>p&&u>b?F=-T:m<p&&u>b?F=T:u===b&&m<p?F=90*k:u===b&&m>p?F=-90*k:m===p&&u<b?F=180*k:m===p&&u>b&&(F=0),Y.rotation=F,Y.circle(0,C,M*1.2).fill({color:0,alpha:.6}).stroke({width:s+M/2.4,color:this.bonesColor})}const a=s*3;t.skeletonXY.context.moveTo(l-a,o-a).lineTo(l+a,o+a).moveTo(l+a,o-a).lineTo(l-a,o+a).stroke()}drawRegionAttachmentsFunc(e,t,s){const r=e.skeleton.slots;for(let l=0,o=r.length;l<o;l++){const n=r[l],a=n.getAttachment();if(a===null||!(a instanceof nt))continue;const h=a,c=new Float32Array(8);h.computeWorldVertices(n,c,0,2),t.regionAttachmentsShape.poly(Array.from(c.slice(0,8)))}t.regionAttachmentsShape.stroke({color:this.regionAttachmentsColor,width:s})}drawMeshHullAndMeshTriangles(e,t,s){const r=e.skeleton.slots;for(let l=0,o=r.length;l<o;l++){const n=r[l];if(!n.bone.active)continue;const a=n.getAttachment();if(a===null||!(a instanceof ct))continue;const h=a,c=new Float32Array(h.worldVerticesLength),f=h.triangles;let d=h.hullLength;if(h.computeWorldVertices(n,0,h.worldVerticesLength,c,0,2),this.drawMeshTriangles)for(let m=0,u=f.length;m<u;m+=3){const p=f[m]*2,b=f[m+1]*2,w=f[m+2]*2;t.meshTrianglesLine.context.moveTo(c[p],c[p+1]).lineTo(c[b],c[b+1]).lineTo(c[w],c[w+1])}if(this.drawMeshHull&&d>0){d=(d>>1)*2;let m=c[d-2],u=c[d-1];for(let p=0,b=d;p<b;p+=2){const w=c[p],g=c[p+1];t.meshHullLine.context.moveTo(w,g).lineTo(m,u),m=w,u=g}}}t.meshHullLine.stroke({width:s,color:this.meshHullColor}),t.meshTrianglesLine.stroke({width:s,color:this.meshTrianglesColor})}drawClippingFunc(e,t,s){const r=e.skeleton.slots;for(let l=0,o=r.length;l<o;l++){const n=r[l];if(!n.bone.active)continue;const a=n.getAttachment();if(a===null||!(a instanceof bt))continue;const h=a,c=h.worldVerticesLength,f=new Float32Array(c);h.computeWorldVertices(n,0,c,f,0,2),t.clippingPolygon.poly(Array.from(f))}t.clippingPolygon.stroke({width:s,color:this.clippingPolygonColor,alpha:1})}drawBoundingBoxesFunc(e,t,s){const i=new rs;i.update(e.skeleton,!0),i.minX!==1/0&&t.boundingBoxesRect.rect(i.minX,i.minY,i.getWidth(),i.getHeight()).stroke({width:s,color:this.boundingBoxesRectColor});const r=i.polygons,l=(o,n,a)=>{if(a<3)throw new Error("Polygon must contain at least 3 vertices");const h=[],c=s*2;for(let f=0,d=o.length;f<d;f+=2){const m=o[f],u=o[f+1];t.boundingBoxesCircle.beginFill(this.boundingBoxesCircleColor),t.boundingBoxesCircle.drawCircle(m,u,c),t.boundingBoxesCircle.fill(0),t.boundingBoxesCircle.circle(m,u,c).fill({color:this.boundingBoxesCircleColor}),h.push(m,u)}t.boundingBoxesPolygon.poly(h).fill({color:this.boundingBoxesPolygonColor,alpha:.1}).stroke({width:s,color:this.boundingBoxesPolygonColor})};for(let o=0,n=r.length;o<n;o++){const a=r[o];l(a,0,a.length)}}drawPathsFunc(e,t,s){const r=e.skeleton.slots;for(let l=0,o=r.length;l<o;l++){const n=r[l];if(!n.bone.active)continue;const a=n.getAttachment();if(a===null||!(a instanceof St))continue;const h=a;let c=h.worldVerticesLength;const f=new Float32Array(c);h.computeWorldVertices(n,0,c,f,0,2);let d=f[2],m=f[3],u=0,p=0;if(h.closed){const b=f[0],w=f[1],g=f[c-2],x=f[c-1];u=f[c-4],p=f[c-3],t.pathsCurve.moveTo(d,m),t.pathsCurve.bezierCurveTo(b,w,g,x,u,p),t.pathsLine.moveTo(d,m),t.pathsLine.lineTo(b,w),t.pathsLine.moveTo(u,p),t.pathsLine.lineTo(g,x)}c-=4;for(let b=4;b<c;b+=6){const w=f[b],g=f[b+1],x=f[b+2],y=f[b+3];u=f[b+4],p=f[b+5],t.pathsCurve.moveTo(d,m),t.pathsCurve.bezierCurveTo(w,g,x,y,u,p),t.pathsLine.moveTo(d,m),t.pathsLine.lineTo(w,g),t.pathsLine.moveTo(u,p),t.pathsLine.lineTo(x,y),d=u,m=p}}t.pathsCurve.stroke({width:s,color:this.pathsCurveColor}),t.pathsLine.stroke({width:s,color:this.pathsLineColor})}unregisterSpine(e){this.registeredSpines.has(e)||console.warn("SpineDebugRenderer.unregisterSpine() - spine is not registered, can't unregister!",e);const t=this.registeredSpines.get(e);t&&(e.state.removeListener(t.eventCallback),t.parentDebugContainer.destroy({textureSource:!0,children:!0,texture:!0}),this.registeredSpines.delete(e))}};export{zi as AABBRectangleBoundsProvider,be as AlphaTimeline,Ot as Animation,Le as AnimationState,br as AnimationStateAdapter,Fs as AnimationStateData,Ds as AssetCache,vr as AssetManagerBase,Ls as AtlasAttachmentLoader,ne as Attachment,xt as AttachmentTimeline,Gs as BinaryInput,ts as BlendMode,We as Bone,qe as BoneData,Oe as BoundingBoxAttachment,Xs as CURRENT,bt as ClippingAttachment,V as Color,Pt as ConstraintData,it as CurveTimeline,st as CurveTimeline1,_t as CurveTimeline2,gr as DebugUtils,ve as DeformTimeline,Vs as Downloader,At as DrawOrderTimeline,ze as Event,Ge as EventData,Is as EventQueue,Ut as EventTimeline,Ms as EventType,De as FIRST,wr as FakeTexture,Wt as HOLD_FIRST,Ys as HOLD_MIX,Ve as HOLD_SUBSEQUENT,Ns as IkConstraint,He as IkConstraintData,Ce as IkConstraintTimeline,Ht as Inherit,ge as InheritTimeline,ur as IntSet,ws as Interpolation,B as MathUtils,ct as MeshAttachment,Ss as MixBlend,ks as MixDirection,St as PathAttachment,Os as PathConstraint,$e as PathConstraintData,Te as PathConstraintMixTimeline,Se as PathConstraintPositionTimeline,ke as PathConstraintSpacingTimeline,qs as Physics,Ye as PhysicsConstraintDampingTimeline,Pe as PhysicsConstraintGravityTimeline,Ie as PhysicsConstraintInertiaTimeline,Xe as PhysicsConstraintMassTimeline,Be as PhysicsConstraintMixTimeline,Ee as PhysicsConstraintResetTimeline,Me as PhysicsConstraintStrengthTimeline,mt as PhysicsConstraintTimeline,Fe as PhysicsConstraintWindTimeline,Rs as PointAttachment,Ct as Pool,je as PositionMode,ys as Pow,mr as PowOut,ye as RGB2Timeline,we as RGBA2Timeline,pe as RGBATimeline,xe as RGBTimeline,nt as RegionAttachment,Ke as RotateMode,Ft as RotateTimeline,Ne as SETUP,qt as SUBSEQUENT,he as ScaleTimeline,ce as ScaleXTimeline,de as ScaleYTimeline,Re as SequenceTimeline,Gi as SetupPoseBoundsProvider,fe as ShearTimeline,ue as ShearXTimeline,me as ShearYTimeline,kt as Skeleton,zs as SkeletonBinary,rs as SkeletonBounds,$t as SkeletonClipping,Bt as SkeletonData,$s as SkeletonJson,Et as Skin,Qe as SkinEntry,Hi as SkinsAndAnimationBoundsProvider,_s as Slot,Ze as SlotData,Je as SpacingMode,$i as Spine,Ji as SpineDebugRenderer,tr as SpinePipe,as as SpineTexture,ie as StringSet,_e as Texture,Gt as TextureAtlas,Es as TextureAtlasPage,Ue as TextureAtlasRegion,zt as TextureFilter,Bs as TextureRegion,Ps as TextureWrap,pr as TimeKeeper,$ as Timeline,Ts as TrackEntry,Us as TransformConstraint,es as TransformConstraintData,Ae as TransformConstraintTimeline,ae as TranslateTimeline,oe as TranslateXTimeline,le as TranslateYTimeline,Hs as Triangulator,E as Utils,Xt as Vector2,ht as VertexAttachment,xr as WindowedMean};
27
+ `}},Ri=class extends Pi{constructor(e){const t=ki({name:"dark-tint-batch",bits:[Si,Ei,Mi(e),Fi]}),s=Ti({name:"dark-tint-batch",bits:[Ai,Bi,Ii(e),Xi]});super({glProgram:t,gpuProgram:s,resources:{batchSamplers:Yi(e)}})}},Zs=null,Li=class fr extends gi{static extension={type:[bi.Batcher],name:"darkTint"};geometry=new Ci;shader=Zs||(Zs=new Ri(this.maxTextures));name=fr.extension.name;vertexSize=7;packAttributes(t,s,i,r,l){const o=l<<16|t.roundPixels&65535,n=t.transform,a=n.a,h=n.b,c=n.c,f=n.d,d=n.tx,m=n.ty,{positions:u,uvs:p}=t,b=t.color,w=(b>>24&255)/255,g=pi.shared.setValue(t.darkColor).premultiply(w,!0).toPremultiplied(1,!1),x=t.attributeOffset,y=x+t.attributeSize;for(let v=x;v<y;v++){const C=v*2,A=u[C],k=u[C+1];s[r++]=a*A+c*k+d,s[r++]=f*k+h*A+m,s[r++]=p[C],s[r++]=p[C+1],i[r++]=b,i[r++]=g,i[r++]=o}}packQuadAttributes(t,s,i,r,l){const o=t.texture,n=t.transform,a=n.a,h=n.b,c=n.c,f=n.d,d=n.tx,m=n.ty,u=t.bounds,p=u.maxX,b=u.minX,w=u.maxY,g=u.minY,x=o.uvs,y=t.color,v=t.darkColor,C=l<<16|t.roundPixels&65535;s[r+0]=a*b+c*g+d,s[r+1]=f*g+h*b+m,s[r+2]=x.x0,s[r+3]=x.y0,i[r+4]=y,i[r+5]=v,i[r+6]=C,s[r+7]=a*p+c*g+d,s[r+8]=f*g+h*p+m,s[r+9]=x.x1,s[r+10]=x.y1,i[r+11]=y,i[r+12]=v,i[r+13]=C,s[r+14]=a*p+c*w+d,s[r+15]=f*w+h*p+m,s[r+16]=x.x2,s[r+17]=x.y2,i[r+18]=y,i[r+19]=v,i[r+20]=C,s[r+21]=a*b+c*w+d,s[r+22]=f*w+h*b+m,s[r+23]=x.x3,s[r+24]=x.y3,i[r+25]=y,i[r+26]=v,i[r+27]=C}};xi.add(Li);import{ExtensionType as ls,extensions as Di}from"pixi.js";var Vi=class{indexOffset=0;attributeOffset=0;indexSize;attributeSize;batcherName="darkTint";topology="triangle-list";packAsQuad=!1;renderable;positions;indices;uvs;roundPixels;data;blendMode;darkTint;texture;transform;_textureId;_attributeStart;_indexStart;_batcher;_batch;get color(){const e=this.data.color,t=this.renderable.groupColor,s=this.renderable.groupAlpha;let i;const r=e.a*s*255;if(t!==16777215){const l=t>>16&255,o=t>>8&255,n=t&255,a=e.r*n,h=e.g*o,c=e.b*l;i=r<<24|c<<16|h<<8|a}else i=r<<24|e.b*255<<16|e.g*255<<8|e.r*255;return i}get darkColor(){const e=this.data.darkColor;return e.b*255<<16|e.g*255<<8|e.r*255}get groupTransform(){return this.renderable.groupTransform}setData(e,t,s,i){if(this.renderable=e,this.transform=e.groupTransform,this.data=t,t.clipped){const r=t.clippedData;this.indexSize=r.indicesCount,this.attributeSize=r.vertexCount,this.positions=r.vertices,this.indices=r.indices,this.uvs=r.uvs}else this.indexSize=t.indices.length,this.attributeSize=t.vertices.length/2,this.positions=t.vertices,this.indices=t.indices,this.uvs=t.uvs;this.texture=t.texture,this.roundPixels=i,this.blendMode=s,this.batcherName=t.darkTint?"darkTint":"default"}},Ni={0:"normal",1:"add",2:"multiply",3:"screen"},tr=class{static extension={type:[ls.WebGLPipes,ls.WebGPUPipes,ls.CanvasPipes],name:"spine"};renderer;gpuSpineData={};_destroyRenderableBound=this.destroyRenderable.bind(this);constructor(e){this.renderer=e}validateRenderable(e){if(e._validateAndTransformAttachments(),e.spineAttachmentsDirty)return!0;if(e.spineTexturesDirty){const t=e.skeleton.drawOrder,s=this.gpuSpineData[e.uid];for(let i=0,r=t.length;i<r;i++){const l=t[i],o=l.getAttachment();if(o instanceof nt||o instanceof ct){const n=e._getCachedData(l,o),a=s.slotBatches[n.id],h=n.texture;if(h!==a.texture&&!a._batcher.checkAndUpdateTexture(a,h))return!0}}}return!1}addRenderable(e,t){const s=this._getSpineData(e),i=this.renderer.renderPipes.batch,r=e.skeleton.drawOrder,l=this.renderer._roundPixels|e._roundPixels;e._validateAndTransformAttachments(),e.spineAttachmentsDirty=!1,e.spineTexturesDirty=!1;for(let o=0,n=r.length;o<n;o++){const a=r[o],h=a.getAttachment(),c=Ni[a.data.blendMode];let f=!1;if(h instanceof nt||h instanceof ct){const m=e._getCachedData(a,h),u=s.slotBatches[m.id]||=new Vi;u.setData(e,m,c,l),f=m.skipRender,f||i.addToBatch(u,t)}const d=e._slotsObject[a.data.name];if(d){const m=d.container;f||(m.includeInBuild=!0,m.collectRenderables(t,this.renderer,null)),m.includeInBuild=!1}}}updateRenderable(e){const t=this.gpuSpineData[e.uid];e._validateAndTransformAttachments(),e.spineAttachmentsDirty=!1,e.spineTexturesDirty=!1;const s=e.skeleton.drawOrder;for(let i=0,r=s.length;i<r;i++){const l=s[i],o=l.getAttachment();if((o instanceof nt||o instanceof ct)&&!e._getCachedData(l,o).skipRender){const a=t.slotBatches[e._getCachedData(l,o).id];a._batcher?.updateElement(a)}}}destroyRenderable(e){this.gpuSpineData[e.uid]=null,e.off("destroyed",this._destroyRenderableBound)}destroy(){this.gpuSpineData=null,this.renderer=null}_getSpineData(e){return this.gpuSpineData[e.uid]||this._initMeshData(e)}_initMeshData(e){return this.gpuSpineData[e.uid]={slotBatches:{}},e.on("destroyed",this._destroyRenderableBound),this.gpuSpineData[e.uid]}};Di.add(tr);import{Assets as er,Cache as hs,Container as Oi,fastCopy as _i,Graphics as Ui,Texture as qi,Ticker as Kt,ViewContainer as Wi}from"pixi.js";var Qt=new Xt;kt.yDown=!0;var Tt=new $t,zi=class{constructor(e,t,s,i){this.x=e,this.y=t,this.width=s,this.height=i}calculateBounds(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},Gi=class{constructor(e=!1){this.clipping=e}calculateBounds(e){if(!e.skeleton)return{x:0,y:0,width:0,height:0};const t=new kt(e.skeleton.data);t.setToSetupPose(),t.updateWorldTransform(2);const s=t.getBoundsRect(this.clipping?new $t:void 0);return s.width==Number.NEGATIVE_INFINITY?{x:0,y:0,width:0,height:0}:s}},Hi=class{constructor(e,t=[],s=.05,i=!1){this.animation=e,this.skins=t,this.timeStep=s,this.clipping=i}calculateBounds(e){if(!e.skeleton||!e.state)return{x:0,y:0,width:0,height:0};const t=new Le(e.state.data),s=new kt(e.skeleton.data),i=this.clipping?new $t:void 0,r=s.data;if(this.skins.length>0){let o=new Et("custom-skin");for(const n of this.skins){const a=r.findSkin(n);a!=null&&o.addSkin(a)}s.setSkin(o)}s.setToSetupPose();const l=this.animation!=null?r.findAnimation(this.animation):null;if(l==null){s.updateWorldTransform(2);const o=s.getBoundsRect(i);return o.width==Number.NEGATIVE_INFINITY?{x:0,y:0,width:0,height:0}:o}else{let o=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,h=Number.NEGATIVE_INFINITY;t.clearTracks(),t.setAnimationWith(0,l,!1);const c=Math.max(l.duration/this.timeStep,1);for(let d=0;d<c;d++){const m=d>0?this.timeStep:0;t.update(m),t.apply(s),s.update(m),s.updateWorldTransform(2);const u=s.getBoundsRect(i);o=Math.min(o,u.x),n=Math.min(n,u.y),a=Math.max(a,u.x+u.width),h=Math.max(h,u.y+u.height)}const f={x:o,y:n,width:a-o,height:h-n};return f.width==Number.NEGATIVE_INFINITY?{x:0,y:0,width:0,height:0}:f}}},sr=new Ct(()=>new Ui),$i=class ms extends Wi{batched=!0;buildId=0;renderPipeId="spine";_didSpineUpdate=!1;beforeUpdateWorldTransforms=()=>{};afterUpdateWorldTransforms=()=>{};skeleton;state;skeletonBounds;darkTint=!1;_debug=void 0;_slotsObject=Object.create(null);clippingSlotToPixiMasks=Object.create(null);getSlotFromRef(t){let s;if(typeof t=="number"?s=this.skeleton.slots[t]:typeof t=="string"?s=this.skeleton.findSlot(t):s=t,!s)throw new Error(`No slot found with the given slot reference: ${t}`);return s}spineAttachmentsDirty=!0;spineTexturesDirty=!0;_lastAttachments=[];_stateChanged=!0;attachmentCacheData=[];get debug(){return this._debug}set debug(t){this._debug&&this._debug.unregisterSpine(this),t&&t.registerSpine(this),this._debug=t}_autoUpdate=!1;get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t&&!this._autoUpdate?Kt.shared.add(this.internalUpdate,this):!t&&this._autoUpdate&&Kt.shared.remove(this.internalUpdate,this),this._autoUpdate=t}_boundsProvider;get boundsProvider(){return this._boundsProvider}set boundsProvider(t){this._boundsProvider=t,t&&(this._boundsDirty=!1),this.updateBounds()}hasNeverUpdated=!0;constructor(t){t instanceof Bt&&(t={skeletonData:t}),super({}),this.allowChildren=!0;const s=t instanceof Bt?t:t.skeletonData;this.skeleton=new kt(s),this.state=new Le(new Fs(s)),this.autoUpdate=t?.autoUpdate??!0,this.darkTint=t?.darkTint===void 0?this.skeleton.slots.some(r=>!!r.data.darkColor):t?.darkTint;const i=this.skeleton.slots;for(let r=0;r<i.length;r++)this.attachmentCacheData[r]=Object.create(null);this._boundsProvider=t.boundsProvider}update(t){this.internalUpdate(0,t)}internalUpdate(t,s){this._updateAndApplyState(s??Kt.shared.deltaMS/1e3)}get bounds(){return this._boundsDirty&&this.updateBounds(),this._bounds}setBonePosition(t,s){const i=t;if(typeof t=="string"&&(t=this.skeleton.findBone(t)),!t)throw Error(`Cant set bone position, bone ${String(i)} not found`);if(Qt.set(s.x,s.y),t.parent){const r=t.parent.worldToLocal(Qt);t.x=r.x,t.y=-r.y}else t.x=Qt.x,t.y=Qt.y}getBonePosition(t,s){const i=t;return typeof t=="string"&&(t=this.skeleton.findBone(t)),t?(s||(s={x:0,y:0}),s.x=t.worldX,s.y=t.worldY,s):(console.error(`Cant set bone position! Bone ${String(i)} not found`),s)}_updateAndApplyState(t){this.hasNeverUpdated=!1,this.state.update(t),this.skeleton.update(t);const{skeleton:s}=this;this.state.apply(s),this.beforeUpdateWorldTransforms(this),s.updateWorldTransform(2),this.afterUpdateWorldTransforms(this),this.updateSlotObjects(),this._stateChanged=!0,this.onViewUpdate()}_validateAndTransformAttachments(){this._stateChanged&&(this._stateChanged=!1,this.validateAttachments(),this.transformAttachments())}validateAttachments(){const t=this.skeleton.drawOrder,s=this._lastAttachments;let i=0,r=!1;for(let l=0;l<t.length;l++){const n=t[l].getAttachment();n&&(n!==s[i]&&(r=!0,s[i]=n),i++)}i!==s.length&&(r=!0,s.length=i),this.spineAttachmentsDirty||=r}currentClippingSlot;updateAndSetPixiMask(t,s){const i=t.attachment;if(i&&i instanceof bt){const o=this.clippingSlotToPixiMasks[t.data.name]||={slot:t,vertices:new Array};o.maskComputed=!1,this.currentClippingSlot=o;return}let r=this.currentClippingSlot,l=this._slotsObject[t.data.name];if(r&&l){let o=r.mask;if(o||(o=sr.obtain(),r.mask=o,this.addChild(o)),!r.maskComputed){let n=r.slot,a=n.attachment;r.maskComputed=!0;const h=a.worldVerticesLength,c=r.vertices;a.computeWorldVertices(n,0,h,c,0,2),o.clear().poly(c).stroke({width:0}).fill({alpha:.25})}l.container.mask=o}else l?.container.mask&&(l.container.mask=null);if(r&&r.slot.attachment.endSlot==t.data&&(this.currentClippingSlot=void 0),s){for(const o in this.clippingSlotToPixiMasks){const n=this.clippingSlotToPixiMasks[o];(!(n.slot.attachment instanceof bt)||!n.maskComputed)&&n.mask&&(this.removeChild(n.mask),sr.free(n.mask),n.mask=void 0)}this.currentClippingSlot=void 0}}transformAttachments(){const t=this.skeleton.drawOrder;for(let s=0;s<t.length;s++){const i=t[s];this.updateAndSetPixiMask(i,s===t.length-1);const r=i.getAttachment();if(r){if(r instanceof ct||r instanceof nt){const l=this._getCachedData(i,r);r instanceof nt?r.computeWorldVertices(i,l.vertices,0,2):r.computeWorldVertices(i,0,r.worldVerticesLength,l.vertices,0,2),l.uvs.length<r.uvs.length&&(l.uvs=new Float32Array(r.uvs.length)),_i(r.uvs.buffer,l.uvs.buffer);const n=i.bone.skeleton.color,a=i.color,h=r.color,c=n.a*a.a*h.a;if(l.color.set(n.r*a.r*h.r,n.g*a.g*h.g,n.b*a.b*h.b,c),this.alpha===0||c===0)l.skipRender||(this.spineAttachmentsDirty=!0),l.skipRender=!0;else{l.skipRender&&(this.spineAttachmentsDirty=!0),l.skipRender=l.clipped=!1,i.darkColor&&l.darkColor.setFromColor(i.darkColor);const f=r.region?.texture.texture||qi.EMPTY;l.texture!==f&&(l.texture=f,this.spineTexturesDirty=!0),Tt.isClipping()&&this.updateClippingData(l)}}else if(r instanceof bt){Tt.clipStart(i,r);continue}}Tt.clipEndWithSlot(i)}Tt.clipEnd()}updateClippingData(t){t.clipped=!0,Tt.clipTrianglesUnpacked(t.vertices,t.indices,t.indices.length,t.uvs);const{clippedVertices:s,clippedUVs:i,clippedTriangles:r}=Tt,l=s.length/2,o=r.length;t.clippedData||(t.clippedData={vertices:new Float32Array(l*2),uvs:new Float32Array(l*2),vertexCount:l,indices:new Uint16Array(o),indicesCount:o},this.spineAttachmentsDirty=!0);const n=t.clippedData,a=n.vertexCount!==l||o!==n.indicesCount;t.skipRender=l===0,a&&(this.spineAttachmentsDirty=!0,n.vertexCount<l&&(n.vertices=new Float32Array(l*2),n.uvs=new Float32Array(l*2)),n.indices.length<o&&(n.indices=new Uint16Array(o)));const{vertices:h,uvs:c,indices:f}=n;for(let d=0;d<l;d++)h[d*2]=s[d*2],h[d*2+1]=s[d*2+1],c[d*2]=i[d*2],c[d*2+1]=i[d*2+1];n.vertexCount=l;for(let d=0;d<o;d++)f[d]!==r[d]&&(this.spineAttachmentsDirty=!0,f[d]=r[d]);n.indicesCount=o}updateSlotObjects(){for(const t in this._slotsObject){const s=this._slotsObject[t];s&&this.updateSlotObject(s)}}updateSlotObject(t){const{slot:s,container:i}=t,r=t.followAttachmentTimeline?!!s.attachment:!0;if(i.visible=this.skeleton.drawOrder.includes(s)&&r,i.visible){let l=s.bone;i.position.set(l.worldX,l.worldY),i.angle=l.getWorldRotationX();let o=1,n=1;for(;l;)o*=l.scaleX,n*=l.scaleY,l=l.parent;o<0&&(i.angle-=180),i.scale.set(s.bone.getWorldScaleX()*Math.sign(o),s.bone.getWorldScaleY()*Math.sign(n)),i.alpha=this.skeleton.color.a*s.color.a}}_getCachedData(t,s){return this.attachmentCacheData[t.data.index][s.name]||this.initCachedData(t,s)}initCachedData(t,s){let i;return s instanceof nt?(i=new Float32Array(8),this.attachmentCacheData[t.data.index][s.name]={id:`${t.data.index}-${s.name}`,vertices:i,clipped:!1,indices:[0,1,2,0,2,3],uvs:new Float32Array(s.uvs.length),color:new V(1,1,1,1),darkColor:new V(0,0,0,0),darkTint:this.darkTint,skipRender:!1,texture:s.region?.texture.texture}):(i=new Float32Array(s.worldVerticesLength),this.attachmentCacheData[t.data.index][s.name]={id:`${t.data.index}-${s.name}`,vertices:i,clipped:!1,indices:s.triangles,uvs:new Float32Array(s.uvs.length),color:new V(1,1,1,1),darkColor:new V(0,0,0,0),darkTint:this.darkTint,skipRender:!1,texture:s.region?.texture.texture}),this.attachmentCacheData[t.data.index][s.name]}onViewUpdate(){if(this._didViewChangeTick++,this._boundsProvider||(this._boundsDirty=!0),this.didViewUpdate)return;this.didViewUpdate=!0;const t=this.renderGroup||this.parentRenderGroup;t&&t.onChildViewUpdate(this),this.debug?.renderDebug(this)}addSlotObject(t,s,i){t=this.getSlotFromRef(t);for(const l in this._slotsObject)this._slotsObject[l]?.container===s&&this.removeSlotObject(this._slotsObject[l].slot);this.removeSlotObject(t),s.includeInBuild=!1,this.addChild(s);const r={container:s,slot:t,followAttachmentTimeline:i?.followAttachmentTimeline||!1};this._slotsObject[t.data.name]=r,this.updateSlotObject(r)}removeSlotObject(t){let s;if(t instanceof Oi){for(const i in this._slotsObject)if(this._slotsObject[i]?.container===t){this._slotsObject[i]=null,s=t;break}}else{const i=this.getSlotFromRef(t);s=this._slotsObject[i.data.name]?.container,this._slotsObject[i.data.name]=null}s&&(this.removeChild(s),s.includeInBuild=!0)}removeSlotObjects(){Object.entries(this._slotsObject).forEach(([t,s])=>{s&&s.container.removeFromParent(),delete this._slotsObject[t]})}getSlotObject(t){return t=this.getSlotFromRef(t),this._slotsObject[t.data.name]?.container}updateBounds(){this._boundsDirty=!1,this.skeletonBounds||=new rs;const t=this.skeletonBounds;if(t.update(this.skeleton,!0),this._boundsProvider){const s=this._boundsProvider.calculateBounds(this),i=this._bounds;i.clear(),i.x=s.x,i.y=s.y,i.width=s.width,i.height=s.height}else if(t.minX===1/0){this.hasNeverUpdated&&(this._updateAndApplyState(0),this._boundsDirty=!1),this._validateAndTransformAttachments();const s=this.skeleton.drawOrder,i=this._bounds;i.clear();for(let r=0;r<s.length;r++){const l=s[r],o=l.getAttachment();if(o&&(o instanceof nt||o instanceof ct)){const n=this._getCachedData(l,o);i.addVertexData(n.vertices,0,n.vertices.length)}}}else this._bounds.minX=t.minX,this._bounds.minY=t.minY,this._bounds.maxX=t.maxX,this._bounds.maxY=t.maxY}addBounds(t){t.addBounds(this.bounds)}destroy(t=!1){super.destroy(t),Kt.shared.remove(this.internalUpdate,this),this.state.clearListeners(),this.debug=void 0,this.skeleton=null,this.state=null,this._slotsObject=null,this._lastAttachments.length=0,this.attachmentCacheData=null}skeletonToPixiWorldCoordinates(t){this.worldTransform.apply(t,t)}pixiWorldCoordinatesToSkeleton(t){this.worldTransform.applyInverse(t,t)}pixiWorldCoordinatesToBone(t,s){this.pixiWorldCoordinatesToSkeleton(t),s.parent?s.parent.worldToLocal(t):s.worldToLocal(t)}static from({skeleton:t,atlas:s,scale:i=1,darkTint:r,autoUpdate:l=!0,boundsProvider:o}){const n=`${t}-${s}-${i}`;if(hs.has(n))return new ms({skeletonData:hs.get(n),darkTint:r,autoUpdate:l,boundsProvider:o});const a=er.get(t),h=er.get(s),c=new Ls(h),f=a instanceof Uint8Array?new zs(c):new $s(c);f.scale=i;const d=f.readSkeletonData(a);return hs.set(n,d),new ms({skeletonData:d,darkTint:r,autoUpdate:l,boundsProvider:o})}};import{Container as cs,Graphics as ot,Text as ji}from"pixi.js";var Ji=class{registeredSpines=new Map;drawMeshHull=!0;drawMeshTriangles=!0;drawBones=!0;drawPaths=!0;drawBoundingBoxes=!0;drawClipping=!0;drawRegionAttachments=!0;drawEvents=!0;lineWidth=1;regionAttachmentsColor=30975;meshHullColor=30975;meshTrianglesColor=16763904;clippingPolygonColor=16711935;boundingBoxesRectColor=65280;boundingBoxesPolygonColor=65280;boundingBoxesCircleColor=65280;pathsCurveColor=16711680;pathsLineColor=16711935;skeletonXYColor=16711680;bonesColor=61132;eventFontSize=24;eventFontColor=0;registerSpine(e){if(this.registeredSpines.has(e)){console.warn("SpineDebugRenderer.registerSpine() - this spine is already registered!",e);return}const t={parentDebugContainer:new cs,bones:new cs,skeletonXY:new ot,regionAttachmentsShape:new ot,meshTrianglesLine:new ot,meshHullLine:new ot,clippingPolygon:new ot,boundingBoxesRect:new ot,boundingBoxesCircle:new ot,boundingBoxesPolygon:new ot,pathsCurve:new ot,pathsLine:new ot,eventText:new cs,eventCallback:{event:(s,i)=>{if(this.drawEvents){const r=Math.abs(e.scale.x||e.scale.y||1),l=new ji({text:i.data.name,style:{fontSize:this.eventFontSize/r,fill:this.eventFontColor,fontFamily:"monospace"}});l.scale.x=Math.sign(e.scale.x),l.anchor.set(.5),t.eventText.addChild(l),setTimeout(()=>{l.destroyed||l.destroy()},250)}}}};t.parentDebugContainer.addChild(t.bones),t.parentDebugContainer.addChild(t.skeletonXY),t.parentDebugContainer.addChild(t.regionAttachmentsShape),t.parentDebugContainer.addChild(t.meshTrianglesLine),t.parentDebugContainer.addChild(t.meshHullLine),t.parentDebugContainer.addChild(t.clippingPolygon),t.parentDebugContainer.addChild(t.boundingBoxesRect),t.parentDebugContainer.addChild(t.boundingBoxesCircle),t.parentDebugContainer.addChild(t.boundingBoxesPolygon),t.parentDebugContainer.addChild(t.pathsCurve),t.parentDebugContainer.addChild(t.pathsLine),t.parentDebugContainer.addChild(t.eventText),t.parentDebugContainer.zIndex=9999999,t.parentDebugContainer.accessibleChildren=!1,t.parentDebugContainer.eventMode="none",t.parentDebugContainer.interactiveChildren=!1,e.addChild(t.parentDebugContainer),e.state.addListener(t.eventCallback),this.registeredSpines.set(e,t)}renderDebug(e){this.registeredSpines.has(e)||this.registerSpine(e);const t=this.registeredSpines.get(e);if(!t)return;e.addChild(t.parentDebugContainer),t.skeletonXY.clear(),t.regionAttachmentsShape.clear(),t.meshTrianglesLine.clear(),t.meshHullLine.clear(),t.clippingPolygon.clear(),t.boundingBoxesRect.clear(),t.boundingBoxesCircle.clear(),t.boundingBoxesPolygon.clear(),t.pathsCurve.clear(),t.pathsLine.clear();for(let r=t.bones.children.length;r>0;r--)t.bones.children[r-1].destroy({children:!0,texture:!0,textureSource:!0});const s=Math.abs(e.scale.x||e.scale.y||1),i=this.lineWidth/s;if(this.drawBones&&this.drawBonesFunc(e,t,i,s),this.drawPaths&&this.drawPathsFunc(e,t,i),this.drawBoundingBoxes&&this.drawBoundingBoxesFunc(e,t,i),this.drawClipping&&this.drawClippingFunc(e,t,i),(this.drawMeshHull||this.drawMeshTriangles)&&this.drawMeshHullAndMeshTriangles(e,t,i),this.drawRegionAttachments&&this.drawRegionAttachmentsFunc(e,t,i),this.drawEvents)for(const r of t.eventText.children)r.alpha-=.05,r.y-=2}drawBonesFunc(e,t,s,i){const r=e.skeleton,l=r.x,o=r.y,n=r.bones;t.skeletonXY.strokeStyle={width:s,color:this.skeletonXYColor};for(let h=0,c=n.length;h<c;h++){const f=n[h],d=f.data.length,m=l+f.worldX,u=o+f.worldY,p=l+d*f.a+f.worldX,b=o+d*f.b+f.worldY;if(f.data.name==="root"||f.data.parent===null)continue;const w=Math.abs(m-p),g=Math.abs(u-b),x=Math.pow(w,2),y=g,v=Math.pow(g,2),C=Math.sqrt(x+v),A=Math.pow(C,2),k=Math.PI/180,T=Math.acos((A+v-x)/(2*y*C))||0;if(C===0)continue;const Y=new ot;t.bones.addChild(Y);const M=C/50/i;Y.context.poly([0,0,0-M,C-M*3,0,C-M,0+M,C-M*3]).fill(this.bonesColor),Y.x=m,Y.y=u,Y.pivot.y=C;let F=0;m<p&&u<b?F=-T+180*k:m>p&&u<b?F=180*k+T:m>p&&u>b?F=-T:m<p&&u>b?F=T:u===b&&m<p?F=90*k:u===b&&m>p?F=-90*k:m===p&&u<b?F=180*k:m===p&&u>b&&(F=0),Y.rotation=F,Y.circle(0,C,M*1.2).fill({color:0,alpha:.6}).stroke({width:s+M/2.4,color:this.bonesColor})}const a=s*3;t.skeletonXY.context.moveTo(l-a,o-a).lineTo(l+a,o+a).moveTo(l+a,o-a).lineTo(l-a,o+a).stroke()}drawRegionAttachmentsFunc(e,t,s){const r=e.skeleton.slots;for(let l=0,o=r.length;l<o;l++){const n=r[l],a=n.getAttachment();if(a===null||!(a instanceof nt))continue;const h=a,c=new Float32Array(8);h.computeWorldVertices(n,c,0,2),t.regionAttachmentsShape.poly(Array.from(c.slice(0,8)))}t.regionAttachmentsShape.stroke({color:this.regionAttachmentsColor,width:s})}drawMeshHullAndMeshTriangles(e,t,s){const r=e.skeleton.slots;for(let l=0,o=r.length;l<o;l++){const n=r[l];if(!n.bone.active)continue;const a=n.getAttachment();if(a===null||!(a instanceof ct))continue;const h=a,c=new Float32Array(h.worldVerticesLength),f=h.triangles;let d=h.hullLength;if(h.computeWorldVertices(n,0,h.worldVerticesLength,c,0,2),this.drawMeshTriangles)for(let m=0,u=f.length;m<u;m+=3){const p=f[m]*2,b=f[m+1]*2,w=f[m+2]*2;t.meshTrianglesLine.context.moveTo(c[p],c[p+1]).lineTo(c[b],c[b+1]).lineTo(c[w],c[w+1])}if(this.drawMeshHull&&d>0){d=(d>>1)*2;let m=c[d-2],u=c[d-1];for(let p=0,b=d;p<b;p+=2){const w=c[p],g=c[p+1];t.meshHullLine.context.moveTo(w,g).lineTo(m,u),m=w,u=g}}}t.meshHullLine.stroke({width:s,color:this.meshHullColor}),t.meshTrianglesLine.stroke({width:s,color:this.meshTrianglesColor})}drawClippingFunc(e,t,s){const r=e.skeleton.slots;for(let l=0,o=r.length;l<o;l++){const n=r[l];if(!n.bone.active)continue;const a=n.getAttachment();if(a===null||!(a instanceof bt))continue;const h=a,c=h.worldVerticesLength,f=new Float32Array(c);h.computeWorldVertices(n,0,c,f,0,2),t.clippingPolygon.poly(Array.from(f))}t.clippingPolygon.stroke({width:s,color:this.clippingPolygonColor,alpha:1})}drawBoundingBoxesFunc(e,t,s){const i=new rs;i.update(e.skeleton,!0),i.minX!==1/0&&t.boundingBoxesRect.rect(i.minX,i.minY,i.getWidth(),i.getHeight()).stroke({width:s,color:this.boundingBoxesRectColor});const r=i.polygons,l=(o,n,a)=>{if(a<3)throw new Error("Polygon must contain at least 3 vertices");const h=[],c=s*2;for(let f=0,d=o.length;f<d;f+=2){const m=o[f],u=o[f+1];t.boundingBoxesCircle.beginFill(this.boundingBoxesCircleColor),t.boundingBoxesCircle.drawCircle(m,u,c),t.boundingBoxesCircle.fill(0),t.boundingBoxesCircle.circle(m,u,c).fill({color:this.boundingBoxesCircleColor}),h.push(m,u)}t.boundingBoxesPolygon.poly(h).fill({color:this.boundingBoxesPolygonColor,alpha:.1}).stroke({width:s,color:this.boundingBoxesPolygonColor})};for(let o=0,n=r.length;o<n;o++){const a=r[o];l(a,0,a.length)}}drawPathsFunc(e,t,s){const r=e.skeleton.slots;for(let l=0,o=r.length;l<o;l++){const n=r[l];if(!n.bone.active)continue;const a=n.getAttachment();if(a===null||!(a instanceof St))continue;const h=a;let c=h.worldVerticesLength;const f=new Float32Array(c);h.computeWorldVertices(n,0,c,f,0,2);let d=f[2],m=f[3],u=0,p=0;if(h.closed){const b=f[0],w=f[1],g=f[c-2],x=f[c-1];u=f[c-4],p=f[c-3],t.pathsCurve.moveTo(d,m),t.pathsCurve.bezierCurveTo(b,w,g,x,u,p),t.pathsLine.moveTo(d,m),t.pathsLine.lineTo(b,w),t.pathsLine.moveTo(u,p),t.pathsLine.lineTo(g,x)}c-=4;for(let b=4;b<c;b+=6){const w=f[b],g=f[b+1],x=f[b+2],y=f[b+3];u=f[b+4],p=f[b+5],t.pathsCurve.moveTo(d,m),t.pathsCurve.bezierCurveTo(w,g,x,y,u,p),t.pathsLine.moveTo(d,m),t.pathsLine.lineTo(w,g),t.pathsLine.moveTo(u,p),t.pathsLine.lineTo(x,y),d=u,m=p}}t.pathsCurve.stroke({width:s,color:this.pathsCurveColor}),t.pathsLine.stroke({width:s,color:this.pathsLineColor})}unregisterSpine(e){this.registeredSpines.has(e)||console.warn("SpineDebugRenderer.unregisterSpine() - spine is not registered, can't unregister!",e);const t=this.registeredSpines.get(e);t&&(e.state.removeListener(t.eventCallback),t.parentDebugContainer.destroy({textureSource:!0,children:!0,texture:!0}),this.registeredSpines.delete(e))}};export{zi as AABBRectangleBoundsProvider,be as AlphaTimeline,Ot as Animation,Le as AnimationState,br as AnimationStateAdapter,Fs as AnimationStateData,Ds as AssetCache,vr as AssetManagerBase,Ls as AtlasAttachmentLoader,ne as Attachment,xt as AttachmentTimeline,Gs as BinaryInput,ts as BlendMode,We as Bone,qe as BoneData,Oe as BoundingBoxAttachment,Xs as CURRENT,bt as ClippingAttachment,V as Color,Pt as ConstraintData,it as CurveTimeline,st as CurveTimeline1,_t as CurveTimeline2,gr as DebugUtils,ve as DeformTimeline,Vs as Downloader,At as DrawOrderTimeline,ze as Event,Ge as EventData,Is as EventQueue,Ut as EventTimeline,Ms as EventType,De as FIRST,wr as FakeTexture,Wt as HOLD_FIRST,Ys as HOLD_MIX,Ve as HOLD_SUBSEQUENT,Ns as IkConstraint,He as IkConstraintData,Ce as IkConstraintTimeline,Ht as Inherit,ge as InheritTimeline,ur as IntSet,ws as Interpolation,B as MathUtils,ct as MeshAttachment,Ss as MixBlend,ks as MixDirection,St as PathAttachment,Os as PathConstraint,$e as PathConstraintData,Te as PathConstraintMixTimeline,Se as PathConstraintPositionTimeline,ke as PathConstraintSpacingTimeline,qs as Physics,Ye as PhysicsConstraintDampingTimeline,Pe as PhysicsConstraintGravityTimeline,Ie as PhysicsConstraintInertiaTimeline,Xe as PhysicsConstraintMassTimeline,Be as PhysicsConstraintMixTimeline,Ee as PhysicsConstraintResetTimeline,Me as PhysicsConstraintStrengthTimeline,mt as PhysicsConstraintTimeline,Fe as PhysicsConstraintWindTimeline,Rs as PointAttachment,Ct as Pool,je as PositionMode,ys as Pow,mr as PowOut,ye as RGB2Timeline,we as RGBA2Timeline,pe as RGBATimeline,xe as RGBTimeline,nt as RegionAttachment,Ke as RotateMode,Ft as RotateTimeline,Ne as SETUP,qt as SUBSEQUENT,he as ScaleTimeline,ce as ScaleXTimeline,de as ScaleYTimeline,Re as SequenceTimeline,Gi as SetupPoseBoundsProvider,fe as ShearTimeline,ue as ShearXTimeline,me as ShearYTimeline,kt as Skeleton,zs as SkeletonBinary,rs as SkeletonBounds,$t as SkeletonClipping,Bt as SkeletonData,$s as SkeletonJson,Et as Skin,Qe as SkinEntry,Hi as SkinsAndAnimationBoundsProvider,_s as Slot,Ze as SlotData,Je as SpacingMode,$i as Spine,Ji as SpineDebugRenderer,tr as SpinePipe,as as SpineTexture,ie as StringSet,_e as Texture,Gt as TextureAtlas,Es as TextureAtlasPage,Ue as TextureAtlasRegion,zt as TextureFilter,Bs as TextureRegion,Ps as TextureWrap,pr as TimeKeeper,$ as Timeline,Ts as TrackEntry,Us as TransformConstraint,es as TransformConstraintData,Ae as TransformConstraintTimeline,ae as TranslateTimeline,oe as TranslateXTimeline,le as TranslateYTimeline,Hs as Triangulator,E as Utils,Xt as Vector2,ht as VertexAttachment,xr as WindowedMean};
@@ -11793,8 +11793,8 @@ extensions3.add(DarkTintBatcher);
11793
11793
 
11794
11794
  // spine-pixi-v8/src/SpinePipe.ts
11795
11795
  import {
11796
- extensions as extensions4,
11797
- ExtensionType as ExtensionType4
11796
+ ExtensionType as ExtensionType4,
11797
+ extensions as extensions4
11798
11798
  } from "pixi.js";
11799
11799
 
11800
11800
  // spine-pixi-v8/src/BatchableSpineSlot.ts
@@ -11932,6 +11932,7 @@ var SpinePipe = class {
11932
11932
  const slot = drawOrder[i];
11933
11933
  const attachment = slot.getAttachment();
11934
11934
  const blendMode = spineBlendModeMap[slot.data.blendMode];
11935
+ let skipRender = false;
11935
11936
  if (attachment instanceof RegionAttachment || attachment instanceof MeshAttachment) {
11936
11937
  const cacheData = spine._getCachedData(slot, attachment);
11937
11938
  const batchableSpineSlot = gpuSpine.slotBatches[cacheData.id] ||= new BatchableSpineSlot();
@@ -11941,15 +11942,18 @@ var SpinePipe = class {
11941
11942
  blendMode,
11942
11943
  roundPixels
11943
11944
  );
11944
- if (!cacheData.skipRender) {
11945
+ skipRender = cacheData.skipRender;
11946
+ if (!skipRender) {
11945
11947
  batcher.addToBatch(batchableSpineSlot, instructionSet);
11946
11948
  }
11947
11949
  }
11948
11950
  const containerAttachment = spine._slotsObject[slot.data.name];
11949
11951
  if (containerAttachment) {
11950
11952
  const container = containerAttachment.container;
11951
- container.includeInBuild = true;
11952
- container.collectRenderables(instructionSet, this.renderer, null);
11953
+ if (!skipRender) {
11954
+ container.includeInBuild = true;
11955
+ container.collectRenderables(instructionSet, this.renderer, null);
11956
+ }
11953
11957
  container.includeInBuild = false;
11954
11958
  }
11955
11959
  }
@@ -12380,12 +12384,14 @@ var Spine = class _Spine extends ViewContainer {
12380
12384
  alpha
12381
12385
  );
12382
12386
  if (this.alpha === 0 || alpha === 0) {
12387
+ if (!cacheData.skipRender) this.spineAttachmentsDirty = true;
12383
12388
  cacheData.skipRender = true;
12384
12389
  } else {
12390
+ if (cacheData.skipRender) this.spineAttachmentsDirty = true;
12391
+ cacheData.skipRender = cacheData.clipped = false;
12385
12392
  if (slot.darkColor) {
12386
12393
  cacheData.darkColor.setFromColor(slot.darkColor);
12387
12394
  }
12388
- cacheData.skipRender = cacheData.clipped = false;
12389
12395
  const texture = attachment.region?.texture.texture || Texture3.EMPTY;
12390
12396
  if (cacheData.texture !== texture) {
12391
12397
  cacheData.texture = texture;