reacthub-pixitweenjs 0.2.22 → 0.2.23
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.
- package/dist/index.es.js +8 -1
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -24698,7 +24698,14 @@ const en = /* @__PURE__ */ qs(QD), JD = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1,
|
|
|
24698
24698
|
...!en(O) && { adjust: rg },
|
|
24699
24699
|
matrix: os.ColorMatrixFilter
|
|
24700
24700
|
}), G = (x == null ? void 0 : x.enabled) || w && w !== Is.Normal;
|
|
24701
|
-
return
|
|
24701
|
+
return console.log(
|
|
24702
|
+
"all render props",
|
|
24703
|
+
l,
|
|
24704
|
+
s,
|
|
24705
|
+
a,
|
|
24706
|
+
o,
|
|
24707
|
+
G
|
|
24708
|
+
), /* @__PURE__ */ Vt.jsxs(Xt.Container, { ref: o, children: [
|
|
24702
24709
|
/* @__PURE__ */ Vt.jsxs(
|
|
24703
24710
|
Xt.Container,
|
|
24704
24711
|
{
|
package/dist/index.umd.js
CHANGED
|
@@ -1239,7 +1239,7 @@ void main()
|
|
|
1239
1239
|
src: url('${t.dataSrc}');
|
|
1240
1240
|
font-weight: ${t.weight};
|
|
1241
1241
|
font-style: ${t.style};
|
|
1242
|
-
}`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(e){this._stylesheet!==e&&(this._stylesheet=e,this.styleID++)}normalizeColor(e){return Array.isArray(e)&&(e=jS(e)),typeof e=="number"?US(e):e}dropShadowToCSS(){let e=this.normalizeColor(this.dropShadowColor);const t=this.dropShadowAlpha,r=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),n=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);e.startsWith("#")&&t<1&&(e+=(t*255|0).toString(16).padStart(2,"0"));const i=`${r}px ${n}px`;return this.dropShadowBlur>0?`text-shadow: ${i} ${this.dropShadowBlur}px ${e}`:`text-shadow: ${i} ${e}`}reset(){Object.assign(this,Do.defaultOptions)}onBeforeDraw(){const{fontsDirty:e}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&e?new Promise(t=>setTimeout(t,100)):Promise.resolve()}get isSafari(){const{userAgent:e}=Tt.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(e)}set fillGradientStops(e){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(e){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(e){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(e){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(e){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(e){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(e){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};let tl=Do;tl.availableFonts={},tl.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};const Lo=class extends Gn{constructor(e="",t={}){super(xt.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this._loading=!1,this.localStyleID=-1,this.dirty=!1,this.ownsStyle=!1;const r=new Image,n=xt.from(r,{scaleMode:Tt.SCALE_MODE,resourceOptions:{autoLoad:!1}});n.orig=new Gt,n.trim=new Gt,this.texture=n;const i="http://www.w3.org/2000/svg",s="http://www.w3.org/1999/xhtml",o=document.createElementNS(i,"svg"),a=document.createElementNS(i,"foreignObject"),l=document.createElementNS(s,"div"),h=document.createElementNS(s,"style");a.setAttribute("width","10000"),a.setAttribute("height","10000"),a.style.overflow="hidden",o.appendChild(a),this.maxWidth=Lo.defaultMaxWidth,this.maxHeight=Lo.defaultMaxHeight,this._domElement=l,this._styleElement=h,this._svgRoot=o,this._foreignObject=a,this._foreignObject.appendChild(h),this._foreignObject.appendChild(l),this._image=r,this._loadImage=new Image,this._autoResolution=Lo.defaultAutoResolution,this._resolution=Lo.defaultResolution??Tt.RESOLUTION,this.text=e,this.style=t}measureText(e){var a,l;const{text:t,style:r,resolution:n}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},e);Object.assign(this._domElement,{innerHTML:t,style:r.toCSS(n)}),this._styleElement.textContent=r.toGlobalCSS(),document.body.appendChild(this._svgRoot);const i=this._domElement.getBoundingClientRect();this._svgRoot.remove();const s=Math.min(this.maxWidth,Math.ceil(i.width)),o=Math.min(this.maxHeight,Math.ceil(i.height));return this._svgRoot.setAttribute("width",s.toString()),this._svgRoot.setAttribute("height",o.toString()),t!==this._text&&(this._domElement.innerHTML=this._text),r!==this._style&&(Object.assign(this._domElement,{style:(a=this._style)==null?void 0:a.toCSS(n)}),this._styleElement.textContent=(l=this._style)==null?void 0:l.toGlobalCSS()),{width:s+r.padding*2,height:o+r.padding*2}}async updateText(e=!0){const{style:t,_image:r,_loadImage:n}=this;if(this.localStyleID!==t.styleID&&(this.dirty=!0,this.localStyleID=t.styleID),!this.dirty&&e)return;const{width:i,height:s}=this.measureText();r.width=n.width=Math.ceil(Math.max(1,i)),r.height=n.height=Math.ceil(Math.max(1,s)),this._loading||(this._loading=!0,await new Promise(o=>{n.onload=async()=>{await t.onBeforeDraw(),this._loading=!1,r.src=n.src,n.onload=null,n.src="",this.updateTexture(),o()};const a=new XMLSerializer().serializeToString(this._svgRoot);n.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(a)}`}))}get source(){return this._image}updateTexture(){const{style:e,texture:t,_image:r,resolution:n}=this,{padding:i}=e,{baseTexture:s}=t;t.trim.width=t._frame.width=r.width/n,t.trim.height=t._frame.height=r.height/n,t.trim.x=-i,t.trim.y=-i,t.orig.width=t._frame.width-i*2,t.orig.height=t._frame.height-i*2,this._onTextureUpdate(),s.setRealSize(r.width,r.height,n),this.dirty=!1}_render(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._render(e)}_renderCanvas(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._renderCanvas(e)}getLocalBounds(e){return this.updateText(!0),super.getLocalBounds(e)}_calculateBounds(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_onStyleChange(){this.dirty=!0}destroy(e){var r,n,i,s,o;typeof e=="boolean"&&(e={children:e}),e=Object.assign({},Lo.defaultDestroyOptions,e),super.destroy(e);const t=null;this.ownsStyle&&((r=this._style)==null||r.cleanFonts()),this._style=t,(n=this._svgRoot)==null||n.remove(),this._svgRoot=t,(i=this._domElement)==null||i.remove(),this._domElement=t,(s=this._foreignObject)==null||s.remove(),this._foreignObject=t,(o=this._styleElement)==null||o.remove(),this._styleElement=t,this._loadImage.src="",this._loadImage.onload=null,this._loadImage=t,this._image.src="",this._image=t}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._image.width/this.resolution}set width(e){this.updateText(!0);const t=ki(this.scale.x)||1;this.scale.x=t*e/this._image.width/this.resolution,this._width=e}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._image.height/this.resolution}set height(e){this.updateText(!0);const t=ki(this.scale.y)||1;this.scale.y=t*e/this._image.height/this.resolution,this._height=e}get style(){return this._style}set style(e){this._style!==e&&(e=e||{},e instanceof tl?(this.ownsStyle=!1,this._style=e):e instanceof Hn?(console.warn("[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle"),this.ownsStyle=!0,this._style=tl.from(e)):(this.ownsStyle=!0,this._style=new tl(e)),this.localStyleID=-1,this.dirty=!0)}get text(){return this._text}set text(e){e=String(e===""||e===null||e===void 0?" ":e),e=this.sanitiseText(e),this._text!==e&&(this._text=e,this.dirty=!0)}get resolution(){return this._resolution}set resolution(e){this._autoResolution=!1,this._resolution!==e&&(this._resolution=e,this.dirty=!0)}sanitiseText(e){return e.replace(/<br>/gi,"<br/>").replace(/<hr>/gi,"<hr/>").replace(/ /gi," ")}};let ch=Lo;ch.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},ch.defaultMaxWidth=2024,ch.defaultMaxHeight=2024,ch.defaultAutoResolution=!0;var Ls=(e=>(e.BlackAndWhite="BlackAndWhite",e.Sepia="Sepia",e.RetroVintage="RetroVintage",e.NightVision="NightVision",e.Normal="Normal",e.None="Normal",e))(Ls||{});class fh{constructor(t=0,r=0,n=0,i=0){this._x=Number(t),this._y=Number(r),this._width=Number(n),this._height=Number(i),this._hull=[new gt,new gt,new gt,new gt],this.currentID=-1,this.dirtyID=0}get x(){return this._x}set x(t){this._x=t,this.dirtyID++}get y(){return this._y}set y(t){this._y=t,this.dirtyID++}get width(){return this._width}set width(t){this._width=t,this.dirtyID++}get height(){return this._height}set height(t){this._height=t,this.dirtyID++}get hull(){return this.isDirty()&&this.update(),this._hull}get topLeft(){return this.isDirty()&&this.update(),this._hull[0]}get topRight(){return this.isDirty()&&this.update(),this._hull[1]}get bottomRight(){return this.isDirty()&&this.update(),this._hull[2]}get bottomLeft(){return this.isDirty()&&this.update(),this._hull[3]}isDirty(){return this.currentID!==this.dirtyID}update(){const[t,r,n,i]=this._hull;t.set(this._x,this._y),r.set(this._x+this._width,this._y),n.set(this._x+this._width,this._y+this._height),i.set(this._x,this._y+this._height)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}clone(){return new fh(this.x,this.y,this.width,this.height)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}contains(t,r){return this.width<=0||this.height<=0?!1:t>=this.x&&t<this.x+this.width&&r>=this.y&&r<this.y+this.height}equals(t){return t?t.x===this.x&&t.y===this.y&&t.width===this.width&&t.height===this.height:!1}pad(t=0,r=t){return this.x-=t,this.y-=r,this.width+=t*2,this.height+=r*2,this}fit(t){const r=Math.max(this.x,t.x),n=Math.min(this.x+this.width,t.x+t.width),i=Math.max(this.y,t.y),s=Math.min(this.y+this.height,t.y+t.height);return this.x=r,this.width=Math.max(n-r,0),this.y=i,this.height=Math.max(s-i,0),this}ceil(t=1,r=.001){const n=Math.ceil((this.x+this.width-r)*t)/t,i=Math.ceil((this.y+this.height-r)*t)/t;return this.x=Math.floor((this.x+r)*t)/t,this.y=Math.floor((this.y+r)*t)/t,this.width=n-this.x,this.height=i-this.y,this}enlarge(t){const r=Math.min(this.x,t.x),n=Math.max(this.x+this.width,t.x+t.width),i=Math.min(this.y,t.y),s=Math.max(this.y+this.height,t.y+t.height);return this.x=r,this.width=n-r,this.y=i,this.height=s-i,this}}const c1=new gt;class dh{constructor(t=0,r=0,n=0,i=0,s=0){t instanceof fh&&(s=r||0,r=t.y,n=t.width,i=t.height,t=t.x),this.innerBounds=new fh(t,r,n,i),this._rotation=s,this._center=new Un(this.updateCenter,this),this._hull=[new gt,new gt,new gt,new gt],this._matrix=new ee,this.currentID=-1,this.dirtyID=0}get rotation(){return this._rotation}set rotation(t){this._rotation=t,this.dirtyID++}get center(){return this.isDirty()&&this.update(),this._center}set center(t){this.center.copyFrom(t)}get hull(){return this.isDirty()&&this.update(),this._hull}get topLeft(){return this.isDirty()&&this.update(),this._hull[0]}get topRight(){return this.isDirty()&&this.update(),this._hull[1]}get bottomRight(){return this.isDirty()&&this.update(),this._hull[2]}get bottomLeft(){return this.isDirty()&&this.update(),this._hull[3]}equals(t){return t?this.innerBounds.equals(t.innerBounds)&&this.rotation===t.rotation:!1}contains(t,r){typeof t=="number"&&(t=c1.set(t,r));const n=this._matrix.applyInverse(t,c1);return this.innerBounds.contains(n.x,n.y)}copyFrom(t){return this.innerBounds.copyFrom(t.innerBounds),this.rotation=t.rotation,this.dirtyID++,this}isDirty(){return this.currentID!==this.dirtyID+this.innerBounds.dirtyID}update(){const t=this.innerBounds,r=this._rotation,n=this._center,[i,s,o,a]=this._hull,l=this._matrix;n._x=t.x+t.width/2,n._y=t.y+t.height/2,l.identity().translate(-n.x,-n.y).rotate(r).translate(n.x,n.y),l.apply(t.topLeft,i),l.apply(t.topRight,s),l.apply(t.bottomRight,o),l.apply(t.bottomLeft,a),this.currentID=this.dirtyID+this.innerBounds.dirtyID}updateCenter(){const t=this.center,r=this.innerBounds;r.x=t.x-r.width/2,r.y=t.y-r.height/2}}class f1{constructor(t,r){this._history=new Array(t),this._decayRatio=r,this._currentIndex=0;for(let n=0;n<t;n++)this._history[n]=0}next(t){const{_history:r,_decayRatio:n}=this,i=r.length;this._currentIndex=this._currentIndex<i-1?this._currentIndex+1:0,r[this._currentIndex]=t;let s=0,o=0;for(let a=this._currentIndex+1;a<i;a++)s=(s+r[a])*n,o=(o+1)*n;for(let a=0;a<=this._currentIndex;a++)s=(s+r[a])*n,o=(o+1)*n;return this._average=s/o,this._average}absDev(){let t=0;for(let r=0,n=this._history.length;r<n;r++)t+=Math.abs(this._history[r]-this._average);return t/this._history.length}}class ph{constructor(t={}){ph.prototype.__init.call(this),this._freeList=[],this._freeCount=0,this._borrowRate=0,this._returnRate=0,this._flowRate=0,this._borrowRateAverage=0,this._reserveCount=t.reserve||0,this._capacityRatio=t.capacityRatio||1.2,this._decayRatio=t.decayRatio||.67,this._marginAverage=0,this._borrowRateAverageProvider=new f1(128,this._decayRatio),this._marginAverageProvider=new f1(128,this._decayRatio)}get capacity(){return this._freeList.length}set capacity(t){this._freeList.length=Math.ceil(t)}allocate(){return++this._borrowRate,++this._flowRate,this._freeCount>0?this._freeList[--this._freeCount]:this.create()}allocateArray(t){let r,n;Array.isArray(t)?(r=t,n=t.length):(n=t,r=new Array(n)),this._borrowRate+=n,this._flowRate+=n;let i=0;if(this._freeCount>0){const s=this._freeList,o=Math.min(this._freeCount,n);let a=this._freeCount;for(let l=0;l<o;l++)r[i]=s[a-1],++i,--a;this._freeCount=a}for(;i<n;)r[i]=this.create(),++i;return r}release(t){++this._returnRate,--this._flowRate,this._freeCount===this.capacity&&(this.capacity*=this._capacityRatio),this._freeList[this._freeCount]=t,++this._freeCount}releaseArray(t){this._returnRate+=t.length,this._flowRate-=t.length,this._freeCount+t.length>this.capacity&&(this.capacity=Math.max(this.capacity*this._capacityRatio,this._freeCount+t.length));for(let r=0,n=t.length;r<n;r++)this._freeList[this._freeCount]=t[r],++this._freeCount}reserve(t){if(this._reserveCount=t,this._freeCount<t){const r=this._freeCount-t;for(let n=0;n<r;n++)this._freeList[this._freeCount]=this.create(),++this._freeCount}}limit(t){if(this._freeCount>t){this.capacity>t*this._capacityRatio&&(this.capacity=t*this._capacityRatio);const n=Math.min(this._freeCount,this.capacity);for(let i=t;i<n;i++)this._freeList[i]=null}}startGC(t=ie.shared){t.add(this._gcTick,null,fi.UTILITY)}stopGC(t=ie.shared){t.remove(this._gcTick)}__init(){this._gcTick=()=>{this._borrowRateAverage=this._borrowRateAverageProvider.next(this._borrowRate),this._marginAverage=this._marginAverageProvider.next(this._freeCount-this._borrowRate);const t=this._borrowRateAverageProvider.absDev();this._flowRate=0,this._borrowRate=0,this._returnRate=0;const r=this._freeCount,n=this._freeList.length;if(r<128&&this._borrowRateAverage<128&&n<128)return;const i=Math.max(this._borrowRateAverage*(this._capacityRatio-1),this._reserveCount);if(this._freeCount>i+t){const s=i+t;this.capacity=Math.min(this._freeList.length,Math.ceil(s)),this._freeCount=this._freeList.length}}}}var yp;const d1=new Map;class p1{static build(t){let r=d1.get(t);return r||(r=new class extends ph{create(){return new t}},d1.set(t,r),r)}static buildFunctional(t){return new(yp=class extends ph{constructor(...n){super(...n),yp.prototype.__init.call(this)}__init(){this.create=t}},yp)}}const m1={color:16777215,outlineColor:0,outlineThickness:1,radius:8,shape:"tooth"},cR=gr;class fR extends cR{constructor(t,r,n={},i,s,o){super(),this.transformer=t;const a=Object.assign({},m1,n);this._handle=r,this._style=a,this.onHandleDelta=i,this.onHandleCommit=s,this._dirty=!0,this.interactive=!0,this.cursor=o||"move",this._pointerDown=!1,this._pointerDragging=!1,this._pointerPosition=new gt,this._pointerMoveTarget=null,this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onpointerdown=this.onPointerDown,this.onpointermove=this.onPointerMove,this.onpointerup=this.onPointerUp,this.onpointerupoutside=this.onPointerUp}get handle(){return this._handle}set handle(t){this._handle=t,this._dirty=!0}get style(){return this._style}set style(t){this._style=Object.assign({},m1,t),this._dirty=!0}render(t){this._dirty&&(this.draw(),this._dirty=!1),super.render(t)}draw(){const t=this._handle,r=this._style,n=r.radius;if(this.clear().lineStyle(r.outlineThickness,r.outlineColor).beginFill(r.color),r.shape==="square")this.drawRect(-n/2,-n/2,n,n);else if(r.shape==="tooth")switch(t){case"middleLeft":this.drawPolygon([-n/2,-n/2,-n/2,n/2,n/2,n/2,n*1.1,0,n/2,-n/2]);break;case"topCenter":this.drawPolygon([-n/2,-n/2,n/2,-n/2,n/2,n/2,0,n*1.1,-n/2,n/2]);break;case"middleRight":this.drawPolygon([-n/2,n/2,-n*1.1,0,-n/2,-n/2,n/2,-n/2,n/2,n/2]);break;case"bottomCenter":this.drawPolygon([0,-n*1.1,n/2,-n/2,n/2,n/2,-n/2,n/2,-n/2,-n/2]);break;case"rotator":this.drawCircle(0,0,n/Math.sqrt(2));break;default:this.drawRect(-n/2,-n/2,n,n);break}else this.drawCircle(0,0,n);this.endFill()}onPointerDown(t){this._pointerDown=!0,this._pointerDragging=!1,t.stopPropagation(),this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null),this._pointerMoveTarget=this.transformer.stage||this,this._pointerMoveTarget.addEventListener("globalpointermove",this.onPointerMove)}onPointerMove(t){this._pointerDown&&(this._pointerDragging?this.onDrag(t):this.onDragStart(t),t.stopPropagation())}onPointerUp(t){this._pointerDragging&&this.onDragEnd(t),this._pointerDown=!1,this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null)}onDragStart(t){this._pointerPosition.copyFrom(t.data.global),this._pointerDragging=!0}onDrag(t){const r=t.data.global;this.onHandleDelta&&this.onHandleDelta(r),this._pointerPosition.copyFrom(r)}onDragEnd(t){this._pointerDragging=!1,this.onHandleCommit&&this.onHandleCommit()}}function mh(e,t,r,n){const{x:i,y:s}=r,{x:o,y:a}=n;if(Math.abs(o-i)<.01)return Math.abs(e-i);if(Math.abs(a-s)<.01)return Math.abs(t-s);const l=(a-s)/(o-i);return Math.abs((l*e-t+(a-l*o))/Math.sqrt(l*l+1))}const g1=p1.build(gt),dR=[new gt,new gt,new gt,new gt],pR=new ee,Bo=new gt,mR=[0,0,0,1,-1,1,-1,-1,1,-1,1,0],gR=[0,0,-1,0,-1,-1,1,-1,1,1,0,1],yR=[0,0,1,0,1,1,-1,1,-1,-1,0,-1],vR=[0,0,0,-1,1,-1,1,1,-1,1,-1,0],vp=new Array(12),_R=[mR,gR,yR,vR],bR=gr;class xR extends bR{constructor(t){super(),this.transformer=t,this.boxScalingHandles=[this.addChild(new gr),this.addChild(new gr),this.addChild(new gr),this.addChild(new gr)],this.boxScalingHandles.forEach(r=>{r.interactive=!0}),this.boxScalingHandles[0].cursor=el.topCenter,this.boxScalingHandles[1].cursor=el.middleRight,this.boxScalingHandles[2].cursor=el.bottomCenter,this.boxScalingHandles[3].cursor=el.middleLeft}hitHandleType(t,r,n){const{boxRotationEnabled:i,boxRotationTolerance:s,boxScalingEnabled:o,boxScalingTolerance:a}=this.transformer,[l,h,f,p]=t.hull,{x:d,y:m}=r.applyInverse(n,Bo);if(o){const g=mh(d,m,l,h)*r.d,y=mh(d,m,l,p)*r.a,v=mh(d,m,h,f)*r.a,_=mh(d,m,p,f)*r.d,x=Math.min(g,y,v,_);if(x<a)switch(x){case g:return"topCenter";case y:return"middleLeft";case v:return"middleRight";case _:return"bottomCenter"}}if(i&&!t.contains(d,m)){const g=Math.sqrt((l.x-d)**2+(l.y-m)**2),y=Math.sqrt((h.x-d)**2+(h.y-m)**2),v=Math.sqrt((p.x-d)**2+(p.y-m)**2),_=Math.sqrt((f.x-d)**2+(f.y-m)**2),x=Math.min(g,y,v,_);if(x<s*1.45)switch(x){case g:return"boxRotateTopLeft";case y:return"boxRotateTopRight";case v:return"boxRotateBottomLeft";case _:return"boxRotateBottomRight"}}return null}drawBounds(t){const r=dR;for(let n=0;n<4;n++)this.transformer.projectToLocal(t.hull[n],r[n]);this.drawPolygon(r)}drawBoxScalingTolerance(t,r=this.transformer.boxScalingTolerance){t.innerBounds.pad(-r);const n=g1.allocateArray(4);n.forEach((s,o)=>{this.projectToLocal(t.hull[o],s)}),t.innerBounds.pad(2.5*r);const i=g1.allocateArray(4);i.forEach((s,o)=>{this.projectToLocal(t.hull[o],s)}),t.innerBounds.pad(-1.5*this.transformer.boxScalingTolerance);for(let s=0;s<4;s++){const o=n[s],a=n[(s+1)%4],l=i[s],h=i[(s+1)%4];this.boxScalingHandles[s].clear().beginFill(16777215,1e-4).drawPolygon(o,l,h,a).endFill()}}drawBoxRotationTolerance(){const{boxRotateTopLeft:t,boxRotateTopRight:r,boxRotateBottomLeft:n,boxRotateBottomRight:i}=this.transformer.handleAnchors,s=this.transformer.boxRotationTolerance*2,o=pR.identity().scale(s,s).rotate(this.transformer.getGroupBounds().rotation);for(let a=0;a<4;a++){const l=_R[a];let h;switch(a){case 0:h=t;break;case 1:h=r;break;case 2:h=n;break;case 3:h=i;break}for(let f=0;f<l.length;f+=2){const p=l[f],d=l[f+1];Bo.set(p,d),o.apply(Bo,Bo),vp[f]=Bo.x+h.x,vp[f+1]=Bo.y+h.y}this.drawPolygon(vp.slice())}}projectToLocal(t,r){return this.transformer.projectToLocal(t,r)}}const y1=new ee;function v1(e){const t=y1.identity();return t.c=Math.tan(e),t}function _1(e){const t=y1.identity();return t.b=Math.tan(e),t}function b1(e,t,r,n=e.pivot){const i=t.a,s=t.b,o=t.c,a=t.d,l=-Math.atan2(-o,a),h=Math.atan2(s,i);return r=r??h,e.pivot.set(n.x,n.y),e.rotation=r,e.skew.x=r+l,e.skew.y=-r+h,e.scale.x=Math.sqrt(i*i+s*s),e.scale.y=Math.sqrt(o*o+a*a),e.position.x=t.tx+(n.x*t.a+n.y*t.c),e.position.y=t.ty+(n.x*t.b+n.y*t.d),e}const gh=new ee,wR=new ee;function TR(e,t,r){if(!r){const s=e.parent?e.parent:e.enableTempParent();e.updateTransform(),e.disableTempParent(s)}const n=e.worldTransform,i=e.parent?wR.copyFrom(e.parent.worldTransform):ee.IDENTITY;gh.copyFrom(n),gh.prepend(t),gh.prepend(i.invert()),b1(e.transform,gh)}const yh=new wa,ER=[new gt,new gt,new gt,new gt],Fo=new ee,Uo=new gt,_p=new dh,SR=new Gt,x1=[new gt,new gt,new gt,new gt],w1=new gt,T1=new ee,vh=p1.build(gt),el={topLeft:"nw-resize",topCenter:"n-resize",topRight:"ne-resize",middleLeft:"w-resize",middleRight:"e-resize",bottomLeft:"sw-resize",bottomCenter:"s-resize",bottomRight:"se-resize"},_h=["topLeft","topCenter","topRight","middleLeft","middleCenter","middleRight","bottomLeft","bottomCenter","bottomRight"],E1={topLeft:{x:-1,y:-1},topCenter:{x:0,y:-1},topRight:{x:1,y:-1},middleLeft:{x:-1,y:0},middleCenter:{x:0,y:0},middleRight:{x:1,y:0},bottomLeft:{x:-1,y:1},bottomCenter:{x:0,y:1},bottomRight:{x:1,y:1}},AR=[..._h,"rotator","skewHorizontal","skewVertical"],PR=4,CR=16,OR=[Math.PI/4,Math.PI/2,Math.PI*3/4,Math.PI,0,-Math.PI/4,-Math.PI/2,-Math.PI*3/4,-Math.PI],IR=Math.PI/90,RR=[Math.PI/4,-Math.PI/4],kR=Math.PI/90,S1={color:0,thickness:2},MR=Je;let NR=class nn extends MR{constructor(t={}){super(),nn.prototype.__init.call(this),nn.prototype.__init2.call(this),nn.prototype.__init3.call(this),nn.prototype.__init4.call(this),nn.prototype.__init5.call(this),this.interactive=!0,this.cursors=Object.assign({default:"move"},t.cursors),this.cursor=this.cursors.default,this.boundingBoxes=t.boundingBoxes||"all",this.group=t.group||[],this.boxRotationTolerance=t.boxRotationTolerance||CR,this.boxScalingTolerance=t.boxScalingTolerance||PR,this.centeredScaling=!!t.centeredScaling,this.projectionTransform=new ee,this.lockAspectRatio=t.lockAspectRatio===!0,this.rotationSnaps=t.rotationSnaps||OR,this.rotationSnapTolerance=t.rotationSnapTolerance!==void 0?t.rotationSnapTolerance:IR,this.skewRadius=t.skewRadius||64,this.skewSnaps=t.skewSnaps||RR,this.skewSnapTolerance=t.skewSnapTolerance!==void 0?t.skewSnapTolerance:kR,this.boxRotationEnabled=t.boxRotationEnabled===!0,this.boxScalingEnabled=t.boxScalingEnabled===!0,this._rotateEnabled=t.rotateEnabled!==!1,this._scaleEnabled=t.scaleEnabled!==!1,this._skewEnabled=t.skewEnabled===!0,this.translateEnabled=t.translateEnabled!==!1,this.transientGroupTilt=t.transientGroupTilt!==void 0?t.transientGroupTilt:!0,this.wireframe=this.addChild(new xR(this)),this.wireframe.cursor="none",this.stage=t.stage||null,this._skewX=0,this._skewY=0,this._transformType="none",this._wireframeStyle=Object.assign({},S1,t.wireframeStyle||{});const r=t.handleConstructor||fR,n=t.handleStyle||{};this._handleStyle=n;const i={rotator:this.addChild(new r(this,"rotator",n,a=>{this.rotateGroup("rotator",a)},this.commitGroup))},s=_h.reduce((a,l)=>{const h=new r(this,l,n,null,this.commitGroup,el[l]);return h.onHandleDelta=f=>{this.scaleGroup(h.handle,f)},h.visible=this._scaleEnabled,a[l]=h,this.addChild(a[l]),a},{}),o={skewHorizontal:this.addChild(new r(this,"skewHorizontal",n,a=>{this.skewGroup("skewHorizontal",a)},this.commitGroup,"pointer")),skewVertical:this.addChild(new r(this,"skewVertical",n,a=>{this.skewGroup("skewVertical",a)},this.commitGroup,"pointer"))};this.handles=Object.assign({},s,i,o),this.handles.middleCenter.visible=!1,this.handles.skewHorizontal.visible=this._skewEnabled,this.handles.skewVertical.visible=this._skewEnabled,this.handleAnchors={rotator:new gt,boxRotateTopLeft:new gt,boxRotateTopRight:new gt,boxRotateBottomLeft:new gt,boxRotateBottomRight:new gt,topLeft:new gt,topCenter:new gt,topRight:new gt,middleLeft:new gt,middleCenter:new gt,middleRight:new gt,bottomLeft:new gt,bottomCenter:new gt,bottomRight:new gt,skewHorizontal:new gt,skewVertical:new gt},this.groupBounds=new dh,this.updateGroupBounds(),this._pointerDown=!1,this._pointerDragging=!1,this._pointerPosition=new gt,this._pointerMoveTarget=null,this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.addEventListener("pointerdown",this.onPointerDown),this.addEventListener("pointerup",this.onPointerUp),this.addEventListener("pointerupoutside",this.onPointerUp)}get enabledHandles(){return this._enabledHandles}set enabledHandles(t){!this._enabledHandles&&!t||(this._enabledHandles=t,AR.forEach(r=>{this.handles[r].visible=!1}),t?t.forEach(r=>{this.handles[r].visible=!0}):(this.handles.rotator.visible=this._rotateEnabled,this.handles.skewHorizontal.visible=this._skewEnabled,this.handles.skewVertical.visible=this._skewEnabled,_h.forEach(r=>{r!=="middleCenter"&&(this.handles[r].visible=this._scaleEnabled)})))}get handleStyle(){return this._handleStyle}set handleStyle(t){const r=this.handles;for(const n in r)r[n].style=t;this._handleStyle=t}get rotateEnabled(){return this._rotateEnabled}set rotateEnabled(t){if(this._rotateEnabled!==t){if(this._rotateEnabled=t,this._enabledHandles)return;this.handles.rotator.visible=t}}get scaleEnabled(){return this._scaleEnabled}set scaleEnabled(t){if(this._scaleEnabled!==t){if(this._scaleEnabled=t,this._enabledHandles)return;_h.forEach(r=>{r!=="middleCenter"&&(this.handles[r].visible=t)})}}get skewEnabled(){return this._skewEnabled}set skewEnabled(t){if(this._skewEnabled!==t){if(this._skewEnabled=t,this._enabledHandles)return;this.handles.skewHorizontal.visible=t,this.handles.skewVertical.visible=t}}get transformType(){return this._transformType}get wireframeStyle(){return this._wireframeStyle}set wireframeStyle(t){this._wireframeStyle=Object.assign({},S1,t)}getGroupBounds(t=!1){return t&&this.updateGroupBounds(),this.groupBounds}__init(){this.translateGroup=t=>{this._transformHandle=null,this._transformType="translate";const r=Fo.identity().translate(t.x,t.y);this.prependTransform(r)}}__init2(){this.rotateGroup=(t,r)=>{this._transformHandle=t,this._transformType="rotate";const n=this.groupBounds,i=this.worldTransform.apply(this.handleAnchors[t],Uo);this.projectionTransform.applyInverse(i,i),r=this.projectionTransform.applyInverse(r,w1);const s=n.center,o=Math.atan2(i.y-s.y,i.x-s.x);let l=Math.atan2(r.y-s.y,r.x-s.x)-o,h=this.groupBounds.rotation+l;h=this.snapAngle(h,this.rotationSnapTolerance,this.rotationSnaps),l=h-this.groupBounds.rotation;const f=Fo.identity().translate(-s.x,-s.y).rotate(l).translate(s.x,s.y);this.prependTransform(f,!0),this.updateGroupBounds(h),this._skewX+=l,this._skewY+=l}}__init3(){this.scaleGroup=(t,r)=>{this._transformHandle=t,this._transformType="scale";const n=E1[t].x,i=E1[t].y,s=this.handles,o=this.groupBounds,a=o.rotation,l=o.innerBounds,h=this.worldTransform.apply(this.handleAnchors[t],Uo);this.projectionTransform.applyInverse(h,h),r=this.projectionTransform.applyInverse(r,w1);const f=r.x-h.x,p=r.y-h.y,d=(o.topRight.x-o.topLeft.x)/l.width,m=(o.topRight.y-o.topLeft.y)/l.width,g=(o.bottomLeft.x-o.topLeft.x)/l.height,y=(o.bottomLeft.y-o.topLeft.y)/l.height,v=f*d+p*m,_=f*g+p*y;let x=1+v*n/l.width,T=1+_*i/l.height;this.lockAspectRatio&&(t==="topLeft"||t==="topRight"||t==="bottomLeft"||t==="bottomRight")&&(x>T?T=x:x=T);const E=Fo.identity();if(n!==0&&x!==0){const I=this.centeredScaling?o.center:n===1?o.topLeft:o.topRight;E.translate(-I.x,-I.y).rotate(-a).scale(x,1).rotate(a).translate(I.x,I.y)}if(i!==0&&T!==0){const I=this.centeredScaling?o.center:i===1?o.topLeft:o.bottomLeft;E.translate(-I.x,-I.y).rotate(-a).scale(1,T).rotate(a).translate(I.x,I.y)}if((T<0||x<0)&&!(T<0&&x<0))switch(t){case"topLeft":case"bottomLeft":this.swapHandles(s.topLeft,s.bottomLeft);break;case"topCenter":case"bottomCenter":this.swapHandles(s.topCenter,s.bottomCenter);break;case"topRight":case"bottomRight":this.swapHandles(s.topRight,s.bottomRight);break}this.prependTransform(E)}}__init4(){this.skewGroup=(t,r)=>{this._transformHandle=t,this._transformType="skew";const n=this.groupBounds,i=Uo.copyFrom(r);this.projectionTransform.applyInverse(i,i);const s=n.center,o=Fo.identity().translate(-s.x,-s.y);let a=this.groupBounds.rotation;if(t==="skewHorizontal"){const l=this._skewX;this._skewX=Math.atan2(i.y-s.y,i.x-s.x),this._skewX=this.snapAngle(this._skewX,this.skewSnapTolerance,this.skewSnaps),o.prepend(_1(-l)),o.prepend(_1(this._skewX))}else{const l=this._skewY,h=Math.atan2(i.y-s.y,i.x-s.x)-Math.PI/2;this._skewY=h,this._skewY=this.snapAngle(this._skewY,this.skewSnapTolerance,this.skewSnaps),o.prepend(v1(l)),o.prepend(v1(-this._skewY)),a-=this._skewY-l}o.translate(s.x,s.y),this.prependTransform(o,!0),this.updateGroupBounds(a)}}__init5(){this.commitGroup=()=>{this._transformHandle=null,this._transformType="none",this.transientGroupTilt!==!1&&this.group.length>1&&this.updateGroupBounds(0),this.emit("transformcommit")}}render(t){this.renderable&&this.visible&&(!this.lazyMode||this.lazyDirty)&&this.draw(),super.render(t)}draw(){const t=this.group,{color:r,thickness:n}=this._wireframeStyle;this.wireframe.clear(),this.boundingBoxes!=="none"&&this.wireframe.lineStyle(n,r),this.translateEnabled&&this.wireframe.beginFill(16777215,1e-4);for(let s=0,o=t.length;s<o&&this.boundingBoxes==="all";s++)this.wireframe.drawBounds(nn.calculateOrientedBounds(t[s],_p));const i=t.length!==1?nn.calculateGroupOrientedBounds(t,this.groupBounds.rotation,_p,!0):nn.calculateOrientedBounds(t[0],_p);this.wireframe.drawBounds(i),this.drawHandles(i),this.groupBounds.copyFrom(i),this.boxRotationEnabled&&(this.wireframe.closePath().beginFill(16777215,1e-4).lineStyle(),this.wireframe.drawBoxRotationTolerance()),this.boxScalingEnabled&&(this.wireframe.closePath().beginFill(16773375,1e-4).lineStyle(),this.wireframe.drawBoxScalingTolerance(i)),this.lazyDirty=!1}drawHandles(t){const r=this.handles,n=this.handleAnchors,{topLeft:i,topRight:s,bottomLeft:o,bottomRight:a,center:l}=t,[h,f,p,d]=x1,m=Uo;if(this.projectToLocal(i,h),this.projectToLocal(s,f),this.projectToLocal(o,p),this.projectToLocal(a,d),this.projectToLocal(l,m),n.topLeft.copyFrom(h),n.topCenter.set((h.x+f.x)/2,(h.y+f.y)/2),n.topRight.copyFrom(f),n.middleLeft.set((h.x+p.x)/2,(h.y+p.y)/2),n.middleCenter.set((h.x+d.x)/2,(h.y+d.y)/2),n.middleRight.set((f.x+d.x)/2,(f.y+d.y)/2),n.bottomLeft.copyFrom(p),n.bottomCenter.set((p.x+d.x)/2,(p.y+d.y)/2),n.bottomRight.copyFrom(d),this.boxRotationEnabled&&(n.boxRotateTopLeft.copyFrom(n.topLeft),n.boxRotateTopRight.copyFrom(n.topRight),n.boxRotateBottomLeft.copyFrom(n.bottomLeft),n.boxRotateBottomRight.copyFrom(n.bottomRight)),this._rotateEnabled){const g=(h.x+f.x)/2,y=(h.y+f.y)/2;let v=-(h.y-f.y),_=h.x-f.x;const x=Math.sqrt(v*v+_*_);v*=32/x,_*=32/x,r.rotator.position.x=g+v,r.rotator.position.y=y+_,this.wireframe.moveTo(g,y).lineTo(r.rotator.position.x,r.rotator.position.y),this.handleAnchors.rotator.copyFrom(r.rotator.position)}if(this._skewEnabled){const g=m.x,y=m.y;this.worldTransform.apply(m,m),n.skewHorizontal.set(m.x+Math.cos(this._skewX)*this.skewRadius,m.y+Math.sin(this._skewX)*this.skewRadius),n.skewVertical.set(m.x+-Math.sin(this._skewY)*this.skewRadius,m.y+Math.cos(this._skewY)*this.skewRadius),this.worldTransform.applyInverse(n.skewHorizontal,n.skewHorizontal),this.worldTransform.applyInverse(n.skewVertical,n.skewVertical),m.set(g,y),this.wireframe.beginFill(this.wireframeStyle.color).drawCircle(m.x,m.y,this.wireframeStyle.thickness*2).endFill(),this.wireframe.moveTo(m.x,m.y).lineTo(r.skewHorizontal.x,r.skewHorizontal.y).moveTo(m.x,m.y).lineTo(r.skewVertical.x,r.skewVertical.y)}for(const g in r){let y=this.groupBounds.rotation;g==="skewHorizontal"?y=this._skewX:g==="skewVertical"&&(y=this._skewY);const v=r[g];v.rotation=y,v.position.copyFrom(n[g]),v.getBounds(!1,SR)}}onPointerDown(t){this._pointerDown=!0,this._pointerDragging=!1,t.stopPropagation(),this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null),this._pointerMoveTarget=this.stage||this,this._pointerMoveTarget.addEventListener("globalpointermove",this.onPointerMove)}onPointerMove(t){const r=this._pointerPosition,n=vh.allocate().copyFrom(t.data.global),i=this.wireframe.hitHandleType(this.groupBounds,this.projectionTransform,n);if(!this._pointerDown)this.setCursorFromHoveredHandle(i);else{const s=n.x,o=n.y;if(this._pointerDragging)switch(this._transformHandle){case"boxRotateTopLeft":case"boxRotateTopRight":case"boxRotateBottomLeft":case"boxRotateBottomRight":this.rotateGroup(this._transformHandle,n);break;case"topCenter":case"middleLeft":case"middleRight":case"bottomCenter":this.scaleGroup(this._transformHandle,n);break;default:if(this.translateEnabled){const[a,l,h]=x1;a.set(0,0),l.set(n.x-r.x,n.y-r.y),this.projectionTransform.applyInverse(a,a),this.projectionTransform.applyInverse(l,l),h.set(l.x-a.x,l.y-a.y),this.translateGroup(h)}}else this._transformHandle=this.wireframe.hitHandleType(this.groupBounds,this.projectionTransform,n),this.setCursorFromHoveredHandle(i);this._pointerPosition.x=s,this._pointerPosition.y=o,this._pointerDragging=!0,t.stopPropagation()}vh.release(n)}onPointerUp(t){this._pointerDragging=!1,this._pointerDown=!1,this.commitGroup(),t.stopPropagation(),this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null)}prependTransform(t,r=!1){const n=this.group;for(let i=0,s=n.length;i<s;i++)TR(n[i],t,!1);T1.copyFrom(t),r||this.updateGroupBounds(),this.emit("transformchange",T1)}updateGroupBounds(t=this.groupBounds.rotation){nn.calculateGroupOrientedBounds(this.group,t,this.groupBounds),this.drawHandles(this.groupBounds),this.lazyDirty=!0}snapAngle(t,r,n){if(t=t%(Math.PI*2),!n||n.length===1||!r)return t;for(let i=0,s=n.length;i<s;i++)if(Math.abs(t-n[i])<=r)return n[i];return t}swapHandles(t,r){const n=t.handle,i=r.handle,s=t.cursor,o=r.cursor,a=t.x,l=r.x,h=t.y,f=r.y;t.handle=i,r.handle=n,t.position.set(l,f),r.position.set(a,h),t.cursor=o,r.cursor=s,this.handles[n]=r,this.handles[i]=t,this._transformHandle===n?this._transformHandle=i:this._transformHandle===i&&(this._transformHandle=n)}setCursorFromHoveredHandle(t){if(t&&t.startsWith("boxRotate"))this.cursor=this.cursors.boxRotate||this.cursors.default;else if(t)switch(t){case"topCenter":this.cursor=this.cursors.boxScaleTop||this.cursors.default;break;case"middleLeft":this.cursor=this.cursors.boxScaleLeft||this.cursors.default;break;case"middleRight":this.cursor=this.cursors.boxScaleRight||this.cursors.default;break;case"bottomCenter":this.cursor=this.cursors.boxScaleBottom||this.cursors.default;break}else this.cursor=this.cursors.translate||this.cursors.default}projectToLocal(t,r){return r||(r=new gt),this.projectionTransform.apply(t,r),this.worldTransform.applyInverse(r,r),r}static calculateTransformedCorners(t,r=t.worldTransform,n,i=0){const s=t.getLocalBounds();return t.getBounds(),n=n||[new gt,new gt,new gt,new gt],n[i].set(s.x,s.y),n[i+1].set(s.x+s.width,s.y),n[i+2].set(s.x+s.width,s.y+s.height),n[i+3].set(s.x,s.y+s.height),r.apply(n[i],n[i]),r.apply(n[i+1],n[i+1]),r.apply(n[i+2],n[i+2]),r.apply(n[i+3],n[i+3]),n}static calculateOrientedBounds(t,r){const n=t.parent?t.parent:t.enableTempParent();t.updateTransform(),t.disableTempParent(n),b1(yh,t.worldTransform),yh.updateLocalTransform();const i=yh.rotation,s=nn.calculateTransformedCorners(t,t.worldTransform,ER),o=(s[0].x+s[1].x+s[2].x+s[3].x)/4,a=(s[0].y+s[1].y+s[2].y+s[3].y)/4,l=Fo.identity().translate(-o,-a).rotate(-yh.rotation).translate(o,a);return l.apply(s[0],s[0]),l.apply(s[1],s[1]),l.apply(s[2],s[2]),l.apply(s[3],s[3]),r=r||new dh,r.rotation=i,r.innerBounds.x=Math.min(s[0].x,s[1].x,s[2].x,s[3].x),r.innerBounds.y=Math.min(s[0].y,s[1].y,s[2].y,s[3].y),r.innerBounds.width=Math.max(s[0].x,s[1].x,s[2].x,s[3].x)-r.innerBounds.x,r.innerBounds.height=Math.max(s[0].y,s[1].y,s[2].y,s[3].y)-r.innerBounds.y,r}static calculateGroupOrientedBounds(t,r,n,i=!1){const s=t.length,o=vh.allocateArray(s*4);for(let d=0;d<s;d++){const m=t[d];if(!i){const g=m.parent?m.parent:m.enableTempParent();m.updateTransform(),m.disableTempParent(g)}nn.calculateTransformedCorners(m,m.worldTransform,o,d*4)}const a=Fo.identity().rotate(-r);let l=Number.MAX_VALUE,h=Number.MAX_VALUE,f=-Number.MAX_VALUE,p=-Number.MAX_VALUE;for(let d=0,m=o.length;d<m;d++){const g=o[d];a.apply(g,g);const y=g.x,v=g.y;l=y<l?y:l,h=v<h?v:h,f=y>f?y:f,p=v>p?v:p}return vh.releaseArray(o),n=n||new dh,n.innerBounds.x=l,n.innerBounds.y=h,n.innerBounds.width=f-l,n.innerBounds.height=p-h,n.rotation=r,a.applyInverse(n.center,Uo),n.center.copyFrom(Uo),n}};function DR(e,t,r,n){for(const i in t){const s=r[i],o=n[i],a=t[i];s!==o&&(s&&e.off(a,s),o&&e.on(a,o))}}const bh={},LR=ee.IDENTITY,BR={transformchange:"transformchange",transformcommit:"transformcommit"},FR=Xt.PixiComponent("Transformer",{create:e=>new NR(e),applyProps(e,t,r){if(Xt.applyDefaultProps(e,t,r),DR(e,BR,t,r),r.cursors&&Object.assign(e.cursors,r.cursors),e.group=r.group||[],e.boundingBoxes=r.boundingBoxes||"all",e.boxScalingEnabled=r.boxScalingEnabled===!0,e.boxScalingTolerance=r.boxScalingTolerance!==void 0?r.boxScalingTolerance:e.boxScalingTolerance,e.boxRotationEnabled=r.boxRotationEnabled===!0,e.boxRotationTolerance=r.boxRotationTolerance!==void 0?r.boxRotationTolerance:e.boxRotationTolerance,e.centeredScaling=r.centeredScaling,e.enabledHandles=r.enabledHandles,e.lockAspectRatio=r.lockAspectRatio,e.projectionTransform.copyFrom(r.projectionTransform||LR),e.skewRadius=r.skewRadius||e.skewRadius,e.rotateEnabled=r.rotateEnabled!==!1,e.scaleEnabled=r.scaleEnabled!==!1,e.skewEnabled=r.skewEnabled===!0,e.translateEnabled=r.translateEnabled!==!1,e.transientGroupTilt=r.transientGroupTilt,t.handleConstructor!==r.handleConstructor)throw new Error("Transformer does not support changing the TransformerHandleConstructor!");t.rotationSnaps!==r.rotationSnaps&&(e.rotationSnaps=r.rotationSnaps),t.rotationSnapTolerance!==r.rotationSnapTolerance&&(e.rotationSnapTolerance=r.rotationSnapTolerance),t.skewSnaps!==r.skewSnaps&&(e.skewSnaps=r.skewSnaps),t.skewSnapTolerance!==r.skewSnapTolerance&&(e.skewSnapTolerance=r.skewSnapTolerance);const n=t.handleStyle||bh,i=r.handleStyle||bh;(n.color!==i.color||n.outlineColor!==i.outlineColor||n.outlineThickness!==i.outlineThickness||n.radius!==i.radius||n.shape!==i.shape)&&(e.handleStyle=i);const s=t.wireframeStyle||bh,o=r.wireframeStyle||bh;(s.color!==o.color||s.thickness!==o.thickness)&&(e.wireframeStyle=o)}}),bp=({pixiTransformerRef:e,imageRef:t,transformCommit:r,transformChange:n,mouseoverEvent:i,onDoubleClick:s,uniqueId:o=""})=>{console.log("transformer props",{pixiTransformerRef:e,imageRef:t,transformCommit:r,transformChange:n,mouseoverEvent:i,onDoubleClick:s,uniqueId:o});const a=Py("#F3C409"),l=Py("#F3C409"),h=Bt.useRef({isDragging:!1}),f=Bt.useCallback(()=>{i&&!h.current.isDragging&&i(!0)},[i]),p=Bt.useCallback(()=>{i&&!h.current.isDragging&&i(!1)},[i]),d=Bt.useCallback(()=>{h.current.isDragging=!0},[]),m=Bt.useCallback(()=>{h.current.isDragging=!1},[]),g=Bt.useCallback(v=>{h.current.isDragging=!0,n&&n(v)},[n]),y=Bt.useCallback(()=>{if(t.current===null)return;const v=t.current.x,_=t.current.y,x=t.current.width,T=t.current.height,w=t.current.rotation,E=[t.current.scale.x,t.current.scale.y];r&&r({uniqueId:o,transformation:{x:Math.round(v),y:Math.round(_),width:Math.round(Math.max(5,x)),height:Math.round(Math.max(5,T)),rotate:Math.round(w),scale:E}}),h.current.isDragging=!1},[r]);return Bt.useEffect(()=>(e.current&&(e.current.on("mouseover",f),e.current.on("mouseout",p),e.current.on("mousedown",d),e.current.on("mouseup",m)),()=>{e.current&&(e.current.off("mouseover",f),e.current.off("mouseout",p),e.current.off("mousedown",d),e.current.off("mouseup",m))}),[]),zt.jsx(FR,{ref:e,group:[t.current],rotateEnabled:!0,boxRotationEnabled:!0,centeredScaling:!0,boxScalingEnabled:!0,wireframeStyle:{thickness:1,color:l},lockAspectRatio:!0,scaleEnabled:!0,handleStyle:{outlineColor:a,shape:"circle",radius:9},transformchange:g,transformcommit:y})};var xh={};Object.defineProperty(xh,"__esModule",{value:!0});var UR=dt,xp;function A1(){return xp||(xp=document.createElement("div")),xp}function jR(e,t,r){var n;return UR.useEffect(function(){n=n||A1();var i=function(s){var o=s.detail;t(o)};return n.addEventListener(e,i,!1),function(){n==null||n.removeEventListener(e,i,!1)}},r),function(i){n=i}}function GR(e,t){var r=A1(),n=new CustomEvent(e,{detail:t});r.dispatchEvent(n)}function HR(){var e;function t(r){e=r}return t.emit=function(r,n){var i=new CustomEvent(r,{bubbles:!0,detail:n});e==null||e.dispatchEvent(i)},t}var P1=xh.emitCustomEvent=GR;xh.newCustomEventEmitter=HR;var rl=xh.useCustomEventListener=jR;const jo=Bt.createContext({}),Ki={STOP:"GSAP_STOP",PAUSE:"GSAP_PAUSE",PLAY:"GSAP_PLAY",RESUME:"GSAP_RESUME",RESTART:"GSAP_RESTART",REPEAT:"GSAP_REPEAT",SEEK:"GSAP_SEEK",RESET:"GSAP_RESET",DRAGGING_START:"GSAP_DRAGGING_START",DRAGGING_END:"GSAP_DRAGGING_END"},$R=({children:e})=>{const[t,r]=dt.useState(!1),[n,i]=dt.useState(!1),s=dt.useRef(),o=dt.useRef(),a=dt.useRef(.001);dt.useLayoutEffect(()=>(o.current=bn.context(()=>{s.current&&s.current.progress(0).kill(),s.current=bn.timeline({paused:!0,defaults:{duration:0}})}),()=>o.current.revert()),[]);const l=dt.useCallback(()=>{let x=s.current.time();a.current=x},[]);dt.useEffect(()=>{const _=s.current;_.eventCallback("onStart",function(){}).eventCallback("onInterrupt",function(){_.pause(),l()}).eventCallback("onUpdate",function(){l()}).eventCallback("onPause",function(){console.log("onPause",_.progress()),l()}).eventCallback("onResume",function(){console.log("onResume",_.progress()),l()}).eventCallback("onComplete",function(){_.seek(0),_.pause(),l()})},[]);const h=dt.useCallback(()=>{s.current.revert()},[]),f=dt.useCallback(()=>{s.current.restart(),r(!0)},[]),p=dt.useCallback(()=>{const _=s.current;_.repeat(1),_.restart()},[]),d=dt.useCallback(_=>{s.current.seek(_)},[]),m=dt.useCallback(()=>{s.current.seek(4)},[]),g=dt.useCallback(()=>{const _=s.current;return _?_.totalDuration():0},[]),y=()=>{s.current.pause(),P1(Ki.PAUSE),r(!1)},v=()=>{const _=s.current;r(!0),_.resume(),P1(Ki.RESUME)};return rl(Ki.DRAGGING_START,()=>{console.log("dragging start"),i(!0)}),rl(Ki.DRAGGING_END,()=>{i(!1),console.log("dragging end")}),console.log("set play updated",t),zt.jsx(jo.Provider,{value:{gsapCtx:o,tl:s,handlePlay:v,handlePause:y,handleReset:h,handleSeek:d,handleSeekTest:m,handleRestart:f,handleRepeat:p,playerTimeRef:a,isDragging:n,getTimelineDuration:g},children:e})},wp=e=>{let t={};switch(e){case"NONE":case"none":break;case"BOUNCE_IN":t.from={duration:2,ease:"bounce.out",y:-1500};break;case"BOUNCE_IN_DOWN":t.from={ease:"bounce.out",y:-1500,duration:2};break;case"BOUNCE_IN_LEFT":t.from={ease:"bounce.out",x:-1500,duration:2};break;case"BOUNCE_IN_RIGHT":t.from={ease:"bounce.out",x:1500,duration:2};break;case"BOUNCE_IN_UP":t.from={ease:"bounce.out",y:1500,duration:2};break;case"BOUNCE_OUT":t.from={ease:"bounce.in",y:2,duration:2};break;case"BOUNCE_OUT_DOWN":break;case"BOUNCE_OUT_LEFT":break;case"BOUNCE_OUT_RIGHT":break;case"BOUNCE_OUT_UP":break;case"FADE_IN":t.to={ease:"power4.in",alpha:1,duration:.5};break;case"FADE_IN_DOWN":t.fromTo={from:{y:-1e3,alpha:0},to:{ease:"power4.in",y:0,alpha:1,duration:1}};break;case"FADE_IN_LEFT":t.fromTo={from:{x:-1e3,alpha:0},to:{ease:"power4.in",x:0,alpha:1,duration:1}};break;case"FADE_IN_RIGHT":t.fromTo={from:{x:2e3,alpha:0},to:{ease:"power4.in",x:0,alpha:1,duration:1}};break;case"FADE_IN_UP":t.fromTo={from:{y:2e3,alpha:0},to:{ease:"power4.in",y:0,alpha:1,duration:1}};break}return t};var zR=Object.prototype;function VR(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||zR;return e===r}var C1=VR;function qR(e,t){return function(r){return e(t(r))}}var WR=qR,XR=WR,YR=XR(Object.keys,Object),KR=YR,ZR=C1,QR=KR,JR=Object.prototype,tk=JR.hasOwnProperty;function ek(e){if(!ZR(e))return QR(e);var t=[];for(var r in Object(e))tk.call(e,r)&&r!="constructor"&&t.push(r);return t}var O1=ek,rk=typeof Ci=="object"&&Ci&&Ci.Object===Object&&Ci,I1=rk,nk=I1,ik=typeof self=="object"&&self&&self.Object===Object&&self,sk=nk||ik||Function("return this")(),xi=sk,ok=xi,ak=ok.Symbol,wh=ak,R1=wh,k1=Object.prototype,lk=k1.hasOwnProperty,uk=k1.toString,nl=R1?R1.toStringTag:void 0;function hk(e){var t=lk.call(e,nl),r=e[nl];try{e[nl]=void 0;var n=!0}catch{}var i=uk.call(e);return n&&(t?e[nl]=r:delete e[nl]),i}var ck=hk,fk=Object.prototype,dk=fk.toString;function pk(e){return dk.call(e)}var mk=pk,M1=wh,gk=ck,yk=mk,vk="[object Null]",_k="[object Undefined]",N1=M1?M1.toStringTag:void 0;function bk(e){return e==null?e===void 0?_k:vk:N1&&N1 in Object(e)?gk(e):yk(e)}var il=bk;function xk(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Tp=xk,wk=il,Tk=Tp,Ek="[object AsyncFunction]",Sk="[object Function]",Ak="[object GeneratorFunction]",Pk="[object Proxy]";function Ck(e){if(!Tk(e))return!1;var t=wk(e);return t==Sk||t==Ak||t==Ek||t==Pk}var D1=Ck,Ok=xi,Ik=Ok["__core-js_shared__"],Rk=Ik,Ep=Rk,L1=function(){var e=/[^.]+$/.exec(Ep&&Ep.keys&&Ep.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function kk(e){return!!L1&&L1 in e}var Mk=kk,Nk=Function.prototype,Dk=Nk.toString;function Lk(e){if(e!=null){try{return Dk.call(e)}catch{}try{return e+""}catch{}}return""}var B1=Lk,Bk=D1,Fk=Mk,Uk=Tp,jk=B1,Gk=/[\\^$.*+?()[\]{}|]/g,Hk=/^\[object .+?Constructor\]$/,$k=Function.prototype,zk=Object.prototype,Vk=$k.toString,qk=zk.hasOwnProperty,Wk=RegExp("^"+Vk.call(qk).replace(Gk,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Xk(e){if(!Uk(e)||Fk(e))return!1;var t=Bk(e)?Wk:Hk;return t.test(jk(e))}var Yk=Xk;function Kk(e,t){return e==null?void 0:e[t]}var Zk=Kk,Qk=Yk,Jk=Zk;function tM(e,t){var r=Jk(e,t);return Qk(r)?r:void 0}var Go=tM,eM=Go,rM=xi,nM=eM(rM,"DataView"),iM=nM,sM=Go,oM=xi,aM=sM(oM,"Map"),Sp=aM,lM=Go,uM=xi,hM=lM(uM,"Promise"),cM=hM,fM=Go,dM=xi,pM=fM(dM,"Set"),mM=pM,gM=Go,yM=xi,vM=gM(yM,"WeakMap"),_M=vM,Ap=iM,Pp=Sp,Cp=cM,Op=mM,Ip=_M,F1=il,Ho=B1,U1="[object Map]",bM="[object Object]",j1="[object Promise]",G1="[object Set]",H1="[object WeakMap]",$1="[object DataView]",xM=Ho(Ap),wM=Ho(Pp),TM=Ho(Cp),EM=Ho(Op),SM=Ho(Ip),Bs=F1;(Ap&&Bs(new Ap(new ArrayBuffer(1)))!=$1||Pp&&Bs(new Pp)!=U1||Cp&&Bs(Cp.resolve())!=j1||Op&&Bs(new Op)!=G1||Ip&&Bs(new Ip)!=H1)&&(Bs=function(e){var t=F1(e),r=t==bM?e.constructor:void 0,n=r?Ho(r):"";if(n)switch(n){case xM:return $1;case wM:return U1;case TM:return j1;case EM:return G1;case SM:return H1}return t});var z1=Bs;function AM(e){return e!=null&&typeof e=="object"}var sl=AM,PM=il,CM=sl,OM="[object Arguments]";function IM(e){return CM(e)&&PM(e)==OM}var RM=IM,V1=RM,kM=sl,q1=Object.prototype,MM=q1.hasOwnProperty,NM=q1.propertyIsEnumerable,DM=V1(function(){return arguments}())?V1:function(e){return kM(e)&&MM.call(e,"callee")&&!NM.call(e,"callee")},Rp=DM,LM=Array.isArray,Yn=LM,BM=9007199254740991;function FM(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=BM}var kp=FM,UM=D1,jM=kp;function GM(e){return e!=null&&jM(e.length)&&!UM(e)}var Th=GM,Eh={exports:{}};function HM(){return!1}var $M=HM;Eh.exports,function(e,t){var r=xi,n=$M,i=t&&!t.nodeType&&t,s=i&&!0&&e&&!e.nodeType&&e,o=s&&s.exports===i,a=o?r.Buffer:void 0,l=a?a.isBuffer:void 0,h=l||n;e.exports=h}(Eh,Eh.exports);var Mp=Eh.exports,zM=il,VM=kp,qM=sl,WM="[object Arguments]",XM="[object Array]",YM="[object Boolean]",KM="[object Date]",ZM="[object Error]",QM="[object Function]",JM="[object Map]",tN="[object Number]",eN="[object Object]",rN="[object RegExp]",nN="[object Set]",iN="[object String]",sN="[object WeakMap]",oN="[object ArrayBuffer]",aN="[object DataView]",lN="[object Float32Array]",uN="[object Float64Array]",hN="[object Int8Array]",cN="[object Int16Array]",fN="[object Int32Array]",dN="[object Uint8Array]",pN="[object Uint8ClampedArray]",mN="[object Uint16Array]",gN="[object Uint32Array]",fe={};fe[lN]=fe[uN]=fe[hN]=fe[cN]=fe[fN]=fe[dN]=fe[pN]=fe[mN]=fe[gN]=!0,fe[WM]=fe[XM]=fe[oN]=fe[YM]=fe[aN]=fe[KM]=fe[ZM]=fe[QM]=fe[JM]=fe[tN]=fe[eN]=fe[rN]=fe[nN]=fe[iN]=fe[sN]=!1;function yN(e){return qM(e)&&VM(e.length)&&!!fe[zM(e)]}var vN=yN;function _N(e){return function(t){return e(t)}}var bN=_N,Sh={exports:{}};Sh.exports,function(e,t){var r=I1,n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===n,o=s&&r.process,a=function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();e.exports=a}(Sh,Sh.exports);var xN=Sh.exports,wN=vN,TN=bN,W1=xN,X1=W1&&W1.isTypedArray,EN=X1?TN(X1):wN,Np=EN,SN=O1,AN=z1,PN=Rp,CN=Yn,ON=Th,IN=Mp,RN=C1,kN=Np,MN="[object Map]",NN="[object Set]",DN=Object.prototype,LN=DN.hasOwnProperty;function BN(e){if(e==null)return!0;if(ON(e)&&(CN(e)||typeof e=="string"||typeof e.splice=="function"||IN(e)||kN(e)||PN(e)))return!e.length;var t=AN(e);if(t==MN||t==NN)return!e.size;if(RN(e))return!SN(e).length;for(var r in e)if(LN.call(e,r))return!1;return!0}var FN=BN;const Xr=us(FN),UN=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],Dp=e=>{const[t,r]=Bt.useState(!1),[,n]=dt.useState(!1),[,i]=dt.useState(!1),s=dt.useRef(null),o=dt.useRef(null),a=dt.useRef(null),l=dt.useRef(null),{tl:h}=dt.useContext(jo),{uniqueId:f,startAt:p,endAt:d,initialAlpha:m,transformation:{x:g,y,width:v,height:_,colorCorrection:x,animation:T,effect:w},applyTransformer:E}=e;console.log("all abstract props",e);const{contrast:I=1,saturation:P=1,brightness:C=1,alpha:M=1,blurRadius:R=0}=x||{},O={...C>1&&{brightness:C},...I>1&&{contrast:I},...P>1&&{saturation:P},...M!==0&&{alpha:M}};Bt.useEffect(()=>{s.current&&r(!0)},[]),Bt.useEffect(()=>{let q=bn.context(()=>{});if(s.current&&h.current){const z={duration:Number(d)-Number(p)},W=wp(T||"None");q=bn.context(()=>{var V,F;Xr(W.from)?Xr(W.to)?Xr(W.fromTo)?h.current.to(s.current,{alpha:1,duration:.01},p).from(a.current,{...z},p).to(s.current,{alpha:0,duration:.1},Number(d)-.1):h.current.fromTo(s.current,(V=W.fromTo)==null?void 0:V.from,(F=W.fromTo)==null?void 0:F.to,p).from(a.current,{...z},p).to(s.current,{alpha:0,duration:.2},d-.2):h.current.to(s.current,{alpha:1,duration:.2,...W.to},p).from(a.current,{...z},p).to(s.current,{alpha:0,duration:.2},d-.2):h.current.from(s.current,{...W.from},p).to(a.current,{alpha:1,duration:.2},p).from(a.current,{...z},p).to(s.current,{alpha:0,duration:.2},d-.2)})}return()=>q.revert()},[T,p,d]);const k=Bt.useCallback(()=>{n(!0)},[]),N=Bt.useCallback(q=>{console.log("changeEnd",q),e.onAnchorTransformationEnd&&(console.log("running onAnchorTransformationEnd"),e.onAnchorTransformationEnd(q))},[]),L=Xt.withFilters(Xt.Container,{...R>0&&{blur:Xi.BlurFilter},...!Xr(O)&&{adjust:lp},matrix:Xi.ColorMatrixFilter}),j=(x==null?void 0:x.enabled)||w&&w!==Ls.Normal;return zt.jsxs(Xt.Container,{ref:o,children:[zt.jsxs(Xt.Container,{ref:s,alpha:m,position:[g,y],pivot:[g,y],width:v,height:_,children:[j&&zt.jsx(L,{scale:1,blur:{blur:R,quality:4},adjust:O,apply:({matrix:q})=>{w===Ls.BlackAndWhite?q.desaturate():w===Ls.Sepia?q.sepia():w===Ls.RetroVintage||w===Ls.NightVision?q.negative():w===Ls.Normal&&q.reset()},matrix:{enabled:!0,matrix:UN},children:zt.jsx(Xt.Container,{ref:a,children:e.children})}),!j&&zt.jsx(Xt.Container,{ref:a,children:e.children})]}),E&&t&&zt.jsx(bp,{pixiTransformerRef:l,imageRef:s,transformCommit:N,transformChange:k,mouseoverEvent:i,uniqueId:f})]})},jN=e=>{const t=dt.useRef(null),r=dt.useRef(null),{src:n,transformation:{x:i,y:s,width:o,height:a,anchor:l},pointerdown:h,pointerup:f,mousedown:p,mouseup:d,pointerover:m,mouseover:g,mouseout:y}=e;return zt.jsx(Dp,{...e,children:zt.jsx(Xt.Container,{ref:r,children:zt.jsx(Xt.Sprite,{image:n,width:o,height:a,anchor:l,ref:t,x:i,y:s,interactive:!0,pointerdown:h,pointerup:f,pointerover:m,mousedown:p,mouseup:d,mouseover:g,mouseout:y})})})};var GN=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Lp={},HN={get exports(){return Lp},set exports(e){Lp=e}};/*!
|
|
1242
|
+
}`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(e){this._stylesheet!==e&&(this._stylesheet=e,this.styleID++)}normalizeColor(e){return Array.isArray(e)&&(e=jS(e)),typeof e=="number"?US(e):e}dropShadowToCSS(){let e=this.normalizeColor(this.dropShadowColor);const t=this.dropShadowAlpha,r=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),n=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);e.startsWith("#")&&t<1&&(e+=(t*255|0).toString(16).padStart(2,"0"));const i=`${r}px ${n}px`;return this.dropShadowBlur>0?`text-shadow: ${i} ${this.dropShadowBlur}px ${e}`:`text-shadow: ${i} ${e}`}reset(){Object.assign(this,Do.defaultOptions)}onBeforeDraw(){const{fontsDirty:e}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&e?new Promise(t=>setTimeout(t,100)):Promise.resolve()}get isSafari(){const{userAgent:e}=Tt.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(e)}set fillGradientStops(e){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(e){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(e){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(e){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(e){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(e){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(e){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};let tl=Do;tl.availableFonts={},tl.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};const Lo=class extends Gn{constructor(e="",t={}){super(xt.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this._loading=!1,this.localStyleID=-1,this.dirty=!1,this.ownsStyle=!1;const r=new Image,n=xt.from(r,{scaleMode:Tt.SCALE_MODE,resourceOptions:{autoLoad:!1}});n.orig=new Gt,n.trim=new Gt,this.texture=n;const i="http://www.w3.org/2000/svg",s="http://www.w3.org/1999/xhtml",o=document.createElementNS(i,"svg"),a=document.createElementNS(i,"foreignObject"),l=document.createElementNS(s,"div"),h=document.createElementNS(s,"style");a.setAttribute("width","10000"),a.setAttribute("height","10000"),a.style.overflow="hidden",o.appendChild(a),this.maxWidth=Lo.defaultMaxWidth,this.maxHeight=Lo.defaultMaxHeight,this._domElement=l,this._styleElement=h,this._svgRoot=o,this._foreignObject=a,this._foreignObject.appendChild(h),this._foreignObject.appendChild(l),this._image=r,this._loadImage=new Image,this._autoResolution=Lo.defaultAutoResolution,this._resolution=Lo.defaultResolution??Tt.RESOLUTION,this.text=e,this.style=t}measureText(e){var a,l;const{text:t,style:r,resolution:n}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},e);Object.assign(this._domElement,{innerHTML:t,style:r.toCSS(n)}),this._styleElement.textContent=r.toGlobalCSS(),document.body.appendChild(this._svgRoot);const i=this._domElement.getBoundingClientRect();this._svgRoot.remove();const s=Math.min(this.maxWidth,Math.ceil(i.width)),o=Math.min(this.maxHeight,Math.ceil(i.height));return this._svgRoot.setAttribute("width",s.toString()),this._svgRoot.setAttribute("height",o.toString()),t!==this._text&&(this._domElement.innerHTML=this._text),r!==this._style&&(Object.assign(this._domElement,{style:(a=this._style)==null?void 0:a.toCSS(n)}),this._styleElement.textContent=(l=this._style)==null?void 0:l.toGlobalCSS()),{width:s+r.padding*2,height:o+r.padding*2}}async updateText(e=!0){const{style:t,_image:r,_loadImage:n}=this;if(this.localStyleID!==t.styleID&&(this.dirty=!0,this.localStyleID=t.styleID),!this.dirty&&e)return;const{width:i,height:s}=this.measureText();r.width=n.width=Math.ceil(Math.max(1,i)),r.height=n.height=Math.ceil(Math.max(1,s)),this._loading||(this._loading=!0,await new Promise(o=>{n.onload=async()=>{await t.onBeforeDraw(),this._loading=!1,r.src=n.src,n.onload=null,n.src="",this.updateTexture(),o()};const a=new XMLSerializer().serializeToString(this._svgRoot);n.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(a)}`}))}get source(){return this._image}updateTexture(){const{style:e,texture:t,_image:r,resolution:n}=this,{padding:i}=e,{baseTexture:s}=t;t.trim.width=t._frame.width=r.width/n,t.trim.height=t._frame.height=r.height/n,t.trim.x=-i,t.trim.y=-i,t.orig.width=t._frame.width-i*2,t.orig.height=t._frame.height-i*2,this._onTextureUpdate(),s.setRealSize(r.width,r.height,n),this.dirty=!1}_render(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._render(e)}_renderCanvas(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._renderCanvas(e)}getLocalBounds(e){return this.updateText(!0),super.getLocalBounds(e)}_calculateBounds(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_onStyleChange(){this.dirty=!0}destroy(e){var r,n,i,s,o;typeof e=="boolean"&&(e={children:e}),e=Object.assign({},Lo.defaultDestroyOptions,e),super.destroy(e);const t=null;this.ownsStyle&&((r=this._style)==null||r.cleanFonts()),this._style=t,(n=this._svgRoot)==null||n.remove(),this._svgRoot=t,(i=this._domElement)==null||i.remove(),this._domElement=t,(s=this._foreignObject)==null||s.remove(),this._foreignObject=t,(o=this._styleElement)==null||o.remove(),this._styleElement=t,this._loadImage.src="",this._loadImage.onload=null,this._loadImage=t,this._image.src="",this._image=t}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._image.width/this.resolution}set width(e){this.updateText(!0);const t=ki(this.scale.x)||1;this.scale.x=t*e/this._image.width/this.resolution,this._width=e}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._image.height/this.resolution}set height(e){this.updateText(!0);const t=ki(this.scale.y)||1;this.scale.y=t*e/this._image.height/this.resolution,this._height=e}get style(){return this._style}set style(e){this._style!==e&&(e=e||{},e instanceof tl?(this.ownsStyle=!1,this._style=e):e instanceof Hn?(console.warn("[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle"),this.ownsStyle=!0,this._style=tl.from(e)):(this.ownsStyle=!0,this._style=new tl(e)),this.localStyleID=-1,this.dirty=!0)}get text(){return this._text}set text(e){e=String(e===""||e===null||e===void 0?" ":e),e=this.sanitiseText(e),this._text!==e&&(this._text=e,this.dirty=!0)}get resolution(){return this._resolution}set resolution(e){this._autoResolution=!1,this._resolution!==e&&(this._resolution=e,this.dirty=!0)}sanitiseText(e){return e.replace(/<br>/gi,"<br/>").replace(/<hr>/gi,"<hr/>").replace(/ /gi," ")}};let ch=Lo;ch.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},ch.defaultMaxWidth=2024,ch.defaultMaxHeight=2024,ch.defaultAutoResolution=!0;var Ls=(e=>(e.BlackAndWhite="BlackAndWhite",e.Sepia="Sepia",e.RetroVintage="RetroVintage",e.NightVision="NightVision",e.Normal="Normal",e.None="Normal",e))(Ls||{});class fh{constructor(t=0,r=0,n=0,i=0){this._x=Number(t),this._y=Number(r),this._width=Number(n),this._height=Number(i),this._hull=[new gt,new gt,new gt,new gt],this.currentID=-1,this.dirtyID=0}get x(){return this._x}set x(t){this._x=t,this.dirtyID++}get y(){return this._y}set y(t){this._y=t,this.dirtyID++}get width(){return this._width}set width(t){this._width=t,this.dirtyID++}get height(){return this._height}set height(t){this._height=t,this.dirtyID++}get hull(){return this.isDirty()&&this.update(),this._hull}get topLeft(){return this.isDirty()&&this.update(),this._hull[0]}get topRight(){return this.isDirty()&&this.update(),this._hull[1]}get bottomRight(){return this.isDirty()&&this.update(),this._hull[2]}get bottomLeft(){return this.isDirty()&&this.update(),this._hull[3]}isDirty(){return this.currentID!==this.dirtyID}update(){const[t,r,n,i]=this._hull;t.set(this._x,this._y),r.set(this._x+this._width,this._y),n.set(this._x+this._width,this._y+this._height),i.set(this._x,this._y+this._height)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}clone(){return new fh(this.x,this.y,this.width,this.height)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}contains(t,r){return this.width<=0||this.height<=0?!1:t>=this.x&&t<this.x+this.width&&r>=this.y&&r<this.y+this.height}equals(t){return t?t.x===this.x&&t.y===this.y&&t.width===this.width&&t.height===this.height:!1}pad(t=0,r=t){return this.x-=t,this.y-=r,this.width+=t*2,this.height+=r*2,this}fit(t){const r=Math.max(this.x,t.x),n=Math.min(this.x+this.width,t.x+t.width),i=Math.max(this.y,t.y),s=Math.min(this.y+this.height,t.y+t.height);return this.x=r,this.width=Math.max(n-r,0),this.y=i,this.height=Math.max(s-i,0),this}ceil(t=1,r=.001){const n=Math.ceil((this.x+this.width-r)*t)/t,i=Math.ceil((this.y+this.height-r)*t)/t;return this.x=Math.floor((this.x+r)*t)/t,this.y=Math.floor((this.y+r)*t)/t,this.width=n-this.x,this.height=i-this.y,this}enlarge(t){const r=Math.min(this.x,t.x),n=Math.max(this.x+this.width,t.x+t.width),i=Math.min(this.y,t.y),s=Math.max(this.y+this.height,t.y+t.height);return this.x=r,this.width=n-r,this.y=i,this.height=s-i,this}}const c1=new gt;class dh{constructor(t=0,r=0,n=0,i=0,s=0){t instanceof fh&&(s=r||0,r=t.y,n=t.width,i=t.height,t=t.x),this.innerBounds=new fh(t,r,n,i),this._rotation=s,this._center=new Un(this.updateCenter,this),this._hull=[new gt,new gt,new gt,new gt],this._matrix=new ee,this.currentID=-1,this.dirtyID=0}get rotation(){return this._rotation}set rotation(t){this._rotation=t,this.dirtyID++}get center(){return this.isDirty()&&this.update(),this._center}set center(t){this.center.copyFrom(t)}get hull(){return this.isDirty()&&this.update(),this._hull}get topLeft(){return this.isDirty()&&this.update(),this._hull[0]}get topRight(){return this.isDirty()&&this.update(),this._hull[1]}get bottomRight(){return this.isDirty()&&this.update(),this._hull[2]}get bottomLeft(){return this.isDirty()&&this.update(),this._hull[3]}equals(t){return t?this.innerBounds.equals(t.innerBounds)&&this.rotation===t.rotation:!1}contains(t,r){typeof t=="number"&&(t=c1.set(t,r));const n=this._matrix.applyInverse(t,c1);return this.innerBounds.contains(n.x,n.y)}copyFrom(t){return this.innerBounds.copyFrom(t.innerBounds),this.rotation=t.rotation,this.dirtyID++,this}isDirty(){return this.currentID!==this.dirtyID+this.innerBounds.dirtyID}update(){const t=this.innerBounds,r=this._rotation,n=this._center,[i,s,o,a]=this._hull,l=this._matrix;n._x=t.x+t.width/2,n._y=t.y+t.height/2,l.identity().translate(-n.x,-n.y).rotate(r).translate(n.x,n.y),l.apply(t.topLeft,i),l.apply(t.topRight,s),l.apply(t.bottomRight,o),l.apply(t.bottomLeft,a),this.currentID=this.dirtyID+this.innerBounds.dirtyID}updateCenter(){const t=this.center,r=this.innerBounds;r.x=t.x-r.width/2,r.y=t.y-r.height/2}}class f1{constructor(t,r){this._history=new Array(t),this._decayRatio=r,this._currentIndex=0;for(let n=0;n<t;n++)this._history[n]=0}next(t){const{_history:r,_decayRatio:n}=this,i=r.length;this._currentIndex=this._currentIndex<i-1?this._currentIndex+1:0,r[this._currentIndex]=t;let s=0,o=0;for(let a=this._currentIndex+1;a<i;a++)s=(s+r[a])*n,o=(o+1)*n;for(let a=0;a<=this._currentIndex;a++)s=(s+r[a])*n,o=(o+1)*n;return this._average=s/o,this._average}absDev(){let t=0;for(let r=0,n=this._history.length;r<n;r++)t+=Math.abs(this._history[r]-this._average);return t/this._history.length}}class ph{constructor(t={}){ph.prototype.__init.call(this),this._freeList=[],this._freeCount=0,this._borrowRate=0,this._returnRate=0,this._flowRate=0,this._borrowRateAverage=0,this._reserveCount=t.reserve||0,this._capacityRatio=t.capacityRatio||1.2,this._decayRatio=t.decayRatio||.67,this._marginAverage=0,this._borrowRateAverageProvider=new f1(128,this._decayRatio),this._marginAverageProvider=new f1(128,this._decayRatio)}get capacity(){return this._freeList.length}set capacity(t){this._freeList.length=Math.ceil(t)}allocate(){return++this._borrowRate,++this._flowRate,this._freeCount>0?this._freeList[--this._freeCount]:this.create()}allocateArray(t){let r,n;Array.isArray(t)?(r=t,n=t.length):(n=t,r=new Array(n)),this._borrowRate+=n,this._flowRate+=n;let i=0;if(this._freeCount>0){const s=this._freeList,o=Math.min(this._freeCount,n);let a=this._freeCount;for(let l=0;l<o;l++)r[i]=s[a-1],++i,--a;this._freeCount=a}for(;i<n;)r[i]=this.create(),++i;return r}release(t){++this._returnRate,--this._flowRate,this._freeCount===this.capacity&&(this.capacity*=this._capacityRatio),this._freeList[this._freeCount]=t,++this._freeCount}releaseArray(t){this._returnRate+=t.length,this._flowRate-=t.length,this._freeCount+t.length>this.capacity&&(this.capacity=Math.max(this.capacity*this._capacityRatio,this._freeCount+t.length));for(let r=0,n=t.length;r<n;r++)this._freeList[this._freeCount]=t[r],++this._freeCount}reserve(t){if(this._reserveCount=t,this._freeCount<t){const r=this._freeCount-t;for(let n=0;n<r;n++)this._freeList[this._freeCount]=this.create(),++this._freeCount}}limit(t){if(this._freeCount>t){this.capacity>t*this._capacityRatio&&(this.capacity=t*this._capacityRatio);const n=Math.min(this._freeCount,this.capacity);for(let i=t;i<n;i++)this._freeList[i]=null}}startGC(t=ie.shared){t.add(this._gcTick,null,fi.UTILITY)}stopGC(t=ie.shared){t.remove(this._gcTick)}__init(){this._gcTick=()=>{this._borrowRateAverage=this._borrowRateAverageProvider.next(this._borrowRate),this._marginAverage=this._marginAverageProvider.next(this._freeCount-this._borrowRate);const t=this._borrowRateAverageProvider.absDev();this._flowRate=0,this._borrowRate=0,this._returnRate=0;const r=this._freeCount,n=this._freeList.length;if(r<128&&this._borrowRateAverage<128&&n<128)return;const i=Math.max(this._borrowRateAverage*(this._capacityRatio-1),this._reserveCount);if(this._freeCount>i+t){const s=i+t;this.capacity=Math.min(this._freeList.length,Math.ceil(s)),this._freeCount=this._freeList.length}}}}var yp;const d1=new Map;class p1{static build(t){let r=d1.get(t);return r||(r=new class extends ph{create(){return new t}},d1.set(t,r),r)}static buildFunctional(t){return new(yp=class extends ph{constructor(...n){super(...n),yp.prototype.__init.call(this)}__init(){this.create=t}},yp)}}const m1={color:16777215,outlineColor:0,outlineThickness:1,radius:8,shape:"tooth"},cR=gr;class fR extends cR{constructor(t,r,n={},i,s,o){super(),this.transformer=t;const a=Object.assign({},m1,n);this._handle=r,this._style=a,this.onHandleDelta=i,this.onHandleCommit=s,this._dirty=!0,this.interactive=!0,this.cursor=o||"move",this._pointerDown=!1,this._pointerDragging=!1,this._pointerPosition=new gt,this._pointerMoveTarget=null,this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onpointerdown=this.onPointerDown,this.onpointermove=this.onPointerMove,this.onpointerup=this.onPointerUp,this.onpointerupoutside=this.onPointerUp}get handle(){return this._handle}set handle(t){this._handle=t,this._dirty=!0}get style(){return this._style}set style(t){this._style=Object.assign({},m1,t),this._dirty=!0}render(t){this._dirty&&(this.draw(),this._dirty=!1),super.render(t)}draw(){const t=this._handle,r=this._style,n=r.radius;if(this.clear().lineStyle(r.outlineThickness,r.outlineColor).beginFill(r.color),r.shape==="square")this.drawRect(-n/2,-n/2,n,n);else if(r.shape==="tooth")switch(t){case"middleLeft":this.drawPolygon([-n/2,-n/2,-n/2,n/2,n/2,n/2,n*1.1,0,n/2,-n/2]);break;case"topCenter":this.drawPolygon([-n/2,-n/2,n/2,-n/2,n/2,n/2,0,n*1.1,-n/2,n/2]);break;case"middleRight":this.drawPolygon([-n/2,n/2,-n*1.1,0,-n/2,-n/2,n/2,-n/2,n/2,n/2]);break;case"bottomCenter":this.drawPolygon([0,-n*1.1,n/2,-n/2,n/2,n/2,-n/2,n/2,-n/2,-n/2]);break;case"rotator":this.drawCircle(0,0,n/Math.sqrt(2));break;default:this.drawRect(-n/2,-n/2,n,n);break}else this.drawCircle(0,0,n);this.endFill()}onPointerDown(t){this._pointerDown=!0,this._pointerDragging=!1,t.stopPropagation(),this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null),this._pointerMoveTarget=this.transformer.stage||this,this._pointerMoveTarget.addEventListener("globalpointermove",this.onPointerMove)}onPointerMove(t){this._pointerDown&&(this._pointerDragging?this.onDrag(t):this.onDragStart(t),t.stopPropagation())}onPointerUp(t){this._pointerDragging&&this.onDragEnd(t),this._pointerDown=!1,this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null)}onDragStart(t){this._pointerPosition.copyFrom(t.data.global),this._pointerDragging=!0}onDrag(t){const r=t.data.global;this.onHandleDelta&&this.onHandleDelta(r),this._pointerPosition.copyFrom(r)}onDragEnd(t){this._pointerDragging=!1,this.onHandleCommit&&this.onHandleCommit()}}function mh(e,t,r,n){const{x:i,y:s}=r,{x:o,y:a}=n;if(Math.abs(o-i)<.01)return Math.abs(e-i);if(Math.abs(a-s)<.01)return Math.abs(t-s);const l=(a-s)/(o-i);return Math.abs((l*e-t+(a-l*o))/Math.sqrt(l*l+1))}const g1=p1.build(gt),dR=[new gt,new gt,new gt,new gt],pR=new ee,Bo=new gt,mR=[0,0,0,1,-1,1,-1,-1,1,-1,1,0],gR=[0,0,-1,0,-1,-1,1,-1,1,1,0,1],yR=[0,0,1,0,1,1,-1,1,-1,-1,0,-1],vR=[0,0,0,-1,1,-1,1,1,-1,1,-1,0],vp=new Array(12),_R=[mR,gR,yR,vR],bR=gr;class xR extends bR{constructor(t){super(),this.transformer=t,this.boxScalingHandles=[this.addChild(new gr),this.addChild(new gr),this.addChild(new gr),this.addChild(new gr)],this.boxScalingHandles.forEach(r=>{r.interactive=!0}),this.boxScalingHandles[0].cursor=el.topCenter,this.boxScalingHandles[1].cursor=el.middleRight,this.boxScalingHandles[2].cursor=el.bottomCenter,this.boxScalingHandles[3].cursor=el.middleLeft}hitHandleType(t,r,n){const{boxRotationEnabled:i,boxRotationTolerance:s,boxScalingEnabled:o,boxScalingTolerance:a}=this.transformer,[l,h,f,p]=t.hull,{x:d,y:m}=r.applyInverse(n,Bo);if(o){const g=mh(d,m,l,h)*r.d,y=mh(d,m,l,p)*r.a,v=mh(d,m,h,f)*r.a,_=mh(d,m,p,f)*r.d,x=Math.min(g,y,v,_);if(x<a)switch(x){case g:return"topCenter";case y:return"middleLeft";case v:return"middleRight";case _:return"bottomCenter"}}if(i&&!t.contains(d,m)){const g=Math.sqrt((l.x-d)**2+(l.y-m)**2),y=Math.sqrt((h.x-d)**2+(h.y-m)**2),v=Math.sqrt((p.x-d)**2+(p.y-m)**2),_=Math.sqrt((f.x-d)**2+(f.y-m)**2),x=Math.min(g,y,v,_);if(x<s*1.45)switch(x){case g:return"boxRotateTopLeft";case y:return"boxRotateTopRight";case v:return"boxRotateBottomLeft";case _:return"boxRotateBottomRight"}}return null}drawBounds(t){const r=dR;for(let n=0;n<4;n++)this.transformer.projectToLocal(t.hull[n],r[n]);this.drawPolygon(r)}drawBoxScalingTolerance(t,r=this.transformer.boxScalingTolerance){t.innerBounds.pad(-r);const n=g1.allocateArray(4);n.forEach((s,o)=>{this.projectToLocal(t.hull[o],s)}),t.innerBounds.pad(2.5*r);const i=g1.allocateArray(4);i.forEach((s,o)=>{this.projectToLocal(t.hull[o],s)}),t.innerBounds.pad(-1.5*this.transformer.boxScalingTolerance);for(let s=0;s<4;s++){const o=n[s],a=n[(s+1)%4],l=i[s],h=i[(s+1)%4];this.boxScalingHandles[s].clear().beginFill(16777215,1e-4).drawPolygon(o,l,h,a).endFill()}}drawBoxRotationTolerance(){const{boxRotateTopLeft:t,boxRotateTopRight:r,boxRotateBottomLeft:n,boxRotateBottomRight:i}=this.transformer.handleAnchors,s=this.transformer.boxRotationTolerance*2,o=pR.identity().scale(s,s).rotate(this.transformer.getGroupBounds().rotation);for(let a=0;a<4;a++){const l=_R[a];let h;switch(a){case 0:h=t;break;case 1:h=r;break;case 2:h=n;break;case 3:h=i;break}for(let f=0;f<l.length;f+=2){const p=l[f],d=l[f+1];Bo.set(p,d),o.apply(Bo,Bo),vp[f]=Bo.x+h.x,vp[f+1]=Bo.y+h.y}this.drawPolygon(vp.slice())}}projectToLocal(t,r){return this.transformer.projectToLocal(t,r)}}const y1=new ee;function v1(e){const t=y1.identity();return t.c=Math.tan(e),t}function _1(e){const t=y1.identity();return t.b=Math.tan(e),t}function b1(e,t,r,n=e.pivot){const i=t.a,s=t.b,o=t.c,a=t.d,l=-Math.atan2(-o,a),h=Math.atan2(s,i);return r=r??h,e.pivot.set(n.x,n.y),e.rotation=r,e.skew.x=r+l,e.skew.y=-r+h,e.scale.x=Math.sqrt(i*i+s*s),e.scale.y=Math.sqrt(o*o+a*a),e.position.x=t.tx+(n.x*t.a+n.y*t.c),e.position.y=t.ty+(n.x*t.b+n.y*t.d),e}const gh=new ee,wR=new ee;function TR(e,t,r){if(!r){const s=e.parent?e.parent:e.enableTempParent();e.updateTransform(),e.disableTempParent(s)}const n=e.worldTransform,i=e.parent?wR.copyFrom(e.parent.worldTransform):ee.IDENTITY;gh.copyFrom(n),gh.prepend(t),gh.prepend(i.invert()),b1(e.transform,gh)}const yh=new wa,ER=[new gt,new gt,new gt,new gt],Fo=new ee,Uo=new gt,_p=new dh,SR=new Gt,x1=[new gt,new gt,new gt,new gt],w1=new gt,T1=new ee,vh=p1.build(gt),el={topLeft:"nw-resize",topCenter:"n-resize",topRight:"ne-resize",middleLeft:"w-resize",middleRight:"e-resize",bottomLeft:"sw-resize",bottomCenter:"s-resize",bottomRight:"se-resize"},_h=["topLeft","topCenter","topRight","middleLeft","middleCenter","middleRight","bottomLeft","bottomCenter","bottomRight"],E1={topLeft:{x:-1,y:-1},topCenter:{x:0,y:-1},topRight:{x:1,y:-1},middleLeft:{x:-1,y:0},middleCenter:{x:0,y:0},middleRight:{x:1,y:0},bottomLeft:{x:-1,y:1},bottomCenter:{x:0,y:1},bottomRight:{x:1,y:1}},AR=[..._h,"rotator","skewHorizontal","skewVertical"],PR=4,CR=16,OR=[Math.PI/4,Math.PI/2,Math.PI*3/4,Math.PI,0,-Math.PI/4,-Math.PI/2,-Math.PI*3/4,-Math.PI],IR=Math.PI/90,RR=[Math.PI/4,-Math.PI/4],kR=Math.PI/90,S1={color:0,thickness:2},MR=Je;let NR=class nn extends MR{constructor(t={}){super(),nn.prototype.__init.call(this),nn.prototype.__init2.call(this),nn.prototype.__init3.call(this),nn.prototype.__init4.call(this),nn.prototype.__init5.call(this),this.interactive=!0,this.cursors=Object.assign({default:"move"},t.cursors),this.cursor=this.cursors.default,this.boundingBoxes=t.boundingBoxes||"all",this.group=t.group||[],this.boxRotationTolerance=t.boxRotationTolerance||CR,this.boxScalingTolerance=t.boxScalingTolerance||PR,this.centeredScaling=!!t.centeredScaling,this.projectionTransform=new ee,this.lockAspectRatio=t.lockAspectRatio===!0,this.rotationSnaps=t.rotationSnaps||OR,this.rotationSnapTolerance=t.rotationSnapTolerance!==void 0?t.rotationSnapTolerance:IR,this.skewRadius=t.skewRadius||64,this.skewSnaps=t.skewSnaps||RR,this.skewSnapTolerance=t.skewSnapTolerance!==void 0?t.skewSnapTolerance:kR,this.boxRotationEnabled=t.boxRotationEnabled===!0,this.boxScalingEnabled=t.boxScalingEnabled===!0,this._rotateEnabled=t.rotateEnabled!==!1,this._scaleEnabled=t.scaleEnabled!==!1,this._skewEnabled=t.skewEnabled===!0,this.translateEnabled=t.translateEnabled!==!1,this.transientGroupTilt=t.transientGroupTilt!==void 0?t.transientGroupTilt:!0,this.wireframe=this.addChild(new xR(this)),this.wireframe.cursor="none",this.stage=t.stage||null,this._skewX=0,this._skewY=0,this._transformType="none",this._wireframeStyle=Object.assign({},S1,t.wireframeStyle||{});const r=t.handleConstructor||fR,n=t.handleStyle||{};this._handleStyle=n;const i={rotator:this.addChild(new r(this,"rotator",n,a=>{this.rotateGroup("rotator",a)},this.commitGroup))},s=_h.reduce((a,l)=>{const h=new r(this,l,n,null,this.commitGroup,el[l]);return h.onHandleDelta=f=>{this.scaleGroup(h.handle,f)},h.visible=this._scaleEnabled,a[l]=h,this.addChild(a[l]),a},{}),o={skewHorizontal:this.addChild(new r(this,"skewHorizontal",n,a=>{this.skewGroup("skewHorizontal",a)},this.commitGroup,"pointer")),skewVertical:this.addChild(new r(this,"skewVertical",n,a=>{this.skewGroup("skewVertical",a)},this.commitGroup,"pointer"))};this.handles=Object.assign({},s,i,o),this.handles.middleCenter.visible=!1,this.handles.skewHorizontal.visible=this._skewEnabled,this.handles.skewVertical.visible=this._skewEnabled,this.handleAnchors={rotator:new gt,boxRotateTopLeft:new gt,boxRotateTopRight:new gt,boxRotateBottomLeft:new gt,boxRotateBottomRight:new gt,topLeft:new gt,topCenter:new gt,topRight:new gt,middleLeft:new gt,middleCenter:new gt,middleRight:new gt,bottomLeft:new gt,bottomCenter:new gt,bottomRight:new gt,skewHorizontal:new gt,skewVertical:new gt},this.groupBounds=new dh,this.updateGroupBounds(),this._pointerDown=!1,this._pointerDragging=!1,this._pointerPosition=new gt,this._pointerMoveTarget=null,this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.addEventListener("pointerdown",this.onPointerDown),this.addEventListener("pointerup",this.onPointerUp),this.addEventListener("pointerupoutside",this.onPointerUp)}get enabledHandles(){return this._enabledHandles}set enabledHandles(t){!this._enabledHandles&&!t||(this._enabledHandles=t,AR.forEach(r=>{this.handles[r].visible=!1}),t?t.forEach(r=>{this.handles[r].visible=!0}):(this.handles.rotator.visible=this._rotateEnabled,this.handles.skewHorizontal.visible=this._skewEnabled,this.handles.skewVertical.visible=this._skewEnabled,_h.forEach(r=>{r!=="middleCenter"&&(this.handles[r].visible=this._scaleEnabled)})))}get handleStyle(){return this._handleStyle}set handleStyle(t){const r=this.handles;for(const n in r)r[n].style=t;this._handleStyle=t}get rotateEnabled(){return this._rotateEnabled}set rotateEnabled(t){if(this._rotateEnabled!==t){if(this._rotateEnabled=t,this._enabledHandles)return;this.handles.rotator.visible=t}}get scaleEnabled(){return this._scaleEnabled}set scaleEnabled(t){if(this._scaleEnabled!==t){if(this._scaleEnabled=t,this._enabledHandles)return;_h.forEach(r=>{r!=="middleCenter"&&(this.handles[r].visible=t)})}}get skewEnabled(){return this._skewEnabled}set skewEnabled(t){if(this._skewEnabled!==t){if(this._skewEnabled=t,this._enabledHandles)return;this.handles.skewHorizontal.visible=t,this.handles.skewVertical.visible=t}}get transformType(){return this._transformType}get wireframeStyle(){return this._wireframeStyle}set wireframeStyle(t){this._wireframeStyle=Object.assign({},S1,t)}getGroupBounds(t=!1){return t&&this.updateGroupBounds(),this.groupBounds}__init(){this.translateGroup=t=>{this._transformHandle=null,this._transformType="translate";const r=Fo.identity().translate(t.x,t.y);this.prependTransform(r)}}__init2(){this.rotateGroup=(t,r)=>{this._transformHandle=t,this._transformType="rotate";const n=this.groupBounds,i=this.worldTransform.apply(this.handleAnchors[t],Uo);this.projectionTransform.applyInverse(i,i),r=this.projectionTransform.applyInverse(r,w1);const s=n.center,o=Math.atan2(i.y-s.y,i.x-s.x);let l=Math.atan2(r.y-s.y,r.x-s.x)-o,h=this.groupBounds.rotation+l;h=this.snapAngle(h,this.rotationSnapTolerance,this.rotationSnaps),l=h-this.groupBounds.rotation;const f=Fo.identity().translate(-s.x,-s.y).rotate(l).translate(s.x,s.y);this.prependTransform(f,!0),this.updateGroupBounds(h),this._skewX+=l,this._skewY+=l}}__init3(){this.scaleGroup=(t,r)=>{this._transformHandle=t,this._transformType="scale";const n=E1[t].x,i=E1[t].y,s=this.handles,o=this.groupBounds,a=o.rotation,l=o.innerBounds,h=this.worldTransform.apply(this.handleAnchors[t],Uo);this.projectionTransform.applyInverse(h,h),r=this.projectionTransform.applyInverse(r,w1);const f=r.x-h.x,p=r.y-h.y,d=(o.topRight.x-o.topLeft.x)/l.width,m=(o.topRight.y-o.topLeft.y)/l.width,g=(o.bottomLeft.x-o.topLeft.x)/l.height,y=(o.bottomLeft.y-o.topLeft.y)/l.height,v=f*d+p*m,_=f*g+p*y;let x=1+v*n/l.width,T=1+_*i/l.height;this.lockAspectRatio&&(t==="topLeft"||t==="topRight"||t==="bottomLeft"||t==="bottomRight")&&(x>T?T=x:x=T);const E=Fo.identity();if(n!==0&&x!==0){const I=this.centeredScaling?o.center:n===1?o.topLeft:o.topRight;E.translate(-I.x,-I.y).rotate(-a).scale(x,1).rotate(a).translate(I.x,I.y)}if(i!==0&&T!==0){const I=this.centeredScaling?o.center:i===1?o.topLeft:o.bottomLeft;E.translate(-I.x,-I.y).rotate(-a).scale(1,T).rotate(a).translate(I.x,I.y)}if((T<0||x<0)&&!(T<0&&x<0))switch(t){case"topLeft":case"bottomLeft":this.swapHandles(s.topLeft,s.bottomLeft);break;case"topCenter":case"bottomCenter":this.swapHandles(s.topCenter,s.bottomCenter);break;case"topRight":case"bottomRight":this.swapHandles(s.topRight,s.bottomRight);break}this.prependTransform(E)}}__init4(){this.skewGroup=(t,r)=>{this._transformHandle=t,this._transformType="skew";const n=this.groupBounds,i=Uo.copyFrom(r);this.projectionTransform.applyInverse(i,i);const s=n.center,o=Fo.identity().translate(-s.x,-s.y);let a=this.groupBounds.rotation;if(t==="skewHorizontal"){const l=this._skewX;this._skewX=Math.atan2(i.y-s.y,i.x-s.x),this._skewX=this.snapAngle(this._skewX,this.skewSnapTolerance,this.skewSnaps),o.prepend(_1(-l)),o.prepend(_1(this._skewX))}else{const l=this._skewY,h=Math.atan2(i.y-s.y,i.x-s.x)-Math.PI/2;this._skewY=h,this._skewY=this.snapAngle(this._skewY,this.skewSnapTolerance,this.skewSnaps),o.prepend(v1(l)),o.prepend(v1(-this._skewY)),a-=this._skewY-l}o.translate(s.x,s.y),this.prependTransform(o,!0),this.updateGroupBounds(a)}}__init5(){this.commitGroup=()=>{this._transformHandle=null,this._transformType="none",this.transientGroupTilt!==!1&&this.group.length>1&&this.updateGroupBounds(0),this.emit("transformcommit")}}render(t){this.renderable&&this.visible&&(!this.lazyMode||this.lazyDirty)&&this.draw(),super.render(t)}draw(){const t=this.group,{color:r,thickness:n}=this._wireframeStyle;this.wireframe.clear(),this.boundingBoxes!=="none"&&this.wireframe.lineStyle(n,r),this.translateEnabled&&this.wireframe.beginFill(16777215,1e-4);for(let s=0,o=t.length;s<o&&this.boundingBoxes==="all";s++)this.wireframe.drawBounds(nn.calculateOrientedBounds(t[s],_p));const i=t.length!==1?nn.calculateGroupOrientedBounds(t,this.groupBounds.rotation,_p,!0):nn.calculateOrientedBounds(t[0],_p);this.wireframe.drawBounds(i),this.drawHandles(i),this.groupBounds.copyFrom(i),this.boxRotationEnabled&&(this.wireframe.closePath().beginFill(16777215,1e-4).lineStyle(),this.wireframe.drawBoxRotationTolerance()),this.boxScalingEnabled&&(this.wireframe.closePath().beginFill(16773375,1e-4).lineStyle(),this.wireframe.drawBoxScalingTolerance(i)),this.lazyDirty=!1}drawHandles(t){const r=this.handles,n=this.handleAnchors,{topLeft:i,topRight:s,bottomLeft:o,bottomRight:a,center:l}=t,[h,f,p,d]=x1,m=Uo;if(this.projectToLocal(i,h),this.projectToLocal(s,f),this.projectToLocal(o,p),this.projectToLocal(a,d),this.projectToLocal(l,m),n.topLeft.copyFrom(h),n.topCenter.set((h.x+f.x)/2,(h.y+f.y)/2),n.topRight.copyFrom(f),n.middleLeft.set((h.x+p.x)/2,(h.y+p.y)/2),n.middleCenter.set((h.x+d.x)/2,(h.y+d.y)/2),n.middleRight.set((f.x+d.x)/2,(f.y+d.y)/2),n.bottomLeft.copyFrom(p),n.bottomCenter.set((p.x+d.x)/2,(p.y+d.y)/2),n.bottomRight.copyFrom(d),this.boxRotationEnabled&&(n.boxRotateTopLeft.copyFrom(n.topLeft),n.boxRotateTopRight.copyFrom(n.topRight),n.boxRotateBottomLeft.copyFrom(n.bottomLeft),n.boxRotateBottomRight.copyFrom(n.bottomRight)),this._rotateEnabled){const g=(h.x+f.x)/2,y=(h.y+f.y)/2;let v=-(h.y-f.y),_=h.x-f.x;const x=Math.sqrt(v*v+_*_);v*=32/x,_*=32/x,r.rotator.position.x=g+v,r.rotator.position.y=y+_,this.wireframe.moveTo(g,y).lineTo(r.rotator.position.x,r.rotator.position.y),this.handleAnchors.rotator.copyFrom(r.rotator.position)}if(this._skewEnabled){const g=m.x,y=m.y;this.worldTransform.apply(m,m),n.skewHorizontal.set(m.x+Math.cos(this._skewX)*this.skewRadius,m.y+Math.sin(this._skewX)*this.skewRadius),n.skewVertical.set(m.x+-Math.sin(this._skewY)*this.skewRadius,m.y+Math.cos(this._skewY)*this.skewRadius),this.worldTransform.applyInverse(n.skewHorizontal,n.skewHorizontal),this.worldTransform.applyInverse(n.skewVertical,n.skewVertical),m.set(g,y),this.wireframe.beginFill(this.wireframeStyle.color).drawCircle(m.x,m.y,this.wireframeStyle.thickness*2).endFill(),this.wireframe.moveTo(m.x,m.y).lineTo(r.skewHorizontal.x,r.skewHorizontal.y).moveTo(m.x,m.y).lineTo(r.skewVertical.x,r.skewVertical.y)}for(const g in r){let y=this.groupBounds.rotation;g==="skewHorizontal"?y=this._skewX:g==="skewVertical"&&(y=this._skewY);const v=r[g];v.rotation=y,v.position.copyFrom(n[g]),v.getBounds(!1,SR)}}onPointerDown(t){this._pointerDown=!0,this._pointerDragging=!1,t.stopPropagation(),this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null),this._pointerMoveTarget=this.stage||this,this._pointerMoveTarget.addEventListener("globalpointermove",this.onPointerMove)}onPointerMove(t){const r=this._pointerPosition,n=vh.allocate().copyFrom(t.data.global),i=this.wireframe.hitHandleType(this.groupBounds,this.projectionTransform,n);if(!this._pointerDown)this.setCursorFromHoveredHandle(i);else{const s=n.x,o=n.y;if(this._pointerDragging)switch(this._transformHandle){case"boxRotateTopLeft":case"boxRotateTopRight":case"boxRotateBottomLeft":case"boxRotateBottomRight":this.rotateGroup(this._transformHandle,n);break;case"topCenter":case"middleLeft":case"middleRight":case"bottomCenter":this.scaleGroup(this._transformHandle,n);break;default:if(this.translateEnabled){const[a,l,h]=x1;a.set(0,0),l.set(n.x-r.x,n.y-r.y),this.projectionTransform.applyInverse(a,a),this.projectionTransform.applyInverse(l,l),h.set(l.x-a.x,l.y-a.y),this.translateGroup(h)}}else this._transformHandle=this.wireframe.hitHandleType(this.groupBounds,this.projectionTransform,n),this.setCursorFromHoveredHandle(i);this._pointerPosition.x=s,this._pointerPosition.y=o,this._pointerDragging=!0,t.stopPropagation()}vh.release(n)}onPointerUp(t){this._pointerDragging=!1,this._pointerDown=!1,this.commitGroup(),t.stopPropagation(),this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null)}prependTransform(t,r=!1){const n=this.group;for(let i=0,s=n.length;i<s;i++)TR(n[i],t,!1);T1.copyFrom(t),r||this.updateGroupBounds(),this.emit("transformchange",T1)}updateGroupBounds(t=this.groupBounds.rotation){nn.calculateGroupOrientedBounds(this.group,t,this.groupBounds),this.drawHandles(this.groupBounds),this.lazyDirty=!0}snapAngle(t,r,n){if(t=t%(Math.PI*2),!n||n.length===1||!r)return t;for(let i=0,s=n.length;i<s;i++)if(Math.abs(t-n[i])<=r)return n[i];return t}swapHandles(t,r){const n=t.handle,i=r.handle,s=t.cursor,o=r.cursor,a=t.x,l=r.x,h=t.y,f=r.y;t.handle=i,r.handle=n,t.position.set(l,f),r.position.set(a,h),t.cursor=o,r.cursor=s,this.handles[n]=r,this.handles[i]=t,this._transformHandle===n?this._transformHandle=i:this._transformHandle===i&&(this._transformHandle=n)}setCursorFromHoveredHandle(t){if(t&&t.startsWith("boxRotate"))this.cursor=this.cursors.boxRotate||this.cursors.default;else if(t)switch(t){case"topCenter":this.cursor=this.cursors.boxScaleTop||this.cursors.default;break;case"middleLeft":this.cursor=this.cursors.boxScaleLeft||this.cursors.default;break;case"middleRight":this.cursor=this.cursors.boxScaleRight||this.cursors.default;break;case"bottomCenter":this.cursor=this.cursors.boxScaleBottom||this.cursors.default;break}else this.cursor=this.cursors.translate||this.cursors.default}projectToLocal(t,r){return r||(r=new gt),this.projectionTransform.apply(t,r),this.worldTransform.applyInverse(r,r),r}static calculateTransformedCorners(t,r=t.worldTransform,n,i=0){const s=t.getLocalBounds();return t.getBounds(),n=n||[new gt,new gt,new gt,new gt],n[i].set(s.x,s.y),n[i+1].set(s.x+s.width,s.y),n[i+2].set(s.x+s.width,s.y+s.height),n[i+3].set(s.x,s.y+s.height),r.apply(n[i],n[i]),r.apply(n[i+1],n[i+1]),r.apply(n[i+2],n[i+2]),r.apply(n[i+3],n[i+3]),n}static calculateOrientedBounds(t,r){const n=t.parent?t.parent:t.enableTempParent();t.updateTransform(),t.disableTempParent(n),b1(yh,t.worldTransform),yh.updateLocalTransform();const i=yh.rotation,s=nn.calculateTransformedCorners(t,t.worldTransform,ER),o=(s[0].x+s[1].x+s[2].x+s[3].x)/4,a=(s[0].y+s[1].y+s[2].y+s[3].y)/4,l=Fo.identity().translate(-o,-a).rotate(-yh.rotation).translate(o,a);return l.apply(s[0],s[0]),l.apply(s[1],s[1]),l.apply(s[2],s[2]),l.apply(s[3],s[3]),r=r||new dh,r.rotation=i,r.innerBounds.x=Math.min(s[0].x,s[1].x,s[2].x,s[3].x),r.innerBounds.y=Math.min(s[0].y,s[1].y,s[2].y,s[3].y),r.innerBounds.width=Math.max(s[0].x,s[1].x,s[2].x,s[3].x)-r.innerBounds.x,r.innerBounds.height=Math.max(s[0].y,s[1].y,s[2].y,s[3].y)-r.innerBounds.y,r}static calculateGroupOrientedBounds(t,r,n,i=!1){const s=t.length,o=vh.allocateArray(s*4);for(let d=0;d<s;d++){const m=t[d];if(!i){const g=m.parent?m.parent:m.enableTempParent();m.updateTransform(),m.disableTempParent(g)}nn.calculateTransformedCorners(m,m.worldTransform,o,d*4)}const a=Fo.identity().rotate(-r);let l=Number.MAX_VALUE,h=Number.MAX_VALUE,f=-Number.MAX_VALUE,p=-Number.MAX_VALUE;for(let d=0,m=o.length;d<m;d++){const g=o[d];a.apply(g,g);const y=g.x,v=g.y;l=y<l?y:l,h=v<h?v:h,f=y>f?y:f,p=v>p?v:p}return vh.releaseArray(o),n=n||new dh,n.innerBounds.x=l,n.innerBounds.y=h,n.innerBounds.width=f-l,n.innerBounds.height=p-h,n.rotation=r,a.applyInverse(n.center,Uo),n.center.copyFrom(Uo),n}};function DR(e,t,r,n){for(const i in t){const s=r[i],o=n[i],a=t[i];s!==o&&(s&&e.off(a,s),o&&e.on(a,o))}}const bh={},LR=ee.IDENTITY,BR={transformchange:"transformchange",transformcommit:"transformcommit"},FR=Xt.PixiComponent("Transformer",{create:e=>new NR(e),applyProps(e,t,r){if(Xt.applyDefaultProps(e,t,r),DR(e,BR,t,r),r.cursors&&Object.assign(e.cursors,r.cursors),e.group=r.group||[],e.boundingBoxes=r.boundingBoxes||"all",e.boxScalingEnabled=r.boxScalingEnabled===!0,e.boxScalingTolerance=r.boxScalingTolerance!==void 0?r.boxScalingTolerance:e.boxScalingTolerance,e.boxRotationEnabled=r.boxRotationEnabled===!0,e.boxRotationTolerance=r.boxRotationTolerance!==void 0?r.boxRotationTolerance:e.boxRotationTolerance,e.centeredScaling=r.centeredScaling,e.enabledHandles=r.enabledHandles,e.lockAspectRatio=r.lockAspectRatio,e.projectionTransform.copyFrom(r.projectionTransform||LR),e.skewRadius=r.skewRadius||e.skewRadius,e.rotateEnabled=r.rotateEnabled!==!1,e.scaleEnabled=r.scaleEnabled!==!1,e.skewEnabled=r.skewEnabled===!0,e.translateEnabled=r.translateEnabled!==!1,e.transientGroupTilt=r.transientGroupTilt,t.handleConstructor!==r.handleConstructor)throw new Error("Transformer does not support changing the TransformerHandleConstructor!");t.rotationSnaps!==r.rotationSnaps&&(e.rotationSnaps=r.rotationSnaps),t.rotationSnapTolerance!==r.rotationSnapTolerance&&(e.rotationSnapTolerance=r.rotationSnapTolerance),t.skewSnaps!==r.skewSnaps&&(e.skewSnaps=r.skewSnaps),t.skewSnapTolerance!==r.skewSnapTolerance&&(e.skewSnapTolerance=r.skewSnapTolerance);const n=t.handleStyle||bh,i=r.handleStyle||bh;(n.color!==i.color||n.outlineColor!==i.outlineColor||n.outlineThickness!==i.outlineThickness||n.radius!==i.radius||n.shape!==i.shape)&&(e.handleStyle=i);const s=t.wireframeStyle||bh,o=r.wireframeStyle||bh;(s.color!==o.color||s.thickness!==o.thickness)&&(e.wireframeStyle=o)}}),bp=({pixiTransformerRef:e,imageRef:t,transformCommit:r,transformChange:n,mouseoverEvent:i,onDoubleClick:s,uniqueId:o=""})=>{console.log("transformer props",{pixiTransformerRef:e,imageRef:t,transformCommit:r,transformChange:n,mouseoverEvent:i,onDoubleClick:s,uniqueId:o});const a=Py("#F3C409"),l=Py("#F3C409"),h=Bt.useRef({isDragging:!1}),f=Bt.useCallback(()=>{i&&!h.current.isDragging&&i(!0)},[i]),p=Bt.useCallback(()=>{i&&!h.current.isDragging&&i(!1)},[i]),d=Bt.useCallback(()=>{h.current.isDragging=!0},[]),m=Bt.useCallback(()=>{h.current.isDragging=!1},[]),g=Bt.useCallback(v=>{h.current.isDragging=!0,n&&n(v)},[n]),y=Bt.useCallback(()=>{if(t.current===null)return;const v=t.current.x,_=t.current.y,x=t.current.width,T=t.current.height,w=t.current.rotation,E=[t.current.scale.x,t.current.scale.y];r&&r({uniqueId:o,transformation:{x:Math.round(v),y:Math.round(_),width:Math.round(Math.max(5,x)),height:Math.round(Math.max(5,T)),rotate:Math.round(w),scale:E}}),h.current.isDragging=!1},[r]);return Bt.useEffect(()=>(e.current&&(e.current.on("mouseover",f),e.current.on("mouseout",p),e.current.on("mousedown",d),e.current.on("mouseup",m)),()=>{e.current&&(e.current.off("mouseover",f),e.current.off("mouseout",p),e.current.off("mousedown",d),e.current.off("mouseup",m))}),[]),zt.jsx(FR,{ref:e,group:[t.current],rotateEnabled:!0,boxRotationEnabled:!0,centeredScaling:!0,boxScalingEnabled:!0,wireframeStyle:{thickness:1,color:l},lockAspectRatio:!0,scaleEnabled:!0,handleStyle:{outlineColor:a,shape:"circle",radius:9},transformchange:g,transformcommit:y})};var xh={};Object.defineProperty(xh,"__esModule",{value:!0});var UR=dt,xp;function A1(){return xp||(xp=document.createElement("div")),xp}function jR(e,t,r){var n;return UR.useEffect(function(){n=n||A1();var i=function(s){var o=s.detail;t(o)};return n.addEventListener(e,i,!1),function(){n==null||n.removeEventListener(e,i,!1)}},r),function(i){n=i}}function GR(e,t){var r=A1(),n=new CustomEvent(e,{detail:t});r.dispatchEvent(n)}function HR(){var e;function t(r){e=r}return t.emit=function(r,n){var i=new CustomEvent(r,{bubbles:!0,detail:n});e==null||e.dispatchEvent(i)},t}var P1=xh.emitCustomEvent=GR;xh.newCustomEventEmitter=HR;var rl=xh.useCustomEventListener=jR;const jo=Bt.createContext({}),Ki={STOP:"GSAP_STOP",PAUSE:"GSAP_PAUSE",PLAY:"GSAP_PLAY",RESUME:"GSAP_RESUME",RESTART:"GSAP_RESTART",REPEAT:"GSAP_REPEAT",SEEK:"GSAP_SEEK",RESET:"GSAP_RESET",DRAGGING_START:"GSAP_DRAGGING_START",DRAGGING_END:"GSAP_DRAGGING_END"},$R=({children:e})=>{const[t,r]=dt.useState(!1),[n,i]=dt.useState(!1),s=dt.useRef(),o=dt.useRef(),a=dt.useRef(.001);dt.useLayoutEffect(()=>(o.current=bn.context(()=>{s.current&&s.current.progress(0).kill(),s.current=bn.timeline({paused:!0,defaults:{duration:0}})}),()=>o.current.revert()),[]);const l=dt.useCallback(()=>{let x=s.current.time();a.current=x},[]);dt.useEffect(()=>{const _=s.current;_.eventCallback("onStart",function(){}).eventCallback("onInterrupt",function(){_.pause(),l()}).eventCallback("onUpdate",function(){l()}).eventCallback("onPause",function(){console.log("onPause",_.progress()),l()}).eventCallback("onResume",function(){console.log("onResume",_.progress()),l()}).eventCallback("onComplete",function(){_.seek(0),_.pause(),l()})},[]);const h=dt.useCallback(()=>{s.current.revert()},[]),f=dt.useCallback(()=>{s.current.restart(),r(!0)},[]),p=dt.useCallback(()=>{const _=s.current;_.repeat(1),_.restart()},[]),d=dt.useCallback(_=>{s.current.seek(_)},[]),m=dt.useCallback(()=>{s.current.seek(4)},[]),g=dt.useCallback(()=>{const _=s.current;return _?_.totalDuration():0},[]),y=()=>{s.current.pause(),P1(Ki.PAUSE),r(!1)},v=()=>{const _=s.current;r(!0),_.resume(),P1(Ki.RESUME)};return rl(Ki.DRAGGING_START,()=>{console.log("dragging start"),i(!0)}),rl(Ki.DRAGGING_END,()=>{i(!1),console.log("dragging end")}),console.log("set play updated",t),zt.jsx(jo.Provider,{value:{gsapCtx:o,tl:s,handlePlay:v,handlePause:y,handleReset:h,handleSeek:d,handleSeekTest:m,handleRestart:f,handleRepeat:p,playerTimeRef:a,isDragging:n,getTimelineDuration:g},children:e})},wp=e=>{let t={};switch(e){case"NONE":case"none":break;case"BOUNCE_IN":t.from={duration:2,ease:"bounce.out",y:-1500};break;case"BOUNCE_IN_DOWN":t.from={ease:"bounce.out",y:-1500,duration:2};break;case"BOUNCE_IN_LEFT":t.from={ease:"bounce.out",x:-1500,duration:2};break;case"BOUNCE_IN_RIGHT":t.from={ease:"bounce.out",x:1500,duration:2};break;case"BOUNCE_IN_UP":t.from={ease:"bounce.out",y:1500,duration:2};break;case"BOUNCE_OUT":t.from={ease:"bounce.in",y:2,duration:2};break;case"BOUNCE_OUT_DOWN":break;case"BOUNCE_OUT_LEFT":break;case"BOUNCE_OUT_RIGHT":break;case"BOUNCE_OUT_UP":break;case"FADE_IN":t.to={ease:"power4.in",alpha:1,duration:.5};break;case"FADE_IN_DOWN":t.fromTo={from:{y:-1e3,alpha:0},to:{ease:"power4.in",y:0,alpha:1,duration:1}};break;case"FADE_IN_LEFT":t.fromTo={from:{x:-1e3,alpha:0},to:{ease:"power4.in",x:0,alpha:1,duration:1}};break;case"FADE_IN_RIGHT":t.fromTo={from:{x:2e3,alpha:0},to:{ease:"power4.in",x:0,alpha:1,duration:1}};break;case"FADE_IN_UP":t.fromTo={from:{y:2e3,alpha:0},to:{ease:"power4.in",y:0,alpha:1,duration:1}};break}return t};var zR=Object.prototype;function VR(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||zR;return e===r}var C1=VR;function qR(e,t){return function(r){return e(t(r))}}var WR=qR,XR=WR,YR=XR(Object.keys,Object),KR=YR,ZR=C1,QR=KR,JR=Object.prototype,tk=JR.hasOwnProperty;function ek(e){if(!ZR(e))return QR(e);var t=[];for(var r in Object(e))tk.call(e,r)&&r!="constructor"&&t.push(r);return t}var O1=ek,rk=typeof Ci=="object"&&Ci&&Ci.Object===Object&&Ci,I1=rk,nk=I1,ik=typeof self=="object"&&self&&self.Object===Object&&self,sk=nk||ik||Function("return this")(),xi=sk,ok=xi,ak=ok.Symbol,wh=ak,R1=wh,k1=Object.prototype,lk=k1.hasOwnProperty,uk=k1.toString,nl=R1?R1.toStringTag:void 0;function hk(e){var t=lk.call(e,nl),r=e[nl];try{e[nl]=void 0;var n=!0}catch{}var i=uk.call(e);return n&&(t?e[nl]=r:delete e[nl]),i}var ck=hk,fk=Object.prototype,dk=fk.toString;function pk(e){return dk.call(e)}var mk=pk,M1=wh,gk=ck,yk=mk,vk="[object Null]",_k="[object Undefined]",N1=M1?M1.toStringTag:void 0;function bk(e){return e==null?e===void 0?_k:vk:N1&&N1 in Object(e)?gk(e):yk(e)}var il=bk;function xk(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Tp=xk,wk=il,Tk=Tp,Ek="[object AsyncFunction]",Sk="[object Function]",Ak="[object GeneratorFunction]",Pk="[object Proxy]";function Ck(e){if(!Tk(e))return!1;var t=wk(e);return t==Sk||t==Ak||t==Ek||t==Pk}var D1=Ck,Ok=xi,Ik=Ok["__core-js_shared__"],Rk=Ik,Ep=Rk,L1=function(){var e=/[^.]+$/.exec(Ep&&Ep.keys&&Ep.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function kk(e){return!!L1&&L1 in e}var Mk=kk,Nk=Function.prototype,Dk=Nk.toString;function Lk(e){if(e!=null){try{return Dk.call(e)}catch{}try{return e+""}catch{}}return""}var B1=Lk,Bk=D1,Fk=Mk,Uk=Tp,jk=B1,Gk=/[\\^$.*+?()[\]{}|]/g,Hk=/^\[object .+?Constructor\]$/,$k=Function.prototype,zk=Object.prototype,Vk=$k.toString,qk=zk.hasOwnProperty,Wk=RegExp("^"+Vk.call(qk).replace(Gk,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Xk(e){if(!Uk(e)||Fk(e))return!1;var t=Bk(e)?Wk:Hk;return t.test(jk(e))}var Yk=Xk;function Kk(e,t){return e==null?void 0:e[t]}var Zk=Kk,Qk=Yk,Jk=Zk;function tM(e,t){var r=Jk(e,t);return Qk(r)?r:void 0}var Go=tM,eM=Go,rM=xi,nM=eM(rM,"DataView"),iM=nM,sM=Go,oM=xi,aM=sM(oM,"Map"),Sp=aM,lM=Go,uM=xi,hM=lM(uM,"Promise"),cM=hM,fM=Go,dM=xi,pM=fM(dM,"Set"),mM=pM,gM=Go,yM=xi,vM=gM(yM,"WeakMap"),_M=vM,Ap=iM,Pp=Sp,Cp=cM,Op=mM,Ip=_M,F1=il,Ho=B1,U1="[object Map]",bM="[object Object]",j1="[object Promise]",G1="[object Set]",H1="[object WeakMap]",$1="[object DataView]",xM=Ho(Ap),wM=Ho(Pp),TM=Ho(Cp),EM=Ho(Op),SM=Ho(Ip),Bs=F1;(Ap&&Bs(new Ap(new ArrayBuffer(1)))!=$1||Pp&&Bs(new Pp)!=U1||Cp&&Bs(Cp.resolve())!=j1||Op&&Bs(new Op)!=G1||Ip&&Bs(new Ip)!=H1)&&(Bs=function(e){var t=F1(e),r=t==bM?e.constructor:void 0,n=r?Ho(r):"";if(n)switch(n){case xM:return $1;case wM:return U1;case TM:return j1;case EM:return G1;case SM:return H1}return t});var z1=Bs;function AM(e){return e!=null&&typeof e=="object"}var sl=AM,PM=il,CM=sl,OM="[object Arguments]";function IM(e){return CM(e)&&PM(e)==OM}var RM=IM,V1=RM,kM=sl,q1=Object.prototype,MM=q1.hasOwnProperty,NM=q1.propertyIsEnumerable,DM=V1(function(){return arguments}())?V1:function(e){return kM(e)&&MM.call(e,"callee")&&!NM.call(e,"callee")},Rp=DM,LM=Array.isArray,Yn=LM,BM=9007199254740991;function FM(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=BM}var kp=FM,UM=D1,jM=kp;function GM(e){return e!=null&&jM(e.length)&&!UM(e)}var Th=GM,Eh={exports:{}};function HM(){return!1}var $M=HM;Eh.exports,function(e,t){var r=xi,n=$M,i=t&&!t.nodeType&&t,s=i&&!0&&e&&!e.nodeType&&e,o=s&&s.exports===i,a=o?r.Buffer:void 0,l=a?a.isBuffer:void 0,h=l||n;e.exports=h}(Eh,Eh.exports);var Mp=Eh.exports,zM=il,VM=kp,qM=sl,WM="[object Arguments]",XM="[object Array]",YM="[object Boolean]",KM="[object Date]",ZM="[object Error]",QM="[object Function]",JM="[object Map]",tN="[object Number]",eN="[object Object]",rN="[object RegExp]",nN="[object Set]",iN="[object String]",sN="[object WeakMap]",oN="[object ArrayBuffer]",aN="[object DataView]",lN="[object Float32Array]",uN="[object Float64Array]",hN="[object Int8Array]",cN="[object Int16Array]",fN="[object Int32Array]",dN="[object Uint8Array]",pN="[object Uint8ClampedArray]",mN="[object Uint16Array]",gN="[object Uint32Array]",fe={};fe[lN]=fe[uN]=fe[hN]=fe[cN]=fe[fN]=fe[dN]=fe[pN]=fe[mN]=fe[gN]=!0,fe[WM]=fe[XM]=fe[oN]=fe[YM]=fe[aN]=fe[KM]=fe[ZM]=fe[QM]=fe[JM]=fe[tN]=fe[eN]=fe[rN]=fe[nN]=fe[iN]=fe[sN]=!1;function yN(e){return qM(e)&&VM(e.length)&&!!fe[zM(e)]}var vN=yN;function _N(e){return function(t){return e(t)}}var bN=_N,Sh={exports:{}};Sh.exports,function(e,t){var r=I1,n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===n,o=s&&r.process,a=function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();e.exports=a}(Sh,Sh.exports);var xN=Sh.exports,wN=vN,TN=bN,W1=xN,X1=W1&&W1.isTypedArray,EN=X1?TN(X1):wN,Np=EN,SN=O1,AN=z1,PN=Rp,CN=Yn,ON=Th,IN=Mp,RN=C1,kN=Np,MN="[object Map]",NN="[object Set]",DN=Object.prototype,LN=DN.hasOwnProperty;function BN(e){if(e==null)return!0;if(ON(e)&&(CN(e)||typeof e=="string"||typeof e.splice=="function"||IN(e)||kN(e)||PN(e)))return!e.length;var t=AN(e);if(t==MN||t==NN)return!e.size;if(RN(e))return!SN(e).length;for(var r in e)if(LN.call(e,r))return!1;return!0}var FN=BN;const Xr=us(FN),UN=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],Dp=e=>{const[t,r]=Bt.useState(!1),[,n]=dt.useState(!1),[,i]=dt.useState(!1),s=dt.useRef(null),o=dt.useRef(null),a=dt.useRef(null),l=dt.useRef(null),{tl:h}=dt.useContext(jo),{uniqueId:f,startAt:p,endAt:d,initialAlpha:m,transformation:{x:g,y,width:v,height:_,colorCorrection:x,animation:T,effect:w},applyTransformer:E}=e;console.log("all abstract props",e);const{contrast:I=1,saturation:P=1,brightness:C=1,alpha:M=1,blurRadius:R=0}=x||{},O={...C>1&&{brightness:C},...I>1&&{contrast:I},...P>1&&{saturation:P},...M!==0&&{alpha:M}};Bt.useEffect(()=>{s.current&&r(!0)},[]),Bt.useEffect(()=>{let q=bn.context(()=>{});if(s.current&&h.current){const z={duration:Number(d)-Number(p)},W=wp(T||"None");q=bn.context(()=>{var V,F;Xr(W.from)?Xr(W.to)?Xr(W.fromTo)?h.current.to(s.current,{alpha:1,duration:.01},p).from(a.current,{...z},p).to(s.current,{alpha:0,duration:.1},Number(d)-.1):h.current.fromTo(s.current,(V=W.fromTo)==null?void 0:V.from,(F=W.fromTo)==null?void 0:F.to,p).from(a.current,{...z},p).to(s.current,{alpha:0,duration:.2},d-.2):h.current.to(s.current,{alpha:1,duration:.2,...W.to},p).from(a.current,{...z},p).to(s.current,{alpha:0,duration:.2},d-.2):h.current.from(s.current,{...W.from},p).to(a.current,{alpha:1,duration:.2},p).from(a.current,{...z},p).to(s.current,{alpha:0,duration:.2},d-.2)})}return()=>q.revert()},[T,p,d]);const k=Bt.useCallback(()=>{n(!0)},[]),N=Bt.useCallback(q=>{console.log("changeEnd",q),e.onAnchorTransformationEnd&&(console.log("running onAnchorTransformationEnd"),e.onAnchorTransformationEnd(q))},[]),L=Xt.withFilters(Xt.Container,{...R>0&&{blur:Xi.BlurFilter},...!Xr(O)&&{adjust:lp},matrix:Xi.ColorMatrixFilter}),j=(x==null?void 0:x.enabled)||w&&w!==Ls.Normal;return console.log("all render props",l,s,a,o,j),zt.jsxs(Xt.Container,{ref:o,children:[zt.jsxs(Xt.Container,{ref:s,alpha:m,position:[g,y],pivot:[g,y],width:v,height:_,children:[j&&zt.jsx(L,{scale:1,blur:{blur:R,quality:4},adjust:O,apply:({matrix:q})=>{w===Ls.BlackAndWhite?q.desaturate():w===Ls.Sepia?q.sepia():w===Ls.RetroVintage||w===Ls.NightVision?q.negative():w===Ls.Normal&&q.reset()},matrix:{enabled:!0,matrix:UN},children:zt.jsx(Xt.Container,{ref:a,children:e.children})}),!j&&zt.jsx(Xt.Container,{ref:a,children:e.children})]}),E&&t&&zt.jsx(bp,{pixiTransformerRef:l,imageRef:s,transformCommit:N,transformChange:k,mouseoverEvent:i,uniqueId:f})]})},jN=e=>{const t=dt.useRef(null),r=dt.useRef(null),{src:n,transformation:{x:i,y:s,width:o,height:a,anchor:l},pointerdown:h,pointerup:f,mousedown:p,mouseup:d,pointerover:m,mouseover:g,mouseout:y}=e;return zt.jsx(Dp,{...e,children:zt.jsx(Xt.Container,{ref:r,children:zt.jsx(Xt.Sprite,{image:n,width:o,height:a,anchor:l,ref:t,x:i,y:s,interactive:!0,pointerdown:h,pointerup:f,pointerover:m,mousedown:p,mouseup:d,mouseover:g,mouseout:y})})})};var GN=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Lp={},HN={get exports(){return Lp},set exports(e){Lp=e}};/*!
|
|
1243
1243
|
* d-path-parser - v1.0.0
|
|
1244
1244
|
* by Massimo Artizzu (MaxArt2501)
|
|
1245
1245
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reacthub-pixitweenjs",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.23",
|
|
4
4
|
"description": "reacthub-pixitweenjs is a library that provides a powerful combination of React, PixiJS, GSAP, and image manipulation capabilities in a timeline sequence. With this library, you can easily create stunning animations and interactive graphics for your React applications",
|
|
5
5
|
"author": "khanzzirfan <reacthub.ai@gmail.com>",
|
|
6
6
|
"main": "dist/index.es.js",
|