reacthub-pixitweenjs 0.2.107-alpha.87 → 0.2.107-alpha.89
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.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(ue,P){typeof exports=="object"&&typeof module<"u"?P(exports,require("react"),require("@pixi/react"),require("pixi.js"),require("gsap"),require("reacthub-react-bindings")):typeof define=="function"&&define.amd?define(["exports","react","@pixi/react","pixi.js","gsap","reacthub-react-bindings"],P):(ue=typeof globalThis<"u"?globalThis:ue||self,P(ue["reacthub-pixitweenjs"]={},ue.React,ue.PIXIReact,ue.PIXI,ue.gsap,ue.reacthubReactBindings))})(this,function(ue,P,ie,jc,k,Hc){"use strict";function to(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,i.get?i:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const D=to(P),Le=to(jc);var We=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Vc(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(i){var n=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(r,i,n.get?n:{enumerable:!0,get:function(){return t[i]}})}),r}var ro={exports:{}},Ci={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var J_=j,ev=Symbol.for("react.element"),tv=Symbol.for("react.fragment"),rv=Object.prototype.hasOwnProperty,nv=J_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,iv={key:!0,ref:!0,__self:!0,__source:!0};function Dh(t,e,r){var n,i={},a=null,u=null;r!==void 0&&(a=""+r),e.key!==void 0&&(a=""+e.key),e.ref!==void 0&&(u=e.ref);for(n in e)rv.call(e,n)&&!iv.hasOwnProperty(n)&&(i[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)i[n]===void 0&&(i[n]=e[n]);return{$$typeof:ev,type:t,key:a,ref:u,props:i,_owner:nv.current}}Zs.Fragment=tv,Zs.jsx=Dh,Zs.jsxs=Dh,kh.exports=Zs;var Se=kh.exports,In=(t=>(t.BlackAndWhite="BlackAndWhite",t.Sepia="Sepia",t.RetroVintage="RetroVintage",t.NightVision="NightVision",t.Normal="Normal",t.Vignette="Vignette",t.None="Normal",t))(In||{});let Bh;function Uh(){return Bh=document.body,Bh}function ht(t,e,r){let n;return j.useEffect(()=>{n=n||Uh();const i=a=>{const u=a.detail;e(u)};return n.addEventListener(t,i,!1),()=>{n==null||n.removeEventListener(t,i,!1)}},r),i=>{n=i}}function si(t,e){const r=Uh(),n=new CustomEvent(t,{detail:e});r.dispatchEvent(n)}function sv(){let t;function e(r){t=r}return e.emit=function(r,n){const i=new CustomEvent(r,{bubbles:!0,detail:n});t==null||t.dispatchEvent(i)},e}const on=te.createContext({}),Ze={STOP:"GSAP_STOP",PAUSE:"GSAP_PAUSE",PLAY:"GSAP_PLAY",RESUME:"GSAP_RESUME",RESTART:"GSAP_RESTART",REPEAT:"GSAP_REPEAT",SEEK:"GSAP_SEEK",RESET:"GSAP_RESET",COMPLETE:"GSAP_COMPLETE",SEEK_START:"GSAP_SEEK_START",SEEK_END:"GSAP_SEEK_END",SCRUBBER_SEEK:"GSAP_SCRUBBER_SEEK",SCRUBBER_PROGRESS_UPDATE:"GSAP_SCRUBBER_PROGRESS_UPDATE",SCRUBBER_PLAY:"GSAP_SCRUBBER_PLAY",SCRUBBER_PAUSE:"GSAP_SCRUBBER_PAUSE",SCRUBBER_CLICKED:"GSAP_SCRUBBER_CLICKED",TRANSFORMER_DRAG_START:"TRANSFORMER_DRAG_START",TRANSFORMER_DRAG_END:"TRANSFORMER_DRAG_END",REVERSE_MODE_START:"REVERSE_MODE_START",REVERSE_MODE_END:"REVERSE_MODE_END"},av=({children:t})=>{const[e,r]=j.useState(0),n=j.useRef(),i=j.useRef(),a=j.useRef(.001),u=j.useRef(!1),l=j.useRef(!1),[h,p]=j.useState(!1);j.useLayoutEffect(()=>(i.current=ee.context(()=>{n.current&&n.current.progress(0).kill(),n.current&&n.current.clear(),n.current&&ee.killTweensOf(n.current),n.current=ee.timeline({paused:!0,defaults:{duration:0}})}),()=>{n.current&&n.current.revert(),i.current.revert()}),[]);const m=j.useCallback(()=>{if(n.current){let I=n.current.time();I<a.current?u.current=!0:u.current=!1,a.current=I}},[]);j.useEffect(()=>{if(n.current){const w=n.current;w.eventCallback("onStart",function(){}).eventCallback("onInterrupt",function(){w.pause(),m()}).eventCallback("onUpdate",function(){m()}).eventCallback("onRepeat",function(){console.log("onrepeat",w.progress())}).eventCallback("onReverseComplete",function(){console.log("onReverseComplete",w.progress())}).eventCallback("onComplete",function(){w.seek(0),w.pause(),si(Ze.COMPLETE,{uniqueId:"timeline"}),console.log("Emitted events"),m()})}},[]);const c=j.useCallback(()=>{n.current&&n.current.revert()},[]),d=j.useCallback(()=>{n.current&&n.current.restart()},[]),g=j.useCallback(()=>{if(n.current){const w=n.current;w.repeat(1),w.restart()}},[]),v=j.useCallback(w=>{n.current&&n.current.seek(w)},[]),y=j.useCallback(()=>{n.current&&n.current.seek(4)},[]),b=j.useCallback(()=>{const w=n.current;return w?w.totalDuration():0},[]),x=()=>{n.current&&(n.current.pause(),si(Ze.PAUSE))},E=()=>{n.current&&(n.current.resume(),si(Ze.RESUME))};return ht(Ze.SEEK_START,()=>{l.current=!0}),ht(Ze.SCRUBBER_PLAY,()=>{E()}),ht(Ze.SCRUBBER_PAUSE,()=>{x()}),ht(Ze.SCRUBBER_SEEK,w=>{v(w)}),ht(Ze.SEEK_END,()=>{l.current=!1}),ht(Ze.REVERSE_MODE_START,()=>{u.current=!0}),ht(Ze.REVERSE_MODE_END,()=>{u.current=!1}),ht(Ze.SCRUBBER_PROGRESS_UPDATE,w=>{}),Se.jsx(on.Provider,{value:{gsapCtx:i,tl:n,handlePlay:E,handlePause:x,handleReset:c,handleSeek:v,handleSeekTest:y,handleRestart:d,handleRepeat:g,playerTimeRef:a,getTimelineDuration:b,totalDuration:e,setTotalDuration:r,reverseModeRef:u,dragModeRef:l,isRemotion:h,setIsRemotion:p},children:t})},ov=({pixiTransformerRef:t,imageRef:e,isMounted:r,transformCommit:n,transformChange:i,mouseoverEvent:a,onDoubleClick:u,uniqueId:l="",isText:h=!1})=>{const p=$t.utils.string2hex("#F3C409"),m=$t.utils.string2hex("#F3C409"),c=te.useRef({isDragging:!1}),d=300,g=te.useRef(0),v=te.useCallback(()=>{a&&!c.current.isDragging&&a(!0)},[a]),y=te.useCallback(()=>{a&&!c.current.isDragging&&a(!1)},[a]),b=te.useCallback(()=>{c.current.isDragging=!0;const w=new Date().getTime();w-g.current<d&&u&&u(),g.current=w},[]),x=te.useCallback(w=>{c.current.isDragging=!0,i&&i(w),si(Ze.TRANSFORMER_DRAG_START,{uniqueId:"timeline"})},[i]),E=te.useCallback(()=>{if(e.current===null)return;const w=e.current.x,I=e.current.y,O=e.current.width,F=e.current.height,N=e.current.rotation,L=[e.current.scale.x,e.current.scale.y],D=L[0]<0?-1:1,V=L[1]<0?-1:1;n&&(n({uniqueId:l,transformation:{x:Math.round(w),y:Math.round(I),width:Math.round(Math.max(5,O)),height:Math.round(Math.max(5,F)),rotation:N,scale:h?L:[D,V]}}),si(Ze.TRANSFORMER_DRAG_END,{uniqueId:"timeline"})),c.current.isDragging=!1},[n]);return te.useEffect(()=>(t.current&&(t.current.on("mouseover",v),t.current.on("mouseout",y),t.current.on("mousedown",b)),()=>{t.current&&(t.current.off("mouseover",v),t.current.off("mouseout",y),t.current.off("mousedown",b))}),[]),Se.jsx(Z_.Transformer,{ref:t,group:r?[e.current]:[],rotateEnabled:!0,boxRotationEnabled:!0,centeredScaling:!0,boxScalingEnabled:!0,wireframeStyle:{thickness:2,color:m},lockAspectRatio:!0,scaleEnabled:!0,handleStyle:{outlineColor:p,shape:"circle",radius:10},transformchange:x,transformcommit:E})};function uv(){this.__data__=[],this.size=0}var lv=uv;function cv(t,e){return t===e||t!==t&&e!==e}var $h=cv,hv=$h;function fv(t,e){for(var r=t.length;r--;)if(hv(t[r][0],e))return r;return-1}var Qs=fv,dv=Qs,pv=Array.prototype,gv=pv.splice;function mv(t){var e=this.__data__,r=dv(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():gv.call(e,r,1),--this.size,!0}var _v=mv,vv=Qs;function yv(t){var e=this.__data__,r=vv(e,t);return r<0?void 0:e[r][1]}var xv=yv,bv=Qs;function Tv(t){return bv(this.__data__,t)>-1}var wv=Tv,Sv=Qs;function Av(t,e){var r=this.__data__,n=Sv(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var Ev=Av,Cv=lv,Iv=_v,Rv=xv,Pv=wv,Mv=Ev;function ai(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ai.prototype.clear=Cv,ai.prototype.delete=Iv,ai.prototype.get=Rv,ai.prototype.has=Pv,ai.prototype.set=Mv;var Js=ai,Ov=Js;function Fv(){this.__data__=new Ov,this.size=0}var Nv=Fv;function Lv(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var kv=Lv;function Dv(t){return this.__data__.get(t)}var Bv=Dv;function Uv(t){return this.__data__.has(t)}var $v=Uv,Gv=typeof Et=="object"&&Et&&Et.Object===Object&&Et,Gh=Gv,zv=Gh,Hv=typeof self=="object"&&self&&self.Object===Object&&self,Vv=zv||Hv||Function("return this")(),Nr=Vv,Xv=Nr,jv=Xv.Symbol,ea=jv,zh=ea,Hh=Object.prototype,Wv=Hh.hasOwnProperty,qv=Hh.toString,ts=zh?zh.toStringTag:void 0;function Yv(t){var e=Wv.call(t,ts),r=t[ts];try{t[ts]=void 0;var n=!0}catch{}var i=qv.call(t);return n&&(e?t[ts]=r:delete t[ts]),i}var Kv=Yv,Zv=Object.prototype,Qv=Zv.toString;function Jv(t){return Qv.call(t)}var ey=Jv,Vh=ea,ty=Kv,ry=ey,ny="[object Null]",iy="[object Undefined]",Xh=Vh?Vh.toStringTag:void 0;function sy(t){return t==null?t===void 0?iy:ny:Xh&&Xh in Object(t)?ty(t):ry(t)}var rs=sy;function ay(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var ns=ay,oy=rs,uy=ns,ly="[object AsyncFunction]",cy="[object Function]",hy="[object GeneratorFunction]",fy="[object Proxy]";function dy(t){if(!uy(t))return!1;var e=oy(t);return e==cy||e==hy||e==ly||e==fy}var jh=dy,py=Nr,gy=py["__core-js_shared__"],my=gy,lu=my,Wh=function(){var t=/[^.]+$/.exec(lu&&lu.keys&&lu.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function _y(t){return!!Wh&&Wh in t}var vy=_y,yy=Function.prototype,xy=yy.toString;function by(t){if(t!=null){try{return xy.call(t)}catch{}try{return t+""}catch{}}return""}var qh=by,Ty=jh,wy=vy,Sy=ns,Ay=qh,Ey=/[\\^$.*+?()[\]{}|]/g,Cy=/^\[object .+?Constructor\]$/,Iy=Function.prototype,Ry=Object.prototype,Py=Iy.toString,My=Ry.hasOwnProperty,Oy=RegExp("^"+Py.call(My).replace(Ey,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Fy(t){if(!Sy(t)||wy(t))return!1;var e=Ty(t)?Oy:Cy;return e.test(Ay(t))}var Ny=Fy;function Ly(t,e){return t==null?void 0:t[e]}var ky=Ly,Dy=Ny,By=ky;function Uy(t,e){var r=By(t,e);return Dy(r)?r:void 0}var oi=Uy,$y=oi,Gy=Nr,zy=$y(Gy,"Map"),cu=zy,Hy=oi,Vy=Hy(Object,"create"),ta=Vy,Yh=ta;function Xy(){this.__data__=Yh?Yh(null):{},this.size=0}var jy=Xy;function Wy(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var qy=Wy,Yy=ta,Ky="__lodash_hash_undefined__",Zy=Object.prototype,Qy=Zy.hasOwnProperty;function Jy(t){var e=this.__data__;if(Yy){var r=e[t];return r===Ky?void 0:r}return Qy.call(e,t)?e[t]:void 0}var ex=Jy,tx=ta,rx=Object.prototype,nx=rx.hasOwnProperty;function ix(t){var e=this.__data__;return tx?e[t]!==void 0:nx.call(e,t)}var sx=ix,ax=ta,ox="__lodash_hash_undefined__";function ux(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=ax&&e===void 0?ox:e,this}var lx=ux,cx=jy,hx=qy,fx=ex,dx=sx,px=lx;function ui(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ui.prototype.clear=cx,ui.prototype.delete=hx,ui.prototype.get=fx,ui.prototype.has=dx,ui.prototype.set=px;var gx=ui,Kh=gx,mx=Js,_x=cu;function vx(){this.size=0,this.__data__={hash:new Kh,map:new(_x||mx),string:new Kh}}var yx=vx;function xx(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var bx=xx,Tx=bx;function wx(t,e){var r=t.__data__;return Tx(e)?r[typeof e=="string"?"string":"hash"]:r.map}var ra=wx,Sx=ra;function Ax(t){var e=Sx(this,t).delete(t);return this.size-=e?1:0,e}var Ex=Ax,Cx=ra;function Ix(t){return Cx(this,t).get(t)}var Rx=Ix,Px=ra;function Mx(t){return Px(this,t).has(t)}var Ox=Mx,Fx=ra;function Nx(t,e){var r=Fx(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var Lx=Nx,kx=yx,Dx=Ex,Bx=Rx,Ux=Ox,$x=Lx;function li(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}li.prototype.clear=kx,li.prototype.delete=Dx,li.prototype.get=Bx,li.prototype.has=Ux,li.prototype.set=$x;var hu=li,Gx=Js,zx=cu,Hx=hu,Vx=200;function Xx(t,e){var r=this.__data__;if(r instanceof Gx){var n=r.__data__;if(!zx||n.length<Vx-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Hx(n)}return r.set(t,e),this.size=r.size,this}var jx=Xx,Wx=Js,qx=Nv,Yx=kv,Kx=Bv,Zx=$v,Qx=jx;function ci(t){var e=this.__data__=new Wx(t);this.size=e.size}ci.prototype.clear=qx,ci.prototype.delete=Yx,ci.prototype.get=Kx,ci.prototype.has=Zx,ci.prototype.set=Qx;var Zh=ci,Jx="__lodash_hash_undefined__";function e1(t){return this.__data__.set(t,Jx),this}var t1=e1;function r1(t){return this.__data__.has(t)}var n1=r1,i1=hu,s1=t1,a1=n1;function na(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new i1;++e<r;)this.add(t[e])}na.prototype.add=na.prototype.push=s1,na.prototype.has=a1;var o1=na;function u1(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}var l1=u1;function c1(t,e){return t.has(e)}var h1=c1,f1=o1,d1=l1,p1=h1,g1=1,m1=2;function _1(t,e,r,n,i,a){var u=r&g1,l=t.length,h=e.length;if(l!=h&&!(u&&h>l))return!1;var p=a.get(t),m=a.get(e);if(p&&m)return p==e&&m==t;var c=-1,d=!0,g=r&m1?new f1:void 0;for(a.set(t,e),a.set(e,t);++c<l;){var v=t[c],y=e[c];if(n)var b=u?n(y,v,c,e,t,a):n(v,y,c,t,e,a);if(b!==void 0){if(b)continue;d=!1;break}if(g){if(!d1(e,function(x,E){if(!p1(g,E)&&(v===x||i(v,x,r,n,a)))return g.push(E)})){d=!1;break}}else if(!(v===y||i(v,y,r,n,a))){d=!1;break}}return a.delete(t),a.delete(e),d}var Qh=_1,v1=Nr,y1=v1.Uint8Array,x1=y1;function b1(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}var T1=b1;function w1(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var S1=w1,Jh=ea,ef=x1,A1=$h,E1=Qh,C1=T1,I1=S1,R1=1,P1=2,M1="[object Boolean]",O1="[object Date]",F1="[object Error]",N1="[object Map]",L1="[object Number]",k1="[object RegExp]",D1="[object Set]",B1="[object String]",U1="[object Symbol]",$1="[object ArrayBuffer]",G1="[object DataView]",tf=Jh?Jh.prototype:void 0,fu=tf?tf.valueOf:void 0;function z1(t,e,r,n,i,a,u){switch(r){case G1:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case $1:return!(t.byteLength!=e.byteLength||!a(new ef(t),new ef(e)));case M1:case O1:case L1:return A1(+t,+e);case F1:return t.name==e.name&&t.message==e.message;case k1:case B1:return t==e+"";case N1:var l=C1;case D1:var h=n&R1;if(l||(l=I1),t.size!=e.size&&!h)return!1;var p=u.get(t);if(p)return p==e;n|=P1,u.set(t,e);var m=E1(l(t),l(e),n,i,a,u);return u.delete(t),m;case U1:if(fu)return fu.call(t)==fu.call(e)}return!1}var H1=z1;function V1(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var X1=V1,j1=Array.isArray,Lr=j1,W1=X1,q1=Lr;function Y1(t,e,r){var n=e(t);return q1(t)?n:W1(n,r(t))}var K1=Y1;function Z1(t,e){for(var r=-1,n=t==null?0:t.length,i=0,a=[];++r<n;){var u=t[r];e(u,r,t)&&(a[i++]=u)}return a}var Q1=Z1;function J1(){return[]}var eb=J1,tb=Q1,rb=eb,nb=Object.prototype,ib=nb.propertyIsEnumerable,rf=Object.getOwnPropertySymbols,sb=rf?function(t){return t==null?[]:(t=Object(t),tb(rf(t),function(e){return ib.call(t,e)}))}:rb,ab=sb;function ob(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var ub=ob;function lb(t){return t!=null&&typeof t=="object"}var is=lb,cb=rs,hb=is,fb="[object Arguments]";function db(t){return hb(t)&&cb(t)==fb}var pb=db,nf=pb,gb=is,sf=Object.prototype,mb=sf.hasOwnProperty,_b=sf.propertyIsEnumerable,vb=nf(function(){return arguments}())?nf:function(t){return gb(t)&&mb.call(t,"callee")&&!_b.call(t,"callee")},du=vb,ia={exports:{}};function yb(){return!1}var xb=yb;ia.exports,function(t,e){var r=Nr,n=xb,i=e&&!e.nodeType&&e,a=i&&!0&&t&&!t.nodeType&&t,u=a&&a.exports===i,l=u?r.Buffer:void 0,h=l?l.isBuffer:void 0,p=h||n;t.exports=p}(ia,ia.exports);var pu=ia.exports,bb=9007199254740991,Tb=/^(?:0|[1-9]\d*)$/;function wb(t,e){var r=typeof t;return e=e??bb,!!e&&(r=="number"||r!="symbol"&&Tb.test(t))&&t>-1&&t%1==0&&t<e}var af=wb,Sb=9007199254740991;function Ab(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Sb}var gu=Ab,Eb=rs,Cb=gu,Ib=is,Rb="[object Arguments]",Pb="[object Array]",Mb="[object Boolean]",Ob="[object Date]",Fb="[object Error]",Nb="[object Function]",Lb="[object Map]",kb="[object Number]",Db="[object Object]",Bb="[object RegExp]",Ub="[object Set]",$b="[object String]",Gb="[object WeakMap]",zb="[object ArrayBuffer]",Hb="[object DataView]",Vb="[object Float32Array]",Xb="[object Float64Array]",jb="[object Int8Array]",Wb="[object Int16Array]",qb="[object Int32Array]",Yb="[object Uint8Array]",Kb="[object Uint8ClampedArray]",Zb="[object Uint16Array]",Qb="[object Uint32Array]",rt={};rt[Vb]=rt[Xb]=rt[jb]=rt[Wb]=rt[qb]=rt[Yb]=rt[Kb]=rt[Zb]=rt[Qb]=!0,rt[Rb]=rt[Pb]=rt[zb]=rt[Mb]=rt[Hb]=rt[Ob]=rt[Fb]=rt[Nb]=rt[Lb]=rt[kb]=rt[Db]=rt[Bb]=rt[Ub]=rt[$b]=rt[Gb]=!1;function Jb(t){return Ib(t)&&Cb(t.length)&&!!rt[Eb(t)]}var eT=Jb;function tT(t){return function(e){return t(e)}}var rT=tT,sa={exports:{}};sa.exports,function(t,e){var r=Gh,n=e&&!e.nodeType&&e,i=n&&!0&&t&&!t.nodeType&&t,a=i&&i.exports===n,u=a&&r.process,l=function(){try{var h=i&&i.require&&i.require("util").types;return h||u&&u.binding&&u.binding("util")}catch{}}();t.exports=l}(sa,sa.exports);var nT=sa.exports,iT=eT,sT=rT,of=nT,uf=of&&of.isTypedArray,aT=uf?sT(uf):iT,mu=aT,oT=ub,uT=du,lT=Lr,cT=pu,hT=af,fT=mu,dT=Object.prototype,pT=dT.hasOwnProperty;function gT(t,e){var r=lT(t),n=!r&&uT(t),i=!r&&!n&&cT(t),a=!r&&!n&&!i&&fT(t),u=r||n||i||a,l=u?oT(t.length,String):[],h=l.length;for(var p in t)(e||pT.call(t,p))&&!(u&&(p=="length"||i&&(p=="offset"||p=="parent")||a&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||hT(p,h)))&&l.push(p);return l}var mT=gT,_T=Object.prototype;function vT(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||_T;return t===r}var lf=vT;function yT(t,e){return function(r){return t(e(r))}}var xT=yT,bT=xT,TT=bT(Object.keys,Object),wT=TT,ST=lf,AT=wT,ET=Object.prototype,CT=ET.hasOwnProperty;function IT(t){if(!ST(t))return AT(t);var e=[];for(var r in Object(t))CT.call(t,r)&&r!="constructor"&&e.push(r);return e}var cf=IT,RT=jh,PT=gu;function MT(t){return t!=null&&PT(t.length)&&!RT(t)}var aa=MT,OT=mT,FT=cf,NT=aa;function LT(t){return NT(t)?OT(t):FT(t)}var _u=LT,kT=K1,DT=ab,BT=_u;function UT(t){return kT(t,BT,DT)}var $T=UT,hf=$T,GT=1,zT=Object.prototype,HT=zT.hasOwnProperty;function VT(t,e,r,n,i,a){var u=r>,l=hf(t),h=l.length,p=hf(e),m=p.length;if(h!=m&&!u)return!1;for(var c=h;c--;){var d=l[c];if(!(u?d in e:HT.call(e,d)))return!1}var g=a.get(t),v=a.get(e);if(g&&v)return g==e&&v==t;var y=!0;a.set(t,e),a.set(e,t);for(var b=u;++c<h;){d=l[c];var x=t[d],E=e[d];if(n)var w=u?n(E,x,d,e,t,a):n(x,E,d,t,e,a);if(!(w===void 0?x===E||i(x,E,r,n,a):w)){y=!1;break}b||(b=d=="constructor")}if(y&&!b){var I=t.constructor,O=e.constructor;I!=O&&"constructor"in t&&"constructor"in e&&!(typeof I=="function"&&I instanceof I&&typeof O=="function"&&O instanceof O)&&(y=!1)}return a.delete(t),a.delete(e),y}var XT=VT,jT=oi,WT=Nr,qT=jT(WT,"DataView"),YT=qT,KT=oi,ZT=Nr,QT=KT(ZT,"Promise"),JT=QT,ew=oi,tw=Nr,rw=ew(tw,"Set"),nw=rw,iw=oi,sw=Nr,aw=iw(sw,"WeakMap"),ow=aw,vu=YT,yu=cu,xu=JT,bu=nw,Tu=ow,ff=rs,hi=qh,df="[object Map]",uw="[object Object]",pf="[object Promise]",gf="[object Set]",mf="[object WeakMap]",_f="[object DataView]",lw=hi(vu),cw=hi(yu),hw=hi(xu),fw=hi(bu),dw=hi(Tu),Rn=ff;(vu&&Rn(new vu(new ArrayBuffer(1)))!=_f||yu&&Rn(new yu)!=df||xu&&Rn(xu.resolve())!=pf||bu&&Rn(new bu)!=gf||Tu&&Rn(new Tu)!=mf)&&(Rn=function(t){var e=ff(t),r=e==uw?t.constructor:void 0,n=r?hi(r):"";if(n)switch(n){case lw:return _f;case cw:return df;case hw:return pf;case fw:return gf;case dw:return mf}return e});var vf=Rn,wu=Zh,pw=Qh,gw=H1,mw=XT,yf=vf,xf=Lr,bf=pu,_w=mu,vw=1,Tf="[object Arguments]",wf="[object Array]",oa="[object Object]",yw=Object.prototype,Sf=yw.hasOwnProperty;function xw(t,e,r,n,i,a){var u=xf(t),l=xf(e),h=u?wf:yf(t),p=l?wf:yf(e);h=h==Tf?oa:h,p=p==Tf?oa:p;var m=h==oa,c=p==oa,d=h==p;if(d&&bf(t)){if(!bf(e))return!1;u=!0,m=!1}if(d&&!m)return a||(a=new wu),u||_w(t)?pw(t,e,r,n,i,a):gw(t,e,h,r,n,i,a);if(!(r&vw)){var g=m&&Sf.call(t,"__wrapped__"),v=c&&Sf.call(e,"__wrapped__");if(g||v){var y=g?t.value():t,b=v?e.value():e;return a||(a=new wu),i(y,b,r,n,a)}}return d?(a||(a=new wu),mw(t,e,r,n,i,a)):!1}var bw=xw,Tw=bw,Af=is;function Ef(t,e,r,n,i){return t===e?!0:t==null||e==null||!Af(t)&&!Af(e)?t!==t&&e!==e:Tw(t,e,r,n,Ef,i)}var Su=Ef,ww=Su;function Sw(t,e){return ww(t,e)}var Aw=Sw;const Ew=Cn(Aw),Cw=(t,e)=>{const r=j.useRef(!0),n=j.useRef(e);j.useEffect(()=>{const i=n.current.every((a,u)=>Ew(a,e[u]));(r.current||!i)&&t(),r.current=!1,n.current=e},e)};function Iw(t,e=700){const[r,n]=j.useState(t);return Cw(()=>{const i=setTimeout(()=>{n(t)},e);return()=>{clearTimeout(i)}},[t,e]),r}var Rw=cf,Pw=vf,Mw=du,Ow=Lr,Fw=aa,Nw=pu,Lw=lf,kw=mu,Dw="[object Map]",Bw="[object Set]",Uw=Object.prototype,$w=Uw.hasOwnProperty;function Gw(t){if(t==null)return!0;if(Fw(t)&&(Ow(t)||typeof t=="string"||typeof t.splice=="function"||Nw(t)||kw(t)||Mw(t)))return!t.length;var e=Pw(t);if(e==Dw||e==Bw)return!t.size;if(Lw(t))return!Rw(t).length;for(var r in t)if($w.call(t,r))return!1;return!0}var zw=Gw;const ss=Cn(zw);var Au=(t=>(t.NONE="none",t.NORMAL="normal",t.LENSFLARE="lensflare",t.FILMSTRIP="filmstrip",t.GRUNGE="grunge",t.BRICKS="bricks",t))(Au||{});const Cf={normal:{src:"https://eyecastvideoeditorfiles.s3.ap-southeast-2.amazonaws.com/assets/overlays/eyecast_lensflare_overlay_50.jpg",blendmode:"ADD",alpha:0},lensflare:{src:"https://eyecastvideoeditorfiles.s3.ap-southeast-2.amazonaws.com/assets/overlays/eyecast_lensflare_overlay_50.jpg",blendmode:"ADD",alpha:1},filmstrip:{src:"https://eyecastvideoeditorfiles.s3.ap-southeast-2.amazonaws.com/assets/overlays/frames_filmstrip_5.png",blendmode:"ADD",alpha:1},grunge:{src:"https://eyecastvideoeditorfiles.s3.ap-southeast-2.amazonaws.com/assets/overlays/pixi_overlay_grunge_60.jpg",blendmode:"ADD",alpha:1},bricks:{src:"https://eyecastvideoeditorfiles.s3.ap-southeast-2.amazonaws.com/assets/overlays/bricks_Overlay_100.jpg",blendmode:"MULTIPLY",alpha:1}},Hw=t=>{const{overlay:e,width:r,height:n,x:i,y:a}=t,{src:u,blendmode:l}=Cf[e]||Cf.normal;return Se.jsx(De.TilingSprite,{image:u,width:r,height:n,x:i,y:a,tilePosition:{x:0,y:0},tileScale:.5,alpha:.5,anchor:.5})};/*!
|
|
9
|
+
*/var Xc=P,Wc=Symbol.for("react.element"),qc=Symbol.for("react.fragment"),Yc=Object.prototype.hasOwnProperty,Kc=Xc.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Zc={key:!0,ref:!0,__self:!0,__source:!0};function io(t,e,r){var i,n={},s=null,a=null;r!==void 0&&(s=""+r),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(a=e.ref);for(i in e)Yc.call(e,i)&&!Zc.hasOwnProperty(i)&&(n[i]=e[i]);if(t&&t.defaultProps)for(i in e=t.defaultProps,e)n[i]===void 0&&(n[i]=e[i]);return{$$typeof:Wc,type:t,key:s,ref:a,props:n,_owner:Kc.current}}Ci.Fragment=qc,Ci.jsx=io,Ci.jsxs=io,ro.exports=Ci;var Y=ro.exports,Gt=(t=>(t.BlackAndWhite="BlackAndWhite",t.Sepia="Sepia",t.RetroVintage="RetroVintage",t.NightVision="NightVision",t.Normal="Normal",t.Vignette="Vignette",t.None="Normal",t))(Gt||{});let no;function so(){return no=document.body,no}function Ee(t,e,r){let i;return P.useEffect(()=>{i=i||so();const n=s=>{const a=s.detail;e(a)};return i.addEventListener(t,n,!1),()=>{i==null||i.removeEventListener(t,n,!1)}},r),n=>{i=n}}function lr(t,e){const r=so(),i=new CustomEvent(t,{detail:e});r.dispatchEvent(i)}function Qc(){let t;function e(r){t=r}return e.emit=function(r,i){const n=new CustomEvent(r,{bubbles:!0,detail:i});t==null||t.dispatchEvent(n)},e}const Ct=D.createContext({}),ve={STOP:"GSAP_STOP",PAUSE:"GSAP_PAUSE",PLAY:"GSAP_PLAY",RESUME:"GSAP_RESUME",RESTART:"GSAP_RESTART",REPEAT:"GSAP_REPEAT",SEEK:"GSAP_SEEK",RESET:"GSAP_RESET",COMPLETE:"GSAP_COMPLETE",SEEK_START:"GSAP_SEEK_START",SEEK_END:"GSAP_SEEK_END",SCRUBBER_SEEK:"GSAP_SCRUBBER_SEEK",SCRUBBER_PROGRESS_UPDATE:"GSAP_SCRUBBER_PROGRESS_UPDATE",SCRUBBER_PLAY:"GSAP_SCRUBBER_PLAY",SCRUBBER_PAUSE:"GSAP_SCRUBBER_PAUSE",SCRUBBER_CLICKED:"GSAP_SCRUBBER_CLICKED",TRANSFORMER_DRAG_START:"TRANSFORMER_DRAG_START",TRANSFORMER_DRAG_END:"TRANSFORMER_DRAG_END",REVERSE_MODE_START:"REVERSE_MODE_START",REVERSE_MODE_END:"REVERSE_MODE_END"},Jc=({children:t})=>{const[e,r]=P.useState(0),i=P.useRef(),n=P.useRef(),s=P.useRef(.001),a=P.useRef(!1),o=P.useRef(!1),[u,c]=P.useState(!1);P.useLayoutEffect(()=>(n.current=k.context(()=>{i.current&&i.current.progress(0).kill(),i.current&&i.current.clear(),i.current&&k.killTweensOf(i.current),i.current=k.timeline({paused:!0,defaults:{duration:0}})}),()=>{i.current&&i.current.revert(),n.current.revert()}),[]);const f=P.useCallback(()=>{if(i.current){let x=i.current.time();x<s.current?a.current=!0:a.current=!1,s.current=x}},[]);P.useEffect(()=>{if(i.current){const v=i.current;v.eventCallback("onStart",function(){}).eventCallback("onInterrupt",function(){v.pause(),f()}).eventCallback("onUpdate",function(){f()}).eventCallback("onRepeat",function(){console.log("onrepeat",v.progress())}).eventCallback("onReverseComplete",function(){console.log("onReverseComplete",v.progress())}).eventCallback("onComplete",function(){v.seek(0),v.pause(),lr(ve.COMPLETE,{uniqueId:"timeline"}),console.log("Emitted events"),f()})}},[]);const l=P.useCallback(()=>{i.current&&i.current.revert()},[]),h=P.useCallback(()=>{i.current&&i.current.restart()},[]),d=P.useCallback(()=>{if(i.current){const v=i.current;v.repeat(1),v.restart()}},[]),p=P.useCallback(v=>{i.current&&i.current.seek(v)},[]),m=P.useCallback(()=>{i.current&&i.current.seek(4)},[]),_=P.useCallback(()=>{const v=i.current;return v?v.totalDuration():0},[]),g=()=>{i.current&&(i.current.pause(),lr(ve.PAUSE))},y=()=>{i.current&&(i.current.resume(),lr(ve.RESUME))};return Ee(ve.SEEK_START,()=>{o.current=!0}),Ee(ve.SCRUBBER_PLAY,()=>{y()}),Ee(ve.SCRUBBER_PAUSE,()=>{g()}),Ee(ve.SCRUBBER_SEEK,v=>{p(v)}),Ee(ve.SEEK_END,()=>{o.current=!1}),Ee(ve.REVERSE_MODE_START,()=>{a.current=!0}),Ee(ve.REVERSE_MODE_END,()=>{a.current=!1}),Ee(ve.SCRUBBER_PROGRESS_UPDATE,v=>{}),Y.jsx(Ct.Provider,{value:{gsapCtx:n,tl:i,handlePlay:y,handlePause:g,handleReset:l,handleSeek:p,handleSeekTest:m,handleRestart:h,handleRepeat:d,playerTimeRef:s,getTimelineDuration:_,totalDuration:e,setTotalDuration:r,reverseModeRef:a,dragModeRef:o,isRemotion:u,setIsRemotion:c},children:t})},ef=({pixiTransformerRef:t,imageRef:e,isMounted:r,transformCommit:i,transformChange:n,mouseoverEvent:s,onDoubleClick:a,uniqueId:o="",isText:u=!1})=>{const c=Le.utils.string2hex("#F3C409"),f=Le.utils.string2hex("#F3C409"),l=D.useRef({isDragging:!1}),h=300,d=D.useRef(0),p=D.useCallback(()=>{s&&!l.current.isDragging&&s(!0)},[s]),m=D.useCallback(()=>{s&&!l.current.isDragging&&s(!1)},[s]),_=D.useCallback(()=>{l.current.isDragging=!0;const v=new Date().getTime();v-d.current<h&&a&&a(),d.current=v},[]),g=D.useCallback(v=>{l.current.isDragging=!0,n&&n(v),lr(ve.TRANSFORMER_DRAG_START,{uniqueId:"timeline"})},[n]),y=D.useCallback(()=>{if(e.current===null)return;const v=e.current.x,x=e.current.y,T=e.current.width,b=e.current.height,w=e.current.rotation,S=[e.current.scale.x,e.current.scale.y],A=S[0]<0?-1:1,C=S[1]<0?-1:1;i&&(i({uniqueId:o,transformation:{x:Math.round(v),y:Math.round(x),width:Math.round(Math.max(5,T)),height:Math.round(Math.max(5,b)),rotation:w,scale:u?S:[A,C]}}),lr(ve.TRANSFORMER_DRAG_END,{uniqueId:"timeline"})),l.current.isDragging=!1},[i]);return D.useEffect(()=>(t.current&&(t.current.on("mouseover",p),t.current.on("mouseout",m),t.current.on("mousedown",_)),()=>{t.current&&(t.current.off("mouseover",p),t.current.off("mouseout",m),t.current.off("mousedown",_))}),[]),Y.jsx(Hc.Transformer,{ref:t,group:r?[e.current]:[],rotateEnabled:!0,boxRotationEnabled:!0,centeredScaling:!0,boxScalingEnabled:!0,wireframeStyle:{thickness:2,color:f},lockAspectRatio:!0,scaleEnabled:!0,handleStyle:{outlineColor:c,shape:"circle",radius:10},transformchange:g,transformcommit:y})};function tf(){this.__data__=[],this.size=0}var rf=tf;function nf(t,e){return t===e||t!==t&&e!==e}var ao=nf,sf=ao;function af(t,e){for(var r=t.length;r--;)if(sf(t[r][0],e))return r;return-1}var Ii=af,of=Ii,lf=Array.prototype,uf=lf.splice;function hf(t){var e=this.__data__,r=of(e,t);if(r<0)return!1;var i=e.length-1;return r==i?e.pop():uf.call(e,r,1),--this.size,!0}var cf=hf,ff=Ii;function df(t){var e=this.__data__,r=ff(e,t);return r<0?void 0:e[r][1]}var pf=df,mf=Ii;function gf(t){return mf(this.__data__,t)>-1}var _f=gf,vf=Ii;function yf(t,e){var r=this.__data__,i=vf(r,t);return i<0?(++this.size,r.push([t,e])):r[i][1]=e,this}var xf=yf,bf=rf,Tf=cf,wf=pf,Sf=_f,Af=xf;function ur(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}ur.prototype.clear=bf,ur.prototype.delete=Tf,ur.prototype.get=wf,ur.prototype.has=Sf,ur.prototype.set=Af;var Ri=ur,Ef=Ri;function Cf(){this.__data__=new Ef,this.size=0}var If=Cf;function Rf(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var Pf=Rf;function Mf(t){return this.__data__.get(t)}var Ff=Mf;function Of(t){return this.__data__.has(t)}var Nf=Of,kf=typeof We=="object"&&We&&We.Object===Object&&We,oo=kf,Df=oo,Lf=typeof self=="object"&&self&&self.Object===Object&&self,Bf=Df||Lf||Function("return this")(),ft=Bf,Uf=ft,$f=Uf.Symbol,Pi=$f,lo=Pi,uo=Object.prototype,Gf=uo.hasOwnProperty,zf=uo.toString,zr=lo?lo.toStringTag:void 0;function jf(t){var e=Gf.call(t,zr),r=t[zr];try{t[zr]=void 0;var i=!0}catch{}var n=zf.call(t);return i&&(e?t[zr]=r:delete t[zr]),n}var Hf=jf,Vf=Object.prototype,Xf=Vf.toString;function Wf(t){return Xf.call(t)}var qf=Wf,ho=Pi,Yf=Hf,Kf=qf,Zf="[object Null]",Qf="[object Undefined]",co=ho?ho.toStringTag:void 0;function Jf(t){return t==null?t===void 0?Qf:Zf:co&&co in Object(t)?Yf(t):Kf(t)}var jr=Jf;function ed(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Hr=ed,td=jr,rd=Hr,id="[object AsyncFunction]",nd="[object Function]",sd="[object GeneratorFunction]",ad="[object Proxy]";function od(t){if(!rd(t))return!1;var e=td(t);return e==nd||e==sd||e==id||e==ad}var fo=od,ld=ft,ud=ld["__core-js_shared__"],hd=ud,Zn=hd,po=function(){var t=/[^.]+$/.exec(Zn&&Zn.keys&&Zn.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function cd(t){return!!po&&po in t}var fd=cd,dd=Function.prototype,pd=dd.toString;function md(t){if(t!=null){try{return pd.call(t)}catch{}try{return t+""}catch{}}return""}var mo=md,gd=fo,_d=fd,vd=Hr,yd=mo,xd=/[\\^$.*+?()[\]{}|]/g,bd=/^\[object .+?Constructor\]$/,Td=Function.prototype,wd=Object.prototype,Sd=Td.toString,Ad=wd.hasOwnProperty,Ed=RegExp("^"+Sd.call(Ad).replace(xd,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Cd(t){if(!vd(t)||_d(t))return!1;var e=gd(t)?Ed:bd;return e.test(yd(t))}var Id=Cd;function Rd(t,e){return t==null?void 0:t[e]}var Pd=Rd,Md=Id,Fd=Pd;function Od(t,e){var r=Fd(t,e);return Md(r)?r:void 0}var hr=Od,Nd=hr,kd=ft,Dd=Nd(kd,"Map"),Qn=Dd,Ld=hr,Bd=Ld(Object,"create"),Mi=Bd,go=Mi;function Ud(){this.__data__=go?go(null):{},this.size=0}var $d=Ud;function Gd(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var zd=Gd,jd=Mi,Hd="__lodash_hash_undefined__",Vd=Object.prototype,Xd=Vd.hasOwnProperty;function Wd(t){var e=this.__data__;if(jd){var r=e[t];return r===Hd?void 0:r}return Xd.call(e,t)?e[t]:void 0}var qd=Wd,Yd=Mi,Kd=Object.prototype,Zd=Kd.hasOwnProperty;function Qd(t){var e=this.__data__;return Yd?e[t]!==void 0:Zd.call(e,t)}var Jd=Qd,ep=Mi,tp="__lodash_hash_undefined__";function rp(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=ep&&e===void 0?tp:e,this}var ip=rp,np=$d,sp=zd,ap=qd,op=Jd,lp=ip;function cr(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}cr.prototype.clear=np,cr.prototype.delete=sp,cr.prototype.get=ap,cr.prototype.has=op,cr.prototype.set=lp;var up=cr,_o=up,hp=Ri,cp=Qn;function fp(){this.size=0,this.__data__={hash:new _o,map:new(cp||hp),string:new _o}}var dp=fp;function pp(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var mp=pp,gp=mp;function _p(t,e){var r=t.__data__;return gp(e)?r[typeof e=="string"?"string":"hash"]:r.map}var Fi=_p,vp=Fi;function yp(t){var e=vp(this,t).delete(t);return this.size-=e?1:0,e}var xp=yp,bp=Fi;function Tp(t){return bp(this,t).get(t)}var wp=Tp,Sp=Fi;function Ap(t){return Sp(this,t).has(t)}var Ep=Ap,Cp=Fi;function Ip(t,e){var r=Cp(this,t),i=r.size;return r.set(t,e),this.size+=r.size==i?0:1,this}var Rp=Ip,Pp=dp,Mp=xp,Fp=wp,Op=Ep,Np=Rp;function fr(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}fr.prototype.clear=Pp,fr.prototype.delete=Mp,fr.prototype.get=Fp,fr.prototype.has=Op,fr.prototype.set=Np;var Jn=fr,kp=Ri,Dp=Qn,Lp=Jn,Bp=200;function Up(t,e){var r=this.__data__;if(r instanceof kp){var i=r.__data__;if(!Dp||i.length<Bp-1)return i.push([t,e]),this.size=++r.size,this;r=this.__data__=new Lp(i)}return r.set(t,e),this.size=r.size,this}var $p=Up,Gp=Ri,zp=If,jp=Pf,Hp=Ff,Vp=Nf,Xp=$p;function dr(t){var e=this.__data__=new Gp(t);this.size=e.size}dr.prototype.clear=zp,dr.prototype.delete=jp,dr.prototype.get=Hp,dr.prototype.has=Vp,dr.prototype.set=Xp;var vo=dr,Wp="__lodash_hash_undefined__";function qp(t){return this.__data__.set(t,Wp),this}var Yp=qp;function Kp(t){return this.__data__.has(t)}var Zp=Kp,Qp=Jn,Jp=Yp,em=Zp;function Oi(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new Qp;++e<r;)this.add(t[e])}Oi.prototype.add=Oi.prototype.push=Jp,Oi.prototype.has=em;var tm=Oi;function rm(t,e){for(var r=-1,i=t==null?0:t.length;++r<i;)if(e(t[r],r,t))return!0;return!1}var im=rm;function nm(t,e){return t.has(e)}var sm=nm,am=tm,om=im,lm=sm,um=1,hm=2;function cm(t,e,r,i,n,s){var a=r&um,o=t.length,u=e.length;if(o!=u&&!(a&&u>o))return!1;var c=s.get(t),f=s.get(e);if(c&&f)return c==e&&f==t;var l=-1,h=!0,d=r&hm?new am:void 0;for(s.set(t,e),s.set(e,t);++l<o;){var p=t[l],m=e[l];if(i)var _=a?i(m,p,l,e,t,s):i(p,m,l,t,e,s);if(_!==void 0){if(_)continue;h=!1;break}if(d){if(!om(e,function(g,y){if(!lm(d,y)&&(p===g||n(p,g,r,i,s)))return d.push(y)})){h=!1;break}}else if(!(p===m||n(p,m,r,i,s))){h=!1;break}}return s.delete(t),s.delete(e),h}var yo=cm,fm=ft,dm=fm.Uint8Array,pm=dm;function mm(t){var e=-1,r=Array(t.size);return t.forEach(function(i,n){r[++e]=[n,i]}),r}var gm=mm;function _m(t){var e=-1,r=Array(t.size);return t.forEach(function(i){r[++e]=i}),r}var vm=_m,xo=Pi,bo=pm,ym=ao,xm=yo,bm=gm,Tm=vm,wm=1,Sm=2,Am="[object Boolean]",Em="[object Date]",Cm="[object Error]",Im="[object Map]",Rm="[object Number]",Pm="[object RegExp]",Mm="[object Set]",Fm="[object String]",Om="[object Symbol]",Nm="[object ArrayBuffer]",km="[object DataView]",To=xo?xo.prototype:void 0,es=To?To.valueOf:void 0;function Dm(t,e,r,i,n,s,a){switch(r){case km:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Nm:return!(t.byteLength!=e.byteLength||!s(new bo(t),new bo(e)));case Am:case Em:case Rm:return ym(+t,+e);case Cm:return t.name==e.name&&t.message==e.message;case Pm:case Fm:return t==e+"";case Im:var o=bm;case Mm:var u=i&wm;if(o||(o=Tm),t.size!=e.size&&!u)return!1;var c=a.get(t);if(c)return c==e;i|=Sm,a.set(t,e);var f=xm(o(t),o(e),i,n,s,a);return a.delete(t),f;case Om:if(es)return es.call(t)==es.call(e)}return!1}var Lm=Dm;function Bm(t,e){for(var r=-1,i=e.length,n=t.length;++r<i;)t[n+r]=e[r];return t}var Um=Bm,$m=Array.isArray,dt=$m,Gm=Um,zm=dt;function jm(t,e,r){var i=e(t);return zm(t)?i:Gm(i,r(t))}var Hm=jm;function Vm(t,e){for(var r=-1,i=t==null?0:t.length,n=0,s=[];++r<i;){var a=t[r];e(a,r,t)&&(s[n++]=a)}return s}var Xm=Vm;function Wm(){return[]}var qm=Wm,Ym=Xm,Km=qm,Zm=Object.prototype,Qm=Zm.propertyIsEnumerable,wo=Object.getOwnPropertySymbols,Jm=wo?function(t){return t==null?[]:(t=Object(t),Ym(wo(t),function(e){return Qm.call(t,e)}))}:Km,eg=Jm;function tg(t,e){for(var r=-1,i=Array(t);++r<t;)i[r]=e(r);return i}var rg=tg;function ig(t){return t!=null&&typeof t=="object"}var Vr=ig,ng=jr,sg=Vr,ag="[object Arguments]";function og(t){return sg(t)&&ng(t)==ag}var lg=og,So=lg,ug=Vr,Ao=Object.prototype,hg=Ao.hasOwnProperty,cg=Ao.propertyIsEnumerable,fg=So(function(){return arguments}())?So:function(t){return ug(t)&&hg.call(t,"callee")&&!cg.call(t,"callee")},ts=fg,Ni={exports:{}};function dg(){return!1}var pg=dg;Ni.exports,function(t,e){var r=ft,i=pg,n=e&&!e.nodeType&&e,s=n&&!0&&t&&!t.nodeType&&t,a=s&&s.exports===n,o=a?r.Buffer:void 0,u=o?o.isBuffer:void 0,c=u||i;t.exports=c}(Ni,Ni.exports);var rs=Ni.exports,mg=9007199254740991,gg=/^(?:0|[1-9]\d*)$/;function _g(t,e){var r=typeof t;return e=e??mg,!!e&&(r=="number"||r!="symbol"&&gg.test(t))&&t>-1&&t%1==0&&t<e}var Eo=_g,vg=9007199254740991;function yg(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=vg}var is=yg,xg=jr,bg=is,Tg=Vr,wg="[object Arguments]",Sg="[object Array]",Ag="[object Boolean]",Eg="[object Date]",Cg="[object Error]",Ig="[object Function]",Rg="[object Map]",Pg="[object Number]",Mg="[object Object]",Fg="[object RegExp]",Og="[object Set]",Ng="[object String]",kg="[object WeakMap]",Dg="[object ArrayBuffer]",Lg="[object DataView]",Bg="[object Float32Array]",Ug="[object Float64Array]",$g="[object Int8Array]",Gg="[object Int16Array]",zg="[object Int32Array]",jg="[object Uint8Array]",Hg="[object Uint8ClampedArray]",Vg="[object Uint16Array]",Xg="[object Uint32Array]",_e={};_e[Bg]=_e[Ug]=_e[$g]=_e[Gg]=_e[zg]=_e[jg]=_e[Hg]=_e[Vg]=_e[Xg]=!0,_e[wg]=_e[Sg]=_e[Dg]=_e[Ag]=_e[Lg]=_e[Eg]=_e[Cg]=_e[Ig]=_e[Rg]=_e[Pg]=_e[Mg]=_e[Fg]=_e[Og]=_e[Ng]=_e[kg]=!1;function Wg(t){return Tg(t)&&bg(t.length)&&!!_e[xg(t)]}var qg=Wg;function Yg(t){return function(e){return t(e)}}var Kg=Yg,ki={exports:{}};ki.exports,function(t,e){var r=oo,i=e&&!e.nodeType&&e,n=i&&!0&&t&&!t.nodeType&&t,s=n&&n.exports===i,a=s&&r.process,o=function(){try{var u=n&&n.require&&n.require("util").types;return u||a&&a.binding&&a.binding("util")}catch{}}();t.exports=o}(ki,ki.exports);var Zg=ki.exports,Qg=qg,Jg=Kg,Co=Zg,Io=Co&&Co.isTypedArray,e0=Io?Jg(Io):Qg,ns=e0,t0=rg,r0=ts,i0=dt,n0=rs,s0=Eo,a0=ns,o0=Object.prototype,l0=o0.hasOwnProperty;function u0(t,e){var r=i0(t),i=!r&&r0(t),n=!r&&!i&&n0(t),s=!r&&!i&&!n&&a0(t),a=r||i||n||s,o=a?t0(t.length,String):[],u=o.length;for(var c in t)(e||l0.call(t,c))&&!(a&&(c=="length"||n&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||s0(c,u)))&&o.push(c);return o}var h0=u0,c0=Object.prototype;function f0(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||c0;return t===r}var Ro=f0;function d0(t,e){return function(r){return t(e(r))}}var p0=d0,m0=p0,g0=m0(Object.keys,Object),_0=g0,v0=Ro,y0=_0,x0=Object.prototype,b0=x0.hasOwnProperty;function T0(t){if(!v0(t))return y0(t);var e=[];for(var r in Object(t))b0.call(t,r)&&r!="constructor"&&e.push(r);return e}var Po=T0,w0=fo,S0=is;function A0(t){return t!=null&&S0(t.length)&&!w0(t)}var Di=A0,E0=h0,C0=Po,I0=Di;function R0(t){return I0(t)?E0(t):C0(t)}var ss=R0,P0=Hm,M0=eg,F0=ss;function O0(t){return P0(t,F0,M0)}var N0=O0,Mo=N0,k0=1,D0=Object.prototype,L0=D0.hasOwnProperty;function B0(t,e,r,i,n,s){var a=r&k0,o=Mo(t),u=o.length,c=Mo(e),f=c.length;if(u!=f&&!a)return!1;for(var l=u;l--;){var h=o[l];if(!(a?h in e:L0.call(e,h)))return!1}var d=s.get(t),p=s.get(e);if(d&&p)return d==e&&p==t;var m=!0;s.set(t,e),s.set(e,t);for(var _=a;++l<u;){h=o[l];var g=t[h],y=e[h];if(i)var v=a?i(y,g,h,e,t,s):i(g,y,h,t,e,s);if(!(v===void 0?g===y||n(g,y,r,i,s):v)){m=!1;break}_||(_=h=="constructor")}if(m&&!_){var x=t.constructor,T=e.constructor;x!=T&&"constructor"in t&&"constructor"in e&&!(typeof x=="function"&&x instanceof x&&typeof T=="function"&&T instanceof T)&&(m=!1)}return s.delete(t),s.delete(e),m}var U0=B0,$0=hr,G0=ft,z0=$0(G0,"DataView"),j0=z0,H0=hr,V0=ft,X0=H0(V0,"Promise"),W0=X0,q0=hr,Y0=ft,K0=q0(Y0,"Set"),Z0=K0,Q0=hr,J0=ft,e_=Q0(J0,"WeakMap"),t_=e_,as=j0,os=Qn,ls=W0,us=Z0,hs=t_,Fo=jr,pr=mo,Oo="[object Map]",r_="[object Object]",No="[object Promise]",ko="[object Set]",Do="[object WeakMap]",Lo="[object DataView]",i_=pr(as),n_=pr(os),s_=pr(ls),a_=pr(us),o_=pr(hs),zt=Fo;(as&&zt(new as(new ArrayBuffer(1)))!=Lo||os&&zt(new os)!=Oo||ls&&zt(ls.resolve())!=No||us&&zt(new us)!=ko||hs&&zt(new hs)!=Do)&&(zt=function(t){var e=Fo(t),r=e==r_?t.constructor:void 0,i=r?pr(r):"";if(i)switch(i){case i_:return Lo;case n_:return Oo;case s_:return No;case a_:return ko;case o_:return Do}return e});var Bo=zt,cs=vo,l_=yo,u_=Lm,h_=U0,Uo=Bo,$o=dt,Go=rs,c_=ns,f_=1,zo="[object Arguments]",jo="[object Array]",Li="[object Object]",d_=Object.prototype,Ho=d_.hasOwnProperty;function p_(t,e,r,i,n,s){var a=$o(t),o=$o(e),u=a?jo:Uo(t),c=o?jo:Uo(e);u=u==zo?Li:u,c=c==zo?Li:c;var f=u==Li,l=c==Li,h=u==c;if(h&&Go(t)){if(!Go(e))return!1;a=!0,f=!1}if(h&&!f)return s||(s=new cs),a||c_(t)?l_(t,e,r,i,n,s):u_(t,e,u,r,i,n,s);if(!(r&f_)){var d=f&&Ho.call(t,"__wrapped__"),p=l&&Ho.call(e,"__wrapped__");if(d||p){var m=d?t.value():t,_=p?e.value():e;return s||(s=new cs),n(m,_,r,i,s)}}return h?(s||(s=new cs),h_(t,e,r,i,n,s)):!1}var m_=p_,g_=m_,Vo=Vr;function Xo(t,e,r,i,n){return t===e?!0:t==null||e==null||!Vo(t)&&!Vo(e)?t!==t&&e!==e:g_(t,e,r,i,Xo,n)}var fs=Xo,__=fs;function v_(t,e){return __(t,e)}var y_=v_;const x_=$t(y_),b_=(t,e)=>{const r=P.useRef(!0),i=P.useRef(e);P.useEffect(()=>{const n=i.current.every((s,a)=>x_(s,e[a]));(r.current||!n)&&t(),r.current=!1,i.current=e},e)};function T_(t,e=700){const[r,i]=P.useState(t);return b_(()=>{const n=setTimeout(()=>{i(t)},e);return()=>{clearTimeout(n)}},[t,e]),r}var w_=Po,S_=Bo,A_=ts,E_=dt,C_=Di,I_=rs,R_=Ro,P_=ns,M_="[object Map]",F_="[object Set]",O_=Object.prototype,N_=O_.hasOwnProperty;function k_(t){if(t==null)return!0;if(C_(t)&&(E_(t)||typeof t=="string"||typeof t.splice=="function"||I_(t)||P_(t)||A_(t)))return!t.length;var e=S_(t);if(e==M_||e==F_)return!t.size;if(R_(t))return!w_(t).length;for(var r in t)if(N_.call(t,r))return!1;return!0}var D_=k_;const Xr=$t(D_);var ds=(t=>(t.NONE="none",t.NORMAL="normal",t.LENSFLARE="lensflare",t.FILMSTRIP="filmstrip",t.GRUNGE="grunge",t.BRICKS="bricks",t))(ds||{});const Wo={normal:{src:"https://eyecastvideoeditorfiles.s3.ap-southeast-2.amazonaws.com/assets/overlays/eyecast_lensflare_overlay_50.jpg",blendmode:"ADD",alpha:0},lensflare:{src:"https://eyecastvideoeditorfiles.s3.ap-southeast-2.amazonaws.com/assets/overlays/eyecast_lensflare_overlay_50.jpg",blendmode:"ADD",alpha:1},filmstrip:{src:"https://eyecastvideoeditorfiles.s3.ap-southeast-2.amazonaws.com/assets/overlays/frames_filmstrip_5.png",blendmode:"ADD",alpha:1},grunge:{src:"https://eyecastvideoeditorfiles.s3.ap-southeast-2.amazonaws.com/assets/overlays/pixi_overlay_grunge_60.jpg",blendmode:"ADD",alpha:1},bricks:{src:"https://eyecastvideoeditorfiles.s3.ap-southeast-2.amazonaws.com/assets/overlays/bricks_Overlay_100.jpg",blendmode:"MULTIPLY",alpha:1}},L_=t=>{const{overlay:e,width:r,height:i,x:n,y:s}=t,{src:a,blendmode:o}=Wo[e]||Wo.normal;return Y.jsx(ie.TilingSprite,{image:a,width:r,height:i,x:n,y:s,tilePosition:{x:0,y:0},tileScale:.5,alpha:.5,anchor:.5})};/*!
|
|
10
10
|
* paths 3.11.5
|
|
11
11
|
* https://greensock.com
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* Subject to the terms at https://greensock.com/standard-license or for
|
|
15
15
|
* Club GreenSock members, the agreement issued with that membership.
|
|
16
16
|
* @author: Jack Doyle, jack@greensock.com
|
|
17
|
-
*/var
|
|
17
|
+
*/var B_=/[achlmqstvz]|(-?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/ig,U_=/[\+\-]?\d*\.?\d+e[\+\-]?\d+/ig,$_=Math.PI/180,Bi=Math.sin,Ui=Math.cos,Wr=Math.abs,qr=Math.sqrt,G_=function(e){return typeof e=="number"},qo=1e5,It=function(e){return Math.round(e*qo)/qo||0};function z_(t,e,r,i,n,s,a){for(var o=t.length,u,c,f,l,h;--o>-1;)for(u=t[o],c=u.length,f=0;f<c;f+=2)l=u[f],h=u[f+1],u[f]=l*e+h*i+s,u[f+1]=l*r+h*n+a;return t._dirty=1,t}function j_(t,e,r,i,n,s,a,o,u){if(!(t===o&&e===u)){r=Wr(r),i=Wr(i);var c=n%360*$_,f=Ui(c),l=Bi(c),h=Math.PI,d=h*2,p=(t-o)/2,m=(e-u)/2,_=f*p+l*m,g=-l*p+f*m,y=_*_,v=g*g,x=y/(r*r)+v/(i*i);x>1&&(r=qr(x)*r,i=qr(x)*i);var T=r*r,b=i*i,w=(T*b-T*v-b*y)/(T*v+b*y);w<0&&(w=0);var S=(s===a?-1:1)*qr(w),A=S*(r*g/i),C=S*-(i*_/r),F=(t+o)/2,G=(e+u)/2,R=F+(f*A-l*C),E=G+(l*A+f*C),B=(_-A)/r,U=(g-C)/i,I=(-_-A)/r,$=(-g-C)/i,X=B*B+U*U,M=(U<0?-1:1)*Math.acos(B/qr(X)),O=(B*$-U*I<0?-1:1)*Math.acos((B*I+U*$)/qr(X*(I*I+$*$)));isNaN(O)&&(O=h),!a&&O>0?O-=d:a&&O<0&&(O+=d),M%=d,O%=d;var j=Math.ceil(Wr(O)/(d/4)),H=[],W=O/j,Q=4/3*Bi(W/2)/(1+Ui(W/2)),V=f*r,J=l*r,de=l*-i,ge=f*i,Z;for(Z=0;Z<j;Z++)n=M+Z*W,_=Ui(n),g=Bi(n),B=Ui(n+=W),U=Bi(n),H.push(_-Q*g,g+Q*_,B+Q*U,U-Q*B,B,U);for(Z=0;Z<H.length;Z+=2)_=H[Z],g=H[Z+1],H[Z]=_*V+g*de+R,H[Z+1]=_*J+g*ge+E;return H[Z-2]=o,H[Z-1]=u,H}}function H_(t){var e=(t+"").replace(U_,function(A){var C=+A;return C<1e-4&&C>-1e-4?0:C}).match(B_)||[],r=[],i=0,n=0,s=2/3,a=e.length,o=0,u="ERROR: malformed path: "+t,c,f,l,h,d,p,m,_,g,y,v,x,T,b,w,S=function(C,F,G,R){y=(G-C)/3,v=(R-F)/3,m.push(C+y,F+v,G-y,R-v,G,R)};if(!t||!isNaN(e[0])||isNaN(e[1]))return console.log(u),r;for(c=0;c<a;c++)if(T=d,isNaN(e[c])?(d=e[c].toUpperCase(),p=d!==e[c]):c--,l=+e[c+1],h=+e[c+2],p&&(l+=i,h+=n),c||(_=l,g=h),d==="M")m&&(m.length<8?r.length-=1:o+=m.length),i=_=l,n=g=h,m=[l,h],r.push(m),c+=2,d="L";else if(d==="C")m||(m=[0,0]),p||(i=n=0),m.push(l,h,i+e[c+3]*1,n+e[c+4]*1,i+=e[c+5]*1,n+=e[c+6]*1),c+=6;else if(d==="S")y=i,v=n,(T==="C"||T==="S")&&(y+=i-m[m.length-4],v+=n-m[m.length-3]),p||(i=n=0),m.push(y,v,l,h,i+=e[c+3]*1,n+=e[c+4]*1),c+=4;else if(d==="Q")y=i+(l-i)*s,v=n+(h-n)*s,p||(i=n=0),i+=e[c+3]*1,n+=e[c+4]*1,m.push(y,v,i+(l-i)*s,n+(h-n)*s,i,n),c+=4;else if(d==="T")y=i-m[m.length-4],v=n-m[m.length-3],m.push(i+y,n+v,l+(i+y*1.5-l)*s,h+(n+v*1.5-h)*s,i=l,n=h),c+=2;else if(d==="H")S(i,n,i=l,n),c+=1;else if(d==="V")S(i,n,i,n=l+(p?n-i:0)),c+=1;else if(d==="L"||d==="Z")d==="Z"&&(l=_,h=g,m.closed=!0),(d==="L"||Wr(i-l)>.5||Wr(n-h)>.5)&&(S(i,n,l,h),d==="L"&&(c+=2)),i=l,n=h;else if(d==="A"){if(b=e[c+4],w=e[c+5],y=e[c+6],v=e[c+7],f=7,b.length>1&&(b.length<3?(v=y,y=w,f--):(v=w,y=b.substr(2),f-=2),w=b.charAt(1),b=b.charAt(0)),x=j_(i,n,+e[c+1],+e[c+2],+e[c+3],+b,+w,(p?i:0)+y*1,(p?n:0)+v*1),c+=f,x)for(f=0;f<x.length;f++)m.push(x[f]);i=m[m.length-2],n=m[m.length-1]}else console.log(u);return c=m.length,c<6?(r.pop(),c=0):m[0]===m[c-2]&&m[1]===m[c-1]&&(m.closed=!0),r.totalPoints=o+c,r}function V_(t){G_(t[0])&&(t=[t]);var e="",r=t.length,i,n,s,a;for(n=0;n<r;n++){for(a=t[n],e+="M"+It(a[0])+","+It(a[1])+" C",i=a.length,s=2;s<i;s++)e+=It(a[s++])+","+It(a[s++])+" "+It(a[s++])+","+It(a[s++])+" "+It(a[s++])+","+It(a[s])+" ";a.closed&&(e+="z")}return e}/*!
|
|
18
18
|
* CustomEase 3.11.5
|
|
19
19
|
* https://greensock.com
|
|
20
20
|
*
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* Subject to the terms at https://greensock.com/standard-license or for
|
|
23
23
|
* Club GreenSock members, the agreement issued with that membership.
|
|
24
24
|
* @author: Jack Doyle, jack@greensock.com
|
|
25
|
-
*/var
|
|
25
|
+
*/var Ge,Yo,Ko=function(){return Ge||typeof window<"u"&&(Ge=window.gsap)&&Ge.registerPlugin&&Ge},Zo=function(){Ge=Ko(),Ge?(Ge.registerEase("_CE",Yr.create),Yo=1):console.warn("Please gsap.registerPlugin(CustomEase)")},X_=1e20,$i=function(e){return~~(e*1e3+(e<0?-.5:.5))/1e3},W_=/[-+=\.]*\d+[\.e\-\+]*\d*[e\-\+]*\d*/gi,q_=/[cLlsSaAhHvVtTqQ]/g,Y_=function(e){var r=e.length,i=X_,n;for(n=1;n<r;n+=6)+e[n]<i&&(i=+e[n]);return i},K_=function(e,r,i){!i&&i!==0&&(i=Math.max(+e[e.length-1],+e[1]));var n=+e[0]*-1,s=-i,a=e.length,o=1/(+e[a-2]+n),u=-r||(Math.abs(+e[a-1]-+e[1])<.01*(+e[a-2]-+e[0])?Y_(e)+s:+e[a-1]+s),c;for(u?u=1/u:u=-o,c=0;c<a;c+=2)e[c]=(+e[c]+n)*o,e[c+1]=(+e[c+1]+s)*u},Z_=function t(e,r,i,n,s,a,o,u,c,f,l){var h=(e+i)/2,d=(r+n)/2,p=(i+s)/2,m=(n+a)/2,_=(s+o)/2,g=(a+u)/2,y=(h+p)/2,v=(d+m)/2,x=(p+_)/2,T=(m+g)/2,b=(y+x)/2,w=(v+T)/2,S=o-e,A=u-r,C=Math.abs((i-o)*A-(n-u)*S),F=Math.abs((s-o)*A-(a-u)*S),G;return f||(f=[{x:e,y:r},{x:o,y:u}],l=1),f.splice(l||f.length-1,0,{x:b,y:w}),(C+F)*(C+F)>c*(S*S+A*A)&&(G=f.length,t(e,r,h,d,y,v,b,w,c,f,l),t(b,w,x,T,_,g,o,u,c,f,l+1+(f.length-G))),f},Yr=function(){function t(r,i,n){Yo||Zo(),this.id=r,this.setData(i,n)}var e=t.prototype;return e.setData=function(i,n){n=n||{},i=i||"0,0,1,1";var s=i.match(W_),a=1,o=[],u=[],c=n.precision||1,f=c<=1,l,h,d,p,m,_,g,y,v;if(this.data=i,(q_.test(i)||~i.indexOf("M")&&i.indexOf("C")<0)&&(s=H_(i)[0]),l=s.length,l===4)s.unshift(0,0),s.push(1,1),l=8;else if((l-2)%6)throw"Invalid CustomEase";for((+s[0]!=0||+s[l-2]!=1)&&K_(s,n.height,n.originY),this.segment=s,p=2;p<l;p+=6)h={x:+s[p-2],y:+s[p-1]},d={x:+s[p+4],y:+s[p+5]},o.push(h,d),Z_(h.x,h.y,+s[p],+s[p+1],+s[p+2],+s[p+3],d.x,d.y,1/(c*2e5),o,o.length-1);for(l=o.length,p=0;p<l;p++)g=o[p],y=o[p-1]||g,(g.x>y.x||y.y!==g.y&&y.x===g.x||g===y)&&g.x<=1?(y.cx=g.x-y.x,y.cy=g.y-y.y,y.n=g,y.nx=g.x,f&&p>1&&Math.abs(y.cy/y.cx-o[p-2].cy/o[p-2].cx)>2&&(f=0),y.cx<a&&(y.cx?a=y.cx:(y.cx=.001,p===l-1&&(y.x-=.001,a=Math.min(a,.001),f=0)))):(o.splice(p--,1),l--);if(l=1/a+1|0,m=1/l,_=0,g=o[0],f){for(p=0;p<l;p++)v=p*m,g.nx<v&&(g=o[++_]),h=g.y+(v-g.x)/g.cx*g.cy,u[p]={x:v,cx:m,y:h,cy:0,nx:9},p&&(u[p-1].cy=h-u[p-1].y);u[l-1].cy=o[o.length-1].y-h}else{for(p=0;p<l;p++)g.nx<p*m&&(g=o[++_]),u[p]=g;_<o.length-1&&(u[p-1]=o[o.length-2])}return this.ease=function(x){var T=u[x*l|0]||u[l-1];return T.nx<x&&(T=T.n),T.y+(x-T.x)/T.cx*T.cy},this.ease.custom=this,this.id&&Ge&&Ge.registerEase(this.id,this.ease),this},e.getSVGData=function(i){return t.getSVGData(this,i)},t.create=function(i,n,s){return new t(i,n,s).ease},t.register=function(i){Ge=i,Zo()},t.get=function(i){return Ge.parseEase(i)},t.getSVGData=function(i,n){n=n||{};var s=n.width||100,a=n.height||100,o=n.x||0,u=(n.y||0)+a,c=Ge.utils.toArray(n.path)[0],f,l,h,d,p,m,_,g,y,v;if(n.invert&&(a=-a,u=0),typeof i=="string"&&(i=Ge.parseEase(i)),i.custom&&(i=i.custom),i instanceof t)f=V_(z_([i.segment],s,0,0,-a,o,u));else{for(f=[o,u],_=Math.max(5,(n.precision||1)*200),d=1/_,_+=2,g=5/_,y=$i(o+d*s),v=$i(u+i(d)*-a),l=(v-u)/(y-o),h=2;h<_;h++)p=$i(o+h*d*s),m=$i(u+i(h*d)*-a),(Math.abs((m-v)/(p-y)-l)>g||h===_-1)&&(f.push(y,v),l=(m-v)/(p-y)),y=p,v=m;f="M"+f.join(",")}return c&&c.setAttribute("d",f),f},t}();Ko()&&Ge.registerPlugin(Yr),Yr.version="3.11.5";/*!
|
|
26
26
|
* PixiPlugin 3.11.5
|
|
27
27
|
* https://greensock.com
|
|
28
28
|
*
|
|
@@ -30,24 +30,24 @@
|
|
|
30
30
|
* Subject to the terms at https://greensock.com/standard-license or for
|
|
31
31
|
* Club GreenSock members, the agreement issued with that membership.
|
|
32
32
|
* @author: Jack Doyle, jack@greensock.com
|
|
33
|
-
*/var ln,Of,ha,nr,ls,Ff,Eu,Nf=function(){return typeof window<"u"},Lf=function(){return ln||Nf()&&(ln=window.gsap)&&ln.registerPlugin&&ln},kf=function(e){return typeof e=="function"},iS=function(e){return console.warn(e)},sS=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],ir=.212671,sr=.71516,ar=.072169,fa=function(e,r){var n=[],i=0,a=0,u,l;for(u=0;u<4;u++){for(l=0;l<5;l++)a=l===4?e[i+4]:0,n[i+l]=e[i]*r[l]+e[i+1]*r[l+5]+e[i+2]*r[l+10]+e[i+3]*r[l+15]+a;i+=5}return n},Df=function(e,r){var n=1-r,i=n*ir,a=n*sr,u=n*ar;return fa([i+r,a,u,0,0,i,a+r,u,0,0,i,a,u+r,0,0,0,0,0,1,0],e)},Bf=function(e,r,n){var i=ha(r),a=i[0]/255,u=i[1]/255,l=i[2]/255,h=1-n;return fa([h+n*a*ir,n*a*sr,n*a*ar,0,0,n*u*ir,h+n*u*sr,n*u*ar,0,0,n*l*ir,n*l*sr,h+n*l*ar,0,0,0,0,0,1,0],e)},Uf=function(e,r){r*=Math.PI/180;var n=Math.cos(r),i=Math.sin(r);return fa([ir+n*(1-ir)+i*-ir,sr+n*-sr+i*-sr,ar+n*-ar+i*(1-ar),0,0,ir+n*-ir+i*.143,sr+n*(1-sr)+i*.14,ar+n*-ar+i*-.283,0,0,ir+n*-ir+i*-(1-ir),sr+n*-sr+i*sr,ar+n*(1-ar)+i*ar,0,0,0,0,0,1,0,0,0,0,0,1],e)},$f=function(e,r){return fa([r,0,0,0,.5*(1-r),0,r,0,0,.5*(1-r),0,0,r,0,.5*(1-r),0,0,0,1,0],e)},Gf=function(e,r){var n=nr.filters[r],i=e.filters||[],a=i.length,u;for(n||iS(r+" not found. PixiPlugin.registerPIXI(PIXI)");--a>-1;)if(i[a]instanceof n)return i[a];return u=new n,r==="BlurFilter"&&(u.blur=0),i.push(u),e.filters=i,u},bt=function(e,r,n,i){r.add(n,e,n[e],i[e]),r._props.push(e)},zf=function(e,r){var n=new nr.filters.ColorMatrixFilter;return n.matrix=r,n.brightness(e,!0),n.matrix},aS=function(e){var r={},n;for(n in e)r[n]=e[n];return r},Wt={contrast:1,saturation:1,colorizeAmount:0,colorize:"rgb(255,255,255)",hue:0,brightness:1},oS=function(e,r,n){var i=Gf(e,"ColorMatrixFilter"),a=e._gsColorMatrixFilter=e._gsColorMatrixFilter||aS(Wt),u=r.combineCMF&&!("colorMatrixFilter"in r&&!r.colorMatrixFilter),l,h,p;for(p=i.matrix,r.resolution&&(i.resolution=r.resolution),r.matrix&&r.matrix.length===p.length?(h=r.matrix,a.contrast!==1&&bt("contrast",n,a,Wt),a.hue&&bt("hue",n,a,Wt),a.brightness!==1&&bt("brightness",n,a,Wt),a.colorizeAmount&&(bt("colorize",n,a,Wt),bt("colorizeAmount",n,a,Wt)),a.saturation!==1&&bt("saturation",n,a,Wt)):(h=sS.slice(),r.contrast!=null?(h=$f(h,+r.contrast),bt("contrast",n,a,r)):a.contrast!==1&&(u?h=$f(h,a.contrast):bt("contrast",n,a,Wt)),r.hue!=null?(h=Uf(h,+r.hue),bt("hue",n,a,r)):a.hue&&(u?h=Uf(h,a.hue):bt("hue",n,a,Wt)),r.brightness!=null?(h=zf(+r.brightness,h),bt("brightness",n,a,r)):a.brightness!==1&&(u?h=zf(a.brightness,h):bt("brightness",n,a,Wt)),r.colorize!=null?(r.colorizeAmount="colorizeAmount"in r?+r.colorizeAmount:1,h=Bf(h,r.colorize,r.colorizeAmount),bt("colorize",n,a,r),bt("colorizeAmount",n,a,r)):a.colorizeAmount&&(u?h=Bf(h,a.colorize,a.colorizeAmount):(bt("colorize",n,a,Wt),bt("colorizeAmount",n,a,Wt))),r.saturation!=null?(h=Df(h,+r.saturation),bt("saturation",n,a,r)):a.saturation!==1&&(u?h=Df(h,a.saturation):bt("saturation",n,a,Wt))),l=h.length;--l>-1;)h[l]!==p[l]&&n.add(p,l,p[l],h[l],"colorMatrixFilter");n._props.push("colorMatrixFilter")},uS=function(e,r){var n=r.t,i=r.p,a=r.color,u=r.set;u(n,i,a[0]<<16|a[1]<<8|a[2])},lS=function(e,r){var n=r.g;n&&(n.dirty++,n.clearDirty++)},cS=function(e,r){r.t.visible=!!r.t.alpha},Hf=function(e,r,n,i){var a=e[r],u=ha(kf(a)?e[r.indexOf("set")||!kf(e["get"+r.substr(3)])?r:"get"+r.substr(3)]():a),l=ha(n);i._pt=new ls(i._pt,e,r,0,0,uS,{t:e,p:r,color:u,set:Ff(e,r)}),i.add(u,0,u[0],l[0]),i.add(u,1,u[1],l[1]),i.add(u,2,u[2],l[2])},hS={tint:1,lineColor:1,fillColor:1},Vf="position,scale,skew,pivot,anchor,tilePosition,tileScale".split(","),Cu={x:"position",y:"position",tileX:"tilePosition",tileY:"tilePosition"},fS={colorMatrixFilter:1,saturation:1,contrast:1,hue:1,colorize:1,colorizeAmount:1,brightness:1,combineCMF:1},da=Math.PI/180,Xf=function(e){return typeof e=="string"},dS=function(e){return Xf(e)&&e.charAt(1)==="="?e.substr(0,2)+parseFloat(e.substr(2))*da:e*da},pS=function(e,r){return r.set(r.t,r.p,e===1?r.e:Math.round((r.s+r.c*e)*1e5)/1e5,r)},gS=function(e,r,n,i,a,u){var l=360*(u?da:1),h=Xf(a),p=h&&a.charAt(1)==="="?+(a.charAt(0)+"1"):0,m=parseFloat(p?a.substr(2):a)*(u?da:1),c=p?m*p:m-i,d=i+c,g,v;return h&&(g=a.split("_")[1],g==="short"&&(c%=l,c!==c%(l/2)&&(c+=c<0?l:-l)),g==="cw"&&c<0?c=(c+l*1e10)%l-~~(c/l)*l:g==="ccw"&&c>0&&(c=(c-l*1e10)%l-~~(c/l)*l)),e._pt=v=new ls(e._pt,r,n,i,c,pS),v.e=d,v},jf=function(){Nf()&&(Of=window,ln=Lf(),nr=nr||Of.PIXI,Eu=nr&&nr.VERSION&&nr.VERSION.charAt(0)==="4",ha=function(r){return ln.utils.splitColor((r+"").substr(0,2)==="0x"?"#"+r.substr(2):r)})},pa,cs;for(pa=0;pa<Vf.length;pa++)cs=Vf[pa],Cu[cs+"X"]=cs,Cu[cs+"Y"]=cs;var Iu={version:"3.11.5",name:"pixi",register:function(e,r,n){ln=e,ls=n,Ff=r.getSetter,jf()},registerPIXI:function(e){nr=e},init:function(e,r,n,i,a){if(nr||jf(),!nr||!(e instanceof nr.DisplayObject))return console.warn(e,"is not a DisplayObject or PIXI was not found. PixiPlugin.registerPIXI(PIXI);"),!1;var u,l,h,p,m,c,d,g,v;for(c in r){if(u=Cu[c],h=r[c],u)l=~c.charAt(c.length-1).toLowerCase().indexOf("x")?"x":"y",this.add(e[u],l,e[u][l],u==="skew"?dS(h):h,0,0,0,0,0,1);else if(c==="scale"||c==="anchor"||c==="pivot"||c==="tileScale")this.add(e[c],"x",e[c].x,h),this.add(e[c],"y",e[c].y,h);else if(c==="rotation"||c==="angle")gS(this,e,c,e[c],h,c==="rotation");else if(fS[c])p||(oS(e,r.colorMatrixFilter||r,this),p=!0);else if(c==="blur"||c==="blurX"||c==="blurY"||c==="blurPadding"){if(m=Gf(e,"BlurFilter"),this.add(m,c,m[c],h),r.blurPadding!==0)for(d=r.blurPadding||Math.max(m[c],h)*2,g=e.filters.length;--g>-1;)e.filters[g].padding=Math.max(e.filters[g].padding,d)}else if(hS[c])if((c==="lineColor"||c==="fillColor")&&e instanceof nr.Graphics)for(v=(e.geometry||e).graphicsData,this._pt=new ls(this._pt,e,c,0,0,lS,{g:e.geometry||e}),g=v.length;--g>-1;)Hf(Eu?v[g]:v[g][c.substr(0,4)+"Style"],Eu?c:"color",h,this);else Hf(e,c,h,this);else c==="autoAlpha"?(this._pt=new ls(this._pt,e,"visible",0,0,cS),this.add(e,"alpha",e.alpha,h),this._props.push("alpha","visible")):c!=="resolution"&&this.add(e,c,"get",h);this._props.push(c)}}};Lf()&&ln.registerPlugin(Iu),ee.registerPlugin(Iu),Iu.registerPIXI($t),ee.registerPlugin(us),us.create("springBounce","0.32, 1.06, 0.61, 0.93"),ee.registerEffect({name:"PULSE",effect(t,e){return ee.timeline().fromTo(t,{pixi:{scaleX:.9,scaleY:.9}},{pixi:{scaleX:1.2,scaleY:1.2},duration:.5,ease:"slow"}).to(t,{pixi:{scaleX:1,scaleY:1,...e},duration:.5})}}),ee.registerEffect({name:"SHAKE",effect(t,e){return ee.timeline().to(t,{duration:.1,pixi:{x:"+=5"}}).to(t,{duration:.1,pixi:{x:"-=10"}}).to(t,{duration:.1,pixi:{x:"+=10"}}).to(t,{duration:.1,pixi:{x:"-=10"}}).to(t,{duration:.1,pixi:{x:"+=5"}}).to(t,{pixi:{...e},duration:.5})}}),ee.registerEffect({name:"SWING",effect(t,e){return ee.timeline().to(t,{duration:.5,pixi:{rotation:1}}).to(t,{duration:.5,pixi:{rotation:-1.5}}).to(t,{pixi:{rotation:0,...e},duration:.5})}}),ee.registerEffect({name:"JELLO",effect(t,e){return ee.timeline().to(t,{duration:.3,pixi:{scaleX:.5,rotation:-1}}).to(t,{duration:.4,pixi:{scaleX:1.5,rotation:1}}).to(t,{duration:.3,pixi:{scaleX:1,rotation:0}}).to(t,{pixi:{rotation:0,...e},duration:.5})}}),ee.registerEffect({name:"WOOBLE",effect(t,e){return ee.timeline().to(t,{duration:.3,pixi:{scaleX:.5,x:e.x*-.5}}).to(t,{duration:.3,pixi:{scaleX:1.5,x:e.x*1.5}}).to(t,{duration:.3,pixi:{scaleX:.5,x:e.x*-.01}}).to(t,{duration:.3,pixi:{scaleX:1,x:e.x}}).to(t,{rotation:0,pixi:{...e,rotation:0},duration:.5})}}),ee.registerEffect({name:"NONE",effect(t,e){return ee.timeline().to(t,{duration:0})}}),ee.registerEffect({name:"FLASH",effect(t,e){return ee.timeline().to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1}).to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1}).to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1,...e})}}),ee.registerEffect({name:"BOUNCE_IN",effect(t,e){return ee.timeline().fromTo(t,{pixi:{scaleX:1.5,scaleY:1.5}},{...e,pixi:{x:e==null?void 0:e.x,y:e==null?void 0:e.y,scaleX:1,scaleY:1},duration:2,ease:"bounce.out"})}}),ee.registerEffect({name:"BOUNCE_IN_DOWN",effect(t,e){return ee.timeline().from(t,{duration:2,ease:"bounce.out",immediateRender:!0,pixi:{...e,x:e==null?void 0:e.x,y:-2500,alpha:0}})}}),ee.registerEffect({name:"BOUNCE_IN_LEFT",effect(t,e){return ee.timeline().from(t,{ease:"bounce.out",pixi:{...e,x:-2500,duration:2,alpha:0}})}}),ee.registerEffect({name:"BOUNCE_IN_RIGHT",effect(t,e){return ee.timeline().from(t,{ease:"bounce.out",duration:2,pixi:{...e,x:2500}})}}),ee.registerEffect({name:"BOUNCE_IN_UP",effect(t,e){return ee.timeline().from(t,{ease:"bounce.out",pixi:{...e,y:2e3},duration:2})}}),ee.registerEffect({name:"BOUNCE_OUT",effect(t,e){return ee.timeline().from(t,{...e,ease:"bounce.in",pixi:{y:2e3},duration:1.5})}}),ee.registerEffect({name:"FADE_IN",effect(t){return ee.timeline().fromTo(t,{alpha:0},{ease:"power4.in",alpha:1,duration:1})}}),ee.registerEffect({name:"FADE_IN_DOWN",effect(t,e){return ee.timeline().fromTo(t,{pixi:{y:-1500,alpha:0}},{duration:1,ease:"power4.in",pixi:{y:0,alpha:1,...e}})}}),ee.registerEffect({name:"FADE_IN_LEFT",effect(t,e){return ee.timeline().fromTo(t,{pixi:{alpha:0,x:-2e3}},{ease:"power4.in",pixi:{x:0,alpha:1,...e},duration:1})}}),ee.registerEffect({name:"FADE_IN_RIGHT",effect(t,e){return ee.fromTo(t,{pixi:{x:2e3,alpha:0}},{duration:1,ease:"power4.in",pixi:{x:0,alpha:1,...e}})}}),ee.registerEffect({name:"FADE_IN_UP",effect(t,e){return ee.fromTo(t,{pixi:{y:2e3,alpha:0}},{duration:.8,ease:"power4.in",pixi:{y:0,alpha:1,...e}})}}),ee.registerEffect({name:"SPIN",effect(t){return ee.to(t,{rotation:(e,r)=>ee.utils.snap(360,Number(ee.getProperty(r,"rotation"))+360)})}});function Wf(){return{updateEffect:j.useCallback((e,r,n)=>ee.effects[r]&&e?ee.effects[r](e,n):ee.effects.NONE(e,n),[])}}var Ru=(t=>(t.NONE="NONE",t.FLASH="FLASH",t.PULSE="PULSE",t.SHAKE="SHAKE",t.SWING="SWING",t.JELLO="JELLO",t.WOOBLE="WOOBLE",t.FADE_IN="FADE_IN",t.FADE_OUT="FADE_OUT",t.FADE_IN_OUT="FADE_IN_OUT",t.SLIDE_IN_LEFT="SLIDE_IN_LEFT",t.SLIDE_IN_RIGHT="SLIDE_IN_RIGHT",t.SLIDE_IN_TOP="SLIDE_IN_TOP",t.SLIDE_IN_BOTTOM="SLIDE_IN_BOTTOM",t.SLIDE_OUT_LEFT="SLIDE_OUT_LEFT",t.SLIDE_OUT_RIGHT="SLIDE_OUT_RIGHT",t.SLIDE_OUT_TOP="SLIDE_OUT_TOP",t.SLIDE_OUT_BOTTOM="SLIDE_OUT_BOTTOM",t.ZOOM_IN="ZOOM_IN",t.ZOOM_OUT="ZOOM_OUT",t.ZOOM_IN_OUT="ZOOM_IN_OUT",t.BOUNCE_IN="BOUNCE_IN",t.BOUNCE_OUT="BOUNCE_OUT",t.BOUNCE_IN_OUT="BOUNCE_IN_OUT",t.BOUNCE_IN_DOWN="BOUNCE_IN_DOWN",t.BOUNCE_IN_LEFT="BOUNCE_IN_LEFT",t.BOUNCE_IN_RIGHT="BOUNCE_IN_RIGHT",t.BOUNCE_IN_UP="BOUNCE_IN_UP",t.BOUNCE_OUT_DOWN="BOUNCE_OUT_DOWN",t.BOUNCE_OUT_LEFT="BOUNCE_OUT_LEFT",t.BOUNCE_OUT_RIGHT="BOUNCE_OUT_RIGHT",t.BOUNCE_OUT_UP="BOUNCE_OUT_UP",t.FADE_IN_DOWN="FADE_IN_DOWN",t.FADE_IN_LEFT="FADE_IN_LEFT",t.FADE_IN_RIGHT="FADE_IN_RIGHT",t.FADE_IN_UP="FADE_IN_UP",t.FADE_OUT_DOWN="FADE_OUT_DOWN",t.FADE_OUT_LEFT="FADE_OUT_LEFT",t.FADE_OUT_RIGHT="FADE_OUT_RIGHT",t.FADE_OUT_UP="FADE_OUT_UP",t.ELASTIC_IN="ELASTIC_IN",t.ELASTIC_OUT="ELASTIC_OUT",t.ELASTIC_IN_OUT="ELASTIC_IN_OUT",t.BACK_IN="BACK_IN",t.BACK_OUT="BACK_OUT",t.BACK_IN_OUT="BACK_IN_OUT",t.CIRCULAR_IN="CIRCULAR_IN",t.CIRCULAR_OUT="CIRCULAR_OUT",t.CIRCULAR_IN_OUT="CIRCULAR_IN_OUT",t.EXPO_IN="EXPO_IN",t.EXPO_OUT="EXPO_OUT",t.EXPO_IN_OUT="EXPO_IN_OUT",t.SINE_IN="SINE_IN",t.SINE_OUT="SINE_OUT",t.SINE_IN_OUT="SINE_IN_OUT",t.BOUNCE="BOUNCE",t.ELASTIC="ELASTIC",t.BACK="BACK",t.CIRCULAR="CIRCULAR",t.EXPO="EXPO",t.SINE="SINE",t))(Ru||{});const mS=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],Pn=te.forwardRef((t,e)=>{const[r,n]=te.useState(!1),[i,a]=j.useState(!1),[u,l]=j.useState(!1),[h,p]=j.useState(),m=Iw(h,300),c=j.useRef(null),d=j.useRef(null),g=j.useRef(null),v=j.useRef(null),y=j.useRef(null),b=j.useRef(null),{tl:x}=j.useContext(on),{uniqueId:E,visible:w,startAt:I,transformation:{x:O,y:F,width:N,height:L,scale:D=[1,1],rotation:V=0,effect:Y,overlay:ie,animation:X=Ru.NONE},applyTransformer:G,disabled:ae,pointerdown:se,pointerout:z,pointerover:Q,isText:ge,isDragging:W,isGif:q,onDoubleClick:he,isTextEditMode:fe}=t,me=Wf();ht(Ze.COMPLETE,()=>{c.current}),te.useImperativeHandle(e,()=>({getIsTransformerDragging:()=>i,getIsMouseOverTransformer:()=>u}),[i,u]),te.useEffect(()=>{c.current&&n(!0)},[]),te.useEffect(()=>{p({x:O,y:F,width:N,height:L,animation:X})},[X,O,F,N,L]),te.useEffect(()=>{if(!d.current)return;const Re=ee.context(()=>{if(x.current&&m){const{x:xe,y:Ae,animation:$e}=m||{},Ke=x.current.progress(),pe=me.updateEffect(c.current,$e,{immediateRender:!1,x:xe,y:Ae,overwrite:!0});y.current&&(x.current.remove(y.current),y.current.progress(0).kill()),Ke>.1?(pe.eventCallback("onComplete",()=>{pe.remove("onComplete"),x.current.add(pe,I),y.current=pe}),pe.play()):(pe.progress(1),x.current.add(pe,I),y.current=pe)}else y.current&&y.current.progress(0).kill()},d.current);return()=>{Re.revert()}},[I,m]);const Te=te.useCallback(()=>{l(!0),Q&&Q()},[]),Ce=te.useCallback(()=>{a(!0)},[]),Ue=te.useCallback(Re=>{t.onAnchorTransformationEnd&&t.onAnchorTransformationEnd(Re),a(!1)},[]),He=De.withFilters(De.Container,{matrix:$t.filters.ColorMatrixFilter});return Se.jsxs(De.Container,{ref:d,children:[Se.jsx(De.Container,{ref:c,position:[O,F],pivot:[O,F],width:N,height:L,scale:D,rotation:V,...!ae&&w&&!i&&!W&&{interactive:!0,buttonMode:!0,pointerdown:se,pointerover:Q,pointerout:z},children:Se.jsxs(De.Container,{ref:b,children:[!q&&Se.jsx(He,{scale:1,apply:({matrix:Re})=>{Y===In.BlackAndWhite?Re.desaturate():Y===In.Sepia?Re.sepia():Y===In.RetroVintage||Y===In.NightVision?Re.negative():Y===In.Normal&&Re.reset()},matrix:{enabled:!0,matrix:mS},children:Se.jsx(De.Container,{ref:g,children:t.children})}),q&&Se.jsx(De.Container,{ref:g,children:t.children}),!ss(ie)&&ie!==Au.NONE&&ie!==Au.NORMAL&&Se.jsx(Hw,{overlay:ie,width:N,height:L,x:O,y:F})]})}),G&&w&&!fe&&Se.jsx(ov,{pixiTransformerRef:v,imageRef:c,isMounted:r,transformCommit:Ue,transformChange:Ce,mouseoverEvent:Te,uniqueId:E,isText:ge,onDoubleClick:he})]})});var Mn=(t=>(t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2",t))(Mn||{}),qf=(t=>(t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS",t))(qf||{}),Pu=(t=>(t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL",t))(Pu||{}),de=(t=>(t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR",t))(de||{}),cn=(t=>(t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t))(cn||{}),Z=(t=>(t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t))(Z||{}),fi=(t=>(t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t))(fi||{}),Ge=(t=>(t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT",t))(Ge||{}),Mu=(t=>(t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT",t))(Mu||{}),kr=(t=>(t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR",t))(kr||{}),hs=(t=>(t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t))(hs||{}),On=(t=>(t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL",t))(On||{}),hn=(t=>(t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",t))(hn||{}),Fn=(t=>(t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT",t))(Fn||{}),Ou=(t=>(t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL",t))(Ou||{}),or=(t=>(t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp",t))(or||{}),vt=(t=>(t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE",t[t.COLOR=4]="COLOR",t))(vt||{}),_t=(t=>(t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH",t))(_t||{}),Dr=(t=>(t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t))(Dr||{});const Ie={ADAPTER:{createCanvas:(t,e)=>{const r=document.createElement("canvas");return r.width=t,r.height=e,r},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(t,e)=>fetch(t,e),parseXML:t=>new DOMParser().parseFromString(t,"text/xml")},RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var Fu=/iPhone/i,Yf=/iPod/i,Kf=/iPad/i,Zf=/\biOS-universal(?:.+)Mac\b/i,Nu=/\bAndroid(?:.+)Mobile\b/i,Qf=/Android/i,di=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,ga=/Silk/i,Xr=/Windows Phone/i,Jf=/\bWindows(?:.+)ARM\b/i,ed=/BlackBerry/i,td=/BB10/i,rd=/Opera Mini/i,nd=/\b(CriOS|Chrome)(?:.+)Mobile/i,id=/Mobile(?:.+)Firefox\b/i,sd=function(t){return typeof t<"u"&&t.platform==="MacIntel"&&typeof t.maxTouchPoints=="number"&&t.maxTouchPoints>1&&typeof MSStream>"u"};function _S(t){return function(e){return e.test(t)}}function ad(t){var e={userAgent:"",platform:"",maxTouchPoints:0};!t&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof t=="string"?e.userAgent=t:t&&t.userAgent&&(e={userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0});var r=e.userAgent,n=r.split("[FBAN");typeof n[1]<"u"&&(r=n[0]),n=r.split("Twitter"),typeof n[1]<"u"&&(r=n[0]);var i=_S(r),a={apple:{phone:i(Fu)&&!i(Xr),ipod:i(Yf),tablet:!i(Fu)&&(i(Kf)||sd(e))&&!i(Xr),universal:i(Zf),device:(i(Fu)||i(Yf)||i(Kf)||i(Zf)||sd(e))&&!i(Xr)},amazon:{phone:i(di),tablet:!i(di)&&i(ga),device:i(di)||i(ga)},android:{phone:!i(Xr)&&i(di)||!i(Xr)&&i(Nu),tablet:!i(Xr)&&!i(di)&&!i(Nu)&&(i(ga)||i(Qf)),device:!i(Xr)&&(i(di)||i(ga)||i(Nu)||i(Qf))||i(/\bokhttp\b/i)},windows:{phone:i(Xr),tablet:i(Jf),device:i(Xr)||i(Jf)},other:{blackberry:i(ed),blackberry10:i(td),opera:i(rd),firefox:i(id),chrome:i(nd),device:i(ed)||i(td)||i(rd)||i(id)||i(nd)},any:!1,phone:!1,tablet:!1};return a.any=a.apple.device||a.android.device||a.windows.device||a.other.device,a.phone=a.apple.phone||a.android.phone||a.windows.phone,a.tablet=a.apple.tablet||a.android.tablet||a.windows.tablet,a}const pi=(ad.default??ad)(globalThis.navigator);Ie.RETINA_PREFIX=/@([0-9\.]+)x/,Ie.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var od={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(h,p,m){this.fn=h,this.context=p,this.once=m||!1}function a(h,p,m,c,d){if(typeof m!="function")throw new TypeError("The listener must be a function");var g=new i(m,c||h,d),v=r?r+p:p;return h._events[v]?h._events[v].fn?h._events[v]=[h._events[v],g]:h._events[v].push(g):(h._events[v]=g,h._eventsCount++),h}function u(h,p){--h._eventsCount===0?h._events=new n:delete h._events[p]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var p=[],m,c;if(this._eventsCount===0)return p;for(c in m=this._events)e.call(m,c)&&p.push(r?c.slice(1):c);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(m)):p},l.prototype.listeners=function(p){var m=r?r+p:p,c=this._events[m];if(!c)return[];if(c.fn)return[c.fn];for(var d=0,g=c.length,v=new Array(g);d<g;d++)v[d]=c[d].fn;return v},l.prototype.listenerCount=function(p){var m=r?r+p:p,c=this._events[m];return c?c.fn?1:c.length:0},l.prototype.emit=function(p,m,c,d,g,v){var y=r?r+p:p;if(!this._events[y])return!1;var b=this._events[y],x=arguments.length,E,w;if(b.fn){switch(b.once&&this.removeListener(p,b.fn,void 0,!0),x){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,m),!0;case 3:return b.fn.call(b.context,m,c),!0;case 4:return b.fn.call(b.context,m,c,d),!0;case 5:return b.fn.call(b.context,m,c,d,g),!0;case 6:return b.fn.call(b.context,m,c,d,g,v),!0}for(w=1,E=new Array(x-1);w<x;w++)E[w-1]=arguments[w];b.fn.apply(b.context,E)}else{var I=b.length,O;for(w=0;w<I;w++)switch(b[w].once&&this.removeListener(p,b[w].fn,void 0,!0),x){case 1:b[w].fn.call(b[w].context);break;case 2:b[w].fn.call(b[w].context,m);break;case 3:b[w].fn.call(b[w].context,m,c);break;case 4:b[w].fn.call(b[w].context,m,c,d);break;default:if(!E)for(O=1,E=new Array(x-1);O<x;O++)E[O-1]=arguments[O];b[w].fn.apply(b[w].context,E)}}return!0},l.prototype.on=function(p,m,c){return a(this,p,m,c,!1)},l.prototype.once=function(p,m,c){return a(this,p,m,c,!0)},l.prototype.removeListener=function(p,m,c,d){var g=r?r+p:p;if(!this._events[g])return this;if(!m)return u(this,g),this;var v=this._events[g];if(v.fn)v.fn===m&&(!d||v.once)&&(!c||v.context===c)&&u(this,g);else{for(var y=0,b=[],x=v.length;y<x;y++)(v[y].fn!==m||d&&!v[y].once||c&&v[y].context!==c)&&b.push(v[y]);b.length?this._events[g]=b.length===1?b[0]:b:u(this,g)}return this},l.prototype.removeAllListeners=function(p){var m;return p?(m=r?r+p:p,this._events[m]&&u(this,m)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=r,l.EventEmitter=l,t.exports=l})(od);var vS=od.exports;const ma=Cn(vS);var Lu={exports:{}};Lu.exports=_a,Lu.exports.default=_a;function _a(t,e,r){r=r||2;var n=e&&e.length,i=n?e[0]*r:t.length,a=ud(t,0,i,r,!0),u=[];if(!a||a.next===a.prev)return u;var l,h,p,m,c,d,g;if(n&&(a=wS(t,e,a,r)),t.length>80*r){l=p=t[0],h=m=t[1];for(var v=r;v<i;v+=r)c=t[v],d=t[v+1],c<l&&(l=c),d<h&&(h=d),c>p&&(p=c),d>m&&(m=d);g=Math.max(p-l,m-h),g=g!==0?32767/g:0}return fs(a,u,r,l,h,g,0),u}function ud(t,e,r,n,i){var a,u;if(i===Bu(t,e,r,n)>0)for(a=e;a<r;a+=n)u=hd(a,t[a],t[a+1],u);else for(a=r-n;a>=e;a-=n)u=hd(a,t[a],t[a+1],u);return u&&va(u,u.next)&&(ps(u),u=u.next),u}function Nn(t,e){if(!t)return t;e||(e=t);var r=t,n;do if(n=!1,!r.steiner&&(va(r,r.next)||ot(r.prev,r,r.next)===0)){if(ps(r),r=e=r.prev,r===r.next)break;n=!0}else r=r.next;while(n||r!==e);return e}function fs(t,e,r,n,i,a,u){if(t){!u&&a&&IS(t,n,i,a);for(var l=t,h,p;t.prev!==t.next;){if(h=t.prev,p=t.next,a?xS(t,n,i,a):yS(t)){e.push(h.i/r|0),e.push(t.i/r|0),e.push(p.i/r|0),ps(t),t=p.next,l=p.next;continue}if(t=p,t===l){u?u===1?(t=bS(Nn(t),e,r),fs(t,e,r,n,i,a,2)):u===2&&TS(t,e,r,n,i,a):fs(Nn(t),e,r,n,i,a,1);break}}}}function yS(t){var e=t.prev,r=t,n=t.next;if(ot(e,r,n)>=0)return!1;for(var i=e.x,a=r.x,u=n.x,l=e.y,h=r.y,p=n.y,m=i<a?i<u?i:u:a<u?a:u,c=l<h?l<p?l:p:h<p?h:p,d=i>a?i>u?i:u:a>u?a:u,g=l>h?l>p?l:p:h>p?h:p,v=n.next;v!==e;){if(v.x>=m&&v.x<=d&&v.y>=c&&v.y<=g&&gi(i,l,a,h,u,p,v.x,v.y)&&ot(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function xS(t,e,r,n){var i=t.prev,a=t,u=t.next;if(ot(i,a,u)>=0)return!1;for(var l=i.x,h=a.x,p=u.x,m=i.y,c=a.y,d=u.y,g=l<h?l<p?l:p:h<p?h:p,v=m<c?m<d?m:d:c<d?c:d,y=l>h?l>p?l:p:h>p?h:p,b=m>c?m>d?m:d:c>d?c:d,x=ku(g,v,e,r,n),E=ku(y,b,e,r,n),w=t.prevZ,I=t.nextZ;w&&w.z>=x&&I&&I.z<=E;){if(w.x>=g&&w.x<=y&&w.y>=v&&w.y<=b&&w!==i&&w!==u&&gi(l,m,h,c,p,d,w.x,w.y)&&ot(w.prev,w,w.next)>=0||(w=w.prevZ,I.x>=g&&I.x<=y&&I.y>=v&&I.y<=b&&I!==i&&I!==u&&gi(l,m,h,c,p,d,I.x,I.y)&&ot(I.prev,I,I.next)>=0))return!1;I=I.nextZ}for(;w&&w.z>=x;){if(w.x>=g&&w.x<=y&&w.y>=v&&w.y<=b&&w!==i&&w!==u&&gi(l,m,h,c,p,d,w.x,w.y)&&ot(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;I&&I.z<=E;){if(I.x>=g&&I.x<=y&&I.y>=v&&I.y<=b&&I!==i&&I!==u&&gi(l,m,h,c,p,d,I.x,I.y)&&ot(I.prev,I,I.next)>=0)return!1;I=I.nextZ}return!0}function bS(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!va(i,a)&&ld(i,n,n.next,a)&&ds(i,a)&&ds(a,i)&&(e.push(i.i/r|0),e.push(n.i/r|0),e.push(a.i/r|0),ps(n),ps(n.next),n=t=a),n=n.next}while(n!==t);return Nn(n)}function TS(t,e,r,n,i,a){var u=t;do{for(var l=u.next.next;l!==u.prev;){if(u.i!==l.i&&MS(u,l)){var h=cd(u,l);u=Nn(u,u.next),h=Nn(h,h.next),fs(u,e,r,n,i,a,0),fs(h,e,r,n,i,a,0);return}l=l.next}u=u.next}while(u!==t)}function wS(t,e,r,n){var i=[],a,u,l,h,p;for(a=0,u=e.length;a<u;a++)l=e[a]*n,h=a<u-1?e[a+1]*n:t.length,p=ud(t,l,h,n,!1),p===p.next&&(p.steiner=!0),i.push(PS(p));for(i.sort(SS),a=0;a<i.length;a++)r=AS(i[a],r);return r}function SS(t,e){return t.x-e.x}function AS(t,e){var r=ES(t,e);if(!r)return e;var n=cd(r,t);return Nn(n,n.next),Nn(r,r.next)}function ES(t,e){var r=e,n=t.x,i=t.y,a=-1/0,u;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var l=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(l<=n&&l>a&&(a=l,u=r.x<r.next.x?r:r.next,l===n))return u}r=r.next}while(r!==e);if(!u)return null;var h=u,p=u.x,m=u.y,c=1/0,d;r=u;do n>=r.x&&r.x>=p&&n!==r.x&&gi(i<m?n:a,i,p,m,i<m?a:n,i,r.x,r.y)&&(d=Math.abs(i-r.y)/(n-r.x),ds(r,t)&&(d<c||d===c&&(r.x>u.x||r.x===u.x&&CS(u,r)))&&(u=r,c=d)),r=r.next;while(r!==h);return u}function CS(t,e){return ot(t.prev,t,e.prev)<0&&ot(e.next,t,t.next)<0}function IS(t,e,r,n){var i=t;do i.z===0&&(i.z=ku(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,RS(i)}function RS(t){var e,r,n,i,a,u,l,h,p=1;do{for(r=t,t=null,a=null,u=0;r;){for(u++,n=r,l=0,e=0;e<p&&(l++,n=n.nextZ,!!n);e++);for(h=p;l>0||h>0&&n;)l!==0&&(h===0||!n||r.z<=n.z)?(i=r,r=r.nextZ,l--):(i=n,n=n.nextZ,h--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,p*=2}while(u>1);return t}function ku(t,e,r,n,i){return t=(t-r)*i|0,e=(e-n)*i|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function PS(t){var e=t,r=t;do(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next;while(e!==t);return r}function gi(t,e,r,n,i,a,u,l){return(i-u)*(e-l)>=(t-u)*(a-l)&&(t-u)*(n-l)>=(r-u)*(e-l)&&(r-u)*(a-l)>=(i-u)*(n-l)}function MS(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!OS(t,e)&&(ds(t,e)&&ds(e,t)&&FS(t,e)&&(ot(t.prev,t,e.prev)||ot(t,e.prev,e))||va(t,e)&&ot(t.prev,t,t.next)>0&&ot(e.prev,e,e.next)>0)}function ot(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function va(t,e){return t.x===e.x&&t.y===e.y}function ld(t,e,r,n){var i=xa(ot(t,e,r)),a=xa(ot(t,e,n)),u=xa(ot(r,n,t)),l=xa(ot(r,n,e));return!!(i!==a&&u!==l||i===0&&ya(t,r,e)||a===0&&ya(t,n,e)||u===0&&ya(r,t,n)||l===0&&ya(r,e,n))}function ya(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function xa(t){return t>0?1:t<0?-1:0}function OS(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&ld(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}function ds(t,e){return ot(t.prev,t,t.next)<0?ot(t,e,t.next)>=0&&ot(t,t.prev,e)>=0:ot(t,e,t.prev)<0||ot(t,t.next,e)<0}function FS(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==t);return n}function cd(t,e){var r=new Du(t.i,t.x,t.y),n=new Du(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function hd(t,e,r,n){var i=new Du(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function ps(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Du(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}_a.deviation=function(t,e,r,n){var i=e&&e.length,a=i?e[0]*r:t.length,u=Math.abs(Bu(t,0,a,r));if(i)for(var l=0,h=e.length;l<h;l++){var p=e[l]*r,m=l<h-1?e[l+1]*r:t.length;u-=Math.abs(Bu(t,p,m,r))}var c=0;for(l=0;l<n.length;l+=3){var d=n[l]*r,g=n[l+1]*r,v=n[l+2]*r;c+=Math.abs((t[d]-t[v])*(t[g+1]-t[d+1])-(t[d]-t[g])*(t[v+1]-t[d+1]))}return u===0&&c===0?0:Math.abs((c-u)/u)};function Bu(t,e,r,n){for(var i=0,a=e,u=r-n;a<r;a+=n)i+=(t[u]-t[a])*(t[a+1]+t[u+1]),u=a;return i}_a.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},n=0,i=0;i<t.length;i++){for(var a=0;a<t[i].length;a++)for(var u=0;u<e;u++)r.vertices.push(t[i][a][u]);i>0&&(n+=t[i-1].length,r.holes.push(n))}return r};var NS=Lu.exports;const LS=Cn(NS);var ba={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */ba.exports,function(t,e){(function(r){var n=e&&!e.nodeType&&e,i=t&&!t.nodeType&&t,a=typeof Et=="object"&&Et;(a.global===a||a.window===a||a.self===a)&&(r=a);var u,l=2147483647,h=36,p=1,m=26,c=38,d=700,g=72,v=128,y="-",b=/^xn--/,x=/[^\x20-\x7E]/,E=/[\x2E\u3002\uFF0E\uFF61]/g,w={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},I=h-p,O=Math.floor,F=String.fromCharCode,N;function L(W){throw new RangeError(w[W])}function D(W,q){for(var he=W.length,fe=[];he--;)fe[he]=q(W[he]);return fe}function V(W,q){var he=W.split("@"),fe="";he.length>1&&(fe=he[0]+"@",W=he[1]),W=W.replace(E,".");var me=W.split("."),Te=D(me,q).join(".");return fe+Te}function Y(W){for(var q=[],he=0,fe=W.length,me,Te;he<fe;)me=W.charCodeAt(he++),me>=55296&&me<=56319&&he<fe?(Te=W.charCodeAt(he++),(Te&64512)==56320?q.push(((me&1023)<<10)+(Te&1023)+65536):(q.push(me),he--)):q.push(me);return q}function ie(W){return D(W,function(q){var he="";return q>65535&&(q-=65536,he+=F(q>>>10&1023|55296),q=56320|q&1023),he+=F(q),he}).join("")}function X(W){return W-48<10?W-22:W-65<26?W-65:W-97<26?W-97:h}function G(W,q){return W+22+75*(W<26)-((q!=0)<<5)}function ae(W,q,he){var fe=0;for(W=he?O(W/d):W>>1,W+=O(W/q);W>I*m>>1;fe+=h)W=O(W/I);return O(fe+(I+1)*W/(W+c))}function se(W){var q=[],he=W.length,fe,me=0,Te=v,Ce=g,Ue,He,Re,xe,Ae,$e,Ke,pe,ve;for(Ue=W.lastIndexOf(y),Ue<0&&(Ue=0),He=0;He<Ue;++He)W.charCodeAt(He)>=128&&L("not-basic"),q.push(W.charCodeAt(He));for(Re=Ue>0?Ue+1:0;Re<he;){for(xe=me,Ae=1,$e=h;Re>=he&&L("invalid-input"),Ke=X(W.charCodeAt(Re++)),(Ke>=h||Ke>O((l-me)/Ae))&&L("overflow"),me+=Ke*Ae,pe=$e<=Ce?p:$e>=Ce+m?m:$e-Ce,!(Ke<pe);$e+=h)ve=h-pe,Ae>O(l/ve)&&L("overflow"),Ae*=ve;fe=q.length+1,Ce=ae(me-xe,fe,xe==0),O(me/fe)>l-Te&&L("overflow"),Te+=O(me/fe),me%=fe,q.splice(me++,0,Te)}return ie(q)}function z(W){var q,he,fe,me,Te,Ce,Ue,He,Re,xe,Ae,$e=[],Ke,pe,ve,st;for(W=Y(W),Ke=W.length,q=v,he=0,Te=g,Ce=0;Ce<Ke;++Ce)Ae=W[Ce],Ae<128&&$e.push(F(Ae));for(fe=me=$e.length,me&&$e.push(y);fe<Ke;){for(Ue=l,Ce=0;Ce<Ke;++Ce)Ae=W[Ce],Ae>=q&&Ae<Ue&&(Ue=Ae);for(pe=fe+1,Ue-q>O((l-he)/pe)&&L("overflow"),he+=(Ue-q)*pe,q=Ue,Ce=0;Ce<Ke;++Ce)if(Ae=W[Ce],Ae<q&&++he>l&&L("overflow"),Ae==q){for(He=he,Re=h;xe=Re<=Te?p:Re>=Te+m?m:Re-Te,!(He<xe);Re+=h)st=He-xe,ve=h-xe,$e.push(F(G(xe+st%ve,0))),He=O(st/ve);$e.push(F(G(He,0))),Te=ae(he,pe,fe==me),he=0,++fe}++he,++q}return $e.join("")}function Q(W){return V(W,function(q){return b.test(q)?se(q.slice(4).toLowerCase()):q})}function ge(W){return V(W,function(q){return x.test(q)?"xn--"+z(q):q})}if(u={version:"1.4.1",ucs2:{decode:Y,encode:ie},decode:se,encode:z,toASCII:ge,toUnicode:Q},n&&i)if(t.exports==n)i.exports=u;else for(N in u)u.hasOwnProperty(N)&&(n[N]=u[N]);else r.punycode=u})(Et)}(ba,ba.exports);var kS=ba.exports,DS=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(r in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var u=Object.getOwnPropertyDescriptor(e,r);if(u.value!==i||u.enumerable!==!0)return!1}return!0},fd=typeof Symbol<"u"&&Symbol,BS=DS,US=function(){return typeof fd!="function"||typeof Symbol!="function"||typeof fd("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:BS()},dd={foo:{}},$S=Object,GS=function(){return{__proto__:dd}.foo===dd.foo&&!({__proto__:null}instanceof $S)},zS="Function.prototype.bind called on incompatible ",Uu=Array.prototype.slice,HS=Object.prototype.toString,VS="[object Function]",XS=function(e){var r=this;if(typeof r!="function"||HS.call(r)!==VS)throw new TypeError(zS+r);for(var n=Uu.call(arguments,1),i,a=function(){if(this instanceof i){var m=r.apply(this,n.concat(Uu.call(arguments)));return Object(m)===m?m:this}else return r.apply(e,n.concat(Uu.call(arguments)))},u=Math.max(0,r.length-n.length),l=[],h=0;h<u;h++)l.push("$"+h);if(i=Function("binder","return function ("+l.join(",")+"){ return binder.apply(this,arguments); }")(a),r.prototype){var p=function(){};p.prototype=r.prototype,i.prototype=new p,p.prototype=null}return i},jS=XS,$u=Function.prototype.bind||jS,WS=$u,qS=WS.call(Function.call,Object.prototype.hasOwnProperty),Me,mi=SyntaxError,pd=Function,_i=TypeError,Gu=function(t){try{return pd('"use strict"; return ('+t+").constructor;")()}catch{}},Ln=Object.getOwnPropertyDescriptor;if(Ln)try{Ln({},"")}catch{Ln=null}var zu=function(){throw new _i},YS=Ln?function(){try{return arguments.callee,zu}catch{try{return Ln(arguments,"callee").get}catch{return zu}}}():zu,vi=US(),KS=GS(),Tt=Object.getPrototypeOf||(KS?function(t){return t.__proto__}:null),yi={},ZS=typeof Uint8Array>"u"||!Tt?Me:Tt(Uint8Array),kn={"%AggregateError%":typeof AggregateError>"u"?Me:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Me:ArrayBuffer,"%ArrayIteratorPrototype%":vi&&Tt?Tt([][Symbol.iterator]()):Me,"%AsyncFromSyncIteratorPrototype%":Me,"%AsyncFunction%":yi,"%AsyncGenerator%":yi,"%AsyncGeneratorFunction%":yi,"%AsyncIteratorPrototype%":yi,"%Atomics%":typeof Atomics>"u"?Me:Atomics,"%BigInt%":typeof BigInt>"u"?Me:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Me:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Me:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Me:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?Me:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Me:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Me:FinalizationRegistry,"%Function%":pd,"%GeneratorFunction%":yi,"%Int8Array%":typeof Int8Array>"u"?Me:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Me:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Me:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":vi&&Tt?Tt(Tt([][Symbol.iterator]())):Me,"%JSON%":typeof JSON=="object"?JSON:Me,"%Map%":typeof Map>"u"?Me:Map,"%MapIteratorPrototype%":typeof Map>"u"||!vi||!Tt?Me:Tt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Me:Promise,"%Proxy%":typeof Proxy>"u"?Me:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?Me:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Me:Set,"%SetIteratorPrototype%":typeof Set>"u"||!vi||!Tt?Me:Tt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Me:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":vi&&Tt?Tt(""[Symbol.iterator]()):Me,"%Symbol%":vi?Symbol:Me,"%SyntaxError%":mi,"%ThrowTypeError%":YS,"%TypedArray%":ZS,"%TypeError%":_i,"%Uint8Array%":typeof Uint8Array>"u"?Me:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Me:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Me:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Me:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?Me:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Me:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Me:WeakSet};if(Tt)try{null.error}catch(t){var QS=Tt(Tt(t));kn["%Error.prototype%"]=QS}var JS=function t(e){var r;if(e==="%AsyncFunction%")r=Gu("async function () {}");else if(e==="%GeneratorFunction%")r=Gu("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=Gu("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&Tt&&(r=Tt(i.prototype))}return kn[e]=r,r},gd={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},gs=$u,Ta=qS,eA=gs.call(Function.call,Array.prototype.concat),tA=gs.call(Function.apply,Array.prototype.splice),md=gs.call(Function.call,String.prototype.replace),wa=gs.call(Function.call,String.prototype.slice),rA=gs.call(Function.call,RegExp.prototype.exec),nA=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,iA=/\\(\\)?/g,sA=function(e){var r=wa(e,0,1),n=wa(e,-1);if(r==="%"&&n!=="%")throw new mi("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new mi("invalid intrinsic syntax, expected opening `%`");var i=[];return md(e,nA,function(a,u,l,h){i[i.length]=l?md(h,iA,"$1"):u||a}),i},aA=function(e,r){var n=e,i;if(Ta(gd,n)&&(i=gd[n],n="%"+i[0]+"%"),Ta(kn,n)){var a=kn[n];if(a===yi&&(a=JS(n)),typeof a>"u"&&!r)throw new _i("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:a}}throw new mi("intrinsic "+e+" does not exist!")},Hu=function(e,r){if(typeof e!="string"||e.length===0)throw new _i("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new _i('"allowMissing" argument must be a boolean');if(rA(/^%?[^%]*%?$/,e)===null)throw new mi("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=sA(e),i=n.length>0?n[0]:"",a=aA("%"+i+"%",r),u=a.name,l=a.value,h=!1,p=a.alias;p&&(i=p[0],tA(n,eA([0,1],p)));for(var m=1,c=!0;m<n.length;m+=1){var d=n[m],g=wa(d,0,1),v=wa(d,-1);if((g==='"'||g==="'"||g==="`"||v==='"'||v==="'"||v==="`")&&g!==v)throw new mi("property names with quotes must have matching quotes");if((d==="constructor"||!c)&&(h=!0),i+="."+d,u="%"+i+"%",Ta(kn,u))l=kn[u];else if(l!=null){if(!(d in l)){if(!r)throw new _i("base intrinsic for "+e+" exists, but the property is not available.");return}if(Ln&&m+1>=n.length){var y=Ln(l,d);c=!!y,c&&"get"in y&&!("originalValue"in y.get)?l=y.get:l=l[d]}else c=Ta(l,d),l=l[d];c&&!h&&(kn[u]=l)}}return l},_d={exports:{}};(function(t){var e=$u,r=Hu,n=r("%Function.prototype.apply%"),i=r("%Function.prototype.call%"),a=r("%Reflect.apply%",!0)||e.call(i,n),u=r("%Object.getOwnPropertyDescriptor%",!0),l=r("%Object.defineProperty%",!0),h=r("%Math.max%");if(l)try{l({},"a",{value:1})}catch{l=null}t.exports=function(c){var d=a(e,i,arguments);if(u&&l){var g=u(d,"length");g.configurable&&l(d,"length",{value:1+h(0,c.length-(arguments.length-1))})}return d};var p=function(){return a(e,n,arguments)};l?l(t.exports,"apply",{value:p}):t.exports.apply=p})(_d);var oA=_d.exports,vd=Hu,yd=oA,uA=yd(vd("String.prototype.indexOf")),lA=function(e,r){var n=vd(e,!!r);return typeof n=="function"&&uA(e,".prototype.")>-1?yd(n):n};const cA=Q_(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Vu=typeof Map=="function"&&Map.prototype,Xu=Object.getOwnPropertyDescriptor&&Vu?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Sa=Vu&&Xu&&typeof Xu.get=="function"?Xu.get:null,xd=Vu&&Map.prototype.forEach,ju=typeof Set=="function"&&Set.prototype,Wu=Object.getOwnPropertyDescriptor&&ju?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Aa=ju&&Wu&&typeof Wu.get=="function"?Wu.get:null,bd=ju&&Set.prototype.forEach,hA=typeof WeakMap=="function"&&WeakMap.prototype,ms=hA?WeakMap.prototype.has:null,fA=typeof WeakSet=="function"&&WeakSet.prototype,_s=fA?WeakSet.prototype.has:null,dA=typeof WeakRef=="function"&&WeakRef.prototype,Td=dA?WeakRef.prototype.deref:null,pA=Boolean.prototype.valueOf,gA=Object.prototype.toString,mA=Function.prototype.toString,_A=String.prototype.match,qu=String.prototype.slice,fn=String.prototype.replace,vA=String.prototype.toUpperCase,wd=String.prototype.toLowerCase,Sd=RegExp.prototype.test,Ad=Array.prototype.concat,Br=Array.prototype.join,yA=Array.prototype.slice,Ed=Math.floor,Yu=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Ku=Object.getOwnPropertySymbols,Zu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,xi=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Pt=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===xi||"symbol")?Symbol.toStringTag:null,Cd=Object.prototype.propertyIsEnumerable,Id=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function Rd(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||Sd.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-Ed(-t):Ed(t);if(n!==t){var i=String(n),a=qu.call(e,i.length+1);return fn.call(i,r,"$&_")+"."+fn.call(fn.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return fn.call(e,r,"$&_")}var Qu=cA,Pd=Qu.custom,Md=Nd(Pd)?Pd:null,xA=function t(e,r,n,i){var a=r||{};if(dn(a,"quoteStyle")&&a.quoteStyle!=="single"&&a.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(dn(a,"maxStringLength")&&(typeof a.maxStringLength=="number"?a.maxStringLength<0&&a.maxStringLength!==1/0:a.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var u=dn(a,"customInspect")?a.customInspect:!0;if(typeof u!="boolean"&&u!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(dn(a,"indent")&&a.indent!==null&&a.indent!==" "&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(dn(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=a.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return kd(e,a);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var h=String(e);return l?Rd(e,h):h}if(typeof e=="bigint"){var p=String(e)+"n";return l?Rd(e,p):p}var m=typeof a.depth>"u"?5:a.depth;if(typeof n>"u"&&(n=0),n>=m&&m>0&&typeof e=="object")return Ju(e)?"[Array]":"[Object]";var c=BA(a,n);if(typeof i>"u")i=[];else if(Ld(i,e)>=0)return"[Circular]";function d(X,G,ae){if(G&&(i=yA.call(i),i.push(G)),ae){var se={depth:a.depth};return dn(a,"quoteStyle")&&(se.quoteStyle=a.quoteStyle),t(X,se,n+1,i)}return t(X,a,n+1,i)}if(typeof e=="function"&&!Fd(e)){var g=RA(e),v=Ea(e,d);return"[Function"+(g?": "+g:" (anonymous)")+"]"+(v.length>0?" { "+Br.call(v,", ")+" }":"")}if(Nd(e)){var y=xi?fn.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Zu.call(e);return typeof e=="object"&&!xi?vs(y):y}if(LA(e)){for(var b="<"+wd.call(String(e.nodeName)),x=e.attributes||[],E=0;E<x.length;E++)b+=" "+x[E].name+"="+Od(bA(x[E].value),"double",a);return b+=">",e.childNodes&&e.childNodes.length&&(b+="..."),b+="</"+wd.call(String(e.nodeName))+">",b}if(Ju(e)){if(e.length===0)return"[]";var w=Ea(e,d);return c&&!DA(w)?"["+tl(w,c)+"]":"[ "+Br.call(w,", ")+" ]"}if(wA(e)){var I=Ea(e,d);return!("cause"in Error.prototype)&&"cause"in e&&!Cd.call(e,"cause")?"{ ["+String(e)+"] "+Br.call(Ad.call("[cause]: "+d(e.cause),I),", ")+" }":I.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Br.call(I,", ")+" }"}if(typeof e=="object"&&u){if(Md&&typeof e[Md]=="function"&&Qu)return Qu(e,{depth:m-n});if(u!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(PA(e)){var O=[];return xd&&xd.call(e,function(X,G){O.push(d(G,e,!0)+" => "+d(X,e))}),Dd("Map",Sa.call(e),O,c)}if(FA(e)){var F=[];return bd&&bd.call(e,function(X){F.push(d(X,e))}),Dd("Set",Aa.call(e),F,c)}if(MA(e))return el("WeakMap");if(NA(e))return el("WeakSet");if(OA(e))return el("WeakRef");if(AA(e))return vs(d(Number(e)));if(CA(e))return vs(d(Yu.call(e)));if(EA(e))return vs(pA.call(e));if(SA(e))return vs(d(String(e)));if(!TA(e)&&!Fd(e)){var N=Ea(e,d),L=Id?Id(e)===Object.prototype:e instanceof Object||e.constructor===Object,D=e instanceof Object?"":"null prototype",V=!L&&Pt&&Object(e)===e&&Pt in e?qu.call(pn(e),8,-1):D?"Object":"",Y=L||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",ie=Y+(V||D?"["+Br.call(Ad.call([],V||[],D||[]),": ")+"] ":"");return N.length===0?ie+"{}":c?ie+"{"+tl(N,c)+"}":ie+"{ "+Br.call(N,", ")+" }"}return String(e)};function Od(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function bA(t){return fn.call(String(t),/"/g,""")}function Ju(t){return pn(t)==="[object Array]"&&(!Pt||!(typeof t=="object"&&Pt in t))}function TA(t){return pn(t)==="[object Date]"&&(!Pt||!(typeof t=="object"&&Pt in t))}function Fd(t){return pn(t)==="[object RegExp]"&&(!Pt||!(typeof t=="object"&&Pt in t))}function wA(t){return pn(t)==="[object Error]"&&(!Pt||!(typeof t=="object"&&Pt in t))}function SA(t){return pn(t)==="[object String]"&&(!Pt||!(typeof t=="object"&&Pt in t))}function AA(t){return pn(t)==="[object Number]"&&(!Pt||!(typeof t=="object"&&Pt in t))}function EA(t){return pn(t)==="[object Boolean]"&&(!Pt||!(typeof t=="object"&&Pt in t))}function Nd(t){if(xi)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!Zu)return!1;try{return Zu.call(t),!0}catch{}return!1}function CA(t){if(!t||typeof t!="object"||!Yu)return!1;try{return Yu.call(t),!0}catch{}return!1}var IA=Object.prototype.hasOwnProperty||function(t){return t in this};function dn(t,e){return IA.call(t,e)}function pn(t){return gA.call(t)}function RA(t){if(t.name)return t.name;var e=_A.call(mA.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function Ld(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function PA(t){if(!Sa||!t||typeof t!="object")return!1;try{Sa.call(t);try{Aa.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}function MA(t){if(!ms||!t||typeof t!="object")return!1;try{ms.call(t,ms);try{_s.call(t,_s)}catch{return!0}return t instanceof WeakMap}catch{}return!1}function OA(t){if(!Td||!t||typeof t!="object")return!1;try{return Td.call(t),!0}catch{}return!1}function FA(t){if(!Aa||!t||typeof t!="object")return!1;try{Aa.call(t);try{Sa.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}function NA(t){if(!_s||!t||typeof t!="object")return!1;try{_s.call(t,_s);try{ms.call(t,ms)}catch{return!0}return t instanceof WeakSet}catch{}return!1}function LA(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}function kd(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return kd(qu.call(t,0,e.maxStringLength),e)+n}var i=fn.call(fn.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,kA);return Od(i,"single",e)}function kA(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+vA.call(e.toString(16))}function vs(t){return"Object("+t+")"}function el(t){return t+" { ? }"}function Dd(t,e,r,n){var i=n?tl(r,n):Br.call(r,", ");return t+" ("+e+") {"+i+"}"}function DA(t){for(var e=0;e<t.length;e++)if(Ld(t[e],`
|
|
34
|
-
`)>=0)return!1;return!0}function
|
|
35
|
-
`+e.prev+e.base;return r+
|
|
36
|
-
`+e.prev}function Ea(t,e){var r=Ju(t),n=[];if(r){n.length=t.length;for(var i=0;i<t.length;i++)n[i]=dn(t,i)?e(t[i],t):""}var a=typeof Ku=="function"?Ku(t):[],u;if(xi){u={};for(var l=0;l<a.length;l++)u["$"+a[l]]=a[l]}for(var h in t)dn(t,h)&&(r&&String(Number(h))===h&&h<t.length||xi&&u["$"+h]instanceof Symbol||(Sd.call(/[^\w$]/,h)?n.push(e(h,t)+": "+e(t[h],t)):n.push(h+": "+e(t[h],t))));if(typeof Ku=="function")for(var p=0;p<a.length;p++)Cd.call(t,a[p])&&n.push("["+e(a[p])+"]: "+e(t[a[p]],t));return n}var rl=Hu,bi=lA,UA=xA,$A=rl("%TypeError%"),Ca=rl("%WeakMap%",!0),Ia=rl("%Map%",!0),GA=bi("WeakMap.prototype.get",!0),zA=bi("WeakMap.prototype.set",!0),HA=bi("WeakMap.prototype.has",!0),VA=bi("Map.prototype.get",!0),XA=bi("Map.prototype.set",!0),jA=bi("Map.prototype.has",!0),nl=function(t,e){for(var r=t,n;(n=r.next)!==null;r=n)if(n.key===e)return r.next=n.next,n.next=t.next,t.next=n,n},WA=function(t,e){var r=nl(t,e);return r&&r.value},qA=function(t,e,r){var n=nl(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},YA=function(t,e){return!!nl(t,e)},KA=function(){var e,r,n,i={assert:function(a){if(!i.has(a))throw new $A("Side channel does not contain "+UA(a))},get:function(a){if(Ca&&a&&(typeof a=="object"||typeof a=="function")){if(e)return GA(e,a)}else if(Ia){if(r)return VA(r,a)}else if(n)return WA(n,a)},has:function(a){if(Ca&&a&&(typeof a=="object"||typeof a=="function")){if(e)return HA(e,a)}else if(Ia){if(r)return jA(r,a)}else if(n)return YA(n,a);return!1},set:function(a,u){Ca&&a&&(typeof a=="object"||typeof a=="function")?(e||(e=new Ca),zA(e,a,u)):Ia?(r||(r=new Ia),XA(r,a,u)):(n||(n={key:{},next:null}),qA(n,a,u))}};return i},ZA=String.prototype.replace,QA=/%20/g,il={RFC1738:"RFC1738",RFC3986:"RFC3986"},sl={default:il.RFC3986,formatters:{RFC1738:function(t){return ZA.call(t,QA,"+")},RFC3986:function(t){return String(t)}},RFC1738:il.RFC1738,RFC3986:il.RFC3986},JA=sl,al=Object.prototype.hasOwnProperty,Dn=Array.isArray,Ur=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),eE=function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(Dn(n)){for(var i=[],a=0;a<n.length;++a)typeof n[a]<"u"&&i.push(n[a]);r.obj[r.prop]=i}}},Bd=function(e,r){for(var n=r&&r.plainObjects?Object.create(null):{},i=0;i<e.length;++i)typeof e[i]<"u"&&(n[i]=e[i]);return n},tE=function t(e,r,n){if(!r)return e;if(typeof r!="object"){if(Dn(e))e.push(r);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!al.call(Object.prototype,r))&&(e[r]=!0);else return[e,r];return e}if(!e||typeof e!="object")return[e].concat(r);var i=e;return Dn(e)&&!Dn(r)&&(i=Bd(e,n)),Dn(e)&&Dn(r)?(r.forEach(function(a,u){if(al.call(e,u)){var l=e[u];l&&typeof l=="object"&&a&&typeof a=="object"?e[u]=t(l,a,n):e.push(a)}else e[u]=a}),e):Object.keys(r).reduce(function(a,u){var l=r[u];return al.call(a,u)?a[u]=t(a[u],l,n):a[u]=l,a},i)},rE=function(e,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},e)},nE=function(t,e,r){var n=t.replace(/\+/g," ");if(r==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},iE=function(e,r,n,i,a){if(e.length===0)return e;var u=e;if(typeof e=="symbol"?u=Symbol.prototype.toString.call(e):typeof e!="string"&&(u=String(e)),n==="iso-8859-1")return escape(u).replace(/%u[0-9a-f]{4}/gi,function(m){return"%26%23"+parseInt(m.slice(2),16)+"%3B"});for(var l="",h=0;h<u.length;++h){var p=u.charCodeAt(h);if(p===45||p===46||p===95||p===126||p>=48&&p<=57||p>=65&&p<=90||p>=97&&p<=122||a===JA.RFC1738&&(p===40||p===41)){l+=u.charAt(h);continue}if(p<128){l=l+Ur[p];continue}if(p<2048){l=l+(Ur[192|p>>6]+Ur[128|p&63]);continue}if(p<55296||p>=57344){l=l+(Ur[224|p>>12]+Ur[128|p>>6&63]+Ur[128|p&63]);continue}h+=1,p=65536+((p&1023)<<10|u.charCodeAt(h)&1023),l+=Ur[240|p>>18]+Ur[128|p>>12&63]+Ur[128|p>>6&63]+Ur[128|p&63]}return l},sE=function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],i=0;i<r.length;++i)for(var a=r[i],u=a.obj[a.prop],l=Object.keys(u),h=0;h<l.length;++h){var p=l[h],m=u[p];typeof m=="object"&&m!==null&&n.indexOf(m)===-1&&(r.push({obj:u,prop:p}),n.push(m))}return eE(r),e},aE=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},oE=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},uE=function(e,r){return[].concat(e,r)},lE=function(e,r){if(Dn(e)){for(var n=[],i=0;i<e.length;i+=1)n.push(r(e[i]));return n}return r(e)},Ud={arrayToObject:Bd,assign:rE,combine:uE,compact:sE,decode:nE,encode:iE,isBuffer:oE,isRegExp:aE,maybeMap:lE,merge:tE},$d=KA,Ra=Ud,ys=sl,cE=Object.prototype.hasOwnProperty,Gd={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,r){return e+"["+r+"]"},repeat:function(e){return e}},jr=Array.isArray,hE=Array.prototype.push,zd=function(t,e){hE.apply(t,jr(e)?e:[e])},fE=Date.prototype.toISOString,Hd=ys.default,Mt={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Ra.encode,encodeValuesOnly:!1,format:Hd,formatter:ys.formatters[Hd],indices:!1,serializeDate:function(e){return fE.call(e)},skipNulls:!1,strictNullHandling:!1},dE=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},ol={},pE=function t(e,r,n,i,a,u,l,h,p,m,c,d,g,v,y,b){for(var x=e,E=b,w=0,I=!1;(E=E.get(ol))!==void 0&&!I;){var O=E.get(e);if(w+=1,typeof O<"u"){if(O===w)throw new RangeError("Cyclic object value");I=!0}typeof E.get(ol)>"u"&&(w=0)}if(typeof h=="function"?x=h(r,x):x instanceof Date?x=c(x):n==="comma"&&jr(x)&&(x=Ra.maybeMap(x,function(se){return se instanceof Date?c(se):se})),x===null){if(a)return l&&!v?l(r,Mt.encoder,y,"key",d):r;x=""}if(dE(x)||Ra.isBuffer(x)){if(l){var F=v?r:l(r,Mt.encoder,y,"key",d);return[g(F)+"="+g(l(x,Mt.encoder,y,"value",d))]}return[g(r)+"="+g(String(x))]}var N=[];if(typeof x>"u")return N;var L;if(n==="comma"&&jr(x))v&&l&&(x=Ra.maybeMap(x,l)),L=[{value:x.length>0?x.join(",")||null:void 0}];else if(jr(h))L=h;else{var D=Object.keys(x);L=p?D.sort(p):D}for(var V=i&&jr(x)&&x.length===1?r+"[]":r,Y=0;Y<L.length;++Y){var ie=L[Y],X=typeof ie=="object"&&typeof ie.value<"u"?ie.value:x[ie];if(!(u&&X===null)){var G=jr(x)?typeof n=="function"?n(V,ie):V:V+(m?"."+ie:"["+ie+"]");b.set(e,w);var ae=$d();ae.set(ol,b),zd(N,t(X,G,n,i,a,u,n==="comma"&&v&&jr(x)?null:l,h,p,m,c,d,g,v,y,ae))}}return N},gE=function(e){if(!e)return Mt;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=e.charset||Mt.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=ys.default;if(typeof e.format<"u"){if(!cE.call(ys.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=ys.formatters[n],a=Mt.filter;return(typeof e.filter=="function"||jr(e.filter))&&(a=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:Mt.addQueryPrefix,allowDots:typeof e.allowDots>"u"?Mt.allowDots:!!e.allowDots,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Mt.charsetSentinel,delimiter:typeof e.delimiter>"u"?Mt.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:Mt.encode,encoder:typeof e.encoder=="function"?e.encoder:Mt.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:Mt.encodeValuesOnly,filter:a,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:Mt.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:Mt.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Mt.strictNullHandling}},mE=function(t,e){var r=t,n=gE(e),i,a;typeof n.filter=="function"?(a=n.filter,r=a("",r)):jr(n.filter)&&(a=n.filter,i=a);var u=[];if(typeof r!="object"||r===null)return"";var l;e&&e.arrayFormat in Gd?l=e.arrayFormat:e&&"indices"in e?l=e.indices?"indices":"repeat":l="indices";var h=Gd[l];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var p=h==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var m=$d(),c=0;c<i.length;++c){var d=i[c];n.skipNulls&&r[d]===null||zd(u,pE(r[d],d,h,p,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,m))}var g=u.join(n.delimiter),v=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?v+="utf8=%26%2310003%3B&":v+="utf8=%E2%9C%93&"),g.length>0?v+g:""},Ti=Ud,ul=Object.prototype.hasOwnProperty,_E=Array.isArray,wt={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Ti.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},vE=function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},Vd=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},yE="utf8=%26%2310003%3B",xE="utf8=%E2%9C%93",bE=function(e,r){var n={__proto__:null},i=r.ignoreQueryPrefix?e.replace(/^\?/,""):e,a=r.parameterLimit===1/0?void 0:r.parameterLimit,u=i.split(r.delimiter,a),l=-1,h,p=r.charset;if(r.charsetSentinel)for(h=0;h<u.length;++h)u[h].indexOf("utf8=")===0&&(u[h]===xE?p="utf-8":u[h]===yE&&(p="iso-8859-1"),l=h,h=u.length);for(h=0;h<u.length;++h)if(h!==l){var m=u[h],c=m.indexOf("]="),d=c===-1?m.indexOf("="):c+1,g,v;d===-1?(g=r.decoder(m,wt.decoder,p,"key"),v=r.strictNullHandling?null:""):(g=r.decoder(m.slice(0,d),wt.decoder,p,"key"),v=Ti.maybeMap(Vd(m.slice(d+1),r),function(y){return r.decoder(y,wt.decoder,p,"value")})),v&&r.interpretNumericEntities&&p==="iso-8859-1"&&(v=vE(v)),m.indexOf("[]=")>-1&&(v=_E(v)?[v]:v),ul.call(n,g)?n[g]=Ti.combine(n[g],v):n[g]=v}return n},TE=function(t,e,r,n){for(var i=n?e:Vd(e,r),a=t.length-1;a>=0;--a){var u,l=t[a];if(l==="[]"&&r.parseArrays)u=[].concat(i);else{u=r.plainObjects?Object.create(null):{};var h=l.charAt(0)==="["&&l.charAt(l.length-1)==="]"?l.slice(1,-1):l,p=parseInt(h,10);!r.parseArrays&&h===""?u={0:i}:!isNaN(p)&&l!==h&&String(p)===h&&p>=0&&r.parseArrays&&p<=r.arrayLimit?(u=[],u[p]=i):h!=="__proto__"&&(u[h]=i)}i=u}return i},wE=function(e,r,n,i){if(e){var a=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,u=/(\[[^[\]]*])/,l=/(\[[^[\]]*])/g,h=n.depth>0&&u.exec(a),p=h?a.slice(0,h.index):a,m=[];if(p){if(!n.plainObjects&&ul.call(Object.prototype,p)&&!n.allowPrototypes)return;m.push(p)}for(var c=0;n.depth>0&&(h=l.exec(a))!==null&&c<n.depth;){if(c+=1,!n.plainObjects&&ul.call(Object.prototype,h[1].slice(1,-1))&&!n.allowPrototypes)return;m.push(h[1])}return h&&m.push("["+a.slice(h.index)+"]"),TE(m,r,n,i)}},SE=function(e){if(!e)return wt;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=typeof e.charset>"u"?wt.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?wt.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:wt.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:wt.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:wt.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:wt.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:wt.comma,decoder:typeof e.decoder=="function"?e.decoder:wt.decoder,delimiter:typeof e.delimiter=="string"||Ti.isRegExp(e.delimiter)?e.delimiter:wt.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:wt.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:wt.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:wt.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:wt.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:wt.strictNullHandling}},AE=function(t,e){var r=SE(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof t=="string"?bE(t,r):t,i=r.plainObjects?Object.create(null):{},a=Object.keys(n),u=0;u<a.length;++u){var l=a[u],h=wE(l,n[l],r,typeof t=="string");i=Ti.merge(i,h,r)}return r.allowSparse===!0?i:Ti.compact(i)},EE=mE,CE=AE,IE=sl,RE={formats:IE,parse:CE,stringify:EE},PE=kS;function vr(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var ME=/^([a-z0-9.+-]+:)/i,OE=/:[0-9]*$/,FE=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,NE=["<",">",'"',"`"," ","\r",`
|
|
37
|
-
`," "],LE=["{","}","|","\\","^","`"].concat(NE),ll=["'"].concat(LE),Xd=["%","/","?",";","#"].concat(ll),jd=["/","?","#"],kE=255,Wd=/^[+a-z0-9A-Z_-]{0,63}$/,DE=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,BE={javascript:!0,"javascript:":!0},cl={javascript:!0,"javascript:":!0},wi={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},hl=RE;function Pa(t,e,r){if(t&&typeof t=="object"&&t instanceof vr)return t;var n=new vr;return n.parse(t,e,r),n}vr.prototype.parse=function(t,e,r){if(typeof t!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var n=t.indexOf("?"),i=n!==-1&&n<t.indexOf("#")?"?":"#",a=t.split(i),u=/\\/g;a[0]=a[0].replace(u,"/"),t=a.join(i);var l=t;if(l=l.trim(),!r&&t.split("#").length===1){var h=FE.exec(l);if(h)return this.path=l,this.href=l,this.pathname=h[1],h[2]?(this.search=h[2],e?this.query=hl.parse(this.search.substr(1)):this.query=this.search.substr(1)):e&&(this.search="",this.query={}),this}var p=ME.exec(l);if(p){p=p[0];var m=p.toLowerCase();this.protocol=m,l=l.substr(p.length)}if(r||p||l.match(/^\/\/[^@/]+@[^@/]+/)){var c=l.substr(0,2)==="//";c&&!(p&&cl[p])&&(l=l.substr(2),this.slashes=!0)}if(!cl[p]&&(c||p&&!wi[p])){for(var d=-1,g=0;g<jd.length;g++){var v=l.indexOf(jd[g]);v!==-1&&(d===-1||v<d)&&(d=v)}var y,b;d===-1?b=l.lastIndexOf("@"):b=l.lastIndexOf("@",d),b!==-1&&(y=l.slice(0,b),l=l.slice(b+1),this.auth=decodeURIComponent(y)),d=-1;for(var g=0;g<Xd.length;g++){var v=l.indexOf(Xd[g]);v!==-1&&(d===-1||v<d)&&(d=v)}d===-1&&(d=l.length),this.host=l.slice(0,d),l=l.slice(d),this.parseHost(),this.hostname=this.hostname||"";var x=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!x)for(var E=this.hostname.split(/\./),g=0,w=E.length;g<w;g++){var I=E[g];if(I&&!I.match(Wd)){for(var O="",F=0,N=I.length;F<N;F++)I.charCodeAt(F)>127?O+="x":O+=I[F];if(!O.match(Wd)){var L=E.slice(0,g),D=E.slice(g+1),V=I.match(DE);V&&(L.push(V[1]),D.unshift(V[2])),D.length&&(l="/"+D.join(".")+l),this.hostname=L.join(".");break}}}this.hostname.length>kE?this.hostname="":this.hostname=this.hostname.toLowerCase(),x||(this.hostname=PE.toASCII(this.hostname));var Y=this.port?":"+this.port:"",ie=this.hostname||"";this.host=ie+Y,this.href+=this.host,x&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),l[0]!=="/"&&(l="/"+l))}if(!BE[m])for(var g=0,w=ll.length;g<w;g++){var X=ll[g];if(l.indexOf(X)!==-1){var G=encodeURIComponent(X);G===X&&(G=escape(X)),l=l.split(X).join(G)}}var ae=l.indexOf("#");ae!==-1&&(this.hash=l.substr(ae),l=l.slice(0,ae));var se=l.indexOf("?");if(se!==-1?(this.search=l.substr(se),this.query=l.substr(se+1),e&&(this.query=hl.parse(this.query)),l=l.slice(0,se)):e&&(this.search="",this.query={}),l&&(this.pathname=l),wi[m]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var Y=this.pathname||"",z=this.search||"";this.path=Y+z}return this.href=this.format(),this};function UE(t){return typeof t=="string"&&(t=Pa(t)),t instanceof vr?t.format():vr.prototype.format.call(t)}vr.prototype.format=function(){var t=this.auth||"";t&&(t=encodeURIComponent(t),t=t.replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",n=this.hash||"",i=!1,a="";this.host?i=t+this.host:this.hostname&&(i=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(a=hl.stringify(this.query));var u=this.search||a&&"?"+a||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||wi[e])&&i!==!1?(i="//"+(i||""),r&&r.charAt(0)!=="/"&&(r="/"+r)):i||(i=""),n&&n.charAt(0)!=="#"&&(n="#"+n),u&&u.charAt(0)!=="?"&&(u="?"+u),r=r.replace(/[?#]/g,function(l){return encodeURIComponent(l)}),u=u.replace("#","%23"),e+i+r+u+n};function $E(t,e){return Pa(t,!1,!0).resolve(e)}vr.prototype.resolve=function(t){return this.resolveObject(Pa(t,!1,!0)).format()},vr.prototype.resolveObject=function(t){if(typeof t=="string"){var e=new vr;e.parse(t,!1,!0),t=e}for(var r=new vr,n=Object.keys(this),i=0;i<n.length;i++){var a=n[i];r[a]=this[a]}if(r.hash=t.hash,t.href==="")return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var u=Object.keys(t),l=0;l<u.length;l++){var h=u[l];h!=="protocol"&&(r[h]=t[h])}return wi[r.protocol]&&r.hostname&&!r.pathname&&(r.pathname="/",r.path=r.pathname),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!wi[t.protocol]){for(var p=Object.keys(t),m=0;m<p.length;m++){var c=p[m];r[c]=t[c]}return r.href=r.format(),r}if(r.protocol=t.protocol,!t.host&&!cl[t.protocol]){for(var w=(t.pathname||"").split("/");w.length&&!(t.host=w.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),w[0]!==""&&w.unshift(""),w.length<2&&w.unshift(""),r.pathname=w.join("/")}else r.pathname=t.pathname;if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var d=r.pathname||"",g=r.search||"";r.path=d+g}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var v=r.pathname&&r.pathname.charAt(0)==="/",y=t.host||t.pathname&&t.pathname.charAt(0)==="/",b=y||v||r.host&&t.pathname,x=b,E=r.pathname&&r.pathname.split("/")||[],w=t.pathname&&t.pathname.split("/")||[],I=r.protocol&&!wi[r.protocol];if(I&&(r.hostname="",r.port=null,r.host&&(E[0]===""?E[0]=r.host:E.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(w[0]===""?w[0]=t.host:w.unshift(t.host)),t.host=null),b=b&&(w[0]===""||E[0]==="")),y)r.host=t.host||t.host===""?t.host:r.host,r.hostname=t.hostname||t.hostname===""?t.hostname:r.hostname,r.search=t.search,r.query=t.query,E=w;else if(w.length)E||(E=[]),E.pop(),E=E.concat(w),r.search=t.search,r.query=t.query;else if(t.search!=null){if(I){r.host=E.shift(),r.hostname=r.host;var O=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;O&&(r.auth=O.shift(),r.hostname=O.shift(),r.host=r.hostname)}return r.search=t.search,r.query=t.query,(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!E.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var F=E.slice(-1)[0],N=(r.host||t.host||E.length>1)&&(F==="."||F==="..")||F==="",L=0,D=E.length;D>=0;D--)F=E[D],F==="."?E.splice(D,1):F===".."?(E.splice(D,1),L++):L&&(E.splice(D,1),L--);if(!b&&!x)for(;L--;L)E.unshift("..");b&&E[0]!==""&&(!E[0]||E[0].charAt(0)!=="/")&&E.unshift(""),N&&E.join("/").substr(-1)!=="/"&&E.push("");var V=E[0]===""||E[0]&&E[0].charAt(0)==="/";if(I){r.hostname=V?"":E.length?E.shift():"",r.host=r.hostname;var O=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;O&&(r.auth=O.shift(),r.hostname=O.shift(),r.host=r.hostname)}return b=b||r.host&&E.length,b&&!V&&E.unshift(""),E.length>0?r.pathname=E.join("/"):(r.pathname=null,r.path=null),(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},vr.prototype.parseHost=function(){var t=this.host,e=OE.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var GE=Pa,zE=$E,HE=UE;const VE={parse:GE,format:HE,resolve:zE},qd={};function ke(t,e,r=3){if(qd[e])return;let n=new Error().stack;typeof n>"u"?console.warn("PixiJS Deprecation Warning: ",`${e}
|
|
38
|
-
Deprecated since v${t}`):(
|
|
33
|
+
*/var Rt,Qo,Gi,qe,Kr,Jo,ps,el=function(){return typeof window<"u"},tl=function(){return Rt||el()&&(Rt=window.gsap)&&Rt.registerPlugin&&Rt},rl=function(e){return typeof e=="function"},Q_=function(e){return console.warn(e)},J_=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],Ye=.212671,Ke=.71516,Ze=.072169,zi=function(e,r){var i=[],n=0,s=0,a,o;for(a=0;a<4;a++){for(o=0;o<5;o++)s=o===4?e[n+4]:0,i[n+o]=e[n]*r[o]+e[n+1]*r[o+5]+e[n+2]*r[o+10]+e[n+3]*r[o+15]+s;n+=5}return i},il=function(e,r){var i=1-r,n=i*Ye,s=i*Ke,a=i*Ze;return zi([n+r,s,a,0,0,n,s+r,a,0,0,n,s,a+r,0,0,0,0,0,1,0],e)},nl=function(e,r,i){var n=Gi(r),s=n[0]/255,a=n[1]/255,o=n[2]/255,u=1-i;return zi([u+i*s*Ye,i*s*Ke,i*s*Ze,0,0,i*a*Ye,u+i*a*Ke,i*a*Ze,0,0,i*o*Ye,i*o*Ke,u+i*o*Ze,0,0,0,0,0,1,0],e)},sl=function(e,r){r*=Math.PI/180;var i=Math.cos(r),n=Math.sin(r);return zi([Ye+i*(1-Ye)+n*-Ye,Ke+i*-Ke+n*-Ke,Ze+i*-Ze+n*(1-Ze),0,0,Ye+i*-Ye+n*.143,Ke+i*(1-Ke)+n*.14,Ze+i*-Ze+n*-.283,0,0,Ye+i*-Ye+n*-(1-Ye),Ke+i*-Ke+n*Ke,Ze+i*(1-Ze)+n*Ze,0,0,0,0,0,1,0,0,0,0,0,1],e)},al=function(e,r){return zi([r,0,0,0,.5*(1-r),0,r,0,0,.5*(1-r),0,0,r,0,.5*(1-r),0,0,0,1,0],e)},ol=function(e,r){var i=qe.filters[r],n=e.filters||[],s=n.length,a;for(i||Q_(r+" not found. PixiPlugin.registerPIXI(PIXI)");--s>-1;)if(n[s]instanceof i)return n[s];return a=new i,r==="BlurFilter"&&(a.blur=0),n.push(a),e.filters=n,a},Ie=function(e,r,i,n){r.add(i,e,i[e],n[e]),r._props.push(e)},ll=function(e,r){var i=new qe.filters.ColorMatrixFilter;return i.matrix=r,i.brightness(e,!0),i.matrix},ev=function(e){var r={},i;for(i in e)r[i]=e[i];return r},He={contrast:1,saturation:1,colorizeAmount:0,colorize:"rgb(255,255,255)",hue:0,brightness:1},tv=function(e,r,i){var n=ol(e,"ColorMatrixFilter"),s=e._gsColorMatrixFilter=e._gsColorMatrixFilter||ev(He),a=r.combineCMF&&!("colorMatrixFilter"in r&&!r.colorMatrixFilter),o,u,c;for(c=n.matrix,r.resolution&&(n.resolution=r.resolution),r.matrix&&r.matrix.length===c.length?(u=r.matrix,s.contrast!==1&&Ie("contrast",i,s,He),s.hue&&Ie("hue",i,s,He),s.brightness!==1&&Ie("brightness",i,s,He),s.colorizeAmount&&(Ie("colorize",i,s,He),Ie("colorizeAmount",i,s,He)),s.saturation!==1&&Ie("saturation",i,s,He)):(u=J_.slice(),r.contrast!=null?(u=al(u,+r.contrast),Ie("contrast",i,s,r)):s.contrast!==1&&(a?u=al(u,s.contrast):Ie("contrast",i,s,He)),r.hue!=null?(u=sl(u,+r.hue),Ie("hue",i,s,r)):s.hue&&(a?u=sl(u,s.hue):Ie("hue",i,s,He)),r.brightness!=null?(u=ll(+r.brightness,u),Ie("brightness",i,s,r)):s.brightness!==1&&(a?u=ll(s.brightness,u):Ie("brightness",i,s,He)),r.colorize!=null?(r.colorizeAmount="colorizeAmount"in r?+r.colorizeAmount:1,u=nl(u,r.colorize,r.colorizeAmount),Ie("colorize",i,s,r),Ie("colorizeAmount",i,s,r)):s.colorizeAmount&&(a?u=nl(u,s.colorize,s.colorizeAmount):(Ie("colorize",i,s,He),Ie("colorizeAmount",i,s,He))),r.saturation!=null?(u=il(u,+r.saturation),Ie("saturation",i,s,r)):s.saturation!==1&&(a?u=il(u,s.saturation):Ie("saturation",i,s,He))),o=u.length;--o>-1;)u[o]!==c[o]&&i.add(c,o,c[o],u[o],"colorMatrixFilter");i._props.push("colorMatrixFilter")},rv=function(e,r){var i=r.t,n=r.p,s=r.color,a=r.set;a(i,n,s[0]<<16|s[1]<<8|s[2])},iv=function(e,r){var i=r.g;i&&(i.dirty++,i.clearDirty++)},nv=function(e,r){r.t.visible=!!r.t.alpha},ul=function(e,r,i,n){var s=e[r],a=Gi(rl(s)?e[r.indexOf("set")||!rl(e["get"+r.substr(3)])?r:"get"+r.substr(3)]():s),o=Gi(i);n._pt=new Kr(n._pt,e,r,0,0,rv,{t:e,p:r,color:a,set:Jo(e,r)}),n.add(a,0,a[0],o[0]),n.add(a,1,a[1],o[1]),n.add(a,2,a[2],o[2])},sv={tint:1,lineColor:1,fillColor:1},hl="position,scale,skew,pivot,anchor,tilePosition,tileScale".split(","),ms={x:"position",y:"position",tileX:"tilePosition",tileY:"tilePosition"},av={colorMatrixFilter:1,saturation:1,contrast:1,hue:1,colorize:1,colorizeAmount:1,brightness:1,combineCMF:1},ji=Math.PI/180,cl=function(e){return typeof e=="string"},ov=function(e){return cl(e)&&e.charAt(1)==="="?e.substr(0,2)+parseFloat(e.substr(2))*ji:e*ji},lv=function(e,r){return r.set(r.t,r.p,e===1?r.e:Math.round((r.s+r.c*e)*1e5)/1e5,r)},uv=function(e,r,i,n,s,a){var o=360*(a?ji:1),u=cl(s),c=u&&s.charAt(1)==="="?+(s.charAt(0)+"1"):0,f=parseFloat(c?s.substr(2):s)*(a?ji:1),l=c?f*c:f-n,h=n+l,d,p;return u&&(d=s.split("_")[1],d==="short"&&(l%=o,l!==l%(o/2)&&(l+=l<0?o:-o)),d==="cw"&&l<0?l=(l+o*1e10)%o-~~(l/o)*o:d==="ccw"&&l>0&&(l=(l-o*1e10)%o-~~(l/o)*o)),e._pt=p=new Kr(e._pt,r,i,n,l,lv),p.e=h,p},fl=function(){el()&&(Qo=window,Rt=tl(),qe=qe||Qo.PIXI,ps=qe&&qe.VERSION&&qe.VERSION.charAt(0)==="4",Gi=function(r){return Rt.utils.splitColor((r+"").substr(0,2)==="0x"?"#"+r.substr(2):r)})},Hi,Zr;for(Hi=0;Hi<hl.length;Hi++)Zr=hl[Hi],ms[Zr+"X"]=Zr,ms[Zr+"Y"]=Zr;var gs={version:"3.11.5",name:"pixi",register:function(e,r,i){Rt=e,Kr=i,Jo=r.getSetter,fl()},registerPIXI:function(e){qe=e},init:function(e,r,i,n,s){if(qe||fl(),!qe||!(e instanceof qe.DisplayObject))return console.warn(e,"is not a DisplayObject or PIXI was not found. PixiPlugin.registerPIXI(PIXI);"),!1;var a,o,u,c,f,l,h,d,p;for(l in r){if(a=ms[l],u=r[l],a)o=~l.charAt(l.length-1).toLowerCase().indexOf("x")?"x":"y",this.add(e[a],o,e[a][o],a==="skew"?ov(u):u,0,0,0,0,0,1);else if(l==="scale"||l==="anchor"||l==="pivot"||l==="tileScale")this.add(e[l],"x",e[l].x,u),this.add(e[l],"y",e[l].y,u);else if(l==="rotation"||l==="angle")uv(this,e,l,e[l],u,l==="rotation");else if(av[l])c||(tv(e,r.colorMatrixFilter||r,this),c=!0);else if(l==="blur"||l==="blurX"||l==="blurY"||l==="blurPadding"){if(f=ol(e,"BlurFilter"),this.add(f,l,f[l],u),r.blurPadding!==0)for(h=r.blurPadding||Math.max(f[l],u)*2,d=e.filters.length;--d>-1;)e.filters[d].padding=Math.max(e.filters[d].padding,h)}else if(sv[l])if((l==="lineColor"||l==="fillColor")&&e instanceof qe.Graphics)for(p=(e.geometry||e).graphicsData,this._pt=new Kr(this._pt,e,l,0,0,iv,{g:e.geometry||e}),d=p.length;--d>-1;)ul(ps?p[d]:p[d][l.substr(0,4)+"Style"],ps?l:"color",u,this);else ul(e,l,u,this);else l==="autoAlpha"?(this._pt=new Kr(this._pt,e,"visible",0,0,nv),this.add(e,"alpha",e.alpha,u),this._props.push("alpha","visible")):l!=="resolution"&&this.add(e,l,"get",u);this._props.push(l)}}};tl()&&Rt.registerPlugin(gs),k.registerPlugin(gs),gs.registerPIXI(Le),k.registerPlugin(Yr),Yr.create("springBounce","0.32, 1.06, 0.61, 0.93"),k.registerEffect({name:"PULSE",effect(t,e){return k.timeline().fromTo(t,{pixi:{scaleX:.9,scaleY:.9}},{pixi:{scaleX:1.2,scaleY:1.2},duration:.5,ease:"slow"}).to(t,{pixi:{scaleX:1,scaleY:1,...e},duration:.5})}}),k.registerEffect({name:"SHAKE",effect(t,e){return k.timeline().to(t,{duration:.1,pixi:{x:"+=5"}}).to(t,{duration:.1,pixi:{x:"-=10"}}).to(t,{duration:.1,pixi:{x:"+=10"}}).to(t,{duration:.1,pixi:{x:"-=10"}}).to(t,{duration:.1,pixi:{x:"+=5"}}).to(t,{pixi:{...e},duration:.5})}}),k.registerEffect({name:"SWING",effect(t,e){return k.timeline().to(t,{duration:.5,pixi:{rotation:1}}).to(t,{duration:.5,pixi:{rotation:-1.5}}).to(t,{pixi:{rotation:0,...e},duration:.5})}}),k.registerEffect({name:"JELLO",effect(t,e){return k.timeline().to(t,{duration:.3,pixi:{scaleX:.5,rotation:-1}}).to(t,{duration:.4,pixi:{scaleX:1.5,rotation:1}}).to(t,{duration:.3,pixi:{scaleX:1,rotation:0}}).to(t,{pixi:{rotation:0,...e},duration:.5})}}),k.registerEffect({name:"WOOBLE",effect(t,e){return k.timeline().to(t,{duration:.3,pixi:{scaleX:.5,x:e.x*-.5}}).to(t,{duration:.3,pixi:{scaleX:1.5,x:e.x*1.5}}).to(t,{duration:.3,pixi:{scaleX:.5,x:e.x*-.01}}).to(t,{duration:.3,pixi:{scaleX:1,x:e.x}}).to(t,{rotation:0,pixi:{...e,rotation:0},duration:.5})}}),k.registerEffect({name:"NONE",effect(t,e){return k.timeline().to(t,{duration:0})}}),k.registerEffect({name:"FLASH",effect(t,e){return k.timeline().to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1}).to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1}).to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1,...e})}}),k.registerEffect({name:"BOUNCE_IN",effect(t,e){return k.timeline().fromTo(t,{pixi:{scaleX:1.5,scaleY:1.5}},{...e,pixi:{x:e==null?void 0:e.x,y:e==null?void 0:e.y,scaleX:1,scaleY:1},duration:2,ease:"bounce.out"})}}),k.registerEffect({name:"BOUNCE_IN_DOWN",effect(t,e){return k.timeline().from(t,{duration:2,ease:"bounce.out",immediateRender:!0,pixi:{...e,x:e==null?void 0:e.x,y:-2500,alpha:0}})}}),k.registerEffect({name:"BOUNCE_IN_LEFT",effect(t,e){return k.timeline().from(t,{ease:"bounce.out",duration:2,pixi:{...e,x:-1500,alpha:0}})}}),k.registerEffect({name:"BOUNCE_IN_RIGHT",effect(t,e){const r=Math.max(1e3,(e==null?void 0:e.maxX)+500);return k.timeline().from(t,{ease:"bounce.out",duration:2,pixi:{...e,x:r}})}}),k.registerEffect({name:"BOUNCE_IN_UP",effect(t,e){return k.timeline().from(t,{ease:"bounce.out",pixi:{...e,y:2e3},duration:2})}}),k.registerEffect({name:"BOUNCE_OUT",effect(t,e){return k.timeline().from(t,{...e,ease:"bounce.in",pixi:{y:2e3},duration:1.5})}}),k.registerEffect({name:"FADE_IN",effect(t){return k.timeline().fromTo(t,{alpha:0},{ease:"power4.in",alpha:1,duration:1})}}),k.registerEffect({name:"FADE_IN_DOWN",effect(t,e){return k.timeline().fromTo(t,{pixi:{y:-1500,alpha:0}},{duration:1,ease:"power4.in",pixi:{y:0,alpha:1,...e}})}}),k.registerEffect({name:"FADE_IN_LEFT",effect(t,e){return k.timeline().fromTo(t,{pixi:{alpha:0,x:-2e3}},{ease:"power4.in",pixi:{x:0,alpha:1,...e},duration:1})}}),k.registerEffect({name:"FADE_IN_RIGHT",effect(t,e){return k.fromTo(t,{pixi:{x:2e3,alpha:0}},{duration:1,ease:"power4.in",pixi:{x:0,alpha:1,...e}})}}),k.registerEffect({name:"FADE_IN_UP",effect(t,e){return k.fromTo(t,{pixi:{y:2e3,alpha:0}},{duration:.8,ease:"power4.in",pixi:{y:0,alpha:1,...e}})}}),k.registerEffect({name:"SPIN",effect(t){return k.to(t,{rotation:(e,r)=>k.utils.snap(360,Number(k.getProperty(r,"rotation"))+360)})}});function dl(){return{updateEffect:P.useCallback((e,r,i)=>k.effects[r]&&e?k.effects[r](e,i):k.effects.NONE(e,i),[])}}var _s=(t=>(t.NONE="NONE",t.FLASH="FLASH",t.PULSE="PULSE",t.SHAKE="SHAKE",t.SWING="SWING",t.JELLO="JELLO",t.WOOBLE="WOOBLE",t.FADE_IN="FADE_IN",t.FADE_OUT="FADE_OUT",t.FADE_IN_OUT="FADE_IN_OUT",t.SLIDE_IN_LEFT="SLIDE_IN_LEFT",t.SLIDE_IN_RIGHT="SLIDE_IN_RIGHT",t.SLIDE_IN_TOP="SLIDE_IN_TOP",t.SLIDE_IN_BOTTOM="SLIDE_IN_BOTTOM",t.SLIDE_OUT_LEFT="SLIDE_OUT_LEFT",t.SLIDE_OUT_RIGHT="SLIDE_OUT_RIGHT",t.SLIDE_OUT_TOP="SLIDE_OUT_TOP",t.SLIDE_OUT_BOTTOM="SLIDE_OUT_BOTTOM",t.ZOOM_IN="ZOOM_IN",t.ZOOM_OUT="ZOOM_OUT",t.ZOOM_IN_OUT="ZOOM_IN_OUT",t.BOUNCE_IN="BOUNCE_IN",t.BOUNCE_OUT="BOUNCE_OUT",t.BOUNCE_IN_OUT="BOUNCE_IN_OUT",t.BOUNCE_IN_DOWN="BOUNCE_IN_DOWN",t.BOUNCE_IN_LEFT="BOUNCE_IN_LEFT",t.BOUNCE_IN_RIGHT="BOUNCE_IN_RIGHT",t.BOUNCE_IN_UP="BOUNCE_IN_UP",t.BOUNCE_OUT_DOWN="BOUNCE_OUT_DOWN",t.BOUNCE_OUT_LEFT="BOUNCE_OUT_LEFT",t.BOUNCE_OUT_RIGHT="BOUNCE_OUT_RIGHT",t.BOUNCE_OUT_UP="BOUNCE_OUT_UP",t.FADE_IN_DOWN="FADE_IN_DOWN",t.FADE_IN_LEFT="FADE_IN_LEFT",t.FADE_IN_RIGHT="FADE_IN_RIGHT",t.FADE_IN_UP="FADE_IN_UP",t.FADE_OUT_DOWN="FADE_OUT_DOWN",t.FADE_OUT_LEFT="FADE_OUT_LEFT",t.FADE_OUT_RIGHT="FADE_OUT_RIGHT",t.FADE_OUT_UP="FADE_OUT_UP",t.ELASTIC_IN="ELASTIC_IN",t.ELASTIC_OUT="ELASTIC_OUT",t.ELASTIC_IN_OUT="ELASTIC_IN_OUT",t.BACK_IN="BACK_IN",t.BACK_OUT="BACK_OUT",t.BACK_IN_OUT="BACK_IN_OUT",t.CIRCULAR_IN="CIRCULAR_IN",t.CIRCULAR_OUT="CIRCULAR_OUT",t.CIRCULAR_IN_OUT="CIRCULAR_IN_OUT",t.EXPO_IN="EXPO_IN",t.EXPO_OUT="EXPO_OUT",t.EXPO_IN_OUT="EXPO_IN_OUT",t.SINE_IN="SINE_IN",t.SINE_OUT="SINE_OUT",t.SINE_IN_OUT="SINE_IN_OUT",t.BOUNCE="BOUNCE",t.ELASTIC="ELASTIC",t.BACK="BACK",t.CIRCULAR="CIRCULAR",t.EXPO="EXPO",t.SINE="SINE",t))(_s||{});const hv=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],jt=D.forwardRef((t,e)=>{const[r,i]=D.useState(!1),[n,s]=P.useState(!1),[a,o]=P.useState(!1),[u,c]=P.useState(),f=T_(u,300),l=P.useRef(null),h=P.useRef(null),d=P.useRef(null),p=P.useRef(null),m=P.useRef(null),_=P.useRef(null),{tl:g}=P.useContext(Ct),y=ie.useApp(),v=y.screen.width,x=y.screen.height,{uniqueId:T,visible:b,startAt:w,transformation:{x:S,y:A,width:C,height:F,scale:G=[1,1],rotation:R=0,effect:E,overlay:B,animation:U=_s.NONE},applyTransformer:I,disabled:$,pointerdown:X,pointerout:M,pointerover:O,isText:j,isDragging:H,isGif:W,onDoubleClick:Q,isTextEditMode:V}=t,J=dl();Ee(ve.COMPLETE,()=>{l.current}),D.useImperativeHandle(e,()=>({getIsTransformerDragging:()=>n,getIsMouseOverTransformer:()=>a}),[n,a]),D.useEffect(()=>{l.current&&i(!0)},[]),D.useEffect(()=>{c({x:S,y:A,width:C,height:F,animation:U,maxX:v,maxY:x})},[U,S,A,C,F,v,x]),D.useEffect(()=>{if(!h.current)return;const se=k.context(()=>{if(g.current&&f){const{x:we,y:ze,animation:je,maxX:At,maxY:ee}=f||{},fe=g.current.progress(),Fe=J.updateEffect(l.current,je,{immediateRender:!1,x:we,y:ze,overwrite:!0,maxX:At,maxY:ee});m.current&&(g.current.remove(m.current),m.current.progress(0).kill()),fe>.1?(Fe.eventCallback("onComplete",()=>{Fe.remove("onComplete"),g.current.add(Fe,w),m.current=Fe}),Fe.play()):(Fe.progress(1),g.current.add(Fe,w),m.current=Fe)}else m.current&&m.current.progress(0).kill()},h.current);return()=>{se.revert()}},[w,f]);const de=D.useCallback(()=>{o(!0),O&&O()},[]),ge=D.useCallback(()=>{s(!0)},[]),Z=D.useCallback(se=>{t.onAnchorTransformationEnd&&t.onAnchorTransformationEnd(se),s(!1)},[]),le=ie.withFilters(ie.Container,{matrix:Le.filters.ColorMatrixFilter});return Y.jsxs(ie.Container,{ref:h,children:[Y.jsx(ie.Container,{ref:l,position:[S,A],pivot:[S,A],width:C,height:F,scale:G,rotation:R,...!$&&b&&!n&&!H&&{interactive:!0,buttonMode:!0,pointerdown:X,pointerover:O,pointerout:M},children:Y.jsxs(ie.Container,{ref:_,children:[!W&&Y.jsx(le,{scale:1,apply:({matrix:se})=>{E===Gt.BlackAndWhite?se.desaturate():E===Gt.Sepia?se.sepia():E===Gt.RetroVintage||E===Gt.NightVision?se.negative():E===Gt.Normal&&se.reset()},matrix:{enabled:!0,matrix:hv},children:Y.jsx(ie.Container,{ref:d,children:t.children})}),W&&Y.jsx(ie.Container,{ref:d,children:t.children}),!Xr(B)&&B!==ds.NONE&&B!==ds.NORMAL&&Y.jsx(L_,{overlay:B,width:C,height:F,x:S,y:A})]})}),I&&b&&!V&&Y.jsx(ef,{pixiTransformerRef:p,imageRef:l,isMounted:r,transformCommit:Z,transformChange:ge,mouseoverEvent:de,uniqueId:T,isText:j,onDoubleClick:Q})]})});var Ht=(t=>(t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2",t))(Ht||{}),pl=(t=>(t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS",t))(pl||{}),vs=(t=>(t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL",t))(vs||{}),z=(t=>(t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR",t))(z||{}),Pt=(t=>(t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t))(Pt||{}),N=(t=>(t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t))(N||{}),mr=(t=>(t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t))(mr||{}),ae=(t=>(t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT",t))(ae||{}),ys=(t=>(t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT",t))(ys||{}),et=(t=>(t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR",t))(et||{}),Qr=(t=>(t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t))(Qr||{}),Vt=(t=>(t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL",t))(Vt||{}),Mt=(t=>(t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",t))(Mt||{}),Xt=(t=>(t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT",t))(Xt||{}),xs=(t=>(t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL",t))(xs||{}),Qe=(t=>(t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp",t))(Qe||{}),Ce=(t=>(t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE",t[t.COLOR=4]="COLOR",t))(Ce||{}),Ae=(t=>(t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH",t))(Ae||{}),pt=(t=>(t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t))(pt||{});const q={ADAPTER:{createCanvas:(t,e)=>{const r=document.createElement("canvas");return r.width=t,r.height=e,r},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(t,e)=>fetch(t,e),parseXML:t=>new DOMParser().parseFromString(t,"text/xml")},RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var bs=/iPhone/i,ml=/iPod/i,gl=/iPad/i,_l=/\biOS-universal(?:.+)Mac\b/i,Ts=/\bAndroid(?:.+)Mobile\b/i,vl=/Android/i,gr=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,Vi=/Silk/i,yt=/Windows Phone/i,yl=/\bWindows(?:.+)ARM\b/i,xl=/BlackBerry/i,bl=/BB10/i,Tl=/Opera Mini/i,wl=/\b(CriOS|Chrome)(?:.+)Mobile/i,Sl=/Mobile(?:.+)Firefox\b/i,Al=function(t){return typeof t<"u"&&t.platform==="MacIntel"&&typeof t.maxTouchPoints=="number"&&t.maxTouchPoints>1&&typeof MSStream>"u"};function cv(t){return function(e){return e.test(t)}}function El(t){var e={userAgent:"",platform:"",maxTouchPoints:0};!t&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof t=="string"?e.userAgent=t:t&&t.userAgent&&(e={userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0});var r=e.userAgent,i=r.split("[FBAN");typeof i[1]<"u"&&(r=i[0]),i=r.split("Twitter"),typeof i[1]<"u"&&(r=i[0]);var n=cv(r),s={apple:{phone:n(bs)&&!n(yt),ipod:n(ml),tablet:!n(bs)&&(n(gl)||Al(e))&&!n(yt),universal:n(_l),device:(n(bs)||n(ml)||n(gl)||n(_l)||Al(e))&&!n(yt)},amazon:{phone:n(gr),tablet:!n(gr)&&n(Vi),device:n(gr)||n(Vi)},android:{phone:!n(yt)&&n(gr)||!n(yt)&&n(Ts),tablet:!n(yt)&&!n(gr)&&!n(Ts)&&(n(Vi)||n(vl)),device:!n(yt)&&(n(gr)||n(Vi)||n(Ts)||n(vl))||n(/\bokhttp\b/i)},windows:{phone:n(yt),tablet:n(yl),device:n(yt)||n(yl)},other:{blackberry:n(xl),blackberry10:n(bl),opera:n(Tl),firefox:n(Sl),chrome:n(wl),device:n(xl)||n(bl)||n(Tl)||n(Sl)||n(wl)},any:!1,phone:!1,tablet:!1};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}const _r=(El.default??El)(globalThis.navigator);q.RETINA_PREFIX=/@([0-9\.]+)x/,q.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var Cl={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,r="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function n(u,c,f){this.fn=u,this.context=c,this.once=f||!1}function s(u,c,f,l,h){if(typeof f!="function")throw new TypeError("The listener must be a function");var d=new n(f,l||u,h),p=r?r+c:c;return u._events[p]?u._events[p].fn?u._events[p]=[u._events[p],d]:u._events[p].push(d):(u._events[p]=d,u._eventsCount++),u}function a(u,c){--u._eventsCount===0?u._events=new i:delete u._events[c]}function o(){this._events=new i,this._eventsCount=0}o.prototype.eventNames=function(){var c=[],f,l;if(this._eventsCount===0)return c;for(l in f=this._events)e.call(f,l)&&c.push(r?l.slice(1):l);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(f)):c},o.prototype.listeners=function(c){var f=r?r+c:c,l=this._events[f];if(!l)return[];if(l.fn)return[l.fn];for(var h=0,d=l.length,p=new Array(d);h<d;h++)p[h]=l[h].fn;return p},o.prototype.listenerCount=function(c){var f=r?r+c:c,l=this._events[f];return l?l.fn?1:l.length:0},o.prototype.emit=function(c,f,l,h,d,p){var m=r?r+c:c;if(!this._events[m])return!1;var _=this._events[m],g=arguments.length,y,v;if(_.fn){switch(_.once&&this.removeListener(c,_.fn,void 0,!0),g){case 1:return _.fn.call(_.context),!0;case 2:return _.fn.call(_.context,f),!0;case 3:return _.fn.call(_.context,f,l),!0;case 4:return _.fn.call(_.context,f,l,h),!0;case 5:return _.fn.call(_.context,f,l,h,d),!0;case 6:return _.fn.call(_.context,f,l,h,d,p),!0}for(v=1,y=new Array(g-1);v<g;v++)y[v-1]=arguments[v];_.fn.apply(_.context,y)}else{var x=_.length,T;for(v=0;v<x;v++)switch(_[v].once&&this.removeListener(c,_[v].fn,void 0,!0),g){case 1:_[v].fn.call(_[v].context);break;case 2:_[v].fn.call(_[v].context,f);break;case 3:_[v].fn.call(_[v].context,f,l);break;case 4:_[v].fn.call(_[v].context,f,l,h);break;default:if(!y)for(T=1,y=new Array(g-1);T<g;T++)y[T-1]=arguments[T];_[v].fn.apply(_[v].context,y)}}return!0},o.prototype.on=function(c,f,l){return s(this,c,f,l,!1)},o.prototype.once=function(c,f,l){return s(this,c,f,l,!0)},o.prototype.removeListener=function(c,f,l,h){var d=r?r+c:c;if(!this._events[d])return this;if(!f)return a(this,d),this;var p=this._events[d];if(p.fn)p.fn===f&&(!h||p.once)&&(!l||p.context===l)&&a(this,d);else{for(var m=0,_=[],g=p.length;m<g;m++)(p[m].fn!==f||h&&!p[m].once||l&&p[m].context!==l)&&_.push(p[m]);_.length?this._events[d]=_.length===1?_[0]:_:a(this,d)}return this},o.prototype.removeAllListeners=function(c){var f;return c?(f=r?r+c:c,this._events[f]&&a(this,f)):(this._events=new i,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=r,o.EventEmitter=o,t.exports=o})(Cl);var fv=Cl.exports;const Xi=$t(fv);var ws={exports:{}};ws.exports=Wi,ws.exports.default=Wi;function Wi(t,e,r){r=r||2;var i=e&&e.length,n=i?e[0]*r:t.length,s=Il(t,0,n,r,!0),a=[];if(!s||s.next===s.prev)return a;var o,u,c,f,l,h,d;if(i&&(s=_v(t,e,s,r)),t.length>80*r){o=c=t[0],u=f=t[1];for(var p=r;p<n;p+=r)l=t[p],h=t[p+1],l<o&&(o=l),h<u&&(u=h),l>c&&(c=l),h>f&&(f=h);d=Math.max(c-o,f-u),d=d!==0?32767/d:0}return Jr(s,a,r,o,u,d,0),a}function Il(t,e,r,i,n){var s,a;if(n===Es(t,e,r,i)>0)for(s=e;s<r;s+=i)a=Ml(s,t[s],t[s+1],a);else for(s=r-i;s>=e;s-=i)a=Ml(s,t[s],t[s+1],a);return a&&qi(a,a.next)&&(ti(a),a=a.next),a}function Wt(t,e){if(!t)return t;e||(e=t);var r=t,i;do if(i=!1,!r.steiner&&(qi(r,r.next)||xe(r.prev,r,r.next)===0)){if(ti(r),r=e=r.prev,r===r.next)break;i=!0}else r=r.next;while(i||r!==e);return e}function Jr(t,e,r,i,n,s,a){if(t){!a&&s&&Tv(t,i,n,s);for(var o=t,u,c;t.prev!==t.next;){if(u=t.prev,c=t.next,s?pv(t,i,n,s):dv(t)){e.push(u.i/r|0),e.push(t.i/r|0),e.push(c.i/r|0),ti(t),t=c.next,o=c.next;continue}if(t=c,t===o){a?a===1?(t=mv(Wt(t),e,r),Jr(t,e,r,i,n,s,2)):a===2&&gv(t,e,r,i,n,s):Jr(Wt(t),e,r,i,n,s,1);break}}}}function dv(t){var e=t.prev,r=t,i=t.next;if(xe(e,r,i)>=0)return!1;for(var n=e.x,s=r.x,a=i.x,o=e.y,u=r.y,c=i.y,f=n<s?n<a?n:a:s<a?s:a,l=o<u?o<c?o:c:u<c?u:c,h=n>s?n>a?n:a:s>a?s:a,d=o>u?o>c?o:c:u>c?u:c,p=i.next;p!==e;){if(p.x>=f&&p.x<=h&&p.y>=l&&p.y<=d&&vr(n,o,s,u,a,c,p.x,p.y)&&xe(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function pv(t,e,r,i){var n=t.prev,s=t,a=t.next;if(xe(n,s,a)>=0)return!1;for(var o=n.x,u=s.x,c=a.x,f=n.y,l=s.y,h=a.y,d=o<u?o<c?o:c:u<c?u:c,p=f<l?f<h?f:h:l<h?l:h,m=o>u?o>c?o:c:u>c?u:c,_=f>l?f>h?f:h:l>h?l:h,g=Ss(d,p,e,r,i),y=Ss(m,_,e,r,i),v=t.prevZ,x=t.nextZ;v&&v.z>=g&&x&&x.z<=y;){if(v.x>=d&&v.x<=m&&v.y>=p&&v.y<=_&&v!==n&&v!==a&&vr(o,f,u,l,c,h,v.x,v.y)&&xe(v.prev,v,v.next)>=0||(v=v.prevZ,x.x>=d&&x.x<=m&&x.y>=p&&x.y<=_&&x!==n&&x!==a&&vr(o,f,u,l,c,h,x.x,x.y)&&xe(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;v&&v.z>=g;){if(v.x>=d&&v.x<=m&&v.y>=p&&v.y<=_&&v!==n&&v!==a&&vr(o,f,u,l,c,h,v.x,v.y)&&xe(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;x&&x.z<=y;){if(x.x>=d&&x.x<=m&&x.y>=p&&x.y<=_&&x!==n&&x!==a&&vr(o,f,u,l,c,h,x.x,x.y)&&xe(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function mv(t,e,r){var i=t;do{var n=i.prev,s=i.next.next;!qi(n,s)&&Rl(n,i,i.next,s)&&ei(n,s)&&ei(s,n)&&(e.push(n.i/r|0),e.push(i.i/r|0),e.push(s.i/r|0),ti(i),ti(i.next),i=t=s),i=i.next}while(i!==t);return Wt(i)}function gv(t,e,r,i,n,s){var a=t;do{for(var o=a.next.next;o!==a.prev;){if(a.i!==o.i&&Av(a,o)){var u=Pl(a,o);a=Wt(a,a.next),u=Wt(u,u.next),Jr(a,e,r,i,n,s,0),Jr(u,e,r,i,n,s,0);return}o=o.next}a=a.next}while(a!==t)}function _v(t,e,r,i){var n=[],s,a,o,u,c;for(s=0,a=e.length;s<a;s++)o=e[s]*i,u=s<a-1?e[s+1]*i:t.length,c=Il(t,o,u,i,!1),c===c.next&&(c.steiner=!0),n.push(Sv(c));for(n.sort(vv),s=0;s<n.length;s++)r=yv(n[s],r);return r}function vv(t,e){return t.x-e.x}function yv(t,e){var r=xv(t,e);if(!r)return e;var i=Pl(r,t);return Wt(i,i.next),Wt(r,r.next)}function xv(t,e){var r=e,i=t.x,n=t.y,s=-1/0,a;do{if(n<=r.y&&n>=r.next.y&&r.next.y!==r.y){var o=r.x+(n-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(o<=i&&o>s&&(s=o,a=r.x<r.next.x?r:r.next,o===i))return a}r=r.next}while(r!==e);if(!a)return null;var u=a,c=a.x,f=a.y,l=1/0,h;r=a;do i>=r.x&&r.x>=c&&i!==r.x&&vr(n<f?i:s,n,c,f,n<f?s:i,n,r.x,r.y)&&(h=Math.abs(n-r.y)/(i-r.x),ei(r,t)&&(h<l||h===l&&(r.x>a.x||r.x===a.x&&bv(a,r)))&&(a=r,l=h)),r=r.next;while(r!==u);return a}function bv(t,e){return xe(t.prev,t,e.prev)<0&&xe(e.next,t,t.next)<0}function Tv(t,e,r,i){var n=t;do n.z===0&&(n.z=Ss(n.x,n.y,e,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,wv(n)}function wv(t){var e,r,i,n,s,a,o,u,c=1;do{for(r=t,t=null,s=null,a=0;r;){for(a++,i=r,o=0,e=0;e<c&&(o++,i=i.nextZ,!!i);e++);for(u=c;o>0||u>0&&i;)o!==0&&(u===0||!i||r.z<=i.z)?(n=r,r=r.nextZ,o--):(n=i,i=i.nextZ,u--),s?s.nextZ=n:t=n,n.prevZ=s,s=n;r=i}s.nextZ=null,c*=2}while(a>1);return t}function Ss(t,e,r,i,n){return t=(t-r)*n|0,e=(e-i)*n|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function Sv(t){var e=t,r=t;do(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next;while(e!==t);return r}function vr(t,e,r,i,n,s,a,o){return(n-a)*(e-o)>=(t-a)*(s-o)&&(t-a)*(i-o)>=(r-a)*(e-o)&&(r-a)*(s-o)>=(n-a)*(i-o)}function Av(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!Ev(t,e)&&(ei(t,e)&&ei(e,t)&&Cv(t,e)&&(xe(t.prev,t,e.prev)||xe(t,e.prev,e))||qi(t,e)&&xe(t.prev,t,t.next)>0&&xe(e.prev,e,e.next)>0)}function xe(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function qi(t,e){return t.x===e.x&&t.y===e.y}function Rl(t,e,r,i){var n=Ki(xe(t,e,r)),s=Ki(xe(t,e,i)),a=Ki(xe(r,i,t)),o=Ki(xe(r,i,e));return!!(n!==s&&a!==o||n===0&&Yi(t,r,e)||s===0&&Yi(t,i,e)||a===0&&Yi(r,t,i)||o===0&&Yi(r,e,i))}function Yi(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function Ki(t){return t>0?1:t<0?-1:0}function Ev(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&Rl(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}function ei(t,e){return xe(t.prev,t,t.next)<0?xe(t,e,t.next)>=0&&xe(t,t.prev,e)>=0:xe(t,e,t.prev)<0||xe(t,t.next,e)<0}function Cv(t,e){var r=t,i=!1,n=(t.x+e.x)/2,s=(t.y+e.y)/2;do r.y>s!=r.next.y>s&&r.next.y!==r.y&&n<(r.next.x-r.x)*(s-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next;while(r!==t);return i}function Pl(t,e){var r=new As(t.i,t.x,t.y),i=new As(e.i,e.x,e.y),n=t.next,s=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,s.next=i,i.prev=s,i}function Ml(t,e,r,i){var n=new As(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function ti(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function As(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}Wi.deviation=function(t,e,r,i){var n=e&&e.length,s=n?e[0]*r:t.length,a=Math.abs(Es(t,0,s,r));if(n)for(var o=0,u=e.length;o<u;o++){var c=e[o]*r,f=o<u-1?e[o+1]*r:t.length;a-=Math.abs(Es(t,c,f,r))}var l=0;for(o=0;o<i.length;o+=3){var h=i[o]*r,d=i[o+1]*r,p=i[o+2]*r;l+=Math.abs((t[h]-t[p])*(t[d+1]-t[h+1])-(t[h]-t[d])*(t[p+1]-t[h+1]))}return a===0&&l===0?0:Math.abs((l-a)/a)};function Es(t,e,r,i){for(var n=0,s=e,a=r-i;s<r;s+=i)n+=(t[a]-t[s])*(t[s+1]+t[a+1]),a=s;return n}Wi.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},i=0,n=0;n<t.length;n++){for(var s=0;s<t[n].length;s++)for(var a=0;a<e;a++)r.vertices.push(t[n][s][a]);n>0&&(i+=t[n-1].length,r.holes.push(i))}return r};var Iv=ws.exports;const Rv=$t(Iv);var Zi={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */Zi.exports,function(t,e){(function(r){var i=e&&!e.nodeType&&e,n=t&&!t.nodeType&&t,s=typeof We=="object"&&We;(s.global===s||s.window===s||s.self===s)&&(r=s);var a,o=2147483647,u=36,c=1,f=26,l=38,h=700,d=72,p=128,m="-",_=/^xn--/,g=/[^\x20-\x7E]/,y=/[\x2E\u3002\uFF0E\uFF61]/g,v={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=u-c,T=Math.floor,b=String.fromCharCode,w;function S(M){throw new RangeError(v[M])}function A(M,O){for(var j=M.length,H=[];j--;)H[j]=O(M[j]);return H}function C(M,O){var j=M.split("@"),H="";j.length>1&&(H=j[0]+"@",M=j[1]),M=M.replace(y,".");var W=M.split("."),Q=A(W,O).join(".");return H+Q}function F(M){for(var O=[],j=0,H=M.length,W,Q;j<H;)W=M.charCodeAt(j++),W>=55296&&W<=56319&&j<H?(Q=M.charCodeAt(j++),(Q&64512)==56320?O.push(((W&1023)<<10)+(Q&1023)+65536):(O.push(W),j--)):O.push(W);return O}function G(M){return A(M,function(O){var j="";return O>65535&&(O-=65536,j+=b(O>>>10&1023|55296),O=56320|O&1023),j+=b(O),j}).join("")}function R(M){return M-48<10?M-22:M-65<26?M-65:M-97<26?M-97:u}function E(M,O){return M+22+75*(M<26)-((O!=0)<<5)}function B(M,O,j){var H=0;for(M=j?T(M/h):M>>1,M+=T(M/O);M>x*f>>1;H+=u)M=T(M/x);return T(H+(x+1)*M/(M+l))}function U(M){var O=[],j=M.length,H,W=0,Q=p,V=d,J,de,ge,Z,le,se,we,ze,je;for(J=M.lastIndexOf(m),J<0&&(J=0),de=0;de<J;++de)M.charCodeAt(de)>=128&&S("not-basic"),O.push(M.charCodeAt(de));for(ge=J>0?J+1:0;ge<j;){for(Z=W,le=1,se=u;ge>=j&&S("invalid-input"),we=R(M.charCodeAt(ge++)),(we>=u||we>T((o-W)/le))&&S("overflow"),W+=we*le,ze=se<=V?c:se>=V+f?f:se-V,!(we<ze);se+=u)je=u-ze,le>T(o/je)&&S("overflow"),le*=je;H=O.length+1,V=B(W-Z,H,Z==0),T(W/H)>o-Q&&S("overflow"),Q+=T(W/H),W%=H,O.splice(W++,0,Q)}return G(O)}function I(M){var O,j,H,W,Q,V,J,de,ge,Z,le,se=[],we,ze,je,At;for(M=F(M),we=M.length,O=p,j=0,Q=d,V=0;V<we;++V)le=M[V],le<128&&se.push(b(le));for(H=W=se.length,W&&se.push(m);H<we;){for(J=o,V=0;V<we;++V)le=M[V],le>=O&&le<J&&(J=le);for(ze=H+1,J-O>T((o-j)/ze)&&S("overflow"),j+=(J-O)*ze,O=J,V=0;V<we;++V)if(le=M[V],le<O&&++j>o&&S("overflow"),le==O){for(de=j,ge=u;Z=ge<=Q?c:ge>=Q+f?f:ge-Q,!(de<Z);ge+=u)At=de-Z,je=u-Z,se.push(b(E(Z+At%je,0))),de=T(At/je);se.push(b(E(de,0))),Q=B(j,ze,H==W),j=0,++H}++j,++O}return se.join("")}function $(M){return C(M,function(O){return _.test(O)?U(O.slice(4).toLowerCase()):O})}function X(M){return C(M,function(O){return g.test(O)?"xn--"+I(O):O})}if(a={version:"1.4.1",ucs2:{decode:F,encode:G},decode:U,encode:I,toASCII:X,toUnicode:$},i&&n)if(t.exports==i)n.exports=a;else for(w in a)a.hasOwnProperty(w)&&(i[w]=a[w]);else r.punycode=a})(We)}(Zi,Zi.exports);var Pv=Zi.exports,Mv=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),i=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var n=42;e[r]=n;for(r in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(e,r);if(a.value!==n||a.enumerable!==!0)return!1}return!0},Fl=typeof Symbol<"u"&&Symbol,Fv=Mv,Ov=function(){return typeof Fl!="function"||typeof Symbol!="function"||typeof Fl("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Fv()},Ol={foo:{}},Nv=Object,kv=function(){return{__proto__:Ol}.foo===Ol.foo&&!({__proto__:null}instanceof Nv)},Dv="Function.prototype.bind called on incompatible ",Cs=Array.prototype.slice,Lv=Object.prototype.toString,Bv="[object Function]",Uv=function(e){var r=this;if(typeof r!="function"||Lv.call(r)!==Bv)throw new TypeError(Dv+r);for(var i=Cs.call(arguments,1),n,s=function(){if(this instanceof n){var f=r.apply(this,i.concat(Cs.call(arguments)));return Object(f)===f?f:this}else return r.apply(e,i.concat(Cs.call(arguments)))},a=Math.max(0,r.length-i.length),o=[],u=0;u<a;u++)o.push("$"+u);if(n=Function("binder","return function ("+o.join(",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var c=function(){};c.prototype=r.prototype,n.prototype=new c,c.prototype=null}return n},$v=Uv,Is=Function.prototype.bind||$v,Gv=Is,zv=Gv.call(Function.call,Object.prototype.hasOwnProperty),te,yr=SyntaxError,Nl=Function,xr=TypeError,Rs=function(t){try{return Nl('"use strict"; return ('+t+").constructor;")()}catch{}},qt=Object.getOwnPropertyDescriptor;if(qt)try{qt({},"")}catch{qt=null}var Ps=function(){throw new xr},jv=qt?function(){try{return arguments.callee,Ps}catch{try{return qt(arguments,"callee").get}catch{return Ps}}}():Ps,br=Ov(),Hv=kv(),Re=Object.getPrototypeOf||(Hv?function(t){return t.__proto__}:null),Tr={},Vv=typeof Uint8Array>"u"||!Re?te:Re(Uint8Array),Yt={"%AggregateError%":typeof AggregateError>"u"?te:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?te:ArrayBuffer,"%ArrayIteratorPrototype%":br&&Re?Re([][Symbol.iterator]()):te,"%AsyncFromSyncIteratorPrototype%":te,"%AsyncFunction%":Tr,"%AsyncGenerator%":Tr,"%AsyncGeneratorFunction%":Tr,"%AsyncIteratorPrototype%":Tr,"%Atomics%":typeof Atomics>"u"?te:Atomics,"%BigInt%":typeof BigInt>"u"?te:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?te:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?te:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?te:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?te:Float32Array,"%Float64Array%":typeof Float64Array>"u"?te:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?te:FinalizationRegistry,"%Function%":Nl,"%GeneratorFunction%":Tr,"%Int8Array%":typeof Int8Array>"u"?te:Int8Array,"%Int16Array%":typeof Int16Array>"u"?te:Int16Array,"%Int32Array%":typeof Int32Array>"u"?te:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":br&&Re?Re(Re([][Symbol.iterator]())):te,"%JSON%":typeof JSON=="object"?JSON:te,"%Map%":typeof Map>"u"?te:Map,"%MapIteratorPrototype%":typeof Map>"u"||!br||!Re?te:Re(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?te:Promise,"%Proxy%":typeof Proxy>"u"?te:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?te:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?te:Set,"%SetIteratorPrototype%":typeof Set>"u"||!br||!Re?te:Re(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?te:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":br&&Re?Re(""[Symbol.iterator]()):te,"%Symbol%":br?Symbol:te,"%SyntaxError%":yr,"%ThrowTypeError%":jv,"%TypedArray%":Vv,"%TypeError%":xr,"%Uint8Array%":typeof Uint8Array>"u"?te:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?te:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?te:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?te:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?te:WeakMap,"%WeakRef%":typeof WeakRef>"u"?te:WeakRef,"%WeakSet%":typeof WeakSet>"u"?te:WeakSet};if(Re)try{null.error}catch(t){var Xv=Re(Re(t));Yt["%Error.prototype%"]=Xv}var Wv=function t(e){var r;if(e==="%AsyncFunction%")r=Rs("async function () {}");else if(e==="%GeneratorFunction%")r=Rs("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=Rs("async function* () {}");else if(e==="%AsyncGenerator%"){var i=t("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if(e==="%AsyncIteratorPrototype%"){var n=t("%AsyncGenerator%");n&&Re&&(r=Re(n.prototype))}return Yt[e]=r,r},kl={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},ri=Is,Qi=zv,qv=ri.call(Function.call,Array.prototype.concat),Yv=ri.call(Function.apply,Array.prototype.splice),Dl=ri.call(Function.call,String.prototype.replace),Ji=ri.call(Function.call,String.prototype.slice),Kv=ri.call(Function.call,RegExp.prototype.exec),Zv=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Qv=/\\(\\)?/g,Jv=function(e){var r=Ji(e,0,1),i=Ji(e,-1);if(r==="%"&&i!=="%")throw new yr("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&r!=="%")throw new yr("invalid intrinsic syntax, expected opening `%`");var n=[];return Dl(e,Zv,function(s,a,o,u){n[n.length]=o?Dl(u,Qv,"$1"):a||s}),n},ey=function(e,r){var i=e,n;if(Qi(kl,i)&&(n=kl[i],i="%"+n[0]+"%"),Qi(Yt,i)){var s=Yt[i];if(s===Tr&&(s=Wv(i)),typeof s>"u"&&!r)throw new xr("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:s}}throw new yr("intrinsic "+e+" does not exist!")},Ms=function(e,r){if(typeof e!="string"||e.length===0)throw new xr("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new xr('"allowMissing" argument must be a boolean');if(Kv(/^%?[^%]*%?$/,e)===null)throw new yr("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=Jv(e),n=i.length>0?i[0]:"",s=ey("%"+n+"%",r),a=s.name,o=s.value,u=!1,c=s.alias;c&&(n=c[0],Yv(i,qv([0,1],c)));for(var f=1,l=!0;f<i.length;f+=1){var h=i[f],d=Ji(h,0,1),p=Ji(h,-1);if((d==='"'||d==="'"||d==="`"||p==='"'||p==="'"||p==="`")&&d!==p)throw new yr("property names with quotes must have matching quotes");if((h==="constructor"||!l)&&(u=!0),n+="."+h,a="%"+n+"%",Qi(Yt,a))o=Yt[a];else if(o!=null){if(!(h in o)){if(!r)throw new xr("base intrinsic for "+e+" exists, but the property is not available.");return}if(qt&&f+1>=i.length){var m=qt(o,h);l=!!m,l&&"get"in m&&!("originalValue"in m.get)?o=m.get:o=o[h]}else l=Qi(o,h),o=o[h];l&&!u&&(Yt[a]=o)}}return o},Ll={exports:{}};(function(t){var e=Is,r=Ms,i=r("%Function.prototype.apply%"),n=r("%Function.prototype.call%"),s=r("%Reflect.apply%",!0)||e.call(n,i),a=r("%Object.getOwnPropertyDescriptor%",!0),o=r("%Object.defineProperty%",!0),u=r("%Math.max%");if(o)try{o({},"a",{value:1})}catch{o=null}t.exports=function(l){var h=s(e,n,arguments);if(a&&o){var d=a(h,"length");d.configurable&&o(h,"length",{value:1+u(0,l.length-(arguments.length-1))})}return h};var c=function(){return s(e,i,arguments)};o?o(t.exports,"apply",{value:c}):t.exports.apply=c})(Ll);var ty=Ll.exports,Bl=Ms,Ul=ty,ry=Ul(Bl("String.prototype.indexOf")),iy=function(e,r){var i=Bl(e,!!r);return typeof i=="function"&&ry(e,".prototype.")>-1?Ul(i):i};const ny=Vc(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Fs=typeof Map=="function"&&Map.prototype,Os=Object.getOwnPropertyDescriptor&&Fs?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,en=Fs&&Os&&typeof Os.get=="function"?Os.get:null,$l=Fs&&Map.prototype.forEach,Ns=typeof Set=="function"&&Set.prototype,ks=Object.getOwnPropertyDescriptor&&Ns?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,tn=Ns&&ks&&typeof ks.get=="function"?ks.get:null,Gl=Ns&&Set.prototype.forEach,sy=typeof WeakMap=="function"&&WeakMap.prototype,ii=sy?WeakMap.prototype.has:null,ay=typeof WeakSet=="function"&&WeakSet.prototype,ni=ay?WeakSet.prototype.has:null,oy=typeof WeakRef=="function"&&WeakRef.prototype,zl=oy?WeakRef.prototype.deref:null,ly=Boolean.prototype.valueOf,uy=Object.prototype.toString,hy=Function.prototype.toString,cy=String.prototype.match,Ds=String.prototype.slice,Ft=String.prototype.replace,fy=String.prototype.toUpperCase,jl=String.prototype.toLowerCase,Hl=RegExp.prototype.test,Vl=Array.prototype.concat,mt=Array.prototype.join,dy=Array.prototype.slice,Xl=Math.floor,Ls=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Bs=Object.getOwnPropertySymbols,Us=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,wr=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ke=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===wr||"symbol")?Symbol.toStringTag:null,Wl=Object.prototype.propertyIsEnumerable,ql=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function Yl(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||Hl.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var i=t<0?-Xl(-t):Xl(t);if(i!==t){var n=String(i),s=Ds.call(e,n.length+1);return Ft.call(n,r,"$&_")+"."+Ft.call(Ft.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ft.call(e,r,"$&_")}var $s=ny,Kl=$s.custom,Zl=eu(Kl)?Kl:null,py=function t(e,r,i,n){var s=r||{};if(Ot(s,"quoteStyle")&&s.quoteStyle!=="single"&&s.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Ot(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=Ot(s,"customInspect")?s.customInspect:!0;if(typeof a!="boolean"&&a!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Ot(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Ot(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var o=s.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return ru(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var u=String(e);return o?Yl(e,u):u}if(typeof e=="bigint"){var c=String(e)+"n";return o?Yl(e,c):c}var f=typeof s.depth>"u"?5:s.depth;if(typeof i>"u"&&(i=0),i>=f&&f>0&&typeof e=="object")return Gs(e)?"[Array]":"[Object]";var l=Fy(s,i);if(typeof n>"u")n=[];else if(tu(n,e)>=0)return"[Circular]";function h(R,E,B){if(E&&(n=dy.call(n),n.push(E)),B){var U={depth:s.depth};return Ot(s,"quoteStyle")&&(U.quoteStyle=s.quoteStyle),t(R,U,i+1,n)}return t(R,s,i+1,n)}if(typeof e=="function"&&!Jl(e)){var d=wy(e),p=rn(e,h);return"[Function"+(d?": "+d:" (anonymous)")+"]"+(p.length>0?" { "+mt.call(p,", ")+" }":"")}if(eu(e)){var m=wr?Ft.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Us.call(e);return typeof e=="object"&&!wr?si(m):m}if(Ry(e)){for(var _="<"+jl.call(String(e.nodeName)),g=e.attributes||[],y=0;y<g.length;y++)_+=" "+g[y].name+"="+Ql(my(g[y].value),"double",s);return _+=">",e.childNodes&&e.childNodes.length&&(_+="..."),_+="</"+jl.call(String(e.nodeName))+">",_}if(Gs(e)){if(e.length===0)return"[]";var v=rn(e,h);return l&&!My(v)?"["+js(v,l)+"]":"[ "+mt.call(v,", ")+" ]"}if(_y(e)){var x=rn(e,h);return!("cause"in Error.prototype)&&"cause"in e&&!Wl.call(e,"cause")?"{ ["+String(e)+"] "+mt.call(Vl.call("[cause]: "+h(e.cause),x),", ")+" }":x.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+mt.call(x,", ")+" }"}if(typeof e=="object"&&a){if(Zl&&typeof e[Zl]=="function"&&$s)return $s(e,{depth:f-i});if(a!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(Sy(e)){var T=[];return $l&&$l.call(e,function(R,E){T.push(h(E,e,!0)+" => "+h(R,e))}),iu("Map",en.call(e),T,l)}if(Cy(e)){var b=[];return Gl&&Gl.call(e,function(R){b.push(h(R,e))}),iu("Set",tn.call(e),b,l)}if(Ay(e))return zs("WeakMap");if(Iy(e))return zs("WeakSet");if(Ey(e))return zs("WeakRef");if(yy(e))return si(h(Number(e)));if(by(e))return si(h(Ls.call(e)));if(xy(e))return si(ly.call(e));if(vy(e))return si(h(String(e)));if(!gy(e)&&!Jl(e)){var w=rn(e,h),S=ql?ql(e)===Object.prototype:e instanceof Object||e.constructor===Object,A=e instanceof Object?"":"null prototype",C=!S&&ke&&Object(e)===e&&ke in e?Ds.call(Nt(e),8,-1):A?"Object":"",F=S||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",G=F+(C||A?"["+mt.call(Vl.call([],C||[],A||[]),": ")+"] ":"");return w.length===0?G+"{}":l?G+"{"+js(w,l)+"}":G+"{ "+mt.call(w,", ")+" }"}return String(e)};function Ql(t,e,r){var i=(r.quoteStyle||e)==="double"?'"':"'";return i+t+i}function my(t){return Ft.call(String(t),/"/g,""")}function Gs(t){return Nt(t)==="[object Array]"&&(!ke||!(typeof t=="object"&&ke in t))}function gy(t){return Nt(t)==="[object Date]"&&(!ke||!(typeof t=="object"&&ke in t))}function Jl(t){return Nt(t)==="[object RegExp]"&&(!ke||!(typeof t=="object"&&ke in t))}function _y(t){return Nt(t)==="[object Error]"&&(!ke||!(typeof t=="object"&&ke in t))}function vy(t){return Nt(t)==="[object String]"&&(!ke||!(typeof t=="object"&&ke in t))}function yy(t){return Nt(t)==="[object Number]"&&(!ke||!(typeof t=="object"&&ke in t))}function xy(t){return Nt(t)==="[object Boolean]"&&(!ke||!(typeof t=="object"&&ke in t))}function eu(t){if(wr)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!Us)return!1;try{return Us.call(t),!0}catch{}return!1}function by(t){if(!t||typeof t!="object"||!Ls)return!1;try{return Ls.call(t),!0}catch{}return!1}var Ty=Object.prototype.hasOwnProperty||function(t){return t in this};function Ot(t,e){return Ty.call(t,e)}function Nt(t){return uy.call(t)}function wy(t){if(t.name)return t.name;var e=cy.call(hy.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function tu(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}function Sy(t){if(!en||!t||typeof t!="object")return!1;try{en.call(t);try{tn.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}function Ay(t){if(!ii||!t||typeof t!="object")return!1;try{ii.call(t,ii);try{ni.call(t,ni)}catch{return!0}return t instanceof WeakMap}catch{}return!1}function Ey(t){if(!zl||!t||typeof t!="object")return!1;try{return zl.call(t),!0}catch{}return!1}function Cy(t){if(!tn||!t||typeof t!="object")return!1;try{tn.call(t);try{en.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}function Iy(t){if(!ni||!t||typeof t!="object")return!1;try{ni.call(t,ni);try{ii.call(t,ii)}catch{return!0}return t instanceof WeakSet}catch{}return!1}function Ry(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}function ru(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,i="... "+r+" more character"+(r>1?"s":"");return ru(Ds.call(t,0,e.maxStringLength),e)+i}var n=Ft.call(Ft.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Py);return Ql(n,"single",e)}function Py(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+fy.call(e.toString(16))}function si(t){return"Object("+t+")"}function zs(t){return t+" { ? }"}function iu(t,e,r,i){var n=i?js(r,i):mt.call(r,", ");return t+" ("+e+") {"+n+"}"}function My(t){for(var e=0;e<t.length;e++)if(tu(t[e],`
|
|
34
|
+
`)>=0)return!1;return!0}function Fy(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=mt.call(Array(t.indent+1)," ");else return null;return{base:r,prev:mt.call(Array(e+1),r)}}function js(t,e){if(t.length===0)return"";var r=`
|
|
35
|
+
`+e.prev+e.base;return r+mt.call(t,","+r)+`
|
|
36
|
+
`+e.prev}function rn(t,e){var r=Gs(t),i=[];if(r){i.length=t.length;for(var n=0;n<t.length;n++)i[n]=Ot(t,n)?e(t[n],t):""}var s=typeof Bs=="function"?Bs(t):[],a;if(wr){a={};for(var o=0;o<s.length;o++)a["$"+s[o]]=s[o]}for(var u in t)Ot(t,u)&&(r&&String(Number(u))===u&&u<t.length||wr&&a["$"+u]instanceof Symbol||(Hl.call(/[^\w$]/,u)?i.push(e(u,t)+": "+e(t[u],t)):i.push(u+": "+e(t[u],t))));if(typeof Bs=="function")for(var c=0;c<s.length;c++)Wl.call(t,s[c])&&i.push("["+e(s[c])+"]: "+e(t[s[c]],t));return i}var Hs=Ms,Sr=iy,Oy=py,Ny=Hs("%TypeError%"),nn=Hs("%WeakMap%",!0),sn=Hs("%Map%",!0),ky=Sr("WeakMap.prototype.get",!0),Dy=Sr("WeakMap.prototype.set",!0),Ly=Sr("WeakMap.prototype.has",!0),By=Sr("Map.prototype.get",!0),Uy=Sr("Map.prototype.set",!0),$y=Sr("Map.prototype.has",!0),Vs=function(t,e){for(var r=t,i;(i=r.next)!==null;r=i)if(i.key===e)return r.next=i.next,i.next=t.next,t.next=i,i},Gy=function(t,e){var r=Vs(t,e);return r&&r.value},zy=function(t,e,r){var i=Vs(t,e);i?i.value=r:t.next={key:e,next:t.next,value:r}},jy=function(t,e){return!!Vs(t,e)},Hy=function(){var e,r,i,n={assert:function(s){if(!n.has(s))throw new Ny("Side channel does not contain "+Oy(s))},get:function(s){if(nn&&s&&(typeof s=="object"||typeof s=="function")){if(e)return ky(e,s)}else if(sn){if(r)return By(r,s)}else if(i)return Gy(i,s)},has:function(s){if(nn&&s&&(typeof s=="object"||typeof s=="function")){if(e)return Ly(e,s)}else if(sn){if(r)return $y(r,s)}else if(i)return jy(i,s);return!1},set:function(s,a){nn&&s&&(typeof s=="object"||typeof s=="function")?(e||(e=new nn),Dy(e,s,a)):sn?(r||(r=new sn),Uy(r,s,a)):(i||(i={key:{},next:null}),zy(i,s,a))}};return n},Vy=String.prototype.replace,Xy=/%20/g,Xs={RFC1738:"RFC1738",RFC3986:"RFC3986"},Ws={default:Xs.RFC3986,formatters:{RFC1738:function(t){return Vy.call(t,Xy,"+")},RFC3986:function(t){return String(t)}},RFC1738:Xs.RFC1738,RFC3986:Xs.RFC3986},Wy=Ws,qs=Object.prototype.hasOwnProperty,Kt=Array.isArray,gt=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),qy=function(e){for(;e.length>1;){var r=e.pop(),i=r.obj[r.prop];if(Kt(i)){for(var n=[],s=0;s<i.length;++s)typeof i[s]<"u"&&n.push(i[s]);r.obj[r.prop]=n}}},nu=function(e,r){for(var i=r&&r.plainObjects?Object.create(null):{},n=0;n<e.length;++n)typeof e[n]<"u"&&(i[n]=e[n]);return i},Yy=function t(e,r,i){if(!r)return e;if(typeof r!="object"){if(Kt(e))e.push(r);else if(e&&typeof e=="object")(i&&(i.plainObjects||i.allowPrototypes)||!qs.call(Object.prototype,r))&&(e[r]=!0);else return[e,r];return e}if(!e||typeof e!="object")return[e].concat(r);var n=e;return Kt(e)&&!Kt(r)&&(n=nu(e,i)),Kt(e)&&Kt(r)?(r.forEach(function(s,a){if(qs.call(e,a)){var o=e[a];o&&typeof o=="object"&&s&&typeof s=="object"?e[a]=t(o,s,i):e.push(s)}else e[a]=s}),e):Object.keys(r).reduce(function(s,a){var o=r[a];return qs.call(s,a)?s[a]=t(s[a],o,i):s[a]=o,s},n)},Ky=function(e,r){return Object.keys(r).reduce(function(i,n){return i[n]=r[n],i},e)},Zy=function(t,e,r){var i=t.replace(/\+/g," ");if(r==="iso-8859-1")return i.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(i)}catch{return i}},Qy=function(e,r,i,n,s){if(e.length===0)return e;var a=e;if(typeof e=="symbol"?a=Symbol.prototype.toString.call(e):typeof e!="string"&&(a=String(e)),i==="iso-8859-1")return escape(a).replace(/%u[0-9a-f]{4}/gi,function(f){return"%26%23"+parseInt(f.slice(2),16)+"%3B"});for(var o="",u=0;u<a.length;++u){var c=a.charCodeAt(u);if(c===45||c===46||c===95||c===126||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||s===Wy.RFC1738&&(c===40||c===41)){o+=a.charAt(u);continue}if(c<128){o=o+gt[c];continue}if(c<2048){o=o+(gt[192|c>>6]+gt[128|c&63]);continue}if(c<55296||c>=57344){o=o+(gt[224|c>>12]+gt[128|c>>6&63]+gt[128|c&63]);continue}u+=1,c=65536+((c&1023)<<10|a.charCodeAt(u)&1023),o+=gt[240|c>>18]+gt[128|c>>12&63]+gt[128|c>>6&63]+gt[128|c&63]}return o},Jy=function(e){for(var r=[{obj:{o:e},prop:"o"}],i=[],n=0;n<r.length;++n)for(var s=r[n],a=s.obj[s.prop],o=Object.keys(a),u=0;u<o.length;++u){var c=o[u],f=a[c];typeof f=="object"&&f!==null&&i.indexOf(f)===-1&&(r.push({obj:a,prop:c}),i.push(f))}return qy(r),e},ex=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},tx=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},rx=function(e,r){return[].concat(e,r)},ix=function(e,r){if(Kt(e)){for(var i=[],n=0;n<e.length;n+=1)i.push(r(e[n]));return i}return r(e)},su={arrayToObject:nu,assign:Ky,combine:rx,compact:Jy,decode:Zy,encode:Qy,isBuffer:tx,isRegExp:ex,maybeMap:ix,merge:Yy},au=Hy,an=su,ai=Ws,nx=Object.prototype.hasOwnProperty,ou={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,r){return e+"["+r+"]"},repeat:function(e){return e}},xt=Array.isArray,sx=Array.prototype.push,lu=function(t,e){sx.apply(t,xt(e)?e:[e])},ax=Date.prototype.toISOString,uu=ai.default,De={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:an.encode,encodeValuesOnly:!1,format:uu,formatter:ai.formatters[uu],indices:!1,serializeDate:function(e){return ax.call(e)},skipNulls:!1,strictNullHandling:!1},ox=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},Ys={},lx=function t(e,r,i,n,s,a,o,u,c,f,l,h,d,p,m,_){for(var g=e,y=_,v=0,x=!1;(y=y.get(Ys))!==void 0&&!x;){var T=y.get(e);if(v+=1,typeof T<"u"){if(T===v)throw new RangeError("Cyclic object value");x=!0}typeof y.get(Ys)>"u"&&(v=0)}if(typeof u=="function"?g=u(r,g):g instanceof Date?g=l(g):i==="comma"&&xt(g)&&(g=an.maybeMap(g,function(U){return U instanceof Date?l(U):U})),g===null){if(s)return o&&!p?o(r,De.encoder,m,"key",h):r;g=""}if(ox(g)||an.isBuffer(g)){if(o){var b=p?r:o(r,De.encoder,m,"key",h);return[d(b)+"="+d(o(g,De.encoder,m,"value",h))]}return[d(r)+"="+d(String(g))]}var w=[];if(typeof g>"u")return w;var S;if(i==="comma"&&xt(g))p&&o&&(g=an.maybeMap(g,o)),S=[{value:g.length>0?g.join(",")||null:void 0}];else if(xt(u))S=u;else{var A=Object.keys(g);S=c?A.sort(c):A}for(var C=n&&xt(g)&&g.length===1?r+"[]":r,F=0;F<S.length;++F){var G=S[F],R=typeof G=="object"&&typeof G.value<"u"?G.value:g[G];if(!(a&&R===null)){var E=xt(g)?typeof i=="function"?i(C,G):C:C+(f?"."+G:"["+G+"]");_.set(e,v);var B=au();B.set(Ys,_),lu(w,t(R,E,i,n,s,a,i==="comma"&&p&&xt(g)?null:o,u,c,f,l,h,d,p,m,B))}}return w},ux=function(e){if(!e)return De;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=e.charset||De.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var i=ai.default;if(typeof e.format<"u"){if(!nx.call(ai.formatters,e.format))throw new TypeError("Unknown format option provided.");i=e.format}var n=ai.formatters[i],s=De.filter;return(typeof e.filter=="function"||xt(e.filter))&&(s=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:De.addQueryPrefix,allowDots:typeof e.allowDots>"u"?De.allowDots:!!e.allowDots,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:De.charsetSentinel,delimiter:typeof e.delimiter>"u"?De.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:De.encode,encoder:typeof e.encoder=="function"?e.encoder:De.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:De.encodeValuesOnly,filter:s,format:i,formatter:n,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:De.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:De.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:De.strictNullHandling}},hx=function(t,e){var r=t,i=ux(e),n,s;typeof i.filter=="function"?(s=i.filter,r=s("",r)):xt(i.filter)&&(s=i.filter,n=s);var a=[];if(typeof r!="object"||r===null)return"";var o;e&&e.arrayFormat in ou?o=e.arrayFormat:e&&"indices"in e?o=e.indices?"indices":"repeat":o="indices";var u=ou[o];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c=u==="comma"&&e&&e.commaRoundTrip;n||(n=Object.keys(r)),i.sort&&n.sort(i.sort);for(var f=au(),l=0;l<n.length;++l){var h=n[l];i.skipNulls&&r[h]===null||lu(a,lx(r[h],h,u,c,i.strictNullHandling,i.skipNulls,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,f))}var d=a.join(i.delimiter),p=i.addQueryPrefix===!0?"?":"";return i.charsetSentinel&&(i.charset==="iso-8859-1"?p+="utf8=%26%2310003%3B&":p+="utf8=%E2%9C%93&"),d.length>0?p+d:""},Ar=su,Ks=Object.prototype.hasOwnProperty,cx=Array.isArray,Pe={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Ar.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},fx=function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},hu=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},dx="utf8=%26%2310003%3B",px="utf8=%E2%9C%93",mx=function(e,r){var i={__proto__:null},n=r.ignoreQueryPrefix?e.replace(/^\?/,""):e,s=r.parameterLimit===1/0?void 0:r.parameterLimit,a=n.split(r.delimiter,s),o=-1,u,c=r.charset;if(r.charsetSentinel)for(u=0;u<a.length;++u)a[u].indexOf("utf8=")===0&&(a[u]===px?c="utf-8":a[u]===dx&&(c="iso-8859-1"),o=u,u=a.length);for(u=0;u<a.length;++u)if(u!==o){var f=a[u],l=f.indexOf("]="),h=l===-1?f.indexOf("="):l+1,d,p;h===-1?(d=r.decoder(f,Pe.decoder,c,"key"),p=r.strictNullHandling?null:""):(d=r.decoder(f.slice(0,h),Pe.decoder,c,"key"),p=Ar.maybeMap(hu(f.slice(h+1),r),function(m){return r.decoder(m,Pe.decoder,c,"value")})),p&&r.interpretNumericEntities&&c==="iso-8859-1"&&(p=fx(p)),f.indexOf("[]=")>-1&&(p=cx(p)?[p]:p),Ks.call(i,d)?i[d]=Ar.combine(i[d],p):i[d]=p}return i},gx=function(t,e,r,i){for(var n=i?e:hu(e,r),s=t.length-1;s>=0;--s){var a,o=t[s];if(o==="[]"&&r.parseArrays)a=[].concat(n);else{a=r.plainObjects?Object.create(null):{};var u=o.charAt(0)==="["&&o.charAt(o.length-1)==="]"?o.slice(1,-1):o,c=parseInt(u,10);!r.parseArrays&&u===""?a={0:n}:!isNaN(c)&&o!==u&&String(c)===u&&c>=0&&r.parseArrays&&c<=r.arrayLimit?(a=[],a[c]=n):u!=="__proto__"&&(a[u]=n)}n=a}return n},_x=function(e,r,i,n){if(e){var s=i.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/,o=/(\[[^[\]]*])/g,u=i.depth>0&&a.exec(s),c=u?s.slice(0,u.index):s,f=[];if(c){if(!i.plainObjects&&Ks.call(Object.prototype,c)&&!i.allowPrototypes)return;f.push(c)}for(var l=0;i.depth>0&&(u=o.exec(s))!==null&&l<i.depth;){if(l+=1,!i.plainObjects&&Ks.call(Object.prototype,u[1].slice(1,-1))&&!i.allowPrototypes)return;f.push(u[1])}return u&&f.push("["+s.slice(u.index)+"]"),gx(f,r,i,n)}},vx=function(e){if(!e)return Pe;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=typeof e.charset>"u"?Pe.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?Pe.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:Pe.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:Pe.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:Pe.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Pe.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:Pe.comma,decoder:typeof e.decoder=="function"?e.decoder:Pe.decoder,delimiter:typeof e.delimiter=="string"||Ar.isRegExp(e.delimiter)?e.delimiter:Pe.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:Pe.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:Pe.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:Pe.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:Pe.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Pe.strictNullHandling}},yx=function(t,e){var r=vx(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?Object.create(null):{};for(var i=typeof t=="string"?mx(t,r):t,n=r.plainObjects?Object.create(null):{},s=Object.keys(i),a=0;a<s.length;++a){var o=s[a],u=_x(o,i[o],r,typeof t=="string");n=Ar.merge(n,u,r)}return r.allowSparse===!0?n:Ar.compact(n)},xx=hx,bx=yx,Tx=Ws,wx={formats:Tx,parse:bx,stringify:xx},Sx=Pv;function tt(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var Ax=/^([a-z0-9.+-]+:)/i,Ex=/:[0-9]*$/,Cx=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,Ix=["<",">",'"',"`"," ","\r",`
|
|
37
|
+
`," "],Rx=["{","}","|","\\","^","`"].concat(Ix),Zs=["'"].concat(Rx),cu=["%","/","?",";","#"].concat(Zs),fu=["/","?","#"],Px=255,du=/^[+a-z0-9A-Z_-]{0,63}$/,Mx=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Fx={javascript:!0,"javascript:":!0},Qs={javascript:!0,"javascript:":!0},Er={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},Js=wx;function on(t,e,r){if(t&&typeof t=="object"&&t instanceof tt)return t;var i=new tt;return i.parse(t,e,r),i}tt.prototype.parse=function(t,e,r){if(typeof t!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=i!==-1&&i<t.indexOf("#")?"?":"#",s=t.split(n),a=/\\/g;s[0]=s[0].replace(a,"/"),t=s.join(n);var o=t;if(o=o.trim(),!r&&t.split("#").length===1){var u=Cx.exec(o);if(u)return this.path=o,this.href=o,this.pathname=u[1],u[2]?(this.search=u[2],e?this.query=Js.parse(this.search.substr(1)):this.query=this.search.substr(1)):e&&(this.search="",this.query={}),this}var c=Ax.exec(o);if(c){c=c[0];var f=c.toLowerCase();this.protocol=f,o=o.substr(c.length)}if(r||c||o.match(/^\/\/[^@/]+@[^@/]+/)){var l=o.substr(0,2)==="//";l&&!(c&&Qs[c])&&(o=o.substr(2),this.slashes=!0)}if(!Qs[c]&&(l||c&&!Er[c])){for(var h=-1,d=0;d<fu.length;d++){var p=o.indexOf(fu[d]);p!==-1&&(h===-1||p<h)&&(h=p)}var m,_;h===-1?_=o.lastIndexOf("@"):_=o.lastIndexOf("@",h),_!==-1&&(m=o.slice(0,_),o=o.slice(_+1),this.auth=decodeURIComponent(m)),h=-1;for(var d=0;d<cu.length;d++){var p=o.indexOf(cu[d]);p!==-1&&(h===-1||p<h)&&(h=p)}h===-1&&(h=o.length),this.host=o.slice(0,h),o=o.slice(h),this.parseHost(),this.hostname=this.hostname||"";var g=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!g)for(var y=this.hostname.split(/\./),d=0,v=y.length;d<v;d++){var x=y[d];if(x&&!x.match(du)){for(var T="",b=0,w=x.length;b<w;b++)x.charCodeAt(b)>127?T+="x":T+=x[b];if(!T.match(du)){var S=y.slice(0,d),A=y.slice(d+1),C=x.match(Mx);C&&(S.push(C[1]),A.unshift(C[2])),A.length&&(o="/"+A.join(".")+o),this.hostname=S.join(".");break}}}this.hostname.length>Px?this.hostname="":this.hostname=this.hostname.toLowerCase(),g||(this.hostname=Sx.toASCII(this.hostname));var F=this.port?":"+this.port:"",G=this.hostname||"";this.host=G+F,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),o[0]!=="/"&&(o="/"+o))}if(!Fx[f])for(var d=0,v=Zs.length;d<v;d++){var R=Zs[d];if(o.indexOf(R)!==-1){var E=encodeURIComponent(R);E===R&&(E=escape(R)),o=o.split(R).join(E)}}var B=o.indexOf("#");B!==-1&&(this.hash=o.substr(B),o=o.slice(0,B));var U=o.indexOf("?");if(U!==-1?(this.search=o.substr(U),this.query=o.substr(U+1),e&&(this.query=Js.parse(this.query)),o=o.slice(0,U)):e&&(this.search="",this.query={}),o&&(this.pathname=o),Er[f]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var F=this.pathname||"",I=this.search||"";this.path=F+I}return this.href=this.format(),this};function Ox(t){return typeof t=="string"&&(t=on(t)),t instanceof tt?t.format():tt.prototype.format.call(t)}tt.prototype.format=function(){var t=this.auth||"";t&&(t=encodeURIComponent(t),t=t.replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",i=this.hash||"",n=!1,s="";this.host?n=t+this.host:this.hostname&&(n=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(n+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(s=Js.stringify(this.query));var a=this.search||s&&"?"+s||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||Er[e])&&n!==!1?(n="//"+(n||""),r&&r.charAt(0)!=="/"&&(r="/"+r)):n||(n=""),i&&i.charAt(0)!=="#"&&(i="#"+i),a&&a.charAt(0)!=="?"&&(a="?"+a),r=r.replace(/[?#]/g,function(o){return encodeURIComponent(o)}),a=a.replace("#","%23"),e+n+r+a+i};function Nx(t,e){return on(t,!1,!0).resolve(e)}tt.prototype.resolve=function(t){return this.resolveObject(on(t,!1,!0)).format()},tt.prototype.resolveObject=function(t){if(typeof t=="string"){var e=new tt;e.parse(t,!1,!0),t=e}for(var r=new tt,i=Object.keys(this),n=0;n<i.length;n++){var s=i[n];r[s]=this[s]}if(r.hash=t.hash,t.href==="")return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var a=Object.keys(t),o=0;o<a.length;o++){var u=a[o];u!=="protocol"&&(r[u]=t[u])}return Er[r.protocol]&&r.hostname&&!r.pathname&&(r.pathname="/",r.path=r.pathname),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!Er[t.protocol]){for(var c=Object.keys(t),f=0;f<c.length;f++){var l=c[f];r[l]=t[l]}return r.href=r.format(),r}if(r.protocol=t.protocol,!t.host&&!Qs[t.protocol]){for(var v=(t.pathname||"").split("/");v.length&&!(t.host=v.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),v[0]!==""&&v.unshift(""),v.length<2&&v.unshift(""),r.pathname=v.join("/")}else r.pathname=t.pathname;if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var h=r.pathname||"",d=r.search||"";r.path=h+d}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var p=r.pathname&&r.pathname.charAt(0)==="/",m=t.host||t.pathname&&t.pathname.charAt(0)==="/",_=m||p||r.host&&t.pathname,g=_,y=r.pathname&&r.pathname.split("/")||[],v=t.pathname&&t.pathname.split("/")||[],x=r.protocol&&!Er[r.protocol];if(x&&(r.hostname="",r.port=null,r.host&&(y[0]===""?y[0]=r.host:y.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(v[0]===""?v[0]=t.host:v.unshift(t.host)),t.host=null),_=_&&(v[0]===""||y[0]==="")),m)r.host=t.host||t.host===""?t.host:r.host,r.hostname=t.hostname||t.hostname===""?t.hostname:r.hostname,r.search=t.search,r.query=t.query,y=v;else if(v.length)y||(y=[]),y.pop(),y=y.concat(v),r.search=t.search,r.query=t.query;else if(t.search!=null){if(x){r.host=y.shift(),r.hostname=r.host;var T=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;T&&(r.auth=T.shift(),r.hostname=T.shift(),r.host=r.hostname)}return r.search=t.search,r.query=t.query,(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!y.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var b=y.slice(-1)[0],w=(r.host||t.host||y.length>1)&&(b==="."||b==="..")||b==="",S=0,A=y.length;A>=0;A--)b=y[A],b==="."?y.splice(A,1):b===".."?(y.splice(A,1),S++):S&&(y.splice(A,1),S--);if(!_&&!g)for(;S--;S)y.unshift("..");_&&y[0]!==""&&(!y[0]||y[0].charAt(0)!=="/")&&y.unshift(""),w&&y.join("/").substr(-1)!=="/"&&y.push("");var C=y[0]===""||y[0]&&y[0].charAt(0)==="/";if(x){r.hostname=C?"":y.length?y.shift():"",r.host=r.hostname;var T=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;T&&(r.auth=T.shift(),r.hostname=T.shift(),r.host=r.hostname)}return _=_||r.host&&y.length,_&&!C&&y.unshift(""),y.length>0?r.pathname=y.join("/"):(r.pathname=null,r.path=null),(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},tt.prototype.parseHost=function(){var t=this.host,e=Ex.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var kx=on,Dx=Nx,Lx=Ox;const Bx={parse:kx,format:Lx,resolve:Dx};function rt(t){if(typeof t!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(t)}`)}function oi(t){return t.split("?")[0].split("#")[0]}function Ux(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function $x(t,e,r){return t.replace(new RegExp(Ux(e),"g"),r)}function Gx(t,e){let r="",i=0,n=-1,s=0,a=-1;for(let o=0;o<=t.length;++o){if(o<t.length)a=t.charCodeAt(o);else{if(a===47)break;a=47}if(a===47){if(!(n===o-1||s===1))if(n!==o-1&&s===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){const u=r.lastIndexOf("/");if(u!==r.length-1){u===-1?(r="",i=0):(r=r.slice(0,u),i=r.length-1-r.lastIndexOf("/")),n=o,s=0;continue}}else if(r.length===2||r.length===1){r="",i=0,n=o,s=0;continue}}e&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+=`/${t.slice(n+1,o)}`:r=t.slice(n+1,o),i=o-n-1;n=o,s=0}else a===46&&s!==-1?++s:s=-1}return r}const pu={toPosix(t){return $x(t,"\\","/")},isUrl(t){return/^https?:/.test(this.toPosix(t))},isDataUrl(t){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(t)},hasProtocol(t){return/^[^/:]+:\//.test(this.toPosix(t))},getProtocol(t){rt(t),t=this.toPosix(t);let e="";const r=/^file:\/\/\//.exec(t),i=/^[^/:]+:\/\//.exec(t),n=/^[^/:]+:\//.exec(t);if(r||i||n){const s=(r==null?void 0:r[0])||(i==null?void 0:i[0])||(n==null?void 0:n[0]);e=s,t=t.slice(s.length)}return e},toAbsolute(t,e,r){if(this.isDataUrl(t))return t;const i=oi(this.toPosix(e??q.ADAPTER.getBaseUrl())),n=oi(this.toPosix(r??this.rootname(i)));return rt(t),t=this.toPosix(t),t.startsWith("/")?pu.join(n,t.slice(1)):this.isAbsolute(t)?t:this.join(i,t)},normalize(t){if(t=this.toPosix(t),rt(t),t.length===0)return".";let e="";const r=t.startsWith("/");this.hasProtocol(t)&&(e=this.rootname(t),t=t.slice(e.length));const i=t.endsWith("/");return t=Gx(t,!1),t.length>0&&i&&(t+="/"),r?`/${t}`:e+t},isAbsolute(t){return rt(t),t=this.toPosix(t),this.hasProtocol(t)?!0:t.startsWith("/")},join(...t){if(t.length===0)return".";let e;for(let r=0;r<t.length;++r){const i=t[r];if(rt(i),i.length>0)if(e===void 0)e=i;else{const n=t[r-1]??"";this.extname(n)?e+=`/../${i}`:e+=`/${i}`}}return e===void 0?".":this.normalize(e)},dirname(t){if(rt(t),t.length===0)return".";t=this.toPosix(t);let e=t.charCodeAt(0);const r=e===47;let i=-1,n=!0;const s=this.getProtocol(t),a=t;t=t.slice(s.length);for(let o=t.length-1;o>=1;--o)if(e=t.charCodeAt(o),e===47){if(!n){i=o;break}}else n=!1;return i===-1?r?"/":this.isUrl(a)?s+t:s:r&&i===1?"//":s+t.slice(0,i)},rootname(t){rt(t),t=this.toPosix(t);let e="";if(t.startsWith("/")?e="/":e=this.getProtocol(t),this.isUrl(t)){const r=t.indexOf("/",e.length);r!==-1?e=t.slice(0,r):e=t,e.endsWith("/")||(e+="/")}return e},basename(t,e){rt(t),e&&rt(e),t=oi(this.toPosix(t));let r=0,i=-1,n=!0,s;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";let a=e.length-1,o=-1;for(s=t.length-1;s>=0;--s){const u=t.charCodeAt(s);if(u===47){if(!n){r=s+1;break}}else o===-1&&(n=!1,o=s+1),a>=0&&(u===e.charCodeAt(a)?--a===-1&&(i=s):(a=-1,i=o))}return r===i?i=o:i===-1&&(i=t.length),t.slice(r,i)}for(s=t.length-1;s>=0;--s)if(t.charCodeAt(s)===47){if(!n){r=s+1;break}}else i===-1&&(n=!1,i=s+1);return i===-1?"":t.slice(r,i)},extname(t){rt(t),t=oi(this.toPosix(t));let e=-1,r=0,i=-1,n=!0,s=0;for(let a=t.length-1;a>=0;--a){const o=t.charCodeAt(a);if(o===47){if(!n){r=a+1;break}continue}i===-1&&(n=!1,i=a+1),o===46?e===-1?e=a:s!==1&&(s=1):e!==-1&&(s=-1)}return e===-1||i===-1||s===0||s===1&&e===i-1&&e===r+1?"":t.slice(e,i)},parse(t){rt(t);const e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;t=oi(this.toPosix(t));let r=t.charCodeAt(0);const i=this.isAbsolute(t);let n;e.root=this.rootname(t),i||this.hasProtocol(t)?n=1:n=0;let s=-1,a=0,o=-1,u=!0,c=t.length-1,f=0;for(;c>=n;--c){if(r=t.charCodeAt(c),r===47){if(!u){a=c+1;break}continue}o===-1&&(u=!1,o=c+1),r===46?s===-1?s=c:f!==1&&(f=1):s!==-1&&(f=-1)}return s===-1||o===-1||f===0||f===1&&s===o-1&&s===a+1?o!==-1&&(a===0&&i?e.base=e.name=t.slice(1,o):e.base=e.name=t.slice(a,o)):(a===0&&i?(e.name=t.slice(1,s),e.base=t.slice(1,o)):(e.name=t.slice(a,s),e.base=t.slice(a,o)),e.ext=t.slice(s,o)),e.dir=this.dirname(t),e},sep:"/",delimiter:":"},mu={};function ne(t,e,r=3){if(mu[e])return;let i=new Error().stack;typeof i>"u"?console.warn("PixiJS Deprecation Warning: ",`${e}
|
|
38
|
+
Deprecated since v${t}`):(i=i.split(`
|
|
39
39
|
`).splice(r).join(`
|
|
40
40
|
`),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${e}
|
|
41
|
-
Deprecated since v${t}`),console.warn(
|
|
42
|
-
Deprecated since v${t}`),console.warn(n))),qd[e]=!0}let fl;function XE(){return typeof fl>"u"&&(fl=function(){var r;const e={stencil:!0,failIfMajorPerformanceCaveat:Ie.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!Ie.ADAPTER.getWebGLRenderingContext())return!1;const n=Ie.ADAPTER.createCanvas();let i=n.getContext("webgl",e)||n.getContext("experimental-webgl",e);const a=!!((r=i==null?void 0:i.getContextAttributes())!=null&&r.stencil);if(i){const u=i.getExtension("WEBGL_lose_context");u&&u.loseContext()}return i=null,a}catch{return!1}}()),fl}var jE={grad:.9,turn:360,rad:360/(2*Math.PI)},Wr=function(t){return typeof t=="string"?t.length>0:typeof t=="number"},St=function(t,e,r){return e===void 0&&(e=0),r===void 0&&(r=Math.pow(10,e)),Math.round(r*t)/r+0},ur=function(t,e,r){return e===void 0&&(e=0),r===void 0&&(r=1),t>r?r:t>e?t:e},Yd=function(t){return(t=isFinite(t)?t%360:0)>0?t:t+360},Kd=function(t){return{r:ur(t.r,0,255),g:ur(t.g,0,255),b:ur(t.b,0,255),a:ur(t.a)}},dl=function(t){return{r:St(t.r),g:St(t.g),b:St(t.b),a:St(t.a,3)}},WE=/^#([0-9a-f]{3,8})$/i,Ma=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},Zd=function(t){var e=t.r,r=t.g,n=t.b,i=t.a,a=Math.max(e,r,n),u=a-Math.min(e,r,n),l=u?a===e?(r-n)/u:a===r?2+(n-e)/u:4+(e-r)/u:0;return{h:60*(l<0?l+6:l),s:a?u/a*100:0,v:a/255*100,a:i}},Qd=function(t){var e=t.h,r=t.s,n=t.v,i=t.a;e=e/360*6,r/=100,n/=100;var a=Math.floor(e),u=n*(1-r),l=n*(1-(e-a)*r),h=n*(1-(1-e+a)*r),p=a%6;return{r:255*[n,l,u,u,h,n][p],g:255*[h,n,n,l,u,u][p],b:255*[u,u,h,n,n,l][p],a:i}},Jd=function(t){return{h:Yd(t.h),s:ur(t.s,0,100),l:ur(t.l,0,100),a:ur(t.a)}},ep=function(t){return{h:St(t.h),s:St(t.s),l:St(t.l),a:St(t.a,3)}},tp=function(t){return Qd((r=(e=t).s,{h:e.h,s:(r*=((n=e.l)<50?n:100-n)/100)>0?2*r/(n+r)*100:0,v:n+r,a:e.a}));var e,r,n},xs=function(t){return{h:(e=Zd(t)).h,s:(i=(200-(r=e.s))*(n=e.v)/100)>0&&i<200?r*n/100/(i<=100?i:200-i)*100:0,l:i/2,a:e.a};var e,r,n,i},qE=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,YE=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,KE=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ZE=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,pl={string:[[function(t){var e=WE.exec(t);return e?(t=e[1]).length<=4?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?St(parseInt(t[3]+t[3],16)/255,2):1}:t.length===6||t.length===8?{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16),a:t.length===8?St(parseInt(t.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(t){var e=KE.exec(t)||ZE.exec(t);return e?e[2]!==e[4]||e[4]!==e[6]?null:Kd({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(t){var e=qE.exec(t)||YE.exec(t);if(!e)return null;var r,n,i=Jd({h:(r=e[1],n=e[2],n===void 0&&(n="deg"),Number(r)*(jE[n]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return tp(i)},"hsl"]],object:[[function(t){var e=t.r,r=t.g,n=t.b,i=t.a,a=i===void 0?1:i;return Wr(e)&&Wr(r)&&Wr(n)?Kd({r:Number(e),g:Number(r),b:Number(n),a:Number(a)}):null},"rgb"],[function(t){var e=t.h,r=t.s,n=t.l,i=t.a,a=i===void 0?1:i;if(!Wr(e)||!Wr(r)||!Wr(n))return null;var u=Jd({h:Number(e),s:Number(r),l:Number(n),a:Number(a)});return tp(u)},"hsl"],[function(t){var e=t.h,r=t.s,n=t.v,i=t.a,a=i===void 0?1:i;if(!Wr(e)||!Wr(r)||!Wr(n))return null;var u=function(l){return{h:Yd(l.h),s:ur(l.s,0,100),v:ur(l.v,0,100),a:ur(l.a)}}({h:Number(e),s:Number(r),v:Number(n),a:Number(a)});return Qd(u)},"hsv"]]},rp=function(t,e){for(var r=0;r<e.length;r++){var n=e[r][0](t);if(n)return[n,e[r][1]]}return[null,void 0]},QE=function(t){return typeof t=="string"?rp(t.trim(),pl.string):typeof t=="object"&&t!==null?rp(t,pl.object):[null,void 0]},gl=function(t,e){var r=xs(t);return{h:r.h,s:ur(r.s+100*e,0,100),l:r.l,a:r.a}},ml=function(t){return(299*t.r+587*t.g+114*t.b)/1e3/255},np=function(t,e){var r=xs(t);return{h:r.h,s:r.s,l:ur(r.l+100*e,0,100),a:r.a}},_l=function(){function t(e){this.parsed=QE(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return t.prototype.isValid=function(){return this.parsed!==null},t.prototype.brightness=function(){return St(ml(this.rgba),2)},t.prototype.isDark=function(){return ml(this.rgba)<.5},t.prototype.isLight=function(){return ml(this.rgba)>=.5},t.prototype.toHex=function(){return e=dl(this.rgba),r=e.r,n=e.g,i=e.b,u=(a=e.a)<1?Ma(St(255*a)):"","#"+Ma(r)+Ma(n)+Ma(i)+u;var e,r,n,i,a,u},t.prototype.toRgb=function(){return dl(this.rgba)},t.prototype.toRgbString=function(){return e=dl(this.rgba),r=e.r,n=e.g,i=e.b,(a=e.a)<1?"rgba("+r+", "+n+", "+i+", "+a+")":"rgb("+r+", "+n+", "+i+")";var e,r,n,i,a},t.prototype.toHsl=function(){return ep(xs(this.rgba))},t.prototype.toHslString=function(){return e=ep(xs(this.rgba)),r=e.h,n=e.s,i=e.l,(a=e.a)<1?"hsla("+r+", "+n+"%, "+i+"%, "+a+")":"hsl("+r+", "+n+"%, "+i+"%)";var e,r,n,i,a},t.prototype.toHsv=function(){return e=Zd(this.rgba),{h:St(e.h),s:St(e.s),v:St(e.v),a:St(e.a,3)};var e},t.prototype.invert=function(){return $r({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},t.prototype.saturate=function(e){return e===void 0&&(e=.1),$r(gl(this.rgba,e))},t.prototype.desaturate=function(e){return e===void 0&&(e=.1),$r(gl(this.rgba,-e))},t.prototype.grayscale=function(){return $r(gl(this.rgba,-1))},t.prototype.lighten=function(e){return e===void 0&&(e=.1),$r(np(this.rgba,e))},t.prototype.darken=function(e){return e===void 0&&(e=.1),$r(np(this.rgba,-e))},t.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},t.prototype.alpha=function(e){return typeof e=="number"?$r({r:(r=this.rgba).r,g:r.g,b:r.b,a:e}):St(this.rgba.a,3);var r},t.prototype.hue=function(e){var r=xs(this.rgba);return typeof e=="number"?$r({h:e,s:r.s,l:r.l,a:r.a}):St(r.h)},t.prototype.isEqual=function(e){return this.toHex()===$r(e).toHex()},t}(),$r=function(t){return t instanceof _l?t:new _l(t)},ip=[],JE=function(t){t.forEach(function(e){ip.indexOf(e)<0&&(e(_l,pl),ip.push(e))})};function eC(t,e){var r={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},n={};for(var i in r)n[r[i]]=i;var a={};t.prototype.toName=function(u){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var l,h,p=n[this.toHex()];if(p)return p;if(u!=null&&u.closest){var m=this.toRgb(),c=1/0,d="black";if(!a.length)for(var g in r)a[g]=new t(r[g]).toRgb();for(var v in r){var y=(l=m,h=a[v],Math.pow(l.r-h.r,2)+Math.pow(l.g-h.g,2)+Math.pow(l.b-h.b,2));y<c&&(c=y,d=v)}return d}},e.string.push([function(u){var l=u.toLowerCase(),h=l==="transparent"?"#0000":r[l];return h?new t(h).toRgb():null},"name"])}JE([eC]);const Si=class{constructor(t=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=t}get red(){return this._components[0]}get green(){return this._components[1]}get blue(){return this._components[2]}get alpha(){return this._components[3]}setValue(t){return this.value=t,this}set value(t){if(t instanceof Si)this._value=this.cloneSource(t._value),this._int=t._int,this._components.set(t._components);else{if(t===null)throw new Error("Cannot set PIXI.Color#value to null");(this._value===null||!this.isSourceEqual(this._value,t))&&(this.normalize(t),this._value=this.cloneSource(t))}}get value(){return this._value}cloneSource(t){return typeof t=="string"||typeof t=="number"||t instanceof Number||t===null?t:Array.isArray(t)||ArrayBuffer.isView(t)?t.slice(0):typeof t=="object"&&t!==null?{...t}:t}isSourceEqual(t,e){const r=typeof t;if(r!==typeof e)return!1;if(r==="number"||r==="string"||t instanceof Number)return t===e;if(Array.isArray(t)&&Array.isArray(e)||ArrayBuffer.isView(t)&&ArrayBuffer.isView(e))return t.length!==e.length?!1:t.every((i,a)=>i===e[a]);if(t!==null&&e!==null){const i=Object.keys(t),a=Object.keys(e);return i.length!==a.length?!1:i.every(u=>t[u]===e[u])}return t===e}toRgba(){const[t,e,r,n]=this._components;return{r:t,g:e,b:r,a:n}}toRgb(){const[t,e,r]=this._components;return{r:t,g:e,b:r}}toRgbaString(){const[t,e,r]=this.toUint8RgbArray();return`rgba(${t},${e},${r},${this.alpha})`}toUint8RgbArray(t){const[e,r,n]=this._components;return t=t??[],t[0]=Math.round(e*255),t[1]=Math.round(r*255),t[2]=Math.round(n*255),t}toRgbArray(t){t=t??[];const[e,r,n]=this._components;return t[0]=e,t[1]=r,t[2]=n,t}toNumber(){return this._int}toLittleEndianNumber(){const t=this._int;return(t>>16)+(t&65280)+((t&255)<<16)}multiply(t){const[e,r,n,i]=Si.temp.setValue(t)._components;return this._components[0]*=e,this._components[1]*=r,this._components[2]*=n,this._components[3]*=i,this.refreshInt(),this._value=null,this}premultiply(t,e=!0){return e&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this.refreshInt(),this._value=null,this}toPremultiplied(t){if(t===1)return(t*255<<24)+this._int;if(t===0)return 0;let e=this._int>>16&255,r=this._int>>8&255,n=this._int&255;return e=e*t+.5|0,r=r*t+.5|0,n=n*t+.5|0,(t*255<<24)+(e<<16)+(r<<8)+n}toHex(){const t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){const e=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-e.length)+e}setAlpha(t){return this._components[3]=this._clamp(t),this}round(t){const[e,r,n]=this._components;return this._components[0]=Math.round(e*t)/t,this._components[1]=Math.round(r*t)/t,this._components[2]=Math.round(n*t)/t,this.refreshInt(),this._value=null,this}toArray(t){t=t??[];const[e,r,n,i]=this._components;return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}normalize(t){let e;if((typeof t=="number"||t instanceof Number)&&t>=0&&t<=16777215){const r=t;e=[(r>>16&255)/255,(r>>8&255)/255,(r&255)/255,1]}else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4){t=this._clamp(t);const[r,n,i,a=1]=t;e=[r,n,i,a]}else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4){t=this._clamp(t,0,255);const[r,n,i,a=255]=t;e=[r/255,n/255,i/255,a/255]}else if(typeof t=="string"||typeof t=="object"){if(typeof t=="string"){const n=Si.HEX_PATTERN.exec(t);n&&(t=`#${n[2]}`)}const r=$r(t);if(r.isValid()){const{r:n,g:i,b:a,a:u}=r.rgba;e=[n/255,i/255,a/255,u]}}if(e)this._components.set(e),this.refreshInt();else throw new Error(`Unable to convert color ${t}`)}refreshInt(){this._clamp(this._components);const[t,e,r]=this._components;this._int=(t*255<<16)+(e*255<<8)+(r*255|0)}_clamp(t,e=0,r=1){return typeof t=="number"?Math.min(Math.max(t,e),r):(t.forEach((n,i)=>{t[i]=Math.min(Math.max(n,e),r)}),t)}};let Ot=Si;Ot.shared=new Si,Ot.temp=new Si,Ot.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;function Oa(t,e=[]){return ke("7.2.0","utils.hex2rgb is deprecated, use Color#toRgbArray instead"),Ot.shared.setValue(t).toRgbArray(e)}function vl(t){return ke("7.2.0","utils.rgb2hex is deprecated, use Color#toNumber instead"),Ot.shared.setValue(t).toNumber()}function tC(){const t=[],e=[];for(let n=0;n<32;n++)t[n]=n,e[n]=n;t[de.NORMAL_NPM]=de.NORMAL,t[de.ADD_NPM]=de.ADD,t[de.SCREEN_NPM]=de.SCREEN,e[de.NORMAL]=de.NORMAL_NPM,e[de.ADD]=de.ADD_NPM,e[de.SCREEN]=de.SCREEN_NPM;const r=[];return r.push(e),r.push(t),r}const rC=tC();function sp(t){if(t.BYTES_PER_ELEMENT===4)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(t.BYTES_PER_ELEMENT===2){if(t instanceof Uint16Array)return"Uint16Array"}else if(t.BYTES_PER_ELEMENT===1&&t instanceof Uint8Array)return"Uint8Array";return null}function Fa(t){return t+=t===0?1:0,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t+1}function ap(t){return!(t&t-1)&&!!t}function op(t){let e=(t>65535?1:0)<<4;t>>>=e;let r=(t>255?1:0)<<3;return t>>>=r,e|=r,r=(t>15?1:0)<<2,t>>>=r,e|=r,r=(t>3?1:0)<<1,t>>>=r,e|=r,e|t>>1}function Na(t,e,r){const n=t.length;let i;if(e>=n||r===0)return;r=e+r>n?n-e:r;const a=n-r;for(i=e;i<a;++i)t[i]=t[i+r];t.length=a}let nC=0;function bs(){return++nC}const up={},Gr=Object.create(null),gn=Object.create(null);let La;function iC(t,e=globalThis.location){if(t.startsWith("data:"))return"";e=e||globalThis.location,La||(La=document.createElement("a")),La.href=t;const r=VE.parse(La.href),n=!r.port&&e.port===""||r.port===e.port;return r.hostname!==e.hostname||!n||r.protocol!==e.protocol?"anonymous":""}function lp(t,e=1){var n;const r=(n=Ie.RETINA_PREFIX)==null?void 0:n.exec(t);return r?parseFloat(r[1]):e}var Fe=(t=>(t.Renderer="renderer",t.Application="application",t.RendererSystem="renderer-webgl-system",t.RendererPlugin="renderer-webgl-plugin",t.CanvasRendererSystem="renderer-canvas-system",t.CanvasRendererPlugin="renderer-canvas-plugin",t.Asset="asset",t.LoadParser="load-parser",t.ResolveParser="resolve-parser",t.CacheParser="cache-parser",t.DetectionParser="detection-parser",t))(Fe||{});const yl=t=>{if(typeof t=="function"||typeof t=="object"&&t.extension){if(!t.extension)throw new Error("Extension class must have an extension object");t={...typeof t.extension!="object"?{type:t.extension}:t.extension,ref:t}}if(typeof t=="object")t={...t};else throw new Error("Invalid extension type");return typeof t.type=="string"&&(t.type=[t.type]),t},cp=(t,e)=>yl(t).priority??e,qe={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...t){return t.map(yl).forEach(e=>{e.type.forEach(r=>{var n,i;return(i=(n=this._removeHandlers)[r])==null?void 0:i.call(n,e)})}),this},add(...t){return t.map(yl).forEach(e=>{e.type.forEach(r=>{const n=this._addHandlers,i=this._queue;n[r]?n[r](e):(i[r]=i[r]||[],i[r].push(e))})}),this},handle(t,e,r){const n=this._addHandlers,i=this._removeHandlers;if(n[t]||i[t])throw new Error(`Extension type ${t} already has a handler`);n[t]=e,i[t]=r;const a=this._queue;return a[t]&&(a[t].forEach(u=>e(u)),delete a[t]),this},handleByMap(t,e){return this.handle(t,r=>{e[r.name]=r.ref},r=>{delete e[r.name]})},handleByList(t,e,r=-1){return this.handle(t,n=>{e.includes(n.ref)||(e.push(n.ref),e.sort((i,a)=>cp(a,r)-cp(i,r)))},n=>{const i=e.indexOf(n.ref);i!==-1&&e.splice(i,1)})}};class sC{constructor(e){typeof e=="number"?this.rawBinaryData=new ArrayBuffer(e):e instanceof Uint8Array?this.rawBinaryData=e.buffer:this.rawBinaryData=e,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get uint16View(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}view(e){return this[`${e}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null}static sizeOf(e){switch(e){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${e} isn't a valid view type`)}}}const aC=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
|
|
43
|
-
`);function
|
|
44
|
-
else `),r<t-1&&(e+=`if(test == ${r}.0){}`);return e}function uC(t,e){if(t===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const r=e.createShader(e.FRAGMENT_SHADER);for(;;){const n=aC.replace(/%forloop%/gi,oC(t));if(e.shaderSource(r,n),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS))t=t/2|0;else break}return t}const xl=0,bl=1,Tl=2,wl=3,Sl=4,Al=5;let ka=class q_{constructor(){this.data=0,this.blendMode=de.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<xl)}set blend(e){!!(this.data&1<<xl)!==e&&(this.data^=1<<xl)}get offsets(){return!!(this.data&1<<bl)}set offsets(e){!!(this.data&1<<bl)!==e&&(this.data^=1<<bl)}get culling(){return!!(this.data&1<<Tl)}set culling(e){!!(this.data&1<<Tl)!==e&&(this.data^=1<<Tl)}get depthTest(){return!!(this.data&1<<wl)}set depthTest(e){!!(this.data&1<<wl)!==e&&(this.data^=1<<wl)}get depthMask(){return!!(this.data&1<<Al)}set depthMask(e){!!(this.data&1<<Al)!==e&&(this.data^=1<<Al)}get clockwiseFrontFace(){return!!(this.data&1<<Sl)}set clockwiseFrontFace(e){!!(this.data&1<<Sl)!==e&&(this.data^=1<<Sl)}get blendMode(){return this._blendMode}set blendMode(e){this.blend=e!==de.NONE,this._blendMode=e}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){this.offsets=!!e,this._polygonOffset=e}toString(){return`[@pixi/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const e=new q_;return e.depthTest=!1,e.blend=!0,e}};const El=[];function hp(t,e){if(!t)return null;let r="";if(typeof t=="string"){const n=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);n&&(r=n[1].toLowerCase())}for(let n=El.length-1;n>=0;--n){const i=El[n];if(i.test&&i.test(t,r))return new i(t,e)}throw new Error("Unrecognized source type to auto-detect Resource")}class yr{constructor(e){this.items=[],this._name=e,this._aliasCount=0}emit(e,r,n,i,a,u,l,h){if(arguments.length>8)throw new Error("max arguments reached");const{name:p,items:m}=this;this._aliasCount++;for(let c=0,d=m.length;c<d;c++)m[c][p](e,r,n,i,a,u,l,h);return m===this.items&&this._aliasCount--,this}ensureNonAliasedItems(){this._aliasCount>0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))}add(e){return e[this._name]&&(this.ensureNonAliasedItems(),this.remove(e),this.items.push(e)),this}remove(e){const r=this.items.indexOf(e);return r!==-1&&(this.ensureNonAliasedItems(),this.items.splice(r,1)),this}contains(e){return this.items.includes(e)}removeAll(){return this.ensureNonAliasedItems(),this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return this.items.length===0}get name(){return this._name}}Object.defineProperties(yr.prototype,{dispatch:{value:yr.prototype.emit},run:{value:yr.prototype.emit}});class Ts{constructor(e=0,r=0){this._width=e,this._height=r,this.destroyed=!1,this.internal=!1,this.onResize=new yr("setRealSize"),this.onUpdate=new yr("update"),this.onError=new yr("onError")}bind(e){this.onResize.add(e),this.onUpdate.add(e),this.onError.add(e),(this._width||this._height)&&this.onResize.emit(this._width,this._height)}unbind(e){this.onResize.remove(e),this.onUpdate.remove(e),this.onError.remove(e)}resize(e,r){(e!==this._width||r!==this._height)&&(this._width=e,this._height=r,this.onResize.emit(e,r))}get valid(){return!!this._width&&!!this._height}update(){this.destroyed||this.onUpdate.emit()}load(){return Promise.resolve(this)}get width(){return this._width}get height(){return this._height}style(e,r,n){return!1}dispose(){}destroy(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)}static test(e,r){return!1}}class Cl extends Ts{constructor(e,r){const{width:n,height:i}=r||{};if(!n||!i)throw new Error("BufferResource width or height invalid");super(n,i),this.data=e}upload(e,r,n){const i=e.gl;i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.alphaMode===hn.UNPACK);const a=r.realWidth,u=r.realHeight;return n.width===a&&n.height===u?i.texSubImage2D(r.target,0,0,0,a,u,r.format,n.type,this.data):(n.width=a,n.height=u,i.texImage2D(r.target,0,n.internalFormat,a,u,0,r.format,n.type,this.data)),!0}dispose(){this.data=null}static test(e){return e instanceof Float32Array||e instanceof Uint8Array||e instanceof Uint32Array}}const lC={scaleMode:kr.NEAREST,format:Z.RGBA,alphaMode:hn.NPM},Ai=class extends ma{constructor(t=null,e=null){super(),e=Object.assign({},Ai.defaultOptions,e);const{alphaMode:r,mipmap:n,anisotropicLevel:i,scaleMode:a,width:u,height:l,wrapMode:h,format:p,type:m,target:c,resolution:d,resourceOptions:g}=e;t&&!(t instanceof Ts)&&(t=hp(t,g),t.internal=!0),this.resolution=d||Ie.RESOLUTION,this.width=Math.round((u||0)*this.resolution)/this.resolution,this.height=Math.round((l||0)*this.resolution)/this.resolution,this._mipmap=n,this.anisotropicLevel=i,this._wrapMode=h,this._scaleMode=a,this.format=p,this.type=m,this.target=c,this.alphaMode=r,this.uid=bs(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=u>0&&l>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this._batchLocation=0,this.parentTextureArray=null,this.setResource(t)}get realWidth(){return Math.round(this.width*this.resolution)}get realHeight(){return Math.round(this.height*this.resolution)}get mipmap(){return this._mipmap}set mipmap(t){this._mipmap!==t&&(this._mipmap=t,this.dirtyStyleId++)}get scaleMode(){return this._scaleMode}set scaleMode(t){this._scaleMode!==t&&(this._scaleMode=t,this.dirtyStyleId++)}get wrapMode(){return this._wrapMode}set wrapMode(t){this._wrapMode!==t&&(this._wrapMode=t,this.dirtyStyleId++)}setStyle(t,e){let r;return t!==void 0&&t!==this.scaleMode&&(this.scaleMode=t,r=!0),e!==void 0&&e!==this.mipmap&&(this.mipmap=e,r=!0),r&&this.dirtyStyleId++,this}setSize(t,e,r){return r=r||this.resolution,this.setRealSize(t*r,e*r,r)}setRealSize(t,e,r){return this.resolution=r||this.resolution,this.width=Math.round(t)/this.resolution,this.height=Math.round(e)/this.resolution,this._refreshPOT(),this.update(),this}_refreshPOT(){this.isPowerOfTwo=ap(this.realWidth)&&ap(this.realHeight)}setResolution(t){const e=this.resolution;return e===t?this:(this.resolution=t,this.valid&&(this.width=Math.round(this.width*e)/t,this.height=Math.round(this.height*e)/t,this.emit("update",this)),this._refreshPOT(),this)}setResource(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this}update(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))}onError(t){this.emit("error",this,t)}destroy(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete gn[this.cacheId],delete Gr[this.cacheId],this.cacheId=null),this.dispose(),Ai.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0}dispose(){this.emit("dispose",this)}castToBaseTexture(){return this}static from(t,e,r=Ie.STRICT_TEXTURE_CACHE){const n=typeof t=="string";let i=null;if(n)i=t;else{if(!t._pixiId){const u=(e==null?void 0:e.pixiIdPrefix)||"pixiid";t._pixiId=`${u}_${bs()}`}i=t._pixiId}let a=gn[i];if(n&&r&&!a)throw new Error(`The cacheId "${i}" does not exist in BaseTextureCache.`);return a||(a=new Ai(t,e),a.cacheId=i,Ai.addToCache(a,i)),a}static fromBuffer(t,e,r,n){t=t||new Float32Array(e*r*4);const i=new Cl(t,{width:e,height:r}),a=t instanceof Float32Array?Ge.FLOAT:Ge.UNSIGNED_BYTE;return new Ai(i,Object.assign({},lC,n||{width:e,height:r,type:a}))}static addToCache(t,e){e&&(t.textureCacheIds.includes(e)||t.textureCacheIds.push(e),gn[e]&&gn[e]!==t&&console.warn(`BaseTexture added to the cache with an id [${e}] that already had an entry`),gn[e]=t)}static removeFromCache(t){if(typeof t=="string"){const e=gn[t];if(e){const r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete gn[t],e}}else if(t!=null&&t.textureCacheIds){for(let e=0;e<t.textureCacheIds.length;++e)delete gn[t.textureCacheIds[e]];return t.textureCacheIds.length=0,t}return null}};let ze=Ai;ze.defaultOptions={mipmap:On.POW2,anisotropicLevel:0,scaleMode:kr.LINEAR,wrapMode:hs.CLAMP,alphaMode:hn.UNPACK,target:fi.TEXTURE_2D,format:Z.RGBA,type:Ge.UNSIGNED_BYTE},ze._globalBatch=0;class Il{constructor(){this.texArray=null,this.blend=0,this.type=cn.TRIANGLES,this.start=0,this.size=0,this.data=null}}let cC=0;class Lt{constructor(e,r=!0,n=!1){this.data=e||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=n,this.static=r,this.id=cC++,this.disposeRunner=new yr("disposeBuffer")}update(e){e instanceof Array&&(e=new Float32Array(e)),this.data=e||this.data,this._updateID++}dispose(){this.disposeRunner.emit(this,!1)}destroy(){this.dispose(),this.data=null}set index(e){this.type=e?Dr.ELEMENT_ARRAY_BUFFER:Dr.ARRAY_BUFFER}get index(){return this.type===Dr.ELEMENT_ARRAY_BUFFER}static from(e){return e instanceof Array&&(e=new Float32Array(e)),new Lt(e)}}class Da{constructor(e,r=0,n=!1,i=Ge.FLOAT,a,u,l,h=1){this.buffer=e,this.size=r,this.normalized=n,this.type=i,this.stride=a,this.start=u,this.instance=l,this.divisor=h}destroy(){this.buffer=null}static from(e,r,n,i,a){return new Da(e,r,n,i,a)}}const hC={Float32Array,Uint32Array,Int32Array,Uint8Array};function fC(t,e){let r=0,n=0;const i={};for(let h=0;h<t.length;h++)n+=e[h],r+=t[h].length;const a=new ArrayBuffer(r*4);let u=null,l=0;for(let h=0;h<t.length;h++){const p=e[h],m=t[h],c=sp(m);i[c]||(i[c]=new hC[c](a)),u=i[c];for(let d=0;d<m.length;d++){const g=(d/p|0)*n+l,v=d%p;u[g+v]=m[d]}l+=p}return new Float32Array(a)}const fp={5126:4,5123:2,5121:1};let dC=0;const pC={Float32Array,Uint32Array,Int32Array,Uint8Array,Uint16Array};class Ei{constructor(e=[],r={}){this.buffers=e,this.indexBuffer=null,this.attributes=r,this.glVertexArrayObjects={},this.id=dC++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new yr("disposeGeometry"),this.refCount=0}addAttribute(e,r,n=0,i=!1,a,u,l,h=!1){if(!r)throw new Error("You must pass a buffer when creating an attribute");r instanceof Lt||(r instanceof Array&&(r=new Float32Array(r)),r=new Lt(r));const p=e.split("|");if(p.length>1){for(let c=0;c<p.length;c++)this.addAttribute(p[c],r,n,i,a);return this}let m=this.buffers.indexOf(r);return m===-1&&(this.buffers.push(r),m=this.buffers.length-1),this.attributes[e]=new Da(m,n,i,a,u,l,h),this.instanced=this.instanced||h,this}getAttribute(e){return this.attributes[e]}getBuffer(e){return this.buffers[this.getAttribute(e).buffer]}addIndex(e){return e instanceof Lt||(e instanceof Array&&(e=new Uint16Array(e)),e=new Lt(e)),e.type=Dr.ELEMENT_ARRAY_BUFFER,this.indexBuffer=e,this.buffers.includes(e)||this.buffers.push(e),this}getIndex(){return this.indexBuffer}interleave(){if(this.buffers.length===1||this.buffers.length===2&&this.indexBuffer)return this;const e=[],r=[],n=new Lt;let i;for(i in this.attributes){const a=this.attributes[i],u=this.buffers[a.buffer];e.push(u.data),r.push(a.size*fp[a.type]/4),a.buffer=0}for(n.data=fC(e,r),i=0;i<this.buffers.length;i++)this.buffers[i]!==this.indexBuffer&&this.buffers[i].destroy();return this.buffers=[n],this.indexBuffer&&this.buffers.push(this.indexBuffer),this}getSize(){for(const e in this.attributes){const r=this.attributes[e];return this.buffers[r.buffer].data.length/(r.stride/4||r.size)}return 0}dispose(){this.disposeRunner.emit(this,!1)}destroy(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null}clone(){const e=new Ei;for(let r=0;r<this.buffers.length;r++)e.buffers[r]=new Lt(this.buffers[r].data.slice(0));for(const r in this.attributes){const n=this.attributes[r];e.attributes[r]=new Da(n.buffer,n.size,n.normalized,n.type,n.stride,n.start,n.instance)}return this.indexBuffer&&(e.indexBuffer=e.buffers[this.buffers.indexOf(this.indexBuffer)],e.indexBuffer.type=Dr.ELEMENT_ARRAY_BUFFER),e}static merge(e){const r=new Ei,n=[],i=[],a=[];let u;for(let l=0;l<e.length;l++){u=e[l];for(let h=0;h<u.buffers.length;h++)i[h]=i[h]||0,i[h]+=u.buffers[h].data.length,a[h]=0}for(let l=0;l<u.buffers.length;l++)n[l]=new pC[sp(u.buffers[l].data)](i[l]),r.buffers[l]=new Lt(n[l]);for(let l=0;l<e.length;l++){u=e[l];for(let h=0;h<u.buffers.length;h++)n[h].set(u.buffers[h].data,a[h]),a[h]+=u.buffers[h].data.length}if(r.attributes=u.attributes,u.indexBuffer){r.indexBuffer=r.buffers[u.buffers.indexOf(u.indexBuffer)],r.indexBuffer.type=Dr.ELEMENT_ARRAY_BUFFER;let l=0,h=0,p=0,m=0;for(let c=0;c<u.buffers.length;c++)if(u.buffers[c]!==u.indexBuffer){m=c;break}for(const c in u.attributes){const d=u.attributes[c];(d.buffer|0)===m&&(h+=d.size*fp[d.type]/4)}for(let c=0;c<e.length;c++){const d=e[c].indexBuffer.data;for(let g=0;g<d.length;g++)r.indexBuffer.data[g+p]+=l;l+=e[c].buffers[m].data.length/h,p+=d.length}}return r}}class dp extends Ei{constructor(e=!1){super(),this._buffer=new Lt(null,e,!1),this._indexBuffer=new Lt(null,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,Ge.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,Ge.FLOAT).addAttribute("aColor",this._buffer,4,!0,Ge.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,Ge.FLOAT).addIndex(this._indexBuffer)}}const Ba=Math.PI*2,gC=180/Math.PI,ws=Math.PI/180;var Ct=(t=>(t[t.POLY=0]="POLY",t[t.RECT=1]="RECT",t[t.CIRC=2]="CIRC",t[t.ELIP=3]="ELIP",t[t.RREC=4]="RREC",t))(Ct||{});class et{constructor(e=0,r=0){this.x=0,this.y=0,this.x=e,this.y=r}clone(){return new et(this.x,this.y)}copyFrom(e){return this.set(e.x,e.y),this}copyTo(e){return e.set(this.x,this.y),e}equals(e){return e.x===this.x&&e.y===this.y}set(e=0,r=e){return this.x=e,this.y=r,this}toString(){return`[@pixi/math:Point x=${this.x} y=${this.y}]`}}const Ua=[new et,new et,new et,new et];class Qe{constructor(e=0,r=0,n=0,i=0){this.x=Number(e),this.y=Number(r),this.width=Number(n),this.height=Number(i),this.type=Ct.RECT}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}static get EMPTY(){return new Qe(0,0,0,0)}clone(){return new Qe(this.x,this.y,this.width,this.height)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}contains(e,r){return this.width<=0||this.height<=0?!1:e>=this.x&&e<this.x+this.width&&r>=this.y&&r<this.y+this.height}intersects(e,r){if(!r){const L=this.x<e.x?e.x:this.x;if((this.right>e.right?e.right:this.right)<=L)return!1;const V=this.y<e.y?e.y:this.y;return(this.bottom>e.bottom?e.bottom:this.bottom)>V}const n=this.left,i=this.right,a=this.top,u=this.bottom;if(i<=n||u<=a)return!1;const l=Ua[0].set(e.left,e.top),h=Ua[1].set(e.left,e.bottom),p=Ua[2].set(e.right,e.top),m=Ua[3].set(e.right,e.bottom);if(p.x<=l.x||h.y<=l.y)return!1;const c=Math.sign(r.a*r.d-r.b*r.c);if(c===0||(r.apply(l,l),r.apply(h,h),r.apply(p,p),r.apply(m,m),Math.max(l.x,h.x,p.x,m.x)<=n||Math.min(l.x,h.x,p.x,m.x)>=i||Math.max(l.y,h.y,p.y,m.y)<=a||Math.min(l.y,h.y,p.y,m.y)>=u))return!1;const d=c*(h.y-l.y),g=c*(l.x-h.x),v=d*n+g*a,y=d*i+g*a,b=d*n+g*u,x=d*i+g*u;if(Math.max(v,y,b,x)<=d*l.x+g*l.y||Math.min(v,y,b,x)>=d*m.x+g*m.y)return!1;const E=c*(l.y-p.y),w=c*(p.x-l.x),I=E*n+w*a,O=E*i+w*a,F=E*n+w*u,N=E*i+w*u;return!(Math.max(I,O,F,N)<=E*l.x+w*l.y||Math.min(I,O,F,N)>=E*m.x+w*m.y)}pad(e=0,r=e){return this.x-=e,this.y-=r,this.width+=e*2,this.height+=r*2,this}fit(e){const r=Math.max(this.x,e.x),n=Math.min(this.x+this.width,e.x+e.width),i=Math.max(this.y,e.y),a=Math.min(this.y+this.height,e.y+e.height);return this.x=r,this.width=Math.max(n-r,0),this.y=i,this.height=Math.max(a-i,0),this}ceil(e=1,r=.001){const n=Math.ceil((this.x+this.width-r)*e)/e,i=Math.ceil((this.y+this.height-r)*e)/e;return this.x=Math.floor((this.x+r)*e)/e,this.y=Math.floor((this.y+r)*e)/e,this.width=n-this.x,this.height=i-this.y,this}enlarge(e){const r=Math.min(this.x,e.x),n=Math.max(this.x+this.width,e.x+e.width),i=Math.min(this.y,e.y),a=Math.max(this.y+this.height,e.y+e.height);return this.x=r,this.width=n-r,this.y=i,this.height=a-i,this}toString(){return`[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}class Rl{constructor(e=0,r=0,n=0){this.x=e,this.y=r,this.radius=n,this.type=Ct.CIRC}clone(){return new Rl(this.x,this.y,this.radius)}contains(e,r){if(this.radius<=0)return!1;const n=this.radius*this.radius;let i=this.x-e,a=this.y-r;return i*=i,a*=a,i+a<=n}getBounds(){return new Qe(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)}toString(){return`[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}let mC=class Y_{constructor(e=0,r=0,n=0,i=0){this.x=e,this.y=r,this.width=n,this.height=i,this.type=Ct.ELIP}clone(){return new Y_(this.x,this.y,this.width,this.height)}contains(e,r){if(this.width<=0||this.height<=0)return!1;let n=(e-this.x)/this.width,i=(r-this.y)/this.height;return n*=n,i*=i,n+i<=1}getBounds(){return new Qe(this.x-this.width,this.y-this.height,this.width,this.height)}toString(){return`[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}};class Ss{constructor(...e){let r=Array.isArray(e[0])?e[0]:e;if(typeof r[0]!="number"){const n=[];for(let i=0,a=r.length;i<a;i++)n.push(r[i].x,r[i].y);r=n}this.points=r,this.type=Ct.POLY,this.closeStroke=!0}clone(){const e=this.points.slice(),r=new Ss(e);return r.closeStroke=this.closeStroke,r}contains(e,r){let n=!1;const i=this.points.length/2;for(let a=0,u=i-1;a<i;u=a++){const l=this.points[a*2],h=this.points[a*2+1],p=this.points[u*2],m=this.points[u*2+1];h>r!=m>r&&e<(p-l)*((r-h)/(m-h))+l&&(n=!n)}return n}toString(){return`[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce((e,r)=>`${e}, ${r}`,"")}]`}}class Pl{constructor(e=0,r=0,n=0,i=0,a=20){this.x=e,this.y=r,this.width=n,this.height=i,this.radius=a,this.type=Ct.RREC}clone(){return new Pl(this.x,this.y,this.width,this.height,this.radius)}contains(e,r){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&r>=this.y&&r<=this.y+this.height){const n=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(r>=this.y+n&&r<=this.y+this.height-n||e>=this.x+n&&e<=this.x+this.width-n)return!0;let i=e-(this.x+n),a=r-(this.y+n);const u=n*n;if(i*i+a*a<=u||(i=e-(this.x+this.width-n),i*i+a*a<=u)||(a=r-(this.y+this.height-n),i*i+a*a<=u)||(i=e-(this.x+n),i*i+a*a<=u))return!0}return!1}toString(){return`[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}let kt=class uu{constructor(e=1,r=0,n=0,i=1,a=0,u=0){this.array=null,this.a=e,this.b=r,this.c=n,this.d=i,this.tx=a,this.ty=u}fromArray(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]}set(e,r,n,i,a,u){return this.a=e,this.b=r,this.c=n,this.d=i,this.tx=a,this.ty=u,this}toArray(e,r){this.array||(this.array=new Float32Array(9));const n=r||this.array;return e?(n[0]=this.a,n[1]=this.b,n[2]=0,n[3]=this.c,n[4]=this.d,n[5]=0,n[6]=this.tx,n[7]=this.ty,n[8]=1):(n[0]=this.a,n[1]=this.c,n[2]=this.tx,n[3]=this.b,n[4]=this.d,n[5]=this.ty,n[6]=0,n[7]=0,n[8]=1),n}apply(e,r){r=r||new et;const n=e.x,i=e.y;return r.x=this.a*n+this.c*i+this.tx,r.y=this.b*n+this.d*i+this.ty,r}applyInverse(e,r){r=r||new et;const n=1/(this.a*this.d+this.c*-this.b),i=e.x,a=e.y;return r.x=this.d*n*i+-this.c*n*a+(this.ty*this.c-this.tx*this.d)*n,r.y=this.a*n*a+-this.b*n*i+(-this.ty*this.a+this.tx*this.b)*n,r}translate(e,r){return this.tx+=e,this.ty+=r,this}scale(e,r){return this.a*=e,this.d*=r,this.c*=e,this.b*=r,this.tx*=e,this.ty*=r,this}rotate(e){const r=Math.cos(e),n=Math.sin(e),i=this.a,a=this.c,u=this.tx;return this.a=i*r-this.b*n,this.b=i*n+this.b*r,this.c=a*r-this.d*n,this.d=a*n+this.d*r,this.tx=u*r-this.ty*n,this.ty=u*n+this.ty*r,this}append(e){const r=this.a,n=this.b,i=this.c,a=this.d;return this.a=e.a*r+e.b*i,this.b=e.a*n+e.b*a,this.c=e.c*r+e.d*i,this.d=e.c*n+e.d*a,this.tx=e.tx*r+e.ty*i+this.tx,this.ty=e.tx*n+e.ty*a+this.ty,this}setTransform(e,r,n,i,a,u,l,h,p){return this.a=Math.cos(l+p)*a,this.b=Math.sin(l+p)*a,this.c=-Math.sin(l-h)*u,this.d=Math.cos(l-h)*u,this.tx=e-(n*this.a+i*this.c),this.ty=r-(n*this.b+i*this.d),this}prepend(e){const r=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const n=this.a,i=this.c;this.a=n*e.a+this.b*e.c,this.b=n*e.b+this.b*e.d,this.c=i*e.a+this.d*e.c,this.d=i*e.b+this.d*e.d}return this.tx=r*e.a+this.ty*e.c+e.tx,this.ty=r*e.b+this.ty*e.d+e.ty,this}decompose(e){const r=this.a,n=this.b,i=this.c,a=this.d,u=e.pivot,l=-Math.atan2(-i,a),h=Math.atan2(n,r),p=Math.abs(l+h);return p<1e-5||Math.abs(Ba-p)<1e-5?(e.rotation=h,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=l,e.skew.y=h),e.scale.x=Math.sqrt(r*r+n*n),e.scale.y=Math.sqrt(i*i+a*a),e.position.x=this.tx+(u.x*r+u.y*i),e.position.y=this.ty+(u.x*n+u.y*a),e}invert(){const e=this.a,r=this.b,n=this.c,i=this.d,a=this.tx,u=e*i-r*n;return this.a=i/u,this.b=-r/u,this.c=-n/u,this.d=e/u,this.tx=(n*this.ty-i*a)/u,this.ty=-(e*this.ty-r*a)/u,this}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const e=new uu;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyTo(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}toString(){return`[@pixi/math:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return new uu}static get TEMP_MATRIX(){return new uu}};const Bn=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Un=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],$n=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Gn=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Ml=[],pp=[],$a=Math.sign;function _C(){for(let t=0;t<16;t++){const e=[];Ml.push(e);for(let r=0;r<16;r++){const n=$a(Bn[t]*Bn[r]+$n[t]*Un[r]),i=$a(Un[t]*Bn[r]+Gn[t]*Un[r]),a=$a(Bn[t]*$n[r]+$n[t]*Gn[r]),u=$a(Un[t]*$n[r]+Gn[t]*Gn[r]);for(let l=0;l<16;l++)if(Bn[l]===n&&Un[l]===i&&$n[l]===a&&Gn[l]===u){e.push(l);break}}}for(let t=0;t<16;t++){const e=new kt;e.set(Bn[t],Un[t],$n[t],Gn[t],0,0),pp.push(e)}}_C();const ut={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:t=>Bn[t],uY:t=>Un[t],vX:t=>$n[t],vY:t=>Gn[t],inv:t=>t&8?t&15:-t&7,add:(t,e)=>Ml[t][e],sub:(t,e)=>Ml[t][ut.inv(e)],rotate180:t=>t^4,isVertical:t=>(t&3)===2,byDirection:(t,e)=>Math.abs(t)*2<=Math.abs(e)?e>=0?ut.S:ut.N:Math.abs(e)*2<=Math.abs(t)?t>0?ut.E:ut.W:e>0?t>0?ut.SE:ut.SW:t>0?ut.NE:ut.NW,matrixAppendRotationInv:(t,e,r=0,n=0)=>{const i=pp[ut.inv(e)];i.tx=r,i.ty=n,t.append(i)}};class zn{constructor(e,r,n=0,i=0){this._x=n,this._y=i,this.cb=e,this.scope=r}clone(e=this.cb,r=this.scope){return new zn(e,r,this._x,this._y)}set(e=0,r=e){return(this._x!==e||this._y!==r)&&(this._x=e,this._y=r,this.cb.call(this.scope)),this}copyFrom(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this.cb.call(this.scope)),this}copyTo(e){return e.set(this._x,this._y),e}equals(e){return e.x===this._x&&e.y===this._y}toString(){return`[@pixi/math:ObservablePoint x=0 y=0 scope=${this.scope}]`}get x(){return this._x}set x(e){this._x!==e&&(this._x=e,this.cb.call(this.scope))}get y(){return this._y}set y(e){this._y!==e&&(this._y=e,this.cb.call(this.scope))}}const gp=class{constructor(){this.worldTransform=new kt,this.localTransform=new kt,this.position=new zn(this.onChange,this,0,0),this.scale=new zn(this.onChange,this,1,1),this.pivot=new zn(this.onChange,this,0,0),this.skew=new zn(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}onChange(){this._localID++}updateSkew(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++}toString(){return`[@pixi/math:Transform position=(${this.position.x}, ${this.position.y}) rotation=${this.rotation} scale=(${this.scale.x}, ${this.scale.y}) skew=(${this.skew.x}, ${this.skew.y}) ]`}updateLocalTransform(){const t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)}updateTransform(t){const e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){const r=t.worldTransform,n=this.worldTransform;n.a=e.a*r.a+e.b*r.c,n.b=e.a*r.b+e.b*r.d,n.c=e.c*r.a+e.d*r.c,n.d=e.c*r.b+e.d*r.d,n.tx=e.tx*r.a+e.ty*r.c+r.tx,n.ty=e.tx*r.b+e.ty*r.d+r.ty,this._parentID=t._worldID,this._worldID++}}setFromMatrix(t){t.decompose(this),this._localID++}get rotation(){return this._rotation}set rotation(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())}};let Ol=gp;Ol.IDENTITY=new gp;var vC=`varying vec2 vTextureCoord;
|
|
41
|
+
Deprecated since v${t}`),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${e}
|
|
42
|
+
Deprecated since v${t}`),console.warn(i))),mu[e]=!0}let ea;function zx(){return typeof ea>"u"&&(ea=function(){var r;const e={stencil:!0,failIfMajorPerformanceCaveat:q.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!q.ADAPTER.getWebGLRenderingContext())return!1;const i=q.ADAPTER.createCanvas();let n=i.getContext("webgl",e)||i.getContext("experimental-webgl",e);const s=!!((r=n==null?void 0:n.getContextAttributes())!=null&&r.stencil);if(n){const a=n.getExtension("WEBGL_lose_context");a&&a.loseContext()}return n=null,s}catch{return!1}}()),ea}var jx={grad:.9,turn:360,rad:360/(2*Math.PI)},bt=function(t){return typeof t=="string"?t.length>0:typeof t=="number"},Me=function(t,e,r){return e===void 0&&(e=0),r===void 0&&(r=Math.pow(10,e)),Math.round(r*t)/r+0},Je=function(t,e,r){return e===void 0&&(e=0),r===void 0&&(r=1),t>r?r:t>e?t:e},gu=function(t){return(t=isFinite(t)?t%360:0)>0?t:t+360},_u=function(t){return{r:Je(t.r,0,255),g:Je(t.g,0,255),b:Je(t.b,0,255),a:Je(t.a)}},ta=function(t){return{r:Me(t.r),g:Me(t.g),b:Me(t.b),a:Me(t.a,3)}},Hx=/^#([0-9a-f]{3,8})$/i,ln=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},vu=function(t){var e=t.r,r=t.g,i=t.b,n=t.a,s=Math.max(e,r,i),a=s-Math.min(e,r,i),o=a?s===e?(r-i)/a:s===r?2+(i-e)/a:4+(e-r)/a:0;return{h:60*(o<0?o+6:o),s:s?a/s*100:0,v:s/255*100,a:n}},yu=function(t){var e=t.h,r=t.s,i=t.v,n=t.a;e=e/360*6,r/=100,i/=100;var s=Math.floor(e),a=i*(1-r),o=i*(1-(e-s)*r),u=i*(1-(1-e+s)*r),c=s%6;return{r:255*[i,o,a,a,u,i][c],g:255*[u,i,i,o,a,a][c],b:255*[a,a,u,i,i,o][c],a:n}},xu=function(t){return{h:gu(t.h),s:Je(t.s,0,100),l:Je(t.l,0,100),a:Je(t.a)}},bu=function(t){return{h:Me(t.h),s:Me(t.s),l:Me(t.l),a:Me(t.a,3)}},Tu=function(t){return yu((r=(e=t).s,{h:e.h,s:(r*=((i=e.l)<50?i:100-i)/100)>0?2*r/(i+r)*100:0,v:i+r,a:e.a}));var e,r,i},li=function(t){return{h:(e=vu(t)).h,s:(n=(200-(r=e.s))*(i=e.v)/100)>0&&n<200?r*i/100/(n<=100?n:200-n)*100:0,l:n/2,a:e.a};var e,r,i,n},Vx=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Xx=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Wx=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,qx=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ra={string:[[function(t){var e=Hx.exec(t);return e?(t=e[1]).length<=4?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?Me(parseInt(t[3]+t[3],16)/255,2):1}:t.length===6||t.length===8?{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16),a:t.length===8?Me(parseInt(t.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(t){var e=Wx.exec(t)||qx.exec(t);return e?e[2]!==e[4]||e[4]!==e[6]?null:_u({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(t){var e=Vx.exec(t)||Xx.exec(t);if(!e)return null;var r,i,n=xu({h:(r=e[1],i=e[2],i===void 0&&(i="deg"),Number(r)*(jx[i]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return Tu(n)},"hsl"]],object:[[function(t){var e=t.r,r=t.g,i=t.b,n=t.a,s=n===void 0?1:n;return bt(e)&&bt(r)&&bt(i)?_u({r:Number(e),g:Number(r),b:Number(i),a:Number(s)}):null},"rgb"],[function(t){var e=t.h,r=t.s,i=t.l,n=t.a,s=n===void 0?1:n;if(!bt(e)||!bt(r)||!bt(i))return null;var a=xu({h:Number(e),s:Number(r),l:Number(i),a:Number(s)});return Tu(a)},"hsl"],[function(t){var e=t.h,r=t.s,i=t.v,n=t.a,s=n===void 0?1:n;if(!bt(e)||!bt(r)||!bt(i))return null;var a=function(o){return{h:gu(o.h),s:Je(o.s,0,100),v:Je(o.v,0,100),a:Je(o.a)}}({h:Number(e),s:Number(r),v:Number(i),a:Number(s)});return yu(a)},"hsv"]]},wu=function(t,e){for(var r=0;r<e.length;r++){var i=e[r][0](t);if(i)return[i,e[r][1]]}return[null,void 0]},Yx=function(t){return typeof t=="string"?wu(t.trim(),ra.string):typeof t=="object"&&t!==null?wu(t,ra.object):[null,void 0]},ia=function(t,e){var r=li(t);return{h:r.h,s:Je(r.s+100*e,0,100),l:r.l,a:r.a}},na=function(t){return(299*t.r+587*t.g+114*t.b)/1e3/255},Su=function(t,e){var r=li(t);return{h:r.h,s:r.s,l:Je(r.l+100*e,0,100),a:r.a}},sa=function(){function t(e){this.parsed=Yx(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return t.prototype.isValid=function(){return this.parsed!==null},t.prototype.brightness=function(){return Me(na(this.rgba),2)},t.prototype.isDark=function(){return na(this.rgba)<.5},t.prototype.isLight=function(){return na(this.rgba)>=.5},t.prototype.toHex=function(){return e=ta(this.rgba),r=e.r,i=e.g,n=e.b,a=(s=e.a)<1?ln(Me(255*s)):"","#"+ln(r)+ln(i)+ln(n)+a;var e,r,i,n,s,a},t.prototype.toRgb=function(){return ta(this.rgba)},t.prototype.toRgbString=function(){return e=ta(this.rgba),r=e.r,i=e.g,n=e.b,(s=e.a)<1?"rgba("+r+", "+i+", "+n+", "+s+")":"rgb("+r+", "+i+", "+n+")";var e,r,i,n,s},t.prototype.toHsl=function(){return bu(li(this.rgba))},t.prototype.toHslString=function(){return e=bu(li(this.rgba)),r=e.h,i=e.s,n=e.l,(s=e.a)<1?"hsla("+r+", "+i+"%, "+n+"%, "+s+")":"hsl("+r+", "+i+"%, "+n+"%)";var e,r,i,n,s},t.prototype.toHsv=function(){return e=vu(this.rgba),{h:Me(e.h),s:Me(e.s),v:Me(e.v),a:Me(e.a,3)};var e},t.prototype.invert=function(){return _t({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},t.prototype.saturate=function(e){return e===void 0&&(e=.1),_t(ia(this.rgba,e))},t.prototype.desaturate=function(e){return e===void 0&&(e=.1),_t(ia(this.rgba,-e))},t.prototype.grayscale=function(){return _t(ia(this.rgba,-1))},t.prototype.lighten=function(e){return e===void 0&&(e=.1),_t(Su(this.rgba,e))},t.prototype.darken=function(e){return e===void 0&&(e=.1),_t(Su(this.rgba,-e))},t.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},t.prototype.alpha=function(e){return typeof e=="number"?_t({r:(r=this.rgba).r,g:r.g,b:r.b,a:e}):Me(this.rgba.a,3);var r},t.prototype.hue=function(e){var r=li(this.rgba);return typeof e=="number"?_t({h:e,s:r.s,l:r.l,a:r.a}):Me(r.h)},t.prototype.isEqual=function(e){return this.toHex()===_t(e).toHex()},t}(),_t=function(t){return t instanceof sa?t:new sa(t)},Au=[],Kx=function(t){t.forEach(function(e){Au.indexOf(e)<0&&(e(sa,ra),Au.push(e))})};function Zx(t,e){var r={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},i={};for(var n in r)i[r[n]]=n;var s={};t.prototype.toName=function(a){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var o,u,c=i[this.toHex()];if(c)return c;if(a!=null&&a.closest){var f=this.toRgb(),l=1/0,h="black";if(!s.length)for(var d in r)s[d]=new t(r[d]).toRgb();for(var p in r){var m=(o=f,u=s[p],Math.pow(o.r-u.r,2)+Math.pow(o.g-u.g,2)+Math.pow(o.b-u.b,2));m<l&&(l=m,h=p)}return h}},e.string.push([function(a){var o=a.toLowerCase(),u=o==="transparent"?"#0000":r[o];return u?new t(u).toRgb():null},"name"])}Kx([Zx]);const Cr=class{constructor(t=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=t}get red(){return this._components[0]}get green(){return this._components[1]}get blue(){return this._components[2]}get alpha(){return this._components[3]}setValue(t){return this.value=t,this}set value(t){if(t instanceof Cr)this._value=this.cloneSource(t._value),this._int=t._int,this._components.set(t._components);else{if(t===null)throw new Error("Cannot set PIXI.Color#value to null");(this._value===null||!this.isSourceEqual(this._value,t))&&(this.normalize(t),this._value=this.cloneSource(t))}}get value(){return this._value}cloneSource(t){return typeof t=="string"||typeof t=="number"||t instanceof Number||t===null?t:Array.isArray(t)||ArrayBuffer.isView(t)?t.slice(0):typeof t=="object"&&t!==null?{...t}:t}isSourceEqual(t,e){const r=typeof t;if(r!==typeof e)return!1;if(r==="number"||r==="string"||t instanceof Number)return t===e;if(Array.isArray(t)&&Array.isArray(e)||ArrayBuffer.isView(t)&&ArrayBuffer.isView(e))return t.length!==e.length?!1:t.every((n,s)=>n===e[s]);if(t!==null&&e!==null){const n=Object.keys(t),s=Object.keys(e);return n.length!==s.length?!1:n.every(a=>t[a]===e[a])}return t===e}toRgba(){const[t,e,r,i]=this._components;return{r:t,g:e,b:r,a:i}}toRgb(){const[t,e,r]=this._components;return{r:t,g:e,b:r}}toRgbaString(){const[t,e,r]=this.toUint8RgbArray();return`rgba(${t},${e},${r},${this.alpha})`}toUint8RgbArray(t){const[e,r,i]=this._components;return t=t??[],t[0]=Math.round(e*255),t[1]=Math.round(r*255),t[2]=Math.round(i*255),t}toRgbArray(t){t=t??[];const[e,r,i]=this._components;return t[0]=e,t[1]=r,t[2]=i,t}toNumber(){return this._int}toLittleEndianNumber(){const t=this._int;return(t>>16)+(t&65280)+((t&255)<<16)}multiply(t){const[e,r,i,n]=Cr.temp.setValue(t)._components;return this._components[0]*=e,this._components[1]*=r,this._components[2]*=i,this._components[3]*=n,this.refreshInt(),this._value=null,this}premultiply(t,e=!0){return e&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this.refreshInt(),this._value=null,this}toPremultiplied(t){if(t===1)return(t*255<<24)+this._int;if(t===0)return 0;let e=this._int>>16&255,r=this._int>>8&255,i=this._int&255;return e=e*t+.5|0,r=r*t+.5|0,i=i*t+.5|0,(t*255<<24)+(e<<16)+(r<<8)+i}toHex(){const t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){const e=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-e.length)+e}setAlpha(t){return this._components[3]=this._clamp(t),this}round(t){const[e,r,i]=this._components;return this._components[0]=Math.round(e*t)/t,this._components[1]=Math.round(r*t)/t,this._components[2]=Math.round(i*t)/t,this.refreshInt(),this._value=null,this}toArray(t){t=t??[];const[e,r,i,n]=this._components;return t[0]=e,t[1]=r,t[2]=i,t[3]=n,t}normalize(t){let e;if((typeof t=="number"||t instanceof Number)&&t>=0&&t<=16777215){const r=t;e=[(r>>16&255)/255,(r>>8&255)/255,(r&255)/255,1]}else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4){t=this._clamp(t);const[r,i,n,s=1]=t;e=[r,i,n,s]}else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4){t=this._clamp(t,0,255);const[r,i,n,s=255]=t;e=[r/255,i/255,n/255,s/255]}else if(typeof t=="string"||typeof t=="object"){if(typeof t=="string"){const i=Cr.HEX_PATTERN.exec(t);i&&(t=`#${i[2]}`)}const r=_t(t);if(r.isValid()){const{r:i,g:n,b:s,a}=r.rgba;e=[i/255,n/255,s/255,a]}}if(e)this._components.set(e),this.refreshInt();else throw new Error(`Unable to convert color ${t}`)}refreshInt(){this._clamp(this._components);const[t,e,r]=this._components;this._int=(t*255<<16)+(e*255<<8)+(r*255|0)}_clamp(t,e=0,r=1){return typeof t=="number"?Math.min(Math.max(t,e),r):(t.forEach((i,n)=>{t[n]=Math.min(Math.max(i,e),r)}),t)}};let Oe=Cr;Oe.shared=new Cr,Oe.temp=new Cr,Oe.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;function un(t,e=[]){return ne("7.2.0","utils.hex2rgb is deprecated, use Color#toRgbArray instead"),Oe.shared.setValue(t).toRgbArray(e)}function aa(t){return ne("7.2.0","utils.rgb2hex is deprecated, use Color#toNumber instead"),Oe.shared.setValue(t).toNumber()}function Qx(){const t=[],e=[];for(let i=0;i<32;i++)t[i]=i,e[i]=i;t[z.NORMAL_NPM]=z.NORMAL,t[z.ADD_NPM]=z.ADD,t[z.SCREEN_NPM]=z.SCREEN,e[z.NORMAL]=z.NORMAL_NPM,e[z.ADD]=z.ADD_NPM,e[z.SCREEN]=z.SCREEN_NPM;const r=[];return r.push(e),r.push(t),r}const Jx=Qx();function Eu(t){if(t.BYTES_PER_ELEMENT===4)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(t.BYTES_PER_ELEMENT===2){if(t instanceof Uint16Array)return"Uint16Array"}else if(t.BYTES_PER_ELEMENT===1&&t instanceof Uint8Array)return"Uint8Array";return null}function hn(t){return t+=t===0?1:0,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t+1}function Cu(t){return!(t&t-1)&&!!t}function Iu(t){let e=(t>65535?1:0)<<4;t>>>=e;let r=(t>255?1:0)<<3;return t>>>=r,e|=r,r=(t>15?1:0)<<2,t>>>=r,e|=r,r=(t>3?1:0)<<1,t>>>=r,e|=r,e|t>>1}function cn(t,e,r){const i=t.length;let n;if(e>=i||r===0)return;r=e+r>i?i-e:r;const s=i-r;for(n=e;n<s;++n)t[n]=t[n+r];t.length=s}function fn(t){return t===0?0:t<0?-1:1}let e1=0;function ui(){return++e1}const Ru={},vt=Object.create(null),kt=Object.create(null);let dn;function t1(t,e=globalThis.location){if(t.startsWith("data:"))return"";e=e||globalThis.location,dn||(dn=document.createElement("a")),dn.href=t;const r=Bx.parse(dn.href),i=!r.port&&e.port===""||r.port===e.port;return r.hostname!==e.hostname||!i||r.protocol!==e.protocol?"anonymous":""}function Pu(t,e=1){var i;const r=(i=q.RETINA_PREFIX)==null?void 0:i.exec(t);return r?parseFloat(r[1]):e}var re=(t=>(t.Renderer="renderer",t.Application="application",t.RendererSystem="renderer-webgl-system",t.RendererPlugin="renderer-webgl-plugin",t.CanvasRendererSystem="renderer-canvas-system",t.CanvasRendererPlugin="renderer-canvas-plugin",t.Asset="asset",t.LoadParser="load-parser",t.ResolveParser="resolve-parser",t.CacheParser="cache-parser",t.DetectionParser="detection-parser",t))(re||{});const oa=t=>{if(typeof t=="function"||typeof t=="object"&&t.extension){if(!t.extension)throw new Error("Extension class must have an extension object");t={...typeof t.extension!="object"?{type:t.extension}:t.extension,ref:t}}if(typeof t=="object")t={...t};else throw new Error("Invalid extension type");return typeof t.type=="string"&&(t.type=[t.type]),t},Mu=(t,e)=>oa(t).priority??e,he={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...t){return t.map(oa).forEach(e=>{e.type.forEach(r=>{var i,n;return(n=(i=this._removeHandlers)[r])==null?void 0:n.call(i,e)})}),this},add(...t){return t.map(oa).forEach(e=>{e.type.forEach(r=>{const i=this._addHandlers,n=this._queue;i[r]?i[r](e):(n[r]=n[r]||[],n[r].push(e))})}),this},handle(t,e,r){const i=this._addHandlers,n=this._removeHandlers;if(i[t]||n[t])throw new Error(`Extension type ${t} already has a handler`);i[t]=e,n[t]=r;const s=this._queue;return s[t]&&(s[t].forEach(a=>e(a)),delete s[t]),this},handleByMap(t,e){return this.handle(t,r=>{e[r.name]=r.ref},r=>{delete e[r.name]})},handleByList(t,e,r=-1){return this.handle(t,i=>{e.includes(i.ref)||(e.push(i.ref),e.sort((n,s)=>Mu(s,r)-Mu(n,r)))},i=>{const n=e.indexOf(i.ref);n!==-1&&e.splice(n,1)})}};class r1{constructor(e){typeof e=="number"?this.rawBinaryData=new ArrayBuffer(e):e instanceof Uint8Array?this.rawBinaryData=e.buffer:this.rawBinaryData=e,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get uint16View(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}view(e){return this[`${e}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null}static sizeOf(e){switch(e){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${e} isn't a valid view type`)}}}const i1=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
|
|
43
|
+
`);function n1(t){let e="";for(let r=0;r<t;++r)r>0&&(e+=`
|
|
44
|
+
else `),r<t-1&&(e+=`if(test == ${r}.0){}`);return e}function s1(t,e){if(t===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const r=e.createShader(e.FRAGMENT_SHADER);for(;;){const i=i1.replace(/%forloop%/gi,n1(t));if(e.shaderSource(r,i),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS))t=t/2|0;else break}return t}const la=0,ua=1,ha=2,ca=3,fa=4,da=5;let pn=class Gc{constructor(){this.data=0,this.blendMode=z.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<la)}set blend(e){!!(this.data&1<<la)!==e&&(this.data^=1<<la)}get offsets(){return!!(this.data&1<<ua)}set offsets(e){!!(this.data&1<<ua)!==e&&(this.data^=1<<ua)}get culling(){return!!(this.data&1<<ha)}set culling(e){!!(this.data&1<<ha)!==e&&(this.data^=1<<ha)}get depthTest(){return!!(this.data&1<<ca)}set depthTest(e){!!(this.data&1<<ca)!==e&&(this.data^=1<<ca)}get depthMask(){return!!(this.data&1<<da)}set depthMask(e){!!(this.data&1<<da)!==e&&(this.data^=1<<da)}get clockwiseFrontFace(){return!!(this.data&1<<fa)}set clockwiseFrontFace(e){!!(this.data&1<<fa)!==e&&(this.data^=1<<fa)}get blendMode(){return this._blendMode}set blendMode(e){this.blend=e!==z.NONE,this._blendMode=e}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){this.offsets=!!e,this._polygonOffset=e}toString(){return`[@pixi/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const e=new Gc;return e.depthTest=!1,e.blend=!0,e}};const pa=[];function Fu(t,e){if(!t)return null;let r="";if(typeof t=="string"){const i=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);i&&(r=i[1].toLowerCase())}for(let i=pa.length-1;i>=0;--i){const n=pa[i];if(n.test&&n.test(t,r))return new n(t,e)}throw new Error("Unrecognized source type to auto-detect Resource")}class it{constructor(e){this.items=[],this._name=e,this._aliasCount=0}emit(e,r,i,n,s,a,o,u){if(arguments.length>8)throw new Error("max arguments reached");const{name:c,items:f}=this;this._aliasCount++;for(let l=0,h=f.length;l<h;l++)f[l][c](e,r,i,n,s,a,o,u);return f===this.items&&this._aliasCount--,this}ensureNonAliasedItems(){this._aliasCount>0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))}add(e){return e[this._name]&&(this.ensureNonAliasedItems(),this.remove(e),this.items.push(e)),this}remove(e){const r=this.items.indexOf(e);return r!==-1&&(this.ensureNonAliasedItems(),this.items.splice(r,1)),this}contains(e){return this.items.includes(e)}removeAll(){return this.ensureNonAliasedItems(),this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return this.items.length===0}get name(){return this._name}}Object.defineProperties(it.prototype,{dispatch:{value:it.prototype.emit},run:{value:it.prototype.emit}});class hi{constructor(e=0,r=0){this._width=e,this._height=r,this.destroyed=!1,this.internal=!1,this.onResize=new it("setRealSize"),this.onUpdate=new it("update"),this.onError=new it("onError")}bind(e){this.onResize.add(e),this.onUpdate.add(e),this.onError.add(e),(this._width||this._height)&&this.onResize.emit(this._width,this._height)}unbind(e){this.onResize.remove(e),this.onUpdate.remove(e),this.onError.remove(e)}resize(e,r){(e!==this._width||r!==this._height)&&(this._width=e,this._height=r,this.onResize.emit(e,r))}get valid(){return!!this._width&&!!this._height}update(){this.destroyed||this.onUpdate.emit()}load(){return Promise.resolve(this)}get width(){return this._width}get height(){return this._height}style(e,r,i){return!1}dispose(){}destroy(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)}static test(e,r){return!1}}class ma extends hi{constructor(e,r){const{width:i,height:n}=r||{};if(!i||!n)throw new Error("BufferResource width or height invalid");super(i,n),this.data=e}upload(e,r,i){const n=e.gl;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.alphaMode===Mt.UNPACK);const s=r.realWidth,a=r.realHeight;return i.width===s&&i.height===a?n.texSubImage2D(r.target,0,0,0,s,a,r.format,i.type,this.data):(i.width=s,i.height=a,n.texImage2D(r.target,0,i.internalFormat,s,a,0,r.format,i.type,this.data)),!0}dispose(){this.data=null}static test(e){return e instanceof Float32Array||e instanceof Uint8Array||e instanceof Uint32Array}}const a1={scaleMode:et.NEAREST,format:N.RGBA,alphaMode:Mt.NPM},Ir=class extends Xi{constructor(t=null,e=null){super(),e=Object.assign({},Ir.defaultOptions,e);const{alphaMode:r,mipmap:i,anisotropicLevel:n,scaleMode:s,width:a,height:o,wrapMode:u,format:c,type:f,target:l,resolution:h,resourceOptions:d}=e;t&&!(t instanceof hi)&&(t=Fu(t,d),t.internal=!0),this.resolution=h||q.RESOLUTION,this.width=Math.round((a||0)*this.resolution)/this.resolution,this.height=Math.round((o||0)*this.resolution)/this.resolution,this._mipmap=i,this.anisotropicLevel=n,this._wrapMode=u,this._scaleMode=s,this.format=c,this.type=f,this.target=l,this.alphaMode=r,this.uid=ui(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=a>0&&o>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this._batchLocation=0,this.parentTextureArray=null,this.setResource(t)}get realWidth(){return Math.round(this.width*this.resolution)}get realHeight(){return Math.round(this.height*this.resolution)}get mipmap(){return this._mipmap}set mipmap(t){this._mipmap!==t&&(this._mipmap=t,this.dirtyStyleId++)}get scaleMode(){return this._scaleMode}set scaleMode(t){this._scaleMode!==t&&(this._scaleMode=t,this.dirtyStyleId++)}get wrapMode(){return this._wrapMode}set wrapMode(t){this._wrapMode!==t&&(this._wrapMode=t,this.dirtyStyleId++)}setStyle(t,e){let r;return t!==void 0&&t!==this.scaleMode&&(this.scaleMode=t,r=!0),e!==void 0&&e!==this.mipmap&&(this.mipmap=e,r=!0),r&&this.dirtyStyleId++,this}setSize(t,e,r){return r=r||this.resolution,this.setRealSize(t*r,e*r,r)}setRealSize(t,e,r){return this.resolution=r||this.resolution,this.width=Math.round(t)/this.resolution,this.height=Math.round(e)/this.resolution,this._refreshPOT(),this.update(),this}_refreshPOT(){this.isPowerOfTwo=Cu(this.realWidth)&&Cu(this.realHeight)}setResolution(t){const e=this.resolution;return e===t?this:(this.resolution=t,this.valid&&(this.width=Math.round(this.width*e)/t,this.height=Math.round(this.height*e)/t,this.emit("update",this)),this._refreshPOT(),this)}setResource(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this}update(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))}onError(t){this.emit("error",this,t)}destroy(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete kt[this.cacheId],delete vt[this.cacheId],this.cacheId=null),this.dispose(),Ir.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0}dispose(){this.emit("dispose",this)}castToBaseTexture(){return this}static from(t,e,r=q.STRICT_TEXTURE_CACHE){const i=typeof t=="string";let n=null;if(i)n=t;else{if(!t._pixiId){const a=(e==null?void 0:e.pixiIdPrefix)||"pixiid";t._pixiId=`${a}_${ui()}`}n=t._pixiId}let s=kt[n];if(i&&r&&!s)throw new Error(`The cacheId "${n}" does not exist in BaseTextureCache.`);return s||(s=new Ir(t,e),s.cacheId=n,Ir.addToCache(s,n)),s}static fromBuffer(t,e,r,i){t=t||new Float32Array(e*r*4);const n=new ma(t,{width:e,height:r}),s=t instanceof Float32Array?ae.FLOAT:ae.UNSIGNED_BYTE;return new Ir(n,Object.assign({},a1,i||{width:e,height:r,type:s}))}static addToCache(t,e){e&&(t.textureCacheIds.includes(e)||t.textureCacheIds.push(e),kt[e]&&kt[e]!==t&&console.warn(`BaseTexture added to the cache with an id [${e}] that already had an entry`),kt[e]=t)}static removeFromCache(t){if(typeof t=="string"){const e=kt[t];if(e){const r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete kt[t],e}}else if(t!=null&&t.textureCacheIds){for(let e=0;e<t.textureCacheIds.length;++e)delete kt[t.textureCacheIds[e]];return t.textureCacheIds.length=0,t}return null}};let oe=Ir;oe.defaultOptions={mipmap:Vt.POW2,anisotropicLevel:0,scaleMode:et.LINEAR,wrapMode:Qr.CLAMP,alphaMode:Mt.UNPACK,target:mr.TEXTURE_2D,format:N.RGBA,type:ae.UNSIGNED_BYTE},oe._globalBatch=0;class ga{constructor(){this.texArray=null,this.blend=0,this.type=Pt.TRIANGLES,this.start=0,this.size=0,this.data=null}}let o1=0;class Be{constructor(e,r=!0,i=!1){this.data=e||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=i,this.static=r,this.id=o1++,this.disposeRunner=new it("disposeBuffer")}update(e){e instanceof Array&&(e=new Float32Array(e)),this.data=e||this.data,this._updateID++}dispose(){this.disposeRunner.emit(this,!1)}destroy(){this.dispose(),this.data=null}set index(e){this.type=e?pt.ELEMENT_ARRAY_BUFFER:pt.ARRAY_BUFFER}get index(){return this.type===pt.ELEMENT_ARRAY_BUFFER}static from(e){return e instanceof Array&&(e=new Float32Array(e)),new Be(e)}}class mn{constructor(e,r=0,i=!1,n=ae.FLOAT,s,a,o,u=1){this.buffer=e,this.size=r,this.normalized=i,this.type=n,this.stride=s,this.start=a,this.instance=o,this.divisor=u}destroy(){this.buffer=null}static from(e,r,i,n,s){return new mn(e,r,i,n,s)}}const l1={Float32Array,Uint32Array,Int32Array,Uint8Array};function u1(t,e){let r=0,i=0;const n={};for(let u=0;u<t.length;u++)i+=e[u],r+=t[u].length;const s=new ArrayBuffer(r*4);let a=null,o=0;for(let u=0;u<t.length;u++){const c=e[u],f=t[u],l=Eu(f);n[l]||(n[l]=new l1[l](s)),a=n[l];for(let h=0;h<f.length;h++){const d=(h/c|0)*i+o,p=h%c;a[d+p]=f[h]}o+=c}return new Float32Array(s)}const Ou={5126:4,5123:2,5121:1};let h1=0;const c1={Float32Array,Uint32Array,Int32Array,Uint8Array,Uint16Array};class Rr{constructor(e=[],r={}){this.buffers=e,this.indexBuffer=null,this.attributes=r,this.glVertexArrayObjects={},this.id=h1++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new it("disposeGeometry"),this.refCount=0}addAttribute(e,r,i=0,n=!1,s,a,o,u=!1){if(!r)throw new Error("You must pass a buffer when creating an attribute");r instanceof Be||(r instanceof Array&&(r=new Float32Array(r)),r=new Be(r));const c=e.split("|");if(c.length>1){for(let l=0;l<c.length;l++)this.addAttribute(c[l],r,i,n,s);return this}let f=this.buffers.indexOf(r);return f===-1&&(this.buffers.push(r),f=this.buffers.length-1),this.attributes[e]=new mn(f,i,n,s,a,o,u),this.instanced=this.instanced||u,this}getAttribute(e){return this.attributes[e]}getBuffer(e){return this.buffers[this.getAttribute(e).buffer]}addIndex(e){return e instanceof Be||(e instanceof Array&&(e=new Uint16Array(e)),e=new Be(e)),e.type=pt.ELEMENT_ARRAY_BUFFER,this.indexBuffer=e,this.buffers.includes(e)||this.buffers.push(e),this}getIndex(){return this.indexBuffer}interleave(){if(this.buffers.length===1||this.buffers.length===2&&this.indexBuffer)return this;const e=[],r=[],i=new Be;let n;for(n in this.attributes){const s=this.attributes[n],a=this.buffers[s.buffer];e.push(a.data),r.push(s.size*Ou[s.type]/4),s.buffer=0}for(i.data=u1(e,r),n=0;n<this.buffers.length;n++)this.buffers[n]!==this.indexBuffer&&this.buffers[n].destroy();return this.buffers=[i],this.indexBuffer&&this.buffers.push(this.indexBuffer),this}getSize(){for(const e in this.attributes){const r=this.attributes[e];return this.buffers[r.buffer].data.length/(r.stride/4||r.size)}return 0}dispose(){this.disposeRunner.emit(this,!1)}destroy(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null}clone(){const e=new Rr;for(let r=0;r<this.buffers.length;r++)e.buffers[r]=new Be(this.buffers[r].data.slice(0));for(const r in this.attributes){const i=this.attributes[r];e.attributes[r]=new mn(i.buffer,i.size,i.normalized,i.type,i.stride,i.start,i.instance)}return this.indexBuffer&&(e.indexBuffer=e.buffers[this.buffers.indexOf(this.indexBuffer)],e.indexBuffer.type=pt.ELEMENT_ARRAY_BUFFER),e}static merge(e){const r=new Rr,i=[],n=[],s=[];let a;for(let o=0;o<e.length;o++){a=e[o];for(let u=0;u<a.buffers.length;u++)n[u]=n[u]||0,n[u]+=a.buffers[u].data.length,s[u]=0}for(let o=0;o<a.buffers.length;o++)i[o]=new c1[Eu(a.buffers[o].data)](n[o]),r.buffers[o]=new Be(i[o]);for(let o=0;o<e.length;o++){a=e[o];for(let u=0;u<a.buffers.length;u++)i[u].set(a.buffers[u].data,s[u]),s[u]+=a.buffers[u].data.length}if(r.attributes=a.attributes,a.indexBuffer){r.indexBuffer=r.buffers[a.buffers.indexOf(a.indexBuffer)],r.indexBuffer.type=pt.ELEMENT_ARRAY_BUFFER;let o=0,u=0,c=0,f=0;for(let l=0;l<a.buffers.length;l++)if(a.buffers[l]!==a.indexBuffer){f=l;break}for(const l in a.attributes){const h=a.attributes[l];(h.buffer|0)===f&&(u+=h.size*Ou[h.type]/4)}for(let l=0;l<e.length;l++){const h=e[l].indexBuffer.data;for(let d=0;d<h.length;d++)r.indexBuffer.data[d+c]+=o;o+=e[l].buffers[f].data.length/u,c+=h.length}}return r}}class Nu extends Rr{constructor(e=!1){super(),this._buffer=new Be(null,e,!1),this._indexBuffer=new Be(null,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,ae.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,ae.FLOAT).addAttribute("aColor",this._buffer,4,!0,ae.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,ae.FLOAT).addIndex(this._indexBuffer)}}const gn=Math.PI*2,f1=180/Math.PI,ci=Math.PI/180;var Ne=(t=>(t[t.POLY=0]="POLY",t[t.RECT=1]="RECT",t[t.CIRC=2]="CIRC",t[t.ELIP=3]="ELIP",t[t.RREC=4]="RREC",t))(Ne||{});class me{constructor(e=0,r=0){this.x=0,this.y=0,this.x=e,this.y=r}clone(){return new me(this.x,this.y)}copyFrom(e){return this.set(e.x,e.y),this}copyTo(e){return e.set(this.x,this.y),e}equals(e){return e.x===this.x&&e.y===this.y}set(e=0,r=e){return this.x=e,this.y=r,this}toString(){return`[@pixi/math:Point x=${this.x} y=${this.y}]`}}const _n=[new me,new me,new me,new me];class pe{constructor(e=0,r=0,i=0,n=0){this.x=Number(e),this.y=Number(r),this.width=Number(i),this.height=Number(n),this.type=Ne.RECT}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}static get EMPTY(){return new pe(0,0,0,0)}clone(){return new pe(this.x,this.y,this.width,this.height)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}contains(e,r){return this.width<=0||this.height<=0?!1:e>=this.x&&e<this.x+this.width&&r>=this.y&&r<this.y+this.height}intersects(e,r){if(!r){const S=this.x<e.x?e.x:this.x;if((this.right>e.right?e.right:this.right)<=S)return!1;const C=this.y<e.y?e.y:this.y;return(this.bottom>e.bottom?e.bottom:this.bottom)>C}const i=this.left,n=this.right,s=this.top,a=this.bottom;if(n<=i||a<=s)return!1;const o=_n[0].set(e.left,e.top),u=_n[1].set(e.left,e.bottom),c=_n[2].set(e.right,e.top),f=_n[3].set(e.right,e.bottom);if(c.x<=o.x||u.y<=o.y)return!1;const l=Math.sign(r.a*r.d-r.b*r.c);if(l===0||(r.apply(o,o),r.apply(u,u),r.apply(c,c),r.apply(f,f),Math.max(o.x,u.x,c.x,f.x)<=i||Math.min(o.x,u.x,c.x,f.x)>=n||Math.max(o.y,u.y,c.y,f.y)<=s||Math.min(o.y,u.y,c.y,f.y)>=a))return!1;const h=l*(u.y-o.y),d=l*(o.x-u.x),p=h*i+d*s,m=h*n+d*s,_=h*i+d*a,g=h*n+d*a;if(Math.max(p,m,_,g)<=h*o.x+d*o.y||Math.min(p,m,_,g)>=h*f.x+d*f.y)return!1;const y=l*(o.y-c.y),v=l*(c.x-o.x),x=y*i+v*s,T=y*n+v*s,b=y*i+v*a,w=y*n+v*a;return!(Math.max(x,T,b,w)<=y*o.x+v*o.y||Math.min(x,T,b,w)>=y*f.x+v*f.y)}pad(e=0,r=e){return this.x-=e,this.y-=r,this.width+=e*2,this.height+=r*2,this}fit(e){const r=Math.max(this.x,e.x),i=Math.min(this.x+this.width,e.x+e.width),n=Math.max(this.y,e.y),s=Math.min(this.y+this.height,e.y+e.height);return this.x=r,this.width=Math.max(i-r,0),this.y=n,this.height=Math.max(s-n,0),this}ceil(e=1,r=.001){const i=Math.ceil((this.x+this.width-r)*e)/e,n=Math.ceil((this.y+this.height-r)*e)/e;return this.x=Math.floor((this.x+r)*e)/e,this.y=Math.floor((this.y+r)*e)/e,this.width=i-this.x,this.height=n-this.y,this}enlarge(e){const r=Math.min(this.x,e.x),i=Math.max(this.x+this.width,e.x+e.width),n=Math.min(this.y,e.y),s=Math.max(this.y+this.height,e.y+e.height);return this.x=r,this.width=i-r,this.y=n,this.height=s-n,this}toString(){return`[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}class _a{constructor(e=0,r=0,i=0){this.x=e,this.y=r,this.radius=i,this.type=Ne.CIRC}clone(){return new _a(this.x,this.y,this.radius)}contains(e,r){if(this.radius<=0)return!1;const i=this.radius*this.radius;let n=this.x-e,s=this.y-r;return n*=n,s*=s,n+s<=i}getBounds(){return new pe(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)}toString(){return`[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}let d1=class zc{constructor(e=0,r=0,i=0,n=0){this.x=e,this.y=r,this.width=i,this.height=n,this.type=Ne.ELIP}clone(){return new zc(this.x,this.y,this.width,this.height)}contains(e,r){if(this.width<=0||this.height<=0)return!1;let i=(e-this.x)/this.width,n=(r-this.y)/this.height;return i*=i,n*=n,i+n<=1}getBounds(){return new pe(this.x-this.width,this.y-this.height,this.width,this.height)}toString(){return`[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}};class fi{constructor(...e){let r=Array.isArray(e[0])?e[0]:e;if(typeof r[0]!="number"){const i=[];for(let n=0,s=r.length;n<s;n++)i.push(r[n].x,r[n].y);r=i}this.points=r,this.type=Ne.POLY,this.closeStroke=!0}clone(){const e=this.points.slice(),r=new fi(e);return r.closeStroke=this.closeStroke,r}contains(e,r){let i=!1;const n=this.points.length/2;for(let s=0,a=n-1;s<n;a=s++){const o=this.points[s*2],u=this.points[s*2+1],c=this.points[a*2],f=this.points[a*2+1];u>r!=f>r&&e<(c-o)*((r-u)/(f-u))+o&&(i=!i)}return i}toString(){return`[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce((e,r)=>`${e}, ${r}`,"")}]`}}class va{constructor(e=0,r=0,i=0,n=0,s=20){this.x=e,this.y=r,this.width=i,this.height=n,this.radius=s,this.type=Ne.RREC}clone(){return new va(this.x,this.y,this.width,this.height,this.radius)}contains(e,r){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&r>=this.y&&r<=this.y+this.height){const i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(r>=this.y+i&&r<=this.y+this.height-i||e>=this.x+i&&e<=this.x+this.width-i)return!0;let n=e-(this.x+i),s=r-(this.y+i);const a=i*i;if(n*n+s*s<=a||(n=e-(this.x+this.width-i),n*n+s*s<=a)||(s=r-(this.y+this.height-i),n*n+s*s<=a)||(n=e-(this.x+i),n*n+s*s<=a))return!0}return!1}toString(){return`[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}let Ue=class Kn{constructor(e=1,r=0,i=0,n=1,s=0,a=0){this.array=null,this.a=e,this.b=r,this.c=i,this.d=n,this.tx=s,this.ty=a}fromArray(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]}set(e,r,i,n,s,a){return this.a=e,this.b=r,this.c=i,this.d=n,this.tx=s,this.ty=a,this}toArray(e,r){this.array||(this.array=new Float32Array(9));const i=r||this.array;return e?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i}apply(e,r){r=r||new me;const i=e.x,n=e.y;return r.x=this.a*i+this.c*n+this.tx,r.y=this.b*i+this.d*n+this.ty,r}applyInverse(e,r){r=r||new me;const i=1/(this.a*this.d+this.c*-this.b),n=e.x,s=e.y;return r.x=this.d*i*n+-this.c*i*s+(this.ty*this.c-this.tx*this.d)*i,r.y=this.a*i*s+-this.b*i*n+(-this.ty*this.a+this.tx*this.b)*i,r}translate(e,r){return this.tx+=e,this.ty+=r,this}scale(e,r){return this.a*=e,this.d*=r,this.c*=e,this.b*=r,this.tx*=e,this.ty*=r,this}rotate(e){const r=Math.cos(e),i=Math.sin(e),n=this.a,s=this.c,a=this.tx;return this.a=n*r-this.b*i,this.b=n*i+this.b*r,this.c=s*r-this.d*i,this.d=s*i+this.d*r,this.tx=a*r-this.ty*i,this.ty=a*i+this.ty*r,this}append(e){const r=this.a,i=this.b,n=this.c,s=this.d;return this.a=e.a*r+e.b*n,this.b=e.a*i+e.b*s,this.c=e.c*r+e.d*n,this.d=e.c*i+e.d*s,this.tx=e.tx*r+e.ty*n+this.tx,this.ty=e.tx*i+e.ty*s+this.ty,this}setTransform(e,r,i,n,s,a,o,u,c){return this.a=Math.cos(o+c)*s,this.b=Math.sin(o+c)*s,this.c=-Math.sin(o-u)*a,this.d=Math.cos(o-u)*a,this.tx=e-(i*this.a+n*this.c),this.ty=r-(i*this.b+n*this.d),this}prepend(e){const r=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const i=this.a,n=this.c;this.a=i*e.a+this.b*e.c,this.b=i*e.b+this.b*e.d,this.c=n*e.a+this.d*e.c,this.d=n*e.b+this.d*e.d}return this.tx=r*e.a+this.ty*e.c+e.tx,this.ty=r*e.b+this.ty*e.d+e.ty,this}decompose(e){const r=this.a,i=this.b,n=this.c,s=this.d,a=e.pivot,o=-Math.atan2(-n,s),u=Math.atan2(i,r),c=Math.abs(o+u);return c<1e-5||Math.abs(gn-c)<1e-5?(e.rotation=u,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=o,e.skew.y=u),e.scale.x=Math.sqrt(r*r+i*i),e.scale.y=Math.sqrt(n*n+s*s),e.position.x=this.tx+(a.x*r+a.y*n),e.position.y=this.ty+(a.x*i+a.y*s),e}invert(){const e=this.a,r=this.b,i=this.c,n=this.d,s=this.tx,a=e*n-r*i;return this.a=n/a,this.b=-r/a,this.c=-i/a,this.d=e/a,this.tx=(i*this.ty-n*s)/a,this.ty=-(e*this.ty-r*s)/a,this}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const e=new Kn;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyTo(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}toString(){return`[@pixi/math:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return new Kn}static get TEMP_MATRIX(){return new Kn}};const Zt=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Qt=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Jt=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],er=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],ya=[],ku=[],vn=Math.sign;function p1(){for(let t=0;t<16;t++){const e=[];ya.push(e);for(let r=0;r<16;r++){const i=vn(Zt[t]*Zt[r]+Jt[t]*Qt[r]),n=vn(Qt[t]*Zt[r]+er[t]*Qt[r]),s=vn(Zt[t]*Jt[r]+Jt[t]*er[r]),a=vn(Qt[t]*Jt[r]+er[t]*er[r]);for(let o=0;o<16;o++)if(Zt[o]===i&&Qt[o]===n&&Jt[o]===s&&er[o]===a){e.push(o);break}}}for(let t=0;t<16;t++){const e=new Ue;e.set(Zt[t],Qt[t],Jt[t],er[t],0,0),ku.push(e)}}p1();const be={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:t=>Zt[t],uY:t=>Qt[t],vX:t=>Jt[t],vY:t=>er[t],inv:t=>t&8?t&15:-t&7,add:(t,e)=>ya[t][e],sub:(t,e)=>ya[t][be.inv(e)],rotate180:t=>t^4,isVertical:t=>(t&3)===2,byDirection:(t,e)=>Math.abs(t)*2<=Math.abs(e)?e>=0?be.S:be.N:Math.abs(e)*2<=Math.abs(t)?t>0?be.E:be.W:e>0?t>0?be.SE:be.SW:t>0?be.NE:be.NW,matrixAppendRotationInv:(t,e,r=0,i=0)=>{const n=ku[be.inv(e)];n.tx=r,n.ty=i,t.append(n)}};class Dt{constructor(e,r,i=0,n=0){this._x=i,this._y=n,this.cb=e,this.scope=r}clone(e=this.cb,r=this.scope){return new Dt(e,r,this._x,this._y)}set(e=0,r=e){return(this._x!==e||this._y!==r)&&(this._x=e,this._y=r,this.cb.call(this.scope)),this}copyFrom(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this.cb.call(this.scope)),this}copyTo(e){return e.set(this._x,this._y),e}equals(e){return e.x===this._x&&e.y===this._y}toString(){return`[@pixi/math:ObservablePoint x=0 y=0 scope=${this.scope}]`}get x(){return this._x}set x(e){this._x!==e&&(this._x=e,this.cb.call(this.scope))}get y(){return this._y}set y(e){this._y!==e&&(this._y=e,this.cb.call(this.scope))}}const Du=class{constructor(){this.worldTransform=new Ue,this.localTransform=new Ue,this.position=new Dt(this.onChange,this,0,0),this.scale=new Dt(this.onChange,this,1,1),this.pivot=new Dt(this.onChange,this,0,0),this.skew=new Dt(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}onChange(){this._localID++}updateSkew(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++}toString(){return`[@pixi/math:Transform position=(${this.position.x}, ${this.position.y}) rotation=${this.rotation} scale=(${this.scale.x}, ${this.scale.y}) skew=(${this.skew.x}, ${this.skew.y}) ]`}updateLocalTransform(){const t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)}updateTransform(t){const e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){const r=t.worldTransform,i=this.worldTransform;i.a=e.a*r.a+e.b*r.c,i.b=e.a*r.b+e.b*r.d,i.c=e.c*r.a+e.d*r.c,i.d=e.c*r.b+e.d*r.d,i.tx=e.tx*r.a+e.ty*r.c+r.tx,i.ty=e.tx*r.b+e.ty*r.d+r.ty,this._parentID=t._worldID,this._worldID++}}setFromMatrix(t){t.decompose(this),this._localID++}get rotation(){return this._rotation}set rotation(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())}};let xa=Du;xa.IDENTITY=new Du;var m1=`varying vec2 vTextureCoord;
|
|
45
45
|
|
|
46
46
|
uniform sampler2D uSampler;
|
|
47
47
|
|
|
48
48
|
void main(void){
|
|
49
49
|
gl_FragColor *= texture2D(uSampler, vTextureCoord);
|
|
50
|
-
}`,
|
|
50
|
+
}`,g1=`attribute vec2 aVertexPosition;
|
|
51
51
|
attribute vec2 aTextureCoord;
|
|
52
52
|
|
|
53
53
|
uniform mat3 projectionMatrix;
|
|
@@ -58,7 +58,7 @@ void main(void){
|
|
|
58
58
|
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
|
59
59
|
vTextureCoord = aTextureCoord;
|
|
60
60
|
}
|
|
61
|
-
`;function
|
|
61
|
+
`;function Lu(t,e,r){const i=t.createShader(e);return t.shaderSource(i,r),t.compileShader(i),i}function ba(t){const e=new Array(t);for(let r=0;r<e.length;r++)e[r]=!1;return e}function Bu(t,e){switch(t){case"float":return 0;case"vec2":return new Float32Array(2*e);case"vec3":return new Float32Array(3*e);case"vec4":return new Float32Array(4*e);case"int":case"uint":case"sampler2D":case"sampler2DArray":return 0;case"ivec2":return new Int32Array(2*e);case"ivec3":return new Int32Array(3*e);case"ivec4":return new Int32Array(4*e);case"uvec2":return new Uint32Array(2*e);case"uvec3":return new Uint32Array(3*e);case"uvec4":return new Uint32Array(4*e);case"bool":return!1;case"bvec2":return ba(2*e);case"bvec3":return ba(3*e);case"bvec4":return ba(4*e);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const Pr=[{test:t=>t.type==="float"&&t.size===1&&!t.isArray,code:t=>`
|
|
62
62
|
if(uv["${t}"] !== ud["${t}"].value)
|
|
63
63
|
{
|
|
64
64
|
ud["${t}"].value = uv["${t}"]
|
|
@@ -178,7 +178,7 @@ void main(void){
|
|
|
178
178
|
cv[3] = v[3];
|
|
179
179
|
|
|
180
180
|
gl.uniform4f(ud["${t}"].location, v[0], v[1], v[2], v[3])
|
|
181
|
-
}`}],
|
|
181
|
+
}`}],_1={float:`
|
|
182
182
|
if (cv !== v)
|
|
183
183
|
{
|
|
184
184
|
cu.value = v;
|
|
@@ -314,36 +314,36 @@ void main(void){
|
|
|
314
314
|
cu.value = v;
|
|
315
315
|
|
|
316
316
|
gl.uniform1i(location, v);
|
|
317
|
-
}`},
|
|
317
|
+
}`},v1={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",uint:"gl.uniform1uiv(location, v)",uvec2:"gl.uniform2uiv(location, v)",uvec3:"gl.uniform3uiv(location, v)",uvec4:"gl.uniform4uiv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};function y1(t,e){var i;const r=[`
|
|
318
318
|
var v = null;
|
|
319
319
|
var cv = null;
|
|
320
320
|
var cu = null;
|
|
321
321
|
var t = 0;
|
|
322
322
|
var gl = renderer.gl;
|
|
323
|
-
`];for(const
|
|
324
|
-
renderer.shader.syncUniformBufferGroup(uv.${
|
|
323
|
+
`];for(const n in t.uniforms){const s=e[n];if(!s){(i=t.uniforms[n])!=null&&i.group&&(t.uniforms[n].ubo?r.push(`
|
|
324
|
+
renderer.shader.syncUniformBufferGroup(uv.${n}, '${n}');
|
|
325
325
|
`):r.push(`
|
|
326
|
-
renderer.shader.syncUniformGroup(uv.${
|
|
327
|
-
`));continue}const
|
|
328
|
-
cu = ud["${
|
|
326
|
+
renderer.shader.syncUniformGroup(uv.${n}, syncData);
|
|
327
|
+
`));continue}const a=t.uniforms[n];let o=!1;for(let u=0;u<Pr.length;u++)if(Pr[u].test(s,a)){r.push(Pr[u].code(n,a)),o=!0;break}if(!o){const c=(s.size===1&&!s.isArray?_1:v1)[s.type].replace("location",`ud["${n}"].location`);r.push(`
|
|
328
|
+
cu = ud["${n}"];
|
|
329
329
|
cv = cu.value;
|
|
330
|
-
v = uv["${
|
|
331
|
-
${
|
|
332
|
-
`))}const
|
|
333
|
-
`).map((
|
|
334
|
-
`),
|
|
335
|
-
`);
|
|
336
|
-
${t}`}else if(r!==
|
|
330
|
+
v = uv["${n}"];
|
|
331
|
+
${c};`)}}return new Function("ud","uv","renderer","syncData",r.join(`
|
|
332
|
+
`))}const Uu={};let Mr=Uu;function x1(){if(Mr===Uu||Mr!=null&&Mr.isContextLost()){const t=q.ADAPTER.createCanvas();let e;q.PREFER_ENV>=Ht.WEBGL2&&(e=t.getContext("webgl2",{})),e||(e=t.getContext("webgl",{})||t.getContext("experimental-webgl",{}),e?e.getExtension("WEBGL_draw_buffers"):e=null),Mr=e}return Mr}let yn;function b1(){if(!yn){yn=Qe.MEDIUM;const t=x1();t&&t.getShaderPrecisionFormat&&(yn=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision?Qe.HIGH:Qe.MEDIUM)}return yn}function $u(t,e){const r=t.getShaderSource(e).split(`
|
|
333
|
+
`).map((c,f)=>`${f}: ${c}`),i=t.getShaderInfoLog(e),n=i.split(`
|
|
334
|
+
`),s={},a=n.map(c=>parseFloat(c.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(c=>c&&!s[c]?(s[c]=!0,!0):!1),o=[""];a.forEach(c=>{r[c-1]=`%c${r[c-1]}%c`,o.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});const u=r.join(`
|
|
335
|
+
`);o[0]=u,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn(...o),console.groupEnd()}function T1(t,e,r,i){t.getProgramParameter(e,t.LINK_STATUS)||(t.getShaderParameter(r,t.COMPILE_STATUS)||$u(t,r),t.getShaderParameter(i,t.COMPILE_STATUS)||$u(t,i),console.error("PixiJS Error: Could not initialize shader."),t.getProgramInfoLog(e)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(e)))}const w1={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function Gu(t){return w1[t]}let xn=null;const zu={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function ju(t,e){if(!xn){const r=Object.keys(zu);xn={};for(let i=0;i<r.length;++i){const n=r[i];xn[t[n]]=zu[n]}}return xn[e]}function Hu(t,e,r){if(t.substring(0,9)!=="precision"){let i=e;return e===Qe.HIGH&&r!==Qe.HIGH&&(i=Qe.MEDIUM),`precision ${i} float;
|
|
336
|
+
${t}`}else if(r!==Qe.HIGH&&t.substring(0,15)==="precision highp")return t.replace("precision highp","precision mediump");return t}let di;function S1(){if(typeof di=="boolean")return di;try{di=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{di=!1}return di}let A1=0;const bn={},Fr=class{constructor(t,e,r="pixi-shader",i={}){this.extra={},this.id=A1++,this.vertexSrc=t||Fr.defaultVertexSrc,this.fragmentSrc=e||Fr.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),this.extra=i,this.vertexSrc.substring(0,8)!=="#version"&&(r=r.replace(/\s+/g,"-"),bn[r]?(bn[r]++,r+=`-${bn[r]}`):bn[r]=1,this.vertexSrc=`#define SHADER_NAME ${r}
|
|
337
337
|
${this.vertexSrc}`,this.fragmentSrc=`#define SHADER_NAME ${r}
|
|
338
|
-
${this.fragmentSrc}`,this.vertexSrc=
|
|
338
|
+
${this.fragmentSrc}`,this.vertexSrc=Hu(this.vertexSrc,Fr.defaultVertexPrecision,Qe.HIGH),this.fragmentSrc=Hu(this.fragmentSrc,Fr.defaultFragmentPrecision,b1())),this.glPrograms={},this.syncUniforms=null}static get defaultVertexSrc(){return g1}static get defaultFragmentSrc(){return m1}static from(t,e,r){const i=t+e;let n=Ru[i];return n||(Ru[i]=n=new Fr(t,e,r)),n}};let Tt=Fr;Tt.defaultVertexPrecision=Qe.HIGH,Tt.defaultFragmentPrecision=_r.apple.device?Qe.HIGH:Qe.MEDIUM;let E1=0;class nt{constructor(e,r,i){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=E1++,this.static=!!r,this.ubo=!!i,e instanceof Be?(this.buffer=e,this.buffer.type=pt.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=e,this.ubo&&(this.buffer=new Be(new Float32Array(1)),this.buffer.type=pt.UNIFORM_BUFFER,this.autoManage=!0))}update(){this.dirtyId++,!this.autoManage&&this.buffer&&this.buffer.update()}add(e,r,i){if(!this.ubo)this.uniforms[e]=new nt(r,i);else throw new Error("[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them")}static from(e,r,i){return new nt(e,r,i)}static uboFrom(e,r){return new nt(e,r??!0,!0)}}class pi{constructor(e,r){this.uniformBindCount=0,this.program=e,r?r instanceof nt?this.uniformGroup=r:this.uniformGroup=new nt(r):this.uniformGroup=new nt({}),this.disposeRunner=new it("disposeShader")}checkUniformExists(e,r){if(r.uniforms[e])return!0;for(const i in r.uniforms){const n=r.uniforms[i];if(n.group&&this.checkUniformExists(e,n))return!0}return!1}destroy(){this.uniformGroup=null,this.disposeRunner.emit(this),this.disposeRunner.destroy()}get uniforms(){return this.uniformGroup.uniforms}static from(e,r,i){const n=Tt.from(e,r);return new pi(n,i)}}class C1{constructor(e,r){if(this.vertexSrc=e,this.fragTemplate=r,this.programCache={},this.defaultGroupCache={},!r.includes("%count%"))throw new Error('Fragment template must contain "%count%".');if(!r.includes("%forloop%"))throw new Error('Fragment template must contain "%forloop%".')}generateShader(e){if(!this.programCache[e]){const i=new Int32Array(e);for(let s=0;s<e;s++)i[s]=s;this.defaultGroupCache[e]=nt.from({uSamplers:i},!0);let n=this.fragTemplate;n=n.replace(/%count%/gi,`${e}`),n=n.replace(/%forloop%/gi,this.generateSampleSrc(e)),this.programCache[e]=new Tt(this.vertexSrc,n)}const r={tint:new Float32Array([1,1,1,1]),translationMatrix:new Ue,default:this.defaultGroupCache[e]};return new pi(this.programCache[e],r)}generateSampleSrc(e){let r="";r+=`
|
|
339
339
|
`,r+=`
|
|
340
|
-
`;for(let
|
|
341
|
-
else `),
|
|
340
|
+
`;for(let i=0;i<e;i++)i>0&&(r+=`
|
|
341
|
+
else `),i<e-1&&(r+=`if(vTextureId < ${i}.5)`),r+=`
|
|
342
342
|
{`,r+=`
|
|
343
|
-
color = texture2D(uSamplers[${
|
|
343
|
+
color = texture2D(uSamplers[${i}], vTextureCoord);`,r+=`
|
|
344
344
|
}`;return r+=`
|
|
345
345
|
`,r+=`
|
|
346
|
-
`,r}}class
|
|
346
|
+
`,r}}class Ta{constructor(){this.elements=[],this.ids=[],this.count=0}clear(){for(let e=0;e<this.count;e++)this.elements[e]=null;this.count=0}}function I1(){return!_r.apple.device}function R1(t){let e=!0;const r=q.ADAPTER.getNavigator();if(_r.tablet||_r.phone){if(_r.apple.device){const i=r.userAgent.match(/OS (\d+)_(\d+)?/);i&&parseInt(i[1],10)<11&&(e=!1)}if(_r.android.device){const i=r.userAgent.match(/Android\s([0-9.]*)/);i&&parseInt(i[1],10)<7&&(e=!1)}}return e?t:4}class Vu{constructor(e){this.renderer=e}flush(){}destroy(){this.renderer=null}start(){}stop(){this.flush()}render(e){}}var P1=`varying vec2 vTextureCoord;
|
|
347
347
|
varying vec4 vColor;
|
|
348
348
|
varying float vTextureId;
|
|
349
349
|
uniform sampler2D uSamplers[%count%];
|
|
@@ -353,7 +353,7 @@ void main(void){
|
|
|
353
353
|
%forloop%
|
|
354
354
|
gl_FragColor = color * vColor;
|
|
355
355
|
}
|
|
356
|
-
`,
|
|
356
|
+
`,M1=`precision highp float;
|
|
357
357
|
attribute vec2 aVertexPosition;
|
|
358
358
|
attribute vec2 aTextureCoord;
|
|
359
359
|
attribute vec4 aColor;
|
|
@@ -374,14 +374,14 @@ void main(void){
|
|
|
374
374
|
vTextureId = aTextureId;
|
|
375
375
|
vColor = aColor * tint;
|
|
376
376
|
}
|
|
377
|
-
`;const
|
|
377
|
+
`;const st=class extends Vu{constructor(t){super(t),this.setShaderGenerator(),this.geometryClass=Nu,this.vertexSize=6,this.state=pn.for2d(),this.size=st.defaultBatchSize*4,this._vertexCount=0,this._indexCount=0,this._bufferedElements=[],this._bufferedTextures=[],this._bufferSize=0,this._shader=null,this._packedGeometries=[],this._packedGeometryPoolSize=2,this._flushId=0,this._aBuffers={},this._iBuffers={},this.maxTextures=1,this.renderer.on("prerender",this.onPrerender,this),t.runners.contextChange.add(this),this._dcIndex=0,this._aIndex=0,this._iIndex=0,this._attributeBuffer=null,this._indexBuffer=null,this._tempBoundTextures=[]}static get defaultMaxTextures(){return this._defaultMaxTextures=this._defaultMaxTextures??R1(32),this._defaultMaxTextures}static set defaultMaxTextures(t){this._defaultMaxTextures=t}static get canUploadSameBuffer(){return this._canUploadSameBuffer=this._canUploadSameBuffer??I1(),this._canUploadSameBuffer}static set canUploadSameBuffer(t){this._canUploadSameBuffer=t}get MAX_TEXTURES(){return ne("7.1.0","BatchRenderer#MAX_TEXTURES renamed to BatchRenderer#maxTextures"),this.maxTextures}static get defaultVertexSrc(){return M1}static get defaultFragmentTemplate(){return P1}setShaderGenerator({vertex:t=st.defaultVertexSrc,fragment:e=st.defaultFragmentTemplate}={}){this.shaderGenerator=new C1(t,e)}contextChange(){const t=this.renderer.gl;q.PREFER_ENV===Ht.WEBGL_LEGACY?this.maxTextures=1:(this.maxTextures=Math.min(t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),st.defaultMaxTextures),this.maxTextures=s1(this.maxTextures,t)),this._shader=this.shaderGenerator.generateShader(this.maxTextures);for(let e=0;e<this._packedGeometryPoolSize;e++)this._packedGeometries[e]=new this.geometryClass;this.initFlushBuffers()}initFlushBuffers(){const{_drawCallPool:t,_textureArrayPool:e}=st,r=this.size/4,i=Math.floor(r/this.maxTextures)+1;for(;t.length<r;)t.push(new ga);for(;e.length<i;)e.push(new Ta);for(let n=0;n<this.maxTextures;n++)this._tempBoundTextures[n]=null}onPrerender(){this._flushId=0}render(t){t._texture.valid&&(this._vertexCount+t.vertexData.length/2>this.size&&this.flush(),this._vertexCount+=t.vertexData.length/2,this._indexCount+=t.indices.length,this._bufferedTextures[this._bufferSize]=t._texture.baseTexture,this._bufferedElements[this._bufferSize++]=t)}buildTexturesAndDrawCalls(){const{_bufferedTextures:t,maxTextures:e}=this,r=st._textureArrayPool,i=this.renderer.batch,n=this._tempBoundTextures,s=this.renderer.textureGC.count;let a=++oe._globalBatch,o=0,u=r[0],c=0;i.copyBoundTextures(n,e);for(let f=0;f<this._bufferSize;++f){const l=t[f];t[f]=null,l._batchEnabled!==a&&(u.count>=e&&(i.boundArray(u,n,a,e),this.buildDrawCalls(u,c,f),c=f,u=r[++o],++a),l._batchEnabled=a,l.touched=s,u.elements[u.count++]=l)}u.count>0&&(i.boundArray(u,n,a,e),this.buildDrawCalls(u,c,this._bufferSize),++o,++a);for(let f=0;f<n.length;f++)n[f]=null;oe._globalBatch=a}buildDrawCalls(t,e,r){const{_bufferedElements:i,_attributeBuffer:n,_indexBuffer:s,vertexSize:a}=this,o=st._drawCallPool;let u=this._dcIndex,c=this._aIndex,f=this._iIndex,l=o[u];l.start=this._iIndex,l.texArray=t;for(let h=e;h<r;++h){const d=i[h],p=d._texture.baseTexture,m=Jx[p.alphaMode?1:0][d.blendMode];i[h]=null,e<h&&l.blend!==m&&(l.size=f-l.start,e=h,l=o[++u],l.texArray=t,l.start=f),this.packInterleavedGeometry(d,n,s,c,f),c+=d.vertexData.length/2*a,f+=d.indices.length,l.blend=m}e<r&&(l.size=f-l.start,++u),this._dcIndex=u,this._aIndex=c,this._iIndex=f}bindAndClearTexArray(t){const e=this.renderer.texture;for(let r=0;r<t.count;r++)e.bind(t.elements[r],t.ids[r]),t.elements[r]=null;t.count=0}updateGeometry(){const{_packedGeometries:t,_attributeBuffer:e,_indexBuffer:r}=this;st.canUploadSameBuffer?(t[this._flushId]._buffer.update(e.rawBinaryData),t[this._flushId]._indexBuffer.update(r),this.renderer.geometry.updateBuffers()):(this._packedGeometryPoolSize<=this._flushId&&(this._packedGeometryPoolSize++,t[this._flushId]=new this.geometryClass),t[this._flushId]._buffer.update(e.rawBinaryData),t[this._flushId]._indexBuffer.update(r),this.renderer.geometry.bind(t[this._flushId]),this.renderer.geometry.updateBuffers(),this._flushId++)}drawBatches(){const t=this._dcIndex,{gl:e,state:r}=this.renderer,i=st._drawCallPool;let n=null;for(let s=0;s<t;s++){const{texArray:a,type:o,size:u,start:c,blend:f}=i[s];n!==a&&(n=a,this.bindAndClearTexArray(a)),this.state.blendMode=f,r.set(this.state),e.drawElements(o,u,e.UNSIGNED_SHORT,c*2)}}flush(){this._vertexCount!==0&&(this._attributeBuffer=this.getAttributeBuffer(this._vertexCount),this._indexBuffer=this.getIndexBuffer(this._indexCount),this._aIndex=0,this._iIndex=0,this._dcIndex=0,this.buildTexturesAndDrawCalls(),this.updateGeometry(),this.drawBatches(),this._bufferSize=0,this._vertexCount=0,this._indexCount=0)}start(){this.renderer.state.set(this.state),this.renderer.texture.ensureSamplerType(this.maxTextures),this.renderer.shader.bind(this._shader),st.canUploadSameBuffer&&this.renderer.geometry.bind(this._packedGeometries[this._flushId])}stop(){this.flush()}destroy(){for(let t=0;t<this._packedGeometryPoolSize;t++)this._packedGeometries[t]&&this._packedGeometries[t].destroy();this.renderer.off("prerender",this.onPrerender,this),this._aBuffers=null,this._iBuffers=null,this._packedGeometries=null,this._attributeBuffer=null,this._indexBuffer=null,this._shader&&(this._shader.destroy(),this._shader=null),super.destroy()}getAttributeBuffer(t){const e=hn(Math.ceil(t/8)),r=Iu(e),i=e*8;this._aBuffers.length<=r&&(this._iBuffers.length=r+1);let n=this._aBuffers[i];return n||(this._aBuffers[i]=n=new r1(i*this.vertexSize*4)),n}getIndexBuffer(t){const e=hn(Math.ceil(t/12)),r=Iu(e),i=e*12;this._iBuffers.length<=r&&(this._iBuffers.length=r+1);let n=this._iBuffers[r];return n||(this._iBuffers[r]=n=new Uint16Array(i)),n}packInterleavedGeometry(t,e,r,i,n){const{uint32View:s,float32View:a}=e,o=i/this.vertexSize,u=t.uvs,c=t.indices,f=t.vertexData,l=t._texture.baseTexture._batchLocation,h=Math.min(t.worldAlpha,1),d=Oe.shared.setValue(t._tintRGB).toPremultiplied(h);for(let p=0;p<f.length;p+=2)a[i++]=f[p],a[i++]=f[p+1],a[i++]=u[p],a[i++]=u[p+1],s[i++]=d,a[i++]=l;for(let p=0;p<c.length;p++)r[n++]=o+c[p]}};let at=st;at.defaultBatchSize=4096,at.extension={name:"batch",type:re.RendererPlugin},at._drawCallPool=[],at._textureArrayPool=[],he.add(at);var F1=`varying vec2 vTextureCoord;
|
|
378
378
|
|
|
379
379
|
uniform sampler2D uSampler;
|
|
380
380
|
|
|
381
381
|
void main(void){
|
|
382
382
|
gl_FragColor = texture2D(uSampler, vTextureCoord);
|
|
383
383
|
}
|
|
384
|
-
`,
|
|
384
|
+
`,O1=`attribute vec2 aVertexPosition;
|
|
385
385
|
|
|
386
386
|
uniform mat3 projectionMatrix;
|
|
387
387
|
|
|
@@ -407,7 +407,7 @@ void main(void)
|
|
|
407
407
|
gl_Position = filterVertexPosition();
|
|
408
408
|
vTextureCoord = filterTextureCoord();
|
|
409
409
|
}
|
|
410
|
-
`;const Cs=class extends Es{constructor(t,e,r){const n=qr.from(t||Cs.defaultVertexSrc,e||Cs.defaultFragmentSrc);super(n,r),this.padding=0,this.resolution=Cs.defaultResolution,this.multisample=Cs.defaultMultisample,this.enabled=!0,this.autoFit=!0,this.state=new ka}apply(t,e,r,n,i){t.applyFilter(this,e,r,n)}get blendMode(){return this.state.blendMode}set blendMode(t){this.state.blendMode=t}get resolution(){return this._resolution}set resolution(t){this._resolution=t}static get defaultVertexSrc(){return kC}static get defaultFragmentSrc(){return LC}};let je=Cs;je.defaultResolution=1,je.defaultMultisample=_t.NONE;class Va{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new Ot(0),this.alpha=1}init(e){this.clearBeforeRender=e.clearBeforeRender;const{backgroundColor:r,background:n,backgroundAlpha:i}=e,a=n??r;a!==void 0&&(this.color=a),this.alpha=i}get color(){return this._backgroundColor.value}set color(e){this._backgroundColor.setValue(e)}get alpha(){return this._backgroundColor.alpha}set alpha(e){this._backgroundColor.setAlpha(e)}get backgroundColor(){return this._backgroundColor}destroy(){}}Va.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0},Va.extension={type:[Fe.RendererSystem,Fe.CanvasRendererSystem],name:"background"},qe.add(Va);class Ap{constructor(e){this.renderer=e,this.emptyRenderer=new Sp(e),this.currentRenderer=this.emptyRenderer}setObjectRenderer(e){this.currentRenderer!==e&&(this.currentRenderer.stop(),this.currentRenderer=e,this.currentRenderer.start())}flush(){this.setObjectRenderer(this.emptyRenderer)}reset(){this.setObjectRenderer(this.emptyRenderer)}copyBoundTextures(e,r){const{boundTextures:n}=this.renderer.texture;for(let i=r-1;i>=0;--i)e[i]=n[i]||null,e[i]&&(e[i]._batchLocation=i)}boundArray(e,r,n,i){const{elements:a,ids:u,count:l}=e;let h=0;for(let p=0;p<l;p++){const m=a[p],c=m._batchLocation;if(c>=0&&c<i&&r[c]===m){u[p]=c;continue}for(;h<i;){const d=r[h];if(d&&d._batchEnabled===n&&d._batchLocation===h){h++;continue}u[p]=h,m._batchLocation=h,r[h]=m;break}}}destroy(){this.renderer=null}}Ap.extension={type:Fe.RendererSystem,name:"batch"},qe.add(Ap);let Ep=0;class Xa{constructor(e){this.renderer=e,this.webGLVersion=1,this.extensions={},this.supports={uint32Indices:!1},this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(e){this.gl=e,this.renderer.gl=e,this.renderer.CONTEXT_UID=Ep++}init(e){if(e.context)this.initFromContext(e.context);else{const r=this.renderer.background.alpha<1,n=e.premultipliedAlpha;this.preserveDrawingBuffer=e.preserveDrawingBuffer,this.useContextAlpha=e.useContextAlpha,this.powerPreference=e.powerPreference,this.initFromOptions({alpha:r,premultipliedAlpha:n,antialias:e.antialias,stencil:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:e.powerPreference})}}initFromContext(e){this.gl=e,this.validateContext(e),this.renderer.gl=e,this.renderer.CONTEXT_UID=Ep++,this.renderer.runners.contextChange.emit(e);const r=this.renderer.view;r.addEventListener!==void 0&&(r.addEventListener("webglcontextlost",this.handleContextLost,!1),r.addEventListener("webglcontextrestored",this.handleContextRestored,!1))}initFromOptions(e){const r=this.createContext(this.renderer.view,e);this.initFromContext(r)}createContext(e,r){let n;if(Ie.PREFER_ENV>=Mn.WEBGL2&&(n=e.getContext("webgl2",r)),n)this.webGLVersion=2;else if(this.webGLVersion=1,n=e.getContext("webgl",r)||e.getContext("experimental-webgl",r),!n)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=n,this.getExtensions(),this.gl}getExtensions(){const{gl:e}=this,r={loseContext:e.getExtension("WEBGL_lose_context"),anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc")};this.webGLVersion===1?Object.assign(this.extensions,r,{drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,r,{colorBufferFloat:e.getExtension("EXT_color_buffer_float")})}handleContextLost(e){e.preventDefault(),setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext&&this.extensions.loseContext.restoreContext()},0)}handleContextRestored(){this.renderer.runners.contextChange.emit(this.gl)}destroy(){const e=this.renderer.view;this.renderer=null,e.removeEventListener!==void 0&&(e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored)),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()}postrender(){this.renderer.objectRenderer.renderingToScreen&&this.gl.flush()}validateContext(e){const r=e.getContextAttributes(),n="WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext;n&&(this.webGLVersion=2),r&&!r.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const i=n||!!e.getExtension("OES_element_index_uint");this.supports.uint32Indices=i,i||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")}}Xa.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},Xa.extension={type:Fe.RendererSystem,name:"context"},qe.add(Xa);class DC extends Cl{upload(e,r,n){const i=e.gl;i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.alphaMode===hn.UNPACK);const a=r.realWidth,u=r.realHeight;return n.width===a&&n.height===u?i.texSubImage2D(r.target,0,0,0,a,u,r.format,n.type,this.data):(n.width=a,n.height=u,i.texImage2D(r.target,0,n.internalFormat,a,u,0,r.format,n.type,this.data)),!0}}class Ll{constructor(e,r){this.width=Math.round(e||100),this.height=Math.round(r||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new yr("disposeFramebuffer"),this.multisample=_t.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(e=0,r){return this.colorTextures[e]=r||new ze(null,{scaleMode:kr.NEAREST,resolution:1,mipmap:On.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(e){return this.depthTexture=e||new ze(new DC(null,{width:this.width,height:this.height}),{scaleMode:kr.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:On.OFF,format:Z.DEPTH_COMPONENT,type:Ge.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this}enableDepth(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this}enableStencil(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this}resize(e,r){if(e=Math.round(e),r=Math.round(r),!(e===this.width&&r===this.height)){this.width=e,this.height=r,this.dirtyId++,this.dirtySize++;for(let n=0;n<this.colorTextures.length;n++){const i=this.colorTextures[n],a=i.resolution;i.setSize(e/a,r/a)}if(this.depthTexture){const n=this.depthTexture.resolution;this.depthTexture.setSize(e/n,r/n)}}}dispose(){this.disposeRunner.emit(this,!1)}destroyDepthTexture(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)}}class Cp extends ze{constructor(e={}){if(typeof e=="number"){const r=arguments[0],n=arguments[1],i=arguments[2],a=arguments[3];e={width:r,height:n,scaleMode:i,resolution:a}}e.width=e.width||100,e.height=e.height||100,e.multisample??(e.multisample=_t.NONE),super(null,e),this.mipmap=On.OFF,this.valid=!0,this._clear=new Ot([0,0,0,0]),this.framebuffer=new Ll(this.realWidth,this.realHeight).addColorTexture(0,this),this.framebuffer.multisample=e.multisample,this.maskStack=[],this.filterStack=[{}]}set clearColor(e){this._clear.setValue(e)}get clearColor(){return this._clear.value}get clear(){return this._clear}resize(e,r){this.framebuffer.resize(e*this.resolution,r*this.resolution),this.setRealSize(this.framebuffer.width,this.framebuffer.height)}dispose(){this.framebuffer.dispose(),super.dispose()}destroy(){super.destroy(),this.framebuffer.destroyDepthTexture(),this.framebuffer=null}}class mn extends Ts{constructor(e){const r=e,n=r.naturalWidth||r.videoWidth||r.width,i=r.naturalHeight||r.videoHeight||r.height;super(n,i),this.source=e,this.noSubImage=!1}static crossOrigin(e,r,n){n===void 0&&!r.startsWith("data:")?e.crossOrigin=iC(r):n!==!1&&(e.crossOrigin=typeof n=="string"?n:"anonymous")}upload(e,r,n,i){const a=e.gl,u=r.realWidth,l=r.realHeight;if(i=i||this.source,typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement){if(!i.complete||i.naturalWidth===0)return!1}else if(typeof HTMLVideoElement<"u"&&i instanceof HTMLVideoElement&&i.readyState<=1&&i.buffered.length===0)return!1;return a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.alphaMode===hn.UNPACK),!this.noSubImage&&r.target===a.TEXTURE_2D&&n.width===u&&n.height===l?a.texSubImage2D(a.TEXTURE_2D,0,0,0,r.format,n.type,i):(n.width=u,n.height=l,a.texImage2D(r.target,0,n.internalFormat,r.format,n.type,i)),!0}update(){if(this.destroyed)return;const e=this.source,r=e.naturalWidth||e.videoWidth||e.width,n=e.naturalHeight||e.videoHeight||e.height;this.resize(r,n),super.update()}dispose(){this.source=null}}class Ip extends mn{constructor(e,r){if(r=r||{},typeof e=="string"){const n=new Image;mn.crossOrigin(n,e,r.crossorigin),n.src=e,e=n}super(e),!e.complete&&this._width&&this._height&&(this._width=0,this._height=0),this.url=e.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(r.createBitmap??Ie.CREATE_IMAGE_BITMAP)&&!!globalThis.createImageBitmap,this.alphaMode=typeof r.alphaMode=="number"?r.alphaMode:null,this.bitmap=null,this._load=null,r.autoLoad!==!1&&this.load()}load(e){return this._load?this._load:(e!==void 0&&(this.createBitmap=e),this._load=new Promise((r,n)=>{const i=this.source;this.url=i.src;const a=()=>{this.destroyed||(i.onload=null,i.onerror=null,this.resize(i.width,i.height),this._load=null,this.createBitmap?r(this.process()):r(this))};i.complete&&i.src?a():(i.onload=a,i.onerror=u=>{n(u),this.onError.emit(u)})}),this._load)}process(){const e=this.source;if(this._process!==null)return this._process;if(this.bitmap!==null||!globalThis.createImageBitmap)return Promise.resolve(this);const r=globalThis.createImageBitmap,n=!e.crossOrigin||e.crossOrigin==="anonymous";return this._process=fetch(e.src,{mode:n?"cors":"no-cors"}).then(i=>i.blob()).then(i=>r(i,0,0,e.width,e.height,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===hn.UNPACK?"premultiply":"none"})).then(i=>this.destroyed?Promise.reject():(this.bitmap=i,this.update(),this._process=null,Promise.resolve(this))),this._process}upload(e,r,n){if(typeof this.alphaMode=="number"&&(r.alphaMode=this.alphaMode),!this.createBitmap)return super.upload(e,r,n);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(super.upload(e,r,n,this.bitmap),!this.preserveBitmap){let i=!0;const a=r._glTextures;for(const u in a){const l=a[u];if(l!==n&&l.dirtyId!==r.dirtyId){i=!1;break}}i&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0}dispose(){this.source.onload=null,this.source.onerror=null,super.dispose(),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null}static test(e){return typeof HTMLImageElement<"u"&&(typeof e=="string"||e instanceof HTMLImageElement)}}class Rp{constructor(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}set(e,r,n){const i=r.width,a=r.height;if(n){const u=e.width/2/i,l=e.height/2/a,h=e.x/i+u,p=e.y/a+l;n=ut.add(n,ut.NW),this.x0=h+u*ut.uX(n),this.y0=p+l*ut.uY(n),n=ut.add(n,2),this.x1=h+u*ut.uX(n),this.y1=p+l*ut.uY(n),n=ut.add(n,2),this.x2=h+u*ut.uX(n),this.y2=p+l*ut.uY(n),n=ut.add(n,2),this.x3=h+u*ut.uX(n),this.y3=p+l*ut.uY(n)}else this.x0=e.x/i,this.y0=e.y/a,this.x1=(e.x+e.width)/i,this.y1=e.y/a,this.x2=(e.x+e.width)/i,this.y2=(e.y+e.height)/a,this.x3=e.x/i,this.y3=(e.y+e.height)/a;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3}toString(){return`[@pixi/core:TextureUvs x0=${this.x0} y0=${this.y0} x1=${this.x1} y1=${this.y1} x2=${this.x2} y2=${this.y2} x3=${this.x3} y3=${this.y3}]`}}const Pp=new Rp;function ja(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}class Be extends ma{constructor(e,r,n,i,a,u,l){if(super(),this.noFrame=!1,r||(this.noFrame=!0,r=new Qe(0,0,1,1)),e instanceof Be&&(e=e.baseTexture),this.baseTexture=e,this._frame=r,this.trim=i,this.valid=!1,this._uvs=Pp,this.uvMatrix=null,this.orig=n||r,this._rotate=Number(a||0),a===!0)this._rotate=2;else if(this._rotate%2!==0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");this.defaultAnchor=u?new et(u.x,u.y):new et(0,0),this.defaultBorders=l,this._updateID=0,this.textureCacheIds=[],e.valid?this.noFrame?e.valid&&this.onBaseTextureUpdated(e):this.frame=r:e.once("loaded",this.onBaseTextureUpdated,this),this.noFrame&&e.on("update",this.onBaseTextureUpdated,this)}update(){this.baseTexture.resource&&this.baseTexture.resource.update()}onBaseTextureUpdated(e){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=e.width,this._frame.height=e.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)}destroy(e){if(this.baseTexture){if(e){const{resource:r}=this.baseTexture;r!=null&&r.url&&Gr[r.url]&&Be.removeFromCache(r.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,Be.removeFromCache(this),this.textureCacheIds=null}clone(){var i;const e=this._frame.clone(),r=this._frame===this.orig?e:this.orig.clone(),n=new Be(this.baseTexture,!this.noFrame&&e,r,(i=this.trim)==null?void 0:i.clone(),this.rotate,this.defaultAnchor,this.defaultBorders);return this.noFrame&&(n._frame=e),n}updateUvs(){this._uvs===Pp&&(this._uvs=new Rp),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(e,r={},n=Ie.STRICT_TEXTURE_CACHE){const i=typeof e=="string";let a=null;if(i)a=e;else if(e instanceof ze){if(!e.cacheId){const l=(r==null?void 0:r.pixiIdPrefix)||"pixiid";e.cacheId=`${l}-${bs()}`,ze.addToCache(e,e.cacheId)}a=e.cacheId}else{if(!e._pixiId){const l=(r==null?void 0:r.pixiIdPrefix)||"pixiid";e._pixiId=`${l}_${bs()}`}a=e._pixiId}let u=Gr[a];if(i&&n&&!u)throw new Error(`The cacheId "${a}" does not exist in TextureCache.`);return!u&&!(e instanceof ze)?(r.resolution||(r.resolution=lp(e)),u=new Be(new ze(e,r)),u.baseTexture.cacheId=a,ze.addToCache(u.baseTexture,a),Be.addToCache(u,a)):!u&&e instanceof ze&&(u=new Be(e),Be.addToCache(u,a)),u}static fromURL(e,r){const n=Object.assign({autoLoad:!1},r==null?void 0:r.resourceOptions),i=Be.from(e,Object.assign({resourceOptions:n},r),!1),a=i.baseTexture.resource;return i.baseTexture.valid?Promise.resolve(i):a.load().then(()=>Promise.resolve(i))}static fromBuffer(e,r,n,i){return new Be(ze.fromBuffer(e,r,n,i))}static fromLoader(e,r,n,i){const a=new ze(e,Object.assign({scaleMode:ze.defaultOptions.scaleMode,resolution:lp(r)},i)),{resource:u}=a;u instanceof Ip&&(u.url=r);const l=new Be(a);return n||(n=r),ze.addToCache(l.baseTexture,n),Be.addToCache(l,n),n!==r&&(ze.addToCache(l.baseTexture,r),Be.addToCache(l,r)),l.baseTexture.valid?Promise.resolve(l):new Promise(h=>{l.baseTexture.once("loaded",()=>h(l))})}static addToCache(e,r){r&&(e.textureCacheIds.includes(r)||e.textureCacheIds.push(r),Gr[r]&&Gr[r]!==e&&console.warn(`Texture added to the cache with an id [${r}] that already had an entry`),Gr[r]=e)}static removeFromCache(e){if(typeof e=="string"){const r=Gr[e];if(r){const n=r.textureCacheIds.indexOf(e);return n>-1&&r.textureCacheIds.splice(n,1),delete Gr[e],r}}else if(e!=null&&e.textureCacheIds){for(let r=0;r<e.textureCacheIds.length;++r)Gr[e.textureCacheIds[r]]===e&&delete Gr[e.textureCacheIds[r]];return e.textureCacheIds.length=0,e}return null}get resolution(){return this.baseTexture.resolution}get frame(){return this._frame}set frame(e){this._frame=e,this.noFrame=!1;const{x:r,y:n,width:i,height:a}=e,u=r+i>this.baseTexture.width,l=n+a>this.baseTexture.height;if(u||l){const h=u&&l?"and":"or",p=`X: ${r} + ${i} = ${r+i} > ${this.baseTexture.width}`,m=`Y: ${n} + ${a} = ${n+a} > ${this.baseTexture.height}`;throw new Error(`Texture Error: frame does not fit inside the base Texture dimensions: ${p} ${h} ${m}`)}this.valid=i&&a&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=e),this.valid&&this.updateUvs()}get rotate(){return this._rotate}set rotate(e){this._rotate=e,this.valid&&this.updateUvs()}get width(){return this.orig.width}get height(){return this.orig.height}castToBaseTexture(){return this.baseTexture}static get EMPTY(){return Be._EMPTY||(Be._EMPTY=new Be(new ze),ja(Be._EMPTY),ja(Be._EMPTY.baseTexture)),Be._EMPTY}static get WHITE(){if(!Be._WHITE){const e=Ie.ADAPTER.createCanvas(16,16),r=e.getContext("2d");e.width=16,e.height=16,r.fillStyle="white",r.fillRect(0,0,16,16),Be._WHITE=new Be(ze.from(e)),ja(Be._WHITE),ja(Be._WHITE.baseTexture)}return Be._WHITE}}class Wa extends Be{constructor(e,r){super(e,r),this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}get framebuffer(){return this.baseTexture.framebuffer}get multisample(){return this.framebuffer.multisample}set multisample(e){this.framebuffer.multisample=e}resize(e,r,n=!0){const i=this.baseTexture.resolution,a=Math.round(e*i)/i,u=Math.round(r*i)/i;this.valid=a>0&&u>0,this._frame.width=this.orig.width=a,this._frame.height=this.orig.height=u,n&&this.baseTexture.resize(a,u),this.updateUvs()}setResolution(e){const{baseTexture:r}=this;r.resolution!==e&&(r.setResolution(e),this.resize(r.width,r.height,!1))}static create(e){return new Wa(new Cp(e))}}class Mp{constructor(e){this.texturePool={},this.textureOptions=e||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}createTexture(e,r,n=_t.NONE){const i=new Cp(Object.assign({width:e,height:r,resolution:1,multisample:n},this.textureOptions));return new Wa(i)}getOptimalTexture(e,r,n=1,i=_t.NONE){let a;e=Math.ceil(e*n-1e-6),r=Math.ceil(r*n-1e-6),!this.enableFullScreen||e!==this._pixelsWidth||r!==this._pixelsHeight?(e=Fa(e),r=Fa(r),a=((e&65535)<<16|r&65535)>>>0,i>1&&(a+=i*4294967296)):a=i>1?-i:-1,this.texturePool[a]||(this.texturePool[a]=[]);let u=this.texturePool[a].pop();return u||(u=this.createTexture(e,r,i)),u.filterPoolKey=a,u.setResolution(n),u}getFilterTexture(e,r,n){const i=this.getOptimalTexture(e.width,e.height,r||e.resolution,n||_t.NONE);return i.filterFrame=e.filterFrame,i}returnTexture(e){const r=e.filterPoolKey;e.filterFrame=null,this.texturePool[r].push(e)}returnFilterTexture(e){this.returnTexture(e)}clear(e){if(e=e!==!1,e)for(const r in this.texturePool){const n=this.texturePool[r];if(n)for(let i=0;i<n.length;i++)n[i].destroy(!0)}this.texturePool={}}setScreenSize(e){if(!(e.width===this._pixelsWidth&&e.height===this._pixelsHeight)){this.enableFullScreen=e.width>0&&e.height>0;for(const r in this.texturePool){if(!(Number(r)<0))continue;const n=this.texturePool[r];if(n)for(let i=0;i<n.length;i++)n[i].destroy(!0);this.texturePool[r]=[]}this._pixelsWidth=e.width,this._pixelsHeight=e.height}}}Mp.SCREEN_KEY=-1;class BC extends Ei{constructor(){super(),this.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2])}}class UC extends Ei{constructor(){super(),this.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),this.uvs=new Float32Array([0,0,1,0,1,1,0,1]),this.vertexBuffer=new Lt(this.vertices),this.uvBuffer=new Lt(this.uvs),this.addAttribute("aVertexPosition",this.vertexBuffer).addAttribute("aTextureCoord",this.uvBuffer).addIndex([0,1,2,0,2,3])}map(e,r){let n=0,i=0;return this.uvs[0]=n,this.uvs[1]=i,this.uvs[2]=n+r.width/e.width,this.uvs[3]=i,this.uvs[4]=n+r.width/e.width,this.uvs[5]=i+r.height/e.height,this.uvs[6]=n,this.uvs[7]=i+r.height/e.height,n=r.x,i=r.y,this.vertices[0]=n,this.vertices[1]=i,this.vertices[2]=n+r.width,this.vertices[3]=i,this.vertices[4]=n+r.width,this.vertices[5]=i+r.height,this.vertices[6]=n,this.vertices[7]=i+r.height,this.invalidate(),this}invalidate(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this}}class $C{constructor(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=_t.NONE,this.sourceFrame=new Qe,this.destinationFrame=new Qe,this.bindingSourceFrame=new Qe,this.bindingDestinationFrame=new Qe,this.filters=[],this.transform=null}clear(){this.target=null,this.filters=null,this.renderTexture=null}}const qa=[new et,new et,new et,new et],kl=new kt;class Op{constructor(e){this.renderer=e,this.defaultFilterStack=[{}],this.texturePool=new Mp,this.statePool=[],this.quad=new BC,this.quadUv=new UC,this.tempRect=new Qe,this.activeState={},this.globalUniforms=new xr({outputFrame:new Qe,inputSize:new Float32Array(4),inputPixel:new Float32Array(4),inputClamp:new Float32Array(4),resolution:1,filterArea:new Float32Array(4),filterClamp:new Float32Array(4)},!0),this.forceClear=!1,this.useMaxPadding=!1}init(){this.texturePool.setScreenSize(this.renderer.view)}push(e,r){const n=this.renderer,i=this.defaultFilterStack,a=this.statePool.pop()||new $C,u=this.renderer.renderTexture;let l=r[0].resolution,h=r[0].multisample,p=r[0].padding,m=r[0].autoFit,c=r[0].legacy??!0;for(let v=1;v<r.length;v++){const y=r[v];l=Math.min(l,y.resolution),h=Math.min(h,y.multisample),p=this.useMaxPadding?Math.max(p,y.padding):p+y.padding,m=m&&y.autoFit,c=c||(y.legacy??!0)}i.length===1&&(this.defaultFilterStack[0].renderTexture=u.current),i.push(a),a.resolution=l,a.multisample=h,a.legacy=c,a.target=e,a.sourceFrame.copyFrom(e.filterArea||e.getBounds(!0)),a.sourceFrame.pad(p);const d=this.tempRect.copyFrom(u.sourceFrame);n.projection.transform&&this.transformAABB(kl.copyFrom(n.projection.transform).invert(),d),m?(a.sourceFrame.fit(d),(a.sourceFrame.width<=0||a.sourceFrame.height<=0)&&(a.sourceFrame.width=0,a.sourceFrame.height=0)):a.sourceFrame.intersects(d)||(a.sourceFrame.width=0,a.sourceFrame.height=0),this.roundFrame(a.sourceFrame,u.current?u.current.resolution:n.resolution,u.sourceFrame,u.destinationFrame,n.projection.transform),a.renderTexture=this.getOptimalFilterTexture(a.sourceFrame.width,a.sourceFrame.height,l,h),a.filters=r,a.destinationFrame.width=a.renderTexture.width,a.destinationFrame.height=a.renderTexture.height;const g=this.tempRect;g.x=0,g.y=0,g.width=a.sourceFrame.width,g.height=a.sourceFrame.height,a.renderTexture.filterFrame=a.sourceFrame,a.bindingSourceFrame.copyFrom(u.sourceFrame),a.bindingDestinationFrame.copyFrom(u.destinationFrame),a.transform=n.projection.transform,n.projection.transform=null,u.bind(a.renderTexture,a.sourceFrame,g),n.framebuffer.clear(0,0,0,0)}pop(){const e=this.defaultFilterStack,r=e.pop(),n=r.filters;this.activeState=r;const i=this.globalUniforms.uniforms;i.outputFrame=r.sourceFrame,i.resolution=r.resolution;const a=i.inputSize,u=i.inputPixel,l=i.inputClamp;if(a[0]=r.destinationFrame.width,a[1]=r.destinationFrame.height,a[2]=1/a[0],a[3]=1/a[1],u[0]=Math.round(a[0]*r.resolution),u[1]=Math.round(a[1]*r.resolution),u[2]=1/u[0],u[3]=1/u[1],l[0]=.5*u[2],l[1]=.5*u[3],l[2]=r.sourceFrame.width*a[2]-.5*u[2],l[3]=r.sourceFrame.height*a[3]-.5*u[3],r.legacy){const p=i.filterArea;p[0]=r.destinationFrame.width,p[1]=r.destinationFrame.height,p[2]=r.sourceFrame.x,p[3]=r.sourceFrame.y,i.filterClamp=i.inputClamp}this.globalUniforms.update();const h=e[e.length-1];if(this.renderer.framebuffer.blit(),n.length===1)n[0].apply(this,r.renderTexture,h.renderTexture,Fn.BLEND,r),this.returnFilterTexture(r.renderTexture);else{let p=r.renderTexture,m=this.getOptimalFilterTexture(p.width,p.height,r.resolution);m.filterFrame=p.filterFrame;let c=0;for(c=0;c<n.length-1;++c){c===1&&r.multisample>1&&(m=this.getOptimalFilterTexture(p.width,p.height,r.resolution),m.filterFrame=p.filterFrame),n[c].apply(this,p,m,Fn.CLEAR,r);const d=p;p=m,m=d}n[c].apply(this,p,h.renderTexture,Fn.BLEND,r),c>1&&r.multisample>1&&this.returnFilterTexture(r.renderTexture),this.returnFilterTexture(p),this.returnFilterTexture(m)}r.clear(),this.statePool.push(r)}bindAndClear(e,r=Fn.CLEAR){const{renderTexture:n,state:i}=this.renderer;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e!=null&&e.filterFrame){const u=this.tempRect;u.x=0,u.y=0,u.width=e.filterFrame.width,u.height=e.filterFrame.height,n.bind(e,e.filterFrame,u)}else e!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?n.bind(e):this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);const a=i.stateId&1||this.forceClear;(r===Fn.CLEAR||r===Fn.BLIT&&a)&&this.renderer.framebuffer.clear(0,0,0,0)}applyFilter(e,r,n,i){const a=this.renderer;a.state.set(e.state),this.bindAndClear(n,i),e.uniforms.uSampler=r,e.uniforms.filterGlobals=this.globalUniforms,a.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(r._frame,r.filterFrame),a.geometry.bind(this.quadUv),a.geometry.draw(cn.TRIANGLES)):(a.geometry.bind(this.quad),a.geometry.draw(cn.TRIANGLE_STRIP))}calculateSpriteMatrix(e,r){const{sourceFrame:n,destinationFrame:i}=this.activeState,{orig:a}=r._texture,u=e.set(i.width,0,0,i.height,n.x,n.y),l=r.worldTransform.copyTo(kt.TEMP_MATRIX);return l.invert(),u.prepend(l),u.scale(1/a.width,1/a.height),u.translate(r.anchor.x,r.anchor.y),u}destroy(){this.renderer=null,this.texturePool.clear(!1)}getOptimalFilterTexture(e,r,n=1,i=_t.NONE){return this.texturePool.getOptimalTexture(e,r,n,i)}getFilterTexture(e,r,n){if(typeof e=="number"){const a=e;e=r,r=a}e=e||this.activeState.renderTexture;const i=this.texturePool.getOptimalTexture(e.width,e.height,r||e.resolution,n||_t.NONE);return i.filterFrame=e.filterFrame,i}returnFilterTexture(e){this.texturePool.returnTexture(e)}emptyPool(){this.texturePool.clear(!0)}resize(){this.texturePool.setScreenSize(this.renderer.view)}transformAABB(e,r){const n=qa[0],i=qa[1],a=qa[2],u=qa[3];n.set(r.left,r.top),i.set(r.left,r.bottom),a.set(r.right,r.top),u.set(r.right,r.bottom),e.apply(n,n),e.apply(i,i),e.apply(a,a),e.apply(u,u);const l=Math.min(n.x,i.x,a.x,u.x),h=Math.min(n.y,i.y,a.y,u.y),p=Math.max(n.x,i.x,a.x,u.x),m=Math.max(n.y,i.y,a.y,u.y);r.x=l,r.y=h,r.width=p-l,r.height=m-h}roundFrame(e,r,n,i,a){if(!(e.width<=0||e.height<=0||n.width<=0||n.height<=0)){if(a){const{a:u,b:l,c:h,d:p}=a;if((Math.abs(l)>1e-4||Math.abs(h)>1e-4)&&(Math.abs(u)>1e-4||Math.abs(p)>1e-4))return}a=a?kl.copyFrom(a):kl.identity(),a.translate(-n.x,-n.y).scale(i.width/n.width,i.height/n.height).translate(i.x,i.y),this.transformAABB(a,e),e.ceil(r),this.transformAABB(a.invert(),e)}}}Op.extension={type:Fe.RendererSystem,name:"filter"},qe.add(Op);class GC{constructor(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=_t.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}}const zC=new Qe;class Fp{constructor(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new Ll(10,10),this.msaaSamples=null}contextChange(){this.disposeAll(!0);const e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Qe,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){let r=this.renderer.context.extensions.drawBuffers,n=this.renderer.context.extensions.depthTexture;Ie.PREFER_ENV===Mn.WEBGL_LEGACY&&(r=null,n=null),r?e.drawBuffers=i=>r.drawBuffersWEBGL(i):(this.hasMRT=!1,e.drawBuffers=()=>{}),n||(this.writeDepthTexture=!1)}else this.msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)}bind(e,r,n=0){const{gl:i}=this;if(e){const a=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,i.bindFramebuffer(i.FRAMEBUFFER,a.framebuffer)),a.mipLevel!==n&&(e.dirtyId++,e.dirtyFormat++,a.mipLevel=n),a.dirtyId!==e.dirtyId&&(a.dirtyId=e.dirtyId,a.dirtyFormat!==e.dirtyFormat?(a.dirtyFormat=e.dirtyFormat,a.dirtySize=e.dirtySize,this.updateFramebuffer(e,n)):a.dirtySize!==e.dirtySize&&(a.dirtySize=e.dirtySize,this.resizeFramebuffer(e)));for(let u=0;u<e.colorTextures.length;u++){const l=e.colorTextures[u];this.renderer.texture.unbind(l.parentTextureArray||l)}if(e.depthTexture&&this.renderer.texture.unbind(e.depthTexture),r){const u=r.width>>n,l=r.height>>n,h=u/r.width;this.setViewport(r.x*h,r.y*h,u,l)}else{const u=e.width>>n,l=e.height>>n;this.setViewport(0,0,u,l)}}else this.current&&(this.current=null,i.bindFramebuffer(i.FRAMEBUFFER,null)),r?this.setViewport(r.x,r.y,r.width,r.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)}setViewport(e,r,n,i){const a=this.viewport;e=Math.round(e),r=Math.round(r),n=Math.round(n),i=Math.round(i),(a.width!==n||a.height!==i||a.x!==e||a.y!==r)&&(a.x=e,a.y=r,a.width=n,a.height=i,this.gl.viewport(e,r,n,i))}get size(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}}clear(e,r,n,i,a=Pu.COLOR|Pu.DEPTH){const{gl:u}=this;u.clearColor(e,r,n,i),u.clear(a)}initFramebuffer(e){const{gl:r}=this,n=new GC(r.createFramebuffer());return n.multisample=this.detectSamples(e.multisample),e.glFramebuffers[this.CONTEXT_UID]=n,this.managedFramebuffers.push(e),e.disposeRunner.add(this),n}resizeFramebuffer(e){const{gl:r}=this,n=e.glFramebuffers[this.CONTEXT_UID];n.stencil&&(r.bindRenderbuffer(r.RENDERBUFFER,n.stencil),n.msaaBuffer?r.renderbufferStorageMultisample(r.RENDERBUFFER,n.multisample,r.DEPTH24_STENCIL8,e.width,e.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,e.width,e.height));const i=e.colorTextures;let a=i.length;r.drawBuffers||(a=Math.min(a,1));for(let u=0;u<a;u++){const l=i[u],h=l.parentTextureArray||l;this.renderer.texture.bind(h,0),u===0&&n.msaaBuffer&&(r.bindRenderbuffer(r.RENDERBUFFER,n.msaaBuffer),r.renderbufferStorageMultisample(r.RENDERBUFFER,n.multisample,h._glTextures[this.CONTEXT_UID].internalFormat,e.width,e.height))}e.depthTexture&&this.writeDepthTexture&&this.renderer.texture.bind(e.depthTexture,0)}updateFramebuffer(e,r){const{gl:n}=this,i=e.glFramebuffers[this.CONTEXT_UID],a=e.colorTextures;let u=a.length;n.drawBuffers||(u=Math.min(u,1)),i.multisample>1&&this.canMultisampleFramebuffer(e)?i.msaaBuffer=i.msaaBuffer||n.createRenderbuffer():i.msaaBuffer&&(n.deleteRenderbuffer(i.msaaBuffer),i.msaaBuffer=null,i.blitFramebuffer&&(i.blitFramebuffer.dispose(),i.blitFramebuffer=null));const l=[];for(let h=0;h<u;h++){const p=a[h],m=p.parentTextureArray||p;this.renderer.texture.bind(m,0),h===0&&i.msaaBuffer?(n.bindRenderbuffer(n.RENDERBUFFER,i.msaaBuffer),n.renderbufferStorageMultisample(n.RENDERBUFFER,i.multisample,m._glTextures[this.CONTEXT_UID].internalFormat,e.width,e.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,i.msaaBuffer)):(n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+h,p.target,m._glTextures[this.CONTEXT_UID].texture,r),l.push(n.COLOR_ATTACHMENT0+h))}if(l.length>1&&n.drawBuffers(l),e.depthTexture&&this.writeDepthTexture){const p=e.depthTexture;this.renderer.texture.bind(p,0),n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,p._glTextures[this.CONTEXT_UID].texture,r)}(e.stencil||e.depth)&&!(e.depthTexture&&this.writeDepthTexture)?(i.stencil=i.stencil||n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,i.stencil),i.msaaBuffer?n.renderbufferStorageMultisample(n.RENDERBUFFER,i.multisample,n.DEPTH24_STENCIL8,e.width,e.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,e.width,e.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,i.stencil)):i.stencil&&(n.deleteRenderbuffer(i.stencil),i.stencil=null)}canMultisampleFramebuffer(e){return this.renderer.context.webGLVersion!==1&&e.colorTextures.length<=1&&!e.depthTexture}detectSamples(e){const{msaaSamples:r}=this;let n=_t.NONE;if(e<=1||r===null)return n;for(let i=0;i<r.length;i++)if(r[i]<=e){n=r[i];break}return n===1&&(n=_t.NONE),n}blit(e,r,n){const{current:i,renderer:a,gl:u,CONTEXT_UID:l}=this;if(a.context.webGLVersion!==2||!i)return;const h=i.glFramebuffers[l];if(!h)return;if(!e){if(!h.msaaBuffer)return;const m=i.colorTextures[0];if(!m)return;h.blitFramebuffer||(h.blitFramebuffer=new Ll(i.width,i.height),h.blitFramebuffer.addColorTexture(0,m)),e=h.blitFramebuffer,e.colorTextures[0]!==m&&(e.colorTextures[0]=m,e.dirtyId++,e.dirtyFormat++),(e.width!==i.width||e.height!==i.height)&&(e.width=i.width,e.height=i.height,e.dirtyId++,e.dirtySize++)}r||(r=zC,r.width=i.width,r.height=i.height),n||(n=r);const p=r.width===n.width&&r.height===n.height;this.bind(e),u.bindFramebuffer(u.READ_FRAMEBUFFER,h.framebuffer),u.blitFramebuffer(r.left,r.top,r.right,r.bottom,n.left,n.top,n.right,n.bottom,u.COLOR_BUFFER_BIT,p?u.NEAREST:u.LINEAR)}disposeFramebuffer(e,r){const n=e.glFramebuffers[this.CONTEXT_UID],i=this.gl;if(!n)return;delete e.glFramebuffers[this.CONTEXT_UID];const a=this.managedFramebuffers.indexOf(e);a>=0&&this.managedFramebuffers.splice(a,1),e.disposeRunner.remove(this),r||(i.deleteFramebuffer(n.framebuffer),n.msaaBuffer&&i.deleteRenderbuffer(n.msaaBuffer),n.stencil&&i.deleteRenderbuffer(n.stencil)),n.blitFramebuffer&&this.disposeFramebuffer(n.blitFramebuffer,r)}disposeAll(e){const r=this.managedFramebuffers;this.managedFramebuffers=[];for(let n=0;n<r.length;n++)this.disposeFramebuffer(r[n],e)}forceStencil(){const e=this.current;if(!e)return;const r=e.glFramebuffers[this.CONTEXT_UID];if(!r||r.stencil)return;e.stencil=!0;const n=e.width,i=e.height,a=this.gl,u=a.createRenderbuffer();a.bindRenderbuffer(a.RENDERBUFFER,u),r.msaaBuffer?a.renderbufferStorageMultisample(a.RENDERBUFFER,r.multisample,a.DEPTH24_STENCIL8,n,i):a.renderbufferStorage(a.RENDERBUFFER,a.DEPTH_STENCIL,n,i),r.stencil=u,a.framebufferRenderbuffer(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.RENDERBUFFER,u)}reset(){this.current=this.unknownFramebuffer,this.viewport=new Qe}destroy(){this.renderer=null}}Fp.extension={type:Fe.RendererSystem,name:"framebuffer"},qe.add(Fp);const Dl={5126:4,5123:2,5121:1};class Np{constructor(e){this.renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.canUseUInt32ElementIndex=!1,this.managedGeometries={}}contextChange(){this.disposeAll(!0);const e=this.gl=this.renderer.gl,r=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,r.webGLVersion!==2){let n=this.renderer.context.extensions.vertexArrayObject;Ie.PREFER_ENV===Mn.WEBGL_LEGACY&&(n=null),n?(e.createVertexArray=()=>n.createVertexArrayOES(),e.bindVertexArray=i=>n.bindVertexArrayOES(i),e.deleteVertexArray=i=>n.deleteVertexArrayOES(i)):(this.hasVao=!1,e.createVertexArray=()=>null,e.bindVertexArray=()=>null,e.deleteVertexArray=()=>null)}if(r.webGLVersion!==2){const n=e.getExtension("ANGLE_instanced_arrays");n?(e.vertexAttribDivisor=(i,a)=>n.vertexAttribDivisorANGLE(i,a),e.drawElementsInstanced=(i,a,u,l,h)=>n.drawElementsInstancedANGLE(i,a,u,l,h),e.drawArraysInstanced=(i,a,u,l)=>n.drawArraysInstancedANGLE(i,a,u,l)):this.hasInstance=!1}this.canUseUInt32ElementIndex=r.webGLVersion===2||!!r.extensions.uint32ElementIndex}bind(e,r){r=r||this.renderer.shader.shader;const{gl:n}=this;let i=e.glVertexArrayObjects[this.CONTEXT_UID],a=!1;i||(this.managedGeometries[e.id]=e,e.disposeRunner.add(this),e.glVertexArrayObjects[this.CONTEXT_UID]=i={},a=!0);const u=i[r.program.id]||this.initGeometryVao(e,r,a);this._activeGeometry=e,this._activeVao!==u&&(this._activeVao=u,this.hasVao?n.bindVertexArray(u):this.activateVao(e,r.program)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const e=this._activeGeometry,r=this.renderer.buffer;for(let n=0;n<e.buffers.length;n++){const i=e.buffers[n];r.update(i)}}checkCompatibility(e,r){const n=e.attributes,i=r.attributeData;for(const a in i)if(!n[a])throw new Error(`shader and geometry incompatible, geometry missing the "${a}" attribute`)}getSignature(e,r){const n=e.attributes,i=r.attributeData,a=["g",e.id];for(const u in n)i[u]&&a.push(u,i[u].location);return a.join("-")}initGeometryVao(e,r,n=!0){const i=this.gl,a=this.CONTEXT_UID,u=this.renderer.buffer,l=r.program;l.glPrograms[a]||this.renderer.shader.generateProgram(r),this.checkCompatibility(e,l);const h=this.getSignature(e,l),p=e.glVertexArrayObjects[this.CONTEXT_UID];let m=p[h];if(m)return p[l.id]=m,m;const c=e.buffers,d=e.attributes,g={},v={};for(const y in c)g[y]=0,v[y]=0;for(const y in d)!d[y].size&&l.attributeData[y]?d[y].size=l.attributeData[y].size:d[y].size||console.warn(`PIXI Geometry attribute '${y}' size cannot be determined (likely the bound shader does not have the attribute)`),g[d[y].buffer]+=d[y].size*Dl[d[y].type];for(const y in d){const b=d[y],x=b.size;b.stride===void 0&&(g[b.buffer]===x*Dl[b.type]?b.stride=0:b.stride=g[b.buffer]),b.start===void 0&&(b.start=v[b.buffer],v[b.buffer]+=x*Dl[b.type])}m=i.createVertexArray(),i.bindVertexArray(m);for(let y=0;y<c.length;y++){const b=c[y];u.bind(b),n&&b._glBuffers[a].refCount++}return this.activateVao(e,l),p[l.id]=m,p[h]=m,i.bindVertexArray(null),u.unbind(Dr.ARRAY_BUFFER),m}disposeGeometry(e,r){var l;if(!this.managedGeometries[e.id])return;delete this.managedGeometries[e.id];const n=e.glVertexArrayObjects[this.CONTEXT_UID],i=this.gl,a=e.buffers,u=(l=this.renderer)==null?void 0:l.buffer;if(e.disposeRunner.remove(this),!!n){if(u)for(let h=0;h<a.length;h++){const p=a[h]._glBuffers[this.CONTEXT_UID];p&&(p.refCount--,p.refCount===0&&!r&&u.dispose(a[h],r))}if(!r){for(const h in n)if(h[0]==="g"){const p=n[h];this._activeVao===p&&this.unbind(),i.deleteVertexArray(p)}}delete e.glVertexArrayObjects[this.CONTEXT_UID]}}disposeAll(e){const r=Object.keys(this.managedGeometries);for(let n=0;n<r.length;n++)this.disposeGeometry(this.managedGeometries[r[n]],e)}activateVao(e,r){const n=this.gl,i=this.CONTEXT_UID,a=this.renderer.buffer,u=e.buffers,l=e.attributes;e.indexBuffer&&a.bind(e.indexBuffer);let h=null;for(const p in l){const m=l[p],c=u[m.buffer],d=c._glBuffers[i];if(r.attributeData[p]){h!==d&&(a.bind(c),h=d);const g=r.attributeData[p].location;if(n.enableVertexAttribArray(g),n.vertexAttribPointer(g,m.size,m.type||n.FLOAT,m.normalized,m.stride,m.start),m.instance)if(this.hasInstance)n.vertexAttribDivisor(g,m.divisor);else throw new Error("geometry error, GPU Instancing is not supported on this device")}}}draw(e,r,n,i){const{gl:a}=this,u=this._activeGeometry;if(u.indexBuffer){const l=u.indexBuffer.data.BYTES_PER_ELEMENT,h=l===2?a.UNSIGNED_SHORT:a.UNSIGNED_INT;l===2||l===4&&this.canUseUInt32ElementIndex?u.instanced?a.drawElementsInstanced(e,r||u.indexBuffer.data.length,h,(n||0)*l,i||1):a.drawElements(e,r||u.indexBuffer.data.length,h,(n||0)*l):console.warn("unsupported index buffer type: uint32")}else u.instanced?a.drawArraysInstanced(e,n,r||u.getSize(),i||1):a.drawArrays(e,n,r||u.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this.renderer=null}}Np.extension={type:Fe.RendererSystem,name:"geometry"},qe.add(Np);const Lp=new kt;class HC{constructor(e,r){this._texture=e,this.mapCoord=new kt,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=typeof r>"u"?.5:r,this.isSimple=!1}get texture(){return this._texture}set texture(e){this._texture=e,this._textureID=-1}multiplyUvs(e,r){r===void 0&&(r=e);const n=this.mapCoord;for(let i=0;i<e.length;i+=2){const a=e[i],u=e[i+1];r[i]=a*n.a+u*n.c+n.tx,r[i+1]=a*n.b+u*n.d+n.ty}return r}update(e){const r=this._texture;if(!r||!r.valid||!e&&this._textureID===r._updateID)return!1;this._textureID=r._updateID,this._updateID++;const n=r._uvs;this.mapCoord.set(n.x1-n.x0,n.y1-n.y0,n.x3-n.x0,n.y3-n.y0,n.x0,n.y0);const i=r.orig,a=r.trim;a&&(Lp.set(i.width/a.width,0,0,i.height/a.height,-a.x/a.width,-a.y/a.height),this.mapCoord.append(Lp));const u=r.baseTexture,l=this.uClampFrame,h=this.clampMargin/u.resolution,p=this.clampOffset;return l[0]=(r._frame.x+h+p)/u.width,l[1]=(r._frame.y+h+p)/u.height,l[2]=(r._frame.x+r._frame.width-h+p)/u.width,l[3]=(r._frame.y+r._frame.height-h+p)/u.height,this.uClampOffset[0]=p/u.realWidth,this.uClampOffset[1]=p/u.realHeight,this.isSimple=r._frame.width===u.width&&r._frame.height===u.height&&r.rotate===0,!0}}var VC=`varying vec2 vMaskCoord;
|
|
410
|
+
`;const mi=class extends pi{constructor(t,e,r){const i=Tt.from(t||mi.defaultVertexSrc,e||mi.defaultFragmentSrc);super(i,r),this.padding=0,this.resolution=mi.defaultResolution,this.multisample=mi.defaultMultisample,this.enabled=!0,this.autoFit=!0,this.state=new pn}apply(t,e,r,i,n){t.applyFilter(this,e,r,i)}get blendMode(){return this.state.blendMode}set blendMode(t){this.state.blendMode=t}get resolution(){return this._resolution}set resolution(t){this._resolution=t}static get defaultVertexSrc(){return O1}static get defaultFragmentSrc(){return F1}};let ce=mi;ce.defaultResolution=1,ce.defaultMultisample=Ae.NONE;class Tn{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new Oe(0),this.alpha=1}init(e){this.clearBeforeRender=e.clearBeforeRender;const{backgroundColor:r,background:i,backgroundAlpha:n}=e,s=i??r;s!==void 0&&(this.color=s),this.alpha=n}get color(){return this._backgroundColor.value}set color(e){this._backgroundColor.setValue(e)}get alpha(){return this._backgroundColor.alpha}set alpha(e){this._backgroundColor.setAlpha(e)}get backgroundColor(){return this._backgroundColor}destroy(){}}Tn.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0},Tn.extension={type:[re.RendererSystem,re.CanvasRendererSystem],name:"background"},he.add(Tn);class Xu{constructor(e){this.renderer=e,this.emptyRenderer=new Vu(e),this.currentRenderer=this.emptyRenderer}setObjectRenderer(e){this.currentRenderer!==e&&(this.currentRenderer.stop(),this.currentRenderer=e,this.currentRenderer.start())}flush(){this.setObjectRenderer(this.emptyRenderer)}reset(){this.setObjectRenderer(this.emptyRenderer)}copyBoundTextures(e,r){const{boundTextures:i}=this.renderer.texture;for(let n=r-1;n>=0;--n)e[n]=i[n]||null,e[n]&&(e[n]._batchLocation=n)}boundArray(e,r,i,n){const{elements:s,ids:a,count:o}=e;let u=0;for(let c=0;c<o;c++){const f=s[c],l=f._batchLocation;if(l>=0&&l<n&&r[l]===f){a[c]=l;continue}for(;u<n;){const h=r[u];if(h&&h._batchEnabled===i&&h._batchLocation===u){u++;continue}a[c]=u,f._batchLocation=u,r[u]=f;break}}}destroy(){this.renderer=null}}Xu.extension={type:re.RendererSystem,name:"batch"},he.add(Xu);let Wu=0;class wn{constructor(e){this.renderer=e,this.webGLVersion=1,this.extensions={},this.supports={uint32Indices:!1},this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(e){this.gl=e,this.renderer.gl=e,this.renderer.CONTEXT_UID=Wu++}init(e){if(e.context)this.initFromContext(e.context);else{const r=this.renderer.background.alpha<1,i=e.premultipliedAlpha;this.preserveDrawingBuffer=e.preserveDrawingBuffer,this.useContextAlpha=e.useContextAlpha,this.powerPreference=e.powerPreference,this.initFromOptions({alpha:r,premultipliedAlpha:i,antialias:e.antialias,stencil:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:e.powerPreference})}}initFromContext(e){this.gl=e,this.validateContext(e),this.renderer.gl=e,this.renderer.CONTEXT_UID=Wu++,this.renderer.runners.contextChange.emit(e);const r=this.renderer.view;r.addEventListener!==void 0&&(r.addEventListener("webglcontextlost",this.handleContextLost,!1),r.addEventListener("webglcontextrestored",this.handleContextRestored,!1))}initFromOptions(e){const r=this.createContext(this.renderer.view,e);this.initFromContext(r)}createContext(e,r){let i;if(q.PREFER_ENV>=Ht.WEBGL2&&(i=e.getContext("webgl2",r)),i)this.webGLVersion=2;else if(this.webGLVersion=1,i=e.getContext("webgl",r)||e.getContext("experimental-webgl",r),!i)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),this.gl}getExtensions(){const{gl:e}=this,r={loseContext:e.getExtension("WEBGL_lose_context"),anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc")};this.webGLVersion===1?Object.assign(this.extensions,r,{drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,r,{colorBufferFloat:e.getExtension("EXT_color_buffer_float")})}handleContextLost(e){e.preventDefault(),setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext&&this.extensions.loseContext.restoreContext()},0)}handleContextRestored(){this.renderer.runners.contextChange.emit(this.gl)}destroy(){const e=this.renderer.view;this.renderer=null,e.removeEventListener!==void 0&&(e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored)),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()}postrender(){this.renderer.objectRenderer.renderingToScreen&&this.gl.flush()}validateContext(e){const r=e.getContextAttributes(),i="WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext;i&&(this.webGLVersion=2),r&&!r.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const n=i||!!e.getExtension("OES_element_index_uint");this.supports.uint32Indices=n,n||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")}}wn.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},wn.extension={type:re.RendererSystem,name:"context"},he.add(wn);class N1 extends ma{upload(e,r,i){const n=e.gl;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.alphaMode===Mt.UNPACK);const s=r.realWidth,a=r.realHeight;return i.width===s&&i.height===a?n.texSubImage2D(r.target,0,0,0,s,a,r.format,i.type,this.data):(i.width=s,i.height=a,n.texImage2D(r.target,0,i.internalFormat,s,a,0,r.format,i.type,this.data)),!0}}class wa{constructor(e,r){this.width=Math.round(e||100),this.height=Math.round(r||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new it("disposeFramebuffer"),this.multisample=Ae.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(e=0,r){return this.colorTextures[e]=r||new oe(null,{scaleMode:et.NEAREST,resolution:1,mipmap:Vt.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(e){return this.depthTexture=e||new oe(new N1(null,{width:this.width,height:this.height}),{scaleMode:et.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:Vt.OFF,format:N.DEPTH_COMPONENT,type:ae.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this}enableDepth(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this}enableStencil(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this}resize(e,r){if(e=Math.round(e),r=Math.round(r),!(e===this.width&&r===this.height)){this.width=e,this.height=r,this.dirtyId++,this.dirtySize++;for(let i=0;i<this.colorTextures.length;i++){const n=this.colorTextures[i],s=n.resolution;n.setSize(e/s,r/s)}if(this.depthTexture){const i=this.depthTexture.resolution;this.depthTexture.setSize(e/i,r/i)}}}dispose(){this.disposeRunner.emit(this,!1)}destroyDepthTexture(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)}}class qu extends oe{constructor(e={}){if(typeof e=="number"){const r=arguments[0],i=arguments[1],n=arguments[2],s=arguments[3];e={width:r,height:i,scaleMode:n,resolution:s}}e.width=e.width||100,e.height=e.height||100,e.multisample??(e.multisample=Ae.NONE),super(null,e),this.mipmap=Vt.OFF,this.valid=!0,this._clear=new Oe([0,0,0,0]),this.framebuffer=new wa(this.realWidth,this.realHeight).addColorTexture(0,this),this.framebuffer.multisample=e.multisample,this.maskStack=[],this.filterStack=[{}]}set clearColor(e){this._clear.setValue(e)}get clearColor(){return this._clear.value}get clear(){return this._clear}resize(e,r){this.framebuffer.resize(e*this.resolution,r*this.resolution),this.setRealSize(this.framebuffer.width,this.framebuffer.height)}dispose(){this.framebuffer.dispose(),super.dispose()}destroy(){super.destroy(),this.framebuffer.destroyDepthTexture(),this.framebuffer=null}}class Lt extends hi{constructor(e){const r=e,i=r.naturalWidth||r.videoWidth||r.width,n=r.naturalHeight||r.videoHeight||r.height;super(i,n),this.source=e,this.noSubImage=!1}static crossOrigin(e,r,i){i===void 0&&!r.startsWith("data:")?e.crossOrigin=t1(r):i!==!1&&(e.crossOrigin=typeof i=="string"?i:"anonymous")}upload(e,r,i,n){const s=e.gl,a=r.realWidth,o=r.realHeight;if(n=n||this.source,typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement){if(!n.complete||n.naturalWidth===0)return!1}else if(typeof HTMLVideoElement<"u"&&n instanceof HTMLVideoElement&&n.readyState<=1&&n.buffered.length===0)return!1;return s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.alphaMode===Mt.UNPACK),!this.noSubImage&&r.target===s.TEXTURE_2D&&i.width===a&&i.height===o?s.texSubImage2D(s.TEXTURE_2D,0,0,0,r.format,i.type,n):(i.width=a,i.height=o,s.texImage2D(r.target,0,i.internalFormat,r.format,i.type,n)),!0}update(){if(this.destroyed)return;const e=this.source,r=e.naturalWidth||e.videoWidth||e.width,i=e.naturalHeight||e.videoHeight||e.height;this.resize(r,i),super.update()}dispose(){this.source=null}}class Yu extends Lt{constructor(e,r){if(r=r||{},typeof e=="string"){const i=new Image;Lt.crossOrigin(i,e,r.crossorigin),i.src=e,e=i}super(e),!e.complete&&this._width&&this._height&&(this._width=0,this._height=0),this.url=e.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(r.createBitmap??q.CREATE_IMAGE_BITMAP)&&!!globalThis.createImageBitmap,this.alphaMode=typeof r.alphaMode=="number"?r.alphaMode:null,this.bitmap=null,this._load=null,r.autoLoad!==!1&&this.load()}load(e){return this._load?this._load:(e!==void 0&&(this.createBitmap=e),this._load=new Promise((r,i)=>{const n=this.source;this.url=n.src;const s=()=>{this.destroyed||(n.onload=null,n.onerror=null,this.resize(n.width,n.height),this._load=null,this.createBitmap?r(this.process()):r(this))};n.complete&&n.src?s():(n.onload=s,n.onerror=a=>{i(a),this.onError.emit(a)})}),this._load)}process(){const e=this.source;if(this._process!==null)return this._process;if(this.bitmap!==null||!globalThis.createImageBitmap)return Promise.resolve(this);const r=globalThis.createImageBitmap,i=!e.crossOrigin||e.crossOrigin==="anonymous";return this._process=fetch(e.src,{mode:i?"cors":"no-cors"}).then(n=>n.blob()).then(n=>r(n,0,0,e.width,e.height,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===Mt.UNPACK?"premultiply":"none"})).then(n=>this.destroyed?Promise.reject():(this.bitmap=n,this.update(),this._process=null,Promise.resolve(this))),this._process}upload(e,r,i){if(typeof this.alphaMode=="number"&&(r.alphaMode=this.alphaMode),!this.createBitmap)return super.upload(e,r,i);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(super.upload(e,r,i,this.bitmap),!this.preserveBitmap){let n=!0;const s=r._glTextures;for(const a in s){const o=s[a];if(o!==i&&o.dirtyId!==r.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0}dispose(){this.source.onload=null,this.source.onerror=null,super.dispose(),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null}static test(e){return typeof HTMLImageElement<"u"&&(typeof e=="string"||e instanceof HTMLImageElement)}}class Ku{constructor(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}set(e,r,i){const n=r.width,s=r.height;if(i){const a=e.width/2/n,o=e.height/2/s,u=e.x/n+a,c=e.y/s+o;i=be.add(i,be.NW),this.x0=u+a*be.uX(i),this.y0=c+o*be.uY(i),i=be.add(i,2),this.x1=u+a*be.uX(i),this.y1=c+o*be.uY(i),i=be.add(i,2),this.x2=u+a*be.uX(i),this.y2=c+o*be.uY(i),i=be.add(i,2),this.x3=u+a*be.uX(i),this.y3=c+o*be.uY(i)}else this.x0=e.x/n,this.y0=e.y/s,this.x1=(e.x+e.width)/n,this.y1=e.y/s,this.x2=(e.x+e.width)/n,this.y2=(e.y+e.height)/s,this.x3=e.x/n,this.y3=(e.y+e.height)/s;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3}toString(){return`[@pixi/core:TextureUvs x0=${this.x0} y0=${this.y0} x1=${this.x1} y1=${this.y1} x2=${this.x2} y2=${this.y2} x3=${this.x3} y3=${this.y3}]`}}const Zu=new Ku;function Sn(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}class K extends Xi{constructor(e,r,i,n,s,a,o){if(super(),this.noFrame=!1,r||(this.noFrame=!0,r=new pe(0,0,1,1)),e instanceof K&&(e=e.baseTexture),this.baseTexture=e,this._frame=r,this.trim=n,this.valid=!1,this._uvs=Zu,this.uvMatrix=null,this.orig=i||r,this._rotate=Number(s||0),s===!0)this._rotate=2;else if(this._rotate%2!==0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");this.defaultAnchor=a?new me(a.x,a.y):new me(0,0),this.defaultBorders=o,this._updateID=0,this.textureCacheIds=[],e.valid?this.noFrame?e.valid&&this.onBaseTextureUpdated(e):this.frame=r:e.once("loaded",this.onBaseTextureUpdated,this),this.noFrame&&e.on("update",this.onBaseTextureUpdated,this)}update(){this.baseTexture.resource&&this.baseTexture.resource.update()}onBaseTextureUpdated(e){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=e.width,this._frame.height=e.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)}destroy(e){if(this.baseTexture){if(e){const{resource:r}=this.baseTexture;r!=null&&r.url&&vt[r.url]&&K.removeFromCache(r.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,K.removeFromCache(this),this.textureCacheIds=null}clone(){var n;const e=this._frame.clone(),r=this._frame===this.orig?e:this.orig.clone(),i=new K(this.baseTexture,!this.noFrame&&e,r,(n=this.trim)==null?void 0:n.clone(),this.rotate,this.defaultAnchor,this.defaultBorders);return this.noFrame&&(i._frame=e),i}updateUvs(){this._uvs===Zu&&(this._uvs=new Ku),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(e,r={},i=q.STRICT_TEXTURE_CACHE){const n=typeof e=="string";let s=null;if(n)s=e;else if(e instanceof oe){if(!e.cacheId){const o=(r==null?void 0:r.pixiIdPrefix)||"pixiid";e.cacheId=`${o}-${ui()}`,oe.addToCache(e,e.cacheId)}s=e.cacheId}else{if(!e._pixiId){const o=(r==null?void 0:r.pixiIdPrefix)||"pixiid";e._pixiId=`${o}_${ui()}`}s=e._pixiId}let a=vt[s];if(n&&i&&!a)throw new Error(`The cacheId "${s}" does not exist in TextureCache.`);return!a&&!(e instanceof oe)?(r.resolution||(r.resolution=Pu(e)),a=new K(new oe(e,r)),a.baseTexture.cacheId=s,oe.addToCache(a.baseTexture,s),K.addToCache(a,s)):!a&&e instanceof oe&&(a=new K(e),K.addToCache(a,s)),a}static fromURL(e,r){const i=Object.assign({autoLoad:!1},r==null?void 0:r.resourceOptions),n=K.from(e,Object.assign({resourceOptions:i},r),!1),s=n.baseTexture.resource;return n.baseTexture.valid?Promise.resolve(n):s.load().then(()=>Promise.resolve(n))}static fromBuffer(e,r,i,n){return new K(oe.fromBuffer(e,r,i,n))}static fromLoader(e,r,i,n){const s=new oe(e,Object.assign({scaleMode:oe.defaultOptions.scaleMode,resolution:Pu(r)},n)),{resource:a}=s;a instanceof Yu&&(a.url=r);const o=new K(s);return i||(i=r),oe.addToCache(o.baseTexture,i),K.addToCache(o,i),i!==r&&(oe.addToCache(o.baseTexture,r),K.addToCache(o,r)),o.baseTexture.valid?Promise.resolve(o):new Promise(u=>{o.baseTexture.once("loaded",()=>u(o))})}static addToCache(e,r){r&&(e.textureCacheIds.includes(r)||e.textureCacheIds.push(r),vt[r]&&vt[r]!==e&&console.warn(`Texture added to the cache with an id [${r}] that already had an entry`),vt[r]=e)}static removeFromCache(e){if(typeof e=="string"){const r=vt[e];if(r){const i=r.textureCacheIds.indexOf(e);return i>-1&&r.textureCacheIds.splice(i,1),delete vt[e],r}}else if(e!=null&&e.textureCacheIds){for(let r=0;r<e.textureCacheIds.length;++r)vt[e.textureCacheIds[r]]===e&&delete vt[e.textureCacheIds[r]];return e.textureCacheIds.length=0,e}return null}get resolution(){return this.baseTexture.resolution}get frame(){return this._frame}set frame(e){this._frame=e,this.noFrame=!1;const{x:r,y:i,width:n,height:s}=e,a=r+n>this.baseTexture.width,o=i+s>this.baseTexture.height;if(a||o){const u=a&&o?"and":"or",c=`X: ${r} + ${n} = ${r+n} > ${this.baseTexture.width}`,f=`Y: ${i} + ${s} = ${i+s} > ${this.baseTexture.height}`;throw new Error(`Texture Error: frame does not fit inside the base Texture dimensions: ${c} ${u} ${f}`)}this.valid=n&&s&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=e),this.valid&&this.updateUvs()}get rotate(){return this._rotate}set rotate(e){this._rotate=e,this.valid&&this.updateUvs()}get width(){return this.orig.width}get height(){return this.orig.height}castToBaseTexture(){return this.baseTexture}static get EMPTY(){return K._EMPTY||(K._EMPTY=new K(new oe),Sn(K._EMPTY),Sn(K._EMPTY.baseTexture)),K._EMPTY}static get WHITE(){if(!K._WHITE){const e=q.ADAPTER.createCanvas(16,16),r=e.getContext("2d");e.width=16,e.height=16,r.fillStyle="white",r.fillRect(0,0,16,16),K._WHITE=new K(oe.from(e)),Sn(K._WHITE),Sn(K._WHITE.baseTexture)}return K._WHITE}}class An extends K{constructor(e,r){super(e,r),this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}get framebuffer(){return this.baseTexture.framebuffer}get multisample(){return this.framebuffer.multisample}set multisample(e){this.framebuffer.multisample=e}resize(e,r,i=!0){const n=this.baseTexture.resolution,s=Math.round(e*n)/n,a=Math.round(r*n)/n;this.valid=s>0&&a>0,this._frame.width=this.orig.width=s,this._frame.height=this.orig.height=a,i&&this.baseTexture.resize(s,a),this.updateUvs()}setResolution(e){const{baseTexture:r}=this;r.resolution!==e&&(r.setResolution(e),this.resize(r.width,r.height,!1))}static create(e){return new An(new qu(e))}}class Qu{constructor(e){this.texturePool={},this.textureOptions=e||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}createTexture(e,r,i=Ae.NONE){const n=new qu(Object.assign({width:e,height:r,resolution:1,multisample:i},this.textureOptions));return new An(n)}getOptimalTexture(e,r,i=1,n=Ae.NONE){let s;e=Math.ceil(e*i-1e-6),r=Math.ceil(r*i-1e-6),!this.enableFullScreen||e!==this._pixelsWidth||r!==this._pixelsHeight?(e=hn(e),r=hn(r),s=((e&65535)<<16|r&65535)>>>0,n>1&&(s+=n*4294967296)):s=n>1?-n:-1,this.texturePool[s]||(this.texturePool[s]=[]);let a=this.texturePool[s].pop();return a||(a=this.createTexture(e,r,n)),a.filterPoolKey=s,a.setResolution(i),a}getFilterTexture(e,r,i){const n=this.getOptimalTexture(e.width,e.height,r||e.resolution,i||Ae.NONE);return n.filterFrame=e.filterFrame,n}returnTexture(e){const r=e.filterPoolKey;e.filterFrame=null,this.texturePool[r].push(e)}returnFilterTexture(e){this.returnTexture(e)}clear(e){if(e=e!==!1,e)for(const r in this.texturePool){const i=this.texturePool[r];if(i)for(let n=0;n<i.length;n++)i[n].destroy(!0)}this.texturePool={}}setScreenSize(e){if(!(e.width===this._pixelsWidth&&e.height===this._pixelsHeight)){this.enableFullScreen=e.width>0&&e.height>0;for(const r in this.texturePool){if(!(Number(r)<0))continue;const i=this.texturePool[r];if(i)for(let n=0;n<i.length;n++)i[n].destroy(!0);this.texturePool[r]=[]}this._pixelsWidth=e.width,this._pixelsHeight=e.height}}}Qu.SCREEN_KEY=-1;class k1 extends Rr{constructor(){super(),this.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2])}}class D1 extends Rr{constructor(){super(),this.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),this.uvs=new Float32Array([0,0,1,0,1,1,0,1]),this.vertexBuffer=new Be(this.vertices),this.uvBuffer=new Be(this.uvs),this.addAttribute("aVertexPosition",this.vertexBuffer).addAttribute("aTextureCoord",this.uvBuffer).addIndex([0,1,2,0,2,3])}map(e,r){let i=0,n=0;return this.uvs[0]=i,this.uvs[1]=n,this.uvs[2]=i+r.width/e.width,this.uvs[3]=n,this.uvs[4]=i+r.width/e.width,this.uvs[5]=n+r.height/e.height,this.uvs[6]=i,this.uvs[7]=n+r.height/e.height,i=r.x,n=r.y,this.vertices[0]=i,this.vertices[1]=n,this.vertices[2]=i+r.width,this.vertices[3]=n,this.vertices[4]=i+r.width,this.vertices[5]=n+r.height,this.vertices[6]=i,this.vertices[7]=n+r.height,this.invalidate(),this}invalidate(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this}}class L1{constructor(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=Ae.NONE,this.sourceFrame=new pe,this.destinationFrame=new pe,this.bindingSourceFrame=new pe,this.bindingDestinationFrame=new pe,this.filters=[],this.transform=null}clear(){this.target=null,this.filters=null,this.renderTexture=null}}const En=[new me,new me,new me,new me],Sa=new Ue;class Ju{constructor(e){this.renderer=e,this.defaultFilterStack=[{}],this.texturePool=new Qu,this.statePool=[],this.quad=new k1,this.quadUv=new D1,this.tempRect=new pe,this.activeState={},this.globalUniforms=new nt({outputFrame:new pe,inputSize:new Float32Array(4),inputPixel:new Float32Array(4),inputClamp:new Float32Array(4),resolution:1,filterArea:new Float32Array(4),filterClamp:new Float32Array(4)},!0),this.forceClear=!1,this.useMaxPadding=!1}init(){this.texturePool.setScreenSize(this.renderer.view)}push(e,r){const i=this.renderer,n=this.defaultFilterStack,s=this.statePool.pop()||new L1,a=this.renderer.renderTexture;let o=r[0].resolution,u=r[0].multisample,c=r[0].padding,f=r[0].autoFit,l=r[0].legacy??!0;for(let p=1;p<r.length;p++){const m=r[p];o=Math.min(o,m.resolution),u=Math.min(u,m.multisample),c=this.useMaxPadding?Math.max(c,m.padding):c+m.padding,f=f&&m.autoFit,l=l||(m.legacy??!0)}n.length===1&&(this.defaultFilterStack[0].renderTexture=a.current),n.push(s),s.resolution=o,s.multisample=u,s.legacy=l,s.target=e,s.sourceFrame.copyFrom(e.filterArea||e.getBounds(!0)),s.sourceFrame.pad(c);const h=this.tempRect.copyFrom(a.sourceFrame);i.projection.transform&&this.transformAABB(Sa.copyFrom(i.projection.transform).invert(),h),f?(s.sourceFrame.fit(h),(s.sourceFrame.width<=0||s.sourceFrame.height<=0)&&(s.sourceFrame.width=0,s.sourceFrame.height=0)):s.sourceFrame.intersects(h)||(s.sourceFrame.width=0,s.sourceFrame.height=0),this.roundFrame(s.sourceFrame,a.current?a.current.resolution:i.resolution,a.sourceFrame,a.destinationFrame,i.projection.transform),s.renderTexture=this.getOptimalFilterTexture(s.sourceFrame.width,s.sourceFrame.height,o,u),s.filters=r,s.destinationFrame.width=s.renderTexture.width,s.destinationFrame.height=s.renderTexture.height;const d=this.tempRect;d.x=0,d.y=0,d.width=s.sourceFrame.width,d.height=s.sourceFrame.height,s.renderTexture.filterFrame=s.sourceFrame,s.bindingSourceFrame.copyFrom(a.sourceFrame),s.bindingDestinationFrame.copyFrom(a.destinationFrame),s.transform=i.projection.transform,i.projection.transform=null,a.bind(s.renderTexture,s.sourceFrame,d),i.framebuffer.clear(0,0,0,0)}pop(){const e=this.defaultFilterStack,r=e.pop(),i=r.filters;this.activeState=r;const n=this.globalUniforms.uniforms;n.outputFrame=r.sourceFrame,n.resolution=r.resolution;const s=n.inputSize,a=n.inputPixel,o=n.inputClamp;if(s[0]=r.destinationFrame.width,s[1]=r.destinationFrame.height,s[2]=1/s[0],s[3]=1/s[1],a[0]=Math.round(s[0]*r.resolution),a[1]=Math.round(s[1]*r.resolution),a[2]=1/a[0],a[3]=1/a[1],o[0]=.5*a[2],o[1]=.5*a[3],o[2]=r.sourceFrame.width*s[2]-.5*a[2],o[3]=r.sourceFrame.height*s[3]-.5*a[3],r.legacy){const c=n.filterArea;c[0]=r.destinationFrame.width,c[1]=r.destinationFrame.height,c[2]=r.sourceFrame.x,c[3]=r.sourceFrame.y,n.filterClamp=n.inputClamp}this.globalUniforms.update();const u=e[e.length-1];if(this.renderer.framebuffer.blit(),i.length===1)i[0].apply(this,r.renderTexture,u.renderTexture,Xt.BLEND,r),this.returnFilterTexture(r.renderTexture);else{let c=r.renderTexture,f=this.getOptimalFilterTexture(c.width,c.height,r.resolution);f.filterFrame=c.filterFrame;let l=0;for(l=0;l<i.length-1;++l){l===1&&r.multisample>1&&(f=this.getOptimalFilterTexture(c.width,c.height,r.resolution),f.filterFrame=c.filterFrame),i[l].apply(this,c,f,Xt.CLEAR,r);const h=c;c=f,f=h}i[l].apply(this,c,u.renderTexture,Xt.BLEND,r),l>1&&r.multisample>1&&this.returnFilterTexture(r.renderTexture),this.returnFilterTexture(c),this.returnFilterTexture(f)}r.clear(),this.statePool.push(r)}bindAndClear(e,r=Xt.CLEAR){const{renderTexture:i,state:n}=this.renderer;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e!=null&&e.filterFrame){const a=this.tempRect;a.x=0,a.y=0,a.width=e.filterFrame.width,a.height=e.filterFrame.height,i.bind(e,e.filterFrame,a)}else e!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?i.bind(e):this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);const s=n.stateId&1||this.forceClear;(r===Xt.CLEAR||r===Xt.BLIT&&s)&&this.renderer.framebuffer.clear(0,0,0,0)}applyFilter(e,r,i,n){const s=this.renderer;s.state.set(e.state),this.bindAndClear(i,n),e.uniforms.uSampler=r,e.uniforms.filterGlobals=this.globalUniforms,s.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(r._frame,r.filterFrame),s.geometry.bind(this.quadUv),s.geometry.draw(Pt.TRIANGLES)):(s.geometry.bind(this.quad),s.geometry.draw(Pt.TRIANGLE_STRIP))}calculateSpriteMatrix(e,r){const{sourceFrame:i,destinationFrame:n}=this.activeState,{orig:s}=r._texture,a=e.set(n.width,0,0,n.height,i.x,i.y),o=r.worldTransform.copyTo(Ue.TEMP_MATRIX);return o.invert(),a.prepend(o),a.scale(1/s.width,1/s.height),a.translate(r.anchor.x,r.anchor.y),a}destroy(){this.renderer=null,this.texturePool.clear(!1)}getOptimalFilterTexture(e,r,i=1,n=Ae.NONE){return this.texturePool.getOptimalTexture(e,r,i,n)}getFilterTexture(e,r,i){if(typeof e=="number"){const s=e;e=r,r=s}e=e||this.activeState.renderTexture;const n=this.texturePool.getOptimalTexture(e.width,e.height,r||e.resolution,i||Ae.NONE);return n.filterFrame=e.filterFrame,n}returnFilterTexture(e){this.texturePool.returnTexture(e)}emptyPool(){this.texturePool.clear(!0)}resize(){this.texturePool.setScreenSize(this.renderer.view)}transformAABB(e,r){const i=En[0],n=En[1],s=En[2],a=En[3];i.set(r.left,r.top),n.set(r.left,r.bottom),s.set(r.right,r.top),a.set(r.right,r.bottom),e.apply(i,i),e.apply(n,n),e.apply(s,s),e.apply(a,a);const o=Math.min(i.x,n.x,s.x,a.x),u=Math.min(i.y,n.y,s.y,a.y),c=Math.max(i.x,n.x,s.x,a.x),f=Math.max(i.y,n.y,s.y,a.y);r.x=o,r.y=u,r.width=c-o,r.height=f-u}roundFrame(e,r,i,n,s){if(!(e.width<=0||e.height<=0||i.width<=0||i.height<=0)){if(s){const{a,b:o,c:u,d:c}=s;if((Math.abs(o)>1e-4||Math.abs(u)>1e-4)&&(Math.abs(a)>1e-4||Math.abs(c)>1e-4))return}s=s?Sa.copyFrom(s):Sa.identity(),s.translate(-i.x,-i.y).scale(n.width/i.width,n.height/i.height).translate(n.x,n.y),this.transformAABB(s,e),e.ceil(r),this.transformAABB(s.invert(),e)}}}Ju.extension={type:re.RendererSystem,name:"filter"},he.add(Ju);class B1{constructor(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=Ae.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}}const U1=new pe;class eh{constructor(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new wa(10,10),this.msaaSamples=null}contextChange(){this.disposeAll(!0);const e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new pe,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){let r=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;q.PREFER_ENV===Ht.WEBGL_LEGACY&&(r=null,i=null),r?e.drawBuffers=n=>r.drawBuffersWEBGL(n):(this.hasMRT=!1,e.drawBuffers=()=>{}),i||(this.writeDepthTexture=!1)}else this.msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)}bind(e,r,i=0){const{gl:n}=this;if(e){const s=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,n.bindFramebuffer(n.FRAMEBUFFER,s.framebuffer)),s.mipLevel!==i&&(e.dirtyId++,e.dirtyFormat++,s.mipLevel=i),s.dirtyId!==e.dirtyId&&(s.dirtyId=e.dirtyId,s.dirtyFormat!==e.dirtyFormat?(s.dirtyFormat=e.dirtyFormat,s.dirtySize=e.dirtySize,this.updateFramebuffer(e,i)):s.dirtySize!==e.dirtySize&&(s.dirtySize=e.dirtySize,this.resizeFramebuffer(e)));for(let a=0;a<e.colorTextures.length;a++){const o=e.colorTextures[a];this.renderer.texture.unbind(o.parentTextureArray||o)}if(e.depthTexture&&this.renderer.texture.unbind(e.depthTexture),r){const a=r.width>>i,o=r.height>>i,u=a/r.width;this.setViewport(r.x*u,r.y*u,a,o)}else{const a=e.width>>i,o=e.height>>i;this.setViewport(0,0,a,o)}}else this.current&&(this.current=null,n.bindFramebuffer(n.FRAMEBUFFER,null)),r?this.setViewport(r.x,r.y,r.width,r.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)}setViewport(e,r,i,n){const s=this.viewport;e=Math.round(e),r=Math.round(r),i=Math.round(i),n=Math.round(n),(s.width!==i||s.height!==n||s.x!==e||s.y!==r)&&(s.x=e,s.y=r,s.width=i,s.height=n,this.gl.viewport(e,r,i,n))}get size(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}}clear(e,r,i,n,s=vs.COLOR|vs.DEPTH){const{gl:a}=this;a.clearColor(e,r,i,n),a.clear(s)}initFramebuffer(e){const{gl:r}=this,i=new B1(r.createFramebuffer());return i.multisample=this.detectSamples(e.multisample),e.glFramebuffers[this.CONTEXT_UID]=i,this.managedFramebuffers.push(e),e.disposeRunner.add(this),i}resizeFramebuffer(e){const{gl:r}=this,i=e.glFramebuffers[this.CONTEXT_UID];i.stencil&&(r.bindRenderbuffer(r.RENDERBUFFER,i.stencil),i.msaaBuffer?r.renderbufferStorageMultisample(r.RENDERBUFFER,i.multisample,r.DEPTH24_STENCIL8,e.width,e.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,e.width,e.height));const n=e.colorTextures;let s=n.length;r.drawBuffers||(s=Math.min(s,1));for(let a=0;a<s;a++){const o=n[a],u=o.parentTextureArray||o;this.renderer.texture.bind(u,0),a===0&&i.msaaBuffer&&(r.bindRenderbuffer(r.RENDERBUFFER,i.msaaBuffer),r.renderbufferStorageMultisample(r.RENDERBUFFER,i.multisample,u._glTextures[this.CONTEXT_UID].internalFormat,e.width,e.height))}e.depthTexture&&this.writeDepthTexture&&this.renderer.texture.bind(e.depthTexture,0)}updateFramebuffer(e,r){const{gl:i}=this,n=e.glFramebuffers[this.CONTEXT_UID],s=e.colorTextures;let a=s.length;i.drawBuffers||(a=Math.min(a,1)),n.multisample>1&&this.canMultisampleFramebuffer(e)?n.msaaBuffer=n.msaaBuffer||i.createRenderbuffer():n.msaaBuffer&&(i.deleteRenderbuffer(n.msaaBuffer),n.msaaBuffer=null,n.blitFramebuffer&&(n.blitFramebuffer.dispose(),n.blitFramebuffer=null));const o=[];for(let u=0;u<a;u++){const c=s[u],f=c.parentTextureArray||c;this.renderer.texture.bind(f,0),u===0&&n.msaaBuffer?(i.bindRenderbuffer(i.RENDERBUFFER,n.msaaBuffer),i.renderbufferStorageMultisample(i.RENDERBUFFER,n.multisample,f._glTextures[this.CONTEXT_UID].internalFormat,e.width,e.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,n.msaaBuffer)):(i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+u,c.target,f._glTextures[this.CONTEXT_UID].texture,r),o.push(i.COLOR_ATTACHMENT0+u))}if(o.length>1&&i.drawBuffers(o),e.depthTexture&&this.writeDepthTexture){const c=e.depthTexture;this.renderer.texture.bind(c,0),i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,c._glTextures[this.CONTEXT_UID].texture,r)}(e.stencil||e.depth)&&!(e.depthTexture&&this.writeDepthTexture)?(n.stencil=n.stencil||i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,n.stencil),n.msaaBuffer?i.renderbufferStorageMultisample(i.RENDERBUFFER,n.multisample,i.DEPTH24_STENCIL8,e.width,e.height):i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,e.width,e.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.RENDERBUFFER,n.stencil)):n.stencil&&(i.deleteRenderbuffer(n.stencil),n.stencil=null)}canMultisampleFramebuffer(e){return this.renderer.context.webGLVersion!==1&&e.colorTextures.length<=1&&!e.depthTexture}detectSamples(e){const{msaaSamples:r}=this;let i=Ae.NONE;if(e<=1||r===null)return i;for(let n=0;n<r.length;n++)if(r[n]<=e){i=r[n];break}return i===1&&(i=Ae.NONE),i}blit(e,r,i){const{current:n,renderer:s,gl:a,CONTEXT_UID:o}=this;if(s.context.webGLVersion!==2||!n)return;const u=n.glFramebuffers[o];if(!u)return;if(!e){if(!u.msaaBuffer)return;const f=n.colorTextures[0];if(!f)return;u.blitFramebuffer||(u.blitFramebuffer=new wa(n.width,n.height),u.blitFramebuffer.addColorTexture(0,f)),e=u.blitFramebuffer,e.colorTextures[0]!==f&&(e.colorTextures[0]=f,e.dirtyId++,e.dirtyFormat++),(e.width!==n.width||e.height!==n.height)&&(e.width=n.width,e.height=n.height,e.dirtyId++,e.dirtySize++)}r||(r=U1,r.width=n.width,r.height=n.height),i||(i=r);const c=r.width===i.width&&r.height===i.height;this.bind(e),a.bindFramebuffer(a.READ_FRAMEBUFFER,u.framebuffer),a.blitFramebuffer(r.left,r.top,r.right,r.bottom,i.left,i.top,i.right,i.bottom,a.COLOR_BUFFER_BIT,c?a.NEAREST:a.LINEAR)}disposeFramebuffer(e,r){const i=e.glFramebuffers[this.CONTEXT_UID],n=this.gl;if(!i)return;delete e.glFramebuffers[this.CONTEXT_UID];const s=this.managedFramebuffers.indexOf(e);s>=0&&this.managedFramebuffers.splice(s,1),e.disposeRunner.remove(this),r||(n.deleteFramebuffer(i.framebuffer),i.msaaBuffer&&n.deleteRenderbuffer(i.msaaBuffer),i.stencil&&n.deleteRenderbuffer(i.stencil)),i.blitFramebuffer&&this.disposeFramebuffer(i.blitFramebuffer,r)}disposeAll(e){const r=this.managedFramebuffers;this.managedFramebuffers=[];for(let i=0;i<r.length;i++)this.disposeFramebuffer(r[i],e)}forceStencil(){const e=this.current;if(!e)return;const r=e.glFramebuffers[this.CONTEXT_UID];if(!r||r.stencil)return;e.stencil=!0;const i=e.width,n=e.height,s=this.gl,a=s.createRenderbuffer();s.bindRenderbuffer(s.RENDERBUFFER,a),r.msaaBuffer?s.renderbufferStorageMultisample(s.RENDERBUFFER,r.multisample,s.DEPTH24_STENCIL8,i,n):s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_STENCIL,i,n),r.stencil=a,s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,a)}reset(){this.current=this.unknownFramebuffer,this.viewport=new pe}destroy(){this.renderer=null}}eh.extension={type:re.RendererSystem,name:"framebuffer"},he.add(eh);const Aa={5126:4,5123:2,5121:1};class th{constructor(e){this.renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.canUseUInt32ElementIndex=!1,this.managedGeometries={}}contextChange(){this.disposeAll(!0);const e=this.gl=this.renderer.gl,r=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,r.webGLVersion!==2){let i=this.renderer.context.extensions.vertexArrayObject;q.PREFER_ENV===Ht.WEBGL_LEGACY&&(i=null),i?(e.createVertexArray=()=>i.createVertexArrayOES(),e.bindVertexArray=n=>i.bindVertexArrayOES(n),e.deleteVertexArray=n=>i.deleteVertexArrayOES(n)):(this.hasVao=!1,e.createVertexArray=()=>null,e.bindVertexArray=()=>null,e.deleteVertexArray=()=>null)}if(r.webGLVersion!==2){const i=e.getExtension("ANGLE_instanced_arrays");i?(e.vertexAttribDivisor=(n,s)=>i.vertexAttribDivisorANGLE(n,s),e.drawElementsInstanced=(n,s,a,o,u)=>i.drawElementsInstancedANGLE(n,s,a,o,u),e.drawArraysInstanced=(n,s,a,o)=>i.drawArraysInstancedANGLE(n,s,a,o)):this.hasInstance=!1}this.canUseUInt32ElementIndex=r.webGLVersion===2||!!r.extensions.uint32ElementIndex}bind(e,r){r=r||this.renderer.shader.shader;const{gl:i}=this;let n=e.glVertexArrayObjects[this.CONTEXT_UID],s=!1;n||(this.managedGeometries[e.id]=e,e.disposeRunner.add(this),e.glVertexArrayObjects[this.CONTEXT_UID]=n={},s=!0);const a=n[r.program.id]||this.initGeometryVao(e,r,s);this._activeGeometry=e,this._activeVao!==a&&(this._activeVao=a,this.hasVao?i.bindVertexArray(a):this.activateVao(e,r.program)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const e=this._activeGeometry,r=this.renderer.buffer;for(let i=0;i<e.buffers.length;i++){const n=e.buffers[i];r.update(n)}}checkCompatibility(e,r){const i=e.attributes,n=r.attributeData;for(const s in n)if(!i[s])throw new Error(`shader and geometry incompatible, geometry missing the "${s}" attribute`)}getSignature(e,r){const i=e.attributes,n=r.attributeData,s=["g",e.id];for(const a in i)n[a]&&s.push(a,n[a].location);return s.join("-")}initGeometryVao(e,r,i=!0){const n=this.gl,s=this.CONTEXT_UID,a=this.renderer.buffer,o=r.program;o.glPrograms[s]||this.renderer.shader.generateProgram(r),this.checkCompatibility(e,o);const u=this.getSignature(e,o),c=e.glVertexArrayObjects[this.CONTEXT_UID];let f=c[u];if(f)return c[o.id]=f,f;const l=e.buffers,h=e.attributes,d={},p={};for(const m in l)d[m]=0,p[m]=0;for(const m in h)!h[m].size&&o.attributeData[m]?h[m].size=o.attributeData[m].size:h[m].size||console.warn(`PIXI Geometry attribute '${m}' size cannot be determined (likely the bound shader does not have the attribute)`),d[h[m].buffer]+=h[m].size*Aa[h[m].type];for(const m in h){const _=h[m],g=_.size;_.stride===void 0&&(d[_.buffer]===g*Aa[_.type]?_.stride=0:_.stride=d[_.buffer]),_.start===void 0&&(_.start=p[_.buffer],p[_.buffer]+=g*Aa[_.type])}f=n.createVertexArray(),n.bindVertexArray(f);for(let m=0;m<l.length;m++){const _=l[m];a.bind(_),i&&_._glBuffers[s].refCount++}return this.activateVao(e,o),c[o.id]=f,c[u]=f,n.bindVertexArray(null),a.unbind(pt.ARRAY_BUFFER),f}disposeGeometry(e,r){var o;if(!this.managedGeometries[e.id])return;delete this.managedGeometries[e.id];const i=e.glVertexArrayObjects[this.CONTEXT_UID],n=this.gl,s=e.buffers,a=(o=this.renderer)==null?void 0:o.buffer;if(e.disposeRunner.remove(this),!!i){if(a)for(let u=0;u<s.length;u++){const c=s[u]._glBuffers[this.CONTEXT_UID];c&&(c.refCount--,c.refCount===0&&!r&&a.dispose(s[u],r))}if(!r){for(const u in i)if(u[0]==="g"){const c=i[u];this._activeVao===c&&this.unbind(),n.deleteVertexArray(c)}}delete e.glVertexArrayObjects[this.CONTEXT_UID]}}disposeAll(e){const r=Object.keys(this.managedGeometries);for(let i=0;i<r.length;i++)this.disposeGeometry(this.managedGeometries[r[i]],e)}activateVao(e,r){const i=this.gl,n=this.CONTEXT_UID,s=this.renderer.buffer,a=e.buffers,o=e.attributes;e.indexBuffer&&s.bind(e.indexBuffer);let u=null;for(const c in o){const f=o[c],l=a[f.buffer],h=l._glBuffers[n];if(r.attributeData[c]){u!==h&&(s.bind(l),u=h);const d=r.attributeData[c].location;if(i.enableVertexAttribArray(d),i.vertexAttribPointer(d,f.size,f.type||i.FLOAT,f.normalized,f.stride,f.start),f.instance)if(this.hasInstance)i.vertexAttribDivisor(d,f.divisor);else throw new Error("geometry error, GPU Instancing is not supported on this device")}}}draw(e,r,i,n){const{gl:s}=this,a=this._activeGeometry;if(a.indexBuffer){const o=a.indexBuffer.data.BYTES_PER_ELEMENT,u=o===2?s.UNSIGNED_SHORT:s.UNSIGNED_INT;o===2||o===4&&this.canUseUInt32ElementIndex?a.instanced?s.drawElementsInstanced(e,r||a.indexBuffer.data.length,u,(i||0)*o,n||1):s.drawElements(e,r||a.indexBuffer.data.length,u,(i||0)*o):console.warn("unsupported index buffer type: uint32")}else a.instanced?s.drawArraysInstanced(e,i,r||a.getSize(),n||1):s.drawArrays(e,i,r||a.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this.renderer=null}}th.extension={type:re.RendererSystem,name:"geometry"},he.add(th);const rh=new Ue;class $1{constructor(e,r){this._texture=e,this.mapCoord=new Ue,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=typeof r>"u"?.5:r,this.isSimple=!1}get texture(){return this._texture}set texture(e){this._texture=e,this._textureID=-1}multiplyUvs(e,r){r===void 0&&(r=e);const i=this.mapCoord;for(let n=0;n<e.length;n+=2){const s=e[n],a=e[n+1];r[n]=s*i.a+a*i.c+i.tx,r[n+1]=s*i.b+a*i.d+i.ty}return r}update(e){const r=this._texture;if(!r||!r.valid||!e&&this._textureID===r._updateID)return!1;this._textureID=r._updateID,this._updateID++;const i=r._uvs;this.mapCoord.set(i.x1-i.x0,i.y1-i.y0,i.x3-i.x0,i.y3-i.y0,i.x0,i.y0);const n=r.orig,s=r.trim;s&&(rh.set(n.width/s.width,0,0,n.height/s.height,-s.x/s.width,-s.y/s.height),this.mapCoord.append(rh));const a=r.baseTexture,o=this.uClampFrame,u=this.clampMargin/a.resolution,c=this.clampOffset;return o[0]=(r._frame.x+u+c)/a.width,o[1]=(r._frame.y+u+c)/a.height,o[2]=(r._frame.x+r._frame.width-u+c)/a.width,o[3]=(r._frame.y+r._frame.height-u+c)/a.height,this.uClampOffset[0]=c/a.realWidth,this.uClampOffset[1]=c/a.realHeight,this.isSimple=r._frame.width===a.width&&r._frame.height===a.height&&r.rotate===0,!0}}var G1=`varying vec2 vMaskCoord;
|
|
411
411
|
varying vec2 vTextureCoord;
|
|
412
412
|
|
|
413
413
|
uniform sampler2D uSampler;
|
|
@@ -432,7 +432,7 @@ void main(void)
|
|
|
432
432
|
|
|
433
433
|
gl_FragColor = original;
|
|
434
434
|
}
|
|
435
|
-
`,
|
|
435
|
+
`,z1=`attribute vec2 aVertexPosition;
|
|
436
436
|
attribute vec2 aTextureCoord;
|
|
437
437
|
|
|
438
438
|
uniform mat3 projectionMatrix;
|
|
@@ -448,7 +448,7 @@ void main(void)
|
|
|
448
448
|
vTextureCoord = aTextureCoord;
|
|
449
449
|
vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;
|
|
450
450
|
}
|
|
451
|
-
`;class jC extends je{constructor(e,r,n){let i=null;typeof e!="string"&&r===void 0&&n===void 0&&(i=e,e=void 0,r=void 0,n=void 0),super(e||XC,r||VC,n),this.maskSprite=i,this.maskMatrix=new kt}get maskSprite(){return this._maskSprite}set maskSprite(e){this._maskSprite=e,this._maskSprite&&(this._maskSprite.renderable=!1)}apply(e,r,n,i){const a=this._maskSprite,u=a._texture;u.valid&&(u.uvMatrix||(u.uvMatrix=new HC(u,0)),u.uvMatrix.update(),this.uniforms.npmAlpha=u.baseTexture.alphaMode?0:1,this.uniforms.mask=u,this.uniforms.otherMatrix=e.calculateSpriteMatrix(this.maskMatrix,a).prepend(u.uvMatrix.mapCoord),this.uniforms.alpha=a.worldAlpha,this.uniforms.maskClamp=u.uvMatrix.uClampFrame,e.applyFilter(this,r,n,i))}}class WC{constructor(e=null){this.type=vt.NONE,this.autoDetect=!0,this.maskObject=e||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=je.defaultMultisample,this.enabled=!0,this.colorMask=15,this._filters=null,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._scissorRectLocal=null,this._colorMask=15,this._target=null}get filter(){return this._filters?this._filters[0]:null}set filter(e){e?this._filters?this._filters[0]=e:this._filters=[e]:this._filters=null}reset(){this.pooled&&(this.maskObject=null,this.type=vt.NONE,this.autoDetect=!0),this._target=null,this._scissorRectLocal=null}copyCountersOrReset(e){e?(this._stencilCounter=e._stencilCounter,this._scissorCounter=e._scissorCounter,this._scissorRect=e._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)}}class kp{constructor(e){this.renderer=e,this.enableScissor=!0,this.alphaMaskPool=[],this.maskDataPool=[],this.maskStack=[],this.alphaMaskIndex=0}setMaskStack(e){this.maskStack=e,this.renderer.scissor.setMaskStack(e),this.renderer.stencil.setMaskStack(e)}push(e,r){let n=r;if(!n.isMaskData){const a=this.maskDataPool.pop()||new WC;a.pooled=!0,a.maskObject=r,n=a}const i=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null;if(n.copyCountersOrReset(i),n._colorMask=i?i._colorMask:15,n.autoDetect&&this.detect(n),n._target=e,n.type!==vt.SPRITE&&this.maskStack.push(n),n.enabled)switch(n.type){case vt.SCISSOR:this.renderer.scissor.push(n);break;case vt.STENCIL:this.renderer.stencil.push(n);break;case vt.SPRITE:n.copyCountersOrReset(null),this.pushSpriteMask(n);break;case vt.COLOR:this.pushColorMask(n);break}n.type===vt.SPRITE&&this.maskStack.push(n)}pop(e){const r=this.maskStack.pop();if(!(!r||r._target!==e)){if(r.enabled)switch(r.type){case vt.SCISSOR:this.renderer.scissor.pop(r);break;case vt.STENCIL:this.renderer.stencil.pop(r.maskObject);break;case vt.SPRITE:this.popSpriteMask(r);break;case vt.COLOR:this.popColorMask(r);break}if(r.reset(),r.pooled&&this.maskDataPool.push(r),this.maskStack.length!==0){const n=this.maskStack[this.maskStack.length-1];n.type===vt.SPRITE&&n._filters&&(n._filters[0].maskSprite=n.maskObject)}}}detect(e){const r=e.maskObject;r?r.isSprite?e.type=vt.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(e)?e.type=vt.SCISSOR:e.type=vt.STENCIL:e.type=vt.COLOR}pushSpriteMask(e){const{maskObject:r}=e,n=e._target;let i=e._filters;i||(i=this.alphaMaskPool[this.alphaMaskIndex],i||(i=this.alphaMaskPool[this.alphaMaskIndex]=[new jC]));const a=this.renderer,u=a.renderTexture;let l,h;if(u.current){const m=u.current;l=e.resolution||m.resolution,h=e.multisample??m.multisample}else l=e.resolution||a.resolution,h=e.multisample??a.multisample;i[0].resolution=l,i[0].multisample=h,i[0].maskSprite=r;const p=n.filterArea;n.filterArea=r.getBounds(!0),a.filter.push(n,i),n.filterArea=p,e._filters||this.alphaMaskIndex++}popSpriteMask(e){this.renderer.filter.pop(),e._filters?e._filters[0].maskSprite=null:(this.alphaMaskIndex--,this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite=null)}pushColorMask(e){const r=e._colorMask,n=e._colorMask=r&e.colorMask;n!==r&&this.renderer.gl.colorMask((n&1)!==0,(n&2)!==0,(n&4)!==0,(n&8)!==0)}popColorMask(e){const r=e._colorMask,n=this.maskStack.length>0?this.maskStack[this.maskStack.length-1]._colorMask:15;n!==r&&this.renderer.gl.colorMask((n&1)!==0,(n&2)!==0,(n&4)!==0,(n&8)!==0)}destroy(){this.renderer=null}}kp.extension={type:Fe.RendererSystem,name:"mask"},qe.add(kp);class Dp{constructor(e){this.renderer=e,this.maskStack=[],this.glConst=0}getStackLength(){return this.maskStack.length}setMaskStack(e){const{gl:r}=this.renderer,n=this.getStackLength();this.maskStack=e;const i=this.getStackLength();i!==n&&(i===0?r.disable(this.glConst):(r.enable(this.glConst),this._useCurrent()))}_useCurrent(){}destroy(){this.renderer=null,this.maskStack=null}}const Bp=new kt,Up=[],Ya=class extends Dp{constructor(t){super(t),this.glConst=Ie.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST}getStackLength(){const t=this.maskStack[this.maskStack.length-1];return t?t._scissorCounter:0}calcScissorRect(t){if(t._scissorRectLocal)return;const e=t._scissorRect,{maskObject:r}=t,{renderer:n}=this,i=n.renderTexture,a=r.getBounds(!0,Up.pop()??new Qe);this.roundFrameToPixels(a,i.current?i.current.resolution:n.resolution,i.sourceFrame,i.destinationFrame,n.projection.transform),e&&a.fit(e),t._scissorRectLocal=a}static isMatrixRotated(t){if(!t)return!1;const{a:e,b:r,c:n,d:i}=t;return(Math.abs(r)>1e-4||Math.abs(n)>1e-4)&&(Math.abs(e)>1e-4||Math.abs(i)>1e-4)}testScissor(t){const{maskObject:e}=t;if(!e.isFastRect||!e.isFastRect()||Ya.isMatrixRotated(e.worldTransform)||Ya.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(t);const r=t._scissorRectLocal;return r.width>0&&r.height>0}roundFrameToPixels(t,e,r,n,i){Ya.isMatrixRotated(i)||(i=i?Bp.copyFrom(i):Bp.identity(),i.translate(-r.x,-r.y).scale(n.width/r.width,n.height/r.height).translate(n.x,n.y),this.renderer.filter.transformAABB(i,t),t.fit(n),t.x=Math.round(t.x*e),t.y=Math.round(t.y*e),t.width=Math.round(t.width*e),t.height=Math.round(t.height*e))}push(t){t._scissorRectLocal||this.calcScissorRect(t);const{gl:e}=this.renderer;t._scissorRect||e.enable(e.SCISSOR_TEST),t._scissorCounter++,t._scissorRect=t._scissorRectLocal,this._useCurrent()}pop(t){const{gl:e}=this.renderer;t&&Up.push(t._scissorRectLocal),this.getStackLength()>0?this._useCurrent():e.disable(e.SCISSOR_TEST)}_useCurrent(){const t=this.maskStack[this.maskStack.length-1]._scissorRect;let e;this.renderer.renderTexture.current?e=t.y:e=this.renderer.height-t.height-t.y,this.renderer.gl.scissor(t.x,e,t.width,t.height)}};let $p=Ya;$p.extension={type:Fe.RendererSystem,name:"scissor"},qe.add($p);class Gp extends Dp{constructor(e){super(e),this.glConst=Ie.ADAPTER.getWebGLRenderingContext().STENCIL_TEST}getStackLength(){const e=this.maskStack[this.maskStack.length-1];return e?e._stencilCounter:0}push(e){const r=e.maskObject,{gl:n}=this.renderer,i=e._stencilCounter;i===0&&(this.renderer.framebuffer.forceStencil(),n.clearStencil(0),n.clear(n.STENCIL_BUFFER_BIT),n.enable(n.STENCIL_TEST)),e._stencilCounter++;const a=e._colorMask;a!==0&&(e._colorMask=0,n.colorMask(!1,!1,!1,!1)),n.stencilFunc(n.EQUAL,i,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.INCR),r.renderable=!0,r.render(this.renderer),this.renderer.batch.flush(),r.renderable=!1,a!==0&&(e._colorMask=a,n.colorMask((a&1)!==0,(a&2)!==0,(a&4)!==0,(a&8)!==0)),this._useCurrent()}pop(e){const r=this.renderer.gl;if(this.getStackLength()===0)r.disable(r.STENCIL_TEST);else{const n=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,i=n?n._colorMask:15;i!==0&&(n._colorMask=0,r.colorMask(!1,!1,!1,!1)),r.stencilOp(r.KEEP,r.KEEP,r.DECR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,i!==0&&(n._colorMask=i,r.colorMask((i&1)!==0,(i&2)!==0,(i&4)!==0,(i&8)!==0)),this._useCurrent()}}_useCurrent(){const e=this.renderer.gl;e.stencilFunc(e.EQUAL,this.getStackLength(),4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)}}Gp.extension={type:Fe.RendererSystem,name:"stencil"},qe.add(Gp);class zp{constructor(e){this.renderer=e,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get(){return ke("7.0.0","renderer.plugins.extract has moved to renderer.extract"),e.extract}},prepare:{enumerable:!1,get(){return ke("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),e.prepare}},interaction:{enumerable:!1,get(){return ke("7.0.0","renderer.plugins.interaction has been deprecated, use renderer.events"),e.events}}})}init(){const e=this.rendererPlugins;for(const r in e)this.plugins[r]=new e[r](this.renderer)}destroy(){for(const e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null}}zp.extension={type:[Fe.RendererSystem,Fe.CanvasRendererSystem],name:"_plugin"},qe.add(zp);class Hp{constructor(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new kt,this.transform=null}update(e,r,n,i){this.destinationFrame=e||this.destinationFrame||this.defaultFrame,this.sourceFrame=r||this.sourceFrame||e,this.calculateProjection(this.destinationFrame,this.sourceFrame,n,i),this.transform&&this.projectionMatrix.append(this.transform);const a=this.renderer;a.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,a.globalUniforms.update(),a.shader.shader&&a.shader.syncUniformGroup(a.shader.shader.uniforms.globals)}calculateProjection(e,r,n,i){const a=this.projectionMatrix,u=i?-1:1;a.identity(),a.a=1/r.width*2,a.d=u*(1/r.height*2),a.tx=-1-r.x*a.a,a.ty=-u-r.y*a.d}setTransform(e){}destroy(){this.renderer=null}}Hp.extension={type:Fe.RendererSystem,name:"projection"},qe.add(Hp);const qC=new Ol;class Vp{constructor(e){this.renderer=e,this._tempMatrix=new kt}generateTexture(e,r){const{region:n,...i}=r||{},a=n||e.getLocalBounds(null,!0);a.width===0&&(a.width=1),a.height===0&&(a.height=1);const u=Wa.create({width:a.width,height:a.height,...i});this._tempMatrix.tx=-a.x,this._tempMatrix.ty=-a.y;const l=e.transform;return e.transform=qC,this.renderer.render(e,{renderTexture:u,transform:this._tempMatrix,skipUpdateTransform:!!e.parent,blit:!0}),e.transform=l,u}destroy(){}}Vp.extension={type:[Fe.RendererSystem,Fe.CanvasRendererSystem],name:"textureGenerator"},qe.add(Vp);const Hn=new Qe,Is=new Qe;class Xp{constructor(e){this.renderer=e,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new Qe,this.destinationFrame=new Qe,this.viewportFrame=new Qe}bind(e=null,r,n){const i=this.renderer;this.current=e;let a,u,l;e?(a=e.baseTexture,l=a.resolution,r||(Hn.width=e.frame.width,Hn.height=e.frame.height,r=Hn),n||(Is.x=e.frame.x,Is.y=e.frame.y,Is.width=r.width,Is.height=r.height,n=Is),u=a.framebuffer):(l=i.resolution,r||(Hn.width=i._view.screen.width,Hn.height=i._view.screen.height,r=Hn),n||(n=Hn,n.width=r.width,n.height=r.height));const h=this.viewportFrame;h.x=n.x*l,h.y=n.y*l,h.width=n.width*l,h.height=n.height*l,e||(h.y=i.view.height-(h.y+h.height)),h.ceil(),this.renderer.framebuffer.bind(u,h),this.renderer.projection.update(n,r,l,!u),e?this.renderer.mask.setMaskStack(a.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(r),this.destinationFrame.copyFrom(n)}clear(e,r){const n=this.current?this.current.baseTexture.clear:this.renderer.background.backgroundColor,i=e?Ot.shared.setValue(e):n,a=this.destinationFrame,u=this.current?this.current.baseTexture:this.renderer._view.screen,l=a.width!==u.width||a.height!==u.height;if(l){let{x:h,y:p,width:m,height:c}=this.viewportFrame;h=Math.round(h),p=Math.round(p),m=Math.round(m),c=Math.round(c),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(h,p,m,c)}this.renderer.framebuffer.clear(i.red,i.green,i.blue,i.alpha,r),l&&this.renderer.scissor.pop()}resize(){this.bind(null)}reset(){this.bind(null)}destroy(){this.renderer=null}}Xp.extension={type:Fe.RendererSystem,name:"renderTexture"},qe.add(Xp);class YC{constructor(e,r){this.program=e,this.uniformData=r,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null}}function KC(t,e){const r={},n=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let i=0;i<n;i++){const a=e.getActiveAttrib(t,i);if(a.name.startsWith("gl_"))continue;const u=Tp(e,a.type),l={type:u,name:a.name,size:xp(u),location:e.getAttribLocation(t,a.name)};r[a.name]=l}return r}function ZC(t,e){const r={},n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let i=0;i<n;i++){const a=e.getActiveUniform(t,i),u=a.name.replace(/\[.*?\]$/,""),l=!!a.name.match(/\[.*?\]$/),h=Tp(e,a.type);r[u]={name:u,index:i,type:h,size:a.size,isArray:l,value:_p(h,a.size)}}return r}function QC(t,e){var h;const r=mp(t,t.VERTEX_SHADER,e.vertexSrc),n=mp(t,t.FRAGMENT_SHADER,e.fragmentSrc),i=t.createProgram();t.attachShader(i,r),t.attachShader(i,n);const a=(h=e.extra)==null?void 0:h.transformFeedbackVaryings;if(a&&(typeof t.transformFeedbackVaryings!="function"?console.warn("TransformFeedback is not supported but TransformFeedbackVaryings are given."):t.transformFeedbackVaryings(i,a.names,a.bufferMode==="separate"?t.SEPARATE_ATTRIBS:t.INTERLEAVED_ATTRIBS)),t.linkProgram(i),t.getProgramParameter(i,t.LINK_STATUS)||AC(t,i,r,n),e.attributeData=KC(i,t),e.uniformData=ZC(i,t),!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertexSrc)){const p=Object.keys(e.attributeData);p.sort((m,c)=>m>c?1:-1);for(let m=0;m<p.length;m++)e.attributeData[p[m]].location=m,t.bindAttribLocation(i,m,p[m]);t.linkProgram(i)}t.deleteShader(r),t.deleteShader(n);const u={};for(const p in e.uniformData){const m=e.uniformData[p];u[p]={location:t.getUniformLocation(i,p),value:_p(m.type,m.size)}}return new YC(i,u)}function JC(t,e,r,n,i){r.buffer.update(i)}const e2={float:`
|
|
451
|
+
`;class j1 extends ce{constructor(e,r,i){let n=null;typeof e!="string"&&r===void 0&&i===void 0&&(n=e,e=void 0,r=void 0,i=void 0),super(e||z1,r||G1,i),this.maskSprite=n,this.maskMatrix=new Ue}get maskSprite(){return this._maskSprite}set maskSprite(e){this._maskSprite=e,this._maskSprite&&(this._maskSprite.renderable=!1)}apply(e,r,i,n){const s=this._maskSprite,a=s._texture;a.valid&&(a.uvMatrix||(a.uvMatrix=new $1(a,0)),a.uvMatrix.update(),this.uniforms.npmAlpha=a.baseTexture.alphaMode?0:1,this.uniforms.mask=a,this.uniforms.otherMatrix=e.calculateSpriteMatrix(this.maskMatrix,s).prepend(a.uvMatrix.mapCoord),this.uniforms.alpha=s.worldAlpha,this.uniforms.maskClamp=a.uvMatrix.uClampFrame,e.applyFilter(this,r,i,n))}}class H1{constructor(e=null){this.type=Ce.NONE,this.autoDetect=!0,this.maskObject=e||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=ce.defaultMultisample,this.enabled=!0,this.colorMask=15,this._filters=null,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._scissorRectLocal=null,this._colorMask=15,this._target=null}get filter(){return this._filters?this._filters[0]:null}set filter(e){e?this._filters?this._filters[0]=e:this._filters=[e]:this._filters=null}reset(){this.pooled&&(this.maskObject=null,this.type=Ce.NONE,this.autoDetect=!0),this._target=null,this._scissorRectLocal=null}copyCountersOrReset(e){e?(this._stencilCounter=e._stencilCounter,this._scissorCounter=e._scissorCounter,this._scissorRect=e._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)}}class ih{constructor(e){this.renderer=e,this.enableScissor=!0,this.alphaMaskPool=[],this.maskDataPool=[],this.maskStack=[],this.alphaMaskIndex=0}setMaskStack(e){this.maskStack=e,this.renderer.scissor.setMaskStack(e),this.renderer.stencil.setMaskStack(e)}push(e,r){let i=r;if(!i.isMaskData){const s=this.maskDataPool.pop()||new H1;s.pooled=!0,s.maskObject=r,i=s}const n=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null;if(i.copyCountersOrReset(n),i._colorMask=n?n._colorMask:15,i.autoDetect&&this.detect(i),i._target=e,i.type!==Ce.SPRITE&&this.maskStack.push(i),i.enabled)switch(i.type){case Ce.SCISSOR:this.renderer.scissor.push(i);break;case Ce.STENCIL:this.renderer.stencil.push(i);break;case Ce.SPRITE:i.copyCountersOrReset(null),this.pushSpriteMask(i);break;case Ce.COLOR:this.pushColorMask(i);break}i.type===Ce.SPRITE&&this.maskStack.push(i)}pop(e){const r=this.maskStack.pop();if(!(!r||r._target!==e)){if(r.enabled)switch(r.type){case Ce.SCISSOR:this.renderer.scissor.pop(r);break;case Ce.STENCIL:this.renderer.stencil.pop(r.maskObject);break;case Ce.SPRITE:this.popSpriteMask(r);break;case Ce.COLOR:this.popColorMask(r);break}if(r.reset(),r.pooled&&this.maskDataPool.push(r),this.maskStack.length!==0){const i=this.maskStack[this.maskStack.length-1];i.type===Ce.SPRITE&&i._filters&&(i._filters[0].maskSprite=i.maskObject)}}}detect(e){const r=e.maskObject;r?r.isSprite?e.type=Ce.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(e)?e.type=Ce.SCISSOR:e.type=Ce.STENCIL:e.type=Ce.COLOR}pushSpriteMask(e){const{maskObject:r}=e,i=e._target;let n=e._filters;n||(n=this.alphaMaskPool[this.alphaMaskIndex],n||(n=this.alphaMaskPool[this.alphaMaskIndex]=[new j1]));const s=this.renderer,a=s.renderTexture;let o,u;if(a.current){const f=a.current;o=e.resolution||f.resolution,u=e.multisample??f.multisample}else o=e.resolution||s.resolution,u=e.multisample??s.multisample;n[0].resolution=o,n[0].multisample=u,n[0].maskSprite=r;const c=i.filterArea;i.filterArea=r.getBounds(!0),s.filter.push(i,n),i.filterArea=c,e._filters||this.alphaMaskIndex++}popSpriteMask(e){this.renderer.filter.pop(),e._filters?e._filters[0].maskSprite=null:(this.alphaMaskIndex--,this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite=null)}pushColorMask(e){const r=e._colorMask,i=e._colorMask=r&e.colorMask;i!==r&&this.renderer.gl.colorMask((i&1)!==0,(i&2)!==0,(i&4)!==0,(i&8)!==0)}popColorMask(e){const r=e._colorMask,i=this.maskStack.length>0?this.maskStack[this.maskStack.length-1]._colorMask:15;i!==r&&this.renderer.gl.colorMask((i&1)!==0,(i&2)!==0,(i&4)!==0,(i&8)!==0)}destroy(){this.renderer=null}}ih.extension={type:re.RendererSystem,name:"mask"},he.add(ih);class nh{constructor(e){this.renderer=e,this.maskStack=[],this.glConst=0}getStackLength(){return this.maskStack.length}setMaskStack(e){const{gl:r}=this.renderer,i=this.getStackLength();this.maskStack=e;const n=this.getStackLength();n!==i&&(n===0?r.disable(this.glConst):(r.enable(this.glConst),this._useCurrent()))}_useCurrent(){}destroy(){this.renderer=null,this.maskStack=null}}const sh=new Ue,ah=[],Cn=class extends nh{constructor(t){super(t),this.glConst=q.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST}getStackLength(){const t=this.maskStack[this.maskStack.length-1];return t?t._scissorCounter:0}calcScissorRect(t){if(t._scissorRectLocal)return;const e=t._scissorRect,{maskObject:r}=t,{renderer:i}=this,n=i.renderTexture,s=r.getBounds(!0,ah.pop()??new pe);this.roundFrameToPixels(s,n.current?n.current.resolution:i.resolution,n.sourceFrame,n.destinationFrame,i.projection.transform),e&&s.fit(e),t._scissorRectLocal=s}static isMatrixRotated(t){if(!t)return!1;const{a:e,b:r,c:i,d:n}=t;return(Math.abs(r)>1e-4||Math.abs(i)>1e-4)&&(Math.abs(e)>1e-4||Math.abs(n)>1e-4)}testScissor(t){const{maskObject:e}=t;if(!e.isFastRect||!e.isFastRect()||Cn.isMatrixRotated(e.worldTransform)||Cn.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(t);const r=t._scissorRectLocal;return r.width>0&&r.height>0}roundFrameToPixels(t,e,r,i,n){Cn.isMatrixRotated(n)||(n=n?sh.copyFrom(n):sh.identity(),n.translate(-r.x,-r.y).scale(i.width/r.width,i.height/r.height).translate(i.x,i.y),this.renderer.filter.transformAABB(n,t),t.fit(i),t.x=Math.round(t.x*e),t.y=Math.round(t.y*e),t.width=Math.round(t.width*e),t.height=Math.round(t.height*e))}push(t){t._scissorRectLocal||this.calcScissorRect(t);const{gl:e}=this.renderer;t._scissorRect||e.enable(e.SCISSOR_TEST),t._scissorCounter++,t._scissorRect=t._scissorRectLocal,this._useCurrent()}pop(t){const{gl:e}=this.renderer;t&&ah.push(t._scissorRectLocal),this.getStackLength()>0?this._useCurrent():e.disable(e.SCISSOR_TEST)}_useCurrent(){const t=this.maskStack[this.maskStack.length-1]._scissorRect;let e;this.renderer.renderTexture.current?e=t.y:e=this.renderer.height-t.height-t.y,this.renderer.gl.scissor(t.x,e,t.width,t.height)}};let oh=Cn;oh.extension={type:re.RendererSystem,name:"scissor"},he.add(oh);class lh extends nh{constructor(e){super(e),this.glConst=q.ADAPTER.getWebGLRenderingContext().STENCIL_TEST}getStackLength(){const e=this.maskStack[this.maskStack.length-1];return e?e._stencilCounter:0}push(e){const r=e.maskObject,{gl:i}=this.renderer,n=e._stencilCounter;n===0&&(this.renderer.framebuffer.forceStencil(),i.clearStencil(0),i.clear(i.STENCIL_BUFFER_BIT),i.enable(i.STENCIL_TEST)),e._stencilCounter++;const s=e._colorMask;s!==0&&(e._colorMask=0,i.colorMask(!1,!1,!1,!1)),i.stencilFunc(i.EQUAL,n,4294967295),i.stencilOp(i.KEEP,i.KEEP,i.INCR),r.renderable=!0,r.render(this.renderer),this.renderer.batch.flush(),r.renderable=!1,s!==0&&(e._colorMask=s,i.colorMask((s&1)!==0,(s&2)!==0,(s&4)!==0,(s&8)!==0)),this._useCurrent()}pop(e){const r=this.renderer.gl;if(this.getStackLength()===0)r.disable(r.STENCIL_TEST);else{const i=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,n=i?i._colorMask:15;n!==0&&(i._colorMask=0,r.colorMask(!1,!1,!1,!1)),r.stencilOp(r.KEEP,r.KEEP,r.DECR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,n!==0&&(i._colorMask=n,r.colorMask((n&1)!==0,(n&2)!==0,(n&4)!==0,(n&8)!==0)),this._useCurrent()}}_useCurrent(){const e=this.renderer.gl;e.stencilFunc(e.EQUAL,this.getStackLength(),4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)}}lh.extension={type:re.RendererSystem,name:"stencil"},he.add(lh);class uh{constructor(e){this.renderer=e,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get(){return ne("7.0.0","renderer.plugins.extract has moved to renderer.extract"),e.extract}},prepare:{enumerable:!1,get(){return ne("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),e.prepare}},interaction:{enumerable:!1,get(){return ne("7.0.0","renderer.plugins.interaction has been deprecated, use renderer.events"),e.events}}})}init(){const e=this.rendererPlugins;for(const r in e)this.plugins[r]=new e[r](this.renderer)}destroy(){for(const e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null}}uh.extension={type:[re.RendererSystem,re.CanvasRendererSystem],name:"_plugin"},he.add(uh);class hh{constructor(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new Ue,this.transform=null}update(e,r,i,n){this.destinationFrame=e||this.destinationFrame||this.defaultFrame,this.sourceFrame=r||this.sourceFrame||e,this.calculateProjection(this.destinationFrame,this.sourceFrame,i,n),this.transform&&this.projectionMatrix.append(this.transform);const s=this.renderer;s.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,s.globalUniforms.update(),s.shader.shader&&s.shader.syncUniformGroup(s.shader.shader.uniforms.globals)}calculateProjection(e,r,i,n){const s=this.projectionMatrix,a=n?-1:1;s.identity(),s.a=1/r.width*2,s.d=a*(1/r.height*2),s.tx=-1-r.x*s.a,s.ty=-a-r.y*s.d}setTransform(e){}destroy(){this.renderer=null}}hh.extension={type:re.RendererSystem,name:"projection"},he.add(hh);const V1=new xa;class ch{constructor(e){this.renderer=e,this._tempMatrix=new Ue}generateTexture(e,r){const{region:i,...n}=r||{},s=i||e.getLocalBounds(null,!0);s.width===0&&(s.width=1),s.height===0&&(s.height=1);const a=An.create({width:s.width,height:s.height,...n});this._tempMatrix.tx=-s.x,this._tempMatrix.ty=-s.y;const o=e.transform;return e.transform=V1,this.renderer.render(e,{renderTexture:a,transform:this._tempMatrix,skipUpdateTransform:!!e.parent,blit:!0}),e.transform=o,a}destroy(){}}ch.extension={type:[re.RendererSystem,re.CanvasRendererSystem],name:"textureGenerator"},he.add(ch);const tr=new pe,gi=new pe;class fh{constructor(e){this.renderer=e,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new pe,this.destinationFrame=new pe,this.viewportFrame=new pe}bind(e=null,r,i){const n=this.renderer;this.current=e;let s,a,o;e?(s=e.baseTexture,o=s.resolution,r||(tr.width=e.frame.width,tr.height=e.frame.height,r=tr),i||(gi.x=e.frame.x,gi.y=e.frame.y,gi.width=r.width,gi.height=r.height,i=gi),a=s.framebuffer):(o=n.resolution,r||(tr.width=n._view.screen.width,tr.height=n._view.screen.height,r=tr),i||(i=tr,i.width=r.width,i.height=r.height));const u=this.viewportFrame;u.x=i.x*o,u.y=i.y*o,u.width=i.width*o,u.height=i.height*o,e||(u.y=n.view.height-(u.y+u.height)),u.ceil(),this.renderer.framebuffer.bind(a,u),this.renderer.projection.update(i,r,o,!a),e?this.renderer.mask.setMaskStack(s.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(r),this.destinationFrame.copyFrom(i)}clear(e,r){const i=this.current?this.current.baseTexture.clear:this.renderer.background.backgroundColor,n=e?Oe.shared.setValue(e):i,s=this.destinationFrame,a=this.current?this.current.baseTexture:this.renderer._view.screen,o=s.width!==a.width||s.height!==a.height;if(o){let{x:u,y:c,width:f,height:l}=this.viewportFrame;u=Math.round(u),c=Math.round(c),f=Math.round(f),l=Math.round(l),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(u,c,f,l)}this.renderer.framebuffer.clear(n.red,n.green,n.blue,n.alpha,r),o&&this.renderer.scissor.pop()}resize(){this.bind(null)}reset(){this.bind(null)}destroy(){this.renderer=null}}fh.extension={type:re.RendererSystem,name:"renderTexture"},he.add(fh);class X1{constructor(e,r){this.program=e,this.uniformData=r,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null}}function W1(t,e){const r={},i=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let n=0;n<i;n++){const s=e.getActiveAttrib(t,n);if(s.name.startsWith("gl_"))continue;const a=ju(e,s.type),o={type:a,name:s.name,size:Gu(a),location:e.getAttribLocation(t,s.name)};r[s.name]=o}return r}function q1(t,e){const r={},i=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let n=0;n<i;n++){const s=e.getActiveUniform(t,n),a=s.name.replace(/\[.*?\]$/,""),o=!!s.name.match(/\[.*?\]$/),u=ju(e,s.type);r[a]={name:a,index:n,type:u,size:s.size,isArray:o,value:Bu(u,s.size)}}return r}function Y1(t,e){var u;const r=Lu(t,t.VERTEX_SHADER,e.vertexSrc),i=Lu(t,t.FRAGMENT_SHADER,e.fragmentSrc),n=t.createProgram();t.attachShader(n,r),t.attachShader(n,i);const s=(u=e.extra)==null?void 0:u.transformFeedbackVaryings;if(s&&(typeof t.transformFeedbackVaryings!="function"?console.warn("TransformFeedback is not supported but TransformFeedbackVaryings are given."):t.transformFeedbackVaryings(n,s.names,s.bufferMode==="separate"?t.SEPARATE_ATTRIBS:t.INTERLEAVED_ATTRIBS)),t.linkProgram(n),t.getProgramParameter(n,t.LINK_STATUS)||T1(t,n,r,i),e.attributeData=W1(n,t),e.uniformData=q1(n,t),!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertexSrc)){const c=Object.keys(e.attributeData);c.sort((f,l)=>f>l?1:-1);for(let f=0;f<c.length;f++)e.attributeData[c[f]].location=f,t.bindAttribLocation(n,f,c[f]);t.linkProgram(n)}t.deleteShader(r),t.deleteShader(i);const a={};for(const c in e.uniformData){const f=e.uniformData[c];a[c]={location:t.getUniformLocation(n,c),value:Bu(f.type,f.size)}}return new X1(n,a)}function K1(t,e,r,i,n){r.buffer.update(n)}const Z1={float:`
|
|
452
452
|
data[offset] = v;
|
|
453
453
|
`,vec2:`
|
|
454
454
|
data[offset] = v[0];
|
|
@@ -486,7 +486,7 @@ void main(void)
|
|
|
486
486
|
{
|
|
487
487
|
data[offset + i] = v[i];
|
|
488
488
|
}
|
|
489
|
-
`},
|
|
489
|
+
`},dh={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:16*2,mat3:16*3,mat4:16*4};function Q1(t){const e=t.map(s=>({data:s,offset:0,dataLen:0,dirty:0}));let r=0,i=0,n=0;for(let s=0;s<e.length;s++){const a=e[s];if(r=dh[a.data.type],a.data.size>1&&(r=Math.max(r,16)*a.data.size),a.dataLen=r,i%r!==0&&i<16){const o=i%r%16;i+=o,n+=o}i+r>16?(n=Math.ceil(n/16)*16,a.offset=n,n+=r,i=r):(a.offset=n,i+=r,n+=r)}return n=Math.ceil(n/16)*16,{uboElements:e,size:n}}function J1(t,e){const r=[];for(const i in t)e[i]&&r.push(e[i]);return r.sort((i,n)=>i.index-n.index),r}function eb(t,e){if(!t.autoManage)return{size:0,syncFunc:K1};const r=J1(t.uniforms,e),{uboElements:i,size:n}=Q1(r),s=[`
|
|
490
490
|
var v = null;
|
|
491
491
|
var v2 = null;
|
|
492
492
|
var cv = null;
|
|
@@ -494,31 +494,31 @@ void main(void)
|
|
|
494
494
|
var gl = renderer.gl
|
|
495
495
|
var index = 0;
|
|
496
496
|
var data = buffer.data;
|
|
497
|
-
`];for(let
|
|
498
|
-
cv = ud.${
|
|
499
|
-
v = uv.${
|
|
500
|
-
offset = ${
|
|
497
|
+
`];for(let a=0;a<i.length;a++){const o=i[a],u=t.uniforms[o.data.name],c=o.data.name;let f=!1;for(let l=0;l<Pr.length;l++){const h=Pr[l];if(h.codeUbo&&h.test(o.data,u)){s.push(`offset = ${o.offset/4};`,Pr[l].codeUbo(o.data.name,u)),f=!0;break}}if(!f)if(o.data.size>1){const l=Gu(o.data.type),h=Math.max(dh[o.data.type]/16,1),d=l/h,p=(4-d%4)%4;s.push(`
|
|
498
|
+
cv = ud.${c}.value;
|
|
499
|
+
v = uv.${c};
|
|
500
|
+
offset = ${o.offset/4};
|
|
501
501
|
|
|
502
502
|
t = 0;
|
|
503
503
|
|
|
504
|
-
for(var i=0; i < ${
|
|
504
|
+
for(var i=0; i < ${o.data.size*h}; i++)
|
|
505
505
|
{
|
|
506
|
-
for(var j = 0; j < ${
|
|
506
|
+
for(var j = 0; j < ${d}; j++)
|
|
507
507
|
{
|
|
508
508
|
data[offset++] = v[t++];
|
|
509
509
|
}
|
|
510
|
-
offset += ${
|
|
510
|
+
offset += ${p};
|
|
511
511
|
}
|
|
512
512
|
|
|
513
|
-
`)}else{const
|
|
514
|
-
cv = ud.${
|
|
515
|
-
v = uv.${
|
|
516
|
-
offset = ${
|
|
517
|
-
${
|
|
518
|
-
`)}}return
|
|
513
|
+
`)}else{const l=Z1[o.data.type];s.push(`
|
|
514
|
+
cv = ud.${c}.value;
|
|
515
|
+
v = uv.${c};
|
|
516
|
+
offset = ${o.offset/4};
|
|
517
|
+
${l};
|
|
518
|
+
`)}}return s.push(`
|
|
519
519
|
renderer.buffer.update(buffer);
|
|
520
|
-
`),{size:
|
|
521
|
-
`))}}let i2=0;const Ka={textureCount:0,uboCount:0};class Wp{constructor(e){this.destroyed=!1,this.renderer=e,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=i2++}systemCheck(){if(!CC())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")}contextChange(e){this.gl=e,this.reset()}bind(e,r){e.disposeRunner.add(this),e.uniforms.globals=this.renderer.globalUniforms;const n=e.program,i=n.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(e);return this.shader=e,this.program!==n&&(this.program=n,this.gl.useProgram(i.program)),r||(Ka.textureCount=0,Ka.uboCount=0,this.syncUniformGroup(e.uniformGroup,Ka)),i}setUniforms(e){const r=this.shader.program,n=r.glPrograms[this.renderer.CONTEXT_UID];r.syncUniforms(n.uniformData,e,this.renderer)}syncUniformGroup(e,r){const n=this.getGlProgram();(!e.static||e.dirtyId!==n.uniformDirtyGroups[e.id])&&(n.uniformDirtyGroups[e.id]=e.dirtyId,this.syncUniforms(e,n,r))}syncUniforms(e,r,n){(e.syncUniforms[this.shader.program.id]||this.createSyncGroups(e))(r.uniformData,e.uniforms,this.renderer,n)}createSyncGroups(e){const r=this.getSignature(e,this.shader.program.uniformData,"u");return this.cache[r]||(this.cache[r]=TC(e,this.shader.program.uniformData)),e.syncUniforms[this.shader.program.id]=this.cache[r],e.syncUniforms[this.shader.program.id]}syncUniformBufferGroup(e,r){const n=this.getGlProgram();if(!e.static||e.dirtyId!==0||!n.uniformGroups[e.id]){e.dirtyId=0;const i=n.uniformGroups[e.id]||this.createSyncBufferGroup(e,n,r);e.buffer.update(),i(n.uniformData,e.uniforms,this.renderer,Ka,e.buffer)}this.renderer.buffer.bindBufferBase(e.buffer,n.uniformBufferBindings[r])}createSyncBufferGroup(e,r,n){const{gl:i}=this.renderer;this.renderer.buffer.bind(e.buffer);const a=this.gl.getUniformBlockIndex(r.program,n);r.uniformBufferBindings[n]=this.shader.uniformBindCount,i.uniformBlockBinding(r.program,a,this.shader.uniformBindCount),this.shader.uniformBindCount++;const u=this.getSignature(e,this.shader.program.uniformData,"ubo");let l=this._uboCache[u];if(l||(l=this._uboCache[u]=n2(e,this.shader.program.uniformData)),e.autoManage){const h=new Float32Array(l.size/4);e.buffer.update(h)}return r.uniformGroups[e.id]=l.syncFunc,r.uniformGroups[e.id]}getSignature(e,r,n){const i=e.uniforms,a=[`${n}-`];for(const u in i)a.push(u),r[u]&&a.push(r[u].type);return a.join("-")}getGlProgram(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null}generateProgram(e){const r=this.gl,n=e.program,i=QC(r,n);return n.glPrograms[this.renderer.CONTEXT_UID]=i,i}reset(){this.program=null,this.shader=null}disposeShader(e){this.shader===e&&(this.shader=null)}destroy(){this.renderer=null,this.destroyed=!0}}Wp.extension={type:Fe.RendererSystem,name:"shader"},qe.add(Wp);class Za{constructor(e){this.renderer=e}run(e){const{renderer:r}=this;r.runners.init.emit(r.options),e.hello&&console.log(`PixiJS 7.2.3 - ${r.rendererLogId} - https://pixijs.com`),r.resize(r.screen.width,r.screen.height)}destroy(){}}Za.defaultOptions={hello:!1},Za.extension={type:[Fe.RendererSystem,Fe.CanvasRendererSystem],name:"startup"},qe.add(Za);function s2(t,e=[]){return e[de.NORMAL]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[de.ADD]=[t.ONE,t.ONE],e[de.MULTIPLY]=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[de.SCREEN]=[t.ONE,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[de.OVERLAY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[de.DARKEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[de.LIGHTEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[de.COLOR_DODGE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[de.COLOR_BURN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[de.HARD_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[de.SOFT_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[de.DIFFERENCE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[de.EXCLUSION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[de.HUE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[de.SATURATION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[de.COLOR]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[de.LUMINOSITY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[de.NONE]=[0,0],e[de.NORMAL_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[de.ADD_NPM]=[t.SRC_ALPHA,t.ONE,t.ONE,t.ONE],e[de.SCREEN_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[de.SRC_IN]=[t.DST_ALPHA,t.ZERO],e[de.SRC_OUT]=[t.ONE_MINUS_DST_ALPHA,t.ZERO],e[de.SRC_ATOP]=[t.DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[de.DST_OVER]=[t.ONE_MINUS_DST_ALPHA,t.ONE],e[de.DST_IN]=[t.ZERO,t.SRC_ALPHA],e[de.DST_OUT]=[t.ZERO,t.ONE_MINUS_SRC_ALPHA],e[de.DST_ATOP]=[t.ONE_MINUS_DST_ALPHA,t.SRC_ALPHA],e[de.XOR]=[t.ONE_MINUS_DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[de.SUBTRACT]=[t.ONE,t.ONE,t.ONE,t.ONE,t.FUNC_REVERSE_SUBTRACT,t.FUNC_ADD],e}const a2=0,o2=1,u2=2,l2=3,c2=4,h2=5,Bl=class{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=de.NONE,this._blendEq=!1,this.map=[],this.map[a2]=this.setBlend,this.map[o2]=this.setOffset,this.map[u2]=this.setCullFace,this.map[l2]=this.setDepthTest,this.map[c2]=this.setFrontFace,this.map[h2]=this.setDepthMask,this.checks=[],this.defaultState=new ka,this.defaultState.blend=!0}contextChange(t){this.gl=t,this.blendModes=s2(t),this.set(this.defaultState),this.reset()}set(t){if(t=t||this.defaultState,this.stateId!==t.data){let e=this.stateId^t.data,r=0;for(;e;)e&1&&this.map[r].call(this,!!(t.data&1<<r)),e=e>>1,r++;this.stateId=t.data}for(let e=0;e<this.checks.length;e++)this.checks[e](this,t)}forceState(t){t=t||this.defaultState;for(let e=0;e<this.map.length;e++)this.map[e].call(this,!!(t.data&1<<e));for(let e=0;e<this.checks.length;e++)this.checks[e](this,t);this.stateId=t.data}setBlend(t){this.updateCheck(Bl.checkBlendMode,t),this.gl[t?"enable":"disable"](this.gl.BLEND)}setOffset(t){this.updateCheck(Bl.checkPolygonOffset,t),this.gl[t?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(t){this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(t){this.gl.depthMask(t)}setCullFace(t){this.gl[t?"enable":"disable"](this.gl.CULL_FACE)}setFrontFace(t){this.gl.frontFace(this.gl[t?"CW":"CCW"])}setBlendMode(t){if(t===this.blendMode)return;this.blendMode=t;const e=this.blendModes[t],r=this.gl;e.length===2?r.blendFunc(e[0],e[1]):r.blendFuncSeparate(e[0],e[1],e[2],e[3]),e.length===6?(this._blendEq=!0,r.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,r.blendEquationSeparate(r.FUNC_ADD,r.FUNC_ADD))}setPolygonOffset(t,e){this.gl.polygonOffset(t,e)}reset(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)}updateCheck(t,e){const r=this.checks.indexOf(t);e&&r===-1?this.checks.push(t):!e&&r!==-1&&this.checks.splice(r,1)}static checkBlendMode(t,e){t.setBlendMode(e.blendMode)}static checkPolygonOffset(t,e){t.setPolygonOffset(1,e.polygonOffset)}destroy(){this.gl=null}};let qp=Bl;qp.extension={type:Fe.RendererSystem,name:"state"},qe.add(qp);class f2 extends ma{constructor(){super(...arguments),this.runners={},this._systemsHash={}}setup(e){this.addRunners(...e.runners);const r=(e.priority??[]).filter(i=>e.systems[i]),n=[...r,...Object.keys(e.systems).filter(i=>!r.includes(i))];for(const i of n)this.addSystem(e.systems[i],i)}addRunners(...e){e.forEach(r=>{this.runners[r]=new yr(r)})}addSystem(e,r){const n=new e(this);if(this[r])throw new Error(`Whoops! The name "${r}" is already in use`);this[r]=n,this._systemsHash[r]=n;for(const i in this.runners)this.runners[i].add(n);return this}emitWithCustomOptions(e,r){const n=Object.keys(this._systemsHash);e.items.forEach(i=>{const a=n.find(u=>this._systemsHash[u]===i);i[e.name](r[a])})}destroy(){Object.values(this.runners).forEach(e=>{e.destroy()}),this._systemsHash={}}}const Qa=class{constructor(t){this.renderer=t,this.count=0,this.checkCount=0,this.maxIdle=Qa.defaultMaxIdle,this.checkCountMax=Qa.defaultCheckCountMax,this.mode=Qa.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==Ou.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const t=this.renderer.texture,e=t.managedTextures;let r=!1;for(let n=0;n<e.length;n++){const i=e[n];!i.framebuffer&&this.count-i.touched>this.maxIdle&&(t.destroyTexture(i,!0),e[n]=null,r=!0)}if(r){let n=0;for(let i=0;i<e.length;i++)e[i]!==null&&(e[n++]=e[i]);e.length=n}}unload(t){const e=this.renderer.texture,r=t._texture;r&&!r.framebuffer&&e.destroyTexture(r);for(let n=t.children.length-1;n>=0;n--)this.unload(t.children[n])}destroy(){this.renderer=null}};let wr=Qa;wr.defaultMode=Ou.AUTO,wr.defaultMaxIdle=60*60,wr.defaultCheckCountMax=60*10,wr.extension={type:Fe.RendererSystem,name:"textureGC"},qe.add(wr);class Ul{constructor(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=Ge.UNSIGNED_BYTE,this.internalFormat=Z.RGBA,this.samplerType=0}}function d2(t){let e;return"WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext?e={[Ge.UNSIGNED_BYTE]:{[Z.RGBA]:t.RGBA8,[Z.RGB]:t.RGB8,[Z.RG]:t.RG8,[Z.RED]:t.R8,[Z.RGBA_INTEGER]:t.RGBA8UI,[Z.RGB_INTEGER]:t.RGB8UI,[Z.RG_INTEGER]:t.RG8UI,[Z.RED_INTEGER]:t.R8UI,[Z.ALPHA]:t.ALPHA,[Z.LUMINANCE]:t.LUMINANCE,[Z.LUMINANCE_ALPHA]:t.LUMINANCE_ALPHA},[Ge.BYTE]:{[Z.RGBA]:t.RGBA8_SNORM,[Z.RGB]:t.RGB8_SNORM,[Z.RG]:t.RG8_SNORM,[Z.RED]:t.R8_SNORM,[Z.RGBA_INTEGER]:t.RGBA8I,[Z.RGB_INTEGER]:t.RGB8I,[Z.RG_INTEGER]:t.RG8I,[Z.RED_INTEGER]:t.R8I},[Ge.UNSIGNED_SHORT]:{[Z.RGBA_INTEGER]:t.RGBA16UI,[Z.RGB_INTEGER]:t.RGB16UI,[Z.RG_INTEGER]:t.RG16UI,[Z.RED_INTEGER]:t.R16UI,[Z.DEPTH_COMPONENT]:t.DEPTH_COMPONENT16},[Ge.SHORT]:{[Z.RGBA_INTEGER]:t.RGBA16I,[Z.RGB_INTEGER]:t.RGB16I,[Z.RG_INTEGER]:t.RG16I,[Z.RED_INTEGER]:t.R16I},[Ge.UNSIGNED_INT]:{[Z.RGBA_INTEGER]:t.RGBA32UI,[Z.RGB_INTEGER]:t.RGB32UI,[Z.RG_INTEGER]:t.RG32UI,[Z.RED_INTEGER]:t.R32UI,[Z.DEPTH_COMPONENT]:t.DEPTH_COMPONENT24},[Ge.INT]:{[Z.RGBA_INTEGER]:t.RGBA32I,[Z.RGB_INTEGER]:t.RGB32I,[Z.RG_INTEGER]:t.RG32I,[Z.RED_INTEGER]:t.R32I},[Ge.FLOAT]:{[Z.RGBA]:t.RGBA32F,[Z.RGB]:t.RGB32F,[Z.RG]:t.RG32F,[Z.RED]:t.R32F,[Z.DEPTH_COMPONENT]:t.DEPTH_COMPONENT32F},[Ge.HALF_FLOAT]:{[Z.RGBA]:t.RGBA16F,[Z.RGB]:t.RGB16F,[Z.RG]:t.RG16F,[Z.RED]:t.R16F},[Ge.UNSIGNED_SHORT_5_6_5]:{[Z.RGB]:t.RGB565},[Ge.UNSIGNED_SHORT_4_4_4_4]:{[Z.RGBA]:t.RGBA4},[Ge.UNSIGNED_SHORT_5_5_5_1]:{[Z.RGBA]:t.RGB5_A1},[Ge.UNSIGNED_INT_2_10_10_10_REV]:{[Z.RGBA]:t.RGB10_A2,[Z.RGBA_INTEGER]:t.RGB10_A2UI},[Ge.UNSIGNED_INT_10F_11F_11F_REV]:{[Z.RGB]:t.R11F_G11F_B10F},[Ge.UNSIGNED_INT_5_9_9_9_REV]:{[Z.RGB]:t.RGB9_E5},[Ge.UNSIGNED_INT_24_8]:{[Z.DEPTH_STENCIL]:t.DEPTH24_STENCIL8},[Ge.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[Z.DEPTH_STENCIL]:t.DEPTH32F_STENCIL8}}:e={[Ge.UNSIGNED_BYTE]:{[Z.RGBA]:t.RGBA,[Z.RGB]:t.RGB,[Z.ALPHA]:t.ALPHA,[Z.LUMINANCE]:t.LUMINANCE,[Z.LUMINANCE_ALPHA]:t.LUMINANCE_ALPHA},[Ge.UNSIGNED_SHORT_5_6_5]:{[Z.RGB]:t.RGB},[Ge.UNSIGNED_SHORT_4_4_4_4]:{[Z.RGBA]:t.RGBA},[Ge.UNSIGNED_SHORT_5_5_5_1]:{[Z.RGBA]:t.RGBA}},e}class Yp{constructor(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new ze,this.hasIntegerTextures=!1}contextChange(){const e=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=d2(e);const r=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=r;for(let i=0;i<r;i++)this.boundTextures[i]=null;this.emptyTextures={};const n=new Ul(e.createTexture());e.bindTexture(e.TEXTURE_2D,n.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[e.TEXTURE_2D]=n,this.emptyTextures[e.TEXTURE_CUBE_MAP]=new Ul(e.createTexture()),e.bindTexture(e.TEXTURE_CUBE_MAP,this.emptyTextures[e.TEXTURE_CUBE_MAP].texture);for(let i=0;i<6;i++)e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,null);e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MIN_FILTER,e.LINEAR);for(let i=0;i<this.boundTextures.length;i++)this.bind(null,i)}bind(e,r=0){const{gl:n}=this;if(e=e==null?void 0:e.castToBaseTexture(),e!=null&&e.valid&&!e.parentTextureArray){e.touched=this.renderer.textureGC.count;const i=e._glTextures[this.CONTEXT_UID]||this.initTexture(e);this.boundTextures[r]!==e&&(this.currentLocation!==r&&(this.currentLocation=r,n.activeTexture(n.TEXTURE0+r)),n.bindTexture(e.target,i.texture)),i.dirtyId!==e.dirtyId?(this.currentLocation!==r&&(this.currentLocation=r,n.activeTexture(n.TEXTURE0+r)),this.updateTexture(e)):i.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(e),this.boundTextures[r]=e}else this.currentLocation!==r&&(this.currentLocation=r,n.activeTexture(n.TEXTURE0+r)),n.bindTexture(n.TEXTURE_2D,this.emptyTextures[n.TEXTURE_2D].texture),this.boundTextures[r]=null}reset(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(let e=0;e<this.boundTextures.length;e++)this.boundTextures[e]=this.unknownTexture}unbind(e){const{gl:r,boundTextures:n}=this;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(let i=0;i<n.length;i++)n[i]===this.unknownTexture&&this.bind(null,i)}for(let i=0;i<n.length;i++)n[i]===e&&(this.currentLocation!==i&&(r.activeTexture(r.TEXTURE0+i),this.currentLocation=i),r.bindTexture(e.target,this.emptyTextures[e.target].texture),n[i]=null)}ensureSamplerType(e){const{boundTextures:r,hasIntegerTextures:n,CONTEXT_UID:i}=this;if(n)for(let a=e-1;a>=0;--a){const u=r[a];u&&u._glTextures[i].samplerType!==Mu.FLOAT&&this.renderer.texture.unbind(u)}}initTexture(e){const r=new Ul(this.gl.createTexture());return r.dirtyId=-1,e._glTextures[this.CONTEXT_UID]=r,this.managedTextures.push(e),e.on("dispose",this.destroyTexture,this),r}initTextureType(e,r){var n;r.internalFormat=((n=this.internalFormats[e.type])==null?void 0:n[e.format])??e.format,this.webGLVersion===2&&e.type===Ge.HALF_FLOAT?r.type=this.gl.HALF_FLOAT:r.type=e.type}updateTexture(e){var i;const r=e._glTextures[this.CONTEXT_UID];if(!r)return;const n=this.renderer;if(this.initTextureType(e,r),(i=e.resource)!=null&&i.upload(n,e,r))r.samplerType!==Mu.FLOAT&&(this.hasIntegerTextures=!0);else{const a=e.realWidth,u=e.realHeight,l=n.gl;(r.width!==a||r.height!==u||r.dirtyId<0)&&(r.width=a,r.height=u,l.texImage2D(e.target,0,r.internalFormat,a,u,0,e.format,r.type,null))}e.dirtyStyleId!==r.dirtyStyleId&&this.updateTextureStyle(e),r.dirtyId=e.dirtyId}destroyTexture(e,r){const{gl:n}=this;if(e=e.castToBaseTexture(),e._glTextures[this.CONTEXT_UID]&&(this.unbind(e),n.deleteTexture(e._glTextures[this.CONTEXT_UID].texture),e.off("dispose",this.destroyTexture,this),delete e._glTextures[this.CONTEXT_UID],!r)){const i=this.managedTextures.indexOf(e);i!==-1&&Na(this.managedTextures,i,1)}}updateTextureStyle(e){var n;const r=e._glTextures[this.CONTEXT_UID];r&&((e.mipmap===On.POW2||this.webGLVersion!==2)&&!e.isPowerOfTwo?r.mipmap=!1:r.mipmap=e.mipmap>=1,this.webGLVersion!==2&&!e.isPowerOfTwo?r.wrapMode=hs.CLAMP:r.wrapMode=e.wrapMode,(n=e.resource)!=null&&n.style(this.renderer,e,r)||this.setStyle(e,r),r.dirtyStyleId=e.dirtyStyleId)}setStyle(e,r){const n=this.gl;if(r.mipmap&&e.mipmap!==On.ON_MANUAL&&n.generateMipmap(e.target),n.texParameteri(e.target,n.TEXTURE_WRAP_S,r.wrapMode),n.texParameteri(e.target,n.TEXTURE_WRAP_T,r.wrapMode),r.mipmap){n.texParameteri(e.target,n.TEXTURE_MIN_FILTER,e.scaleMode===kr.LINEAR?n.LINEAR_MIPMAP_LINEAR:n.NEAREST_MIPMAP_NEAREST);const i=this.renderer.context.extensions.anisotropicFiltering;if(i&&e.anisotropicLevel>0&&e.scaleMode===kr.LINEAR){const a=Math.min(e.anisotropicLevel,n.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT));n.texParameterf(e.target,i.TEXTURE_MAX_ANISOTROPY_EXT,a)}}else n.texParameteri(e.target,n.TEXTURE_MIN_FILTER,e.scaleMode===kr.LINEAR?n.LINEAR:n.NEAREST);n.texParameteri(e.target,n.TEXTURE_MAG_FILTER,e.scaleMode===kr.LINEAR?n.LINEAR:n.NEAREST)}destroy(){this.renderer=null}}Yp.extension={type:Fe.RendererSystem,name:"texture"},qe.add(Yp);class Kp{constructor(e){this.renderer=e}contextChange(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(e){const{gl:r,CONTEXT_UID:n}=this,i=e._glTransformFeedbacks[n]||this.createGLTransformFeedback(e);r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,i)}unbind(){const{gl:e}=this;e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,null)}beginTransformFeedback(e,r){const{gl:n,renderer:i}=this;r&&i.shader.bind(r),n.beginTransformFeedback(e)}endTransformFeedback(){const{gl:e}=this;e.endTransformFeedback()}createGLTransformFeedback(e){const{gl:r,renderer:n,CONTEXT_UID:i}=this,a=r.createTransformFeedback();e._glTransformFeedbacks[i]=a,r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,a);for(let u=0;u<e.buffers.length;u++){const l=e.buffers[u];l&&(n.buffer.update(l),l._glBuffers[i].refCount++,r.bindBufferBase(r.TRANSFORM_FEEDBACK_BUFFER,u,l._glBuffers[i].buffer||null))}return r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,null),e.disposeRunner.add(this),a}disposeTransformFeedback(e,r){const n=e._glTransformFeedbacks[this.CONTEXT_UID],i=this.gl;e.disposeRunner.remove(this);const a=this.renderer.buffer;if(a)for(let u=0;u<e.buffers.length;u++){const l=e.buffers[u];if(!l)continue;const h=l._glBuffers[this.CONTEXT_UID];h&&(h.refCount--,h.refCount===0&&!r&&a.dispose(l,r))}n&&(r||i.deleteTransformFeedback(n),delete e._glTransformFeedbacks[this.CONTEXT_UID])}destroy(){this.renderer=null}}Kp.extension={type:Fe.RendererSystem,name:"transformFeedback"},qe.add(Kp);class Ja{constructor(e){this.renderer=e}init(e){this.screen=new Qe(0,0,e.width,e.height),this.element=e.view||Ie.ADAPTER.createCanvas(),this.resolution=e.resolution||Ie.RESOLUTION,this.autoDensity=!!e.autoDensity}resizeView(e,r){this.element.width=Math.round(e*this.resolution),this.element.height=Math.round(r*this.resolution);const n=this.element.width/this.resolution,i=this.element.height/this.resolution;this.screen.width=n,this.screen.height=i,this.autoDensity&&(this.element.style.width=`${n}px`,this.element.style.height=`${i}px`),this.renderer.emit("resize",n,i),this.renderer.runners.resize.emit(this.screen.width,this.screen.height)}destroy(e){var r;e&&((r=this.element.parentNode)==null||r.removeChild(this.element)),this.renderer=null,this.element=null,this.screen=null}}Ja.defaultOptions={width:800,height:600,resolution:Ie.RESOLUTION,autoDensity:!1},Ja.extension={type:[Fe.RendererSystem,Fe.CanvasRendererSystem],name:"_view"},qe.add(Ja),Ie.PREFER_ENV=Mn.WEBGL2,Ie.STRICT_TEXTURE_CACHE=!1,Ie.RENDER_OPTIONS={...Xa.defaultOptions,...Va.defaultOptions,...Ja.defaultOptions,...Za.defaultOptions},Object.defineProperties(Ie,{WRAP_MODE:{get(){return ze.defaultOptions.wrapMode},set(t){ke("7.1.0","settings.WRAP_MODE is deprecated, use BaseTexture.defaultOptions.wrapMode"),ze.defaultOptions.wrapMode=t}},SCALE_MODE:{get(){return ze.defaultOptions.scaleMode},set(t){ke("7.1.0","settings.SCALE_MODE is deprecated, use BaseTexture.defaultOptions.scaleMode"),ze.defaultOptions.scaleMode=t}},MIPMAP_TEXTURES:{get(){return ze.defaultOptions.mipmap},set(t){ke("7.1.0","settings.MIPMAP_TEXTURES is deprecated, use BaseTexture.defaultOptions.mipmap"),ze.defaultOptions.mipmap=t}},ANISOTROPIC_LEVEL:{get(){return ze.defaultOptions.anisotropicLevel},set(t){ke("7.1.0","settings.ANISOTROPIC_LEVEL is deprecated, use BaseTexture.defaultOptions.anisotropicLevel"),ze.defaultOptions.anisotropicLevel=t}},FILTER_RESOLUTION:{get(){return ke("7.1.0","settings.FILTER_RESOLUTION is deprecated, use Filter.defaultResolution"),je.defaultResolution},set(t){je.defaultResolution=t}},FILTER_MULTISAMPLE:{get(){return ke("7.1.0","settings.FILTER_MULTISAMPLE is deprecated, use Filter.defaultMultisample"),je.defaultMultisample},set(t){je.defaultMultisample=t}},SPRITE_MAX_TEXTURES:{get(){return Tr.defaultMaxTextures},set(t){ke("7.1.0","settings.SPRITE_MAX_TEXTURES is deprecated, use BatchRenderer.defaultMaxTextures"),Tr.defaultMaxTextures=t}},SPRITE_BATCH_SIZE:{get(){return Tr.defaultBatchSize},set(t){ke("7.1.0","settings.SPRITE_BATCH_SIZE is deprecated, use BatchRenderer.defaultBatchSize"),Tr.defaultBatchSize=t}},CAN_UPLOAD_SAME_BUFFER:{get(){return Tr.canUploadSameBuffer},set(t){ke("7.1.0","settings.CAN_UPLOAD_SAME_BUFFER is deprecated, use BatchRenderer.canUploadSameBuffer"),Tr.canUploadSameBuffer=t}},GC_MODE:{get(){return wr.defaultMode},set(t){ke("7.1.0","settings.GC_MODE is deprecated, use TextureGCSystem.defaultMode"),wr.defaultMode=t}},GC_MAX_IDLE:{get(){return wr.defaultMaxIdle},set(t){ke("7.1.0","settings.GC_MAX_IDLE is deprecated, use TextureGCSystem.defaultMaxIdle"),wr.defaultMaxIdle=t}},GC_MAX_CHECK_COUNT:{get(){return wr.defaultCheckCountMax},set(t){ke("7.1.0","settings.GC_MAX_CHECK_COUNT is deprecated, use TextureGCSystem.defaultCheckCountMax"),wr.defaultCheckCountMax=t}},PRECISION_VERTEX:{get(){return qr.defaultVertexPrecision},set(t){ke("7.1.0","settings.PRECISION_VERTEX is deprecated, use Program.defaultVertexPrecision"),qr.defaultVertexPrecision=t}},PRECISION_FRAGMENT:{get(){return qr.defaultFragmentPrecision},set(t){ke("7.1.0","settings.PRECISION_FRAGMENT is deprecated, use Program.defaultFragmentPrecision"),qr.defaultFragmentPrecision=t}}});var eo=(t=>(t[t.INTERACTION=50]="INTERACTION",t[t.HIGH=25]="HIGH",t[t.NORMAL=0]="NORMAL",t[t.LOW=-25]="LOW",t[t.UTILITY=-50]="UTILITY",t))(eo||{});class $l{constructor(e,r=null,n=0,i=!1){this.next=null,this.previous=null,this._destroyed=!1,this.fn=e,this.context=r,this.priority=n,this.once=i}match(e,r=null){return this.fn===e&&this.context===r}emit(e){this.fn&&(this.context?this.fn.call(this.context,e):this.fn(e));const r=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),r}connect(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this}destroy(e=!1){this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const r=this.next;return this.next=e?null:r,this.previous=null,r}}const qt=class{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new $l(null,null,1/0),this.deltaMS=1/qt.targetFPMS,this.elapsedMS=1/qt.targetFPMS,this._tick=t=>{this._requestId=null,this.started&&(this.update(t),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(t,e,r=eo.NORMAL){return this._addListener(new $l(t,e,r))}addOnce(t,e,r=eo.NORMAL){return this._addListener(new $l(t,e,r,!0))}_addListener(t){let e=this._head.next,r=this._head;if(!e)t.connect(r);else{for(;e;){if(t.priority>e.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}return this._startIfPossible(),this}remove(t,e){let r=this._head.next;for(;r;)r.match(t,e)?r=r.destroy():r=r.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let t=0,e=this._head;for(;e=e.next;)t++;return t}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let t=this._head.next;for(;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}}update(t=performance.now()){let e;if(t>this.lastTime){if(e=this.elapsedMS=t-this.lastTime,e>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){const i=t-this._lastFrame|0;if(i<this._minElapsedMS)return;this._lastFrame=t-i%this._minElapsedMS}this.deltaMS=e,this.deltaTime=this.deltaMS*qt.targetFPMS;const r=this._head;let n=r.next;for(;n;)n=n.emit(this.deltaTime);r.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(t){const e=Math.min(this.maxFPS,t),r=Math.min(Math.max(0,e)/1e3,qt.targetFPMS);this._maxElapsedMS=1/r}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(t){if(t===0)this._minElapsedMS=0;else{const e=Math.max(this.minFPS,t);this._minElapsedMS=1/(e/1e3)}}static get shared(){if(!qt._shared){const t=qt._shared=new qt;t.autoStart=!0,t._protected=!0}return qt._shared}static get system(){if(!qt._system){const t=qt._system=new qt;t.autoStart=!0,t._protected=!0}return qt._system}};let Sr=qt;Sr.targetFPMS=.06,Object.defineProperties(Ie,{TARGET_FPMS:{get(){return Sr.targetFPMS},set(t){ke("7.1.0","settings.TARGET_FPMS is deprecated, use Ticker.targetFPMS"),Sr.targetFPMS=t}}});class Zp{static init(e){e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,"ticker",{set(r){this._ticker&&this._ticker.remove(this.render,this),this._ticker=r,r&&r.add(this.render,this,eo.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?Sr.shared:new Sr,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}Zp.extension=Fe.Application,qe.add(Zp);const p2=[];qe.handleByList(Fe.Renderer,p2);class Qp{constructor(e){this.renderer=e}contextChange(e){let r;if(this.renderer.context.webGLVersion===1){const n=e.getParameter(e.FRAMEBUFFER_BINDING);e.bindFramebuffer(e.FRAMEBUFFER,null),r=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.FRAMEBUFFER,n)}else{const n=e.getParameter(e.DRAW_FRAMEBUFFER_BINDING);e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),r=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,n)}r>=_t.HIGH?this.multisample=_t.HIGH:r>=_t.MEDIUM?this.multisample=_t.MEDIUM:r>=_t.LOW?this.multisample=_t.LOW:this.multisample=_t.NONE}destroy(){}}Qp.extension={type:Fe.RendererSystem,name:"_multisample"},qe.add(Qp);class g2{constructor(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class Jp{constructor(e){this.renderer=e,this.managedBuffers={},this.boundBufferBases={}}destroy(){this.renderer=null}contextChange(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(e){const{gl:r,CONTEXT_UID:n}=this,i=e._glBuffers[n]||this.createGLBuffer(e);r.bindBuffer(e.type,i.buffer)}unbind(e){const{gl:r}=this;r.bindBuffer(e,null)}bindBufferBase(e,r){const{gl:n,CONTEXT_UID:i}=this;if(this.boundBufferBases[r]!==e){const a=e._glBuffers[i]||this.createGLBuffer(e);this.boundBufferBases[r]=e,n.bindBufferBase(n.UNIFORM_BUFFER,r,a.buffer)}}bindBufferRange(e,r,n){const{gl:i,CONTEXT_UID:a}=this;n=n||0;const u=e._glBuffers[a]||this.createGLBuffer(e);i.bindBufferRange(i.UNIFORM_BUFFER,r||0,u.buffer,n*256,256)}update(e){const{gl:r,CONTEXT_UID:n}=this,i=e._glBuffers[n]||this.createGLBuffer(e);if(e._updateID!==i.updateID)if(i.updateID=e._updateID,r.bindBuffer(e.type,i.buffer),i.byteLength>=e.data.byteLength)r.bufferSubData(e.type,0,e.data);else{const a=e.static?r.STATIC_DRAW:r.DYNAMIC_DRAW;i.byteLength=e.data.byteLength,r.bufferData(e.type,e.data,a)}}dispose(e,r){if(!this.managedBuffers[e.id])return;delete this.managedBuffers[e.id];const n=e._glBuffers[this.CONTEXT_UID],i=this.gl;e.disposeRunner.remove(this),n&&(r||i.deleteBuffer(n.buffer),delete e._glBuffers[this.CONTEXT_UID])}disposeAll(e){const r=Object.keys(this.managedBuffers);for(let n=0;n<r.length;n++)this.dispose(this.managedBuffers[r[n]],e)}createGLBuffer(e){const{CONTEXT_UID:r,gl:n}=this;return e._glBuffers[r]=new g2(n.createBuffer()),this.managedBuffers[e.id]=e,e.disposeRunner.add(this),e._glBuffers[r]}}Jp.extension={type:Fe.RendererSystem,name:"buffer"},qe.add(Jp);class eg{constructor(e){this.renderer=e}render(e,r){const n=this.renderer;let i,a,u,l;if(r&&(i=r.renderTexture,a=r.clear,u=r.transform,l=r.skipUpdateTransform),this.renderingToScreen=!i,n.runners.prerender.emit(),n.emit("prerender"),n.projection.transform=u,!n.context.isLost){if(i||(this.lastObjectRendered=e),!l){const h=e.enableTempParent();e.updateTransform(),e.disableTempParent(h)}n.renderTexture.bind(i),n.batch.currentRenderer.start(),(a??n.background.clearBeforeRender)&&n.renderTexture.clear(),e.render(n),n.batch.currentRenderer.flush(),i&&(r.blit&&n.framebuffer.blit(),i.baseTexture.update()),n.runners.postrender.emit(),n.projection.transform=null,n.emit("postrender")}}destroy(){this.renderer=null,this.lastObjectRendered=null}}eg.extension={type:Fe.RendererSystem,name:"objectRenderer"},qe.add(eg);const Gl=class extends f2{constructor(t){super(),this.type=qf.WEBGL,t=Object.assign({},Ie.RENDER_OPTIONS,t),this.gl=null,this.CONTEXT_UID=0,this.globalUniforms=new xr({projectionMatrix:new kt},!0);const e={runners:["init","destroy","contextChange","resolutionChange","reset","update","postrender","prerender","resize"],systems:Gl.__systems,priority:["_view","textureGenerator","background","_plugin","startup","context","state","texture","buffer","geometry","framebuffer","transformFeedback","mask","scissor","stencil","projection","textureGC","filter","renderTexture","batch","objectRenderer","_multisample"]};this.setup(e),"useContextAlpha"in t&&(ke("7.0.0","options.useContextAlpha is deprecated, use options.premultipliedAlpha and options.backgroundAlpha instead"),t.premultipliedAlpha=t.useContextAlpha&&t.useContextAlpha!=="notMultiplied",t.backgroundAlpha=t.useContextAlpha===!1?1:t.backgroundAlpha),this._plugin.rendererPlugins=Gl.__plugins,this.options=t,this.startup.run(this.options)}static test(t){return t!=null&&t.forceCanvas?!1:XE()}render(t,e){this.objectRenderer.render(t,e)}resize(t,e){this._view.resizeView(t,e)}reset(){return this.runners.reset.emit(),this}clear(){this.renderTexture.bind(),this.renderTexture.clear()}destroy(t=!1){this.runners.destroy.items.reverse(),this.emitWithCustomOptions(this.runners.destroy,{_view:t}),super.destroy()}get plugins(){return this._plugin.plugins}get multisample(){return this._multisample.multisample}get width(){return this._view.element.width}get height(){return this._view.element.height}get resolution(){return this._view.resolution}set resolution(t){this._view.resolution=t,this.runners.resolutionChange.emit(t)}get autoDensity(){return this._view.autoDensity}get view(){return this._view.element}get screen(){return this._view.screen}get lastObjectRendered(){return this.objectRenderer.lastObjectRendered}get renderingToScreen(){return this.objectRenderer.renderingToScreen}get rendererLogId(){return`WebGL ${this.context.webGLVersion}`}get clearBeforeRender(){return ke("7.0.0","renderer.clearBeforeRender has been deprecated, please use renderer.background.clearBeforeRender instead."),this.background.clearBeforeRender}get useContextAlpha(){return ke("7.0.0","renderer.useContextAlpha has been deprecated, please use renderer.context.premultipliedAlpha instead."),this.context.useContextAlpha}get preserveDrawingBuffer(){return ke("7.0.0","renderer.preserveDrawingBuffer has been deprecated, we cannot truly know this unless pixi created the context"),this.context.preserveDrawingBuffer}get backgroundColor(){return ke("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color}set backgroundColor(t){ke("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color=t}get backgroundAlpha(){return ke("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha}set backgroundAlpha(t){ke("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha=t}get powerPreference(){return ke("7.0.0","renderer.powerPreference has been deprecated, we can only know this if pixi creates the context"),this.context.powerPreference}generateTexture(t,e){return this.textureGenerator.generateTexture(t,e)}};let Pi=Gl;Pi.extension={type:Fe.Renderer,priority:1},Pi.__plugins={},Pi.__systems={},qe.handleByMap(Fe.RendererPlugin,Pi.__plugins),qe.handleByMap(Fe.RendererSystem,Pi.__systems),qe.add(Pi);class tg extends Ts{constructor(e,r){const{width:n,height:i}=r||{};super(n,i),this.items=[],this.itemDirtyIds=[];for(let a=0;a<e;a++){const u=new ze;this.items.push(u),this.itemDirtyIds.push(-2)}this.length=e,this._load=null,this.baseTexture=null}initFromArray(e,r){for(let n=0;n<this.length;n++)e[n]&&(e[n].castToBaseTexture?this.addBaseTextureAt(e[n].castToBaseTexture(),n):e[n]instanceof Ts?this.addResourceAt(e[n],n):this.addResourceAt(hp(e[n],r),n))}dispose(){for(let e=0,r=this.length;e<r;e++)this.items[e].destroy();this.items=null,this.itemDirtyIds=null,this._load=null}addResourceAt(e,r){if(!this.items[r])throw new Error(`Index ${r} is out of bounds`);return e.valid&&!this.valid&&this.resize(e.width,e.height),this.items[r].setResource(e),this}bind(e){if(this.baseTexture!==null)throw new Error("Only one base texture per TextureArray is allowed");super.bind(e);for(let r=0;r<this.length;r++)this.items[r].parentTextureArray=e,this.items[r].on("update",e.update,e)}unbind(e){super.unbind(e);for(let r=0;r<this.length;r++)this.items[r].parentTextureArray=null,this.items[r].off("update",e.update,e)}load(){if(this._load)return this._load;const r=this.items.map(n=>n.resource).filter(n=>n).map(n=>n.load());return this._load=Promise.all(r).then(()=>{const{realWidth:n,realHeight:i}=this.items[0];return this.resize(n,i),Promise.resolve(this)}),this._load}}class m2 extends tg{constructor(e,r){const{width:n,height:i}=r||{};let a,u;Array.isArray(e)?(a=e,u=e.length):u=e,super(u,{width:n,height:i}),a&&this.initFromArray(a,r)}addBaseTextureAt(e,r){if(e.resource)this.addResourceAt(e.resource,r);else throw new Error("ArrayResource does not support RenderTexture");return this}bind(e){super.bind(e),e.target=fi.TEXTURE_2D_ARRAY}upload(e,r,n){const{length:i,itemDirtyIds:a,items:u}=this,{gl:l}=e;n.dirtyId<0&&l.texImage3D(l.TEXTURE_2D_ARRAY,0,n.internalFormat,this._width,this._height,i,0,r.format,n.type,null);for(let h=0;h<i;h++){const p=u[h];a[h]<p.dirtyId&&(a[h]=p.dirtyId,p.valid&&l.texSubImage3D(l.TEXTURE_2D_ARRAY,0,0,0,h,p.resource.width,p.resource.height,1,r.format,n.type,p.resource.source))}return!0}}class _2 extends mn{constructor(e){super(e)}static test(e){const{OffscreenCanvas:r}=globalThis;return r&&e instanceof r?!0:globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement}}const Rs=class extends tg{constructor(t,e){const{width:r,height:n,autoLoad:i,linkBaseTexture:a}=e||{};if(t&&t.length!==Rs.SIDES)throw new Error(`Invalid length. Got ${t.length}, expected 6`);super(6,{width:r,height:n});for(let u=0;u<Rs.SIDES;u++)this.items[u].target=fi.TEXTURE_CUBE_MAP_POSITIVE_X+u;this.linkBaseTexture=a!==!1,t&&this.initFromArray(t,e),i!==!1&&this.load()}bind(t){super.bind(t),t.target=fi.TEXTURE_CUBE_MAP}addBaseTextureAt(t,e,r){if(r===void 0&&(r=this.linkBaseTexture),!this.items[e])throw new Error(`Index ${e} is out of bounds`);if(!this.linkBaseTexture||t.parentTextureArray||Object.keys(t._glTextures).length>0)if(t.resource)this.addResourceAt(t.resource,e);else throw new Error("CubeResource does not support copying of renderTexture.");else t.target=fi.TEXTURE_CUBE_MAP_POSITIVE_X+e,t.parentTextureArray=this.baseTexture,this.items[e]=t;return t.valid&&!this.valid&&this.resize(t.realWidth,t.realHeight),this.items[e]=t,this}upload(t,e,r){const n=this.itemDirtyIds;for(let i=0;i<Rs.SIDES;i++){const a=this.items[i];(n[i]<a.dirtyId||r.dirtyId<e.dirtyId)&&(a.valid&&a.resource?(a.resource.upload(t,a,r),n[i]=a.dirtyId):n[i]<-1&&(t.gl.texImage2D(a.target,0,r.internalFormat,e.realWidth,e.realHeight,0,e.format,r.type,null),n[i]=-1))}return!0}static test(t){return Array.isArray(t)&&t.length===Rs.SIDES}};let rg=Rs;rg.SIDES=6;class Mi extends mn{constructor(e,r){r=r||{};let n,i;typeof e=="string"?(n=Mi.EMPTY,i=e):(n=e,i=null),super(n),this.url=i,this.crossOrigin=r.crossOrigin??!0,this.alphaMode=typeof r.alphaMode=="number"?r.alphaMode:null,this._load=null,r.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(async(e,r)=>{if(this.url===null){e(this);return}try{const n=await Ie.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;const i=await n.blob();if(this.destroyed)return;const a=await createImageBitmap(i,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===hn.UNPACK?"premultiply":"none"});if(this.destroyed)return;this.source=a,this.update(),e(this)}catch(n){if(this.destroyed)return;r(n),this.onError.emit(n)}}),this._load)}upload(e,r,n){return this.source instanceof ImageBitmap?(typeof this.alphaMode=="number"&&(r.alphaMode=this.alphaMode),super.upload(e,r,n)):(this.load(),!1)}dispose(){this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(e){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&(typeof e=="string"||e instanceof ImageBitmap)}static get EMPTY(){return Mi._EMPTY=Mi._EMPTY??Ie.ADAPTER.createCanvas(0,0),Mi._EMPTY}}const to=class extends mn{constructor(t,e){e=e||{},super(Ie.ADAPTER.createCanvas()),this._width=0,this._height=0,this.svg=t,this.scale=e.scale||1,this._overrideWidth=e.width,this._overrideHeight=e.height,this._resolve=null,this._crossorigin=e.crossorigin,this._load=null,e.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(t=>{if(this._resolve=()=>{this.resize(this.source.width,this.source.height),t(this)},to.SVG_XML.test(this.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");this.svg=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`}this._loadSvg()}),this._load)}_loadSvg(){const t=new Image;mn.crossOrigin(t,this.svg,this._crossorigin),t.src=this.svg,t.onerror=e=>{this._resolve&&(t.onerror=null,this.onError.emit(e))},t.onload=()=>{if(!this._resolve)return;const e=t.width,r=t.height;if(!e||!r)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let n=e*this.scale,i=r*this.scale;(this._overrideWidth||this._overrideHeight)&&(n=this._overrideWidth||this._overrideHeight/r*e,i=this._overrideHeight||this._overrideWidth/e*r),n=Math.round(n),i=Math.round(i);const a=this.source;a.width=n,a.height=i,a._pixiId=`canvas_${bs()}`,a.getContext("2d").drawImage(t,0,0,e,r,0,0,n,i),this._resolve(),this._resolve=null}}static getSize(t){const e=to.SVG_SIZE.exec(t),r={};return e&&(r[e[1]]=Math.round(parseFloat(e[3])),r[e[5]]=Math.round(parseFloat(e[7]))),r}dispose(){super.dispose(),this._resolve=null,this._crossorigin=null}static test(t,e){return e==="svg"||typeof t=="string"&&t.startsWith("data:image/svg+xml")||typeof t=="string"&&to.SVG_XML.test(t)}};let zl=to;zl.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,zl.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;const Hl=class extends mn{constructor(t,e){if(e=e||{},!(t instanceof HTMLVideoElement)){const r=document.createElement("video");r.setAttribute("preload","auto"),r.setAttribute("webkit-playsinline",""),r.setAttribute("playsinline",""),typeof t=="string"&&(t=[t]);const n=t[0].src||t[0];mn.crossOrigin(r,n,e.crossorigin);for(let i=0;i<t.length;++i){const a=document.createElement("source");let{src:u,mime:l}=t[i];u=u||t[i];const h=u.split("?").shift().toLowerCase(),p=h.slice(h.lastIndexOf(".")+1);l=l||Hl.MIME_TYPES[p]||`video/${p}`,a.src=u,a.type=l,r.appendChild(a)}t=r}super(t),this.noSubImage=!0,this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=e.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=e.autoPlay!==!1,this._load=null,this._resolve=null,this._onCanPlay=this._onCanPlay.bind(this),this._onError=this._onError.bind(this),e.autoLoad!==!1&&this.load()}update(t=0){if(!this.destroyed){const e=Sr.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-e),(!this._updateFPS||this._msToNextUpdate<=0)&&(super.update(),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}}load(){if(this._load)return this._load;const t=this.source;return(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),t.addEventListener("play",this._onPlayStart.bind(this)),t.addEventListener("pause",this._onPlayStop.bind(this)),this._isSourceReady()?this._onCanPlay():(t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlay),t.addEventListener("error",this._onError,!0)),this._load=new Promise(e=>{this.valid?e(this):(this._resolve=e,t.load())}),this._load}_onError(t){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(t)}_isSourcePlaying(){const t=this.source;return!t.paused&&!t.ended&&this._isSourceReady()}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(Sr.shared.add(this.update,this),this._isConnectedToTicker=!0)}_onPlayStop(){this._isConnectedToTicker&&(Sr.shared.remove(this.update,this),this._isConnectedToTicker=!1)}_onCanPlay(){const t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);const e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()}dispose(){this._isConnectedToTicker&&(Sr.shared.remove(this.update,this),this._isConnectedToTicker=!1);const t=this.source;t&&(t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),super.dispose()}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(Sr.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(Sr.shared.add(this.update,this),this._isConnectedToTicker=!0))}get updateFPS(){return this._updateFPS}set updateFPS(t){t!==this._updateFPS&&(this._updateFPS=t)}static test(t,e){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement||Hl.TYPES.includes(e)}};let Vl=Hl;Vl.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],Vl.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},El.push(Mi,Ip,_2,Vl,zl,Cl,rg,m2);var v2=`attribute vec2 aVertexPosition;
|
|
520
|
+
`),{size:n,syncFunc:new Function("ud","uv","renderer","syncData","buffer",s.join(`
|
|
521
|
+
`))}}let tb=0;const In={textureCount:0,uboCount:0};class ph{constructor(e){this.destroyed=!1,this.renderer=e,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=tb++}systemCheck(){if(!S1())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")}contextChange(e){this.gl=e,this.reset()}bind(e,r){e.disposeRunner.add(this),e.uniforms.globals=this.renderer.globalUniforms;const i=e.program,n=i.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(e);return this.shader=e,this.program!==i&&(this.program=i,this.gl.useProgram(n.program)),r||(In.textureCount=0,In.uboCount=0,this.syncUniformGroup(e.uniformGroup,In)),n}setUniforms(e){const r=this.shader.program,i=r.glPrograms[this.renderer.CONTEXT_UID];r.syncUniforms(i.uniformData,e,this.renderer)}syncUniformGroup(e,r){const i=this.getGlProgram();(!e.static||e.dirtyId!==i.uniformDirtyGroups[e.id])&&(i.uniformDirtyGroups[e.id]=e.dirtyId,this.syncUniforms(e,i,r))}syncUniforms(e,r,i){(e.syncUniforms[this.shader.program.id]||this.createSyncGroups(e))(r.uniformData,e.uniforms,this.renderer,i)}createSyncGroups(e){const r=this.getSignature(e,this.shader.program.uniformData,"u");return this.cache[r]||(this.cache[r]=y1(e,this.shader.program.uniformData)),e.syncUniforms[this.shader.program.id]=this.cache[r],e.syncUniforms[this.shader.program.id]}syncUniformBufferGroup(e,r){const i=this.getGlProgram();if(!e.static||e.dirtyId!==0||!i.uniformGroups[e.id]){e.dirtyId=0;const n=i.uniformGroups[e.id]||this.createSyncBufferGroup(e,i,r);e.buffer.update(),n(i.uniformData,e.uniforms,this.renderer,In,e.buffer)}this.renderer.buffer.bindBufferBase(e.buffer,i.uniformBufferBindings[r])}createSyncBufferGroup(e,r,i){const{gl:n}=this.renderer;this.renderer.buffer.bind(e.buffer);const s=this.gl.getUniformBlockIndex(r.program,i);r.uniformBufferBindings[i]=this.shader.uniformBindCount,n.uniformBlockBinding(r.program,s,this.shader.uniformBindCount),this.shader.uniformBindCount++;const a=this.getSignature(e,this.shader.program.uniformData,"ubo");let o=this._uboCache[a];if(o||(o=this._uboCache[a]=eb(e,this.shader.program.uniformData)),e.autoManage){const u=new Float32Array(o.size/4);e.buffer.update(u)}return r.uniformGroups[e.id]=o.syncFunc,r.uniformGroups[e.id]}getSignature(e,r,i){const n=e.uniforms,s=[`${i}-`];for(const a in n)s.push(a),r[a]&&s.push(r[a].type);return s.join("-")}getGlProgram(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null}generateProgram(e){const r=this.gl,i=e.program,n=Y1(r,i);return i.glPrograms[this.renderer.CONTEXT_UID]=n,n}reset(){this.program=null,this.shader=null}disposeShader(e){this.shader===e&&(this.shader=null)}destroy(){this.renderer=null,this.destroyed=!0}}ph.extension={type:re.RendererSystem,name:"shader"},he.add(ph);class Rn{constructor(e){this.renderer=e}run(e){const{renderer:r}=this;r.runners.init.emit(r.options),e.hello&&console.log(`PixiJS 7.2.3 - ${r.rendererLogId} - https://pixijs.com`),r.resize(r.screen.width,r.screen.height)}destroy(){}}Rn.defaultOptions={hello:!1},Rn.extension={type:[re.RendererSystem,re.CanvasRendererSystem],name:"startup"},he.add(Rn);function rb(t,e=[]){return e[z.NORMAL]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[z.ADD]=[t.ONE,t.ONE],e[z.MULTIPLY]=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[z.SCREEN]=[t.ONE,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[z.OVERLAY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[z.DARKEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[z.LIGHTEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[z.COLOR_DODGE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[z.COLOR_BURN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[z.HARD_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[z.SOFT_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[z.DIFFERENCE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[z.EXCLUSION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[z.HUE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[z.SATURATION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[z.COLOR]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[z.LUMINOSITY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[z.NONE]=[0,0],e[z.NORMAL_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[z.ADD_NPM]=[t.SRC_ALPHA,t.ONE,t.ONE,t.ONE],e[z.SCREEN_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[z.SRC_IN]=[t.DST_ALPHA,t.ZERO],e[z.SRC_OUT]=[t.ONE_MINUS_DST_ALPHA,t.ZERO],e[z.SRC_ATOP]=[t.DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[z.DST_OVER]=[t.ONE_MINUS_DST_ALPHA,t.ONE],e[z.DST_IN]=[t.ZERO,t.SRC_ALPHA],e[z.DST_OUT]=[t.ZERO,t.ONE_MINUS_SRC_ALPHA],e[z.DST_ATOP]=[t.ONE_MINUS_DST_ALPHA,t.SRC_ALPHA],e[z.XOR]=[t.ONE_MINUS_DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[z.SUBTRACT]=[t.ONE,t.ONE,t.ONE,t.ONE,t.FUNC_REVERSE_SUBTRACT,t.FUNC_ADD],e}const ib=0,nb=1,sb=2,ab=3,ob=4,lb=5,Ea=class{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=z.NONE,this._blendEq=!1,this.map=[],this.map[ib]=this.setBlend,this.map[nb]=this.setOffset,this.map[sb]=this.setCullFace,this.map[ab]=this.setDepthTest,this.map[ob]=this.setFrontFace,this.map[lb]=this.setDepthMask,this.checks=[],this.defaultState=new pn,this.defaultState.blend=!0}contextChange(t){this.gl=t,this.blendModes=rb(t),this.set(this.defaultState),this.reset()}set(t){if(t=t||this.defaultState,this.stateId!==t.data){let e=this.stateId^t.data,r=0;for(;e;)e&1&&this.map[r].call(this,!!(t.data&1<<r)),e=e>>1,r++;this.stateId=t.data}for(let e=0;e<this.checks.length;e++)this.checks[e](this,t)}forceState(t){t=t||this.defaultState;for(let e=0;e<this.map.length;e++)this.map[e].call(this,!!(t.data&1<<e));for(let e=0;e<this.checks.length;e++)this.checks[e](this,t);this.stateId=t.data}setBlend(t){this.updateCheck(Ea.checkBlendMode,t),this.gl[t?"enable":"disable"](this.gl.BLEND)}setOffset(t){this.updateCheck(Ea.checkPolygonOffset,t),this.gl[t?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(t){this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(t){this.gl.depthMask(t)}setCullFace(t){this.gl[t?"enable":"disable"](this.gl.CULL_FACE)}setFrontFace(t){this.gl.frontFace(this.gl[t?"CW":"CCW"])}setBlendMode(t){if(t===this.blendMode)return;this.blendMode=t;const e=this.blendModes[t],r=this.gl;e.length===2?r.blendFunc(e[0],e[1]):r.blendFuncSeparate(e[0],e[1],e[2],e[3]),e.length===6?(this._blendEq=!0,r.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,r.blendEquationSeparate(r.FUNC_ADD,r.FUNC_ADD))}setPolygonOffset(t,e){this.gl.polygonOffset(t,e)}reset(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)}updateCheck(t,e){const r=this.checks.indexOf(t);e&&r===-1?this.checks.push(t):!e&&r!==-1&&this.checks.splice(r,1)}static checkBlendMode(t,e){t.setBlendMode(e.blendMode)}static checkPolygonOffset(t,e){t.setPolygonOffset(1,e.polygonOffset)}destroy(){this.gl=null}};let mh=Ea;mh.extension={type:re.RendererSystem,name:"state"},he.add(mh);class ub extends Xi{constructor(){super(...arguments),this.runners={},this._systemsHash={}}setup(e){this.addRunners(...e.runners);const r=(e.priority??[]).filter(n=>e.systems[n]),i=[...r,...Object.keys(e.systems).filter(n=>!r.includes(n))];for(const n of i)this.addSystem(e.systems[n],n)}addRunners(...e){e.forEach(r=>{this.runners[r]=new it(r)})}addSystem(e,r){const i=new e(this);if(this[r])throw new Error(`Whoops! The name "${r}" is already in use`);this[r]=i,this._systemsHash[r]=i;for(const n in this.runners)this.runners[n].add(i);return this}emitWithCustomOptions(e,r){const i=Object.keys(this._systemsHash);e.items.forEach(n=>{const s=i.find(a=>this._systemsHash[a]===n);n[e.name](r[s])})}destroy(){Object.values(this.runners).forEach(e=>{e.destroy()}),this._systemsHash={}}}const Pn=class{constructor(t){this.renderer=t,this.count=0,this.checkCount=0,this.maxIdle=Pn.defaultMaxIdle,this.checkCountMax=Pn.defaultCheckCountMax,this.mode=Pn.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==xs.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const t=this.renderer.texture,e=t.managedTextures;let r=!1;for(let i=0;i<e.length;i++){const n=e[i];!n.framebuffer&&this.count-n.touched>this.maxIdle&&(t.destroyTexture(n,!0),e[i]=null,r=!0)}if(r){let i=0;for(let n=0;n<e.length;n++)e[n]!==null&&(e[i++]=e[n]);e.length=i}}unload(t){const e=this.renderer.texture,r=t._texture;r&&!r.framebuffer&&e.destroyTexture(r);for(let i=t.children.length-1;i>=0;i--)this.unload(t.children[i])}destroy(){this.renderer=null}};let ot=Pn;ot.defaultMode=xs.AUTO,ot.defaultMaxIdle=60*60,ot.defaultCheckCountMax=60*10,ot.extension={type:re.RendererSystem,name:"textureGC"},he.add(ot);class Ca{constructor(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=ae.UNSIGNED_BYTE,this.internalFormat=N.RGBA,this.samplerType=0}}function hb(t){let e;return"WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext?e={[ae.UNSIGNED_BYTE]:{[N.RGBA]:t.RGBA8,[N.RGB]:t.RGB8,[N.RG]:t.RG8,[N.RED]:t.R8,[N.RGBA_INTEGER]:t.RGBA8UI,[N.RGB_INTEGER]:t.RGB8UI,[N.RG_INTEGER]:t.RG8UI,[N.RED_INTEGER]:t.R8UI,[N.ALPHA]:t.ALPHA,[N.LUMINANCE]:t.LUMINANCE,[N.LUMINANCE_ALPHA]:t.LUMINANCE_ALPHA},[ae.BYTE]:{[N.RGBA]:t.RGBA8_SNORM,[N.RGB]:t.RGB8_SNORM,[N.RG]:t.RG8_SNORM,[N.RED]:t.R8_SNORM,[N.RGBA_INTEGER]:t.RGBA8I,[N.RGB_INTEGER]:t.RGB8I,[N.RG_INTEGER]:t.RG8I,[N.RED_INTEGER]:t.R8I},[ae.UNSIGNED_SHORT]:{[N.RGBA_INTEGER]:t.RGBA16UI,[N.RGB_INTEGER]:t.RGB16UI,[N.RG_INTEGER]:t.RG16UI,[N.RED_INTEGER]:t.R16UI,[N.DEPTH_COMPONENT]:t.DEPTH_COMPONENT16},[ae.SHORT]:{[N.RGBA_INTEGER]:t.RGBA16I,[N.RGB_INTEGER]:t.RGB16I,[N.RG_INTEGER]:t.RG16I,[N.RED_INTEGER]:t.R16I},[ae.UNSIGNED_INT]:{[N.RGBA_INTEGER]:t.RGBA32UI,[N.RGB_INTEGER]:t.RGB32UI,[N.RG_INTEGER]:t.RG32UI,[N.RED_INTEGER]:t.R32UI,[N.DEPTH_COMPONENT]:t.DEPTH_COMPONENT24},[ae.INT]:{[N.RGBA_INTEGER]:t.RGBA32I,[N.RGB_INTEGER]:t.RGB32I,[N.RG_INTEGER]:t.RG32I,[N.RED_INTEGER]:t.R32I},[ae.FLOAT]:{[N.RGBA]:t.RGBA32F,[N.RGB]:t.RGB32F,[N.RG]:t.RG32F,[N.RED]:t.R32F,[N.DEPTH_COMPONENT]:t.DEPTH_COMPONENT32F},[ae.HALF_FLOAT]:{[N.RGBA]:t.RGBA16F,[N.RGB]:t.RGB16F,[N.RG]:t.RG16F,[N.RED]:t.R16F},[ae.UNSIGNED_SHORT_5_6_5]:{[N.RGB]:t.RGB565},[ae.UNSIGNED_SHORT_4_4_4_4]:{[N.RGBA]:t.RGBA4},[ae.UNSIGNED_SHORT_5_5_5_1]:{[N.RGBA]:t.RGB5_A1},[ae.UNSIGNED_INT_2_10_10_10_REV]:{[N.RGBA]:t.RGB10_A2,[N.RGBA_INTEGER]:t.RGB10_A2UI},[ae.UNSIGNED_INT_10F_11F_11F_REV]:{[N.RGB]:t.R11F_G11F_B10F},[ae.UNSIGNED_INT_5_9_9_9_REV]:{[N.RGB]:t.RGB9_E5},[ae.UNSIGNED_INT_24_8]:{[N.DEPTH_STENCIL]:t.DEPTH24_STENCIL8},[ae.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[N.DEPTH_STENCIL]:t.DEPTH32F_STENCIL8}}:e={[ae.UNSIGNED_BYTE]:{[N.RGBA]:t.RGBA,[N.RGB]:t.RGB,[N.ALPHA]:t.ALPHA,[N.LUMINANCE]:t.LUMINANCE,[N.LUMINANCE_ALPHA]:t.LUMINANCE_ALPHA},[ae.UNSIGNED_SHORT_5_6_5]:{[N.RGB]:t.RGB},[ae.UNSIGNED_SHORT_4_4_4_4]:{[N.RGBA]:t.RGBA},[ae.UNSIGNED_SHORT_5_5_5_1]:{[N.RGBA]:t.RGBA}},e}class gh{constructor(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new oe,this.hasIntegerTextures=!1}contextChange(){const e=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=hb(e);const r=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=r;for(let n=0;n<r;n++)this.boundTextures[n]=null;this.emptyTextures={};const i=new Ca(e.createTexture());e.bindTexture(e.TEXTURE_2D,i.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[e.TEXTURE_2D]=i,this.emptyTextures[e.TEXTURE_CUBE_MAP]=new Ca(e.createTexture()),e.bindTexture(e.TEXTURE_CUBE_MAP,this.emptyTextures[e.TEXTURE_CUBE_MAP].texture);for(let n=0;n<6;n++)e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,null);e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MIN_FILTER,e.LINEAR);for(let n=0;n<this.boundTextures.length;n++)this.bind(null,n)}bind(e,r=0){const{gl:i}=this;if(e=e==null?void 0:e.castToBaseTexture(),e!=null&&e.valid&&!e.parentTextureArray){e.touched=this.renderer.textureGC.count;const n=e._glTextures[this.CONTEXT_UID]||this.initTexture(e);this.boundTextures[r]!==e&&(this.currentLocation!==r&&(this.currentLocation=r,i.activeTexture(i.TEXTURE0+r)),i.bindTexture(e.target,n.texture)),n.dirtyId!==e.dirtyId?(this.currentLocation!==r&&(this.currentLocation=r,i.activeTexture(i.TEXTURE0+r)),this.updateTexture(e)):n.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(e),this.boundTextures[r]=e}else this.currentLocation!==r&&(this.currentLocation=r,i.activeTexture(i.TEXTURE0+r)),i.bindTexture(i.TEXTURE_2D,this.emptyTextures[i.TEXTURE_2D].texture),this.boundTextures[r]=null}reset(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(let e=0;e<this.boundTextures.length;e++)this.boundTextures[e]=this.unknownTexture}unbind(e){const{gl:r,boundTextures:i}=this;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(let n=0;n<i.length;n++)i[n]===this.unknownTexture&&this.bind(null,n)}for(let n=0;n<i.length;n++)i[n]===e&&(this.currentLocation!==n&&(r.activeTexture(r.TEXTURE0+n),this.currentLocation=n),r.bindTexture(e.target,this.emptyTextures[e.target].texture),i[n]=null)}ensureSamplerType(e){const{boundTextures:r,hasIntegerTextures:i,CONTEXT_UID:n}=this;if(i)for(let s=e-1;s>=0;--s){const a=r[s];a&&a._glTextures[n].samplerType!==ys.FLOAT&&this.renderer.texture.unbind(a)}}initTexture(e){const r=new Ca(this.gl.createTexture());return r.dirtyId=-1,e._glTextures[this.CONTEXT_UID]=r,this.managedTextures.push(e),e.on("dispose",this.destroyTexture,this),r}initTextureType(e,r){var i;r.internalFormat=((i=this.internalFormats[e.type])==null?void 0:i[e.format])??e.format,this.webGLVersion===2&&e.type===ae.HALF_FLOAT?r.type=this.gl.HALF_FLOAT:r.type=e.type}updateTexture(e){var n;const r=e._glTextures[this.CONTEXT_UID];if(!r)return;const i=this.renderer;if(this.initTextureType(e,r),(n=e.resource)!=null&&n.upload(i,e,r))r.samplerType!==ys.FLOAT&&(this.hasIntegerTextures=!0);else{const s=e.realWidth,a=e.realHeight,o=i.gl;(r.width!==s||r.height!==a||r.dirtyId<0)&&(r.width=s,r.height=a,o.texImage2D(e.target,0,r.internalFormat,s,a,0,e.format,r.type,null))}e.dirtyStyleId!==r.dirtyStyleId&&this.updateTextureStyle(e),r.dirtyId=e.dirtyId}destroyTexture(e,r){const{gl:i}=this;if(e=e.castToBaseTexture(),e._glTextures[this.CONTEXT_UID]&&(this.unbind(e),i.deleteTexture(e._glTextures[this.CONTEXT_UID].texture),e.off("dispose",this.destroyTexture,this),delete e._glTextures[this.CONTEXT_UID],!r)){const n=this.managedTextures.indexOf(e);n!==-1&&cn(this.managedTextures,n,1)}}updateTextureStyle(e){var i;const r=e._glTextures[this.CONTEXT_UID];r&&((e.mipmap===Vt.POW2||this.webGLVersion!==2)&&!e.isPowerOfTwo?r.mipmap=!1:r.mipmap=e.mipmap>=1,this.webGLVersion!==2&&!e.isPowerOfTwo?r.wrapMode=Qr.CLAMP:r.wrapMode=e.wrapMode,(i=e.resource)!=null&&i.style(this.renderer,e,r)||this.setStyle(e,r),r.dirtyStyleId=e.dirtyStyleId)}setStyle(e,r){const i=this.gl;if(r.mipmap&&e.mipmap!==Vt.ON_MANUAL&&i.generateMipmap(e.target),i.texParameteri(e.target,i.TEXTURE_WRAP_S,r.wrapMode),i.texParameteri(e.target,i.TEXTURE_WRAP_T,r.wrapMode),r.mipmap){i.texParameteri(e.target,i.TEXTURE_MIN_FILTER,e.scaleMode===et.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);const n=this.renderer.context.extensions.anisotropicFiltering;if(n&&e.anisotropicLevel>0&&e.scaleMode===et.LINEAR){const s=Math.min(e.anisotropicLevel,i.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT));i.texParameterf(e.target,n.TEXTURE_MAX_ANISOTROPY_EXT,s)}}else i.texParameteri(e.target,i.TEXTURE_MIN_FILTER,e.scaleMode===et.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(e.target,i.TEXTURE_MAG_FILTER,e.scaleMode===et.LINEAR?i.LINEAR:i.NEAREST)}destroy(){this.renderer=null}}gh.extension={type:re.RendererSystem,name:"texture"},he.add(gh);class _h{constructor(e){this.renderer=e}contextChange(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(e){const{gl:r,CONTEXT_UID:i}=this,n=e._glTransformFeedbacks[i]||this.createGLTransformFeedback(e);r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,n)}unbind(){const{gl:e}=this;e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,null)}beginTransformFeedback(e,r){const{gl:i,renderer:n}=this;r&&n.shader.bind(r),i.beginTransformFeedback(e)}endTransformFeedback(){const{gl:e}=this;e.endTransformFeedback()}createGLTransformFeedback(e){const{gl:r,renderer:i,CONTEXT_UID:n}=this,s=r.createTransformFeedback();e._glTransformFeedbacks[n]=s,r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,s);for(let a=0;a<e.buffers.length;a++){const o=e.buffers[a];o&&(i.buffer.update(o),o._glBuffers[n].refCount++,r.bindBufferBase(r.TRANSFORM_FEEDBACK_BUFFER,a,o._glBuffers[n].buffer||null))}return r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,null),e.disposeRunner.add(this),s}disposeTransformFeedback(e,r){const i=e._glTransformFeedbacks[this.CONTEXT_UID],n=this.gl;e.disposeRunner.remove(this);const s=this.renderer.buffer;if(s)for(let a=0;a<e.buffers.length;a++){const o=e.buffers[a];if(!o)continue;const u=o._glBuffers[this.CONTEXT_UID];u&&(u.refCount--,u.refCount===0&&!r&&s.dispose(o,r))}i&&(r||n.deleteTransformFeedback(i),delete e._glTransformFeedbacks[this.CONTEXT_UID])}destroy(){this.renderer=null}}_h.extension={type:re.RendererSystem,name:"transformFeedback"},he.add(_h);class Mn{constructor(e){this.renderer=e}init(e){this.screen=new pe(0,0,e.width,e.height),this.element=e.view||q.ADAPTER.createCanvas(),this.resolution=e.resolution||q.RESOLUTION,this.autoDensity=!!e.autoDensity}resizeView(e,r){this.element.width=Math.round(e*this.resolution),this.element.height=Math.round(r*this.resolution);const i=this.element.width/this.resolution,n=this.element.height/this.resolution;this.screen.width=i,this.screen.height=n,this.autoDensity&&(this.element.style.width=`${i}px`,this.element.style.height=`${n}px`),this.renderer.emit("resize",i,n),this.renderer.runners.resize.emit(this.screen.width,this.screen.height)}destroy(e){var r;e&&((r=this.element.parentNode)==null||r.removeChild(this.element)),this.renderer=null,this.element=null,this.screen=null}}Mn.defaultOptions={width:800,height:600,resolution:q.RESOLUTION,autoDensity:!1},Mn.extension={type:[re.RendererSystem,re.CanvasRendererSystem],name:"_view"},he.add(Mn),q.PREFER_ENV=Ht.WEBGL2,q.STRICT_TEXTURE_CACHE=!1,q.RENDER_OPTIONS={...wn.defaultOptions,...Tn.defaultOptions,...Mn.defaultOptions,...Rn.defaultOptions},Object.defineProperties(q,{WRAP_MODE:{get(){return oe.defaultOptions.wrapMode},set(t){ne("7.1.0","settings.WRAP_MODE is deprecated, use BaseTexture.defaultOptions.wrapMode"),oe.defaultOptions.wrapMode=t}},SCALE_MODE:{get(){return oe.defaultOptions.scaleMode},set(t){ne("7.1.0","settings.SCALE_MODE is deprecated, use BaseTexture.defaultOptions.scaleMode"),oe.defaultOptions.scaleMode=t}},MIPMAP_TEXTURES:{get(){return oe.defaultOptions.mipmap},set(t){ne("7.1.0","settings.MIPMAP_TEXTURES is deprecated, use BaseTexture.defaultOptions.mipmap"),oe.defaultOptions.mipmap=t}},ANISOTROPIC_LEVEL:{get(){return oe.defaultOptions.anisotropicLevel},set(t){ne("7.1.0","settings.ANISOTROPIC_LEVEL is deprecated, use BaseTexture.defaultOptions.anisotropicLevel"),oe.defaultOptions.anisotropicLevel=t}},FILTER_RESOLUTION:{get(){return ne("7.1.0","settings.FILTER_RESOLUTION is deprecated, use Filter.defaultResolution"),ce.defaultResolution},set(t){ce.defaultResolution=t}},FILTER_MULTISAMPLE:{get(){return ne("7.1.0","settings.FILTER_MULTISAMPLE is deprecated, use Filter.defaultMultisample"),ce.defaultMultisample},set(t){ce.defaultMultisample=t}},SPRITE_MAX_TEXTURES:{get(){return at.defaultMaxTextures},set(t){ne("7.1.0","settings.SPRITE_MAX_TEXTURES is deprecated, use BatchRenderer.defaultMaxTextures"),at.defaultMaxTextures=t}},SPRITE_BATCH_SIZE:{get(){return at.defaultBatchSize},set(t){ne("7.1.0","settings.SPRITE_BATCH_SIZE is deprecated, use BatchRenderer.defaultBatchSize"),at.defaultBatchSize=t}},CAN_UPLOAD_SAME_BUFFER:{get(){return at.canUploadSameBuffer},set(t){ne("7.1.0","settings.CAN_UPLOAD_SAME_BUFFER is deprecated, use BatchRenderer.canUploadSameBuffer"),at.canUploadSameBuffer=t}},GC_MODE:{get(){return ot.defaultMode},set(t){ne("7.1.0","settings.GC_MODE is deprecated, use TextureGCSystem.defaultMode"),ot.defaultMode=t}},GC_MAX_IDLE:{get(){return ot.defaultMaxIdle},set(t){ne("7.1.0","settings.GC_MAX_IDLE is deprecated, use TextureGCSystem.defaultMaxIdle"),ot.defaultMaxIdle=t}},GC_MAX_CHECK_COUNT:{get(){return ot.defaultCheckCountMax},set(t){ne("7.1.0","settings.GC_MAX_CHECK_COUNT is deprecated, use TextureGCSystem.defaultCheckCountMax"),ot.defaultCheckCountMax=t}},PRECISION_VERTEX:{get(){return Tt.defaultVertexPrecision},set(t){ne("7.1.0","settings.PRECISION_VERTEX is deprecated, use Program.defaultVertexPrecision"),Tt.defaultVertexPrecision=t}},PRECISION_FRAGMENT:{get(){return Tt.defaultFragmentPrecision},set(t){ne("7.1.0","settings.PRECISION_FRAGMENT is deprecated, use Program.defaultFragmentPrecision"),Tt.defaultFragmentPrecision=t}}});var _i=(t=>(t[t.INTERACTION=50]="INTERACTION",t[t.HIGH=25]="HIGH",t[t.NORMAL=0]="NORMAL",t[t.LOW=-25]="LOW",t[t.UTILITY=-50]="UTILITY",t))(_i||{});class Ia{constructor(e,r=null,i=0,n=!1){this.next=null,this.previous=null,this._destroyed=!1,this.fn=e,this.context=r,this.priority=i,this.once=n}match(e,r=null){return this.fn===e&&this.context===r}emit(e){this.fn&&(this.context?this.fn.call(this.context,e):this.fn(e));const r=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),r}connect(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this}destroy(e=!1){this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const r=this.next;return this.next=e?null:r,this.previous=null,r}}const Ve=class{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new Ia(null,null,1/0),this.deltaMS=1/Ve.targetFPMS,this.elapsedMS=1/Ve.targetFPMS,this._tick=t=>{this._requestId=null,this.started&&(this.update(t),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(t,e,r=_i.NORMAL){return this._addListener(new Ia(t,e,r))}addOnce(t,e,r=_i.NORMAL){return this._addListener(new Ia(t,e,r,!0))}_addListener(t){let e=this._head.next,r=this._head;if(!e)t.connect(r);else{for(;e;){if(t.priority>e.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}return this._startIfPossible(),this}remove(t,e){let r=this._head.next;for(;r;)r.match(t,e)?r=r.destroy():r=r.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let t=0,e=this._head;for(;e=e.next;)t++;return t}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let t=this._head.next;for(;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}}update(t=performance.now()){let e;if(t>this.lastTime){if(e=this.elapsedMS=t-this.lastTime,e>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){const n=t-this._lastFrame|0;if(n<this._minElapsedMS)return;this._lastFrame=t-n%this._minElapsedMS}this.deltaMS=e,this.deltaTime=this.deltaMS*Ve.targetFPMS;const r=this._head;let i=r.next;for(;i;)i=i.emit(this.deltaTime);r.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(t){const e=Math.min(this.maxFPS,t),r=Math.min(Math.max(0,e)/1e3,Ve.targetFPMS);this._maxElapsedMS=1/r}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(t){if(t===0)this._minElapsedMS=0;else{const e=Math.max(this.minFPS,t);this._minElapsedMS=1/(e/1e3)}}static get shared(){if(!Ve._shared){const t=Ve._shared=new Ve;t.autoStart=!0,t._protected=!0}return Ve._shared}static get system(){if(!Ve._system){const t=Ve._system=new Ve;t.autoStart=!0,t._protected=!0}return Ve._system}};let $e=Ve;$e.targetFPMS=.06,Object.defineProperties(q,{TARGET_FPMS:{get(){return $e.targetFPMS},set(t){ne("7.1.0","settings.TARGET_FPMS is deprecated, use Ticker.targetFPMS"),$e.targetFPMS=t}}});class vh{static init(e){e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,"ticker",{set(r){this._ticker&&this._ticker.remove(this.render,this),this._ticker=r,r&&r.add(this.render,this,_i.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?$e.shared:new $e,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}vh.extension=re.Application,he.add(vh);const cb=[];he.handleByList(re.Renderer,cb);class yh{constructor(e){this.renderer=e}contextChange(e){let r;if(this.renderer.context.webGLVersion===1){const i=e.getParameter(e.FRAMEBUFFER_BINDING);e.bindFramebuffer(e.FRAMEBUFFER,null),r=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.FRAMEBUFFER,i)}else{const i=e.getParameter(e.DRAW_FRAMEBUFFER_BINDING);e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),r=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,i)}r>=Ae.HIGH?this.multisample=Ae.HIGH:r>=Ae.MEDIUM?this.multisample=Ae.MEDIUM:r>=Ae.LOW?this.multisample=Ae.LOW:this.multisample=Ae.NONE}destroy(){}}yh.extension={type:re.RendererSystem,name:"_multisample"},he.add(yh);class fb{constructor(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class xh{constructor(e){this.renderer=e,this.managedBuffers={},this.boundBufferBases={}}destroy(){this.renderer=null}contextChange(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(e){const{gl:r,CONTEXT_UID:i}=this,n=e._glBuffers[i]||this.createGLBuffer(e);r.bindBuffer(e.type,n.buffer)}unbind(e){const{gl:r}=this;r.bindBuffer(e,null)}bindBufferBase(e,r){const{gl:i,CONTEXT_UID:n}=this;if(this.boundBufferBases[r]!==e){const s=e._glBuffers[n]||this.createGLBuffer(e);this.boundBufferBases[r]=e,i.bindBufferBase(i.UNIFORM_BUFFER,r,s.buffer)}}bindBufferRange(e,r,i){const{gl:n,CONTEXT_UID:s}=this;i=i||0;const a=e._glBuffers[s]||this.createGLBuffer(e);n.bindBufferRange(n.UNIFORM_BUFFER,r||0,a.buffer,i*256,256)}update(e){const{gl:r,CONTEXT_UID:i}=this,n=e._glBuffers[i]||this.createGLBuffer(e);if(e._updateID!==n.updateID)if(n.updateID=e._updateID,r.bindBuffer(e.type,n.buffer),n.byteLength>=e.data.byteLength)r.bufferSubData(e.type,0,e.data);else{const s=e.static?r.STATIC_DRAW:r.DYNAMIC_DRAW;n.byteLength=e.data.byteLength,r.bufferData(e.type,e.data,s)}}dispose(e,r){if(!this.managedBuffers[e.id])return;delete this.managedBuffers[e.id];const i=e._glBuffers[this.CONTEXT_UID],n=this.gl;e.disposeRunner.remove(this),i&&(r||n.deleteBuffer(i.buffer),delete e._glBuffers[this.CONTEXT_UID])}disposeAll(e){const r=Object.keys(this.managedBuffers);for(let i=0;i<r.length;i++)this.dispose(this.managedBuffers[r[i]],e)}createGLBuffer(e){const{CONTEXT_UID:r,gl:i}=this;return e._glBuffers[r]=new fb(i.createBuffer()),this.managedBuffers[e.id]=e,e.disposeRunner.add(this),e._glBuffers[r]}}xh.extension={type:re.RendererSystem,name:"buffer"},he.add(xh);class bh{constructor(e){this.renderer=e}render(e,r){const i=this.renderer;let n,s,a,o;if(r&&(n=r.renderTexture,s=r.clear,a=r.transform,o=r.skipUpdateTransform),this.renderingToScreen=!n,i.runners.prerender.emit(),i.emit("prerender"),i.projection.transform=a,!i.context.isLost){if(n||(this.lastObjectRendered=e),!o){const u=e.enableTempParent();e.updateTransform(),e.disableTempParent(u)}i.renderTexture.bind(n),i.batch.currentRenderer.start(),(s??i.background.clearBeforeRender)&&i.renderTexture.clear(),e.render(i),i.batch.currentRenderer.flush(),n&&(r.blit&&i.framebuffer.blit(),n.baseTexture.update()),i.runners.postrender.emit(),i.projection.transform=null,i.emit("postrender")}}destroy(){this.renderer=null,this.lastObjectRendered=null}}bh.extension={type:re.RendererSystem,name:"objectRenderer"},he.add(bh);const Ra=class extends ub{constructor(t){super(),this.type=pl.WEBGL,t=Object.assign({},q.RENDER_OPTIONS,t),this.gl=null,this.CONTEXT_UID=0,this.globalUniforms=new nt({projectionMatrix:new Ue},!0);const e={runners:["init","destroy","contextChange","resolutionChange","reset","update","postrender","prerender","resize"],systems:Ra.__systems,priority:["_view","textureGenerator","background","_plugin","startup","context","state","texture","buffer","geometry","framebuffer","transformFeedback","mask","scissor","stencil","projection","textureGC","filter","renderTexture","batch","objectRenderer","_multisample"]};this.setup(e),"useContextAlpha"in t&&(ne("7.0.0","options.useContextAlpha is deprecated, use options.premultipliedAlpha and options.backgroundAlpha instead"),t.premultipliedAlpha=t.useContextAlpha&&t.useContextAlpha!=="notMultiplied",t.backgroundAlpha=t.useContextAlpha===!1?1:t.backgroundAlpha),this._plugin.rendererPlugins=Ra.__plugins,this.options=t,this.startup.run(this.options)}static test(t){return t!=null&&t.forceCanvas?!1:zx()}render(t,e){this.objectRenderer.render(t,e)}resize(t,e){this._view.resizeView(t,e)}reset(){return this.runners.reset.emit(),this}clear(){this.renderTexture.bind(),this.renderTexture.clear()}destroy(t=!1){this.runners.destroy.items.reverse(),this.emitWithCustomOptions(this.runners.destroy,{_view:t}),super.destroy()}get plugins(){return this._plugin.plugins}get multisample(){return this._multisample.multisample}get width(){return this._view.element.width}get height(){return this._view.element.height}get resolution(){return this._view.resolution}set resolution(t){this._view.resolution=t,this.runners.resolutionChange.emit(t)}get autoDensity(){return this._view.autoDensity}get view(){return this._view.element}get screen(){return this._view.screen}get lastObjectRendered(){return this.objectRenderer.lastObjectRendered}get renderingToScreen(){return this.objectRenderer.renderingToScreen}get rendererLogId(){return`WebGL ${this.context.webGLVersion}`}get clearBeforeRender(){return ne("7.0.0","renderer.clearBeforeRender has been deprecated, please use renderer.background.clearBeforeRender instead."),this.background.clearBeforeRender}get useContextAlpha(){return ne("7.0.0","renderer.useContextAlpha has been deprecated, please use renderer.context.premultipliedAlpha instead."),this.context.useContextAlpha}get preserveDrawingBuffer(){return ne("7.0.0","renderer.preserveDrawingBuffer has been deprecated, we cannot truly know this unless pixi created the context"),this.context.preserveDrawingBuffer}get backgroundColor(){return ne("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color}set backgroundColor(t){ne("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color=t}get backgroundAlpha(){return ne("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha}set backgroundAlpha(t){ne("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha=t}get powerPreference(){return ne("7.0.0","renderer.powerPreference has been deprecated, we can only know this if pixi creates the context"),this.context.powerPreference}generateTexture(t,e){return this.textureGenerator.generateTexture(t,e)}};let Or=Ra;Or.extension={type:re.Renderer,priority:1},Or.__plugins={},Or.__systems={},he.handleByMap(re.RendererPlugin,Or.__plugins),he.handleByMap(re.RendererSystem,Or.__systems),he.add(Or);class Th extends hi{constructor(e,r){const{width:i,height:n}=r||{};super(i,n),this.items=[],this.itemDirtyIds=[];for(let s=0;s<e;s++){const a=new oe;this.items.push(a),this.itemDirtyIds.push(-2)}this.length=e,this._load=null,this.baseTexture=null}initFromArray(e,r){for(let i=0;i<this.length;i++)e[i]&&(e[i].castToBaseTexture?this.addBaseTextureAt(e[i].castToBaseTexture(),i):e[i]instanceof hi?this.addResourceAt(e[i],i):this.addResourceAt(Fu(e[i],r),i))}dispose(){for(let e=0,r=this.length;e<r;e++)this.items[e].destroy();this.items=null,this.itemDirtyIds=null,this._load=null}addResourceAt(e,r){if(!this.items[r])throw new Error(`Index ${r} is out of bounds`);return e.valid&&!this.valid&&this.resize(e.width,e.height),this.items[r].setResource(e),this}bind(e){if(this.baseTexture!==null)throw new Error("Only one base texture per TextureArray is allowed");super.bind(e);for(let r=0;r<this.length;r++)this.items[r].parentTextureArray=e,this.items[r].on("update",e.update,e)}unbind(e){super.unbind(e);for(let r=0;r<this.length;r++)this.items[r].parentTextureArray=null,this.items[r].off("update",e.update,e)}load(){if(this._load)return this._load;const r=this.items.map(i=>i.resource).filter(i=>i).map(i=>i.load());return this._load=Promise.all(r).then(()=>{const{realWidth:i,realHeight:n}=this.items[0];return this.resize(i,n),Promise.resolve(this)}),this._load}}class db extends Th{constructor(e,r){const{width:i,height:n}=r||{};let s,a;Array.isArray(e)?(s=e,a=e.length):a=e,super(a,{width:i,height:n}),s&&this.initFromArray(s,r)}addBaseTextureAt(e,r){if(e.resource)this.addResourceAt(e.resource,r);else throw new Error("ArrayResource does not support RenderTexture");return this}bind(e){super.bind(e),e.target=mr.TEXTURE_2D_ARRAY}upload(e,r,i){const{length:n,itemDirtyIds:s,items:a}=this,{gl:o}=e;i.dirtyId<0&&o.texImage3D(o.TEXTURE_2D_ARRAY,0,i.internalFormat,this._width,this._height,n,0,r.format,i.type,null);for(let u=0;u<n;u++){const c=a[u];s[u]<c.dirtyId&&(s[u]=c.dirtyId,c.valid&&o.texSubImage3D(o.TEXTURE_2D_ARRAY,0,0,0,u,c.resource.width,c.resource.height,1,r.format,i.type,c.resource.source))}return!0}}class pb extends Lt{constructor(e){super(e)}static test(e){const{OffscreenCanvas:r}=globalThis;return r&&e instanceof r?!0:globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement}}const vi=class extends Th{constructor(t,e){const{width:r,height:i,autoLoad:n,linkBaseTexture:s}=e||{};if(t&&t.length!==vi.SIDES)throw new Error(`Invalid length. Got ${t.length}, expected 6`);super(6,{width:r,height:i});for(let a=0;a<vi.SIDES;a++)this.items[a].target=mr.TEXTURE_CUBE_MAP_POSITIVE_X+a;this.linkBaseTexture=s!==!1,t&&this.initFromArray(t,e),n!==!1&&this.load()}bind(t){super.bind(t),t.target=mr.TEXTURE_CUBE_MAP}addBaseTextureAt(t,e,r){if(r===void 0&&(r=this.linkBaseTexture),!this.items[e])throw new Error(`Index ${e} is out of bounds`);if(!this.linkBaseTexture||t.parentTextureArray||Object.keys(t._glTextures).length>0)if(t.resource)this.addResourceAt(t.resource,e);else throw new Error("CubeResource does not support copying of renderTexture.");else t.target=mr.TEXTURE_CUBE_MAP_POSITIVE_X+e,t.parentTextureArray=this.baseTexture,this.items[e]=t;return t.valid&&!this.valid&&this.resize(t.realWidth,t.realHeight),this.items[e]=t,this}upload(t,e,r){const i=this.itemDirtyIds;for(let n=0;n<vi.SIDES;n++){const s=this.items[n];(i[n]<s.dirtyId||r.dirtyId<e.dirtyId)&&(s.valid&&s.resource?(s.resource.upload(t,s,r),i[n]=s.dirtyId):i[n]<-1&&(t.gl.texImage2D(s.target,0,r.internalFormat,e.realWidth,e.realHeight,0,e.format,r.type,null),i[n]=-1))}return!0}static test(t){return Array.isArray(t)&&t.length===vi.SIDES}};let wh=vi;wh.SIDES=6;class Nr extends Lt{constructor(e,r){r=r||{};let i,n;typeof e=="string"?(i=Nr.EMPTY,n=e):(i=e,n=null),super(i),this.url=n,this.crossOrigin=r.crossOrigin??!0,this.alphaMode=typeof r.alphaMode=="number"?r.alphaMode:null,this._load=null,r.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(async(e,r)=>{if(this.url===null){e(this);return}try{const i=await q.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;const n=await i.blob();if(this.destroyed)return;const s=await createImageBitmap(n,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===Mt.UNPACK?"premultiply":"none"});if(this.destroyed)return;this.source=s,this.update(),e(this)}catch(i){if(this.destroyed)return;r(i),this.onError.emit(i)}}),this._load)}upload(e,r,i){return this.source instanceof ImageBitmap?(typeof this.alphaMode=="number"&&(r.alphaMode=this.alphaMode),super.upload(e,r,i)):(this.load(),!1)}dispose(){this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(e){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&(typeof e=="string"||e instanceof ImageBitmap)}static get EMPTY(){return Nr._EMPTY=Nr._EMPTY??q.ADAPTER.createCanvas(0,0),Nr._EMPTY}}const Fn=class extends Lt{constructor(t,e){e=e||{},super(q.ADAPTER.createCanvas()),this._width=0,this._height=0,this.svg=t,this.scale=e.scale||1,this._overrideWidth=e.width,this._overrideHeight=e.height,this._resolve=null,this._crossorigin=e.crossorigin,this._load=null,e.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(t=>{if(this._resolve=()=>{this.resize(this.source.width,this.source.height),t(this)},Fn.SVG_XML.test(this.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");this.svg=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`}this._loadSvg()}),this._load)}_loadSvg(){const t=new Image;Lt.crossOrigin(t,this.svg,this._crossorigin),t.src=this.svg,t.onerror=e=>{this._resolve&&(t.onerror=null,this.onError.emit(e))},t.onload=()=>{if(!this._resolve)return;const e=t.width,r=t.height;if(!e||!r)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let i=e*this.scale,n=r*this.scale;(this._overrideWidth||this._overrideHeight)&&(i=this._overrideWidth||this._overrideHeight/r*e,n=this._overrideHeight||this._overrideWidth/e*r),i=Math.round(i),n=Math.round(n);const s=this.source;s.width=i,s.height=n,s._pixiId=`canvas_${ui()}`,s.getContext("2d").drawImage(t,0,0,e,r,0,0,i,n),this._resolve(),this._resolve=null}}static getSize(t){const e=Fn.SVG_SIZE.exec(t),r={};return e&&(r[e[1]]=Math.round(parseFloat(e[3])),r[e[5]]=Math.round(parseFloat(e[7]))),r}dispose(){super.dispose(),this._resolve=null,this._crossorigin=null}static test(t,e){return e==="svg"||typeof t=="string"&&t.startsWith("data:image/svg+xml")||typeof t=="string"&&Fn.SVG_XML.test(t)}};let Pa=Fn;Pa.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,Pa.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;const Ma=class extends Lt{constructor(t,e){if(e=e||{},!(t instanceof HTMLVideoElement)){const r=document.createElement("video");r.setAttribute("preload","auto"),r.setAttribute("webkit-playsinline",""),r.setAttribute("playsinline",""),typeof t=="string"&&(t=[t]);const i=t[0].src||t[0];Lt.crossOrigin(r,i,e.crossorigin);for(let n=0;n<t.length;++n){const s=document.createElement("source");let{src:a,mime:o}=t[n];a=a||t[n];const u=a.split("?").shift().toLowerCase(),c=u.slice(u.lastIndexOf(".")+1);o=o||Ma.MIME_TYPES[c]||`video/${c}`,s.src=a,s.type=o,r.appendChild(s)}t=r}super(t),this.noSubImage=!0,this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=e.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=e.autoPlay!==!1,this._load=null,this._resolve=null,this._onCanPlay=this._onCanPlay.bind(this),this._onError=this._onError.bind(this),e.autoLoad!==!1&&this.load()}update(t=0){if(!this.destroyed){const e=$e.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-e),(!this._updateFPS||this._msToNextUpdate<=0)&&(super.update(),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}}load(){if(this._load)return this._load;const t=this.source;return(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),t.addEventListener("play",this._onPlayStart.bind(this)),t.addEventListener("pause",this._onPlayStop.bind(this)),this._isSourceReady()?this._onCanPlay():(t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlay),t.addEventListener("error",this._onError,!0)),this._load=new Promise(e=>{this.valid?e(this):(this._resolve=e,t.load())}),this._load}_onError(t){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(t)}_isSourcePlaying(){const t=this.source;return!t.paused&&!t.ended&&this._isSourceReady()}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&($e.shared.add(this.update,this),this._isConnectedToTicker=!0)}_onPlayStop(){this._isConnectedToTicker&&($e.shared.remove(this.update,this),this._isConnectedToTicker=!1)}_onCanPlay(){const t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);const e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()}dispose(){this._isConnectedToTicker&&($e.shared.remove(this.update,this),this._isConnectedToTicker=!1);const t=this.source;t&&(t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),super.dispose()}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?($e.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&($e.shared.add(this.update,this),this._isConnectedToTicker=!0))}get updateFPS(){return this._updateFPS}set updateFPS(t){t!==this._updateFPS&&(this._updateFPS=t)}static test(t,e){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement||Ma.TYPES.includes(e)}};let Fa=Ma;Fa.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],Fa.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},pa.push(Nr,Yu,pb,Fa,Pa,ma,wh,db);var mb=`attribute vec2 aVertexPosition;
|
|
522
522
|
attribute vec2 aTextureCoord;
|
|
523
523
|
|
|
524
524
|
uniform mat3 projectionMatrix;
|
|
@@ -529,7 +529,7 @@ void main(void)
|
|
|
529
529
|
{
|
|
530
530
|
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
|
531
531
|
vTextureCoord = aTextureCoord;
|
|
532
|
-
}`,
|
|
532
|
+
}`,gb=`varying vec2 vTextureCoord;
|
|
533
533
|
uniform sampler2D uSampler;
|
|
534
534
|
|
|
535
535
|
uniform float gamma;
|
|
@@ -560,7 +560,7 @@ void main(void)
|
|
|
560
560
|
|
|
561
561
|
gl_FragColor = c * alpha;
|
|
562
562
|
}
|
|
563
|
-
`;let
|
|
563
|
+
`;let _b=class extends ce{constructor(e){super(mb,gb),this.gamma=1,this.saturation=1,this.contrast=1,this.brightness=1,this.red=1,this.green=1,this.blue=1,this.alpha=1,Object.assign(this,e)}apply(e,r,i,n){this.uniforms.gamma=Math.max(this.gamma,1e-4),this.uniforms.saturation=this.saturation,this.uniforms.contrast=this.contrast,this.uniforms.brightness=this.brightness,this.uniforms.red=this.red,this.uniforms.green=this.green,this.uniforms.blue=this.blue,this.uniforms.alpha=this.alpha,e.applyFilter(this,r,i,n)}};var vb=`attribute vec2 aVertexPosition;
|
|
564
564
|
attribute vec2 aTextureCoord;
|
|
565
565
|
|
|
566
566
|
uniform mat3 projectionMatrix;
|
|
@@ -571,7 +571,7 @@ void main(void)
|
|
|
571
571
|
{
|
|
572
572
|
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
|
573
573
|
vTextureCoord = aTextureCoord;
|
|
574
|
-
}`,
|
|
574
|
+
}`,yb=`
|
|
575
575
|
varying vec2 vTextureCoord;
|
|
576
576
|
uniform sampler2D uSampler;
|
|
577
577
|
|
|
@@ -597,7 +597,7 @@ void main(void)
|
|
|
597
597
|
color *= 0.25;
|
|
598
598
|
|
|
599
599
|
gl_FragColor = color;
|
|
600
|
-
}`,
|
|
600
|
+
}`,xb=`
|
|
601
601
|
varying vec2 vTextureCoord;
|
|
602
602
|
uniform sampler2D uSampler;
|
|
603
603
|
|
|
@@ -625,7 +625,7 @@ void main(void)
|
|
|
625
625
|
|
|
626
626
|
gl_FragColor = color;
|
|
627
627
|
}
|
|
628
|
-
`;let
|
|
628
|
+
`;let yi=class extends ce{constructor(e=4,r=3,i=!1){super(vb,i?xb:yb),this._kernels=[],this._blur=4,this._quality=3,this.uniforms.uOffset=new Float32Array(2),this._pixelSize=new me,this.pixelSize=1,this._clamp=i,Array.isArray(e)?this.kernels=e:(this._blur=e,this.quality=r)}apply(e,r,i,n){const s=this._pixelSize.x/r._frame.width,a=this._pixelSize.y/r._frame.height;let o;if(this._quality===1||this._blur===0)o=this._kernels[0]+.5,this.uniforms.uOffset[0]=o*s,this.uniforms.uOffset[1]=o*a,e.applyFilter(this,r,i,n);else{const u=e.getFilterTexture();let c=r,f=u,l;const h=this._quality-1;for(let d=0;d<h;d++)o=this._kernels[d]+.5,this.uniforms.uOffset[0]=o*s,this.uniforms.uOffset[1]=o*a,e.applyFilter(this,c,f,1),l=c,c=f,f=l;o=this._kernels[h]+.5,this.uniforms.uOffset[0]=o*s,this.uniforms.uOffset[1]=o*a,e.applyFilter(this,c,i,n),e.returnFilterTexture(u)}}_updatePadding(){this.padding=Math.ceil(this._kernels.reduce((e,r)=>e+r+.5,0))}_generateKernels(){const e=this._blur,r=this._quality,i=[e];if(e>0){let n=e;const s=e/r;for(let a=1;a<r;a++)n-=s,i.push(n)}this._kernels=i,this._updatePadding()}get kernels(){return this._kernels}set kernels(e){Array.isArray(e)&&e.length>0?(this._kernels=e,this._quality=e.length,this._blur=Math.max(...e)):(this._kernels=[0],this._quality=1)}get clamp(){return this._clamp}set pixelSize(e){typeof e=="number"?(this._pixelSize.x=e,this._pixelSize.y=e):Array.isArray(e)?(this._pixelSize.x=e[0],this._pixelSize.y=e[1]):e instanceof me?(this._pixelSize.x=e.x,this._pixelSize.y=e.y):(this._pixelSize.x=1,this._pixelSize.y=1)}get pixelSize(){return this._pixelSize}get quality(){return this._quality}set quality(e){this._quality=Math.max(1,Math.round(e)),this._generateKernels()}get blur(){return this._blur}set blur(e){this._blur=e,this._generateKernels()}};var Sh=`attribute vec2 aVertexPosition;
|
|
629
629
|
attribute vec2 aTextureCoord;
|
|
630
630
|
|
|
631
631
|
uniform mat3 projectionMatrix;
|
|
@@ -636,7 +636,7 @@ void main(void)
|
|
|
636
636
|
{
|
|
637
637
|
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
|
638
638
|
vTextureCoord = aTextureCoord;
|
|
639
|
-
}`,
|
|
639
|
+
}`,bb=`
|
|
640
640
|
uniform sampler2D uSampler;
|
|
641
641
|
varying vec2 vTextureCoord;
|
|
642
642
|
|
|
@@ -657,7 +657,7 @@ void main() {
|
|
|
657
657
|
gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
|
|
658
658
|
}
|
|
659
659
|
}
|
|
660
|
-
`;let
|
|
660
|
+
`;let Tb=class extends ce{constructor(e=.5){super(Sh,bb),this.threshold=e}get threshold(){return this.uniforms.threshold}set threshold(e){this.uniforms.threshold=e}};var wb=`uniform sampler2D uSampler;
|
|
661
661
|
varying vec2 vTextureCoord;
|
|
662
662
|
|
|
663
663
|
uniform sampler2D bloomTexture;
|
|
@@ -671,7 +671,7 @@ void main() {
|
|
|
671
671
|
bloomColor.rgb *= bloomScale;
|
|
672
672
|
gl_FragColor = color + bloomColor;
|
|
673
673
|
}
|
|
674
|
-
`;const
|
|
674
|
+
`;const Ah=class extends ce{constructor(e){super(Sh,wb),this.bloomScale=1,this.brightness=1,this._resolution=q.FILTER_RESOLUTION,typeof e=="number"&&(e={threshold:e});const r=Object.assign(Ah.defaults,e);this.bloomScale=r.bloomScale,this.brightness=r.brightness;const{kernels:i,blur:n,quality:s,pixelSize:a,resolution:o}=r;this._extractFilter=new Tb(r.threshold),this._extractFilter.resolution=o,this._blurFilter=i?new yi(i):new yi(n,s),this.pixelSize=a,this.resolution=o}apply(e,r,i,n,s){const a=e.getFilterTexture();this._extractFilter.apply(e,r,a,1,s);const o=e.getFilterTexture();this._blurFilter.apply(e,a,o,1),this.uniforms.bloomScale=this.bloomScale,this.uniforms.brightness=this.brightness,this.uniforms.bloomTexture=o,e.applyFilter(this,r,i,n),e.returnFilterTexture(o),e.returnFilterTexture(a)}get resolution(){return this._resolution}set resolution(e){this._resolution=e,this._extractFilter&&(this._extractFilter.resolution=e),this._blurFilter&&(this._blurFilter.resolution=e)}get threshold(){return this._extractFilter.threshold}set threshold(e){this._extractFilter.threshold=e}get kernels(){return this._blurFilter.kernels}set kernels(e){this._blurFilter.kernels=e}get blur(){return this._blurFilter.blur}set blur(e){this._blurFilter.blur=e}get quality(){return this._blurFilter.quality}set quality(e){this._blurFilter.quality=e}get pixelSize(){return this._blurFilter.pixelSize}set pixelSize(e){this._blurFilter.pixelSize=e}};let Sb=Ah;Sb.defaults={threshold:.5,bloomScale:1,brightness:1,kernels:null,blur:8,quality:4,pixelSize:1,resolution:q.FILTER_RESOLUTION};var Ab=`attribute vec2 aVertexPosition;
|
|
675
675
|
attribute vec2 aTextureCoord;
|
|
676
676
|
|
|
677
677
|
uniform mat3 projectionMatrix;
|
|
@@ -682,7 +682,7 @@ void main(void)
|
|
|
682
682
|
{
|
|
683
683
|
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
|
684
684
|
vTextureCoord = aTextureCoord;
|
|
685
|
-
}`,
|
|
685
|
+
}`,Eb=`uniform float radius;
|
|
686
686
|
uniform float strength;
|
|
687
687
|
uniform vec2 center;
|
|
688
688
|
uniform sampler2D uSampler;
|
|
@@ -715,7 +715,7 @@ void main()
|
|
|
715
715
|
|
|
716
716
|
gl_FragColor = color;
|
|
717
717
|
}
|
|
718
|
-
`;const
|
|
718
|
+
`;const Eh=class extends ce{constructor(e){super(Ab,Eb),this.uniforms.dimensions=new Float32Array(2),Object.assign(this,Eh.defaults,e)}apply(e,r,i,n){const{width:s,height:a}=r.filterFrame;this.uniforms.dimensions[0]=s,this.uniforms.dimensions[1]=a,e.applyFilter(this,r,i,n)}get radius(){return this.uniforms.radius}set radius(e){this.uniforms.radius=e}get strength(){return this.uniforms.strength}set strength(e){this.uniforms.strength=e}get center(){return this.uniforms.center}set center(e){this.uniforms.center=e}};let Cb=Eh;Cb.defaults={center:[.5,.5],radius:100,strength:1};var Ib=`const float PI = 3.1415926538;
|
|
719
719
|
const float PI_2 = PI*2.;
|
|
720
720
|
|
|
721
721
|
varying vec2 vTextureCoord;
|
|
@@ -842,7 +842,7 @@ void main(void) {
|
|
|
842
842
|
// mix resulting color with current color
|
|
843
843
|
gl_FragColor = gradientColor + currentColor*(1.-gradientColor.a);
|
|
844
844
|
}
|
|
845
|
-
`,
|
|
845
|
+
`,Rb=`attribute vec2 aVertexPosition;
|
|
846
846
|
attribute vec2 aTextureCoord;
|
|
847
847
|
|
|
848
848
|
uniform mat3 projectionMatrix;
|
|
@@ -858,7 +858,7 @@ void main(void)
|
|
|
858
858
|
vTextureCoord = aTextureCoord;
|
|
859
859
|
vFilterCoord = vTextureCoord * inputSize.xy / outputFrame.zw;
|
|
860
860
|
}
|
|
861
|
-
`,Vn=Vn||{};Vn.stringify=function(){var t={"visit_linear-gradient":function(e){return t.visit_gradient(e)},"visit_repeating-linear-gradient":function(e){return t.visit_gradient(e)},"visit_radial-gradient":function(e){return t.visit_gradient(e)},"visit_repeating-radial-gradient":function(e){return t.visit_gradient(e)},visit_gradient:function(e){var r=t.visit(e.orientation);return r&&(r+=", "),e.type+"("+r+t.visit(e.colorStops)+")"},visit_shape:function(e){var r=e.value,n=t.visit(e.at),i=t.visit(e.style);return i&&(r+=" "+i),n&&(r+=" at "+n),r},"visit_default-radial":function(e){var r="",n=t.visit(e.at);return n&&(r+=n),r},"visit_extent-keyword":function(e){var r=e.value,n=t.visit(e.at);return n&&(r+=" at "+n),r},"visit_position-keyword":function(e){return e.value},visit_position:function(e){return t.visit(e.value.x)+" "+t.visit(e.value.y)},"visit_%":function(e){return e.value+"%"},visit_em:function(e){return e.value+"em"},visit_px:function(e){return e.value+"px"},visit_literal:function(e){return t.visit_color(e.value,e)},visit_hex:function(e){return t.visit_color("#"+e.value,e)},visit_rgb:function(e){return t.visit_color("rgb("+e.value.join(", ")+")",e)},visit_rgba:function(e){return t.visit_color("rgba("+e.value.join(", ")+")",e)},visit_color:function(e,r){var n=e,i=t.visit(r.length);return i&&(n+=" "+i),n},visit_angular:function(e){return e.value+"deg"},visit_directional:function(e){return"to "+e.value},visit_array:function(e){var r="",n=e.length;return e.forEach(function(i,a){r+=t.visit(i),a<n-1&&(r+=", ")}),r},visit:function(e){if(!e)return"";var r="";if(e instanceof Array)return t.visit_array(e,r);if(e.type){var n=t["visit_"+e.type];if(n)return n(e);throw Error("Missing visitor visit_"+e.type)}else throw Error("Invalid node.")}};return function(e){return t.visit(e)}}();var Vn=Vn||{};Vn.parse=function(){var t={linearGradient:/^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,repeatingLinearGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,radialGradient:/^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,repeatingRadialGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},e="";function r(z){var Q=new Error(e+": "+z);throw Q.source=e,Q}function n(){var z=i();return e.length>0&&r("Invalid input not EOF"),z}function i(){return w(a)}function a(){return u("linear-gradient",t.linearGradient,h)||u("repeating-linear-gradient",t.repeatingLinearGradient,h)||u("radial-gradient",t.radialGradient,c)||u("repeating-radial-gradient",t.repeatingRadialGradient,c)}function u(z,Q,ge){return l(Q,function(W){var q=ge();return q&&(ae(t.comma)||r("Missing comma before color stops")),{type:z,orientation:q,colorStops:w(I)}})}function l(z,Q){var ge=ae(z);if(ge){ae(t.startCall)||r("Missing (");var W=Q(ge);return ae(t.endCall)||r("Missing )"),W}}function h(){return p()||m()}function p(){return G("directional",t.sideOrCorner,1)}function m(){return G("angular",t.angleValue,1)}function c(){var z,Q=d(),ge;return Q&&(z=[],z.push(Q),ge=e,ae(t.comma)&&(Q=d(),Q?z.push(Q):e=ge)),z}function d(){var z=g()||v();if(z)z.at=b();else{var Q=y();if(Q){z=Q;var ge=b();ge&&(z.at=ge)}else{var W=x();W&&(z={type:"default-radial",at:W})}}return z}function g(){var z=G("shape",/^(circle)/i,0);return z&&(z.style=X()||y()),z}function v(){var z=G("shape",/^(ellipse)/i,0);return z&&(z.style=Y()||y()),z}function y(){return G("extent-keyword",t.extentKeywords,1)}function b(){if(G("position",/^at/,0)){var z=x();return z||r("Missing positioning value"),z}}function x(){var z=E();if(z.x||z.y)return{type:"position",value:z}}function E(){return{x:Y(),y:Y()}}function w(z){var Q=z(),ge=[];if(Q)for(ge.push(Q);ae(t.comma);)Q=z(),Q?ge.push(Q):r("One extra comma");return ge}function I(){var z=O();return z||r("Expected color definition"),z.length=Y(),z}function O(){return N()||D()||L()||F()}function F(){return G("literal",t.literalColor,0)}function N(){return G("hex",t.hexColor,1)}function L(){return l(t.rgbColor,function(){return{type:"rgb",value:w(V)}})}function D(){return l(t.rgbaColor,function(){return{type:"rgba",value:w(V)}})}function V(){return ae(t.number)[1]}function Y(){return G("%",t.percentageValue,1)||ie()||X()}function ie(){return G("position-keyword",t.positionKeywords,1)}function X(){return G("px",t.pixelValue,1)||G("em",t.emValue,1)}function G(z,Q,ge){var W=ae(Q);if(W)return{type:z,value:W[ge]}}function ae(z){var Q,ge;return ge=/^[\n\r\t\s]+/.exec(e),ge&&se(ge[0].length),Q=z.exec(e),Q&&se(Q[0].length),Q}function se(z){e=e.substr(z)}return function(z){return e=z.toString(),n()}}();var F2=Vn.parse;Vn.stringify;var ag={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},og={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function N2(t){var e,r=[],n=1,i;if(typeof t=="string")if(ag[t])r=ag[t].slice(),i="rgb";else if(t==="transparent")n=0,i="rgb",r=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var a=t.slice(1),u=a.length,l=u<=4;n=1,l?(r=[parseInt(a[0]+a[0],16),parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16)],u===4&&(n=parseInt(a[3]+a[3],16)/255)):(r=[parseInt(a[0]+a[1],16),parseInt(a[2]+a[3],16),parseInt(a[4]+a[5],16)],u===8&&(n=parseInt(a[6]+a[7],16)/255)),r[0]||(r[0]=0),r[1]||(r[1]=0),r[2]||(r[2]=0),i="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var h=e[1],p=h==="rgb",a=h.replace(/a$/,"");i=a;var u=a==="cmyk"?4:a==="gray"?1:3;r=e[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(d,g){if(/%$/.test(d))return g===u?parseFloat(d)/100:a==="rgb"?parseFloat(d)*255/100:parseFloat(d);if(a[g]==="h"){if(/deg$/.test(d))return parseFloat(d);if(og[d]!==void 0)return og[d]}return parseFloat(d)}),h===a&&r.push(1),n=p||r[u]===void 0?1:r[u],r=r.slice(0,u)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(r=t.match(/([0-9]+)/g).map(function(m){return parseFloat(m)}),i=t.match(/([a-z])/ig).join("").toLowerCase());else isNaN(t)?Array.isArray(t)||t.length?(r=[t[0],t[1],t[2]],i="rgb",n=t.length===4?t[3]:1):t instanceof Object&&(t.r!=null||t.red!=null||t.R!=null?(i="rgb",r=[t.r||t.red||t.R||0,t.g||t.green||t.G||0,t.b||t.blue||t.B||0]):(i="hsl",r=[t.h||t.hue||t.H||0,t.s||t.saturation||t.S||0,t.l||t.lightness||t.L||t.b||t.brightness]),n=t.a||t.alpha||t.opacity||1,t.opacity!=null&&(n/=100)):(i="rgb",r=[t>>>16,(t&65280)>>>8,t&255]);return{space:i,values:r,alpha:n}}var Xl={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]},jl={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e=t[0]/360,r=t[1]/100,n=t[2]/100,i,a,u,l,h;if(r===0)return h=n*255,[h,h,h];n<.5?a=n*(1+r):a=n+r-n*r,i=2*n-a,l=[0,0,0];for(var p=0;p<3;p++)u=e+1/3*-(p-1),u<0?u++:u>1&&u--,6*u<1?h=i+(a-i)*6*u:2*u<1?h=a:3*u<2?h=i+(a-i)*(2/3-u)*6:h=i,l[p]=h*255;return l}};Xl.hsl=function(t){var e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(e,r,n),a=Math.max(e,r,n),u=a-i,l,h,p;return a===i?l=0:e===a?l=(r-n)/u:r===a?l=2+(n-e)/u:n===a&&(l=4+(e-r)/u),l=Math.min(l*60,360),l<0&&(l+=360),p=(i+a)/2,a===i?h=0:p<=.5?h=u/(a+i):h=u/(2-a-i),[l,h*100,p*100]};function L2(t){Array.isArray(t)&&t.raw&&(t=String.raw(...arguments));var e,r=N2(t);if(!r.space)return[];const n=r.space[0]==="h"?jl.min:Xl.min,i=r.space[0]==="h"?jl.max:Xl.max;return e=Array(3),e[0]=Math.min(Math.max(r.values[0],n[0]),i[0]),e[1]=Math.min(Math.max(r.values[1],n[1]),i[1]),e[2]=Math.min(Math.max(r.values[2],n[2]),i[2]),r.space[0]==="h"&&(e=jl.rgb(e)),e.push(Math.min(Math.max(r.alpha,0),1)),e}function ug(t){switch(typeof t){case"string":return k2(t);case"number":return Oa(t);default:return t}}function k2(t){const e=L2(t);if(!e)throw new Error(`Unable to parse color "${t}" as RGBA.`);return[e[0]/255,e[1]/255,e[2]/255,e[3]]}function D2(t){const e=F2(j2(t));if(e.length===0)throw new Error("Invalid CSS gradient.");if(e.length!==1)throw new Error("Unsupported CSS gradient (multiple gradients is not supported).");const r=e[0],n=B2(r.type),i=U2(r.colorStops),a=V2(r.orientation);return{type:n,stops:i,angle:a}}function B2(t){const e={"linear-gradient":0,"radial-gradient":1};if(!(t in e))throw new Error(`Unsupported gradient type "${t}"`);return e[t]}function U2(t){const e=z2(t),r=[];for(let n=0;n<t.length;n++){const i=$2(t[n]);r.push({offset:e[n],color:i.slice(0,3),alpha:i[3]})}return r}function $2(t){return ug(G2(t))}function G2(t){switch(t.type){case"hex":return`#${t.value}`;case"literal":return t.value;default:return`${t.type}(${t.value.join(",")})`}}function z2(t){const e=[];for(let i=0;i<t.length;i++){const a=t[i];let u=-1;a.type==="literal"&&a.length&&"type"in a.length&&a.length.type==="%"&&"value"in a.length&&(u=parseFloat(a.length.value)/100),e.push(u)}const r=i=>{for(let a=i;a<e.length;a++)if(e[a]!==-1)return{indexDelta:a-i,offset:e[a]};return{indexDelta:e.length-1-i,offset:1}};let n=0;for(let i=0;i<e.length;i++){const a=e[i];if(a!==-1)n=a;else if(i===0)e[i]=0;else if(i+1===e.length)e[i]=1;else{const u=r(i),l=(u.offset-n)/(1+u.indexDelta);for(let h=0;h<=u.indexDelta;h++)e[i+h]=n+(h+1)*l;i+=u.indexDelta,n=e[i]}}return e.map(H2)}function H2(t){return t.toString().length>6?parseFloat(t.toString().substring(0,6)):t}function V2(t){if(typeof t>"u")return 0;if("type"in t&&"value"in t)switch(t.type){case"angular":return parseFloat(t.value);case"directional":return X2(t.value)}return 0}function X2(t){const e={left:270,top:0,bottom:180,right:90,"left top":315,"top left":315,"left bottom":225,"bottom left":225,"right top":45,"top right":45,"right bottom":135,"bottom right":135};if(!(t in e))throw new Error(`Unsupported directional value "${t}"`);return e[t]}function j2(t){let e=t.replace(/\s{2,}/gu," ");return e=e.replace(/;/g,""),e=e.replace(/ ,/g,","),e=e.replace(/\( /g,"("),e=e.replace(/ \)/g,")"),e.trim()}var W2=Object.defineProperty,q2=Object.defineProperties,Y2=Object.getOwnPropertyDescriptors,lg=Object.getOwnPropertySymbols,K2=Object.prototype.hasOwnProperty,Z2=Object.prototype.propertyIsEnumerable,cg=(t,e,r)=>e in t?W2(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Wl=(t,e)=>{for(var r in e||(e={}))K2.call(e,r)&&cg(t,r,e[r]);if(lg)for(var r of lg(e))Z2.call(e,r)&&cg(t,r,e[r]);return t},Q2=(t,e)=>q2(t,Y2(e));const hg=90;function J2(t){return[...t].sort((e,r)=>e.offset-r.offset)}const ql=class extends je{constructor(e){e&&"css"in e&&(e=Q2(Wl({},D2(e.css||"")),{alpha:e.alpha,maxColors:e.maxColors}));const r=Wl(Wl({},ql.defaults),e);if(!r.stops||r.stops.length<2)throw new Error("ColorGradientFilter requires at least 2 color stops.");super(O2,M2),this._stops=[],this.autoFit=!1,Object.assign(this,r)}get stops(){return this._stops}set stops(e){const r=J2(e),n=new Float32Array(r.length*3),i=0,a=1,u=2;for(let l=0;l<r.length;l++){const h=ug(r[l].color),p=l*3;n[p+i]=h[i],n[p+a]=h[a],n[p+u]=h[u]}this.uniforms.uColors=n,this.uniforms.uOffsets=r.map(l=>l.offset),this.uniforms.uAlphas=r.map(l=>l.alpha),this.uniforms.uNumStops=r.length,this._stops=r}set type(e){this.uniforms.uType=e}get type(){return this.uniforms.uType}set angle(e){this.uniforms.uAngle=e-hg}get angle(){return this.uniforms.uAngle+hg}set alpha(e){this.uniforms.uAlpha=e}get alpha(){return this.uniforms.uAlpha}set maxColors(e){this.uniforms.uMaxColors=e}get maxColors(){return this.uniforms.uMaxColors}};let ro=ql;ro.LINEAR=0,ro.RADIAL=1,ro.CONIC=2,ro.defaults={type:ql.LINEAR,stops:[{offset:0,color:16711680,alpha:1},{offset:1,color:255,alpha:1}],alpha:1,angle:90,maxColors:0};var eI=`attribute vec2 aVertexPosition;
|
|
861
|
+
`,rr=rr||{};rr.stringify=function(){var t={"visit_linear-gradient":function(e){return t.visit_gradient(e)},"visit_repeating-linear-gradient":function(e){return t.visit_gradient(e)},"visit_radial-gradient":function(e){return t.visit_gradient(e)},"visit_repeating-radial-gradient":function(e){return t.visit_gradient(e)},visit_gradient:function(e){var r=t.visit(e.orientation);return r&&(r+=", "),e.type+"("+r+t.visit(e.colorStops)+")"},visit_shape:function(e){var r=e.value,i=t.visit(e.at),n=t.visit(e.style);return n&&(r+=" "+n),i&&(r+=" at "+i),r},"visit_default-radial":function(e){var r="",i=t.visit(e.at);return i&&(r+=i),r},"visit_extent-keyword":function(e){var r=e.value,i=t.visit(e.at);return i&&(r+=" at "+i),r},"visit_position-keyword":function(e){return e.value},visit_position:function(e){return t.visit(e.value.x)+" "+t.visit(e.value.y)},"visit_%":function(e){return e.value+"%"},visit_em:function(e){return e.value+"em"},visit_px:function(e){return e.value+"px"},visit_literal:function(e){return t.visit_color(e.value,e)},visit_hex:function(e){return t.visit_color("#"+e.value,e)},visit_rgb:function(e){return t.visit_color("rgb("+e.value.join(", ")+")",e)},visit_rgba:function(e){return t.visit_color("rgba("+e.value.join(", ")+")",e)},visit_color:function(e,r){var i=e,n=t.visit(r.length);return n&&(i+=" "+n),i},visit_angular:function(e){return e.value+"deg"},visit_directional:function(e){return"to "+e.value},visit_array:function(e){var r="",i=e.length;return e.forEach(function(n,s){r+=t.visit(n),s<i-1&&(r+=", ")}),r},visit:function(e){if(!e)return"";var r="";if(e instanceof Array)return t.visit_array(e,r);if(e.type){var i=t["visit_"+e.type];if(i)return i(e);throw Error("Missing visitor visit_"+e.type)}else throw Error("Invalid node.")}};return function(e){return t.visit(e)}}();var rr=rr||{};rr.parse=function(){var t={linearGradient:/^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,repeatingLinearGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,radialGradient:/^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,repeatingRadialGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},e="";function r(I){var $=new Error(e+": "+I);throw $.source=e,$}function i(){var I=n();return e.length>0&&r("Invalid input not EOF"),I}function n(){return v(s)}function s(){return a("linear-gradient",t.linearGradient,u)||a("repeating-linear-gradient",t.repeatingLinearGradient,u)||a("radial-gradient",t.radialGradient,l)||a("repeating-radial-gradient",t.repeatingRadialGradient,l)}function a(I,$,X){return o($,function(M){var O=X();return O&&(B(t.comma)||r("Missing comma before color stops")),{type:I,orientation:O,colorStops:v(x)}})}function o(I,$){var X=B(I);if(X){B(t.startCall)||r("Missing (");var M=$(X);return B(t.endCall)||r("Missing )"),M}}function u(){return c()||f()}function c(){return E("directional",t.sideOrCorner,1)}function f(){return E("angular",t.angleValue,1)}function l(){var I,$=h(),X;return $&&(I=[],I.push($),X=e,B(t.comma)&&($=h(),$?I.push($):e=X)),I}function h(){var I=d()||p();if(I)I.at=_();else{var $=m();if($){I=$;var X=_();X&&(I.at=X)}else{var M=g();M&&(I={type:"default-radial",at:M})}}return I}function d(){var I=E("shape",/^(circle)/i,0);return I&&(I.style=R()||m()),I}function p(){var I=E("shape",/^(ellipse)/i,0);return I&&(I.style=F()||m()),I}function m(){return E("extent-keyword",t.extentKeywords,1)}function _(){if(E("position",/^at/,0)){var I=g();return I||r("Missing positioning value"),I}}function g(){var I=y();if(I.x||I.y)return{type:"position",value:I}}function y(){return{x:F(),y:F()}}function v(I){var $=I(),X=[];if($)for(X.push($);B(t.comma);)$=I(),$?X.push($):r("One extra comma");return X}function x(){var I=T();return I||r("Expected color definition"),I.length=F(),I}function T(){return w()||A()||S()||b()}function b(){return E("literal",t.literalColor,0)}function w(){return E("hex",t.hexColor,1)}function S(){return o(t.rgbColor,function(){return{type:"rgb",value:v(C)}})}function A(){return o(t.rgbaColor,function(){return{type:"rgba",value:v(C)}})}function C(){return B(t.number)[1]}function F(){return E("%",t.percentageValue,1)||G()||R()}function G(){return E("position-keyword",t.positionKeywords,1)}function R(){return E("px",t.pixelValue,1)||E("em",t.emValue,1)}function E(I,$,X){var M=B($);if(M)return{type:I,value:M[X]}}function B(I){var $,X;return X=/^[\n\r\t\s]+/.exec(e),X&&U(X[0].length),$=I.exec(e),$&&U($[0].length),$}function U(I){e=e.substr(I)}return function(I){return e=I.toString(),i()}}();var Pb=rr.parse;rr.stringify;var Ch={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Ih={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function Mb(t){var e,r=[],i=1,n;if(typeof t=="string")if(Ch[t])r=Ch[t].slice(),n="rgb";else if(t==="transparent")i=0,n="rgb",r=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var s=t.slice(1),a=s.length,o=a<=4;i=1,o?(r=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],a===4&&(i=parseInt(s[3]+s[3],16)/255)):(r=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],a===8&&(i=parseInt(s[6]+s[7],16)/255)),r[0]||(r[0]=0),r[1]||(r[1]=0),r[2]||(r[2]=0),n="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var u=e[1],c=u==="rgb",s=u.replace(/a$/,"");n=s;var a=s==="cmyk"?4:s==="gray"?1:3;r=e[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(h,d){if(/%$/.test(h))return d===a?parseFloat(h)/100:s==="rgb"?parseFloat(h)*255/100:parseFloat(h);if(s[d]==="h"){if(/deg$/.test(h))return parseFloat(h);if(Ih[h]!==void 0)return Ih[h]}return parseFloat(h)}),u===s&&r.push(1),i=c||r[a]===void 0?1:r[a],r=r.slice(0,a)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(r=t.match(/([0-9]+)/g).map(function(f){return parseFloat(f)}),n=t.match(/([a-z])/ig).join("").toLowerCase());else isNaN(t)?Array.isArray(t)||t.length?(r=[t[0],t[1],t[2]],n="rgb",i=t.length===4?t[3]:1):t instanceof Object&&(t.r!=null||t.red!=null||t.R!=null?(n="rgb",r=[t.r||t.red||t.R||0,t.g||t.green||t.G||0,t.b||t.blue||t.B||0]):(n="hsl",r=[t.h||t.hue||t.H||0,t.s||t.saturation||t.S||0,t.l||t.lightness||t.L||t.b||t.brightness]),i=t.a||t.alpha||t.opacity||1,t.opacity!=null&&(i/=100)):(n="rgb",r=[t>>>16,(t&65280)>>>8,t&255]);return{space:n,values:r,alpha:i}}var Oa={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]},Na={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e=t[0]/360,r=t[1]/100,i=t[2]/100,n,s,a,o,u;if(r===0)return u=i*255,[u,u,u];i<.5?s=i*(1+r):s=i+r-i*r,n=2*i-s,o=[0,0,0];for(var c=0;c<3;c++)a=e+1/3*-(c-1),a<0?a++:a>1&&a--,6*a<1?u=n+(s-n)*6*a:2*a<1?u=s:3*a<2?u=n+(s-n)*(2/3-a)*6:u=n,o[c]=u*255;return o}};Oa.hsl=function(t){var e=t[0]/255,r=t[1]/255,i=t[2]/255,n=Math.min(e,r,i),s=Math.max(e,r,i),a=s-n,o,u,c;return s===n?o=0:e===s?o=(r-i)/a:r===s?o=2+(i-e)/a:i===s&&(o=4+(e-r)/a),o=Math.min(o*60,360),o<0&&(o+=360),c=(n+s)/2,s===n?u=0:c<=.5?u=a/(s+n):u=a/(2-s-n),[o,u*100,c*100]};function Fb(t){Array.isArray(t)&&t.raw&&(t=String.raw(...arguments));var e,r=Mb(t);if(!r.space)return[];const i=r.space[0]==="h"?Na.min:Oa.min,n=r.space[0]==="h"?Na.max:Oa.max;return e=Array(3),e[0]=Math.min(Math.max(r.values[0],i[0]),n[0]),e[1]=Math.min(Math.max(r.values[1],i[1]),n[1]),e[2]=Math.min(Math.max(r.values[2],i[2]),n[2]),r.space[0]==="h"&&(e=Na.rgb(e)),e.push(Math.min(Math.max(r.alpha,0),1)),e}function Rh(t){switch(typeof t){case"string":return Ob(t);case"number":return un(t);default:return t}}function Ob(t){const e=Fb(t);if(!e)throw new Error(`Unable to parse color "${t}" as RGBA.`);return[e[0]/255,e[1]/255,e[2]/255,e[3]]}function Nb(t){const e=Pb(jb(t));if(e.length===0)throw new Error("Invalid CSS gradient.");if(e.length!==1)throw new Error("Unsupported CSS gradient (multiple gradients is not supported).");const r=e[0],i=kb(r.type),n=Db(r.colorStops),s=Gb(r.orientation);return{type:i,stops:n,angle:s}}function kb(t){const e={"linear-gradient":0,"radial-gradient":1};if(!(t in e))throw new Error(`Unsupported gradient type "${t}"`);return e[t]}function Db(t){const e=Ub(t),r=[];for(let i=0;i<t.length;i++){const n=Lb(t[i]);r.push({offset:e[i],color:n.slice(0,3),alpha:n[3]})}return r}function Lb(t){return Rh(Bb(t))}function Bb(t){switch(t.type){case"hex":return`#${t.value}`;case"literal":return t.value;default:return`${t.type}(${t.value.join(",")})`}}function Ub(t){const e=[];for(let n=0;n<t.length;n++){const s=t[n];let a=-1;s.type==="literal"&&s.length&&"type"in s.length&&s.length.type==="%"&&"value"in s.length&&(a=parseFloat(s.length.value)/100),e.push(a)}const r=n=>{for(let s=n;s<e.length;s++)if(e[s]!==-1)return{indexDelta:s-n,offset:e[s]};return{indexDelta:e.length-1-n,offset:1}};let i=0;for(let n=0;n<e.length;n++){const s=e[n];if(s!==-1)i=s;else if(n===0)e[n]=0;else if(n+1===e.length)e[n]=1;else{const a=r(n),o=(a.offset-i)/(1+a.indexDelta);for(let u=0;u<=a.indexDelta;u++)e[n+u]=i+(u+1)*o;n+=a.indexDelta,i=e[n]}}return e.map($b)}function $b(t){return t.toString().length>6?parseFloat(t.toString().substring(0,6)):t}function Gb(t){if(typeof t>"u")return 0;if("type"in t&&"value"in t)switch(t.type){case"angular":return parseFloat(t.value);case"directional":return zb(t.value)}return 0}function zb(t){const e={left:270,top:0,bottom:180,right:90,"left top":315,"top left":315,"left bottom":225,"bottom left":225,"right top":45,"top right":45,"right bottom":135,"bottom right":135};if(!(t in e))throw new Error(`Unsupported directional value "${t}"`);return e[t]}function jb(t){let e=t.replace(/\s{2,}/gu," ");return e=e.replace(/;/g,""),e=e.replace(/ ,/g,","),e=e.replace(/\( /g,"("),e=e.replace(/ \)/g,")"),e.trim()}var Hb=Object.defineProperty,Vb=Object.defineProperties,Xb=Object.getOwnPropertyDescriptors,Ph=Object.getOwnPropertySymbols,Wb=Object.prototype.hasOwnProperty,qb=Object.prototype.propertyIsEnumerable,Mh=(t,e,r)=>e in t?Hb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ka=(t,e)=>{for(var r in e||(e={}))Wb.call(e,r)&&Mh(t,r,e[r]);if(Ph)for(var r of Ph(e))qb.call(e,r)&&Mh(t,r,e[r]);return t},Yb=(t,e)=>Vb(t,Xb(e));const Fh=90;function Kb(t){return[...t].sort((e,r)=>e.offset-r.offset)}const Da=class extends ce{constructor(e){e&&"css"in e&&(e=Yb(ka({},Nb(e.css||"")),{alpha:e.alpha,maxColors:e.maxColors}));const r=ka(ka({},Da.defaults),e);if(!r.stops||r.stops.length<2)throw new Error("ColorGradientFilter requires at least 2 color stops.");super(Rb,Ib),this._stops=[],this.autoFit=!1,Object.assign(this,r)}get stops(){return this._stops}set stops(e){const r=Kb(e),i=new Float32Array(r.length*3),n=0,s=1,a=2;for(let o=0;o<r.length;o++){const u=Rh(r[o].color),c=o*3;i[c+n]=u[n],i[c+s]=u[s],i[c+a]=u[a]}this.uniforms.uColors=i,this.uniforms.uOffsets=r.map(o=>o.offset),this.uniforms.uAlphas=r.map(o=>o.alpha),this.uniforms.uNumStops=r.length,this._stops=r}set type(e){this.uniforms.uType=e}get type(){return this.uniforms.uType}set angle(e){this.uniforms.uAngle=e-Fh}get angle(){return this.uniforms.uAngle+Fh}set alpha(e){this.uniforms.uAlpha=e}get alpha(){return this.uniforms.uAlpha}set maxColors(e){this.uniforms.uMaxColors=e}get maxColors(){return this.uniforms.uMaxColors}};let On=Da;On.LINEAR=0,On.RADIAL=1,On.CONIC=2,On.defaults={type:Da.LINEAR,stops:[{offset:0,color:16711680,alpha:1},{offset:1,color:255,alpha:1}],alpha:1,angle:90,maxColors:0};var Zb=`attribute vec2 aVertexPosition;
|
|
862
862
|
attribute vec2 aTextureCoord;
|
|
863
863
|
|
|
864
864
|
uniform mat3 projectionMatrix;
|
|
@@ -869,7 +869,7 @@ void main(void)
|
|
|
869
869
|
{
|
|
870
870
|
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
|
871
871
|
vTextureCoord = aTextureCoord;
|
|
872
|
-
}`,
|
|
872
|
+
}`,Qb=`precision mediump float;
|
|
873
873
|
|
|
874
874
|
varying mediump vec2 vTextureCoord;
|
|
875
875
|
|
|
@@ -898,7 +898,7 @@ void main(void)
|
|
|
898
898
|
|
|
899
899
|
gl_FragColor.a = c22.a;
|
|
900
900
|
}
|
|
901
|
-
`;let
|
|
901
|
+
`;let Jb=class extends ce{constructor(e,r=200,i=200){super(Zb,Qb),this.uniforms.texelSize=new Float32Array(2),this.uniforms.matrix=new Float32Array(9),e!==void 0&&(this.matrix=e),this.width=r,this.height=i}get matrix(){return this.uniforms.matrix}set matrix(e){e.forEach((r,i)=>{this.uniforms.matrix[i]=r})}get width(){return 1/this.uniforms.texelSize[0]}set width(e){this.uniforms.texelSize[0]=1/e}get height(){return 1/this.uniforms.texelSize[1]}set height(e){this.uniforms.texelSize[1]=1/e}};var eT=`attribute vec2 aVertexPosition;
|
|
902
902
|
attribute vec2 aTextureCoord;
|
|
903
903
|
|
|
904
904
|
uniform mat3 projectionMatrix;
|
|
@@ -909,7 +909,7 @@ void main(void)
|
|
|
909
909
|
{
|
|
910
910
|
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
|
911
911
|
vTextureCoord = aTextureCoord;
|
|
912
|
-
}`,
|
|
912
|
+
}`,tT=`varying vec2 vTextureCoord;
|
|
913
913
|
uniform sampler2D uSampler;
|
|
914
914
|
|
|
915
915
|
uniform vec4 filterArea;
|
|
@@ -975,7 +975,7 @@ void main(void)
|
|
|
975
975
|
|
|
976
976
|
gl_FragColor.rgb = rgb;
|
|
977
977
|
}
|
|
978
|
-
`;const
|
|
978
|
+
`;const Oh=class extends ce{constructor(e){super(eT,tT),this.time=0,this.seed=0,this.uniforms.dimensions=new Float32Array(2),Object.assign(this,Oh.defaults,e)}apply(e,r,i,n){const{width:s,height:a}=r.filterFrame;this.uniforms.dimensions[0]=s,this.uniforms.dimensions[1]=a,this.uniforms.seed=this.seed,this.uniforms.time=this.time,e.applyFilter(this,r,i,n)}set curvature(e){this.uniforms.curvature=e}get curvature(){return this.uniforms.curvature}set lineWidth(e){this.uniforms.lineWidth=e}get lineWidth(){return this.uniforms.lineWidth}set lineContrast(e){this.uniforms.lineContrast=e}get lineContrast(){return this.uniforms.lineContrast}set verticalLine(e){this.uniforms.verticalLine=e}get verticalLine(){return this.uniforms.verticalLine}set noise(e){this.uniforms.noise=e}get noise(){return this.uniforms.noise}set noiseSize(e){this.uniforms.noiseSize=e}get noiseSize(){return this.uniforms.noiseSize}set vignetting(e){this.uniforms.vignetting=e}get vignetting(){return this.uniforms.vignetting}set vignettingAlpha(e){this.uniforms.vignettingAlpha=e}get vignettingAlpha(){return this.uniforms.vignettingAlpha}set vignettingBlur(e){this.uniforms.vignettingBlur=e}get vignettingBlur(){return this.uniforms.vignettingBlur}};let rT=Oh;rT.defaults={curvature:1,lineWidth:1,lineContrast:.25,verticalLine:!1,noise:0,noiseSize:1,seed:0,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3,time:0};var iT=`attribute vec2 aVertexPosition;
|
|
979
979
|
attribute vec2 aTextureCoord;
|
|
980
980
|
|
|
981
981
|
uniform mat3 projectionMatrix;
|
|
@@ -986,7 +986,7 @@ void main(void)
|
|
|
986
986
|
{
|
|
987
987
|
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
|
988
988
|
vTextureCoord = aTextureCoord;
|
|
989
|
-
}`,
|
|
989
|
+
}`,nT=`varying vec2 vTextureCoord;
|
|
990
990
|
uniform sampler2D uSampler;
|
|
991
991
|
uniform float alpha;
|
|
992
992
|
uniform vec3 color;
|
|
@@ -1004,7 +1004,7 @@ void main(void){
|
|
|
1004
1004
|
sample *= alpha;
|
|
1005
1005
|
|
|
1006
1006
|
gl_FragColor = sample;
|
|
1007
|
-
}`,
|
|
1007
|
+
}`,sT=Object.defineProperty,Nh=Object.getOwnPropertySymbols,aT=Object.prototype.hasOwnProperty,oT=Object.prototype.propertyIsEnumerable,kh=(t,e,r)=>e in t?sT(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Dh=(t,e)=>{for(var r in e||(e={}))aT.call(e,r)&&kh(t,r,e[r]);if(Nh)for(var r of Nh(e))oT.call(e,r)&&kh(t,r,e[r]);return t};const La=class extends ce{constructor(e){super(),this.angle=45,this._distance=5,this._resolution=q.FILTER_RESOLUTION;const r=e?Dh(Dh({},La.defaults),e):La.defaults,{kernels:i,blur:n,quality:s,pixelSize:a,resolution:o}=r;this._offset=new Dt(this._updatePadding,this),this._tintFilter=new ce(iT,nT),this._tintFilter.uniforms.color=new Float32Array(4),this._tintFilter.uniforms.shift=this._offset,this._tintFilter.resolution=o,this._blurFilter=i?new yi(i):new yi(n,s),this.pixelSize=a,this.resolution=o;const{shadowOnly:u,rotation:c,distance:f,offset:l,alpha:h,color:d}=r;this.shadowOnly=u,c!==void 0&&f!==void 0?(this.rotation=c,this.distance=f):this.offset=l,this.alpha=h,this.color=d}apply(e,r,i,n){const s=e.getFilterTexture();this._tintFilter.apply(e,r,s,1),this._blurFilter.apply(e,s,i,n),this.shadowOnly!==!0&&e.applyFilter(this,r,i,0),e.returnFilterTexture(s)}_updatePadding(){const e=Math.max(Math.abs(this._offset.x),Math.abs(this._offset.y));this.padding=e+this.blur*2}_updateShift(){this._tintFilter.uniforms.shift.set(this.distance*Math.cos(this.angle),this.distance*Math.sin(this.angle))}set offset(e){this._offset.copyFrom(e),this._updatePadding()}get offset(){return this._offset}get resolution(){return this._resolution}set resolution(e){this._resolution=e,this._tintFilter&&(this._tintFilter.resolution=e),this._blurFilter&&(this._blurFilter.resolution=e)}get distance(){return this._distance}set distance(e){ne("5.3.0","DropShadowFilter distance is deprecated, use offset"),this._distance=e,this._updatePadding(),this._updateShift()}get rotation(){return this.angle/ci}set rotation(e){ne("5.3.0","DropShadowFilter rotation is deprecated, use offset"),this.angle=e*ci,this._updateShift()}get alpha(){return this._tintFilter.uniforms.alpha}set alpha(e){this._tintFilter.uniforms.alpha=e}get color(){return aa(this._tintFilter.uniforms.color)}set color(e){un(e,this._tintFilter.uniforms.color)}get kernels(){return this._blurFilter.kernels}set kernels(e){this._blurFilter.kernels=e}get blur(){return this._blurFilter.blur}set blur(e){this._blurFilter.blur=e,this._updatePadding()}get quality(){return this._blurFilter.quality}set quality(e){this._blurFilter.quality=e}get pixelSize(){return this._blurFilter.pixelSize}set pixelSize(e){this._blurFilter.pixelSize=e}};let lT=La;lT.defaults={offset:{x:4,y:4},color:0,alpha:.5,shadowOnly:!1,kernels:null,blur:2,quality:3,pixelSize:1,resolution:q.FILTER_RESOLUTION};var uT=`attribute vec2 aVertexPosition;
|
|
1008
1008
|
attribute vec2 aTextureCoord;
|
|
1009
1009
|
|
|
1010
1010
|
uniform mat3 projectionMatrix;
|
|
@@ -1015,7 +1015,7 @@ void main(void)
|
|
|
1015
1015
|
{
|
|
1016
1016
|
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
|
1017
1017
|
vTextureCoord = aTextureCoord;
|
|
1018
|
-
}`,
|
|
1018
|
+
}`,hT=`// precision highp float;
|
|
1019
1019
|
|
|
1020
1020
|
varying vec2 vTextureCoord;
|
|
1021
1021
|
uniform sampler2D uSampler;
|
|
@@ -1111,7 +1111,7 @@ void main(void)
|
|
|
1111
1111
|
gl_FragColor.b = texture2D(uSampler, coord + blue * (1.0 - seed * 0.2) / filterArea.xy).b;
|
|
1112
1112
|
gl_FragColor.a = texture2D(uSampler, coord).a;
|
|
1113
1113
|
}
|
|
1114
|
-
`;const
|
|
1114
|
+
`;const Ba=class extends ce{constructor(e){super(uT,hT),this.offset=100,this.fillMode=Ba.TRANSPARENT,this.average=!1,this.seed=0,this.minSize=8,this.sampleSize=512,this._slices=0,this._offsets=new Float32Array(1),this._sizes=new Float32Array(1),this._direction=-1,this.uniforms.dimensions=new Float32Array(2),this._canvas=document.createElement("canvas"),this._canvas.width=4,this._canvas.height=this.sampleSize,this.texture=K.from(this._canvas,{scaleMode:et.NEAREST}),Object.assign(this,Ba.defaults,e)}apply(e,r,i,n){const{width:s,height:a}=r.filterFrame;this.uniforms.dimensions[0]=s,this.uniforms.dimensions[1]=a,this.uniforms.aspect=a/s,this.uniforms.seed=this.seed,this.uniforms.offset=this.offset,this.uniforms.fillMode=this.fillMode,e.applyFilter(this,r,i,n)}_randomizeSizes(){const e=this._sizes,r=this._slices-1,i=this.sampleSize,n=Math.min(this.minSize/i,.9/this._slices);if(this.average){const s=this._slices;let a=1;for(let o=0;o<r;o++){const u=a/(s-o),c=Math.max(u*(1-Math.random()*.6),n);e[o]=c,a-=c}e[r]=a}else{let s=1;const a=Math.sqrt(1/this._slices);for(let o=0;o<r;o++){const u=Math.max(a*s*Math.random(),n);e[o]=u,s-=u}e[r]=s}this.shuffle()}shuffle(){const e=this._sizes,r=this._slices-1;for(let i=r;i>0;i--){const n=Math.random()*i>>0,s=e[i];e[i]=e[n],e[n]=s}}_randomizeOffsets(){for(let e=0;e<this._slices;e++)this._offsets[e]=Math.random()*(Math.random()<.5?-1:1)}refresh(){this._randomizeSizes(),this._randomizeOffsets(),this.redraw()}redraw(){const e=this.sampleSize,r=this.texture,i=this._canvas.getContext("2d");i.clearRect(0,0,8,e);let n,s=0;for(let a=0;a<this._slices;a++){n=Math.floor(this._offsets[a]*256);const o=this._sizes[a]*e,u=n>0?n:0,c=n<0?-n:0;i.fillStyle=`rgba(${u}, ${c}, 0, 1)`,i.fillRect(0,s>>0,e,o+1>>0),s+=o}r.baseTexture.update(),this.uniforms.displacementMap=r}set sizes(e){const r=Math.min(this._slices,e.length);for(let i=0;i<r;i++)this._sizes[i]=e[i]}get sizes(){return this._sizes}set offsets(e){const r=Math.min(this._slices,e.length);for(let i=0;i<r;i++)this._offsets[i]=e[i]}get offsets(){return this._offsets}get slices(){return this._slices}set slices(e){this._slices!==e&&(this._slices=e,this.uniforms.slices=e,this._sizes=this.uniforms.slicesWidth=new Float32Array(e),this._offsets=this.uniforms.slicesOffset=new Float32Array(e),this.refresh())}get direction(){return this._direction}set direction(e){if(this._direction===e)return;this._direction=e;const r=e*ci;this.uniforms.sinDir=Math.sin(r),this.uniforms.cosDir=Math.cos(r)}get red(){return this.uniforms.red}set red(e){this.uniforms.red=e}get green(){return this.uniforms.green}set green(e){this.uniforms.green=e}get blue(){return this.uniforms.blue}set blue(e){this.uniforms.blue=e}destroy(){var e;(e=this.texture)==null||e.destroy(!0),this.texture=this._canvas=this.red=this.green=this.blue=this._sizes=this._offsets=null}};let kr=Ba;kr.defaults={slices:5,offset:100,direction:0,fillMode:0,average:!1,seed:0,red:[0,0],green:[0,0],blue:[0,0],minSize:8,sampleSize:512},kr.TRANSPARENT=0,kr.ORIGINAL=1,kr.LOOP=2,kr.CLAMP=3,kr.MIRROR=4;var cT=`attribute vec2 aVertexPosition;
|
|
1115
1115
|
attribute vec2 aTextureCoord;
|
|
1116
1116
|
|
|
1117
1117
|
uniform mat3 projectionMatrix;
|
|
@@ -1122,7 +1122,7 @@ void main(void)
|
|
|
1122
1122
|
{
|
|
1123
1123
|
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
|
1124
1124
|
vTextureCoord = aTextureCoord;
|
|
1125
|
-
}`,
|
|
1125
|
+
}`,fT=`varying vec2 vTextureCoord;
|
|
1126
1126
|
varying vec4 vColor;
|
|
1127
1127
|
|
|
1128
1128
|
uniform sampler2D uSampler;
|
|
@@ -1188,7 +1188,7 @@ void main(void) {
|
|
|
1188
1188
|
gl_FragColor = innerColor + outerGlowColor;
|
|
1189
1189
|
}
|
|
1190
1190
|
}
|
|
1191
|
-
`;const
|
|
1191
|
+
`;const Lh=class extends ce{constructor(t){const e=Object.assign({},Lh.defaults,t),{outerStrength:r,innerStrength:i,color:n,knockout:s,quality:a,alpha:o}=e,u=Math.round(e.distance);super(cT,fT.replace(/__ANGLE_STEP_SIZE__/gi,`${(1/a/u).toFixed(7)}`).replace(/__DIST__/gi,`${u.toFixed(0)}.0`)),this.uniforms.glowColor=new Float32Array([0,0,0,1]),this.uniforms.alpha=1,Object.assign(this,{color:n,outerStrength:r,innerStrength:i,padding:u,knockout:s,alpha:o})}get color(){return aa(this.uniforms.glowColor)}set color(t){un(t,this.uniforms.glowColor)}get outerStrength(){return this.uniforms.outerStrength}set outerStrength(t){this.uniforms.outerStrength=t}get innerStrength(){return this.uniforms.innerStrength}set innerStrength(t){this.uniforms.innerStrength=t}get knockout(){return this.uniforms.knockout}set knockout(t){this.uniforms.knockout=t}get alpha(){return this.uniforms.alpha}set alpha(t){this.uniforms.alpha=t}};let dT=Lh;dT.defaults={distance:10,outerStrength:4,innerStrength:0,color:16777215,quality:.1,knockout:!1,alpha:1};var pT=`attribute vec2 aVertexPosition;
|
|
1192
1192
|
attribute vec2 aTextureCoord;
|
|
1193
1193
|
|
|
1194
1194
|
uniform mat3 projectionMatrix;
|
|
@@ -1199,7 +1199,7 @@ void main(void)
|
|
|
1199
1199
|
{
|
|
1200
1200
|
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
|
1201
1201
|
vTextureCoord = aTextureCoord;
|
|
1202
|
-
}`,
|
|
1202
|
+
}`,mT=`vec3 mod289(vec3 x)
|
|
1203
1203
|
{
|
|
1204
1204
|
return x - floor(x * (1.0 / 289.0)) * 289.0;
|
|
1205
1205
|
}
|
|
@@ -1294,7 +1294,7 @@ float turb(vec3 P, vec3 rep, float lacunarity, float gain)
|
|
|
1294
1294
|
}
|
|
1295
1295
|
return abs(sum);
|
|
1296
1296
|
}
|
|
1297
|
-
`,
|
|
1297
|
+
`,gT=`varying vec2 vTextureCoord;
|
|
1298
1298
|
uniform sampler2D uSampler;
|
|
1299
1299
|
uniform vec4 filterArea;
|
|
1300
1300
|
uniform vec2 dimensions;
|
|
@@ -1339,7 +1339,7 @@ void main(void) {
|
|
|
1339
1339
|
gl_FragColor = texture2D(uSampler, vTextureCoord) + mist;
|
|
1340
1340
|
|
|
1341
1341
|
}
|
|
1342
|
-
`;const
|
|
1342
|
+
`;const Bh=class extends ce{constructor(e){super(pT,gT.replace("${perlin}",mT)),this.parallel=!0,this.time=0,this._angle=0,this.uniforms.dimensions=new Float32Array(2);const r=Object.assign(Bh.defaults,e);this._angleLight=new me,this.angle=r.angle,this.gain=r.gain,this.lacunarity=r.lacunarity,this.alpha=r.alpha,this.parallel=r.parallel,this.center=r.center,this.time=r.time}apply(e,r,i,n){const{width:s,height:a}=r.filterFrame;this.uniforms.light=this.parallel?this._angleLight:this.center,this.uniforms.parallel=this.parallel,this.uniforms.dimensions[0]=s,this.uniforms.dimensions[1]=a,this.uniforms.aspect=a/s,this.uniforms.time=this.time,this.uniforms.alpha=this.alpha,e.applyFilter(this,r,i,n)}get angle(){return this._angle}set angle(e){this._angle=e;const r=e*ci;this._angleLight.x=Math.cos(r),this._angleLight.y=Math.sin(r)}get gain(){return this.uniforms.gain}set gain(e){this.uniforms.gain=e}get lacunarity(){return this.uniforms.lacunarity}set lacunarity(e){this.uniforms.lacunarity=e}get alpha(){return this.uniforms.alpha}set alpha(e){this.uniforms.alpha=e}};let _T=Bh;_T.defaults={angle:30,gain:.5,lacunarity:2.5,time:0,parallel:!0,center:[0,0],alpha:1};var vT=`attribute vec2 aVertexPosition;
|
|
1343
1343
|
attribute vec2 aTextureCoord;
|
|
1344
1344
|
|
|
1345
1345
|
uniform mat3 projectionMatrix;
|
|
@@ -1350,7 +1350,7 @@ void main(void)
|
|
|
1350
1350
|
{
|
|
1351
1351
|
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
|
1352
1352
|
vTextureCoord = aTextureCoord;
|
|
1353
|
-
}`,
|
|
1353
|
+
}`,yT=`precision mediump float;
|
|
1354
1354
|
|
|
1355
1355
|
varying vec2 vTextureCoord;
|
|
1356
1356
|
uniform sampler2D uSampler;
|
|
@@ -1408,7 +1408,7 @@ void main()
|
|
|
1408
1408
|
// alpha
|
|
1409
1409
|
gl_FragColor = mix(color, result, uAlpha);
|
|
1410
1410
|
}
|
|
1411
|
-
`;const
|
|
1411
|
+
`;const Uh=class extends ce{constructor(t){super(vT,yT),this._hue=0;const e=Object.assign({},Uh.defaults,t);Object.assign(this,e)}get hue(){return this._hue}set hue(t){this._hue=t,this.uniforms.uHue=this._hue*(Math.PI/180)}get alpha(){return this.uniforms.uAlpha}set alpha(t){this.uniforms.uAlpha=t}get colorize(){return this.uniforms.uColorize}set colorize(t){this.uniforms.uColorize=t}get lightness(){return this.uniforms.uLightness}set lightness(t){this.uniforms.uLightness=t}get saturation(){return this.uniforms.uSaturation}set saturation(t){this.uniforms.uSaturation=t}};let xT=Uh;xT.defaults={hue:0,saturation:0,lightness:0,colorize:!1,alpha:1};var bT=`attribute vec2 aVertexPosition;
|
|
1412
1412
|
attribute vec2 aTextureCoord;
|
|
1413
1413
|
|
|
1414
1414
|
uniform mat3 projectionMatrix;
|
|
@@ -1419,7 +1419,7 @@ void main(void)
|
|
|
1419
1419
|
{
|
|
1420
1420
|
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
|
1421
1421
|
vTextureCoord = aTextureCoord;
|
|
1422
|
-
}`,
|
|
1422
|
+
}`,TT=`varying vec2 vTextureCoord;
|
|
1423
1423
|
uniform sampler2D uSampler;
|
|
1424
1424
|
uniform vec4 filterArea;
|
|
1425
1425
|
uniform vec2 dimensions;
|
|
@@ -1523,7 +1523,7 @@ void main()
|
|
|
1523
1523
|
|
|
1524
1524
|
gl_FragColor.rgb = color;
|
|
1525
1525
|
}
|
|
1526
|
-
`;const
|
|
1526
|
+
`;const $h=class extends ce{constructor(e,r=0){super(bT,TT),this.seed=0,this.uniforms.dimensions=new Float32Array(2),typeof e=="number"?(this.seed=e,e=void 0):this.seed=r,Object.assign(this,$h.defaults,e)}apply(e,r,i,n){var s,a;this.uniforms.dimensions[0]=(s=r.filterFrame)==null?void 0:s.width,this.uniforms.dimensions[1]=(a=r.filterFrame)==null?void 0:a.height,this.uniforms.seed=this.seed,e.applyFilter(this,r,i,n)}set sepia(e){this.uniforms.sepia=e}get sepia(){return this.uniforms.sepia}set noise(e){this.uniforms.noise=e}get noise(){return this.uniforms.noise}set noiseSize(e){this.uniforms.noiseSize=e}get noiseSize(){return this.uniforms.noiseSize}set scratch(e){this.uniforms.scratch=e}get scratch(){return this.uniforms.scratch}set scratchDensity(e){this.uniforms.scratchDensity=e}get scratchDensity(){return this.uniforms.scratchDensity}set scratchWidth(e){this.uniforms.scratchWidth=e}get scratchWidth(){return this.uniforms.scratchWidth}set vignetting(e){this.uniforms.vignetting=e}get vignetting(){return this.uniforms.vignetting}set vignettingAlpha(e){this.uniforms.vignettingAlpha=e}get vignettingAlpha(){return this.uniforms.vignettingAlpha}set vignettingBlur(e){this.uniforms.vignettingBlur=e}get vignettingBlur(){return this.uniforms.vignettingBlur}};let Gh=$h;Gh.defaults={sepia:.3,noise:.3,noiseSize:1,scratch:.5,scratchDensity:.3,scratchWidth:1,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3};var wT=`attribute vec2 aVertexPosition;
|
|
1527
1527
|
attribute vec2 aTextureCoord;
|
|
1528
1528
|
|
|
1529
1529
|
uniform mat3 projectionMatrix;
|
|
@@ -1534,7 +1534,7 @@ void main(void)
|
|
|
1534
1534
|
{
|
|
1535
1535
|
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
|
1536
1536
|
vTextureCoord = aTextureCoord;
|
|
1537
|
-
}`,
|
|
1537
|
+
}`,ST=`varying vec2 vTextureCoord;
|
|
1538
1538
|
uniform sampler2D uSampler;
|
|
1539
1539
|
uniform vec4 filterClamp;
|
|
1540
1540
|
|
|
@@ -1572,7 +1572,7 @@ void main(void) {
|
|
|
1572
1572
|
vec4 outlineColor = vec4(vec3(uColor) * outlineAlpha, outlineAlpha);
|
|
1573
1573
|
gl_FragColor = contentColor + outlineColor;
|
|
1574
1574
|
}
|
|
1575
|
-
`;const
|
|
1575
|
+
`;const Nn=class extends ce{constructor(e=1,r=0,i=.1,n=1,s=!1){super(wT,ST.replace(/\$\{angleStep\}/,Nn.getAngleStep(i))),this._thickness=1,this._alpha=1,this._knockout=!1,this.uniforms.uThickness=new Float32Array([0,0]),this.uniforms.uColor=new Float32Array([0,0,0,1]),this.uniforms.uAlpha=n,this.uniforms.uKnockout=s,Object.assign(this,{thickness:e,color:r,quality:i,alpha:n,knockout:s})}static getAngleStep(e){const r=Math.max(e*Nn.MAX_SAMPLES,Nn.MIN_SAMPLES);return(Math.PI*2/r).toFixed(7)}apply(e,r,i,n){this.uniforms.uThickness[0]=this._thickness/r._frame.width,this.uniforms.uThickness[1]=this._thickness/r._frame.height,this.uniforms.uAlpha=this._alpha,this.uniforms.uKnockout=this._knockout,e.applyFilter(this,r,i,n)}get alpha(){return this._alpha}set alpha(e){this._alpha=e}get color(){return aa(this.uniforms.uColor)}set color(e){un(e,this.uniforms.uColor)}get knockout(){return this._knockout}set knockout(e){this._knockout=e}get thickness(){return this._thickness}set thickness(e){this._thickness=e,this.padding=e}};let zh=Nn;zh.MIN_SAMPLES=1,zh.MAX_SAMPLES=100;var AT=`attribute vec2 aVertexPosition;
|
|
1576
1576
|
attribute vec2 aTextureCoord;
|
|
1577
1577
|
|
|
1578
1578
|
uniform mat3 projectionMatrix;
|
|
@@ -1583,7 +1583,7 @@ void main(void)
|
|
|
1583
1583
|
{
|
|
1584
1584
|
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
|
1585
1585
|
vTextureCoord = aTextureCoord;
|
|
1586
|
-
}`,
|
|
1586
|
+
}`,ET=`varying vec2 vTextureCoord;
|
|
1587
1587
|
uniform sampler2D uSampler;
|
|
1588
1588
|
|
|
1589
1589
|
uniform vec4 filterArea;
|
|
@@ -1627,7 +1627,7 @@ void main(void)
|
|
|
1627
1627
|
|
|
1628
1628
|
gl_FragColor = color * _alpha;
|
|
1629
1629
|
}
|
|
1630
|
-
`;const
|
|
1630
|
+
`;const jh=class extends ce{constructor(e){super(AT,ET),this.time=0,this.uniforms.amplitude=new Float32Array(2),this.uniforms.waveLength=new Float32Array(2),this.uniforms.alpha=new Float32Array(2),this.uniforms.dimensions=new Float32Array(2),Object.assign(this,jh.defaults,e)}apply(e,r,i,n){var s,a;this.uniforms.dimensions[0]=(s=r.filterFrame)==null?void 0:s.width,this.uniforms.dimensions[1]=(a=r.filterFrame)==null?void 0:a.height,this.uniforms.time=this.time,e.applyFilter(this,r,i,n)}set mirror(e){this.uniforms.mirror=e}get mirror(){return this.uniforms.mirror}set boundary(e){this.uniforms.boundary=e}get boundary(){return this.uniforms.boundary}set amplitude(e){this.uniforms.amplitude[0]=e[0],this.uniforms.amplitude[1]=e[1]}get amplitude(){return this.uniforms.amplitude}set waveLength(e){this.uniforms.waveLength[0]=e[0],this.uniforms.waveLength[1]=e[1]}get waveLength(){return this.uniforms.waveLength}set alpha(e){this.uniforms.alpha[0]=e[0],this.uniforms.alpha[1]=e[1]}get alpha(){return this.uniforms.alpha}};let CT=jh;CT.defaults={mirror:!0,boundary:.5,amplitude:[0,20],waveLength:[30,100],alpha:[1,1],time:0};var IT=`attribute vec2 aVertexPosition;
|
|
1631
1631
|
attribute vec2 aTextureCoord;
|
|
1632
1632
|
|
|
1633
1633
|
uniform mat3 projectionMatrix;
|
|
@@ -1638,7 +1638,7 @@ void main(void)
|
|
|
1638
1638
|
{
|
|
1639
1639
|
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
|
1640
1640
|
vTextureCoord = aTextureCoord;
|
|
1641
|
-
}`,
|
|
1641
|
+
}`,RT=`varying vec2 vTextureCoord;
|
|
1642
1642
|
uniform sampler2D uSampler;
|
|
1643
1643
|
uniform vec4 filterArea;
|
|
1644
1644
|
uniform vec4 filterClamp;
|
|
@@ -1707,7 +1707,7 @@ void main()
|
|
|
1707
1707
|
|
|
1708
1708
|
gl_FragColor = color;
|
|
1709
1709
|
}
|
|
1710
|
-
`;const
|
|
1710
|
+
`;const Hh=class extends ce{constructor(e=[0,0],r,i=0){super(IT,RT),this.center=e,Object.assign(this,Hh.defaults,r),this.time=i}apply(e,r,i,n){this.uniforms.time=this.time,e.applyFilter(this,r,i,n)}get center(){return this.uniforms.center}set center(e){this.uniforms.center=e}get amplitude(){return this.uniforms.amplitude}set amplitude(e){this.uniforms.amplitude=e}get wavelength(){return this.uniforms.wavelength}set wavelength(e){this.uniforms.wavelength=e}get brightness(){return this.uniforms.brightness}set brightness(e){this.uniforms.brightness=e}get speed(){return this.uniforms.speed}set speed(e){this.uniforms.speed=e}get radius(){return this.uniforms.radius}set radius(e){this.uniforms.radius=e}};let PT=Hh;PT.defaults={amplitude:30,wavelength:160,brightness:1,speed:500,radius:-1};var MT=`attribute vec2 aVertexPosition;
|
|
1711
1711
|
attribute vec2 aTextureCoord;
|
|
1712
1712
|
|
|
1713
1713
|
uniform mat3 projectionMatrix;
|
|
@@ -1718,7 +1718,7 @@ void main(void)
|
|
|
1718
1718
|
{
|
|
1719
1719
|
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
|
1720
1720
|
vTextureCoord = aTextureCoord;
|
|
1721
|
-
}`,
|
|
1721
|
+
}`,FT=`varying vec2 vTextureCoord;
|
|
1722
1722
|
|
|
1723
1723
|
uniform sampler2D uSampler;
|
|
1724
1724
|
uniform float blur;
|
|
@@ -1757,7 +1757,7 @@ void main(void)
|
|
|
1757
1757
|
|
|
1758
1758
|
gl_FragColor = color;
|
|
1759
1759
|
}
|
|
1760
|
-
`;let
|
|
1760
|
+
`;let Vh=class extends ce{constructor(e){var r,i;super(MT,FT),this.uniforms.blur=e.blur,this.uniforms.gradientBlur=e.gradientBlur,this.uniforms.start=(r=e.start)!=null?r:new me(0,window.innerHeight/2),this.uniforms.end=(i=e.end)!=null?i:new me(600,window.innerHeight/2),this.uniforms.delta=new me(30,30),this.uniforms.texSize=new me(window.innerWidth,window.innerHeight),this.updateDelta()}updateDelta(){this.uniforms.delta.x=0,this.uniforms.delta.y=0}get blur(){return this.uniforms.blur}set blur(e){this.uniforms.blur=e}get gradientBlur(){return this.uniforms.gradientBlur}set gradientBlur(e){this.uniforms.gradientBlur=e}get start(){return this.uniforms.start}set start(e){this.uniforms.start=e,this.updateDelta()}get end(){return this.uniforms.end}set end(e){this.uniforms.end=e,this.updateDelta()}},OT=class extends Vh{updateDelta(){const e=this.uniforms.end.x-this.uniforms.start.x,r=this.uniforms.end.y-this.uniforms.start.y,i=Math.sqrt(e*e+r*r);this.uniforms.delta.x=e/i,this.uniforms.delta.y=r/i}},NT=class extends Vh{updateDelta(){const e=this.uniforms.end.x-this.uniforms.start.x,r=this.uniforms.end.y-this.uniforms.start.y,i=Math.sqrt(e*e+r*r);this.uniforms.delta.x=-r/i,this.uniforms.delta.y=e/i}};const Xh=class extends ce{constructor(e,r,i,n){super(),typeof e=="number"&&(ne("5.3.0","TiltShiftFilter constructor arguments is deprecated, use options."),e={blur:e,gradientBlur:r,start:i,end:n}),e=Object.assign({},Xh.defaults,e),this.tiltShiftXFilter=new OT(e),this.tiltShiftYFilter=new NT(e)}apply(e,r,i,n){const s=e.getFilterTexture();this.tiltShiftXFilter.apply(e,r,s,1),this.tiltShiftYFilter.apply(e,s,i,n),e.returnFilterTexture(s)}get blur(){return this.tiltShiftXFilter.blur}set blur(e){this.tiltShiftXFilter.blur=this.tiltShiftYFilter.blur=e}get gradientBlur(){return this.tiltShiftXFilter.gradientBlur}set gradientBlur(e){this.tiltShiftXFilter.gradientBlur=this.tiltShiftYFilter.gradientBlur=e}get start(){return this.tiltShiftXFilter.start}set start(e){this.tiltShiftXFilter.start=this.tiltShiftYFilter.start=e}get end(){return this.tiltShiftXFilter.end}set end(e){this.tiltShiftXFilter.end=this.tiltShiftYFilter.end=e}};let kT=Xh;kT.defaults={blur:100,gradientBlur:600,start:void 0,end:void 0};var DT=`attribute vec2 aVertexPosition;
|
|
1761
1761
|
attribute vec2 aTextureCoord;
|
|
1762
1762
|
|
|
1763
1763
|
uniform mat3 projectionMatrix;
|
|
@@ -1768,7 +1768,7 @@ void main(void)
|
|
|
1768
1768
|
{
|
|
1769
1769
|
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
|
1770
1770
|
vTextureCoord = aTextureCoord;
|
|
1771
|
-
}
|
|
1771
|
+
}`,LT=`varying vec2 vTextureCoord;
|
|
1772
1772
|
|
|
1773
1773
|
uniform sampler2D uSampler;
|
|
1774
1774
|
uniform float radius;
|
|
@@ -1824,7 +1824,7 @@ void main(void)
|
|
|
1824
1824
|
gl_FragColor = texture2D(uSampler, coord );
|
|
1825
1825
|
|
|
1826
1826
|
}
|
|
1827
|
-
`;const
|
|
1827
|
+
`;const Wh=class extends ce{constructor(t){super(DT,LT),Object.assign(this,Wh.defaults,t)}get offset(){return this.uniforms.offset}set offset(t){this.uniforms.offset=t}get radius(){return this.uniforms.radius}set radius(t){this.uniforms.radius=t}get angle(){return this.uniforms.angle}set angle(t){this.uniforms.angle=t}};let BT=Wh;BT.defaults={radius:200,angle:4,padding:20,offset:new me};var UT=`attribute vec2 aVertexPosition;
|
|
1828
1828
|
attribute vec2 aTextureCoord;
|
|
1829
1829
|
|
|
1830
1830
|
uniform mat3 projectionMatrix;
|
|
@@ -1835,7 +1835,7 @@ void main(void)
|
|
|
1835
1835
|
{
|
|
1836
1836
|
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
|
1837
1837
|
vTextureCoord = aTextureCoord;
|
|
1838
|
-
}
|
|
1838
|
+
}`,$T=`varying vec2 vTextureCoord;
|
|
1839
1839
|
uniform sampler2D uSampler;
|
|
1840
1840
|
uniform vec4 filterArea;
|
|
1841
1841
|
|
|
@@ -1921,7 +1921,7 @@ void main() {
|
|
|
1921
1921
|
|
|
1922
1922
|
gl_FragColor = color;
|
|
1923
1923
|
}
|
|
1924
|
-
`,
|
|
1924
|
+
`,qh=Object.getOwnPropertySymbols,GT=Object.prototype.hasOwnProperty,zT=Object.prototype.propertyIsEnumerable,jT=(t,e)=>{var r={};for(var i in t)GT.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&qh)for(var i of qh(t))e.indexOf(i)<0&&zT.call(t,i)&&(r[i]=t[i]);return r};const Yh=class extends ce{constructor(t){const e=Object.assign(Yh.defaults,t),{maxKernelSize:r}=e,i=jT(e,["maxKernelSize"]);super(UT,$T.replace("${maxKernelSize}",r.toFixed(1))),Object.assign(this,i)}get center(){return this.uniforms.uCenter}set center(t){this.uniforms.uCenter=t}get strength(){return this.uniforms.uStrength}set strength(t){this.uniforms.uStrength=t}get innerRadius(){return this.uniforms.uInnerRadius}set innerRadius(t){this.uniforms.uInnerRadius=t}get radius(){return this.uniforms.uRadius}set radius(t){(t<0||t===1/0)&&(t=-1),this.uniforms.uRadius=t}};let HT=Yh;HT.defaults={strength:.1,center:[0,0],innerRadius:0,radius:-1,maxKernelSize:32};const ir=t=>{const{contrast:e=1,saturation:r=1,brightness:i=1,alpha:n=1,red:s=1,blue:a=1,gamma:o=1,green:u=1,blurRadius:c=0,temperature:f=0,hue:l=0,sharpness:h=0,vignette:d=0,noise:p=0}=t||{},m=new Le.Filter(null,`
|
|
1925
1925
|
precision mediump float;
|
|
1926
1926
|
varying vec2 vTextureCoord;
|
|
1927
1927
|
uniform sampler2D uSampler;
|
|
@@ -1933,7 +1933,7 @@ void main() {
|
|
|
1933
1933
|
color.b = color.b - (temperature / 100.0);
|
|
1934
1934
|
gl_FragColor = color;
|
|
1935
1935
|
}
|
|
1936
|
-
`);
|
|
1936
|
+
`);m.uniforms.temperature=f;const _=new Jb([0,-h,0,-h,1+4*h,-h,0,-h,0]),g=new Le.filters.ColorMatrixFilter;g.hue(l,!1);const y=new yi(c,1,!0),v=new Gh({vignetting:d}),x=new Le.filters.NoiseFilter(p);return{adjustmentFilter:new _b({...o&&{gamma:o},...i&&{brightness:i},...e&&{contrast:e},...r&&{saturation:r},...s&&{red:s},...u&&{green:u},...a&&{blue:a},...n&&{alpha:n}}),blurFilter:y,hueFilter:g,sharpnessFilter:_,temperatureFilter:m,vignetteFilter:v,noiseFilter:x}},VT=()=>{const t=new Le.Filter(null,`
|
|
1937
1937
|
precision mediump float;
|
|
1938
1938
|
uniform mat3 uNightVisionMatrix;
|
|
1939
1939
|
varying vec2 vTextureCoord;
|
|
@@ -1944,7 +1944,7 @@ void main() {
|
|
|
1944
1944
|
vec3 color = texColor.rgb;
|
|
1945
1945
|
gl_FragColor = vec4(uNightVisionMatrix * vec3(color), texColor.a);
|
|
1946
1946
|
}
|
|
1947
|
-
`),e=[.393,.769,.189,.349,.686,.168,.272,.534,.131];t.uniforms.uNightVisionMatrix=e;const r=new
|
|
1947
|
+
`),e=[.393,.769,.189,.349,.686,.168,.272,.534,.131];t.uniforms.uNightVisionMatrix=e;const r=new Le.Filter(null,`
|
|
1948
1948
|
precision mediump float;
|
|
1949
1949
|
varying vec2 vTextureCoord;
|
|
1950
1950
|
uniform sampler2D uSampler;
|
|
@@ -1958,7 +1958,7 @@ void main() {
|
|
|
1958
1958
|
float vignette = 1.0 - smoothstep(vignetteSize, 0.5, length(delta));
|
|
1959
1959
|
gl_FragColor = texColor * vignetteColor * vignetteStrength * vignette;
|
|
1960
1960
|
}
|
|
1961
|
-
`);return r.uniforms.vignetteColor=[0,0,0,1],r.uniforms.vignetteSize=.7,r.uniforms.vignetteStrength=.6,{nightVisionFilter:t,vignetteFilter:r}},Rg=te.forwardRef((t,e)=>{const r=j.useRef(null),n=j.useRef(null),{src:i,visible:a,disabled:u,transformation:{x:l,y:h,width:p,height:m,anchor:c,colorCorrection:d={},effect:g},pointerdown:v}=t,{blurRadius:y=0,vignette:b=0,noise:x=0}=d,{temperatureFilter:E,sharpnessFilter:w,hueFilter:I,blurFilter:O,adjustmentFilter:F,vignetteFilter:N,noiseFilter:L}=Xn(d),{nightVisionFilter:D}=qI();return te.useEffect(()=>()=>{console.log("PixiImageSprite unmounting")},[]),Se.jsx(Pn,{...t,ref:e,children:Se.jsx(De.Container,{ref:n,children:Se.jsx(De.Sprite,{image:i,width:p,height:m,anchor:c,ref:r,alpha:a?1:0,x:l,y:h,...!u&&a&&{interactive:!0,pointerdown:v},filters:[E,w,I,F,...y>0?[O]:[],...g===In.NightVision?[D]:[],...b>0?[N]:[],...x>0?[L]:[]]})})})});Rg.whyDidYouRender={logOnDifferentValues:!0,customName:"ImageSprite"};const io={build(t){const e=t.points;let r,n,i,a,u,l;if(t.type===Ct.CIRC){const v=t.shape;r=v.x,n=v.y,u=l=v.radius,i=a=0}else if(t.type===Ct.ELIP){const v=t.shape;r=v.x,n=v.y,u=v.width,l=v.height,i=a=0}else{const v=t.shape,y=v.width/2,b=v.height/2;r=v.x+y,n=v.y+b,u=l=Math.max(0,Math.min(v.radius,Math.min(y,b))),i=y-u,a=b-l}if(!(u>=0&&l>=0&&i>=0&&a>=0)){e.length=0;return}const h=Math.ceil(2.3*Math.sqrt(u+l)),p=h*8+(i?4:0)+(a?4:0);if(e.length=p,p===0)return;if(h===0){e.length=8,e[0]=e[6]=r+i,e[1]=e[3]=n+a,e[2]=e[4]=r-i,e[5]=e[7]=n-a;return}let m=0,c=h*4+(i?2:0)+2,d=c,g=p;{const v=i+u,y=a,b=r+v,x=r-v,E=n+y;if(e[m++]=b,e[m++]=E,e[--c]=E,e[--c]=x,a){const w=n-y;e[d++]=x,e[d++]=w,e[--g]=w,e[--g]=b}}for(let v=1;v<h;v++){const y=Math.PI/2*(v/h),b=i+Math.cos(y)*u,x=a+Math.sin(y)*l,E=r+b,w=r-b,I=n+x,O=n-x;e[m++]=E,e[m++]=I,e[--c]=I,e[--c]=w,e[d++]=w,e[d++]=O,e[--g]=O,e[--g]=E}{const v=i,y=a+l,b=r+v,x=r-v,E=n+y,w=n-y;e[m++]=b,e[m++]=E,e[--g]=w,e[--g]=b,i&&(e[m++]=x,e[m++]=E,e[--g]=w,e[--g]=x)}},triangulate(t,e){const r=t.points,n=e.points,i=e.indices;if(r.length===0)return;let a=n.length/2;const u=a;let l,h;if(t.type!==Ct.RREC){const m=t.shape;l=m.x,h=m.y}else{const m=t.shape;l=m.x+m.width/2,h=m.y+m.height/2}const p=t.matrix;n.push(t.matrix?p.a*l+p.c*h+p.tx:l,t.matrix?p.b*l+p.d*h+p.ty:h),a++,n.push(r[0],r[1]);for(let m=2;m<r.length;m+=2)n.push(r[m],r[m+1]),i.push(a++,u,a);i.push(u+1,u,a)}};function Pg(t,e=!1){const r=t.length;if(r<6)return;let n=0;for(let i=0,a=t[r-2],u=t[r-1];i<r;i+=2){const l=t[i],h=t[i+1];n+=(l-a)*(h+u),a=l,u=h}if(!e&&n>0||e&&n<=0){const i=r/2;for(let a=i+i%2;a<r;a+=2){const u=r-a-2,l=r-a-1,h=a,p=a+1;[t[u],t[h]]=[t[h],t[u]],[t[l],t[p]]=[t[p],t[l]]}}}const Mg={build(t){t.points=t.shape.points.slice()},triangulate(t,e){let r=t.points;const n=t.holes,i=e.points,a=e.indices;if(r.length>=6){Pg(r,!1);const u=[];for(let p=0;p<n.length;p++){const m=n[p];Pg(m.points,!0),u.push(r.length/2),r=r.concat(m.points)}const l=LS(r,u,2);if(!l)return;const h=i.length/2;for(let p=0;p<l.length;p+=3)a.push(l[p]+h),a.push(l[p+1]+h),a.push(l[p+2]+h);for(let p=0;p<r.length;p++)i.push(r[p])}}},YI={build(t){const e=t.shape,r=e.x,n=e.y,i=e.width,a=e.height,u=t.points;u.length=0,i>=0&&a>=0&&u.push(r,n,r+i,n,r+i,n+a,r,n+a)},triangulate(t,e){const r=t.points,n=e.points;if(r.length===0)return;const i=n.length/2;n.push(r[0],r[1],r[2],r[3],r[6],r[7],r[4],r[5]),e.indices.push(i,i+1,i+2,i+1,i+2,i+3)}},KI={build(t){io.build(t)},triangulate(t,e){io.triangulate(t,e)}};var Ar=(t=>(t.MITER="miter",t.BEVEL="bevel",t.ROUND="round",t))(Ar||{}),jn=(t=>(t.BUTT="butt",t.ROUND="round",t.SQUARE="square",t))(jn||{});const Fi={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(t,e=20){if(!this.adaptive||!t||isNaN(t))return e;let r=Math.ceil(t/this.maxLength);return r<this.minSegments?r=this.minSegments:r>this.maxSegments&&(r=this.maxSegments),r}};class Og{static curveTo(e,r,n,i,a,u){const l=u[u.length-2],p=u[u.length-1]-r,m=l-e,c=i-r,d=n-e,g=Math.abs(p*d-m*c);if(g<1e-8||a===0)return(u[u.length-2]!==e||u[u.length-1]!==r)&&u.push(e,r),null;const v=p*p+m*m,y=c*c+d*d,b=p*c+m*d,x=a*Math.sqrt(v)/g,E=a*Math.sqrt(y)/g,w=x*b/v,I=E*b/y,O=x*d+E*m,F=x*c+E*p,N=m*(E+w),L=p*(E+w),D=d*(x+I),V=c*(x+I),Y=Math.atan2(L-F,N-O),ie=Math.atan2(V-F,D-O);return{cx:O+e,cy:F+r,radius:a,startAngle:Y,endAngle:ie,anticlockwise:m*c>d*p}}static arc(e,r,n,i,a,u,l,h,p){const m=l-u,c=Fi._segmentsCount(Math.abs(m)*a,Math.ceil(Math.abs(m)/Ba)*40),d=m/(c*2),g=d*2,v=Math.cos(d),y=Math.sin(d),b=c-1,x=b%1/b;for(let E=0;E<=b;++E){const w=E+x*E,I=d+u+g*w,O=Math.cos(I),F=-Math.sin(I);p.push((v*O+y*F)*a+n,(v*-F+y*O)*a+i)}}}class ZI{constructor(){this.reset()}begin(e,r,n){this.reset(),this.style=e,this.start=r,this.attribStart=n}end(e,r){this.attribSize=r-this.attribStart,this.size=e-this.start}reset(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0}}class Zl{static curveLength(e,r,n,i,a,u,l,h){let m=0,c=0,d=0,g=0,v=0,y=0,b=0,x=0,E=0,w=0,I=0,O=e,F=r;for(let N=1;N<=10;++N)c=N/10,d=c*c,g=d*c,v=1-c,y=v*v,b=y*v,x=b*e+3*y*c*n+3*v*d*a+g*l,E=b*r+3*y*c*i+3*v*d*u+g*h,w=O-x,I=F-E,O=x,F=E,m+=Math.sqrt(w*w+I*I);return m}static curveTo(e,r,n,i,a,u,l){const h=l[l.length-2],p=l[l.length-1];l.length-=2;const m=Fi._segmentsCount(Zl.curveLength(h,p,e,r,n,i,a,u));let c=0,d=0,g=0,v=0,y=0;l.push(h,p);for(let b=1,x=0;b<=m;++b)x=b/m,c=1-x,d=c*c,g=d*c,v=x*x,y=v*x,l.push(g*h+3*d*x*e+3*c*v*n+y*a,g*p+3*d*x*r+3*c*v*i+y*u)}}function Fg(t,e,r,n,i,a,u,l){const h=t-r*i,p=e-n*i,m=t+r*a,c=e+n*a;let d,g;u?(d=n,g=-r):(d=-n,g=r);const v=h+d,y=p+g,b=m+d,x=c+g;return l.push(v,y,b,x),2}function Wn(t,e,r,n,i,a,u,l){const h=r-t,p=n-e;let m=Math.atan2(h,p),c=Math.atan2(i-t,a-e);l&&m<c?m+=Math.PI*2:!l&&m>c&&(c+=Math.PI*2);let d=m;const g=c-m,v=Math.abs(g),y=Math.sqrt(h*h+p*p),b=(15*v*Math.sqrt(y)/Math.PI>>0)+1,x=g/b;if(d+=x,l){u.push(t,e,r,n);for(let E=1,w=d;E<b;E++,w+=x)u.push(t,e,t+Math.sin(w)*y,e+Math.cos(w)*y);u.push(t,e,i,a)}else{u.push(r,n,t,e);for(let E=1,w=d;E<b;E++,w+=x)u.push(t+Math.sin(w)*y,e+Math.cos(w)*y,t,e);u.push(i,a,t,e)}return b*2}function QI(t,e){const r=t.shape;let n=t.points||r.points.slice();const i=e.closePointEps;if(n.length===0)return;const a=t.lineStyle,u=new et(n[0],n[1]),l=new et(n[n.length-2],n[n.length-1]),h=r.type!==Ct.POLY||r.closeStroke,p=Math.abs(u.x-l.x)<i&&Math.abs(u.y-l.y)<i;if(h){n=n.slice(),p&&(n.pop(),n.pop(),l.set(n[n.length-2],n[n.length-1]));const z=(u.x+l.x)*.5,Q=(l.y+u.y)*.5;n.unshift(z,Q),n.push(z,Q)}const m=e.points,c=n.length/2;let d=n.length;const g=m.length/2,v=a.width/2,y=v*v,b=a.miterLimit*a.miterLimit;let x=n[0],E=n[1],w=n[2],I=n[3],O=0,F=0,N=-(E-I),L=x-w,D=0,V=0,Y=Math.sqrt(N*N+L*L);N/=Y,L/=Y,N*=v,L*=v;const ie=a.alignment,X=(1-ie)*2,G=ie*2;h||(a.cap===jn.ROUND?d+=Wn(x-N*(X-G)*.5,E-L*(X-G)*.5,x-N*X,E-L*X,x+N*G,E+L*G,m,!0)+2:a.cap===jn.SQUARE&&(d+=Fg(x,E,N,L,X,G,!0,m))),m.push(x-N*X,E-L*X,x+N*G,E+L*G);for(let z=1;z<c-1;++z){x=n[(z-1)*2],E=n[(z-1)*2+1],w=n[z*2],I=n[z*2+1],O=n[(z+1)*2],F=n[(z+1)*2+1],N=-(E-I),L=x-w,Y=Math.sqrt(N*N+L*L),N/=Y,L/=Y,N*=v,L*=v,D=-(I-F),V=w-O,Y=Math.sqrt(D*D+V*V),D/=Y,V/=Y,D*=v,V*=v;const Q=w-x,ge=E-I,W=w-O,q=F-I,he=Q*W+ge*q,fe=ge*W-q*Q,me=fe<0;if(Math.abs(fe)<.001*Math.abs(he)){m.push(w-N*X,I-L*X,w+N*G,I+L*G),he>=0&&(a.join===Ar.ROUND?d+=Wn(w,I,w-N*X,I-L*X,w-D*X,I-V*X,m,!1)+4:d+=2,m.push(w-D*G,I-V*G,w+D*X,I+V*X));continue}const Te=(-N+x)*(-L+I)-(-N+w)*(-L+E),Ce=(-D+O)*(-V+I)-(-D+w)*(-V+F),Ue=(Q*Ce-W*Te)/fe,He=(q*Te-ge*Ce)/fe,Re=(Ue-w)*(Ue-w)+(He-I)*(He-I),xe=w+(Ue-w)*X,Ae=I+(He-I)*X,$e=w-(Ue-w)*G,Ke=I-(He-I)*G,pe=Math.min(Q*Q+ge*ge,W*W+q*q),ve=me?X:G,st=pe+ve*ve*y,oe=Re<=st;let Ne=a.join;if(Ne===Ar.MITER&&Re/y>b&&(Ne=Ar.BEVEL),oe)switch(Ne){case Ar.MITER:{m.push(xe,Ae,$e,Ke);break}case Ar.BEVEL:{me?m.push(xe,Ae,w+N*G,I+L*G,xe,Ae,w+D*G,I+V*G):m.push(w-N*X,I-L*X,$e,Ke,w-D*X,I-V*X,$e,Ke),d+=2;break}case Ar.ROUND:{me?(m.push(xe,Ae,w+N*G,I+L*G),d+=Wn(w,I,w+N*G,I+L*G,w+D*G,I+V*G,m,!0)+4,m.push(xe,Ae,w+D*G,I+V*G)):(m.push(w-N*X,I-L*X,$e,Ke),d+=Wn(w,I,w-N*X,I-L*X,w-D*X,I-V*X,m,!1)+4,m.push(w-D*X,I-V*X,$e,Ke));break}}else{switch(m.push(w-N*X,I-L*X,w+N*G,I+L*G),Ne){case Ar.MITER:{me?m.push($e,Ke,$e,Ke):m.push(xe,Ae,xe,Ae),d+=2;break}case Ar.ROUND:{me?d+=Wn(w,I,w+N*G,I+L*G,w+D*G,I+V*G,m,!0)+2:d+=Wn(w,I,w-N*X,I-L*X,w-D*X,I-V*X,m,!1)+2;break}}m.push(w-D*X,I-V*X,w+D*G,I+V*G),d+=2}}x=n[(c-2)*2],E=n[(c-2)*2+1],w=n[(c-1)*2],I=n[(c-1)*2+1],N=-(E-I),L=x-w,Y=Math.sqrt(N*N+L*L),N/=Y,L/=Y,N*=v,L*=v,m.push(w-N*X,I-L*X,w+N*G,I+L*G),h||(a.cap===jn.ROUND?d+=Wn(w-N*(X-G)*.5,I-L*(X-G)*.5,w-N*X,I-L*X,w+N*G,I+L*G,m,!1)+2:a.cap===jn.SQUARE&&(d+=Fg(w,I,N,L,X,G,!1,m)));const ae=e.indices,se=Fi.epsilon*Fi.epsilon;for(let z=g;z<d+g-2;++z)x=m[z*2],E=m[z*2+1],w=m[(z+1)*2],I=m[(z+1)*2+1],O=m[(z+2)*2],F=m[(z+2)*2+1],!(Math.abs(x*(I-F)+w*(F-E)+O*(E-I))<se)&&ae.push(z,z+1,z+2)}function JI(t,e){let r=0;const n=t.shape,i=t.points||n.points,a=n.type!==Ct.POLY||n.closeStroke;if(i.length===0)return;const u=e.points,l=e.indices,h=i.length/2,p=u.length/2;let m=p;for(u.push(i[0],i[1]),r=1;r<h;r++)u.push(i[r*2],i[r*2+1]),l.push(m,m+1),m++;a&&l.push(m,p)}function Ng(t,e){t.lineStyle.native?JI(t,e):QI(t,e)}class Ql{static curveLength(e,r,n,i,a,u){const l=e-2*n+a,h=r-2*i+u,p=2*n-2*e,m=2*i-2*r,c=4*(l*l+h*h),d=4*(l*p+h*m),g=p*p+m*m,v=2*Math.sqrt(c+d+g),y=Math.sqrt(c),b=2*c*y,x=2*Math.sqrt(g),E=d/y;return(b*v+y*d*(v-x)+(4*g*c-d*d)*Math.log((2*y+E+v)/(E+x)))/(4*b)}static curveTo(e,r,n,i,a){const u=a[a.length-2],l=a[a.length-1],h=Fi._segmentsCount(Ql.curveLength(u,l,e,r,n,i));let p=0,m=0;for(let c=1;c<=h;++c){const d=c/h;p=u+(e-u)*d,m=l+(r-l)*d,a.push(p+(e+(n-e)*d-p)*d,m+(r+(i-r)*d-m)*d)}}}const Jl={[Ct.POLY]:Mg,[Ct.CIRC]:io,[Ct.ELIP]:io,[Ct.RECT]:YI,[Ct.RREC]:KI},Lg=[],so=[];class ec{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}clear(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}getRectangle(e){return this.minX>this.maxX||this.minY>this.maxY?Qe.EMPTY:(e=e||new Qe(0,0,1,1),e.x=this.minX,e.y=this.minY,e.width=this.maxX-this.minX,e.height=this.maxY-this.minY,e)}addPoint(e){this.minX=Math.min(this.minX,e.x),this.maxX=Math.max(this.maxX,e.x),this.minY=Math.min(this.minY,e.y),this.maxY=Math.max(this.maxY,e.y)}addPointMatrix(e,r){const{a:n,b:i,c:a,d:u,tx:l,ty:h}=e,p=n*r.x+a*r.y+l,m=i*r.x+u*r.y+h;this.minX=Math.min(this.minX,p),this.maxX=Math.max(this.maxX,p),this.minY=Math.min(this.minY,m),this.maxY=Math.max(this.maxY,m)}addQuad(e){let r=this.minX,n=this.minY,i=this.maxX,a=this.maxY,u=e[0],l=e[1];r=u<r?u:r,n=l<n?l:n,i=u>i?u:i,a=l>a?l:a,u=e[2],l=e[3],r=u<r?u:r,n=l<n?l:n,i=u>i?u:i,a=l>a?l:a,u=e[4],l=e[5],r=u<r?u:r,n=l<n?l:n,i=u>i?u:i,a=l>a?l:a,u=e[6],l=e[7],r=u<r?u:r,n=l<n?l:n,i=u>i?u:i,a=l>a?l:a,this.minX=r,this.minY=n,this.maxX=i,this.maxY=a}addFrame(e,r,n,i,a){this.addFrameMatrix(e.worldTransform,r,n,i,a)}addFrameMatrix(e,r,n,i,a){const u=e.a,l=e.b,h=e.c,p=e.d,m=e.tx,c=e.ty;let d=this.minX,g=this.minY,v=this.maxX,y=this.maxY,b=u*r+h*n+m,x=l*r+p*n+c;d=b<d?b:d,g=x<g?x:g,v=b>v?b:v,y=x>y?x:y,b=u*i+h*n+m,x=l*i+p*n+c,d=b<d?b:d,g=x<g?x:g,v=b>v?b:v,y=x>y?x:y,b=u*r+h*a+m,x=l*r+p*a+c,d=b<d?b:d,g=x<g?x:g,v=b>v?b:v,y=x>y?x:y,b=u*i+h*a+m,x=l*i+p*a+c,d=b<d?b:d,g=x<g?x:g,v=b>v?b:v,y=x>y?x:y,this.minX=d,this.minY=g,this.maxX=v,this.maxY=y}addVertexData(e,r,n){let i=this.minX,a=this.minY,u=this.maxX,l=this.maxY;for(let h=r;h<n;h+=2){const p=e[h],m=e[h+1];i=p<i?p:i,a=m<a?m:a,u=p>u?p:u,l=m>l?m:l}this.minX=i,this.minY=a,this.maxX=u,this.maxY=l}addVertices(e,r,n,i){this.addVerticesMatrix(e.worldTransform,r,n,i)}addVerticesMatrix(e,r,n,i,a=0,u=a){const l=e.a,h=e.b,p=e.c,m=e.d,c=e.tx,d=e.ty;let g=this.minX,v=this.minY,y=this.maxX,b=this.maxY;for(let x=n;x<i;x+=2){const E=r[x],w=r[x+1],I=l*E+p*w+c,O=m*w+h*E+d;g=Math.min(g,I-a),y=Math.max(y,I+a),v=Math.min(v,O-u),b=Math.max(b,O+u)}this.minX=g,this.minY=v,this.maxX=y,this.maxY=b}addBounds(e){const r=this.minX,n=this.minY,i=this.maxX,a=this.maxY;this.minX=e.minX<r?e.minX:r,this.minY=e.minY<n?e.minY:n,this.maxX=e.maxX>i?e.maxX:i,this.maxY=e.maxY>a?e.maxY:a}addBoundsMask(e,r){const n=e.minX>r.minX?e.minX:r.minX,i=e.minY>r.minY?e.minY:r.minY,a=e.maxX<r.maxX?e.maxX:r.maxX,u=e.maxY<r.maxY?e.maxY:r.maxY;if(n<=a&&i<=u){const l=this.minX,h=this.minY,p=this.maxX,m=this.maxY;this.minX=n<l?n:l,this.minY=i<h?i:h,this.maxX=a>p?a:p,this.maxY=u>m?u:m}}addBoundsMatrix(e,r){this.addFrameMatrix(r,e.minX,e.minY,e.maxX,e.maxY)}addBoundsArea(e,r){const n=e.minX>r.x?e.minX:r.x,i=e.minY>r.y?e.minY:r.y,a=e.maxX<r.x+r.width?e.maxX:r.x+r.width,u=e.maxY<r.y+r.height?e.maxY:r.y+r.height;if(n<=a&&i<=u){const l=this.minX,h=this.minY,p=this.maxX,m=this.maxY;this.minX=n<l?n:l,this.minY=i<h?i:h,this.maxX=a>p?a:p,this.maxY=u>m?u:m}}pad(e=0,r=e){this.isEmpty()||(this.minX-=e,this.maxX+=e,this.minY-=r,this.maxY+=r)}addFramePad(e,r,n,i,a,u){e-=a,r-=u,n+=a,i+=u,this.minX=this.minX<e?this.minX:e,this.maxX=this.maxX>n?this.maxX:n,this.minY=this.minY<r?this.minY:r,this.maxY=this.maxY>i?this.maxY:i}}class Ni extends ma{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new Ol,this.alpha=1,this.visible=!0,this.renderable=!0,this.cullable=!1,this.cullArea=null,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new ec,this._localBounds=null,this._boundsID=0,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._maskRefCount=0,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}static mixin(e){const r=Object.keys(e);for(let n=0;n<r.length;++n){const i=r[n];Object.defineProperty(Ni.prototype,i,Object.getOwnPropertyDescriptor(e,i))}}get destroyed(){return this._destroyed}_recursivePostUpdateTransform(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)}updateTransform(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha}getBounds(e,r){return e||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._bounds.updateID!==this._boundsID&&(this.calculateBounds(),this._bounds.updateID=this._boundsID),r||(this._boundsRect||(this._boundsRect=new Qe),r=this._boundsRect),this._bounds.getRectangle(r)}getLocalBounds(e){e||(this._localBoundsRect||(this._localBoundsRect=new Qe),e=this._localBoundsRect),this._localBounds||(this._localBounds=new ec);const r=this.transform,n=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform;const i=this._bounds,a=this._boundsID;this._bounds=this._localBounds;const u=this.getBounds(!1,e);return this.parent=n,this.transform=r,this._bounds=i,this._bounds.updateID+=this._boundsID-a,u}toGlobal(e,r,n=!1){return n||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(e,r)}toLocal(e,r,n,i){return r&&(e=r.toGlobal(e,n,i)),i||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(e,n)}setParent(e){if(!e||!e.addChild)throw new Error("setParent: Argument must be a Container");return e.addChild(this),e}removeFromParent(){var e;(e=this.parent)==null||e.removeChild(this)}setTransform(e=0,r=0,n=1,i=1,a=0,u=0,l=0,h=0,p=0){return this.position.x=e,this.position.y=r,this.scale.x=n||1,this.scale.y=i||1,this.rotation=a,this.skew.x=u,this.skew.y=l,this.pivot.x=h,this.pivot.y=p,this}destroy(e){this.removeFromParent(),this._destroyed=!0,this.transform=null,this.parent=null,this._bounds=null,this.mask=null,this.cullArea=null,this.filters=null,this.filterArea=null,this.hitArea=null,this.eventMode="auto",this.interactiveChildren=!1,this.emit("destroyed"),this.removeAllListeners()}get _tempDisplayObjectParent(){return this.tempDisplayObjectParent===null&&(this.tempDisplayObjectParent=new eR),this.tempDisplayObjectParent}enableTempParent(){const e=this.parent;return this.parent=this._tempDisplayObjectParent,e}disableTempParent(e){this.parent=e}get x(){return this.position.x}set x(e){this.transform.position.x=e}get y(){return this.position.y}set y(e){this.transform.position.y=e}get worldTransform(){return this.transform.worldTransform}get localTransform(){return this.transform.localTransform}get position(){return this.transform.position}set position(e){this.transform.position.copyFrom(e)}get scale(){return this.transform.scale}set scale(e){this.transform.scale.copyFrom(e)}get pivot(){return this.transform.pivot}set pivot(e){this.transform.pivot.copyFrom(e)}get skew(){return this.transform.skew}set skew(e){this.transform.skew.copyFrom(e)}get rotation(){return this.transform.rotation}set rotation(e){this.transform.rotation=e}get angle(){return this.transform.rotation*gC}set angle(e){this.transform.rotation=e*ws}get zIndex(){return this._zIndex}set zIndex(e){this._zIndex=e,this.parent&&(this.parent.sortDirty=!0)}get worldVisible(){let e=this;do{if(!e.visible)return!1;e=e.parent}while(e);return!0}get mask(){return this._mask}set mask(e){if(this._mask!==e){if(this._mask){const r=this._mask.isMaskData?this._mask.maskObject:this._mask;r&&(r._maskRefCount--,r._maskRefCount===0&&(r.renderable=!0,r.isMask=!1))}if(this._mask=e,this._mask){const r=this._mask.isMaskData?this._mask.maskObject:this._mask;r&&(r._maskRefCount===0&&(r.renderable=!1,r.isMask=!0),r._maskRefCount++)}}}}class eR extends Ni{constructor(){super(...arguments),this.sortDirty=null}}Ni.prototype.displayObjectUpdateTransform=Ni.prototype.updateTransform;const tR=new kt;function rR(t,e){return t.zIndex===e.zIndex?t._lastSortedIndex-e._lastSortedIndex:t.zIndex-e.zIndex}const tc=class extends Ni{constructor(){super(),this.children=[],this.sortableChildren=tc.defaultSortableChildren,this.sortDirty=!1}onChildrenChange(t){}addChild(...t){if(t.length>1)for(let e=0;e<t.length;e++)this.addChild(t[e]);else{const e=t[0];e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.push(e),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",e,this,this.children.length-1),e.emit("added",this)}return t[0]}addChildAt(t,e){if(e<0||e>this.children.length)throw new Error(`${t}addChildAt: The index ${e} supplied is out of bounds ${this.children.length}`);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t}swapChildren(t,e){if(t===e)return;const r=this.getChildIndex(t),n=this.getChildIndex(e);this.children[r]=e,this.children[n]=t,this.onChildrenChange(r<n?r:n)}getChildIndex(t){const e=this.children.indexOf(t);if(e===-1)throw new Error("The supplied DisplayObject must be a child of the caller");return e}setChildIndex(t,e){if(e<0||e>=this.children.length)throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);const r=this.getChildIndex(t);Na(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)}getChildAt(t){if(t<0||t>=this.children.length)throw new Error(`getChildAt: Index (${t}) does not exist.`);return this.children[t]}removeChild(...t){if(t.length>1)for(let e=0;e<t.length;e++)this.removeChild(t[e]);else{const e=t[0],r=this.children.indexOf(e);if(r===-1)return null;e.parent=null,e.transform._parentID=-1,Na(this.children,r,1),this._boundsID++,this.onChildrenChange(r),e.emit("removed",this),this.emit("childRemoved",e,this,r)}return t[0]}removeChildAt(t){const e=this.getChildAt(t);return e.parent=null,e.transform._parentID=-1,Na(this.children,t,1),this._boundsID++,this.onChildrenChange(t),e.emit("removed",this),this.emit("childRemoved",e,this,t),e}removeChildren(t=0,e=this.children.length){const r=t,n=e,i=n-r;let a;if(i>0&&i<=n){a=this.children.splice(r,i);for(let u=0;u<a.length;++u)a[u].parent=null,a[u].transform&&(a[u].transform._parentID=-1);this._boundsID++,this.onChildrenChange(t);for(let u=0;u<a.length;++u)a[u].emit("removed",this),this.emit("childRemoved",a[u],this,u);return a}else if(i===0&&this.children.length===0)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")}sortChildren(){let t=!1;for(let e=0,r=this.children.length;e<r;++e){const n=this.children[e];n._lastSortedIndex=e,!t&&n.zIndex!==0&&(t=!0)}t&&this.children.length>1&&this.children.sort(rR),this.sortDirty=!1}updateTransform(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(let t=0,e=this.children.length;t<e;++t){const r=this.children[t];r.visible&&r.updateTransform()}}calculateBounds(){this._bounds.clear(),this._calculateBounds();for(let t=0;t<this.children.length;t++){const e=this.children[t];if(!(!e.visible||!e.renderable))if(e.calculateBounds(),e._mask){const r=e._mask.isMaskData?e._mask.maskObject:e._mask;r?(r.calculateBounds(),this._bounds.addBoundsMask(e._bounds,r._bounds)):this._bounds.addBounds(e._bounds)}else e.filterArea?this._bounds.addBoundsArea(e._bounds,e.filterArea):this._bounds.addBounds(e._bounds)}this._bounds.updateID=this._boundsID}getLocalBounds(t,e=!1){const r=super.getLocalBounds(t);if(!e)for(let n=0,i=this.children.length;n<i;++n){const a=this.children[n];a.visible&&a.updateTransform()}return r}_calculateBounds(){}_renderWithCulling(t){const e=t.renderTexture.sourceFrame;if(!(e.width>0&&e.height>0))return;let r,n;this.cullArea?(r=this.cullArea,n=this.worldTransform):this._render!==tc.prototype._render&&(r=this.getBounds(!0));const i=t.projection.transform;if(i&&(n?(n=tR.copyFrom(n),n.prepend(i)):n=i),r&&e.intersects(r,n))this._render(t);else if(this.cullArea)return;for(let a=0,u=this.children.length;a<u;++a){const l=this.children[a],h=l.cullable;l.cullable=h||!this.cullArea,l.render(t),l.cullable=h}}render(t){var e;if(!(!this.visible||this.worldAlpha<=0||!this.renderable))if(this._mask||(e=this.filters)!=null&&e.length)this.renderAdvanced(t);else if(this.cullable)this._renderWithCulling(t);else{this._render(t);for(let r=0,n=this.children.length;r<n;++r)this.children[r].render(t)}}renderAdvanced(t){var i,a,u;const e=this.filters,r=this._mask;if(e){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(let l=0;l<e.length;l++)e[l].enabled&&this._enabledFilters.push(e[l])}const n=e&&((i=this._enabledFilters)==null?void 0:i.length)||r&&(!r.isMaskData||r.enabled&&(r.autoDetect||r.type!==vt.NONE));if(n&&t.batch.flush(),e&&((a=this._enabledFilters)!=null&&a.length)&&t.filter.push(this,this._enabledFilters),r&&t.mask.push(this,this._mask),this.cullable)this._renderWithCulling(t);else{this._render(t);for(let l=0,h=this.children.length;l<h;++l)this.children[l].render(t)}n&&t.batch.flush(),r&&t.mask.pop(this),e&&((u=this._enabledFilters)!=null&&u.length)&&t.filter.pop()}_render(t){}destroy(t){super.destroy(),this.sortDirty=!1;const e=typeof t=="boolean"?t:t==null?void 0:t.children,r=this.removeChildren(0,this.children.length);if(e)for(let n=0;n<r.length;++n)r[n].destroy(t)}get width(){return this.scale.x*this.getLocalBounds().width}set width(t){const e=this.getLocalBounds().width;e!==0?this.scale.x=t/e:this.scale.x=1,this._width=t}get height(){return this.scale.y*this.getLocalBounds().height}set height(t){const e=this.getLocalBounds().height;e!==0?this.scale.y=t/e:this.scale.y=1,this._height=t}};let Li=tc;Li.defaultSortableChildren=!1,Li.prototype.containerUpdateTransform=Li.prototype.updateTransform,Object.defineProperties(Ie,{SORTABLE_CHILDREN:{get(){return Li.defaultSortableChildren},set(t){ke("7.1.0","settings.SORTABLE_CHILDREN is deprecated, use Container.defaultSortableChildren"),Li.defaultSortableChildren=t}}});class ao{constructor(e,r=null,n=null,i=null){this.points=[],this.holes=[],this.shape=e,this.lineStyle=n,this.fillStyle=r,this.matrix=i,this.type=e.type}clone(){return new ao(this.shape,this.fillStyle,this.lineStyle,this.matrix)}destroy(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null}}const ki=new et,kg=class extends dp{constructor(){super(),this.closePointEps=1e-4,this.boundsPadding=0,this.uvsFloat32=null,this.indicesUint16=null,this.batchable=!1,this.points=[],this.colors=[],this.uvs=[],this.indices=[],this.textureIds=[],this.graphicsData=[],this.drawCalls=[],this.batchDirty=-1,this.batches=[],this.dirty=0,this.cacheDirty=-1,this.clearDirty=0,this.shapeIndex=0,this._bounds=new ec,this.boundsDirty=-1}get bounds(){return this.updateBatches(),this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds}invalidate(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(let t=0;t<this.drawCalls.length;t++)this.drawCalls[t].texArray.clear(),so.push(this.drawCalls[t]);this.drawCalls.length=0;for(let t=0;t<this.batches.length;t++){const e=this.batches[t];e.reset(),Lg.push(e)}this.batches.length=0}clear(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(t,e=null,r=null,n=null){const i=new ao(t,e,r,n);return this.graphicsData.push(i),this.dirty++,this}drawHole(t,e=null){if(!this.graphicsData.length)return null;const r=new ao(t,null,null,e),n=this.graphicsData[this.graphicsData.length-1];return r.lineStyle=n.lineStyle,n.holes.push(r),this.dirty++,this}destroy(){super.destroy();for(let t=0;t<this.graphicsData.length;++t)this.graphicsData[t].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null}containsPoint(t){const e=this.graphicsData;for(let r=0;r<e.length;++r){const n=e[r];if(n.fillStyle.visible&&n.shape&&(n.matrix?n.matrix.applyInverse(t,ki):ki.copyFrom(t),n.shape.contains(ki.x,ki.y))){let i=!1;if(n.holes){for(let a=0;a<n.holes.length;a++)if(n.holes[a].shape.contains(ki.x,ki.y)){i=!0;break}}if(!i)return!0}}return!1}updateBatches(){if(!this.graphicsData.length){this.batchable=!0;return}if(!this.validateBatching())return;this.cacheDirty=this.dirty;const t=this.uvs,e=this.graphicsData;let r=null,n=null;this.batches.length>0&&(r=this.batches[this.batches.length-1],n=r.style);for(let l=this.shapeIndex;l<e.length;l++){this.shapeIndex++;const h=e[l],p=h.fillStyle,m=h.lineStyle;Jl[h.type].build(h),h.matrix&&this.transformPoints(h.points,h.matrix),(p.visible||m.visible)&&this.processHoles(h.holes);for(let d=0;d<2;d++){const g=d===0?p:m;if(!g.visible)continue;const v=g.texture.baseTexture,y=this.indices.length,b=this.points.length/2;v.wrapMode=hs.REPEAT,d===0?this.processFill(h):this.processLine(h);const x=this.points.length/2-b;x!==0&&(r&&!this._compareStyles(n,g)&&(r.end(y,b),r=null),r||(r=Lg.pop()||new ZI,r.begin(g,y,b),this.batches.push(r),n=g),this.addUvs(this.points,t,g.texture,b,x,g.matrix))}}const i=this.indices.length,a=this.points.length/2;if(r&&r.end(i,a),this.batches.length===0){this.batchable=!0;return}const u=a>65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&u===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=u?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}_compareStyles(t,e){return!(!t||!e||t.texture.baseTexture!==e.texture.baseTexture||t.color+t.alpha!==e.color+e.alpha||!!t.native!=!!e.native)}validateBatching(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(let t=0,e=this.graphicsData.length;t<e;t++){const r=this.graphicsData[t],n=r.fillStyle,i=r.lineStyle;if(n&&!n.texture.baseTexture.valid||i&&!i.texture.baseTexture.valid)return!1}return!0}packBatches(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);const t=this.batches;for(let e=0,r=t.length;e<r;e++){const n=t[e];for(let i=0;i<n.size;i++){const a=n.start+i;this.indicesUint16[a]=this.indicesUint16[a]-n.attribStart}}}isBatchable(){if(this.points.length>65535*2)return!1;const t=this.batches;for(let e=0;e<t.length;e++)if(t[e].style.native)return!1;return this.points.length<kg.BATCHABLE_SIZE*2}buildDrawCalls(){let t=++ze._globalBatch;for(let m=0;m<this.drawCalls.length;m++)this.drawCalls[m].texArray.clear(),so.push(this.drawCalls[m]);this.drawCalls.length=0;const e=this.colors,r=this.textureIds;let n=so.pop();n||(n=new Il,n.texArray=new Nl),n.texArray.count=0,n.start=0,n.size=0,n.type=cn.TRIANGLES;let i=0,a=null,u=0,l=!1,h=cn.TRIANGLES,p=0;this.drawCalls.push(n);for(let m=0;m<this.batches.length;m++){const c=this.batches[m],d=8,g=c.style,v=g.texture.baseTexture;l!==!!g.native&&(l=!!g.native,h=l?cn.LINES:cn.TRIANGLES,a=null,i=d,t++),a!==v&&(a=v,v._batchEnabled!==t&&(i===d&&(t++,i=0,n.size>0&&(n=so.pop(),n||(n=new Il,n.texArray=new Nl),this.drawCalls.push(n)),n.start=p,n.size=0,n.texArray.count=0,n.type=h),v.touched=1,v._batchEnabled=t,v._batchLocation=i,v.wrapMode=hs.REPEAT,n.texArray.elements[n.texArray.count++]=v,i++)),n.size+=c.size,p+=c.size,u=v._batchLocation,this.addColors(e,g.color,g.alpha,c.attribSize,c.attribStart),this.addTextureIds(r,u,c.attribSize,c.attribStart)}ze._globalBatch=t,this.packAttributes()}packAttributes(){const t=this.points,e=this.uvs,r=this.colors,n=this.textureIds,i=new ArrayBuffer(t.length*3*4),a=new Float32Array(i),u=new Uint32Array(i);let l=0;for(let h=0;h<t.length/2;h++)a[l++]=t[h*2],a[l++]=t[h*2+1],a[l++]=e[h*2],a[l++]=e[h*2+1],u[l++]=r[h],a[l++]=n[h];this._buffer.update(i),this._indexBuffer.update(this.indicesUint16)}processFill(t){t.holes.length?Mg.triangulate(t,this):Jl[t.type].triangulate(t,this)}processLine(t){Ng(t,this);for(let e=0;e<t.holes.length;e++)Ng(t.holes[e],this)}processHoles(t){for(let e=0;e<t.length;e++){const r=t[e];Jl[r.type].build(r),r.matrix&&this.transformPoints(r.points,r.matrix)}}calculateBounds(){const t=this._bounds;t.clear(),t.addVertexData(this.points,0,this.points.length),t.pad(this.boundsPadding,this.boundsPadding)}transformPoints(t,e){for(let r=0;r<t.length/2;r++){const n=t[r*2],i=t[r*2+1];t[r*2]=e.a*n+e.c*i+e.tx,t[r*2+1]=e.b*n+e.d*i+e.ty}}addColors(t,e,r,n,i=0){const a=Ot.shared.setValue(e).toLittleEndianNumber(),u=Ot.shared.setValue(a).toPremultiplied(r);t.length=Math.max(t.length,i+n);for(let l=0;l<n;l++)t[i+l]=u}addTextureIds(t,e,r,n=0){t.length=Math.max(t.length,n+r);for(let i=0;i<r;i++)t[n+i]=e}addUvs(t,e,r,n,i,a=null){let u=0;const l=e.length,h=r.frame;for(;u<i;){let m=t[(n+u)*2],c=t[(n+u)*2+1];if(a){const d=a.a*m+a.c*c+a.tx;c=a.b*m+a.d*c+a.ty,m=d}u++,e.push(m/h.width,c/h.height)}const p=r.baseTexture;(h.width<p.width||h.height<p.height)&&this.adjustUvs(e,r,l,i)}adjustUvs(t,e,r,n){const i=e.baseTexture,a=1e-6,u=r+n*2,l=e.frame,h=l.width/i.width,p=l.height/i.height;let m=l.x/l.width,c=l.y/l.height,d=Math.floor(t[r]+a),g=Math.floor(t[r+1]+a);for(let v=r+2;v<u;v+=2)d=Math.min(d,Math.floor(t[v]+a)),g=Math.min(g,Math.floor(t[v+1]+a));m-=d,c-=g;for(let v=r;v<u;v+=2)t[v]=(t[v]+m)*h,t[v+1]=(t[v+1]+c)*p}};let Dg=kg;Dg.BATCHABLE_SIZE=100;class oo{constructor(){this.color=16777215,this.alpha=1,this.texture=Be.WHITE,this.matrix=null,this.visible=!1,this.reset()}clone(){const e=new oo;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e}reset(){this.color=16777215,this.alpha=1,this.texture=Be.WHITE,this.matrix=null,this.visible=!1}destroy(){this.texture=null,this.matrix=null}}class rc extends oo{constructor(){super(...arguments),this.width=0,this.alignment=.5,this.native=!1,this.cap=jn.BUTT,this.join=Ar.MITER,this.miterLimit=10}clone(){const e=new rc;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e.width=this.width,e.alignment=this.alignment,e.native=this.native,e.cap=this.cap,e.join=this.join,e.miterLimit=this.miterLimit,e}reset(){super.reset(),this.color=0,this.alignment=.5,this.width=0,this.native=!1}}const nc={},uo=class extends Li{constructor(t=null){super(),this.shader=null,this.pluginName="batch",this.currentPath=null,this.batches=[],this.batchTint=-1,this.batchDirty=-1,this.vertexData=null,this._fillStyle=new oo,this._lineStyle=new rc,this._matrix=null,this._holeMode=!1,this.state=ka.for2d(),this._geometry=t||new Dg,this._geometry.refCount++,this._transformID=-1,this._tintColor=new Ot(16777215),this.blendMode=de.NORMAL}get geometry(){return this._geometry}clone(){return this.finishPoly(),new uo(this._geometry)}set blendMode(t){this.state.blendMode=t}get blendMode(){return this.state.blendMode}get tint(){return this._tintColor.value}set tint(t){this._tintColor.setValue(t)}get fill(){return this._fillStyle}get line(){return this._lineStyle}lineStyle(t=null,e=0,r,n=.5,i=!1){return typeof t=="number"&&(t={width:t,color:e,alpha:r,alignment:n,native:i}),this.lineTextureStyle(t)}lineTextureStyle(t){const e={width:0,texture:Be.WHITE,color:t!=null&&t.texture?16777215:0,matrix:null,alignment:.5,native:!1,cap:jn.BUTT,join:Ar.MITER,miterLimit:10};t=Object.assign(e,t),this.normalizeColor(t),this.currentPath&&this.startPoly();const r=t.width>0&&t.alpha>0;return r?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:r},t)):this._lineStyle.reset(),this}startPoly(){if(this.currentPath){const t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new Ss,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new Ss,this.currentPath.closeStroke=!1}finishPoly(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)}moveTo(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this}lineTo(t,e){this.currentPath||this.moveTo(0,0);const r=this.currentPath.points,n=r[r.length-2],i=r[r.length-1];return(n!==t||i!==e)&&r.push(t,e),this}_initCurve(t=0,e=0){this.currentPath?this.currentPath.points.length===0&&(this.currentPath.points=[t,e]):this.moveTo(t,e)}quadraticCurveTo(t,e,r,n){this._initCurve();const i=this.currentPath.points;return i.length===0&&this.moveTo(0,0),Ql.curveTo(t,e,r,n,i),this}bezierCurveTo(t,e,r,n,i,a){return this._initCurve(),Zl.curveTo(t,e,r,n,i,a,this.currentPath.points),this}arcTo(t,e,r,n,i){this._initCurve(t,e);const a=this.currentPath.points,u=Og.curveTo(t,e,r,n,i,a);if(u){const{cx:l,cy:h,radius:p,startAngle:m,endAngle:c,anticlockwise:d}=u;this.arc(l,h,p,m,c,d)}return this}arc(t,e,r,n,i,a=!1){if(n===i)return this;if(!a&&i<=n?i+=Ba:a&&n<=i&&(n+=Ba),i-n===0)return this;const l=t+Math.cos(n)*r,h=e+Math.sin(n)*r,p=this._geometry.closePointEps;let m=this.currentPath?this.currentPath.points:null;if(m){const c=Math.abs(m[m.length-2]-l),d=Math.abs(m[m.length-1]-h);c<p&&d<p||m.push(l,h)}else this.moveTo(l,h),m=this.currentPath.points;return Og.arc(l,h,t,e,r,n,i,a,m),this}beginFill(t=0,e){return this.beginTextureFill({texture:Be.WHITE,color:t,alpha:e})}normalizeColor(t){const e=Ot.shared.setValue(t.color??0);t.color=e.toNumber(),t.alpha??(t.alpha=e.alpha)}beginTextureFill(t){const e={texture:Be.WHITE,color:16777215,matrix:null};t=Object.assign(e,t),this.normalizeColor(t),this.currentPath&&this.startPoly();const r=t.alpha>0;return r?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:r},t)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(t,e,r,n){return this.drawShape(new Qe(t,e,r,n))}drawRoundedRect(t,e,r,n,i){return this.drawShape(new Pl(t,e,r,n,i))}drawCircle(t,e,r){return this.drawShape(new Rl(t,e,r))}drawEllipse(t,e,r,n){return this.drawShape(new mC(t,e,r,n))}drawPolygon(...t){let e,r=!0;const n=t[0];n.points?(r=n.closeStroke,e=n.points):Array.isArray(t[0])?e=t[0]:e=t;const i=new Ss(e);return i.closeStroke=r,this.drawShape(i),this}drawShape(t){return this._holeMode?this._geometry.drawHole(t,this._matrix):this._geometry.drawShape(t,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this}clear(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this}isFastRect(){const t=this._geometry.graphicsData;return t.length===1&&t[0].shape.type===Ct.RECT&&!t[0].matrix&&!t[0].holes.length&&!(t[0].lineStyle.visible&&t[0].lineStyle.width)}_render(t){this.finishPoly();const e=this._geometry;e.updateBatches(),e.batchable?(this.batchDirty!==e.batchDirty&&this._populateBatches(),this._renderBatched(t)):(t.batch.flush(),this._renderDirect(t))}_populateBatches(){const t=this._geometry,e=this.blendMode,r=t.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=t.batchDirty,this.batches.length=r,this.vertexData=new Float32Array(t.points);for(let n=0;n<r;n++){const i=t.batches[n],a=i.style.color,u=new Float32Array(this.vertexData.buffer,i.attribStart*4*2,i.attribSize*2),l=new Float32Array(t.uvsFloat32.buffer,i.attribStart*4*2,i.attribSize*2),h=new Uint16Array(t.indicesUint16.buffer,i.start*2,i.size),p={vertexData:u,blendMode:e,indices:h,uvs:l,_batchRGB:Ot.shared.setValue(a).toRgbArray(),_tintRGB:a,_texture:i.style.texture,alpha:i.style.alpha,worldAlpha:1};this.batches[n]=p}}_renderBatched(t){if(this.batches.length){t.batch.setObjectRenderer(t.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(let e=0,r=this.batches.length;e<r;e++){const n=this.batches[e];n.worldAlpha=this.worldAlpha*n.alpha,t.plugins[this.pluginName].render(n)}}}_renderDirect(t){const e=this._resolveDirectShader(t),r=this._geometry,n=this.worldAlpha,i=e.uniforms,a=r.drawCalls;i.translationMatrix=this.transform.worldTransform,Ot.shared.setValue(this._tintColor).premultiply(n).toArray(i.tint),t.shader.bind(e),t.geometry.bind(r,e),t.state.set(this.state);for(let u=0,l=a.length;u<l;u++)this._renderDrawCallDirect(t,r.drawCalls[u])}_renderDrawCallDirect(t,e){const{texArray:r,type:n,size:i,start:a}=e,u=r.count;for(let l=0;l<u;l++)t.texture.bind(r.elements[l],l);t.geometry.draw(n,i,a)}_resolveDirectShader(t){let e=this.shader;const r=this.pluginName;if(!e){if(!nc[r]){const{maxTextures:n}=t.plugins[r],i=new Int32Array(n);for(let l=0;l<n;l++)i[l]=l;const a={tint:new Float32Array([1,1,1,1]),translationMatrix:new kt,default:xr.from({uSamplers:i},!0)},u=t.plugins[r]._shader.program;nc[r]=new Es(u,a)}e=nc[r]}return e}_calculateBounds(){this.finishPoly();const t=this._geometry;if(!t.graphicsData.length)return;const{minX:e,minY:r,maxX:n,maxY:i}=t.bounds;this._bounds.addFrame(this.transform,e,r,n,i)}containsPoint(t){return this.worldTransform.applyInverse(t,uo._TEMP_POINT),this._geometry.containsPoint(uo._TEMP_POINT)}calculateTints(){if(this.batchTint!==this.tint){this.batchTint=this._tintColor.toNumber();for(let t=0;t<this.batches.length;t++){const e=this.batches[t];e._tintRGB=Ot.shared.setValue(this._tintColor).multiply(e._batchRGB).toLittleEndianNumber()}}}calculateVertices(){const t=this.transform._worldID;if(this._transformID===t)return;this._transformID=t;const e=this.transform.worldTransform,r=e.a,n=e.b,i=e.c,a=e.d,u=e.tx,l=e.ty,h=this._geometry.points,p=this.vertexData;let m=0;for(let c=0;c<h.length;c+=2){const d=h[c],g=h[c+1];p[m++]=r*d+i*g+u,p[m++]=a*g+n*d+l}}closePath(){const t=this.currentPath;return t&&(t.closeStroke=!0,this.finishPoly()),this}setMatrix(t){return this._matrix=t,this}beginHole(){return this.finishPoly(),this._holeMode=!0,this}endHole(){return this.finishPoly(),this._holeMode=!1,this}destroy(t){this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this._geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,super.destroy(t)}};let ic=uo;ic.curves=Fi,ic._TEMP_POINT=new et;var nR=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},sc={},iR={get exports(){return sc},set exports(t){sc=t}};/*!
|
|
1961
|
+
`);return r.uniforms.vignetteColor=[0,0,0,1],r.uniforms.vignetteSize=.7,r.uniforms.vignetteStrength=.6,{nightVisionFilter:t,vignetteFilter:r}},Kh=D.forwardRef((t,e)=>{const r=P.useRef(null),i=P.useRef(null),{src:n,visible:s,disabled:a,transformation:{x:o,y:u,width:c,height:f,anchor:l,colorCorrection:h={},effect:d},pointerdown:p}=t,{blurRadius:m=0,vignette:_=0,noise:g=0}=h,{temperatureFilter:y,sharpnessFilter:v,hueFilter:x,blurFilter:T,adjustmentFilter:b,vignetteFilter:w,noiseFilter:S}=ir(h),{nightVisionFilter:A}=VT();return D.useEffect(()=>()=>{console.log("PixiImageSprite unmounting")},[]),Y.jsx(jt,{...t,ref:e,children:Y.jsx(ie.Container,{ref:i,children:Y.jsx(ie.Sprite,{image:n,width:c,height:f,anchor:l,ref:r,alpha:s?1:0,x:o,y:u,...!a&&s&&{interactive:!0,pointerdown:p},filters:[y,v,x,b,...m>0?[T]:[],...d===Gt.NightVision?[A]:[],..._>0?[w]:[],...g>0?[S]:[]]})})})});Kh.whyDidYouRender={logOnDifferentValues:!0,customName:"ImageSprite"};const kn={build(t){const e=t.points;let r,i,n,s,a,o;if(t.type===Ne.CIRC){const p=t.shape;r=p.x,i=p.y,a=o=p.radius,n=s=0}else if(t.type===Ne.ELIP){const p=t.shape;r=p.x,i=p.y,a=p.width,o=p.height,n=s=0}else{const p=t.shape,m=p.width/2,_=p.height/2;r=p.x+m,i=p.y+_,a=o=Math.max(0,Math.min(p.radius,Math.min(m,_))),n=m-a,s=_-o}if(!(a>=0&&o>=0&&n>=0&&s>=0)){e.length=0;return}const u=Math.ceil(2.3*Math.sqrt(a+o)),c=u*8+(n?4:0)+(s?4:0);if(e.length=c,c===0)return;if(u===0){e.length=8,e[0]=e[6]=r+n,e[1]=e[3]=i+s,e[2]=e[4]=r-n,e[5]=e[7]=i-s;return}let f=0,l=u*4+(n?2:0)+2,h=l,d=c;{const p=n+a,m=s,_=r+p,g=r-p,y=i+m;if(e[f++]=_,e[f++]=y,e[--l]=y,e[--l]=g,s){const v=i-m;e[h++]=g,e[h++]=v,e[--d]=v,e[--d]=_}}for(let p=1;p<u;p++){const m=Math.PI/2*(p/u),_=n+Math.cos(m)*a,g=s+Math.sin(m)*o,y=r+_,v=r-_,x=i+g,T=i-g;e[f++]=y,e[f++]=x,e[--l]=x,e[--l]=v,e[h++]=v,e[h++]=T,e[--d]=T,e[--d]=y}{const p=n,m=s+o,_=r+p,g=r-p,y=i+m,v=i-m;e[f++]=_,e[f++]=y,e[--d]=v,e[--d]=_,n&&(e[f++]=g,e[f++]=y,e[--d]=v,e[--d]=g)}},triangulate(t,e){const r=t.points,i=e.points,n=e.indices;if(r.length===0)return;let s=i.length/2;const a=s;let o,u;if(t.type!==Ne.RREC){const f=t.shape;o=f.x,u=f.y}else{const f=t.shape;o=f.x+f.width/2,u=f.y+f.height/2}const c=t.matrix;i.push(t.matrix?c.a*o+c.c*u+c.tx:o,t.matrix?c.b*o+c.d*u+c.ty:u),s++,i.push(r[0],r[1]);for(let f=2;f<r.length;f+=2)i.push(r[f],r[f+1]),n.push(s++,a,s);n.push(a+1,a,s)}};function Zh(t,e=!1){const r=t.length;if(r<6)return;let i=0;for(let n=0,s=t[r-2],a=t[r-1];n<r;n+=2){const o=t[n],u=t[n+1];i+=(o-s)*(u+a),s=o,a=u}if(!e&&i>0||e&&i<=0){const n=r/2;for(let s=n+n%2;s<r;s+=2){const a=r-s-2,o=r-s-1,u=s,c=s+1;[t[a],t[u]]=[t[u],t[a]],[t[o],t[c]]=[t[c],t[o]]}}}const Qh={build(t){t.points=t.shape.points.slice()},triangulate(t,e){let r=t.points;const i=t.holes,n=e.points,s=e.indices;if(r.length>=6){Zh(r,!1);const a=[];for(let c=0;c<i.length;c++){const f=i[c];Zh(f.points,!0),a.push(r.length/2),r=r.concat(f.points)}const o=Rv(r,a,2);if(!o)return;const u=n.length/2;for(let c=0;c<o.length;c+=3)s.push(o[c]+u),s.push(o[c+1]+u),s.push(o[c+2]+u);for(let c=0;c<r.length;c++)n.push(r[c])}}},XT={build(t){const e=t.shape,r=e.x,i=e.y,n=e.width,s=e.height,a=t.points;a.length=0,n>=0&&s>=0&&a.push(r,i,r+n,i,r+n,i+s,r,i+s)},triangulate(t,e){const r=t.points,i=e.points;if(r.length===0)return;const n=i.length/2;i.push(r[0],r[1],r[2],r[3],r[6],r[7],r[4],r[5]),e.indices.push(n,n+1,n+2,n+1,n+2,n+3)}},WT={build(t){kn.build(t)},triangulate(t,e){kn.triangulate(t,e)}};var lt=(t=>(t.MITER="miter",t.BEVEL="bevel",t.ROUND="round",t))(lt||{}),nr=(t=>(t.BUTT="butt",t.ROUND="round",t.SQUARE="square",t))(nr||{});const Dr={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(t,e=20){if(!this.adaptive||!t||isNaN(t))return e;let r=Math.ceil(t/this.maxLength);return r<this.minSegments?r=this.minSegments:r>this.maxSegments&&(r=this.maxSegments),r}};class Jh{static curveTo(e,r,i,n,s,a){const o=a[a.length-2],c=a[a.length-1]-r,f=o-e,l=n-r,h=i-e,d=Math.abs(c*h-f*l);if(d<1e-8||s===0)return(a[a.length-2]!==e||a[a.length-1]!==r)&&a.push(e,r),null;const p=c*c+f*f,m=l*l+h*h,_=c*l+f*h,g=s*Math.sqrt(p)/d,y=s*Math.sqrt(m)/d,v=g*_/p,x=y*_/m,T=g*h+y*f,b=g*l+y*c,w=f*(y+v),S=c*(y+v),A=h*(g+x),C=l*(g+x),F=Math.atan2(S-b,w-T),G=Math.atan2(C-b,A-T);return{cx:T+e,cy:b+r,radius:s,startAngle:F,endAngle:G,anticlockwise:f*l>h*c}}static arc(e,r,i,n,s,a,o,u,c){const f=o-a,l=Dr._segmentsCount(Math.abs(f)*s,Math.ceil(Math.abs(f)/gn)*40),h=f/(l*2),d=h*2,p=Math.cos(h),m=Math.sin(h),_=l-1,g=_%1/_;for(let y=0;y<=_;++y){const v=y+g*y,x=h+a+d*v,T=Math.cos(x),b=-Math.sin(x);c.push((p*T+m*b)*s+i,(p*-b+m*T)*s+n)}}}class qT{constructor(){this.reset()}begin(e,r,i){this.reset(),this.style=e,this.start=r,this.attribStart=i}end(e,r){this.attribSize=r-this.attribStart,this.size=e-this.start}reset(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0}}class Ua{static curveLength(e,r,i,n,s,a,o,u){let f=0,l=0,h=0,d=0,p=0,m=0,_=0,g=0,y=0,v=0,x=0,T=e,b=r;for(let w=1;w<=10;++w)l=w/10,h=l*l,d=h*l,p=1-l,m=p*p,_=m*p,g=_*e+3*m*l*i+3*p*h*s+d*o,y=_*r+3*m*l*n+3*p*h*a+d*u,v=T-g,x=b-y,T=g,b=y,f+=Math.sqrt(v*v+x*x);return f}static curveTo(e,r,i,n,s,a,o){const u=o[o.length-2],c=o[o.length-1];o.length-=2;const f=Dr._segmentsCount(Ua.curveLength(u,c,e,r,i,n,s,a));let l=0,h=0,d=0,p=0,m=0;o.push(u,c);for(let _=1,g=0;_<=f;++_)g=_/f,l=1-g,h=l*l,d=h*l,p=g*g,m=p*g,o.push(d*u+3*h*g*e+3*l*p*i+m*s,d*c+3*h*g*r+3*l*p*n+m*a)}}function ec(t,e,r,i,n,s,a,o){const u=t-r*n,c=e-i*n,f=t+r*s,l=e+i*s;let h,d;a?(h=i,d=-r):(h=-i,d=r);const p=u+h,m=c+d,_=f+h,g=l+d;return o.push(p,m,_,g),2}function sr(t,e,r,i,n,s,a,o){const u=r-t,c=i-e;let f=Math.atan2(u,c),l=Math.atan2(n-t,s-e);o&&f<l?f+=Math.PI*2:!o&&f>l&&(l+=Math.PI*2);let h=f;const d=l-f,p=Math.abs(d),m=Math.sqrt(u*u+c*c),_=(15*p*Math.sqrt(m)/Math.PI>>0)+1,g=d/_;if(h+=g,o){a.push(t,e,r,i);for(let y=1,v=h;y<_;y++,v+=g)a.push(t,e,t+Math.sin(v)*m,e+Math.cos(v)*m);a.push(t,e,n,s)}else{a.push(r,i,t,e);for(let y=1,v=h;y<_;y++,v+=g)a.push(t+Math.sin(v)*m,e+Math.cos(v)*m,t,e);a.push(n,s,t,e)}return _*2}function YT(t,e){const r=t.shape;let i=t.points||r.points.slice();const n=e.closePointEps;if(i.length===0)return;const s=t.lineStyle,a=new me(i[0],i[1]),o=new me(i[i.length-2],i[i.length-1]),u=r.type!==Ne.POLY||r.closeStroke,c=Math.abs(a.x-o.x)<n&&Math.abs(a.y-o.y)<n;if(u){i=i.slice(),c&&(i.pop(),i.pop(),o.set(i[i.length-2],i[i.length-1]));const I=(a.x+o.x)*.5,$=(o.y+a.y)*.5;i.unshift(I,$),i.push(I,$)}const f=e.points,l=i.length/2;let h=i.length;const d=f.length/2,p=s.width/2,m=p*p,_=s.miterLimit*s.miterLimit;let g=i[0],y=i[1],v=i[2],x=i[3],T=0,b=0,w=-(y-x),S=g-v,A=0,C=0,F=Math.sqrt(w*w+S*S);w/=F,S/=F,w*=p,S*=p;const G=s.alignment,R=(1-G)*2,E=G*2;u||(s.cap===nr.ROUND?h+=sr(g-w*(R-E)*.5,y-S*(R-E)*.5,g-w*R,y-S*R,g+w*E,y+S*E,f,!0)+2:s.cap===nr.SQUARE&&(h+=ec(g,y,w,S,R,E,!0,f))),f.push(g-w*R,y-S*R,g+w*E,y+S*E);for(let I=1;I<l-1;++I){g=i[(I-1)*2],y=i[(I-1)*2+1],v=i[I*2],x=i[I*2+1],T=i[(I+1)*2],b=i[(I+1)*2+1],w=-(y-x),S=g-v,F=Math.sqrt(w*w+S*S),w/=F,S/=F,w*=p,S*=p,A=-(x-b),C=v-T,F=Math.sqrt(A*A+C*C),A/=F,C/=F,A*=p,C*=p;const $=v-g,X=y-x,M=v-T,O=b-x,j=$*M+X*O,H=X*M-O*$,W=H<0;if(Math.abs(H)<.001*Math.abs(j)){f.push(v-w*R,x-S*R,v+w*E,x+S*E),j>=0&&(s.join===lt.ROUND?h+=sr(v,x,v-w*R,x-S*R,v-A*R,x-C*R,f,!1)+4:h+=2,f.push(v-A*E,x-C*E,v+A*R,x+C*R));continue}const Q=(-w+g)*(-S+x)-(-w+v)*(-S+y),V=(-A+T)*(-C+x)-(-A+v)*(-C+b),J=($*V-M*Q)/H,de=(O*Q-X*V)/H,ge=(J-v)*(J-v)+(de-x)*(de-x),Z=v+(J-v)*R,le=x+(de-x)*R,se=v-(J-v)*E,we=x-(de-x)*E,ze=Math.min($*$+X*X,M*M+O*O),je=W?R:E,At=ze+je*je*m,ee=ge<=At;let fe=s.join;if(fe===lt.MITER&&ge/m>_&&(fe=lt.BEVEL),ee)switch(fe){case lt.MITER:{f.push(Z,le,se,we);break}case lt.BEVEL:{W?f.push(Z,le,v+w*E,x+S*E,Z,le,v+A*E,x+C*E):f.push(v-w*R,x-S*R,se,we,v-A*R,x-C*R,se,we),h+=2;break}case lt.ROUND:{W?(f.push(Z,le,v+w*E,x+S*E),h+=sr(v,x,v+w*E,x+S*E,v+A*E,x+C*E,f,!0)+4,f.push(Z,le,v+A*E,x+C*E)):(f.push(v-w*R,x-S*R,se,we),h+=sr(v,x,v-w*R,x-S*R,v-A*R,x-C*R,f,!1)+4,f.push(v-A*R,x-C*R,se,we));break}}else{switch(f.push(v-w*R,x-S*R,v+w*E,x+S*E),fe){case lt.MITER:{W?f.push(se,we,se,we):f.push(Z,le,Z,le),h+=2;break}case lt.ROUND:{W?h+=sr(v,x,v+w*E,x+S*E,v+A*E,x+C*E,f,!0)+2:h+=sr(v,x,v-w*R,x-S*R,v-A*R,x-C*R,f,!1)+2;break}}f.push(v-A*R,x-C*R,v+A*E,x+C*E),h+=2}}g=i[(l-2)*2],y=i[(l-2)*2+1],v=i[(l-1)*2],x=i[(l-1)*2+1],w=-(y-x),S=g-v,F=Math.sqrt(w*w+S*S),w/=F,S/=F,w*=p,S*=p,f.push(v-w*R,x-S*R,v+w*E,x+S*E),u||(s.cap===nr.ROUND?h+=sr(v-w*(R-E)*.5,x-S*(R-E)*.5,v-w*R,x-S*R,v+w*E,x+S*E,f,!1)+2:s.cap===nr.SQUARE&&(h+=ec(v,x,w,S,R,E,!1,f)));const B=e.indices,U=Dr.epsilon*Dr.epsilon;for(let I=d;I<h+d-2;++I)g=f[I*2],y=f[I*2+1],v=f[(I+1)*2],x=f[(I+1)*2+1],T=f[(I+2)*2],b=f[(I+2)*2+1],!(Math.abs(g*(x-b)+v*(b-y)+T*(y-x))<U)&&B.push(I,I+1,I+2)}function KT(t,e){let r=0;const i=t.shape,n=t.points||i.points,s=i.type!==Ne.POLY||i.closeStroke;if(n.length===0)return;const a=e.points,o=e.indices,u=n.length/2,c=a.length/2;let f=c;for(a.push(n[0],n[1]),r=1;r<u;r++)a.push(n[r*2],n[r*2+1]),o.push(f,f+1),f++;s&&o.push(f,c)}function tc(t,e){t.lineStyle.native?KT(t,e):YT(t,e)}class $a{static curveLength(e,r,i,n,s,a){const o=e-2*i+s,u=r-2*n+a,c=2*i-2*e,f=2*n-2*r,l=4*(o*o+u*u),h=4*(o*c+u*f),d=c*c+f*f,p=2*Math.sqrt(l+h+d),m=Math.sqrt(l),_=2*l*m,g=2*Math.sqrt(d),y=h/m;return(_*p+m*h*(p-g)+(4*d*l-h*h)*Math.log((2*m+y+p)/(y+g)))/(4*_)}static curveTo(e,r,i,n,s){const a=s[s.length-2],o=s[s.length-1],u=Dr._segmentsCount($a.curveLength(a,o,e,r,i,n));let c=0,f=0;for(let l=1;l<=u;++l){const h=l/u;c=a+(e-a)*h,f=o+(r-o)*h,s.push(c+(e+(i-e)*h-c)*h,f+(r+(n-r)*h-f)*h)}}}const Ga={[Ne.POLY]:Qh,[Ne.CIRC]:kn,[Ne.ELIP]:kn,[Ne.RECT]:XT,[Ne.RREC]:WT},rc=[],Dn=[];class Ln{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}clear(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}getRectangle(e){return this.minX>this.maxX||this.minY>this.maxY?pe.EMPTY:(e=e||new pe(0,0,1,1),e.x=this.minX,e.y=this.minY,e.width=this.maxX-this.minX,e.height=this.maxY-this.minY,e)}addPoint(e){this.minX=Math.min(this.minX,e.x),this.maxX=Math.max(this.maxX,e.x),this.minY=Math.min(this.minY,e.y),this.maxY=Math.max(this.maxY,e.y)}addPointMatrix(e,r){const{a:i,b:n,c:s,d:a,tx:o,ty:u}=e,c=i*r.x+s*r.y+o,f=n*r.x+a*r.y+u;this.minX=Math.min(this.minX,c),this.maxX=Math.max(this.maxX,c),this.minY=Math.min(this.minY,f),this.maxY=Math.max(this.maxY,f)}addQuad(e){let r=this.minX,i=this.minY,n=this.maxX,s=this.maxY,a=e[0],o=e[1];r=a<r?a:r,i=o<i?o:i,n=a>n?a:n,s=o>s?o:s,a=e[2],o=e[3],r=a<r?a:r,i=o<i?o:i,n=a>n?a:n,s=o>s?o:s,a=e[4],o=e[5],r=a<r?a:r,i=o<i?o:i,n=a>n?a:n,s=o>s?o:s,a=e[6],o=e[7],r=a<r?a:r,i=o<i?o:i,n=a>n?a:n,s=o>s?o:s,this.minX=r,this.minY=i,this.maxX=n,this.maxY=s}addFrame(e,r,i,n,s){this.addFrameMatrix(e.worldTransform,r,i,n,s)}addFrameMatrix(e,r,i,n,s){const a=e.a,o=e.b,u=e.c,c=e.d,f=e.tx,l=e.ty;let h=this.minX,d=this.minY,p=this.maxX,m=this.maxY,_=a*r+u*i+f,g=o*r+c*i+l;h=_<h?_:h,d=g<d?g:d,p=_>p?_:p,m=g>m?g:m,_=a*n+u*i+f,g=o*n+c*i+l,h=_<h?_:h,d=g<d?g:d,p=_>p?_:p,m=g>m?g:m,_=a*r+u*s+f,g=o*r+c*s+l,h=_<h?_:h,d=g<d?g:d,p=_>p?_:p,m=g>m?g:m,_=a*n+u*s+f,g=o*n+c*s+l,h=_<h?_:h,d=g<d?g:d,p=_>p?_:p,m=g>m?g:m,this.minX=h,this.minY=d,this.maxX=p,this.maxY=m}addVertexData(e,r,i){let n=this.minX,s=this.minY,a=this.maxX,o=this.maxY;for(let u=r;u<i;u+=2){const c=e[u],f=e[u+1];n=c<n?c:n,s=f<s?f:s,a=c>a?c:a,o=f>o?f:o}this.minX=n,this.minY=s,this.maxX=a,this.maxY=o}addVertices(e,r,i,n){this.addVerticesMatrix(e.worldTransform,r,i,n)}addVerticesMatrix(e,r,i,n,s=0,a=s){const o=e.a,u=e.b,c=e.c,f=e.d,l=e.tx,h=e.ty;let d=this.minX,p=this.minY,m=this.maxX,_=this.maxY;for(let g=i;g<n;g+=2){const y=r[g],v=r[g+1],x=o*y+c*v+l,T=f*v+u*y+h;d=Math.min(d,x-s),m=Math.max(m,x+s),p=Math.min(p,T-a),_=Math.max(_,T+a)}this.minX=d,this.minY=p,this.maxX=m,this.maxY=_}addBounds(e){const r=this.minX,i=this.minY,n=this.maxX,s=this.maxY;this.minX=e.minX<r?e.minX:r,this.minY=e.minY<i?e.minY:i,this.maxX=e.maxX>n?e.maxX:n,this.maxY=e.maxY>s?e.maxY:s}addBoundsMask(e,r){const i=e.minX>r.minX?e.minX:r.minX,n=e.minY>r.minY?e.minY:r.minY,s=e.maxX<r.maxX?e.maxX:r.maxX,a=e.maxY<r.maxY?e.maxY:r.maxY;if(i<=s&&n<=a){const o=this.minX,u=this.minY,c=this.maxX,f=this.maxY;this.minX=i<o?i:o,this.minY=n<u?n:u,this.maxX=s>c?s:c,this.maxY=a>f?a:f}}addBoundsMatrix(e,r){this.addFrameMatrix(r,e.minX,e.minY,e.maxX,e.maxY)}addBoundsArea(e,r){const i=e.minX>r.x?e.minX:r.x,n=e.minY>r.y?e.minY:r.y,s=e.maxX<r.x+r.width?e.maxX:r.x+r.width,a=e.maxY<r.y+r.height?e.maxY:r.y+r.height;if(i<=s&&n<=a){const o=this.minX,u=this.minY,c=this.maxX,f=this.maxY;this.minX=i<o?i:o,this.minY=n<u?n:u,this.maxX=s>c?s:c,this.maxY=a>f?a:f}}pad(e=0,r=e){this.isEmpty()||(this.minX-=e,this.maxX+=e,this.minY-=r,this.maxY+=r)}addFramePad(e,r,i,n,s,a){e-=s,r-=a,i+=s,n+=a,this.minX=this.minX<e?this.minX:e,this.maxX=this.maxX>i?this.maxX:i,this.minY=this.minY<r?this.minY:r,this.maxY=this.maxY>n?this.maxY:n}}class Lr extends Xi{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new xa,this.alpha=1,this.visible=!0,this.renderable=!0,this.cullable=!1,this.cullArea=null,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Ln,this._localBounds=null,this._boundsID=0,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._maskRefCount=0,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}static mixin(e){const r=Object.keys(e);for(let i=0;i<r.length;++i){const n=r[i];Object.defineProperty(Lr.prototype,n,Object.getOwnPropertyDescriptor(e,n))}}get destroyed(){return this._destroyed}_recursivePostUpdateTransform(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)}updateTransform(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha}getBounds(e,r){return e||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._bounds.updateID!==this._boundsID&&(this.calculateBounds(),this._bounds.updateID=this._boundsID),r||(this._boundsRect||(this._boundsRect=new pe),r=this._boundsRect),this._bounds.getRectangle(r)}getLocalBounds(e){e||(this._localBoundsRect||(this._localBoundsRect=new pe),e=this._localBoundsRect),this._localBounds||(this._localBounds=new Ln);const r=this.transform,i=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform;const n=this._bounds,s=this._boundsID;this._bounds=this._localBounds;const a=this.getBounds(!1,e);return this.parent=i,this.transform=r,this._bounds=n,this._bounds.updateID+=this._boundsID-s,a}toGlobal(e,r,i=!1){return i||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(e,r)}toLocal(e,r,i,n){return r&&(e=r.toGlobal(e,i,n)),n||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(e,i)}setParent(e){if(!e||!e.addChild)throw new Error("setParent: Argument must be a Container");return e.addChild(this),e}removeFromParent(){var e;(e=this.parent)==null||e.removeChild(this)}setTransform(e=0,r=0,i=1,n=1,s=0,a=0,o=0,u=0,c=0){return this.position.x=e,this.position.y=r,this.scale.x=i||1,this.scale.y=n||1,this.rotation=s,this.skew.x=a,this.skew.y=o,this.pivot.x=u,this.pivot.y=c,this}destroy(e){this.removeFromParent(),this._destroyed=!0,this.transform=null,this.parent=null,this._bounds=null,this.mask=null,this.cullArea=null,this.filters=null,this.filterArea=null,this.hitArea=null,this.eventMode="auto",this.interactiveChildren=!1,this.emit("destroyed"),this.removeAllListeners()}get _tempDisplayObjectParent(){return this.tempDisplayObjectParent===null&&(this.tempDisplayObjectParent=new ZT),this.tempDisplayObjectParent}enableTempParent(){const e=this.parent;return this.parent=this._tempDisplayObjectParent,e}disableTempParent(e){this.parent=e}get x(){return this.position.x}set x(e){this.transform.position.x=e}get y(){return this.position.y}set y(e){this.transform.position.y=e}get worldTransform(){return this.transform.worldTransform}get localTransform(){return this.transform.localTransform}get position(){return this.transform.position}set position(e){this.transform.position.copyFrom(e)}get scale(){return this.transform.scale}set scale(e){this.transform.scale.copyFrom(e)}get pivot(){return this.transform.pivot}set pivot(e){this.transform.pivot.copyFrom(e)}get skew(){return this.transform.skew}set skew(e){this.transform.skew.copyFrom(e)}get rotation(){return this.transform.rotation}set rotation(e){this.transform.rotation=e}get angle(){return this.transform.rotation*f1}set angle(e){this.transform.rotation=e*ci}get zIndex(){return this._zIndex}set zIndex(e){this._zIndex=e,this.parent&&(this.parent.sortDirty=!0)}get worldVisible(){let e=this;do{if(!e.visible)return!1;e=e.parent}while(e);return!0}get mask(){return this._mask}set mask(e){if(this._mask!==e){if(this._mask){const r=this._mask.isMaskData?this._mask.maskObject:this._mask;r&&(r._maskRefCount--,r._maskRefCount===0&&(r.renderable=!0,r.isMask=!1))}if(this._mask=e,this._mask){const r=this._mask.isMaskData?this._mask.maskObject:this._mask;r&&(r._maskRefCount===0&&(r.renderable=!1,r.isMask=!0),r._maskRefCount++)}}}}class ZT extends Lr{constructor(){super(...arguments),this.sortDirty=null}}Lr.prototype.displayObjectUpdateTransform=Lr.prototype.updateTransform;const QT=new Ue;function JT(t,e){return t.zIndex===e.zIndex?t._lastSortedIndex-e._lastSortedIndex:t.zIndex-e.zIndex}const za=class extends Lr{constructor(){super(),this.children=[],this.sortableChildren=za.defaultSortableChildren,this.sortDirty=!1}onChildrenChange(t){}addChild(...t){if(t.length>1)for(let e=0;e<t.length;e++)this.addChild(t[e]);else{const e=t[0];e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.push(e),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",e,this,this.children.length-1),e.emit("added",this)}return t[0]}addChildAt(t,e){if(e<0||e>this.children.length)throw new Error(`${t}addChildAt: The index ${e} supplied is out of bounds ${this.children.length}`);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t}swapChildren(t,e){if(t===e)return;const r=this.getChildIndex(t),i=this.getChildIndex(e);this.children[r]=e,this.children[i]=t,this.onChildrenChange(r<i?r:i)}getChildIndex(t){const e=this.children.indexOf(t);if(e===-1)throw new Error("The supplied DisplayObject must be a child of the caller");return e}setChildIndex(t,e){if(e<0||e>=this.children.length)throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);const r=this.getChildIndex(t);cn(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)}getChildAt(t){if(t<0||t>=this.children.length)throw new Error(`getChildAt: Index (${t}) does not exist.`);return this.children[t]}removeChild(...t){if(t.length>1)for(let e=0;e<t.length;e++)this.removeChild(t[e]);else{const e=t[0],r=this.children.indexOf(e);if(r===-1)return null;e.parent=null,e.transform._parentID=-1,cn(this.children,r,1),this._boundsID++,this.onChildrenChange(r),e.emit("removed",this),this.emit("childRemoved",e,this,r)}return t[0]}removeChildAt(t){const e=this.getChildAt(t);return e.parent=null,e.transform._parentID=-1,cn(this.children,t,1),this._boundsID++,this.onChildrenChange(t),e.emit("removed",this),this.emit("childRemoved",e,this,t),e}removeChildren(t=0,e=this.children.length){const r=t,i=e,n=i-r;let s;if(n>0&&n<=i){s=this.children.splice(r,n);for(let a=0;a<s.length;++a)s[a].parent=null,s[a].transform&&(s[a].transform._parentID=-1);this._boundsID++,this.onChildrenChange(t);for(let a=0;a<s.length;++a)s[a].emit("removed",this),this.emit("childRemoved",s[a],this,a);return s}else if(n===0&&this.children.length===0)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")}sortChildren(){let t=!1;for(let e=0,r=this.children.length;e<r;++e){const i=this.children[e];i._lastSortedIndex=e,!t&&i.zIndex!==0&&(t=!0)}t&&this.children.length>1&&this.children.sort(JT),this.sortDirty=!1}updateTransform(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(let t=0,e=this.children.length;t<e;++t){const r=this.children[t];r.visible&&r.updateTransform()}}calculateBounds(){this._bounds.clear(),this._calculateBounds();for(let t=0;t<this.children.length;t++){const e=this.children[t];if(!(!e.visible||!e.renderable))if(e.calculateBounds(),e._mask){const r=e._mask.isMaskData?e._mask.maskObject:e._mask;r?(r.calculateBounds(),this._bounds.addBoundsMask(e._bounds,r._bounds)):this._bounds.addBounds(e._bounds)}else e.filterArea?this._bounds.addBoundsArea(e._bounds,e.filterArea):this._bounds.addBounds(e._bounds)}this._bounds.updateID=this._boundsID}getLocalBounds(t,e=!1){const r=super.getLocalBounds(t);if(!e)for(let i=0,n=this.children.length;i<n;++i){const s=this.children[i];s.visible&&s.updateTransform()}return r}_calculateBounds(){}_renderWithCulling(t){const e=t.renderTexture.sourceFrame;if(!(e.width>0&&e.height>0))return;let r,i;this.cullArea?(r=this.cullArea,i=this.worldTransform):this._render!==za.prototype._render&&(r=this.getBounds(!0));const n=t.projection.transform;if(n&&(i?(i=QT.copyFrom(i),i.prepend(n)):i=n),r&&e.intersects(r,i))this._render(t);else if(this.cullArea)return;for(let s=0,a=this.children.length;s<a;++s){const o=this.children[s],u=o.cullable;o.cullable=u||!this.cullArea,o.render(t),o.cullable=u}}render(t){var e;if(!(!this.visible||this.worldAlpha<=0||!this.renderable))if(this._mask||(e=this.filters)!=null&&e.length)this.renderAdvanced(t);else if(this.cullable)this._renderWithCulling(t);else{this._render(t);for(let r=0,i=this.children.length;r<i;++r)this.children[r].render(t)}}renderAdvanced(t){var n,s,a;const e=this.filters,r=this._mask;if(e){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(let o=0;o<e.length;o++)e[o].enabled&&this._enabledFilters.push(e[o])}const i=e&&((n=this._enabledFilters)==null?void 0:n.length)||r&&(!r.isMaskData||r.enabled&&(r.autoDetect||r.type!==Ce.NONE));if(i&&t.batch.flush(),e&&((s=this._enabledFilters)!=null&&s.length)&&t.filter.push(this,this._enabledFilters),r&&t.mask.push(this,this._mask),this.cullable)this._renderWithCulling(t);else{this._render(t);for(let o=0,u=this.children.length;o<u;++o)this.children[o].render(t)}i&&t.batch.flush(),r&&t.mask.pop(this),e&&((a=this._enabledFilters)!=null&&a.length)&&t.filter.pop()}_render(t){}destroy(t){super.destroy(),this.sortDirty=!1;const e=typeof t=="boolean"?t:t==null?void 0:t.children,r=this.removeChildren(0,this.children.length);if(e)for(let i=0;i<r.length;++i)r[i].destroy(t)}get width(){return this.scale.x*this.getLocalBounds().width}set width(t){const e=this.getLocalBounds().width;e!==0?this.scale.x=t/e:this.scale.x=1,this._width=t}get height(){return this.scale.y*this.getLocalBounds().height}set height(t){const e=this.getLocalBounds().height;e!==0?this.scale.y=t/e:this.scale.y=1,this._height=t}};let ar=za;ar.defaultSortableChildren=!1,ar.prototype.containerUpdateTransform=ar.prototype.updateTransform,Object.defineProperties(q,{SORTABLE_CHILDREN:{get(){return ar.defaultSortableChildren},set(t){ne("7.1.0","settings.SORTABLE_CHILDREN is deprecated, use Container.defaultSortableChildren"),ar.defaultSortableChildren=t}}});class Bn{constructor(e,r=null,i=null,n=null){this.points=[],this.holes=[],this.shape=e,this.lineStyle=i,this.fillStyle=r,this.matrix=n,this.type=e.type}clone(){return new Bn(this.shape,this.fillStyle,this.lineStyle,this.matrix)}destroy(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null}}const Br=new me,ic=class extends Nu{constructor(){super(),this.closePointEps=1e-4,this.boundsPadding=0,this.uvsFloat32=null,this.indicesUint16=null,this.batchable=!1,this.points=[],this.colors=[],this.uvs=[],this.indices=[],this.textureIds=[],this.graphicsData=[],this.drawCalls=[],this.batchDirty=-1,this.batches=[],this.dirty=0,this.cacheDirty=-1,this.clearDirty=0,this.shapeIndex=0,this._bounds=new Ln,this.boundsDirty=-1}get bounds(){return this.updateBatches(),this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds}invalidate(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(let t=0;t<this.drawCalls.length;t++)this.drawCalls[t].texArray.clear(),Dn.push(this.drawCalls[t]);this.drawCalls.length=0;for(let t=0;t<this.batches.length;t++){const e=this.batches[t];e.reset(),rc.push(e)}this.batches.length=0}clear(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(t,e=null,r=null,i=null){const n=new Bn(t,e,r,i);return this.graphicsData.push(n),this.dirty++,this}drawHole(t,e=null){if(!this.graphicsData.length)return null;const r=new Bn(t,null,null,e),i=this.graphicsData[this.graphicsData.length-1];return r.lineStyle=i.lineStyle,i.holes.push(r),this.dirty++,this}destroy(){super.destroy();for(let t=0;t<this.graphicsData.length;++t)this.graphicsData[t].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null}containsPoint(t){const e=this.graphicsData;for(let r=0;r<e.length;++r){const i=e[r];if(i.fillStyle.visible&&i.shape&&(i.matrix?i.matrix.applyInverse(t,Br):Br.copyFrom(t),i.shape.contains(Br.x,Br.y))){let n=!1;if(i.holes){for(let s=0;s<i.holes.length;s++)if(i.holes[s].shape.contains(Br.x,Br.y)){n=!0;break}}if(!n)return!0}}return!1}updateBatches(){if(!this.graphicsData.length){this.batchable=!0;return}if(!this.validateBatching())return;this.cacheDirty=this.dirty;const t=this.uvs,e=this.graphicsData;let r=null,i=null;this.batches.length>0&&(r=this.batches[this.batches.length-1],i=r.style);for(let o=this.shapeIndex;o<e.length;o++){this.shapeIndex++;const u=e[o],c=u.fillStyle,f=u.lineStyle;Ga[u.type].build(u),u.matrix&&this.transformPoints(u.points,u.matrix),(c.visible||f.visible)&&this.processHoles(u.holes);for(let h=0;h<2;h++){const d=h===0?c:f;if(!d.visible)continue;const p=d.texture.baseTexture,m=this.indices.length,_=this.points.length/2;p.wrapMode=Qr.REPEAT,h===0?this.processFill(u):this.processLine(u);const g=this.points.length/2-_;g!==0&&(r&&!this._compareStyles(i,d)&&(r.end(m,_),r=null),r||(r=rc.pop()||new qT,r.begin(d,m,_),this.batches.push(r),i=d),this.addUvs(this.points,t,d.texture,_,g,d.matrix))}}const n=this.indices.length,s=this.points.length/2;if(r&&r.end(n,s),this.batches.length===0){this.batchable=!0;return}const a=s>65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&a===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=a?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}_compareStyles(t,e){return!(!t||!e||t.texture.baseTexture!==e.texture.baseTexture||t.color+t.alpha!==e.color+e.alpha||!!t.native!=!!e.native)}validateBatching(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(let t=0,e=this.graphicsData.length;t<e;t++){const r=this.graphicsData[t],i=r.fillStyle,n=r.lineStyle;if(i&&!i.texture.baseTexture.valid||n&&!n.texture.baseTexture.valid)return!1}return!0}packBatches(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);const t=this.batches;for(let e=0,r=t.length;e<r;e++){const i=t[e];for(let n=0;n<i.size;n++){const s=i.start+n;this.indicesUint16[s]=this.indicesUint16[s]-i.attribStart}}}isBatchable(){if(this.points.length>65535*2)return!1;const t=this.batches;for(let e=0;e<t.length;e++)if(t[e].style.native)return!1;return this.points.length<ic.BATCHABLE_SIZE*2}buildDrawCalls(){let t=++oe._globalBatch;for(let f=0;f<this.drawCalls.length;f++)this.drawCalls[f].texArray.clear(),Dn.push(this.drawCalls[f]);this.drawCalls.length=0;const e=this.colors,r=this.textureIds;let i=Dn.pop();i||(i=new ga,i.texArray=new Ta),i.texArray.count=0,i.start=0,i.size=0,i.type=Pt.TRIANGLES;let n=0,s=null,a=0,o=!1,u=Pt.TRIANGLES,c=0;this.drawCalls.push(i);for(let f=0;f<this.batches.length;f++){const l=this.batches[f],h=8,d=l.style,p=d.texture.baseTexture;o!==!!d.native&&(o=!!d.native,u=o?Pt.LINES:Pt.TRIANGLES,s=null,n=h,t++),s!==p&&(s=p,p._batchEnabled!==t&&(n===h&&(t++,n=0,i.size>0&&(i=Dn.pop(),i||(i=new ga,i.texArray=new Ta),this.drawCalls.push(i)),i.start=c,i.size=0,i.texArray.count=0,i.type=u),p.touched=1,p._batchEnabled=t,p._batchLocation=n,p.wrapMode=Qr.REPEAT,i.texArray.elements[i.texArray.count++]=p,n++)),i.size+=l.size,c+=l.size,a=p._batchLocation,this.addColors(e,d.color,d.alpha,l.attribSize,l.attribStart),this.addTextureIds(r,a,l.attribSize,l.attribStart)}oe._globalBatch=t,this.packAttributes()}packAttributes(){const t=this.points,e=this.uvs,r=this.colors,i=this.textureIds,n=new ArrayBuffer(t.length*3*4),s=new Float32Array(n),a=new Uint32Array(n);let o=0;for(let u=0;u<t.length/2;u++)s[o++]=t[u*2],s[o++]=t[u*2+1],s[o++]=e[u*2],s[o++]=e[u*2+1],a[o++]=r[u],s[o++]=i[u];this._buffer.update(n),this._indexBuffer.update(this.indicesUint16)}processFill(t){t.holes.length?Qh.triangulate(t,this):Ga[t.type].triangulate(t,this)}processLine(t){tc(t,this);for(let e=0;e<t.holes.length;e++)tc(t.holes[e],this)}processHoles(t){for(let e=0;e<t.length;e++){const r=t[e];Ga[r.type].build(r),r.matrix&&this.transformPoints(r.points,r.matrix)}}calculateBounds(){const t=this._bounds;t.clear(),t.addVertexData(this.points,0,this.points.length),t.pad(this.boundsPadding,this.boundsPadding)}transformPoints(t,e){for(let r=0;r<t.length/2;r++){const i=t[r*2],n=t[r*2+1];t[r*2]=e.a*i+e.c*n+e.tx,t[r*2+1]=e.b*i+e.d*n+e.ty}}addColors(t,e,r,i,n=0){const s=Oe.shared.setValue(e).toLittleEndianNumber(),a=Oe.shared.setValue(s).toPremultiplied(r);t.length=Math.max(t.length,n+i);for(let o=0;o<i;o++)t[n+o]=a}addTextureIds(t,e,r,i=0){t.length=Math.max(t.length,i+r);for(let n=0;n<r;n++)t[i+n]=e}addUvs(t,e,r,i,n,s=null){let a=0;const o=e.length,u=r.frame;for(;a<n;){let f=t[(i+a)*2],l=t[(i+a)*2+1];if(s){const h=s.a*f+s.c*l+s.tx;l=s.b*f+s.d*l+s.ty,f=h}a++,e.push(f/u.width,l/u.height)}const c=r.baseTexture;(u.width<c.width||u.height<c.height)&&this.adjustUvs(e,r,o,n)}adjustUvs(t,e,r,i){const n=e.baseTexture,s=1e-6,a=r+i*2,o=e.frame,u=o.width/n.width,c=o.height/n.height;let f=o.x/o.width,l=o.y/o.height,h=Math.floor(t[r]+s),d=Math.floor(t[r+1]+s);for(let p=r+2;p<a;p+=2)h=Math.min(h,Math.floor(t[p]+s)),d=Math.min(d,Math.floor(t[p+1]+s));f-=h,l-=d;for(let p=r;p<a;p+=2)t[p]=(t[p]+f)*u,t[p+1]=(t[p+1]+l)*c}};let nc=ic;nc.BATCHABLE_SIZE=100;class Un{constructor(){this.color=16777215,this.alpha=1,this.texture=K.WHITE,this.matrix=null,this.visible=!1,this.reset()}clone(){const e=new Un;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e}reset(){this.color=16777215,this.alpha=1,this.texture=K.WHITE,this.matrix=null,this.visible=!1}destroy(){this.texture=null,this.matrix=null}}class ja extends Un{constructor(){super(...arguments),this.width=0,this.alignment=.5,this.native=!1,this.cap=nr.BUTT,this.join=lt.MITER,this.miterLimit=10}clone(){const e=new ja;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e.width=this.width,e.alignment=this.alignment,e.native=this.native,e.cap=this.cap,e.join=this.join,e.miterLimit=this.miterLimit,e}reset(){super.reset(),this.color=0,this.alignment=.5,this.width=0,this.native=!1}}const Ha={},$n=class extends ar{constructor(t=null){super(),this.shader=null,this.pluginName="batch",this.currentPath=null,this.batches=[],this.batchTint=-1,this.batchDirty=-1,this.vertexData=null,this._fillStyle=new Un,this._lineStyle=new ja,this._matrix=null,this._holeMode=!1,this.state=pn.for2d(),this._geometry=t||new nc,this._geometry.refCount++,this._transformID=-1,this._tintColor=new Oe(16777215),this.blendMode=z.NORMAL}get geometry(){return this._geometry}clone(){return this.finishPoly(),new $n(this._geometry)}set blendMode(t){this.state.blendMode=t}get blendMode(){return this.state.blendMode}get tint(){return this._tintColor.value}set tint(t){this._tintColor.setValue(t)}get fill(){return this._fillStyle}get line(){return this._lineStyle}lineStyle(t=null,e=0,r,i=.5,n=!1){return typeof t=="number"&&(t={width:t,color:e,alpha:r,alignment:i,native:n}),this.lineTextureStyle(t)}lineTextureStyle(t){const e={width:0,texture:K.WHITE,color:t!=null&&t.texture?16777215:0,matrix:null,alignment:.5,native:!1,cap:nr.BUTT,join:lt.MITER,miterLimit:10};t=Object.assign(e,t),this.normalizeColor(t),this.currentPath&&this.startPoly();const r=t.width>0&&t.alpha>0;return r?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:r},t)):this._lineStyle.reset(),this}startPoly(){if(this.currentPath){const t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new fi,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new fi,this.currentPath.closeStroke=!1}finishPoly(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)}moveTo(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this}lineTo(t,e){this.currentPath||this.moveTo(0,0);const r=this.currentPath.points,i=r[r.length-2],n=r[r.length-1];return(i!==t||n!==e)&&r.push(t,e),this}_initCurve(t=0,e=0){this.currentPath?this.currentPath.points.length===0&&(this.currentPath.points=[t,e]):this.moveTo(t,e)}quadraticCurveTo(t,e,r,i){this._initCurve();const n=this.currentPath.points;return n.length===0&&this.moveTo(0,0),$a.curveTo(t,e,r,i,n),this}bezierCurveTo(t,e,r,i,n,s){return this._initCurve(),Ua.curveTo(t,e,r,i,n,s,this.currentPath.points),this}arcTo(t,e,r,i,n){this._initCurve(t,e);const s=this.currentPath.points,a=Jh.curveTo(t,e,r,i,n,s);if(a){const{cx:o,cy:u,radius:c,startAngle:f,endAngle:l,anticlockwise:h}=a;this.arc(o,u,c,f,l,h)}return this}arc(t,e,r,i,n,s=!1){if(i===n)return this;if(!s&&n<=i?n+=gn:s&&i<=n&&(i+=gn),n-i===0)return this;const o=t+Math.cos(i)*r,u=e+Math.sin(i)*r,c=this._geometry.closePointEps;let f=this.currentPath?this.currentPath.points:null;if(f){const l=Math.abs(f[f.length-2]-o),h=Math.abs(f[f.length-1]-u);l<c&&h<c||f.push(o,u)}else this.moveTo(o,u),f=this.currentPath.points;return Jh.arc(o,u,t,e,r,i,n,s,f),this}beginFill(t=0,e){return this.beginTextureFill({texture:K.WHITE,color:t,alpha:e})}normalizeColor(t){const e=Oe.shared.setValue(t.color??0);t.color=e.toNumber(),t.alpha??(t.alpha=e.alpha)}beginTextureFill(t){const e={texture:K.WHITE,color:16777215,matrix:null};t=Object.assign(e,t),this.normalizeColor(t),this.currentPath&&this.startPoly();const r=t.alpha>0;return r?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:r},t)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(t,e,r,i){return this.drawShape(new pe(t,e,r,i))}drawRoundedRect(t,e,r,i,n){return this.drawShape(new va(t,e,r,i,n))}drawCircle(t,e,r){return this.drawShape(new _a(t,e,r))}drawEllipse(t,e,r,i){return this.drawShape(new d1(t,e,r,i))}drawPolygon(...t){let e,r=!0;const i=t[0];i.points?(r=i.closeStroke,e=i.points):Array.isArray(t[0])?e=t[0]:e=t;const n=new fi(e);return n.closeStroke=r,this.drawShape(n),this}drawShape(t){return this._holeMode?this._geometry.drawHole(t,this._matrix):this._geometry.drawShape(t,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this}clear(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this}isFastRect(){const t=this._geometry.graphicsData;return t.length===1&&t[0].shape.type===Ne.RECT&&!t[0].matrix&&!t[0].holes.length&&!(t[0].lineStyle.visible&&t[0].lineStyle.width)}_render(t){this.finishPoly();const e=this._geometry;e.updateBatches(),e.batchable?(this.batchDirty!==e.batchDirty&&this._populateBatches(),this._renderBatched(t)):(t.batch.flush(),this._renderDirect(t))}_populateBatches(){const t=this._geometry,e=this.blendMode,r=t.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=t.batchDirty,this.batches.length=r,this.vertexData=new Float32Array(t.points);for(let i=0;i<r;i++){const n=t.batches[i],s=n.style.color,a=new Float32Array(this.vertexData.buffer,n.attribStart*4*2,n.attribSize*2),o=new Float32Array(t.uvsFloat32.buffer,n.attribStart*4*2,n.attribSize*2),u=new Uint16Array(t.indicesUint16.buffer,n.start*2,n.size),c={vertexData:a,blendMode:e,indices:u,uvs:o,_batchRGB:Oe.shared.setValue(s).toRgbArray(),_tintRGB:s,_texture:n.style.texture,alpha:n.style.alpha,worldAlpha:1};this.batches[i]=c}}_renderBatched(t){if(this.batches.length){t.batch.setObjectRenderer(t.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(let e=0,r=this.batches.length;e<r;e++){const i=this.batches[e];i.worldAlpha=this.worldAlpha*i.alpha,t.plugins[this.pluginName].render(i)}}}_renderDirect(t){const e=this._resolveDirectShader(t),r=this._geometry,i=this.worldAlpha,n=e.uniforms,s=r.drawCalls;n.translationMatrix=this.transform.worldTransform,Oe.shared.setValue(this._tintColor).premultiply(i).toArray(n.tint),t.shader.bind(e),t.geometry.bind(r,e),t.state.set(this.state);for(let a=0,o=s.length;a<o;a++)this._renderDrawCallDirect(t,r.drawCalls[a])}_renderDrawCallDirect(t,e){const{texArray:r,type:i,size:n,start:s}=e,a=r.count;for(let o=0;o<a;o++)t.texture.bind(r.elements[o],o);t.geometry.draw(i,n,s)}_resolveDirectShader(t){let e=this.shader;const r=this.pluginName;if(!e){if(!Ha[r]){const{maxTextures:i}=t.plugins[r],n=new Int32Array(i);for(let o=0;o<i;o++)n[o]=o;const s={tint:new Float32Array([1,1,1,1]),translationMatrix:new Ue,default:nt.from({uSamplers:n},!0)},a=t.plugins[r]._shader.program;Ha[r]=new pi(a,s)}e=Ha[r]}return e}_calculateBounds(){this.finishPoly();const t=this._geometry;if(!t.graphicsData.length)return;const{minX:e,minY:r,maxX:i,maxY:n}=t.bounds;this._bounds.addFrame(this.transform,e,r,i,n)}containsPoint(t){return this.worldTransform.applyInverse(t,$n._TEMP_POINT),this._geometry.containsPoint($n._TEMP_POINT)}calculateTints(){if(this.batchTint!==this.tint){this.batchTint=this._tintColor.toNumber();for(let t=0;t<this.batches.length;t++){const e=this.batches[t];e._tintRGB=Oe.shared.setValue(this._tintColor).multiply(e._batchRGB).toLittleEndianNumber()}}}calculateVertices(){const t=this.transform._worldID;if(this._transformID===t)return;this._transformID=t;const e=this.transform.worldTransform,r=e.a,i=e.b,n=e.c,s=e.d,a=e.tx,o=e.ty,u=this._geometry.points,c=this.vertexData;let f=0;for(let l=0;l<u.length;l+=2){const h=u[l],d=u[l+1];c[f++]=r*h+n*d+a,c[f++]=s*d+i*h+o}}closePath(){const t=this.currentPath;return t&&(t.closeStroke=!0,this.finishPoly()),this}setMatrix(t){return this._matrix=t,this}beginHole(){return this.finishPoly(),this._holeMode=!0,this}endHole(){return this.finishPoly(),this._holeMode=!1,this}destroy(t){this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this._geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,super.destroy(t)}};let Va=$n;Va.curves=Dr,Va._TEMP_POINT=new me;var ew=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Xa={},tw={get exports(){return Xa},set exports(t){Xa=t}};/*!
|
|
1962
1962
|
* d-path-parser - v1.0.0
|
|
1963
1963
|
* by Massimo Artizzu (MaxArt2501)
|
|
1964
1964
|
*
|
|
@@ -1966,10 +1966,10 @@ void main() {
|
|
|
1966
1966
|
*
|
|
1967
1967
|
* Licensed under the MIT License
|
|
1968
1968
|
* See LICENSE for details
|
|
1969
|
-
*/(function(t,e){(function(r,n){t.exports=n()})(nR,function(){return function(n){for(var i={command:/\s*([achlmqstvz])/gi,number:/\s*([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/gi,comma:/\s*(?:(,)|\s)/g,flag:/\s*([01])/g},a={number:function(y){return+g("number",y)},"coordinate pair":function(y){var b=g("number",y);if(b===null&&!y)return null;g("comma");var x=g("number",!0);return{x:+b,y:+x}},"arc definition":function(y){var b=a["coordinate pair"](y);if(!b&&!y)return null;g("comma");var x=+g("number",!0);g("comma",!0);var E=!!+g("flag",!0);g("comma");var w=!!+g("flag",!0);g("comma");var I=a["coordinate pair"](!0);return{radii:b,rotation:x,large:E,clockwise:w,end:I}}},u=0,l=[];u<n.length;){var h=g("command"),p=h.toUpperCase(),m=h!==p,c;switch(p){case"M":c=v("coordinate pair").map(function(y,b){return b===1&&(h=m?"l":"L"),d({end:y})});break;case"L":case"T":c=v("coordinate pair").map(function(y){return d({end:y})});break;case"C":if(c=v("coordinate pair"),c.length%3)throw Error("Expected coordinate pair triplet at position "+u);c=c.reduce(function(y,b,x){var E=x%3;if(!E)y.push(d({cp1:b}));else{var w=y[y.length-1];w[E===1?"cp2":"end"]=b}return y},[]);break;case"Q":case"S":if(c=v("coordinate pair"),c.length&1)throw Error("Expected coordinate pair couple at position "+u);c=c.reduce(function(y,b,x){var E=x&1;if(!E)y.push(d({cp:b}));else{var w=y[y.length-1];w.end=b}return y},[]);break;case"H":case"V":c=v("number").map(function(y){return d({value:y})});break;case"A":c=v("arc definition").map(d);break;case"Z":c=[{code:"Z"}];break}l.push.apply(l,c)}return l;function d(y){return y.code=h,y.relative=m,y}function g(y,b){i[y].lastIndex=u;var x=i[y].exec(n);if(!x||x.index!==u){if(!b)return null;throw Error("Expected "+y+" at position "+u)}return u=i[y].lastIndex,x[1]}function v(y){for(var b=[],x,E=!0;x=a[y](E);)b.push(x),E=!!g("comma");return b}}})})(iR);const sR=/^\s+/,aR=/\s+$/;function ne(t,e){if(t=t||"",e=e||{},t instanceof ne)return t;if(!(this instanceof ne))return new ne(t,e);var r=oR(t);this._originalInput=t,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||r.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}ne.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),e,r,n,i,a,u;return e=t.r/255,r=t.g/255,n=t.b/255,e<=.03928?i=e/12.92:i=Math.pow((e+.055)/1.055,2.4),r<=.03928?a=r/12.92:a=Math.pow((r+.055)/1.055,2.4),n<=.03928?u=n/12.92:u=Math.pow((n+.055)/1.055,2.4),.2126*i+.7152*a+.0722*u},setAlpha:function(t){return this._a=Hg(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=Ug(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=Ug(this._r,this._g,this._b),e=Math.round(t.h*360),r=Math.round(t.s*100),n=Math.round(t.v*100);return this._a==1?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=Bg(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=Bg(this._r,this._g,this._b),e=Math.round(t.h*360),r=Math.round(t.s*100),n=Math.round(t.l*100);return this._a==1?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return $g(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return hR(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(it(this._r,255)*100)+"%",g:Math.round(it(this._g,255)*100)+"%",b:Math.round(it(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(it(this._r,255)*100)+"%, "+Math.round(it(this._g,255)*100)+"%, "+Math.round(it(this._b,255)*100)+"%)":"rgba("+Math.round(it(this._r,255)*100)+"%, "+Math.round(it(this._g,255)*100)+"%, "+Math.round(it(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:wR[$g(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var e="#"+Gg(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var i=ne(t);r="#"+Gg(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0,i=!e&&n&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return i?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return ne(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(gR,arguments)},brighten:function(){return this._applyModification(mR,arguments)},darken:function(){return this._applyModification(_R,arguments)},desaturate:function(){return this._applyModification(fR,arguments)},saturate:function(){return this._applyModification(dR,arguments)},greyscale:function(){return this._applyModification(pR,arguments)},spin:function(){return this._applyModification(vR,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(bR,arguments)},complement:function(){return this._applyCombination(yR,arguments)},monochromatic:function(){return this._applyCombination(TR,arguments)},splitcomplement:function(){return this._applyCombination(xR,arguments)},triad:function(){return this._applyCombination(zg,[3])},tetrad:function(){return this._applyCombination(zg,[4])}},ne.fromRatio=function(t,e){if(typeof t=="object"){var r={};for(var n in t)t.hasOwnProperty(n)&&(n==="a"?r[n]=t[n]:r[n]=Ms(t[n]));t=r}return ne(t,e)};function oR(t){var e={r:0,g:0,b:0},r=1,n=null,i=null,a=null,u=!1,l=!1;return typeof t=="string"&&(t=CR(t)),typeof t=="object"&&(Yr(t.r)&&Yr(t.g)&&Yr(t.b)?(e=uR(t.r,t.g,t.b),u=!0,l=String(t.r).substr(-1)==="%"?"prgb":"rgb"):Yr(t.h)&&Yr(t.s)&&Yr(t.v)?(n=Ms(t.s),i=Ms(t.v),e=cR(t.h,n,i),u=!0,l="hsv"):Yr(t.h)&&Yr(t.s)&&Yr(t.l)&&(n=Ms(t.s),a=Ms(t.l),e=lR(t.h,n,a),u=!0,l="hsl"),t.hasOwnProperty("a")&&(r=t.a)),r=Hg(r),{ok:u,format:t.format||l,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:r}}function uR(t,e,r){return{r:it(t,255)*255,g:it(e,255)*255,b:it(r,255)*255}}function Bg(t,e,r){t=it(t,255),e=it(e,255),r=it(r,255);var n=Math.max(t,e,r),i=Math.min(t,e,r),a,u,l=(n+i)/2;if(n==i)a=u=0;else{var h=n-i;switch(u=l>.5?h/(2-n-i):h/(n+i),n){case t:a=(e-r)/h+(e<r?6:0);break;case e:a=(r-t)/h+2;break;case r:a=(t-e)/h+4;break}a/=6}return{h:a,s:u,l}}function lR(t,e,r){var n,i,a;t=it(t,360),e=it(e,100),r=it(r,100);function u(p,m,c){return c<0&&(c+=1),c>1&&(c-=1),c<1/6?p+(m-p)*6*c:c<1/2?m:c<2/3?p+(m-p)*(2/3-c)*6:p}if(e===0)n=i=a=r;else{var l=r<.5?r*(1+e):r+e-r*e,h=2*r-l;n=u(h,l,t+1/3),i=u(h,l,t),a=u(h,l,t-1/3)}return{r:n*255,g:i*255,b:a*255}}function Ug(t,e,r){t=it(t,255),e=it(e,255),r=it(r,255);var n=Math.max(t,e,r),i=Math.min(t,e,r),a,u,l=n,h=n-i;if(u=n===0?0:h/n,n==i)a=0;else{switch(n){case t:a=(e-r)/h+(e<r?6:0);break;case e:a=(r-t)/h+2;break;case r:a=(t-e)/h+4;break}a/=6}return{h:a,s:u,v:l}}function cR(t,e,r){t=it(t,360)*6,e=it(e,100),r=it(r,100);var n=Math.floor(t),i=t-n,a=r*(1-e),u=r*(1-i*e),l=r*(1-(1-i)*e),h=n%6,p=[r,u,a,a,l,r][h],m=[l,r,r,u,a,a][h],c=[a,a,l,r,r,u][h];return{r:p*255,g:m*255,b:c*255}}function $g(t,e,r,n){var i=[Er(Math.round(t).toString(16)),Er(Math.round(e).toString(16)),Er(Math.round(r).toString(16))];return n&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function hR(t,e,r,n,i){var a=[Er(Math.round(t).toString(16)),Er(Math.round(e).toString(16)),Er(Math.round(r).toString(16)),Er(Vg(n))];return i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}function Gg(t,e,r,n){var i=[Er(Vg(n)),Er(Math.round(t).toString(16)),Er(Math.round(e).toString(16)),Er(Math.round(r).toString(16))];return i.join("")}ne.equals=function(t,e){return!t||!e?!1:ne(t).toRgbString()==ne(e).toRgbString()},ne.random=function(){return ne.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function fR(t,e){e=e===0?0:e||10;var r=ne(t).toHsl();return r.s-=e/100,r.s=lo(r.s),ne(r)}function dR(t,e){e=e===0?0:e||10;var r=ne(t).toHsl();return r.s+=e/100,r.s=lo(r.s),ne(r)}function pR(t){return ne(t).desaturate(100)}function gR(t,e){e=e===0?0:e||10;var r=ne(t).toHsl();return r.l+=e/100,r.l=lo(r.l),ne(r)}function mR(t,e){e=e===0?0:e||10;var r=ne(t).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(e/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(e/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(e/100)))),ne(r)}function _R(t,e){e=e===0?0:e||10;var r=ne(t).toHsl();return r.l-=e/100,r.l=lo(r.l),ne(r)}function vR(t,e){var r=ne(t).toHsl(),n=(r.h+e)%360;return r.h=n<0?360+n:n,ne(r)}function yR(t){var e=ne(t).toHsl();return e.h=(e.h+180)%360,ne(e)}function zg(t,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var r=ne(t).toHsl(),n=[ne(t)],i=360/e,a=1;a<e;a++)n.push(ne({h:(r.h+a*i)%360,s:r.s,l:r.l}));return n}function xR(t){var e=ne(t).toHsl(),r=e.h;return[ne(t),ne({h:(r+72)%360,s:e.s,l:e.l}),ne({h:(r+216)%360,s:e.s,l:e.l})]}function bR(t,e,r){e=e||6,r=r||30;var n=ne(t).toHsl(),i=360/r,a=[ne(t)];for(n.h=(n.h-(i*e>>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push(ne(n));return a}function TR(t,e){e=e||6;for(var r=ne(t).toHsv(),n=r.h,i=r.s,a=r.v,u=[],l=1/e;e--;)u.push(ne({h:n,s:i,v:a})),a=(a+l)%1;return u}ne.mix=function(t,e,r){r=r===0?0:r||50;var n=ne(t).toRgb(),i=ne(e).toRgb(),a=r/100,u={r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a};return ne(u)},ne.readability=function(t,e){var r=ne(t),n=ne(e);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)},ne.isReadable=function(t,e,r){var n=ne.readability(t,e),i,a;switch(a=!1,i=IR(r),i.level+i.size){case"AAsmall":case"AAAlarge":a=n>=4.5;break;case"AAlarge":a=n>=3;break;case"AAAsmall":a=n>=7;break}return a},ne.mostReadable=function(t,e,r){var n=null,i=0,a,u,l,h;r=r||{},u=r.includeFallbackColors,l=r.level,h=r.size;for(var p=0;p<e.length;p++)a=ne.readability(t,e[p]),a>i&&(i=a,n=ne(e[p]));return ne.isReadable(t,n,{level:l,size:h})||!u?n:(r.includeFallbackColors=!1,ne.mostReadable(t,["#fff","#000"],r))};var ac=ne.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},wR=ne.hexNames=SR(ac);function SR(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}function Hg(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function it(t,e){AR(t)&&(t="100%");var r=ER(t);return t=Math.min(e,Math.max(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function lo(t){return Math.min(1,Math.max(0,t))}function Yt(t){return parseInt(t,16)}function AR(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function ER(t){return typeof t=="string"&&t.indexOf("%")!=-1}function Er(t){return t.length==1?"0"+t:""+t}function Ms(t){return t<=1&&(t=t*100+"%"),t}function Vg(t){return Math.round(parseFloat(t)*255).toString(16)}function Xg(t){return Yt(t)/255}var Cr=function(){var t="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",r="(?:"+e+")|(?:"+t+")",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Yr(t){return!!Cr.CSS_UNIT.exec(t)}function CR(t){t=t.replace(sR,"").replace(aR,"").toLowerCase();var e=!1;if(ac[t])t=ac[t],e=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=Cr.rgb.exec(t))?{r:r[1],g:r[2],b:r[3]}:(r=Cr.rgba.exec(t))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=Cr.hsl.exec(t))?{h:r[1],s:r[2],l:r[3]}:(r=Cr.hsla.exec(t))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=Cr.hsv.exec(t))?{h:r[1],s:r[2],v:r[3]}:(r=Cr.hsva.exec(t))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=Cr.hex8.exec(t))?{r:Yt(r[1]),g:Yt(r[2]),b:Yt(r[3]),a:Xg(r[4]),format:e?"name":"hex8"}:(r=Cr.hex6.exec(t))?{r:Yt(r[1]),g:Yt(r[2]),b:Yt(r[3]),format:e?"name":"hex"}:(r=Cr.hex4.exec(t))?{r:Yt(r[1]+""+r[1]),g:Yt(r[2]+""+r[2]),b:Yt(r[3]+""+r[3]),a:Xg(r[4]+""+r[4]),format:e?"name":"hex8"}:(r=Cr.hex3.exec(t))?{r:Yt(r[1]+""+r[1]),g:Yt(r[2]+""+r[2]),b:Yt(r[3]+""+r[3]),format:e?"name":"hex"}:!1}function IR(t){var e,r;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:e,size:r}}var RR=function(){function t(e,r){var n=[],i=!0,a=!1,u=void 0;try{for(var l=e[Symbol.iterator](),h;!(i=(h=l.next()).done)&&(n.push(h.value),!(r&&n.length===r));i=!0);}catch(p){a=!0,u=p}finally{try{!i&&l.return&&l.return()}finally{if(a)throw u}}return n}return function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),Os=Math.PI*2,oc=function(e,r,n,i,a,u,l){var h=e.x,p=e.y;h*=r,p*=n;var m=i*h-a*p,c=a*h+i*p;return{x:m+u,y:c+l}},PR=function(e,r){var n=r===1.5707963267948966?.551915024494:r===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(r/4),i=Math.cos(e),a=Math.sin(e),u=Math.cos(e+r),l=Math.sin(e+r);return[{x:i-a*n,y:a+i*n},{x:u+l*n,y:l-u*n},{x:u,y:l}]},jg=function(e,r,n,i){var a=e*i-r*n<0?-1:1,u=e*n+r*i;return u>1&&(u=1),u<-1&&(u=-1),a*Math.acos(u)},MR=function(e,r,n,i,a,u,l,h,p,m,c,d){var g=Math.pow(a,2),v=Math.pow(u,2),y=Math.pow(c,2),b=Math.pow(d,2),x=g*v-g*b-v*y;x<0&&(x=0),x/=g*b+v*y,x=Math.sqrt(x)*(l===h?-1:1);var E=x*a/u*d,w=x*-u/a*c,I=m*E-p*w+(e+n)/2,O=p*E+m*w+(r+i)/2,F=(c-E)/a,N=(d-w)/u,L=(-c-E)/a,D=(-d-w)/u,V=jg(1,0,F,N),Y=jg(F,N,L,D);return h===0&&Y>0&&(Y-=Os),h===1&&Y<0&&(Y+=Os),[I,O,V,Y]},Wg=function(e){var r=e.px,n=e.py,i=e.cx,a=e.cy,u=e.rx,l=e.ry,h=e.xAxisRotation,p=h===void 0?0:h,m=e.largeArcFlag,c=m===void 0?0:m,d=e.sweepFlag,g=d===void 0?0:d,v=[];if(u===0||l===0)return[];var y=Math.sin(p*Os/360),b=Math.cos(p*Os/360),x=b*(r-i)/2+y*(n-a)/2,E=-y*(r-i)/2+b*(n-a)/2;if(x===0&&E===0)return[];u=Math.abs(u),l=Math.abs(l);var w=Math.pow(x,2)/Math.pow(u,2)+Math.pow(E,2)/Math.pow(l,2);w>1&&(u*=Math.sqrt(w),l*=Math.sqrt(w));var I=MR(r,n,i,a,u,l,c,g,y,b,x,E),O=RR(I,4),F=O[0],N=O[1],L=O[2],D=O[3],V=Math.abs(D)/(Os/4);Math.abs(1-V)<1e-7&&(V=1);var Y=Math.max(Math.ceil(V),1);D/=Y;for(var ie=0;ie<Y;ie++)v.push(PR(L,D)),L+=D;return v.map(function(X){var G=oc(X[0],u,l,b,y,F,N),ae=G.x,se=G.y,z=oc(X[1],u,l,b,y,F,N),Q=z.x,ge=z.y,W=oc(X[2],u,l,b,y,F,N),q=W.x,he=W.y;return{x1:ae,y1:se,x2:Q,y2:ge,x:q,y:he}})};class OR extends ic{constructor(e){super(),this.lineColor=null,e&&this.drawSVG(e)}drawSVG(e){if(typeof e=="string"){const r=document.createElement("div");r.innerHTML=e.trim(),e=r.querySelector("svg")}if(!e)throw new Error("Missing <svg> element in SVG constructor");return this._svgFill(e),this._svgChildren(e.children),this}_svgChildren(e,r=!1){for(let n=0;n<e.length;n++){const i=e[n];switch(this._svgFill(i,r),i.nodeName.toLowerCase()){case"path":{this._svgPath(i);break}case"circle":case"ellipse":{this._svgCircle(i);break}case"rect":{this._svgRect(i);break}case"polygon":{this._svgPoly(i,!0);break}case"polyline":{this._svgPoly(i);break}case"g":break;default:{console.info(`[PIXI.SVG] <${i.nodeName}> elements unsupported`);break}}this._svgChildren(i.children,!0)}}_hexToUint(e){if(e[0]==="#")return e=e.substr(1),e.length===3&&(e=e.replace(/([a-f0-9])/ig,"$1$1")),parseInt(e,16);const{r,g:n,b:i}=ne(e).toRgb();return(r<<16)+(n<<8)+i}_svgCircle(e){let r="r",n="r";const i=e.nodeName==="elipse";i&&(r+="x",n+="y");const a=parseFloat(e.getAttribute(n)),u=parseFloat(e.getAttribute(r)),l=e.getAttribute("cx"),h=e.getAttribute("cy");let p=0,m=0;l!==null&&(p=parseFloat(l)),h!==null&&(m=parseFloat(h)),i?this.drawEllipse(p,m,a,u):this.drawCircle(p,m,a)}_svgRect(e){const r=parseFloat(e.getAttribute("x")),n=parseFloat(e.getAttribute("y")),i=parseFloat(e.getAttribute("width")),a=parseFloat(e.getAttribute("height")),u=parseFloat(e.getAttribute("rx"));u?this.drawRoundedRect(r,n,i,a,u):this.drawRect(r,n,i,a)}_convertStyleName(e){return e.trim().replace("-width","Width").replace(/.*-(line)?/,"")}_svgStyle(e){const r=e.getAttribute("style"),n=e.getAttribute("opacity"),i={fill:e.getAttribute("fill"),opacity:n||e.getAttribute("fill-opacity"),stroke:e.getAttribute("stroke"),strokeOpacity:n||e.getAttribute("stroke-opacity"),strokeWidth:e.getAttribute("stroke-width"),cap:e.getAttribute("stroke-linecap"),join:e.getAttribute("stroke-linejoin"),miterLimit:e.getAttribute("stroke-miterlimit")};return r!==null&&r.split(";").forEach(a=>{const[u,l]=a.split(":");if(u){const h=this._convertStyleName(u);i[h]||(i[h]=l.trim())}}),i}_svgPoly(e,r){const n=e.getAttribute("points").split(/[ ,]/g).map(i=>parseInt(i,10));this.drawPolygon(n),r&&this.closePath()}_svgFill(e,r){const{fill:n,opacity:i,stroke:a,strokeOpacity:u,strokeWidth:l,cap:h,join:p,miterLimit:m}=this._svgStyle(e),d=l!==null?parseFloat(l):a!==null?1:0,g=a!==null?this._hexToUint(a):this.lineColor;n?n==="none"?this.beginFill(0,0):this.beginFill(this._hexToUint(n),i!==null?parseFloat(i):1):r||this.beginFill(0),this.lineStyle({width:a===null&&l===null&&r?this.line.width:d,alpha:u===null?this.line.alpha:parseFloat(u),color:a===null&&r?this.line.color:g,cap:h===null&&r?this.line.cap:h,join:p===null&&r?this.line.join:p,miterLimit:m===null&&r?this.line.miterLimit:parseFloat(m)}),e.getAttribute("fill-rule")&&console.info('[PIXI.SVG] "fill-rule" attribute is not supported')}_svgPath(e){const r=e.getAttribute("d");let n=0,i=0;const a=sc(r.trim());for(let u=0;u<a.length;u++){const l=a[u];switch(l.code){case"m":{this.moveTo(n+=l.end.x,i+=l.end.y);break}case"M":{this.moveTo(n=l.end.x,i=l.end.y);break}case"H":{this.lineTo(n=l.value,i);break}case"h":{this.lineTo(n+=l.value,i);break}case"V":{this.lineTo(n,i=l.value);break}case"v":{this.lineTo(n,i+=l.value);break}case"Z":{this.closePath();break}case"L":{this.lineTo(n=l.end.x,i=l.end.y);break}case"l":{this.lineTo(n+=l.end.x,i+=l.end.y);break}case"C":{this.bezierCurveTo(l.cp1.x,l.cp1.y,l.cp2.x,l.cp2.y,n=l.end.x,i=l.end.y);break}case"c":{const h=n,p=i;this.bezierCurveTo(h+l.cp1.x,p+l.cp1.y,h+l.cp2.x,p+l.cp2.y,n+=l.end.x,i+=l.end.y);break}case"s":case"q":{const h=n,p=i;this.quadraticCurveTo(h+l.cp.x,p+l.cp.y,n+=l.end.x,i+=l.end.y);break}case"S":case"Q":{this.quadraticCurveTo(l.cp.x,l.cp.y,n=l.end.x,i=l.end.y);break}case"a":{Wg({px:n,py:i,cx:n+=l.end.x,cy:i+=l.end.y,rx:l.radii.x,ry:l.radii.y,xAxisRotation:l.rotation,largeArcFlag:l.large?1:0,sweepFlag:l.clockwise?1:0}).forEach(({x1:h,y1:p,x2:m,y2:c,x:d,y:g})=>this.bezierCurveTo(h,p,m,c,d,g));break}case"A":{Wg({px:n,py:i,cx:n=l.end.x,cy:i=l.end.y,rx:l.radii.x,ry:l.radii.y,xAxisRotation:l.rotation,largeArcFlag:l.large?1:0,sweepFlag:l.clockwise?1:0}).forEach(({x1:h,y1:p,x2:m,y2:c,x:d,y:g})=>this.bezierCurveTo(h,p,m,c,d,g));break}default:{console.info("[PIXI.SVG] Draw command not supported:",l.code,l);break}}}}}var co={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},FR=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function NR(t){return t===10||t===13||t===8232||t===8233||t===32||t===9||t===11||t===12||t===160||t>=5760&&FR.indexOf(t)>=0}function LR(t){switch(t|32){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}function kR(t){return(t|32)===97}function Di(t){return t>=48&&t<=57}function DR(t){return t>=48&&t<=57||t===43||t===45||t===46}function BR(t){this.index=0,this.path=t,this.max=t.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function ho(t){for(;t.index<t.max&&NR(t.path.charCodeAt(t.index));)t.index++}function UR(t){var e=t.path.charCodeAt(t.index);if(e===48){t.param=0,t.index++;return}if(e===49){t.param=1,t.index++;return}t.err="SvgPath: arc flag can be 0 or 1 only (at pos "+t.index+")"}function $R(t){var e=t.index,r=e,n=t.max,i=!1,a=!1,u=!1,l=!1,h;if(r>=n){t.err="SvgPath: missed param (at pos "+r+")";return}if(h=t.path.charCodeAt(r),(h===43||h===45)&&(r++,h=r<n?t.path.charCodeAt(r):0),!Di(h)&&h!==46){t.err="SvgPath: param should start with 0..9 or `.` (at pos "+r+")";return}if(h!==46){if(i=h===48,r++,h=r<n?t.path.charCodeAt(r):0,i&&r<n&&h&&Di(h)){t.err="SvgPath: numbers started with `0` such as `09` are illegal (at pos "+e+")";return}for(;r<n&&Di(t.path.charCodeAt(r));)r++,a=!0;h=r<n?t.path.charCodeAt(r):0}if(h===46){for(l=!0,r++;Di(t.path.charCodeAt(r));)r++,u=!0;h=r<n?t.path.charCodeAt(r):0}if(h===101||h===69){if(l&&!a&&!u){t.err="SvgPath: invalid float exponent (at pos "+r+")";return}if(r++,h=r<n?t.path.charCodeAt(r):0,(h===43||h===45)&&r++,r<n&&Di(t.path.charCodeAt(r)))for(;r<n&&Di(t.path.charCodeAt(r));)r++;else{t.err="SvgPath: invalid float exponent (at pos "+r+")";return}}t.index=r,t.param=parseFloat(t.path.slice(e,r))+0}function uc(t){var e,r;e=t.path[t.segmentStart],r=e.toLowerCase();var n=t.data;if(r==="m"&&n.length>2&&(t.result.push([e,n[0],n[1]]),n=n.slice(2),r="l",e=e==="m"?"l":"L"),r==="r")t.result.push([e].concat(n));else for(;n.length>=co[r]&&(t.result.push([e].concat(n.splice(0,co[r]))),!!co[r]););}function GR(t){var e=t.max,r,n,i,a,u;if(t.segmentStart=t.index,r=t.path.charCodeAt(t.index),n=kR(r),!LR(r)){t.err="SvgPath: bad command "+t.path[t.index]+" (at pos "+t.index+")";return}if(a=co[t.path[t.index].toLowerCase()],t.index++,ho(t),t.data=[],!a){uc(t);return}for(i=!1;;){for(u=a;u>0;u--){if(n&&(u===3||u===4)?UR(t):$R(t),t.err.length){uc(t);return}t.data.push(t.param),ho(t),i=!1,t.index<e&&t.path.charCodeAt(t.index)===44&&(t.index++,ho(t),i=!0)}if(!i&&(t.index>=t.max||!DR(t.path.charCodeAt(t.index))))break}uc(t)}var zR=function(e){var r=new BR(e),n=r.max;for(ho(r);r.index<n&&!r.err.length;)GR(r);return r.result.length&&("mM".indexOf(r.result[0][0])<0?(r.err="SvgPath: string should start with `M` or `m`",r.result=[]):r.result[0][0]="M"),{err:r.err,segments:r.result}};function HR(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}function Ir(){if(!(this instanceof Ir))return new Ir;this.queue=[],this.cache=null}Ir.prototype.matrix=function(t){return t[0]===1&&t[1]===0&&t[2]===0&&t[3]===1&&t[4]===0&&t[5]===0?this:(this.cache=null,this.queue.push(t),this)},Ir.prototype.translate=function(t,e){return(t!==0||e!==0)&&(this.cache=null,this.queue.push([1,0,0,1,t,e])),this},Ir.prototype.scale=function(t,e){return(t!==1||e!==1)&&(this.cache=null,this.queue.push([t,0,0,e,0,0])),this},Ir.prototype.rotate=function(t,e,r){var n,i,a;return t!==0&&(this.translate(e,r),n=t*Math.PI/180,i=Math.cos(n),a=Math.sin(n),this.queue.push([i,a,-a,i,0,0]),this.cache=null,this.translate(-e,-r)),this},Ir.prototype.skewX=function(t){return t!==0&&(this.cache=null,this.queue.push([1,0,Math.tan(t*Math.PI/180),1,0,0])),this},Ir.prototype.skewY=function(t){return t!==0&&(this.cache=null,this.queue.push([1,Math.tan(t*Math.PI/180),0,1,0,0])),this},Ir.prototype.toArray=function(){if(this.cache)return this.cache;if(!this.queue.length)return this.cache=[1,0,0,1,0,0],this.cache;if(this.cache=this.queue[0],this.queue.length===1)return this.cache;for(var t=1;t<this.queue.length;t++)this.cache=HR(this.cache,this.queue[t]);return this.cache},Ir.prototype.calc=function(t,e,r){var n;return this.queue.length?(this.cache||(this.cache=this.toArray()),n=this.cache,[t*n[0]+e*n[2]+(r?0:n[4]),t*n[1]+e*n[3]+(r?0:n[5])]):[t,e]};var qg=Ir,VR=qg,XR={matrix:!0,scale:!0,rotate:!0,translate:!0,skewX:!0,skewY:!0},jR=/\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/,WR=/[\s,]+/,qR=function(e){var r=new VR,n,i;return e.split(jR).forEach(function(a){if(a.length){if(typeof XR[a]<"u"){n=a;return}switch(i=a.split(WR).map(function(u){return+u||0}),n){case"matrix":i.length===6&&r.matrix(i);return;case"scale":i.length===1?r.scale(i[0],i[0]):i.length===2&&r.scale(i[0],i[1]);return;case"rotate":i.length===1?r.rotate(i[0],0,0):i.length===3&&r.rotate(i[0],i[1],i[2]);return;case"translate":i.length===1?r.translate(i[0],0):i.length===2&&r.translate(i[0],i[1]);return;case"skewX":i.length===1&&r.skewX(i[0]);return;case"skewY":i.length===1&&r.skewY(i[0]);return}}}),r},Fs=Math.PI*2;function Yg(t,e,r,n){var i=t*n-e*r<0?-1:1,a=t*r+e*n;return a>1&&(a=1),a<-1&&(a=-1),i*Math.acos(a)}function YR(t,e,r,n,i,a,u,l,h,p){var m=p*(t-r)/2+h*(e-n)/2,c=-h*(t-r)/2+p*(e-n)/2,d=u*u,g=l*l,v=m*m,y=c*c,b=d*g-d*y-g*v;b<0&&(b=0),b/=d*y+g*v,b=Math.sqrt(b)*(i===a?-1:1);var x=b*u/l*c,E=b*-l/u*m,w=p*x-h*E+(t+r)/2,I=h*x+p*E+(e+n)/2,O=(m-x)/u,F=(c-E)/l,N=(-m-x)/u,L=(-c-E)/l,D=Yg(1,0,O,F),V=Yg(O,F,N,L);return a===0&&V>0&&(V-=Fs),a===1&&V<0&&(V+=Fs),[w,I,D,V]}function KR(t,e){var r=1.3333333333333333*Math.tan(e/4),n=Math.cos(t),i=Math.sin(t),a=Math.cos(t+e),u=Math.sin(t+e);return[n,i,n-i*r,i+n*r,a+u*r,u-a*r,a,u]}var ZR=function(e,r,n,i,a,u,l,h,p){var m=Math.sin(p*Fs/360),c=Math.cos(p*Fs/360),d=c*(e-n)/2+m*(r-i)/2,g=-m*(e-n)/2+c*(r-i)/2;if(d===0&&g===0)return[];if(l===0||h===0)return[];l=Math.abs(l),h=Math.abs(h);var v=d*d/(l*l)+g*g/(h*h);v>1&&(l*=Math.sqrt(v),h*=Math.sqrt(v));var y=YR(e,r,n,i,a,u,l,h,m,c),b=[],x=y[2],E=y[3],w=Math.max(Math.ceil(Math.abs(E)/(Fs/4)),1);E/=w;for(var I=0;I<w;I++)b.push(KR(x,E)),x+=E;return b.map(function(O){for(var F=0;F<O.length;F+=2){var N=O[F+0],L=O[F+1];N*=l,L*=h;var D=c*N-m*L,V=m*N+c*L;O[F+0]=D+y[0],O[F+1]=V+y[1]}return O})},Ns=1e-10,Kg=Math.PI/180;function Ls(t,e,r){if(!(this instanceof Ls))return new Ls(t,e,r);this.rx=t,this.ry=e,this.ax=r}Ls.prototype.transform=function(t){var e=Math.cos(this.ax*Kg),r=Math.sin(this.ax*Kg),n=[this.rx*(t[0]*e+t[2]*r),this.rx*(t[1]*e+t[3]*r),this.ry*(-t[0]*r+t[2]*e),this.ry*(-t[1]*r+t[3]*e)],i=n[0]*n[0]+n[2]*n[2],a=n[1]*n[1]+n[3]*n[3],u=((n[0]-n[3])*(n[0]-n[3])+(n[2]+n[1])*(n[2]+n[1]))*((n[0]+n[3])*(n[0]+n[3])+(n[2]-n[1])*(n[2]-n[1])),l=(i+a)/2;if(u<Ns*l)return this.rx=this.ry=Math.sqrt(l),this.ax=0,this;var h=n[0]*n[1]+n[2]*n[3];u=Math.sqrt(u);var p=l+u/2,m=l-u/2;return this.ax=Math.abs(h)<Ns&&Math.abs(p-a)<Ns?90:Math.atan(Math.abs(h)>Math.abs(p-a)?(p-i)/h:h/(p-a))*180/Math.PI,this.ax>=0?(this.rx=Math.sqrt(p),this.ry=Math.sqrt(m)):(this.ax+=90,this.rx=Math.sqrt(m),this.ry=Math.sqrt(p)),this},Ls.prototype.isDegenerate=function(){return this.rx<Ns*this.ry||this.ry<Ns*this.rx};var QR=Ls,JR=zR,eP=qR,_n=qg,tP=ZR,rP=QR;function lt(t){if(!(this instanceof lt))return new lt(t);var e=JR(t);this.segments=e.segments,this.err=e.err,this.__stack=[]}lt.from=function(t){if(typeof t=="string")return new lt(t);if(t instanceof lt){var e=new lt("");return e.err=t.err,e.segments=t.segments.map(function(r){return r.slice()}),e.__stack=t.__stack.map(function(r){return _n().matrix(r.toArray())}),e}throw new Error("SvgPath.from: invalid param type "+t)},lt.prototype.__matrix=function(t){var e=this,r;t.queue.length&&this.iterate(function(n,i,a,u){var l,h,p,m;switch(n[0]){case"v":l=t.calc(0,n[1],!0),h=l[0]===0?["v",l[1]]:["l",l[0],l[1]];break;case"V":l=t.calc(a,n[1],!1),h=l[0]===t.calc(a,u,!1)[0]?["V",l[1]]:["L",l[0],l[1]];break;case"h":l=t.calc(n[1],0,!0),h=l[1]===0?["h",l[0]]:["l",l[0],l[1]];break;case"H":l=t.calc(n[1],u,!1),h=l[1]===t.calc(a,u,!1)[1]?["H",l[0]]:["L",l[0],l[1]];break;case"a":case"A":var c=t.toArray(),d=rP(n[1],n[2],n[3]).transform(c);if(c[0]*c[3]-c[1]*c[2]<0&&(n[5]=n[5]?"0":"1"),l=t.calc(n[6],n[7],n[0]==="a"),n[0]==="A"&&n[6]===a&&n[7]===u||n[0]==="a"&&n[6]===0&&n[7]===0){h=[n[0]==="a"?"l":"L",l[0],l[1]];break}d.isDegenerate()?h=[n[0]==="a"?"l":"L",l[0],l[1]]:h=[n[0],d.rx,d.ry,d.ax,n[4],n[5],l[0],l[1]];break;case"m":m=i>0,l=t.calc(n[1],n[2],m),h=["m",l[0],l[1]];break;default:for(p=n[0],h=[p],m=p.toLowerCase()===p,r=1;r<n.length;r+=2)l=t.calc(n[r],n[r+1],m),h.push(l[0],l[1])}e.segments[i]=h},!0)},lt.prototype.__evaluateStack=function(){var t,e;if(this.__stack.length){if(this.__stack.length===1){this.__matrix(this.__stack[0]),this.__stack=[];return}for(t=_n(),e=this.__stack.length;--e>=0;)t.matrix(this.__stack[e].toArray());this.__matrix(t),this.__stack=[]}},lt.prototype.toString=function(){var t="",e="",r=!1;this.__evaluateStack();for(var n=0,i=this.segments.length;n<i;n++){var a=this.segments[n],u=a[0];u!==e||u==="m"||u==="M"?(u==="m"&&e==="z"&&(t+=" "),t+=u,r=!1):r=!0;for(var l=1;l<a.length;l++){var h=a[l];l===1?r&&h>=0&&(t+=" "):h>=0&&(t+=" "),t+=h}e=u}return t},lt.prototype.translate=function(t,e){return this.__stack.push(_n().translate(t,e||0)),this},lt.prototype.scale=function(t,e){return this.__stack.push(_n().scale(t,!e&&e!==0?t:e)),this},lt.prototype.rotate=function(t,e,r){return this.__stack.push(_n().rotate(t,e||0,r||0)),this},lt.prototype.skewX=function(t){return this.__stack.push(_n().skewX(t)),this},lt.prototype.skewY=function(t){return this.__stack.push(_n().skewY(t)),this},lt.prototype.matrix=function(t){return this.__stack.push(_n().matrix(t)),this},lt.prototype.transform=function(t){return t.trim()?(this.__stack.push(eP(t)),this):this},lt.prototype.round=function(t){var e=0,r=0,n=0,i=0,a;return t=t||0,this.__evaluateStack(),this.segments.forEach(function(u){var l=u[0].toLowerCase()===u[0];switch(u[0]){case"H":case"h":l&&(u[1]+=n),n=u[1]-u[1].toFixed(t),u[1]=+u[1].toFixed(t);return;case"V":case"v":l&&(u[1]+=i),i=u[1]-u[1].toFixed(t),u[1]=+u[1].toFixed(t);return;case"Z":case"z":n=e,i=r;return;case"M":case"m":l&&(u[1]+=n,u[2]+=i),n=u[1]-u[1].toFixed(t),i=u[2]-u[2].toFixed(t),e=n,r=i,u[1]=+u[1].toFixed(t),u[2]=+u[2].toFixed(t);return;case"A":case"a":l&&(u[6]+=n,u[7]+=i),n=u[6]-u[6].toFixed(t),i=u[7]-u[7].toFixed(t),u[1]=+u[1].toFixed(t),u[2]=+u[2].toFixed(t),u[3]=+u[3].toFixed(t+2),u[6]=+u[6].toFixed(t),u[7]=+u[7].toFixed(t);return;default:a=u.length,l&&(u[a-2]+=n,u[a-1]+=i),n=u[a-2]-u[a-2].toFixed(t),i=u[a-1]-u[a-1].toFixed(t),u.forEach(function(h,p){p&&(u[p]=+u[p].toFixed(t))});return}}),this},lt.prototype.iterate=function(t,e){var r=this.segments,n={},i=!1,a=0,u=0,l=0,h=0,p,m,c;if(e||this.__evaluateStack(),r.forEach(function(d,g){var v=t(d,g,a,u);Array.isArray(v)&&(n[g]=v,i=!0);var y=d[0]===d[0].toLowerCase();switch(d[0]){case"m":case"M":a=d[1]+(y?a:0),u=d[2]+(y?u:0),l=a,h=u;return;case"h":case"H":a=d[1]+(y?a:0);return;case"v":case"V":u=d[1]+(y?u:0);return;case"z":case"Z":a=l,u=h;return;default:a=d[d.length-2]+(y?a:0),u=d[d.length-1]+(y?u:0)}}),!i)return this;for(c=[],p=0;p<r.length;p++)if(typeof n[p]<"u")for(m=0;m<n[p].length;m++)c.push(n[p][m]);else c.push(r[p]);return this.segments=c,this},lt.prototype.abs=function(){return this.iterate(function(t,e,r,n){var i=t[0],a=i.toUpperCase(),u;if(i!==a)switch(t[0]=a,i){case"v":t[1]+=n;return;case"a":t[6]+=r,t[7]+=n;return;default:for(u=1;u<t.length;u++)t[u]+=u%2?r:n}},!0),this},lt.prototype.rel=function(){return this.iterate(function(t,e,r,n){var i=t[0],a=i.toLowerCase(),u;if(i!==a&&!(e===0&&i==="M"))switch(t[0]=a,i){case"V":t[1]-=n;return;case"A":t[6]-=r,t[7]-=n;return;default:for(u=1;u<t.length;u++)t[u]-=u%2?r:n}},!0),this},lt.prototype.unarc=function(){return this.iterate(function(t,e,r,n){var i,a,u,l=[],h=t[0];return h!=="A"&&h!=="a"?null:(h==="a"?(a=r+t[6],u=n+t[7]):(a=t[6],u=t[7]),i=tP(r,n,a,u,t[4],t[5],t[1],t[2],t[3]),i.length===0?[[t[0]==="a"?"l":"L",t[6],t[7]]]:(i.forEach(function(p){l.push(["C",p[2],p[3],p[4],p[5],p[6],p[7]])}),l))}),this},lt.prototype.unshort=function(){var t=this.segments,e,r,n,i,a;return this.iterate(function(u,l,h,p){var m=u[0],c=m.toUpperCase(),d;l&&(c==="T"?(d=m==="t",n=t[l-1],n[0]==="Q"?(e=n[1]-h,r=n[2]-p):n[0]==="q"?(e=n[1]-n[3],r=n[2]-n[4]):(e=0,r=0),i=-e,a=-r,d||(i+=h,a+=p),t[l]=[d?"q":"Q",i,a,u[1],u[2]]):c==="S"&&(d=m==="s",n=t[l-1],n[0]==="C"?(e=n[3]-h,r=n[4]-p):n[0]==="c"?(e=n[3]-n[5],r=n[4]-n[6]):(e=0,r=0),i=-e,a=-r,d||(i+=h,a+=p),t[l]=[d?"c":"C",i,a,u[1],u[2],u[3],u[4]]))}),this};var nP=lt,iP=nP;const sP=Cn(iP),aP=te.forwardRef((t,e)=>{const[r,n]=te.useState(null),i=j.useRef(null),a=j.useRef(null),u=j.useRef(null),{path:l,visible:h,disabled:p,transformation:{x:m,y:c,width:d,height:g,anchor:v,hexColor:y,fill:b,stroke:x="none",strokeWidth:E=0,colorCorrection:w={}},pointerdown:I,pointerup:O}=t,F=De.useApp(),{temperatureFilter:N,sharpnessFilter:L,hueFilter:D,blurFilter:V,adjustmentFilter:Y,vignetteFilter:ie,noiseFilter:X}=Xn(w),{blurRadius:G=0,vignette:ae=0,noise:se=0}=w;return te.useEffect(()=>{const z=sP(l).scale(5).translate(0,0).toString(),Q=`<svg xmlns="http://www.w3.org/2000/svg" width="${d}" height="${g}">
|
|
1970
|
-
<path stroke="${
|
|
1969
|
+
*/(function(t,e){(function(r,i){t.exports=i()})(ew,function(){return function(i){for(var n={command:/\s*([achlmqstvz])/gi,number:/\s*([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/gi,comma:/\s*(?:(,)|\s)/g,flag:/\s*([01])/g},s={number:function(m){return+d("number",m)},"coordinate pair":function(m){var _=d("number",m);if(_===null&&!m)return null;d("comma");var g=d("number",!0);return{x:+_,y:+g}},"arc definition":function(m){var _=s["coordinate pair"](m);if(!_&&!m)return null;d("comma");var g=+d("number",!0);d("comma",!0);var y=!!+d("flag",!0);d("comma");var v=!!+d("flag",!0);d("comma");var x=s["coordinate pair"](!0);return{radii:_,rotation:g,large:y,clockwise:v,end:x}}},a=0,o=[];a<i.length;){var u=d("command"),c=u.toUpperCase(),f=u!==c,l;switch(c){case"M":l=p("coordinate pair").map(function(m,_){return _===1&&(u=f?"l":"L"),h({end:m})});break;case"L":case"T":l=p("coordinate pair").map(function(m){return h({end:m})});break;case"C":if(l=p("coordinate pair"),l.length%3)throw Error("Expected coordinate pair triplet at position "+a);l=l.reduce(function(m,_,g){var y=g%3;if(!y)m.push(h({cp1:_}));else{var v=m[m.length-1];v[y===1?"cp2":"end"]=_}return m},[]);break;case"Q":case"S":if(l=p("coordinate pair"),l.length&1)throw Error("Expected coordinate pair couple at position "+a);l=l.reduce(function(m,_,g){var y=g&1;if(!y)m.push(h({cp:_}));else{var v=m[m.length-1];v.end=_}return m},[]);break;case"H":case"V":l=p("number").map(function(m){return h({value:m})});break;case"A":l=p("arc definition").map(h);break;case"Z":l=[{code:"Z"}];break}o.push.apply(o,l)}return o;function h(m){return m.code=u,m.relative=f,m}function d(m,_){n[m].lastIndex=a;var g=n[m].exec(i);if(!g||g.index!==a){if(!_)return null;throw Error("Expected "+m+" at position "+a)}return a=n[m].lastIndex,g[1]}function p(m){for(var _=[],g,y=!0;g=s[m](y);)_.push(g),y=!!d("comma");return _}}})})(tw);const rw=/^\s+/,iw=/\s+$/;function L(t,e){if(t=t||"",e=e||{},t instanceof L)return t;if(!(this instanceof L))return new L(t,e);var r=nw(t);this._originalInput=t,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||r.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}L.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),e,r,i,n,s,a;return e=t.r/255,r=t.g/255,i=t.b/255,e<=.03928?n=e/12.92:n=Math.pow((e+.055)/1.055,2.4),r<=.03928?s=r/12.92:s=Math.pow((r+.055)/1.055,2.4),i<=.03928?a=i/12.92:a=Math.pow((i+.055)/1.055,2.4),.2126*n+.7152*s+.0722*a},setAlpha:function(t){return this._a=hc(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=ac(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=ac(this._r,this._g,this._b),e=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.v*100);return this._a==1?"hsv("+e+", "+r+"%, "+i+"%)":"hsva("+e+", "+r+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var t=sc(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=sc(this._r,this._g,this._b),e=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.l*100);return this._a==1?"hsl("+e+", "+r+"%, "+i+"%)":"hsla("+e+", "+r+"%, "+i+"%, "+this._roundA+")"},toHex:function(t){return oc(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return lw(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(ye(this._r,255)*100)+"%",g:Math.round(ye(this._g,255)*100)+"%",b:Math.round(ye(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(ye(this._r,255)*100)+"%, "+Math.round(ye(this._g,255)*100)+"%, "+Math.round(ye(this._b,255)*100)+"%)":"rgba("+Math.round(ye(this._r,255)*100)+"%, "+Math.round(ye(this._g,255)*100)+"%, "+Math.round(ye(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:xw[oc(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var e="#"+lc(this._r,this._g,this._b,this._a),r=e,i=this._gradientType?"GradientType = 1, ":"";if(t){var n=L(t);r="#"+lc(n._r,n._g,n._b,n._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,i=this._a<1&&this._a>=0,n=!e&&i&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return n?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return L(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(fw,arguments)},brighten:function(){return this._applyModification(dw,arguments)},darken:function(){return this._applyModification(pw,arguments)},desaturate:function(){return this._applyModification(uw,arguments)},saturate:function(){return this._applyModification(hw,arguments)},greyscale:function(){return this._applyModification(cw,arguments)},spin:function(){return this._applyModification(mw,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(vw,arguments)},complement:function(){return this._applyCombination(gw,arguments)},monochromatic:function(){return this._applyCombination(yw,arguments)},splitcomplement:function(){return this._applyCombination(_w,arguments)},triad:function(){return this._applyCombination(uc,[3])},tetrad:function(){return this._applyCombination(uc,[4])}},L.fromRatio=function(t,e){if(typeof t=="object"){var r={};for(var i in t)t.hasOwnProperty(i)&&(i==="a"?r[i]=t[i]:r[i]=xi(t[i]));t=r}return L(t,e)};function nw(t){var e={r:0,g:0,b:0},r=1,i=null,n=null,s=null,a=!1,o=!1;return typeof t=="string"&&(t=Sw(t)),typeof t=="object"&&(wt(t.r)&&wt(t.g)&&wt(t.b)?(e=sw(t.r,t.g,t.b),a=!0,o=String(t.r).substr(-1)==="%"?"prgb":"rgb"):wt(t.h)&&wt(t.s)&&wt(t.v)?(i=xi(t.s),n=xi(t.v),e=ow(t.h,i,n),a=!0,o="hsv"):wt(t.h)&&wt(t.s)&&wt(t.l)&&(i=xi(t.s),s=xi(t.l),e=aw(t.h,i,s),a=!0,o="hsl"),t.hasOwnProperty("a")&&(r=t.a)),r=hc(r),{ok:a,format:t.format||o,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:r}}function sw(t,e,r){return{r:ye(t,255)*255,g:ye(e,255)*255,b:ye(r,255)*255}}function sc(t,e,r){t=ye(t,255),e=ye(e,255),r=ye(r,255);var i=Math.max(t,e,r),n=Math.min(t,e,r),s,a,o=(i+n)/2;if(i==n)s=a=0;else{var u=i-n;switch(a=o>.5?u/(2-i-n):u/(i+n),i){case t:s=(e-r)/u+(e<r?6:0);break;case e:s=(r-t)/u+2;break;case r:s=(t-e)/u+4;break}s/=6}return{h:s,s:a,l:o}}function aw(t,e,r){var i,n,s;t=ye(t,360),e=ye(e,100),r=ye(r,100);function a(c,f,l){return l<0&&(l+=1),l>1&&(l-=1),l<1/6?c+(f-c)*6*l:l<1/2?f:l<2/3?c+(f-c)*(2/3-l)*6:c}if(e===0)i=n=s=r;else{var o=r<.5?r*(1+e):r+e-r*e,u=2*r-o;i=a(u,o,t+1/3),n=a(u,o,t),s=a(u,o,t-1/3)}return{r:i*255,g:n*255,b:s*255}}function ac(t,e,r){t=ye(t,255),e=ye(e,255),r=ye(r,255);var i=Math.max(t,e,r),n=Math.min(t,e,r),s,a,o=i,u=i-n;if(a=i===0?0:u/i,i==n)s=0;else{switch(i){case t:s=(e-r)/u+(e<r?6:0);break;case e:s=(r-t)/u+2;break;case r:s=(t-e)/u+4;break}s/=6}return{h:s,s:a,v:o}}function ow(t,e,r){t=ye(t,360)*6,e=ye(e,100),r=ye(r,100);var i=Math.floor(t),n=t-i,s=r*(1-e),a=r*(1-n*e),o=r*(1-(1-n)*e),u=i%6,c=[r,a,s,s,o,r][u],f=[o,r,r,a,s,s][u],l=[s,s,o,r,r,a][u];return{r:c*255,g:f*255,b:l*255}}function oc(t,e,r,i){var n=[ut(Math.round(t).toString(16)),ut(Math.round(e).toString(16)),ut(Math.round(r).toString(16))];return i&&n[0].charAt(0)==n[0].charAt(1)&&n[1].charAt(0)==n[1].charAt(1)&&n[2].charAt(0)==n[2].charAt(1)?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0):n.join("")}function lw(t,e,r,i,n){var s=[ut(Math.round(t).toString(16)),ut(Math.round(e).toString(16)),ut(Math.round(r).toString(16)),ut(cc(i))];return n&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}function lc(t,e,r,i){var n=[ut(cc(i)),ut(Math.round(t).toString(16)),ut(Math.round(e).toString(16)),ut(Math.round(r).toString(16))];return n.join("")}L.equals=function(t,e){return!t||!e?!1:L(t).toRgbString()==L(e).toRgbString()},L.random=function(){return L.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function uw(t,e){e=e===0?0:e||10;var r=L(t).toHsl();return r.s-=e/100,r.s=Gn(r.s),L(r)}function hw(t,e){e=e===0?0:e||10;var r=L(t).toHsl();return r.s+=e/100,r.s=Gn(r.s),L(r)}function cw(t){return L(t).desaturate(100)}function fw(t,e){e=e===0?0:e||10;var r=L(t).toHsl();return r.l+=e/100,r.l=Gn(r.l),L(r)}function dw(t,e){e=e===0?0:e||10;var r=L(t).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(e/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(e/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(e/100)))),L(r)}function pw(t,e){e=e===0?0:e||10;var r=L(t).toHsl();return r.l-=e/100,r.l=Gn(r.l),L(r)}function mw(t,e){var r=L(t).toHsl(),i=(r.h+e)%360;return r.h=i<0?360+i:i,L(r)}function gw(t){var e=L(t).toHsl();return e.h=(e.h+180)%360,L(e)}function uc(t,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var r=L(t).toHsl(),i=[L(t)],n=360/e,s=1;s<e;s++)i.push(L({h:(r.h+s*n)%360,s:r.s,l:r.l}));return i}function _w(t){var e=L(t).toHsl(),r=e.h;return[L(t),L({h:(r+72)%360,s:e.s,l:e.l}),L({h:(r+216)%360,s:e.s,l:e.l})]}function vw(t,e,r){e=e||6,r=r||30;var i=L(t).toHsl(),n=360/r,s=[L(t)];for(i.h=(i.h-(n*e>>1)+720)%360;--e;)i.h=(i.h+n)%360,s.push(L(i));return s}function yw(t,e){e=e||6;for(var r=L(t).toHsv(),i=r.h,n=r.s,s=r.v,a=[],o=1/e;e--;)a.push(L({h:i,s:n,v:s})),s=(s+o)%1;return a}L.mix=function(t,e,r){r=r===0?0:r||50;var i=L(t).toRgb(),n=L(e).toRgb(),s=r/100,a={r:(n.r-i.r)*s+i.r,g:(n.g-i.g)*s+i.g,b:(n.b-i.b)*s+i.b,a:(n.a-i.a)*s+i.a};return L(a)},L.readability=function(t,e){var r=L(t),i=L(e);return(Math.max(r.getLuminance(),i.getLuminance())+.05)/(Math.min(r.getLuminance(),i.getLuminance())+.05)},L.isReadable=function(t,e,r){var i=L.readability(t,e),n,s;switch(s=!1,n=Aw(r),n.level+n.size){case"AAsmall":case"AAAlarge":s=i>=4.5;break;case"AAlarge":s=i>=3;break;case"AAAsmall":s=i>=7;break}return s},L.mostReadable=function(t,e,r){var i=null,n=0,s,a,o,u;r=r||{},a=r.includeFallbackColors,o=r.level,u=r.size;for(var c=0;c<e.length;c++)s=L.readability(t,e[c]),s>n&&(n=s,i=L(e[c]));return L.isReadable(t,i,{level:o,size:u})||!a?i:(r.includeFallbackColors=!1,L.mostReadable(t,["#fff","#000"],r))};var Wa=L.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},xw=L.hexNames=bw(Wa);function bw(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}function hc(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function ye(t,e){Tw(t)&&(t="100%");var r=ww(t);return t=Math.min(e,Math.max(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function Gn(t){return Math.min(1,Math.max(0,t))}function Xe(t){return parseInt(t,16)}function Tw(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function ww(t){return typeof t=="string"&&t.indexOf("%")!=-1}function ut(t){return t.length==1?"0"+t:""+t}function xi(t){return t<=1&&(t=t*100+"%"),t}function cc(t){return Math.round(parseFloat(t)*255).toString(16)}function fc(t){return Xe(t)/255}var ht=function(){var t="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",r="(?:"+e+")|(?:"+t+")",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+i),rgba:new RegExp("rgba"+n),hsl:new RegExp("hsl"+i),hsla:new RegExp("hsla"+n),hsv:new RegExp("hsv"+i),hsva:new RegExp("hsva"+n),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function wt(t){return!!ht.CSS_UNIT.exec(t)}function Sw(t){t=t.replace(rw,"").replace(iw,"").toLowerCase();var e=!1;if(Wa[t])t=Wa[t],e=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=ht.rgb.exec(t))?{r:r[1],g:r[2],b:r[3]}:(r=ht.rgba.exec(t))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=ht.hsl.exec(t))?{h:r[1],s:r[2],l:r[3]}:(r=ht.hsla.exec(t))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=ht.hsv.exec(t))?{h:r[1],s:r[2],v:r[3]}:(r=ht.hsva.exec(t))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=ht.hex8.exec(t))?{r:Xe(r[1]),g:Xe(r[2]),b:Xe(r[3]),a:fc(r[4]),format:e?"name":"hex8"}:(r=ht.hex6.exec(t))?{r:Xe(r[1]),g:Xe(r[2]),b:Xe(r[3]),format:e?"name":"hex"}:(r=ht.hex4.exec(t))?{r:Xe(r[1]+""+r[1]),g:Xe(r[2]+""+r[2]),b:Xe(r[3]+""+r[3]),a:fc(r[4]+""+r[4]),format:e?"name":"hex8"}:(r=ht.hex3.exec(t))?{r:Xe(r[1]+""+r[1]),g:Xe(r[2]+""+r[2]),b:Xe(r[3]+""+r[3]),format:e?"name":"hex"}:!1}function Aw(t){var e,r;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:e,size:r}}var Ew=function(){function t(e,r){var i=[],n=!0,s=!1,a=void 0;try{for(var o=e[Symbol.iterator](),u;!(n=(u=o.next()).done)&&(i.push(u.value),!(r&&i.length===r));n=!0);}catch(c){s=!0,a=c}finally{try{!n&&o.return&&o.return()}finally{if(s)throw a}}return i}return function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),bi=Math.PI*2,qa=function(e,r,i,n,s,a,o){var u=e.x,c=e.y;u*=r,c*=i;var f=n*u-s*c,l=s*u+n*c;return{x:f+a,y:l+o}},Cw=function(e,r){var i=r===1.5707963267948966?.551915024494:r===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(r/4),n=Math.cos(e),s=Math.sin(e),a=Math.cos(e+r),o=Math.sin(e+r);return[{x:n-s*i,y:s+n*i},{x:a+o*i,y:o-a*i},{x:a,y:o}]},dc=function(e,r,i,n){var s=e*n-r*i<0?-1:1,a=e*i+r*n;return a>1&&(a=1),a<-1&&(a=-1),s*Math.acos(a)},Iw=function(e,r,i,n,s,a,o,u,c,f,l,h){var d=Math.pow(s,2),p=Math.pow(a,2),m=Math.pow(l,2),_=Math.pow(h,2),g=d*p-d*_-p*m;g<0&&(g=0),g/=d*_+p*m,g=Math.sqrt(g)*(o===u?-1:1);var y=g*s/a*h,v=g*-a/s*l,x=f*y-c*v+(e+i)/2,T=c*y+f*v+(r+n)/2,b=(l-y)/s,w=(h-v)/a,S=(-l-y)/s,A=(-h-v)/a,C=dc(1,0,b,w),F=dc(b,w,S,A);return u===0&&F>0&&(F-=bi),u===1&&F<0&&(F+=bi),[x,T,C,F]},pc=function(e){var r=e.px,i=e.py,n=e.cx,s=e.cy,a=e.rx,o=e.ry,u=e.xAxisRotation,c=u===void 0?0:u,f=e.largeArcFlag,l=f===void 0?0:f,h=e.sweepFlag,d=h===void 0?0:h,p=[];if(a===0||o===0)return[];var m=Math.sin(c*bi/360),_=Math.cos(c*bi/360),g=_*(r-n)/2+m*(i-s)/2,y=-m*(r-n)/2+_*(i-s)/2;if(g===0&&y===0)return[];a=Math.abs(a),o=Math.abs(o);var v=Math.pow(g,2)/Math.pow(a,2)+Math.pow(y,2)/Math.pow(o,2);v>1&&(a*=Math.sqrt(v),o*=Math.sqrt(v));var x=Iw(r,i,n,s,a,o,l,d,m,_,g,y),T=Ew(x,4),b=T[0],w=T[1],S=T[2],A=T[3],C=Math.abs(A)/(bi/4);Math.abs(1-C)<1e-7&&(C=1);var F=Math.max(Math.ceil(C),1);A/=F;for(var G=0;G<F;G++)p.push(Cw(S,A)),S+=A;return p.map(function(R){var E=qa(R[0],a,o,_,m,b,w),B=E.x,U=E.y,I=qa(R[1],a,o,_,m,b,w),$=I.x,X=I.y,M=qa(R[2],a,o,_,m,b,w),O=M.x,j=M.y;return{x1:B,y1:U,x2:$,y2:X,x:O,y:j}})};class Rw extends Va{constructor(e){super(),this.lineColor=null,e&&this.drawSVG(e)}drawSVG(e){if(typeof e=="string"){const r=document.createElement("div");r.innerHTML=e.trim(),e=r.querySelector("svg")}if(!e)throw new Error("Missing <svg> element in SVG constructor");return this._svgFill(e),this._svgChildren(e.children),this}_svgChildren(e,r=!1){for(let i=0;i<e.length;i++){const n=e[i];switch(this._svgFill(n,r),n.nodeName.toLowerCase()){case"path":{this._svgPath(n);break}case"circle":case"ellipse":{this._svgCircle(n);break}case"rect":{this._svgRect(n);break}case"polygon":{this._svgPoly(n,!0);break}case"polyline":{this._svgPoly(n);break}case"g":break;default:{console.info(`[PIXI.SVG] <${n.nodeName}> elements unsupported`);break}}this._svgChildren(n.children,!0)}}_hexToUint(e){if(e[0]==="#")return e=e.substr(1),e.length===3&&(e=e.replace(/([a-f0-9])/ig,"$1$1")),parseInt(e,16);const{r,g:i,b:n}=L(e).toRgb();return(r<<16)+(i<<8)+n}_svgCircle(e){let r="r",i="r";const n=e.nodeName==="elipse";n&&(r+="x",i+="y");const s=parseFloat(e.getAttribute(i)),a=parseFloat(e.getAttribute(r)),o=e.getAttribute("cx"),u=e.getAttribute("cy");let c=0,f=0;o!==null&&(c=parseFloat(o)),u!==null&&(f=parseFloat(u)),n?this.drawEllipse(c,f,s,a):this.drawCircle(c,f,s)}_svgRect(e){const r=parseFloat(e.getAttribute("x")),i=parseFloat(e.getAttribute("y")),n=parseFloat(e.getAttribute("width")),s=parseFloat(e.getAttribute("height")),a=parseFloat(e.getAttribute("rx"));a?this.drawRoundedRect(r,i,n,s,a):this.drawRect(r,i,n,s)}_convertStyleName(e){return e.trim().replace("-width","Width").replace(/.*-(line)?/,"")}_svgStyle(e){const r=e.getAttribute("style"),i=e.getAttribute("opacity"),n={fill:e.getAttribute("fill"),opacity:i||e.getAttribute("fill-opacity"),stroke:e.getAttribute("stroke"),strokeOpacity:i||e.getAttribute("stroke-opacity"),strokeWidth:e.getAttribute("stroke-width"),cap:e.getAttribute("stroke-linecap"),join:e.getAttribute("stroke-linejoin"),miterLimit:e.getAttribute("stroke-miterlimit")};return r!==null&&r.split(";").forEach(s=>{const[a,o]=s.split(":");if(a){const u=this._convertStyleName(a);n[u]||(n[u]=o.trim())}}),n}_svgPoly(e,r){const i=e.getAttribute("points").split(/[ ,]/g).map(n=>parseInt(n,10));this.drawPolygon(i),r&&this.closePath()}_svgFill(e,r){const{fill:i,opacity:n,stroke:s,strokeOpacity:a,strokeWidth:o,cap:u,join:c,miterLimit:f}=this._svgStyle(e),h=o!==null?parseFloat(o):s!==null?1:0,d=s!==null?this._hexToUint(s):this.lineColor;i?i==="none"?this.beginFill(0,0):this.beginFill(this._hexToUint(i),n!==null?parseFloat(n):1):r||this.beginFill(0),this.lineStyle({width:s===null&&o===null&&r?this.line.width:h,alpha:a===null?this.line.alpha:parseFloat(a),color:s===null&&r?this.line.color:d,cap:u===null&&r?this.line.cap:u,join:c===null&&r?this.line.join:c,miterLimit:f===null&&r?this.line.miterLimit:parseFloat(f)}),e.getAttribute("fill-rule")&&console.info('[PIXI.SVG] "fill-rule" attribute is not supported')}_svgPath(e){const r=e.getAttribute("d");let i=0,n=0;const s=Xa(r.trim());for(let a=0;a<s.length;a++){const o=s[a];switch(o.code){case"m":{this.moveTo(i+=o.end.x,n+=o.end.y);break}case"M":{this.moveTo(i=o.end.x,n=o.end.y);break}case"H":{this.lineTo(i=o.value,n);break}case"h":{this.lineTo(i+=o.value,n);break}case"V":{this.lineTo(i,n=o.value);break}case"v":{this.lineTo(i,n+=o.value);break}case"Z":{this.closePath();break}case"L":{this.lineTo(i=o.end.x,n=o.end.y);break}case"l":{this.lineTo(i+=o.end.x,n+=o.end.y);break}case"C":{this.bezierCurveTo(o.cp1.x,o.cp1.y,o.cp2.x,o.cp2.y,i=o.end.x,n=o.end.y);break}case"c":{const u=i,c=n;this.bezierCurveTo(u+o.cp1.x,c+o.cp1.y,u+o.cp2.x,c+o.cp2.y,i+=o.end.x,n+=o.end.y);break}case"s":case"q":{const u=i,c=n;this.quadraticCurveTo(u+o.cp.x,c+o.cp.y,i+=o.end.x,n+=o.end.y);break}case"S":case"Q":{this.quadraticCurveTo(o.cp.x,o.cp.y,i=o.end.x,n=o.end.y);break}case"a":{pc({px:i,py:n,cx:i+=o.end.x,cy:n+=o.end.y,rx:o.radii.x,ry:o.radii.y,xAxisRotation:o.rotation,largeArcFlag:o.large?1:0,sweepFlag:o.clockwise?1:0}).forEach(({x1:u,y1:c,x2:f,y2:l,x:h,y:d})=>this.bezierCurveTo(u,c,f,l,h,d));break}case"A":{pc({px:i,py:n,cx:i=o.end.x,cy:n=o.end.y,rx:o.radii.x,ry:o.radii.y,xAxisRotation:o.rotation,largeArcFlag:o.large?1:0,sweepFlag:o.clockwise?1:0}).forEach(({x1:u,y1:c,x2:f,y2:l,x:h,y:d})=>this.bezierCurveTo(u,c,f,l,h,d));break}default:{console.info("[PIXI.SVG] Draw command not supported:",o.code,o);break}}}}}var zn={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},Pw=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function Mw(t){return t===10||t===13||t===8232||t===8233||t===32||t===9||t===11||t===12||t===160||t>=5760&&Pw.indexOf(t)>=0}function Fw(t){switch(t|32){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}function Ow(t){return(t|32)===97}function Ur(t){return t>=48&&t<=57}function Nw(t){return t>=48&&t<=57||t===43||t===45||t===46}function kw(t){this.index=0,this.path=t,this.max=t.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function jn(t){for(;t.index<t.max&&Mw(t.path.charCodeAt(t.index));)t.index++}function Dw(t){var e=t.path.charCodeAt(t.index);if(e===48){t.param=0,t.index++;return}if(e===49){t.param=1,t.index++;return}t.err="SvgPath: arc flag can be 0 or 1 only (at pos "+t.index+")"}function Lw(t){var e=t.index,r=e,i=t.max,n=!1,s=!1,a=!1,o=!1,u;if(r>=i){t.err="SvgPath: missed param (at pos "+r+")";return}if(u=t.path.charCodeAt(r),(u===43||u===45)&&(r++,u=r<i?t.path.charCodeAt(r):0),!Ur(u)&&u!==46){t.err="SvgPath: param should start with 0..9 or `.` (at pos "+r+")";return}if(u!==46){if(n=u===48,r++,u=r<i?t.path.charCodeAt(r):0,n&&r<i&&u&&Ur(u)){t.err="SvgPath: numbers started with `0` such as `09` are illegal (at pos "+e+")";return}for(;r<i&&Ur(t.path.charCodeAt(r));)r++,s=!0;u=r<i?t.path.charCodeAt(r):0}if(u===46){for(o=!0,r++;Ur(t.path.charCodeAt(r));)r++,a=!0;u=r<i?t.path.charCodeAt(r):0}if(u===101||u===69){if(o&&!s&&!a){t.err="SvgPath: invalid float exponent (at pos "+r+")";return}if(r++,u=r<i?t.path.charCodeAt(r):0,(u===43||u===45)&&r++,r<i&&Ur(t.path.charCodeAt(r)))for(;r<i&&Ur(t.path.charCodeAt(r));)r++;else{t.err="SvgPath: invalid float exponent (at pos "+r+")";return}}t.index=r,t.param=parseFloat(t.path.slice(e,r))+0}function Ya(t){var e,r;e=t.path[t.segmentStart],r=e.toLowerCase();var i=t.data;if(r==="m"&&i.length>2&&(t.result.push([e,i[0],i[1]]),i=i.slice(2),r="l",e=e==="m"?"l":"L"),r==="r")t.result.push([e].concat(i));else for(;i.length>=zn[r]&&(t.result.push([e].concat(i.splice(0,zn[r]))),!!zn[r]););}function Bw(t){var e=t.max,r,i,n,s,a;if(t.segmentStart=t.index,r=t.path.charCodeAt(t.index),i=Ow(r),!Fw(r)){t.err="SvgPath: bad command "+t.path[t.index]+" (at pos "+t.index+")";return}if(s=zn[t.path[t.index].toLowerCase()],t.index++,jn(t),t.data=[],!s){Ya(t);return}for(n=!1;;){for(a=s;a>0;a--){if(i&&(a===3||a===4)?Dw(t):Lw(t),t.err.length){Ya(t);return}t.data.push(t.param),jn(t),n=!1,t.index<e&&t.path.charCodeAt(t.index)===44&&(t.index++,jn(t),n=!0)}if(!n&&(t.index>=t.max||!Nw(t.path.charCodeAt(t.index))))break}Ya(t)}var Uw=function(e){var r=new kw(e),i=r.max;for(jn(r);r.index<i&&!r.err.length;)Bw(r);return r.result.length&&("mM".indexOf(r.result[0][0])<0?(r.err="SvgPath: string should start with `M` or `m`",r.result=[]):r.result[0][0]="M"),{err:r.err,segments:r.result}};function $w(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}function ct(){if(!(this instanceof ct))return new ct;this.queue=[],this.cache=null}ct.prototype.matrix=function(t){return t[0]===1&&t[1]===0&&t[2]===0&&t[3]===1&&t[4]===0&&t[5]===0?this:(this.cache=null,this.queue.push(t),this)},ct.prototype.translate=function(t,e){return(t!==0||e!==0)&&(this.cache=null,this.queue.push([1,0,0,1,t,e])),this},ct.prototype.scale=function(t,e){return(t!==1||e!==1)&&(this.cache=null,this.queue.push([t,0,0,e,0,0])),this},ct.prototype.rotate=function(t,e,r){var i,n,s;return t!==0&&(this.translate(e,r),i=t*Math.PI/180,n=Math.cos(i),s=Math.sin(i),this.queue.push([n,s,-s,n,0,0]),this.cache=null,this.translate(-e,-r)),this},ct.prototype.skewX=function(t){return t!==0&&(this.cache=null,this.queue.push([1,0,Math.tan(t*Math.PI/180),1,0,0])),this},ct.prototype.skewY=function(t){return t!==0&&(this.cache=null,this.queue.push([1,Math.tan(t*Math.PI/180),0,1,0,0])),this},ct.prototype.toArray=function(){if(this.cache)return this.cache;if(!this.queue.length)return this.cache=[1,0,0,1,0,0],this.cache;if(this.cache=this.queue[0],this.queue.length===1)return this.cache;for(var t=1;t<this.queue.length;t++)this.cache=$w(this.cache,this.queue[t]);return this.cache},ct.prototype.calc=function(t,e,r){var i;return this.queue.length?(this.cache||(this.cache=this.toArray()),i=this.cache,[t*i[0]+e*i[2]+(r?0:i[4]),t*i[1]+e*i[3]+(r?0:i[5])]):[t,e]};var mc=ct,Gw=mc,zw={matrix:!0,scale:!0,rotate:!0,translate:!0,skewX:!0,skewY:!0},jw=/\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/,Hw=/[\s,]+/,Vw=function(e){var r=new Gw,i,n;return e.split(jw).forEach(function(s){if(s.length){if(typeof zw[s]<"u"){i=s;return}switch(n=s.split(Hw).map(function(a){return+a||0}),i){case"matrix":n.length===6&&r.matrix(n);return;case"scale":n.length===1?r.scale(n[0],n[0]):n.length===2&&r.scale(n[0],n[1]);return;case"rotate":n.length===1?r.rotate(n[0],0,0):n.length===3&&r.rotate(n[0],n[1],n[2]);return;case"translate":n.length===1?r.translate(n[0],0):n.length===2&&r.translate(n[0],n[1]);return;case"skewX":n.length===1&&r.skewX(n[0]);return;case"skewY":n.length===1&&r.skewY(n[0]);return}}}),r},Ti=Math.PI*2;function gc(t,e,r,i){var n=t*i-e*r<0?-1:1,s=t*r+e*i;return s>1&&(s=1),s<-1&&(s=-1),n*Math.acos(s)}function Xw(t,e,r,i,n,s,a,o,u,c){var f=c*(t-r)/2+u*(e-i)/2,l=-u*(t-r)/2+c*(e-i)/2,h=a*a,d=o*o,p=f*f,m=l*l,_=h*d-h*m-d*p;_<0&&(_=0),_/=h*m+d*p,_=Math.sqrt(_)*(n===s?-1:1);var g=_*a/o*l,y=_*-o/a*f,v=c*g-u*y+(t+r)/2,x=u*g+c*y+(e+i)/2,T=(f-g)/a,b=(l-y)/o,w=(-f-g)/a,S=(-l-y)/o,A=gc(1,0,T,b),C=gc(T,b,w,S);return s===0&&C>0&&(C-=Ti),s===1&&C<0&&(C+=Ti),[v,x,A,C]}function Ww(t,e){var r=1.3333333333333333*Math.tan(e/4),i=Math.cos(t),n=Math.sin(t),s=Math.cos(t+e),a=Math.sin(t+e);return[i,n,i-n*r,n+i*r,s+a*r,a-s*r,s,a]}var qw=function(e,r,i,n,s,a,o,u,c){var f=Math.sin(c*Ti/360),l=Math.cos(c*Ti/360),h=l*(e-i)/2+f*(r-n)/2,d=-f*(e-i)/2+l*(r-n)/2;if(h===0&&d===0)return[];if(o===0||u===0)return[];o=Math.abs(o),u=Math.abs(u);var p=h*h/(o*o)+d*d/(u*u);p>1&&(o*=Math.sqrt(p),u*=Math.sqrt(p));var m=Xw(e,r,i,n,s,a,o,u,f,l),_=[],g=m[2],y=m[3],v=Math.max(Math.ceil(Math.abs(y)/(Ti/4)),1);y/=v;for(var x=0;x<v;x++)_.push(Ww(g,y)),g+=y;return _.map(function(T){for(var b=0;b<T.length;b+=2){var w=T[b+0],S=T[b+1];w*=o,S*=u;var A=l*w-f*S,C=f*w+l*S;T[b+0]=A+m[0],T[b+1]=C+m[1]}return T})},wi=1e-10,_c=Math.PI/180;function Si(t,e,r){if(!(this instanceof Si))return new Si(t,e,r);this.rx=t,this.ry=e,this.ax=r}Si.prototype.transform=function(t){var e=Math.cos(this.ax*_c),r=Math.sin(this.ax*_c),i=[this.rx*(t[0]*e+t[2]*r),this.rx*(t[1]*e+t[3]*r),this.ry*(-t[0]*r+t[2]*e),this.ry*(-t[1]*r+t[3]*e)],n=i[0]*i[0]+i[2]*i[2],s=i[1]*i[1]+i[3]*i[3],a=((i[0]-i[3])*(i[0]-i[3])+(i[2]+i[1])*(i[2]+i[1]))*((i[0]+i[3])*(i[0]+i[3])+(i[2]-i[1])*(i[2]-i[1])),o=(n+s)/2;if(a<wi*o)return this.rx=this.ry=Math.sqrt(o),this.ax=0,this;var u=i[0]*i[1]+i[2]*i[3];a=Math.sqrt(a);var c=o+a/2,f=o-a/2;return this.ax=Math.abs(u)<wi&&Math.abs(c-s)<wi?90:Math.atan(Math.abs(u)>Math.abs(c-s)?(c-n)/u:u/(c-s))*180/Math.PI,this.ax>=0?(this.rx=Math.sqrt(c),this.ry=Math.sqrt(f)):(this.ax+=90,this.rx=Math.sqrt(f),this.ry=Math.sqrt(c)),this},Si.prototype.isDegenerate=function(){return this.rx<wi*this.ry||this.ry<wi*this.rx};var Yw=Si,Kw=Uw,Zw=Vw,Bt=mc,Qw=qw,Jw=Yw;function Te(t){if(!(this instanceof Te))return new Te(t);var e=Kw(t);this.segments=e.segments,this.err=e.err,this.__stack=[]}Te.from=function(t){if(typeof t=="string")return new Te(t);if(t instanceof Te){var e=new Te("");return e.err=t.err,e.segments=t.segments.map(function(r){return r.slice()}),e.__stack=t.__stack.map(function(r){return Bt().matrix(r.toArray())}),e}throw new Error("SvgPath.from: invalid param type "+t)},Te.prototype.__matrix=function(t){var e=this,r;t.queue.length&&this.iterate(function(i,n,s,a){var o,u,c,f;switch(i[0]){case"v":o=t.calc(0,i[1],!0),u=o[0]===0?["v",o[1]]:["l",o[0],o[1]];break;case"V":o=t.calc(s,i[1],!1),u=o[0]===t.calc(s,a,!1)[0]?["V",o[1]]:["L",o[0],o[1]];break;case"h":o=t.calc(i[1],0,!0),u=o[1]===0?["h",o[0]]:["l",o[0],o[1]];break;case"H":o=t.calc(i[1],a,!1),u=o[1]===t.calc(s,a,!1)[1]?["H",o[0]]:["L",o[0],o[1]];break;case"a":case"A":var l=t.toArray(),h=Jw(i[1],i[2],i[3]).transform(l);if(l[0]*l[3]-l[1]*l[2]<0&&(i[5]=i[5]?"0":"1"),o=t.calc(i[6],i[7],i[0]==="a"),i[0]==="A"&&i[6]===s&&i[7]===a||i[0]==="a"&&i[6]===0&&i[7]===0){u=[i[0]==="a"?"l":"L",o[0],o[1]];break}h.isDegenerate()?u=[i[0]==="a"?"l":"L",o[0],o[1]]:u=[i[0],h.rx,h.ry,h.ax,i[4],i[5],o[0],o[1]];break;case"m":f=n>0,o=t.calc(i[1],i[2],f),u=["m",o[0],o[1]];break;default:for(c=i[0],u=[c],f=c.toLowerCase()===c,r=1;r<i.length;r+=2)o=t.calc(i[r],i[r+1],f),u.push(o[0],o[1])}e.segments[n]=u},!0)},Te.prototype.__evaluateStack=function(){var t,e;if(this.__stack.length){if(this.__stack.length===1){this.__matrix(this.__stack[0]),this.__stack=[];return}for(t=Bt(),e=this.__stack.length;--e>=0;)t.matrix(this.__stack[e].toArray());this.__matrix(t),this.__stack=[]}},Te.prototype.toString=function(){var t="",e="",r=!1;this.__evaluateStack();for(var i=0,n=this.segments.length;i<n;i++){var s=this.segments[i],a=s[0];a!==e||a==="m"||a==="M"?(a==="m"&&e==="z"&&(t+=" "),t+=a,r=!1):r=!0;for(var o=1;o<s.length;o++){var u=s[o];o===1?r&&u>=0&&(t+=" "):u>=0&&(t+=" "),t+=u}e=a}return t},Te.prototype.translate=function(t,e){return this.__stack.push(Bt().translate(t,e||0)),this},Te.prototype.scale=function(t,e){return this.__stack.push(Bt().scale(t,!e&&e!==0?t:e)),this},Te.prototype.rotate=function(t,e,r){return this.__stack.push(Bt().rotate(t,e||0,r||0)),this},Te.prototype.skewX=function(t){return this.__stack.push(Bt().skewX(t)),this},Te.prototype.skewY=function(t){return this.__stack.push(Bt().skewY(t)),this},Te.prototype.matrix=function(t){return this.__stack.push(Bt().matrix(t)),this},Te.prototype.transform=function(t){return t.trim()?(this.__stack.push(Zw(t)),this):this},Te.prototype.round=function(t){var e=0,r=0,i=0,n=0,s;return t=t||0,this.__evaluateStack(),this.segments.forEach(function(a){var o=a[0].toLowerCase()===a[0];switch(a[0]){case"H":case"h":o&&(a[1]+=i),i=a[1]-a[1].toFixed(t),a[1]=+a[1].toFixed(t);return;case"V":case"v":o&&(a[1]+=n),n=a[1]-a[1].toFixed(t),a[1]=+a[1].toFixed(t);return;case"Z":case"z":i=e,n=r;return;case"M":case"m":o&&(a[1]+=i,a[2]+=n),i=a[1]-a[1].toFixed(t),n=a[2]-a[2].toFixed(t),e=i,r=n,a[1]=+a[1].toFixed(t),a[2]=+a[2].toFixed(t);return;case"A":case"a":o&&(a[6]+=i,a[7]+=n),i=a[6]-a[6].toFixed(t),n=a[7]-a[7].toFixed(t),a[1]=+a[1].toFixed(t),a[2]=+a[2].toFixed(t),a[3]=+a[3].toFixed(t+2),a[6]=+a[6].toFixed(t),a[7]=+a[7].toFixed(t);return;default:s=a.length,o&&(a[s-2]+=i,a[s-1]+=n),i=a[s-2]-a[s-2].toFixed(t),n=a[s-1]-a[s-1].toFixed(t),a.forEach(function(u,c){c&&(a[c]=+a[c].toFixed(t))});return}}),this},Te.prototype.iterate=function(t,e){var r=this.segments,i={},n=!1,s=0,a=0,o=0,u=0,c,f,l;if(e||this.__evaluateStack(),r.forEach(function(h,d){var p=t(h,d,s,a);Array.isArray(p)&&(i[d]=p,n=!0);var m=h[0]===h[0].toLowerCase();switch(h[0]){case"m":case"M":s=h[1]+(m?s:0),a=h[2]+(m?a:0),o=s,u=a;return;case"h":case"H":s=h[1]+(m?s:0);return;case"v":case"V":a=h[1]+(m?a:0);return;case"z":case"Z":s=o,a=u;return;default:s=h[h.length-2]+(m?s:0),a=h[h.length-1]+(m?a:0)}}),!n)return this;for(l=[],c=0;c<r.length;c++)if(typeof i[c]<"u")for(f=0;f<i[c].length;f++)l.push(i[c][f]);else l.push(r[c]);return this.segments=l,this},Te.prototype.abs=function(){return this.iterate(function(t,e,r,i){var n=t[0],s=n.toUpperCase(),a;if(n!==s)switch(t[0]=s,n){case"v":t[1]+=i;return;case"a":t[6]+=r,t[7]+=i;return;default:for(a=1;a<t.length;a++)t[a]+=a%2?r:i}},!0),this},Te.prototype.rel=function(){return this.iterate(function(t,e,r,i){var n=t[0],s=n.toLowerCase(),a;if(n!==s&&!(e===0&&n==="M"))switch(t[0]=s,n){case"V":t[1]-=i;return;case"A":t[6]-=r,t[7]-=i;return;default:for(a=1;a<t.length;a++)t[a]-=a%2?r:i}},!0),this},Te.prototype.unarc=function(){return this.iterate(function(t,e,r,i){var n,s,a,o=[],u=t[0];return u!=="A"&&u!=="a"?null:(u==="a"?(s=r+t[6],a=i+t[7]):(s=t[6],a=t[7]),n=Qw(r,i,s,a,t[4],t[5],t[1],t[2],t[3]),n.length===0?[[t[0]==="a"?"l":"L",t[6],t[7]]]:(n.forEach(function(c){o.push(["C",c[2],c[3],c[4],c[5],c[6],c[7]])}),o))}),this},Te.prototype.unshort=function(){var t=this.segments,e,r,i,n,s;return this.iterate(function(a,o,u,c){var f=a[0],l=f.toUpperCase(),h;o&&(l==="T"?(h=f==="t",i=t[o-1],i[0]==="Q"?(e=i[1]-u,r=i[2]-c):i[0]==="q"?(e=i[1]-i[3],r=i[2]-i[4]):(e=0,r=0),n=-e,s=-r,h||(n+=u,s+=c),t[o]=[h?"q":"Q",n,s,a[1],a[2]]):l==="S"&&(h=f==="s",i=t[o-1],i[0]==="C"?(e=i[3]-u,r=i[4]-c):i[0]==="c"?(e=i[3]-i[5],r=i[4]-i[6]):(e=0,r=0),n=-e,s=-r,h||(n+=u,s+=c),t[o]=[h?"c":"C",n,s,a[1],a[2],a[3],a[4]]))}),this};var eS=Te,tS=eS;const rS=$t(tS),iS=D.forwardRef((t,e)=>{const[r,i]=D.useState(null),n=P.useRef(null),s=P.useRef(null),a=P.useRef(null),{path:o,visible:u,disabled:c,transformation:{x:f,y:l,width:h,height:d,anchor:p,hexColor:m,fill:_,stroke:g="none",strokeWidth:y=0,colorCorrection:v={}},pointerdown:x,pointerup:T}=t,b=ie.useApp(),{temperatureFilter:w,sharpnessFilter:S,hueFilter:A,blurFilter:C,adjustmentFilter:F,vignetteFilter:G,noiseFilter:R}=ir(v),{blurRadius:E=0,vignette:B=0,noise:U=0}=v;return D.useEffect(()=>{const I=rS(o).scale(5).translate(0,0).toString(),$=`<svg xmlns="http://www.w3.org/2000/svg" width="${h}" height="${d}">
|
|
1970
|
+
<path stroke="${g}" stroke-width="${y}" fill="${m||_}" d="${I}">
|
|
1971
1971
|
</path>
|
|
1972
|
-
</svg>`,
|
|
1972
|
+
</svg>`,X=new Rw($),M=b.renderer.generateTexture(X);return i(M),()=>{}},[b,o,g,y,m,_]),Y.jsx(jt,{...t,ref:e,children:Y.jsx(ie.Container,{ref:s,children:Y.jsx(ie.Container,{ref:a,children:r&&Y.jsx(ie.Sprite,{texture:r,width:h,height:d,anchor:p,ref:n,x:f,y:l,alpha:u?1:0,...!c&&u&&{interactive:!0,pointerdown:x,pointerup:T},filters:[w,S,A,F,...E>0?[C]:[],...B>0?[G]:[],...U>0?[R]:[]]})})})})});var vc={};/*!
|
|
1973
1973
|
* howler.js v2.2.3
|
|
1974
1974
|
* howlerjs.com
|
|
1975
1975
|
*
|
|
@@ -1977,7 +1977,7 @@ void main() {
|
|
|
1977
1977
|
* goldfirestudios.com
|
|
1978
1978
|
*
|
|
1979
1979
|
* MIT License
|
|
1980
|
-
*/(function(t){(function(){var e=function(){this.init()};e.prototype={init:function(){var c=this||r;return c._counter=1e3,c._html5AudioPool=[],c.html5PoolSize=10,c._codecs={},c._howls=[],c._muted=!1,c._volume=1,c._canPlayEvent="canplaythrough",c._navigator=typeof window<"u"&&window.navigator?window.navigator:null,c.masterGain=null,c.noAudio=!1,c.usingWebAudio=!0,c.autoSuspend=!0,c.ctx=null,c.autoUnlock=!0,c._setup(),c},volume:function(c){var d=this||r;if(c=parseFloat(c),d.ctx||m(),typeof c<"u"&&c>=0&&c<=1){if(d._volume=c,d._muted)return d;d.usingWebAudio&&d.masterGain.gain.setValueAtTime(c,r.ctx.currentTime);for(var g=0;g<d._howls.length;g++)if(!d._howls[g]._webAudio)for(var v=d._howls[g]._getSoundIds(),y=0;y<v.length;y++){var b=d._howls[g]._soundById(v[y]);b&&b._node&&(b._node.volume=b._volume*c)}return d}return d._volume},mute:function(c){var d=this||r;d.ctx||m(),d._muted=c,d.usingWebAudio&&d.masterGain.gain.setValueAtTime(c?0:d._volume,r.ctx.currentTime);for(var g=0;g<d._howls.length;g++)if(!d._howls[g]._webAudio)for(var v=d._howls[g]._getSoundIds(),y=0;y<v.length;y++){var b=d._howls[g]._soundById(v[y]);b&&b._node&&(b._node.muted=c?!0:b._muted)}return d},stop:function(){for(var c=this||r,d=0;d<c._howls.length;d++)c._howls[d].stop();return c},unload:function(){for(var c=this||r,d=c._howls.length-1;d>=0;d--)c._howls[d].unload();return c.usingWebAudio&&c.ctx&&typeof c.ctx.close<"u"&&(c.ctx.close(),c.ctx=null,m()),c},codecs:function(c){return(this||r)._codecs[c.replace(/^x-/,"")]},_setup:function(){var c=this||r;if(c.state=c.ctx&&c.ctx.state||"suspended",c._autoSuspend(),!c.usingWebAudio)if(typeof Audio<"u")try{var d=new Audio;typeof d.oncanplaythrough>"u"&&(c._canPlayEvent="canplay")}catch{c.noAudio=!0}else c.noAudio=!0;try{var d=new Audio;d.muted&&(c.noAudio=!0)}catch{}return c.noAudio||c._setupCodecs(),c},_setupCodecs:function(){var c=this||r,d=null;try{d=typeof Audio<"u"?new Audio:null}catch{return c}if(!d||typeof d.canPlayType!="function")return c;var g=d.canPlayType("audio/mpeg;").replace(/^no$/,""),v=c._navigator?c._navigator.userAgent:"",y=v.match(/OPR\/([0-6].)/g),b=y&&parseInt(y[0].split("/")[1],10)<33,x=v.indexOf("Safari")!==-1&&v.indexOf("Chrome")===-1,E=v.match(/Version\/(.*?) /),w=x&&E&&parseInt(E[1],10)<15;return c._codecs={mp3:!!(!b&&(g||d.canPlayType("audio/mp3;").replace(/^no$/,""))),mpeg:!!g,opus:!!d.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!d.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!d.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(d.canPlayType('audio/wav; codecs="1"')||d.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!d.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!d.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(d.canPlayType("audio/x-m4a;")||d.canPlayType("audio/m4a;")||d.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(d.canPlayType("audio/x-m4b;")||d.canPlayType("audio/m4b;")||d.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(d.canPlayType("audio/x-mp4;")||d.canPlayType("audio/mp4;")||d.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!!(!w&&d.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!!(!w&&d.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!d.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(d.canPlayType("audio/x-flac;")||d.canPlayType("audio/flac;")).replace(/^no$/,"")},c},_unlockAudio:function(){var c=this||r;if(!(c._audioUnlocked||!c.ctx)){c._audioUnlocked=!1,c.autoUnlock=!1,!c._mobileUnloaded&&c.ctx.sampleRate!==44100&&(c._mobileUnloaded=!0,c.unload()),c._scratchBuffer=c.ctx.createBuffer(1,1,22050);var d=function(g){for(;c._html5AudioPool.length<c.html5PoolSize;)try{var v=new Audio;v._unlocked=!0,c._releaseHtml5Audio(v)}catch{c.noAudio=!0;break}for(var y=0;y<c._howls.length;y++)if(!c._howls[y]._webAudio)for(var b=c._howls[y]._getSoundIds(),x=0;x<b.length;x++){var E=c._howls[y]._soundById(b[x]);E&&E._node&&!E._node._unlocked&&(E._node._unlocked=!0,E._node.load())}c._autoResume();var w=c.ctx.createBufferSource();w.buffer=c._scratchBuffer,w.connect(c.ctx.destination),typeof w.start>"u"?w.noteOn(0):w.start(0),typeof c.ctx.resume=="function"&&c.ctx.resume(),w.onended=function(){w.disconnect(0),c._audioUnlocked=!0,document.removeEventListener("touchstart",d,!0),document.removeEventListener("touchend",d,!0),document.removeEventListener("click",d,!0),document.removeEventListener("keydown",d,!0);for(var I=0;I<c._howls.length;I++)c._howls[I]._emit("unlock")}};return document.addEventListener("touchstart",d,!0),document.addEventListener("touchend",d,!0),document.addEventListener("click",d,!0),document.addEventListener("keydown",d,!0),c}},_obtainHtml5Audio:function(){var c=this||r;if(c._html5AudioPool.length)return c._html5AudioPool.pop();var d=new Audio().play();return d&&typeof Promise<"u"&&(d instanceof Promise||typeof d.then=="function")&&d.catch(function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")}),new Audio},_releaseHtml5Audio:function(c){var d=this||r;return c._unlocked&&d._html5AudioPool.push(c),d},_autoSuspend:function(){var c=this;if(!(!c.autoSuspend||!c.ctx||typeof c.ctx.suspend>"u"||!r.usingWebAudio)){for(var d=0;d<c._howls.length;d++)if(c._howls[d]._webAudio){for(var g=0;g<c._howls[d]._sounds.length;g++)if(!c._howls[d]._sounds[g]._paused)return c}return c._suspendTimer&&clearTimeout(c._suspendTimer),c._suspendTimer=setTimeout(function(){if(c.autoSuspend){c._suspendTimer=null,c.state="suspending";var v=function(){c.state="suspended",c._resumeAfterSuspend&&(delete c._resumeAfterSuspend,c._autoResume())};c.ctx.suspend().then(v,v)}},3e4),c}},_autoResume:function(){var c=this;if(!(!c.ctx||typeof c.ctx.resume>"u"||!r.usingWebAudio))return c.state==="running"&&c.ctx.state!=="interrupted"&&c._suspendTimer?(clearTimeout(c._suspendTimer),c._suspendTimer=null):c.state==="suspended"||c.state==="running"&&c.ctx.state==="interrupted"?(c.ctx.resume().then(function(){c.state="running";for(var d=0;d<c._howls.length;d++)c._howls[d]._emit("resume")}),c._suspendTimer&&(clearTimeout(c._suspendTimer),c._suspendTimer=null)):c.state==="suspending"&&(c._resumeAfterSuspend=!0),c}};var r=new e,n=function(c){var d=this;if(!c.src||c.src.length===0){console.error("An array of source files must be passed with any new Howl.");return}d.init(c)};n.prototype={init:function(c){var d=this;return r.ctx||m(),d._autoplay=c.autoplay||!1,d._format=typeof c.format!="string"?c.format:[c.format],d._html5=c.html5||!1,d._muted=c.mute||!1,d._loop=c.loop||!1,d._pool=c.pool||5,d._preload=typeof c.preload=="boolean"||c.preload==="metadata"?c.preload:!0,d._rate=c.rate||1,d._sprite=c.sprite||{},d._src=typeof c.src!="string"?c.src:[c.src],d._volume=c.volume!==void 0?c.volume:1,d._xhr={method:c.xhr&&c.xhr.method?c.xhr.method:"GET",headers:c.xhr&&c.xhr.headers?c.xhr.headers:null,withCredentials:c.xhr&&c.xhr.withCredentials?c.xhr.withCredentials:!1},d._duration=0,d._state="unloaded",d._sounds=[],d._endTimers={},d._queue=[],d._playLock=!1,d._onend=c.onend?[{fn:c.onend}]:[],d._onfade=c.onfade?[{fn:c.onfade}]:[],d._onload=c.onload?[{fn:c.onload}]:[],d._onloaderror=c.onloaderror?[{fn:c.onloaderror}]:[],d._onplayerror=c.onplayerror?[{fn:c.onplayerror}]:[],d._onpause=c.onpause?[{fn:c.onpause}]:[],d._onplay=c.onplay?[{fn:c.onplay}]:[],d._onstop=c.onstop?[{fn:c.onstop}]:[],d._onmute=c.onmute?[{fn:c.onmute}]:[],d._onvolume=c.onvolume?[{fn:c.onvolume}]:[],d._onrate=c.onrate?[{fn:c.onrate}]:[],d._onseek=c.onseek?[{fn:c.onseek}]:[],d._onunlock=c.onunlock?[{fn:c.onunlock}]:[],d._onresume=[],d._webAudio=r.usingWebAudio&&!d._html5,typeof r.ctx<"u"&&r.ctx&&r.autoUnlock&&r._unlockAudio(),r._howls.push(d),d._autoplay&&d._queue.push({event:"play",action:function(){d.play()}}),d._preload&&d._preload!=="none"&&d.load(),d},load:function(){var c=this,d=null;if(r.noAudio){c._emit("loaderror",null,"No audio support.");return}typeof c._src=="string"&&(c._src=[c._src]);for(var g=0;g<c._src.length;g++){var v,y;if(c._format&&c._format[g])v=c._format[g];else{if(y=c._src[g],typeof y!="string"){c._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}v=/^data:audio\/([^;,]+);/i.exec(y),v||(v=/\.([^.]+)$/.exec(y.split("?",1)[0])),v&&(v=v[1].toLowerCase())}if(v||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),v&&r.codecs(v)){d=c._src[g];break}}if(!d){c._emit("loaderror",null,"No codec support for selected audio sources.");return}return c._src=d,c._state="loading",window.location.protocol==="https:"&&d.slice(0,5)==="http:"&&(c._html5=!0,c._webAudio=!1),new i(c),c._webAudio&&u(c),c},play:function(c,d){var g=this,v=null;if(typeof c=="number")v=c,c=null;else{if(typeof c=="string"&&g._state==="loaded"&&!g._sprite[c])return null;if(typeof c>"u"&&(c="__default",!g._playLock)){for(var y=0,b=0;b<g._sounds.length;b++)g._sounds[b]._paused&&!g._sounds[b]._ended&&(y++,v=g._sounds[b]._id);y===1?c=null:v=null}}var x=v?g._soundById(v):g._inactiveSound();if(!x)return null;if(v&&!c&&(c=x._sprite||"__default"),g._state!=="loaded"){x._sprite=c,x._ended=!1;var E=x._id;return g._queue.push({event:"play",action:function(){g.play(E)}}),E}if(v&&!x._paused)return d||g._loadQueue("play"),x._id;g._webAudio&&r._autoResume();var w=Math.max(0,x._seek>0?x._seek:g._sprite[c][0]/1e3),I=Math.max(0,(g._sprite[c][0]+g._sprite[c][1])/1e3-w),O=I*1e3/Math.abs(x._rate),F=g._sprite[c][0]/1e3,N=(g._sprite[c][0]+g._sprite[c][1])/1e3;x._sprite=c,x._ended=!1;var L=function(){x._paused=!1,x._seek=w,x._start=F,x._stop=N,x._loop=!!(x._loop||g._sprite[c][2])};if(w>=N){g._ended(x);return}var D=x._node;if(g._webAudio){var V=function(){g._playLock=!1,L(),g._refreshBuffer(x);var G=x._muted||g._muted?0:x._volume;D.gain.setValueAtTime(G,r.ctx.currentTime),x._playStart=r.ctx.currentTime,typeof D.bufferSource.start>"u"?x._loop?D.bufferSource.noteGrainOn(0,w,86400):D.bufferSource.noteGrainOn(0,w,I):x._loop?D.bufferSource.start(0,w,86400):D.bufferSource.start(0,w,I),O!==1/0&&(g._endTimers[x._id]=setTimeout(g._ended.bind(g,x),O)),d||setTimeout(function(){g._emit("play",x._id),g._loadQueue()},0)};r.state==="running"&&r.ctx.state!=="interrupted"?V():(g._playLock=!0,g.once("resume",V),g._clearTimer(x._id))}else{var Y=function(){D.currentTime=w,D.muted=x._muted||g._muted||r._muted||D.muted,D.volume=x._volume*r.volume(),D.playbackRate=x._rate;try{var G=D.play();if(G&&typeof Promise<"u"&&(G instanceof Promise||typeof G.then=="function")?(g._playLock=!0,L(),G.then(function(){g._playLock=!1,D._unlocked=!0,d?g._loadQueue():g._emit("play",x._id)}).catch(function(){g._playLock=!1,g._emit("playerror",x._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),x._ended=!0,x._paused=!0})):d||(g._playLock=!1,L(),g._emit("play",x._id)),D.playbackRate=x._rate,D.paused){g._emit("playerror",x._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");return}c!=="__default"||x._loop?g._endTimers[x._id]=setTimeout(g._ended.bind(g,x),O):(g._endTimers[x._id]=function(){g._ended(x),D.removeEventListener("ended",g._endTimers[x._id],!1)},D.addEventListener("ended",g._endTimers[x._id],!1))}catch(ae){g._emit("playerror",x._id,ae)}};D.src==="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"&&(D.src=g._src,D.load());var ie=window&&window.ejecta||!D.readyState&&r._navigator.isCocoonJS;if(D.readyState>=3||ie)Y();else{g._playLock=!0,g._state="loading";var X=function(){g._state="loaded",Y(),D.removeEventListener(r._canPlayEvent,X,!1)};D.addEventListener(r._canPlayEvent,X,!1),g._clearTimer(x._id)}}return x._id},pause:function(c){var d=this;if(d._state!=="loaded"||d._playLock)return d._queue.push({event:"pause",action:function(){d.pause(c)}}),d;for(var g=d._getSoundIds(c),v=0;v<g.length;v++){d._clearTimer(g[v]);var y=d._soundById(g[v]);if(y&&!y._paused&&(y._seek=d.seek(g[v]),y._rateSeek=0,y._paused=!0,d._stopFade(g[v]),y._node))if(d._webAudio){if(!y._node.bufferSource)continue;typeof y._node.bufferSource.stop>"u"?y._node.bufferSource.noteOff(0):y._node.bufferSource.stop(0),d._cleanBuffer(y._node)}else(!isNaN(y._node.duration)||y._node.duration===1/0)&&y._node.pause();arguments[1]||d._emit("pause",y?y._id:null)}return d},stop:function(c,d){var g=this;if(g._state!=="loaded"||g._playLock)return g._queue.push({event:"stop",action:function(){g.stop(c)}}),g;for(var v=g._getSoundIds(c),y=0;y<v.length;y++){g._clearTimer(v[y]);var b=g._soundById(v[y]);b&&(b._seek=b._start||0,b._rateSeek=0,b._paused=!0,b._ended=!0,g._stopFade(v[y]),b._node&&(g._webAudio?b._node.bufferSource&&(typeof b._node.bufferSource.stop>"u"?b._node.bufferSource.noteOff(0):b._node.bufferSource.stop(0),g._cleanBuffer(b._node)):(!isNaN(b._node.duration)||b._node.duration===1/0)&&(b._node.currentTime=b._start||0,b._node.pause(),b._node.duration===1/0&&g._clearSound(b._node))),d||g._emit("stop",b._id))}return g},mute:function(c,d){var g=this;if(g._state!=="loaded"||g._playLock)return g._queue.push({event:"mute",action:function(){g.mute(c,d)}}),g;if(typeof d>"u")if(typeof c=="boolean")g._muted=c;else return g._muted;for(var v=g._getSoundIds(d),y=0;y<v.length;y++){var b=g._soundById(v[y]);b&&(b._muted=c,b._interval&&g._stopFade(b._id),g._webAudio&&b._node?b._node.gain.setValueAtTime(c?0:b._volume,r.ctx.currentTime):b._node&&(b._node.muted=r._muted?!0:c),g._emit("mute",b._id))}return g},volume:function(){var c=this,d=arguments,g,v;if(d.length===0)return c._volume;if(d.length===1||d.length===2&&typeof d[1]>"u"){var y=c._getSoundIds(),b=y.indexOf(d[0]);b>=0?v=parseInt(d[0],10):g=parseFloat(d[0])}else d.length>=2&&(g=parseFloat(d[0]),v=parseInt(d[1],10));var x;if(typeof g<"u"&&g>=0&&g<=1){if(c._state!=="loaded"||c._playLock)return c._queue.push({event:"volume",action:function(){c.volume.apply(c,d)}}),c;typeof v>"u"&&(c._volume=g),v=c._getSoundIds(v);for(var E=0;E<v.length;E++)x=c._soundById(v[E]),x&&(x._volume=g,d[2]||c._stopFade(v[E]),c._webAudio&&x._node&&!x._muted?x._node.gain.setValueAtTime(g,r.ctx.currentTime):x._node&&!x._muted&&(x._node.volume=g*r.volume()),c._emit("volume",x._id))}else return x=v?c._soundById(v):c._sounds[0],x?x._volume:0;return c},fade:function(c,d,g,v){var y=this;if(y._state!=="loaded"||y._playLock)return y._queue.push({event:"fade",action:function(){y.fade(c,d,g,v)}}),y;c=Math.min(Math.max(0,parseFloat(c)),1),d=Math.min(Math.max(0,parseFloat(d)),1),g=parseFloat(g),y.volume(c,v);for(var b=y._getSoundIds(v),x=0;x<b.length;x++){var E=y._soundById(b[x]);if(E){if(v||y._stopFade(b[x]),y._webAudio&&!E._muted){var w=r.ctx.currentTime,I=w+g/1e3;E._volume=c,E._node.gain.setValueAtTime(c,w),E._node.gain.linearRampToValueAtTime(d,I)}y._startFadeInterval(E,c,d,g,b[x],typeof v>"u")}}return y},_startFadeInterval:function(c,d,g,v,y,b){var x=this,E=d,w=g-d,I=Math.abs(w/.01),O=Math.max(4,I>0?v/I:v),F=Date.now();c._fadeTo=g,c._interval=setInterval(function(){var N=(Date.now()-F)/v;F=Date.now(),E+=w*N,E=Math.round(E*100)/100,w<0?E=Math.max(g,E):E=Math.min(g,E),x._webAudio?c._volume=E:x.volume(E,c._id,!0),b&&(x._volume=E),(g<d&&E<=g||g>d&&E>=g)&&(clearInterval(c._interval),c._interval=null,c._fadeTo=null,x.volume(g,c._id),x._emit("fade",c._id))},O)},_stopFade:function(c){var d=this,g=d._soundById(c);return g&&g._interval&&(d._webAudio&&g._node.gain.cancelScheduledValues(r.ctx.currentTime),clearInterval(g._interval),g._interval=null,d.volume(g._fadeTo,c),g._fadeTo=null,d._emit("fade",c)),d},loop:function(){var c=this,d=arguments,g,v,y;if(d.length===0)return c._loop;if(d.length===1)if(typeof d[0]=="boolean")g=d[0],c._loop=g;else return y=c._soundById(parseInt(d[0],10)),y?y._loop:!1;else d.length===2&&(g=d[0],v=parseInt(d[1],10));for(var b=c._getSoundIds(v),x=0;x<b.length;x++)y=c._soundById(b[x]),y&&(y._loop=g,c._webAudio&&y._node&&y._node.bufferSource&&(y._node.bufferSource.loop=g,g&&(y._node.bufferSource.loopStart=y._start||0,y._node.bufferSource.loopEnd=y._stop,c.playing(b[x])&&(c.pause(b[x],!0),c.play(b[x],!0)))));return c},rate:function(){var c=this,d=arguments,g,v;if(d.length===0)v=c._sounds[0]._id;else if(d.length===1){var y=c._getSoundIds(),b=y.indexOf(d[0]);b>=0?v=parseInt(d[0],10):g=parseFloat(d[0])}else d.length===2&&(g=parseFloat(d[0]),v=parseInt(d[1],10));var x;if(typeof g=="number"){if(c._state!=="loaded"||c._playLock)return c._queue.push({event:"rate",action:function(){c.rate.apply(c,d)}}),c;typeof v>"u"&&(c._rate=g),v=c._getSoundIds(v);for(var E=0;E<v.length;E++)if(x=c._soundById(v[E]),x){c.playing(v[E])&&(x._rateSeek=c.seek(v[E]),x._playStart=c._webAudio?r.ctx.currentTime:x._playStart),x._rate=g,c._webAudio&&x._node&&x._node.bufferSource?x._node.bufferSource.playbackRate.setValueAtTime(g,r.ctx.currentTime):x._node&&(x._node.playbackRate=g);var w=c.seek(v[E]),I=(c._sprite[x._sprite][0]+c._sprite[x._sprite][1])/1e3-w,O=I*1e3/Math.abs(x._rate);(c._endTimers[v[E]]||!x._paused)&&(c._clearTimer(v[E]),c._endTimers[v[E]]=setTimeout(c._ended.bind(c,x),O)),c._emit("rate",x._id)}}else return x=c._soundById(v),x?x._rate:c._rate;return c},seek:function(){var c=this,d=arguments,g,v;if(d.length===0)c._sounds.length&&(v=c._sounds[0]._id);else if(d.length===1){var y=c._getSoundIds(),b=y.indexOf(d[0]);b>=0?v=parseInt(d[0],10):c._sounds.length&&(v=c._sounds[0]._id,g=parseFloat(d[0]))}else d.length===2&&(g=parseFloat(d[0]),v=parseInt(d[1],10));if(typeof v>"u")return 0;if(typeof g=="number"&&(c._state!=="loaded"||c._playLock))return c._queue.push({event:"seek",action:function(){c.seek.apply(c,d)}}),c;var x=c._soundById(v);if(x)if(typeof g=="number"&&g>=0){var E=c.playing(v);E&&c.pause(v,!0),x._seek=g,x._ended=!1,c._clearTimer(v),!c._webAudio&&x._node&&!isNaN(x._node.duration)&&(x._node.currentTime=g);var w=function(){E&&c.play(v,!0),c._emit("seek",v)};if(E&&!c._webAudio){var I=function(){c._playLock?setTimeout(I,0):w()};setTimeout(I,0)}else w()}else if(c._webAudio){var O=c.playing(v)?r.ctx.currentTime-x._playStart:0,F=x._rateSeek?x._rateSeek-x._seek:0;return x._seek+(F+O*Math.abs(x._rate))}else return x._node.currentTime;return c},playing:function(c){var d=this;if(typeof c=="number"){var g=d._soundById(c);return g?!g._paused:!1}for(var v=0;v<d._sounds.length;v++)if(!d._sounds[v]._paused)return!0;return!1},duration:function(c){var d=this,g=d._duration,v=d._soundById(c);return v&&(g=d._sprite[v._sprite][1]/1e3),g},state:function(){return this._state},unload:function(){for(var c=this,d=c._sounds,g=0;g<d.length;g++)d[g]._paused||c.stop(d[g]._id),c._webAudio||(c._clearSound(d[g]._node),d[g]._node.removeEventListener("error",d[g]._errorFn,!1),d[g]._node.removeEventListener(r._canPlayEvent,d[g]._loadFn,!1),d[g]._node.removeEventListener("ended",d[g]._endFn,!1),r._releaseHtml5Audio(d[g]._node)),delete d[g]._node,c._clearTimer(d[g]._id);var v=r._howls.indexOf(c);v>=0&&r._howls.splice(v,1);var y=!0;for(g=0;g<r._howls.length;g++)if(r._howls[g]._src===c._src||c._src.indexOf(r._howls[g]._src)>=0){y=!1;break}return a&&y&&delete a[c._src],r.noAudio=!1,c._state="unloaded",c._sounds=[],c=null,null},on:function(c,d,g,v){var y=this,b=y["_on"+c];return typeof d=="function"&&b.push(v?{id:g,fn:d,once:v}:{id:g,fn:d}),y},off:function(c,d,g){var v=this,y=v["_on"+c],b=0;if(typeof d=="number"&&(g=d,d=null),d||g)for(b=0;b<y.length;b++){var x=g===y[b].id;if(d===y[b].fn&&x||!d&&x){y.splice(b,1);break}}else if(c)v["_on"+c]=[];else{var E=Object.keys(v);for(b=0;b<E.length;b++)E[b].indexOf("_on")===0&&Array.isArray(v[E[b]])&&(v[E[b]]=[])}return v},once:function(c,d,g){var v=this;return v.on(c,d,g,1),v},_emit:function(c,d,g){for(var v=this,y=v["_on"+c],b=y.length-1;b>=0;b--)(!y[b].id||y[b].id===d||c==="load")&&(setTimeout((function(x){x.call(this,d,g)}).bind(v,y[b].fn),0),y[b].once&&v.off(c,y[b].fn,y[b].id));return v._loadQueue(c),v},_loadQueue:function(c){var d=this;if(d._queue.length>0){var g=d._queue[0];g.event===c&&(d._queue.shift(),d._loadQueue()),c||g.action()}return d},_ended:function(c){var d=this,g=c._sprite;if(!d._webAudio&&c._node&&!c._node.paused&&!c._node.ended&&c._node.currentTime<c._stop)return setTimeout(d._ended.bind(d,c),100),d;var v=!!(c._loop||d._sprite[g][2]);if(d._emit("end",c._id),!d._webAudio&&v&&d.stop(c._id,!0).play(c._id),d._webAudio&&v){d._emit("play",c._id),c._seek=c._start||0,c._rateSeek=0,c._playStart=r.ctx.currentTime;var y=(c._stop-c._start)*1e3/Math.abs(c._rate);d._endTimers[c._id]=setTimeout(d._ended.bind(d,c),y)}return d._webAudio&&!v&&(c._paused=!0,c._ended=!0,c._seek=c._start||0,c._rateSeek=0,d._clearTimer(c._id),d._cleanBuffer(c._node),r._autoSuspend()),!d._webAudio&&!v&&d.stop(c._id,!0),d},_clearTimer:function(c){var d=this;if(d._endTimers[c]){if(typeof d._endTimers[c]!="function")clearTimeout(d._endTimers[c]);else{var g=d._soundById(c);g&&g._node&&g._node.removeEventListener("ended",d._endTimers[c],!1)}delete d._endTimers[c]}return d},_soundById:function(c){for(var d=this,g=0;g<d._sounds.length;g++)if(c===d._sounds[g]._id)return d._sounds[g];return null},_inactiveSound:function(){var c=this;c._drain();for(var d=0;d<c._sounds.length;d++)if(c._sounds[d]._ended)return c._sounds[d].reset();return new i(c)},_drain:function(){var c=this,d=c._pool,g=0,v=0;if(!(c._sounds.length<d)){for(v=0;v<c._sounds.length;v++)c._sounds[v]._ended&&g++;for(v=c._sounds.length-1;v>=0;v--){if(g<=d)return;c._sounds[v]._ended&&(c._webAudio&&c._sounds[v]._node&&c._sounds[v]._node.disconnect(0),c._sounds.splice(v,1),g--)}}},_getSoundIds:function(c){var d=this;if(typeof c>"u"){for(var g=[],v=0;v<d._sounds.length;v++)g.push(d._sounds[v]._id);return g}else return[c]},_refreshBuffer:function(c){var d=this;return c._node.bufferSource=r.ctx.createBufferSource(),c._node.bufferSource.buffer=a[d._src],c._panner?c._node.bufferSource.connect(c._panner):c._node.bufferSource.connect(c._node),c._node.bufferSource.loop=c._loop,c._loop&&(c._node.bufferSource.loopStart=c._start||0,c._node.bufferSource.loopEnd=c._stop||0),c._node.bufferSource.playbackRate.setValueAtTime(c._rate,r.ctx.currentTime),d},_cleanBuffer:function(c){var d=this,g=r._navigator&&r._navigator.vendor.indexOf("Apple")>=0;if(r._scratchBuffer&&c.bufferSource&&(c.bufferSource.onended=null,c.bufferSource.disconnect(0),g))try{c.bufferSource.buffer=r._scratchBuffer}catch{}return c.bufferSource=null,d},_clearSound:function(c){var d=/MSIE |Trident\//.test(r._navigator&&r._navigator.userAgent);d||(c.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var i=function(c){this._parent=c,this.init()};i.prototype={init:function(){var c=this,d=c._parent;return c._muted=d._muted,c._loop=d._loop,c._volume=d._volume,c._rate=d._rate,c._seek=0,c._paused=!0,c._ended=!0,c._sprite="__default",c._id=++r._counter,d._sounds.push(c),c.create(),c},create:function(){var c=this,d=c._parent,g=r._muted||c._muted||c._parent._muted?0:c._volume;return d._webAudio?(c._node=typeof r.ctx.createGain>"u"?r.ctx.createGainNode():r.ctx.createGain(),c._node.gain.setValueAtTime(g,r.ctx.currentTime),c._node.paused=!0,c._node.connect(r.masterGain)):r.noAudio||(c._node=r._obtainHtml5Audio(),c._errorFn=c._errorListener.bind(c),c._node.addEventListener("error",c._errorFn,!1),c._loadFn=c._loadListener.bind(c),c._node.addEventListener(r._canPlayEvent,c._loadFn,!1),c._endFn=c._endListener.bind(c),c._node.addEventListener("ended",c._endFn,!1),c._node.src=d._src,c._node.preload=d._preload===!0?"auto":d._preload,c._node.volume=g*r.volume(),c._node.load()),c},reset:function(){var c=this,d=c._parent;return c._muted=d._muted,c._loop=d._loop,c._volume=d._volume,c._rate=d._rate,c._seek=0,c._rateSeek=0,c._paused=!0,c._ended=!0,c._sprite="__default",c._id=++r._counter,c},_errorListener:function(){var c=this;c._parent._emit("loaderror",c._id,c._node.error?c._node.error.code:0),c._node.removeEventListener("error",c._errorFn,!1)},_loadListener:function(){var c=this,d=c._parent;d._duration=Math.ceil(c._node.duration*10)/10,Object.keys(d._sprite).length===0&&(d._sprite={__default:[0,d._duration*1e3]}),d._state!=="loaded"&&(d._state="loaded",d._emit("load"),d._loadQueue()),c._node.removeEventListener(r._canPlayEvent,c._loadFn,!1)},_endListener:function(){var c=this,d=c._parent;d._duration===1/0&&(d._duration=Math.ceil(c._node.duration*10)/10,d._sprite.__default[1]===1/0&&(d._sprite.__default[1]=d._duration*1e3),d._ended(c)),c._node.removeEventListener("ended",c._endFn,!1)}};var a={},u=function(c){var d=c._src;if(a[d]){c._duration=a[d].duration,p(c);return}if(/^data:[^;]+;base64,/.test(d)){for(var g=atob(d.split(",")[1]),v=new Uint8Array(g.length),y=0;y<g.length;++y)v[y]=g.charCodeAt(y);h(v.buffer,c)}else{var b=new XMLHttpRequest;b.open(c._xhr.method,d,!0),b.withCredentials=c._xhr.withCredentials,b.responseType="arraybuffer",c._xhr.headers&&Object.keys(c._xhr.headers).forEach(function(x){b.setRequestHeader(x,c._xhr.headers[x])}),b.onload=function(){var x=(b.status+"")[0];if(x!=="0"&&x!=="2"&&x!=="3"){c._emit("loaderror",null,"Failed loading audio file with status: "+b.status+".");return}h(b.response,c)},b.onerror=function(){c._webAudio&&(c._html5=!0,c._webAudio=!1,c._sounds=[],delete a[d],c.load())},l(b)}},l=function(c){try{c.send()}catch{c.onerror()}},h=function(c,d){var g=function(){d._emit("loaderror",null,"Decoding audio data failed.")},v=function(y){y&&d._sounds.length>0?(a[d._src]=y,p(d,y)):g()};typeof Promise<"u"&&r.ctx.decodeAudioData.length===1?r.ctx.decodeAudioData(c).then(v).catch(g):r.ctx.decodeAudioData(c,v,g)},p=function(c,d){d&&!c._duration&&(c._duration=d.duration),Object.keys(c._sprite).length===0&&(c._sprite={__default:[0,c._duration*1e3]}),c._state!=="loaded"&&(c._state="loaded",c._emit("load"),c._loadQueue())},m=function(){if(r.usingWebAudio){try{typeof AudioContext<"u"?r.ctx=new AudioContext:typeof webkitAudioContext<"u"?r.ctx=new webkitAudioContext:r.usingWebAudio=!1}catch{r.usingWebAudio=!1}r.ctx||(r.usingWebAudio=!1);var c=/iP(hone|od|ad)/.test(r._navigator&&r._navigator.platform),d=r._navigator&&r._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),g=d?parseInt(d[1],10):null;if(c&&g&&g<9){var v=/safari/.test(r._navigator&&r._navigator.userAgent.toLowerCase());r._navigator&&!v&&(r.usingWebAudio=!1)}r.usingWebAudio&&(r.masterGain=typeof r.ctx.createGain>"u"?r.ctx.createGainNode():r.ctx.createGain(),r.masterGain.gain.setValueAtTime(r._muted?0:r._volume,r.ctx.currentTime),r.masterGain.connect(r.ctx.destination)),r._setup()}};t.Howler=r,t.Howl=n,typeof Et<"u"?(Et.HowlerGlobal=e,Et.Howler=r,Et.Howl=n,Et.Sound=i):typeof window<"u"&&(window.HowlerGlobal=e,window.Howler=r,window.Howl=n,window.Sound=i)})();/*!
|
|
1980
|
+
*/(function(t){(function(){var e=function(){this.init()};e.prototype={init:function(){var l=this||r;return l._counter=1e3,l._html5AudioPool=[],l.html5PoolSize=10,l._codecs={},l._howls=[],l._muted=!1,l._volume=1,l._canPlayEvent="canplaythrough",l._navigator=typeof window<"u"&&window.navigator?window.navigator:null,l.masterGain=null,l.noAudio=!1,l.usingWebAudio=!0,l.autoSuspend=!0,l.ctx=null,l.autoUnlock=!0,l._setup(),l},volume:function(l){var h=this||r;if(l=parseFloat(l),h.ctx||f(),typeof l<"u"&&l>=0&&l<=1){if(h._volume=l,h._muted)return h;h.usingWebAudio&&h.masterGain.gain.setValueAtTime(l,r.ctx.currentTime);for(var d=0;d<h._howls.length;d++)if(!h._howls[d]._webAudio)for(var p=h._howls[d]._getSoundIds(),m=0;m<p.length;m++){var _=h._howls[d]._soundById(p[m]);_&&_._node&&(_._node.volume=_._volume*l)}return h}return h._volume},mute:function(l){var h=this||r;h.ctx||f(),h._muted=l,h.usingWebAudio&&h.masterGain.gain.setValueAtTime(l?0:h._volume,r.ctx.currentTime);for(var d=0;d<h._howls.length;d++)if(!h._howls[d]._webAudio)for(var p=h._howls[d]._getSoundIds(),m=0;m<p.length;m++){var _=h._howls[d]._soundById(p[m]);_&&_._node&&(_._node.muted=l?!0:_._muted)}return h},stop:function(){for(var l=this||r,h=0;h<l._howls.length;h++)l._howls[h].stop();return l},unload:function(){for(var l=this||r,h=l._howls.length-1;h>=0;h--)l._howls[h].unload();return l.usingWebAudio&&l.ctx&&typeof l.ctx.close<"u"&&(l.ctx.close(),l.ctx=null,f()),l},codecs:function(l){return(this||r)._codecs[l.replace(/^x-/,"")]},_setup:function(){var l=this||r;if(l.state=l.ctx&&l.ctx.state||"suspended",l._autoSuspend(),!l.usingWebAudio)if(typeof Audio<"u")try{var h=new Audio;typeof h.oncanplaythrough>"u"&&(l._canPlayEvent="canplay")}catch{l.noAudio=!0}else l.noAudio=!0;try{var h=new Audio;h.muted&&(l.noAudio=!0)}catch{}return l.noAudio||l._setupCodecs(),l},_setupCodecs:function(){var l=this||r,h=null;try{h=typeof Audio<"u"?new Audio:null}catch{return l}if(!h||typeof h.canPlayType!="function")return l;var d=h.canPlayType("audio/mpeg;").replace(/^no$/,""),p=l._navigator?l._navigator.userAgent:"",m=p.match(/OPR\/([0-6].)/g),_=m&&parseInt(m[0].split("/")[1],10)<33,g=p.indexOf("Safari")!==-1&&p.indexOf("Chrome")===-1,y=p.match(/Version\/(.*?) /),v=g&&y&&parseInt(y[1],10)<15;return l._codecs={mp3:!!(!_&&(d||h.canPlayType("audio/mp3;").replace(/^no$/,""))),mpeg:!!d,opus:!!h.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!h.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!h.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(h.canPlayType('audio/wav; codecs="1"')||h.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!h.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!h.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(h.canPlayType("audio/x-m4a;")||h.canPlayType("audio/m4a;")||h.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(h.canPlayType("audio/x-m4b;")||h.canPlayType("audio/m4b;")||h.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(h.canPlayType("audio/x-mp4;")||h.canPlayType("audio/mp4;")||h.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!!(!v&&h.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!!(!v&&h.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!h.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(h.canPlayType("audio/x-flac;")||h.canPlayType("audio/flac;")).replace(/^no$/,"")},l},_unlockAudio:function(){var l=this||r;if(!(l._audioUnlocked||!l.ctx)){l._audioUnlocked=!1,l.autoUnlock=!1,!l._mobileUnloaded&&l.ctx.sampleRate!==44100&&(l._mobileUnloaded=!0,l.unload()),l._scratchBuffer=l.ctx.createBuffer(1,1,22050);var h=function(d){for(;l._html5AudioPool.length<l.html5PoolSize;)try{var p=new Audio;p._unlocked=!0,l._releaseHtml5Audio(p)}catch{l.noAudio=!0;break}for(var m=0;m<l._howls.length;m++)if(!l._howls[m]._webAudio)for(var _=l._howls[m]._getSoundIds(),g=0;g<_.length;g++){var y=l._howls[m]._soundById(_[g]);y&&y._node&&!y._node._unlocked&&(y._node._unlocked=!0,y._node.load())}l._autoResume();var v=l.ctx.createBufferSource();v.buffer=l._scratchBuffer,v.connect(l.ctx.destination),typeof v.start>"u"?v.noteOn(0):v.start(0),typeof l.ctx.resume=="function"&&l.ctx.resume(),v.onended=function(){v.disconnect(0),l._audioUnlocked=!0,document.removeEventListener("touchstart",h,!0),document.removeEventListener("touchend",h,!0),document.removeEventListener("click",h,!0),document.removeEventListener("keydown",h,!0);for(var x=0;x<l._howls.length;x++)l._howls[x]._emit("unlock")}};return document.addEventListener("touchstart",h,!0),document.addEventListener("touchend",h,!0),document.addEventListener("click",h,!0),document.addEventListener("keydown",h,!0),l}},_obtainHtml5Audio:function(){var l=this||r;if(l._html5AudioPool.length)return l._html5AudioPool.pop();var h=new Audio().play();return h&&typeof Promise<"u"&&(h instanceof Promise||typeof h.then=="function")&&h.catch(function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")}),new Audio},_releaseHtml5Audio:function(l){var h=this||r;return l._unlocked&&h._html5AudioPool.push(l),h},_autoSuspend:function(){var l=this;if(!(!l.autoSuspend||!l.ctx||typeof l.ctx.suspend>"u"||!r.usingWebAudio)){for(var h=0;h<l._howls.length;h++)if(l._howls[h]._webAudio){for(var d=0;d<l._howls[h]._sounds.length;d++)if(!l._howls[h]._sounds[d]._paused)return l}return l._suspendTimer&&clearTimeout(l._suspendTimer),l._suspendTimer=setTimeout(function(){if(l.autoSuspend){l._suspendTimer=null,l.state="suspending";var p=function(){l.state="suspended",l._resumeAfterSuspend&&(delete l._resumeAfterSuspend,l._autoResume())};l.ctx.suspend().then(p,p)}},3e4),l}},_autoResume:function(){var l=this;if(!(!l.ctx||typeof l.ctx.resume>"u"||!r.usingWebAudio))return l.state==="running"&&l.ctx.state!=="interrupted"&&l._suspendTimer?(clearTimeout(l._suspendTimer),l._suspendTimer=null):l.state==="suspended"||l.state==="running"&&l.ctx.state==="interrupted"?(l.ctx.resume().then(function(){l.state="running";for(var h=0;h<l._howls.length;h++)l._howls[h]._emit("resume")}),l._suspendTimer&&(clearTimeout(l._suspendTimer),l._suspendTimer=null)):l.state==="suspending"&&(l._resumeAfterSuspend=!0),l}};var r=new e,i=function(l){var h=this;if(!l.src||l.src.length===0){console.error("An array of source files must be passed with any new Howl.");return}h.init(l)};i.prototype={init:function(l){var h=this;return r.ctx||f(),h._autoplay=l.autoplay||!1,h._format=typeof l.format!="string"?l.format:[l.format],h._html5=l.html5||!1,h._muted=l.mute||!1,h._loop=l.loop||!1,h._pool=l.pool||5,h._preload=typeof l.preload=="boolean"||l.preload==="metadata"?l.preload:!0,h._rate=l.rate||1,h._sprite=l.sprite||{},h._src=typeof l.src!="string"?l.src:[l.src],h._volume=l.volume!==void 0?l.volume:1,h._xhr={method:l.xhr&&l.xhr.method?l.xhr.method:"GET",headers:l.xhr&&l.xhr.headers?l.xhr.headers:null,withCredentials:l.xhr&&l.xhr.withCredentials?l.xhr.withCredentials:!1},h._duration=0,h._state="unloaded",h._sounds=[],h._endTimers={},h._queue=[],h._playLock=!1,h._onend=l.onend?[{fn:l.onend}]:[],h._onfade=l.onfade?[{fn:l.onfade}]:[],h._onload=l.onload?[{fn:l.onload}]:[],h._onloaderror=l.onloaderror?[{fn:l.onloaderror}]:[],h._onplayerror=l.onplayerror?[{fn:l.onplayerror}]:[],h._onpause=l.onpause?[{fn:l.onpause}]:[],h._onplay=l.onplay?[{fn:l.onplay}]:[],h._onstop=l.onstop?[{fn:l.onstop}]:[],h._onmute=l.onmute?[{fn:l.onmute}]:[],h._onvolume=l.onvolume?[{fn:l.onvolume}]:[],h._onrate=l.onrate?[{fn:l.onrate}]:[],h._onseek=l.onseek?[{fn:l.onseek}]:[],h._onunlock=l.onunlock?[{fn:l.onunlock}]:[],h._onresume=[],h._webAudio=r.usingWebAudio&&!h._html5,typeof r.ctx<"u"&&r.ctx&&r.autoUnlock&&r._unlockAudio(),r._howls.push(h),h._autoplay&&h._queue.push({event:"play",action:function(){h.play()}}),h._preload&&h._preload!=="none"&&h.load(),h},load:function(){var l=this,h=null;if(r.noAudio){l._emit("loaderror",null,"No audio support.");return}typeof l._src=="string"&&(l._src=[l._src]);for(var d=0;d<l._src.length;d++){var p,m;if(l._format&&l._format[d])p=l._format[d];else{if(m=l._src[d],typeof m!="string"){l._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}p=/^data:audio\/([^;,]+);/i.exec(m),p||(p=/\.([^.]+)$/.exec(m.split("?",1)[0])),p&&(p=p[1].toLowerCase())}if(p||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),p&&r.codecs(p)){h=l._src[d];break}}if(!h){l._emit("loaderror",null,"No codec support for selected audio sources.");return}return l._src=h,l._state="loading",window.location.protocol==="https:"&&h.slice(0,5)==="http:"&&(l._html5=!0,l._webAudio=!1),new n(l),l._webAudio&&a(l),l},play:function(l,h){var d=this,p=null;if(typeof l=="number")p=l,l=null;else{if(typeof l=="string"&&d._state==="loaded"&&!d._sprite[l])return null;if(typeof l>"u"&&(l="__default",!d._playLock)){for(var m=0,_=0;_<d._sounds.length;_++)d._sounds[_]._paused&&!d._sounds[_]._ended&&(m++,p=d._sounds[_]._id);m===1?l=null:p=null}}var g=p?d._soundById(p):d._inactiveSound();if(!g)return null;if(p&&!l&&(l=g._sprite||"__default"),d._state!=="loaded"){g._sprite=l,g._ended=!1;var y=g._id;return d._queue.push({event:"play",action:function(){d.play(y)}}),y}if(p&&!g._paused)return h||d._loadQueue("play"),g._id;d._webAudio&&r._autoResume();var v=Math.max(0,g._seek>0?g._seek:d._sprite[l][0]/1e3),x=Math.max(0,(d._sprite[l][0]+d._sprite[l][1])/1e3-v),T=x*1e3/Math.abs(g._rate),b=d._sprite[l][0]/1e3,w=(d._sprite[l][0]+d._sprite[l][1])/1e3;g._sprite=l,g._ended=!1;var S=function(){g._paused=!1,g._seek=v,g._start=b,g._stop=w,g._loop=!!(g._loop||d._sprite[l][2])};if(v>=w){d._ended(g);return}var A=g._node;if(d._webAudio){var C=function(){d._playLock=!1,S(),d._refreshBuffer(g);var E=g._muted||d._muted?0:g._volume;A.gain.setValueAtTime(E,r.ctx.currentTime),g._playStart=r.ctx.currentTime,typeof A.bufferSource.start>"u"?g._loop?A.bufferSource.noteGrainOn(0,v,86400):A.bufferSource.noteGrainOn(0,v,x):g._loop?A.bufferSource.start(0,v,86400):A.bufferSource.start(0,v,x),T!==1/0&&(d._endTimers[g._id]=setTimeout(d._ended.bind(d,g),T)),h||setTimeout(function(){d._emit("play",g._id),d._loadQueue()},0)};r.state==="running"&&r.ctx.state!=="interrupted"?C():(d._playLock=!0,d.once("resume",C),d._clearTimer(g._id))}else{var F=function(){A.currentTime=v,A.muted=g._muted||d._muted||r._muted||A.muted,A.volume=g._volume*r.volume(),A.playbackRate=g._rate;try{var E=A.play();if(E&&typeof Promise<"u"&&(E instanceof Promise||typeof E.then=="function")?(d._playLock=!0,S(),E.then(function(){d._playLock=!1,A._unlocked=!0,h?d._loadQueue():d._emit("play",g._id)}).catch(function(){d._playLock=!1,d._emit("playerror",g._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),g._ended=!0,g._paused=!0})):h||(d._playLock=!1,S(),d._emit("play",g._id)),A.playbackRate=g._rate,A.paused){d._emit("playerror",g._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");return}l!=="__default"||g._loop?d._endTimers[g._id]=setTimeout(d._ended.bind(d,g),T):(d._endTimers[g._id]=function(){d._ended(g),A.removeEventListener("ended",d._endTimers[g._id],!1)},A.addEventListener("ended",d._endTimers[g._id],!1))}catch(B){d._emit("playerror",g._id,B)}};A.src==="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"&&(A.src=d._src,A.load());var G=window&&window.ejecta||!A.readyState&&r._navigator.isCocoonJS;if(A.readyState>=3||G)F();else{d._playLock=!0,d._state="loading";var R=function(){d._state="loaded",F(),A.removeEventListener(r._canPlayEvent,R,!1)};A.addEventListener(r._canPlayEvent,R,!1),d._clearTimer(g._id)}}return g._id},pause:function(l){var h=this;if(h._state!=="loaded"||h._playLock)return h._queue.push({event:"pause",action:function(){h.pause(l)}}),h;for(var d=h._getSoundIds(l),p=0;p<d.length;p++){h._clearTimer(d[p]);var m=h._soundById(d[p]);if(m&&!m._paused&&(m._seek=h.seek(d[p]),m._rateSeek=0,m._paused=!0,h._stopFade(d[p]),m._node))if(h._webAudio){if(!m._node.bufferSource)continue;typeof m._node.bufferSource.stop>"u"?m._node.bufferSource.noteOff(0):m._node.bufferSource.stop(0),h._cleanBuffer(m._node)}else(!isNaN(m._node.duration)||m._node.duration===1/0)&&m._node.pause();arguments[1]||h._emit("pause",m?m._id:null)}return h},stop:function(l,h){var d=this;if(d._state!=="loaded"||d._playLock)return d._queue.push({event:"stop",action:function(){d.stop(l)}}),d;for(var p=d._getSoundIds(l),m=0;m<p.length;m++){d._clearTimer(p[m]);var _=d._soundById(p[m]);_&&(_._seek=_._start||0,_._rateSeek=0,_._paused=!0,_._ended=!0,d._stopFade(p[m]),_._node&&(d._webAudio?_._node.bufferSource&&(typeof _._node.bufferSource.stop>"u"?_._node.bufferSource.noteOff(0):_._node.bufferSource.stop(0),d._cleanBuffer(_._node)):(!isNaN(_._node.duration)||_._node.duration===1/0)&&(_._node.currentTime=_._start||0,_._node.pause(),_._node.duration===1/0&&d._clearSound(_._node))),h||d._emit("stop",_._id))}return d},mute:function(l,h){var d=this;if(d._state!=="loaded"||d._playLock)return d._queue.push({event:"mute",action:function(){d.mute(l,h)}}),d;if(typeof h>"u")if(typeof l=="boolean")d._muted=l;else return d._muted;for(var p=d._getSoundIds(h),m=0;m<p.length;m++){var _=d._soundById(p[m]);_&&(_._muted=l,_._interval&&d._stopFade(_._id),d._webAudio&&_._node?_._node.gain.setValueAtTime(l?0:_._volume,r.ctx.currentTime):_._node&&(_._node.muted=r._muted?!0:l),d._emit("mute",_._id))}return d},volume:function(){var l=this,h=arguments,d,p;if(h.length===0)return l._volume;if(h.length===1||h.length===2&&typeof h[1]>"u"){var m=l._getSoundIds(),_=m.indexOf(h[0]);_>=0?p=parseInt(h[0],10):d=parseFloat(h[0])}else h.length>=2&&(d=parseFloat(h[0]),p=parseInt(h[1],10));var g;if(typeof d<"u"&&d>=0&&d<=1){if(l._state!=="loaded"||l._playLock)return l._queue.push({event:"volume",action:function(){l.volume.apply(l,h)}}),l;typeof p>"u"&&(l._volume=d),p=l._getSoundIds(p);for(var y=0;y<p.length;y++)g=l._soundById(p[y]),g&&(g._volume=d,h[2]||l._stopFade(p[y]),l._webAudio&&g._node&&!g._muted?g._node.gain.setValueAtTime(d,r.ctx.currentTime):g._node&&!g._muted&&(g._node.volume=d*r.volume()),l._emit("volume",g._id))}else return g=p?l._soundById(p):l._sounds[0],g?g._volume:0;return l},fade:function(l,h,d,p){var m=this;if(m._state!=="loaded"||m._playLock)return m._queue.push({event:"fade",action:function(){m.fade(l,h,d,p)}}),m;l=Math.min(Math.max(0,parseFloat(l)),1),h=Math.min(Math.max(0,parseFloat(h)),1),d=parseFloat(d),m.volume(l,p);for(var _=m._getSoundIds(p),g=0;g<_.length;g++){var y=m._soundById(_[g]);if(y){if(p||m._stopFade(_[g]),m._webAudio&&!y._muted){var v=r.ctx.currentTime,x=v+d/1e3;y._volume=l,y._node.gain.setValueAtTime(l,v),y._node.gain.linearRampToValueAtTime(h,x)}m._startFadeInterval(y,l,h,d,_[g],typeof p>"u")}}return m},_startFadeInterval:function(l,h,d,p,m,_){var g=this,y=h,v=d-h,x=Math.abs(v/.01),T=Math.max(4,x>0?p/x:p),b=Date.now();l._fadeTo=d,l._interval=setInterval(function(){var w=(Date.now()-b)/p;b=Date.now(),y+=v*w,y=Math.round(y*100)/100,v<0?y=Math.max(d,y):y=Math.min(d,y),g._webAudio?l._volume=y:g.volume(y,l._id,!0),_&&(g._volume=y),(d<h&&y<=d||d>h&&y>=d)&&(clearInterval(l._interval),l._interval=null,l._fadeTo=null,g.volume(d,l._id),g._emit("fade",l._id))},T)},_stopFade:function(l){var h=this,d=h._soundById(l);return d&&d._interval&&(h._webAudio&&d._node.gain.cancelScheduledValues(r.ctx.currentTime),clearInterval(d._interval),d._interval=null,h.volume(d._fadeTo,l),d._fadeTo=null,h._emit("fade",l)),h},loop:function(){var l=this,h=arguments,d,p,m;if(h.length===0)return l._loop;if(h.length===1)if(typeof h[0]=="boolean")d=h[0],l._loop=d;else return m=l._soundById(parseInt(h[0],10)),m?m._loop:!1;else h.length===2&&(d=h[0],p=parseInt(h[1],10));for(var _=l._getSoundIds(p),g=0;g<_.length;g++)m=l._soundById(_[g]),m&&(m._loop=d,l._webAudio&&m._node&&m._node.bufferSource&&(m._node.bufferSource.loop=d,d&&(m._node.bufferSource.loopStart=m._start||0,m._node.bufferSource.loopEnd=m._stop,l.playing(_[g])&&(l.pause(_[g],!0),l.play(_[g],!0)))));return l},rate:function(){var l=this,h=arguments,d,p;if(h.length===0)p=l._sounds[0]._id;else if(h.length===1){var m=l._getSoundIds(),_=m.indexOf(h[0]);_>=0?p=parseInt(h[0],10):d=parseFloat(h[0])}else h.length===2&&(d=parseFloat(h[0]),p=parseInt(h[1],10));var g;if(typeof d=="number"){if(l._state!=="loaded"||l._playLock)return l._queue.push({event:"rate",action:function(){l.rate.apply(l,h)}}),l;typeof p>"u"&&(l._rate=d),p=l._getSoundIds(p);for(var y=0;y<p.length;y++)if(g=l._soundById(p[y]),g){l.playing(p[y])&&(g._rateSeek=l.seek(p[y]),g._playStart=l._webAudio?r.ctx.currentTime:g._playStart),g._rate=d,l._webAudio&&g._node&&g._node.bufferSource?g._node.bufferSource.playbackRate.setValueAtTime(d,r.ctx.currentTime):g._node&&(g._node.playbackRate=d);var v=l.seek(p[y]),x=(l._sprite[g._sprite][0]+l._sprite[g._sprite][1])/1e3-v,T=x*1e3/Math.abs(g._rate);(l._endTimers[p[y]]||!g._paused)&&(l._clearTimer(p[y]),l._endTimers[p[y]]=setTimeout(l._ended.bind(l,g),T)),l._emit("rate",g._id)}}else return g=l._soundById(p),g?g._rate:l._rate;return l},seek:function(){var l=this,h=arguments,d,p;if(h.length===0)l._sounds.length&&(p=l._sounds[0]._id);else if(h.length===1){var m=l._getSoundIds(),_=m.indexOf(h[0]);_>=0?p=parseInt(h[0],10):l._sounds.length&&(p=l._sounds[0]._id,d=parseFloat(h[0]))}else h.length===2&&(d=parseFloat(h[0]),p=parseInt(h[1],10));if(typeof p>"u")return 0;if(typeof d=="number"&&(l._state!=="loaded"||l._playLock))return l._queue.push({event:"seek",action:function(){l.seek.apply(l,h)}}),l;var g=l._soundById(p);if(g)if(typeof d=="number"&&d>=0){var y=l.playing(p);y&&l.pause(p,!0),g._seek=d,g._ended=!1,l._clearTimer(p),!l._webAudio&&g._node&&!isNaN(g._node.duration)&&(g._node.currentTime=d);var v=function(){y&&l.play(p,!0),l._emit("seek",p)};if(y&&!l._webAudio){var x=function(){l._playLock?setTimeout(x,0):v()};setTimeout(x,0)}else v()}else if(l._webAudio){var T=l.playing(p)?r.ctx.currentTime-g._playStart:0,b=g._rateSeek?g._rateSeek-g._seek:0;return g._seek+(b+T*Math.abs(g._rate))}else return g._node.currentTime;return l},playing:function(l){var h=this;if(typeof l=="number"){var d=h._soundById(l);return d?!d._paused:!1}for(var p=0;p<h._sounds.length;p++)if(!h._sounds[p]._paused)return!0;return!1},duration:function(l){var h=this,d=h._duration,p=h._soundById(l);return p&&(d=h._sprite[p._sprite][1]/1e3),d},state:function(){return this._state},unload:function(){for(var l=this,h=l._sounds,d=0;d<h.length;d++)h[d]._paused||l.stop(h[d]._id),l._webAudio||(l._clearSound(h[d]._node),h[d]._node.removeEventListener("error",h[d]._errorFn,!1),h[d]._node.removeEventListener(r._canPlayEvent,h[d]._loadFn,!1),h[d]._node.removeEventListener("ended",h[d]._endFn,!1),r._releaseHtml5Audio(h[d]._node)),delete h[d]._node,l._clearTimer(h[d]._id);var p=r._howls.indexOf(l);p>=0&&r._howls.splice(p,1);var m=!0;for(d=0;d<r._howls.length;d++)if(r._howls[d]._src===l._src||l._src.indexOf(r._howls[d]._src)>=0){m=!1;break}return s&&m&&delete s[l._src],r.noAudio=!1,l._state="unloaded",l._sounds=[],l=null,null},on:function(l,h,d,p){var m=this,_=m["_on"+l];return typeof h=="function"&&_.push(p?{id:d,fn:h,once:p}:{id:d,fn:h}),m},off:function(l,h,d){var p=this,m=p["_on"+l],_=0;if(typeof h=="number"&&(d=h,h=null),h||d)for(_=0;_<m.length;_++){var g=d===m[_].id;if(h===m[_].fn&&g||!h&&g){m.splice(_,1);break}}else if(l)p["_on"+l]=[];else{var y=Object.keys(p);for(_=0;_<y.length;_++)y[_].indexOf("_on")===0&&Array.isArray(p[y[_]])&&(p[y[_]]=[])}return p},once:function(l,h,d){var p=this;return p.on(l,h,d,1),p},_emit:function(l,h,d){for(var p=this,m=p["_on"+l],_=m.length-1;_>=0;_--)(!m[_].id||m[_].id===h||l==="load")&&(setTimeout((function(g){g.call(this,h,d)}).bind(p,m[_].fn),0),m[_].once&&p.off(l,m[_].fn,m[_].id));return p._loadQueue(l),p},_loadQueue:function(l){var h=this;if(h._queue.length>0){var d=h._queue[0];d.event===l&&(h._queue.shift(),h._loadQueue()),l||d.action()}return h},_ended:function(l){var h=this,d=l._sprite;if(!h._webAudio&&l._node&&!l._node.paused&&!l._node.ended&&l._node.currentTime<l._stop)return setTimeout(h._ended.bind(h,l),100),h;var p=!!(l._loop||h._sprite[d][2]);if(h._emit("end",l._id),!h._webAudio&&p&&h.stop(l._id,!0).play(l._id),h._webAudio&&p){h._emit("play",l._id),l._seek=l._start||0,l._rateSeek=0,l._playStart=r.ctx.currentTime;var m=(l._stop-l._start)*1e3/Math.abs(l._rate);h._endTimers[l._id]=setTimeout(h._ended.bind(h,l),m)}return h._webAudio&&!p&&(l._paused=!0,l._ended=!0,l._seek=l._start||0,l._rateSeek=0,h._clearTimer(l._id),h._cleanBuffer(l._node),r._autoSuspend()),!h._webAudio&&!p&&h.stop(l._id,!0),h},_clearTimer:function(l){var h=this;if(h._endTimers[l]){if(typeof h._endTimers[l]!="function")clearTimeout(h._endTimers[l]);else{var d=h._soundById(l);d&&d._node&&d._node.removeEventListener("ended",h._endTimers[l],!1)}delete h._endTimers[l]}return h},_soundById:function(l){for(var h=this,d=0;d<h._sounds.length;d++)if(l===h._sounds[d]._id)return h._sounds[d];return null},_inactiveSound:function(){var l=this;l._drain();for(var h=0;h<l._sounds.length;h++)if(l._sounds[h]._ended)return l._sounds[h].reset();return new n(l)},_drain:function(){var l=this,h=l._pool,d=0,p=0;if(!(l._sounds.length<h)){for(p=0;p<l._sounds.length;p++)l._sounds[p]._ended&&d++;for(p=l._sounds.length-1;p>=0;p--){if(d<=h)return;l._sounds[p]._ended&&(l._webAudio&&l._sounds[p]._node&&l._sounds[p]._node.disconnect(0),l._sounds.splice(p,1),d--)}}},_getSoundIds:function(l){var h=this;if(typeof l>"u"){for(var d=[],p=0;p<h._sounds.length;p++)d.push(h._sounds[p]._id);return d}else return[l]},_refreshBuffer:function(l){var h=this;return l._node.bufferSource=r.ctx.createBufferSource(),l._node.bufferSource.buffer=s[h._src],l._panner?l._node.bufferSource.connect(l._panner):l._node.bufferSource.connect(l._node),l._node.bufferSource.loop=l._loop,l._loop&&(l._node.bufferSource.loopStart=l._start||0,l._node.bufferSource.loopEnd=l._stop||0),l._node.bufferSource.playbackRate.setValueAtTime(l._rate,r.ctx.currentTime),h},_cleanBuffer:function(l){var h=this,d=r._navigator&&r._navigator.vendor.indexOf("Apple")>=0;if(r._scratchBuffer&&l.bufferSource&&(l.bufferSource.onended=null,l.bufferSource.disconnect(0),d))try{l.bufferSource.buffer=r._scratchBuffer}catch{}return l.bufferSource=null,h},_clearSound:function(l){var h=/MSIE |Trident\//.test(r._navigator&&r._navigator.userAgent);h||(l.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var n=function(l){this._parent=l,this.init()};n.prototype={init:function(){var l=this,h=l._parent;return l._muted=h._muted,l._loop=h._loop,l._volume=h._volume,l._rate=h._rate,l._seek=0,l._paused=!0,l._ended=!0,l._sprite="__default",l._id=++r._counter,h._sounds.push(l),l.create(),l},create:function(){var l=this,h=l._parent,d=r._muted||l._muted||l._parent._muted?0:l._volume;return h._webAudio?(l._node=typeof r.ctx.createGain>"u"?r.ctx.createGainNode():r.ctx.createGain(),l._node.gain.setValueAtTime(d,r.ctx.currentTime),l._node.paused=!0,l._node.connect(r.masterGain)):r.noAudio||(l._node=r._obtainHtml5Audio(),l._errorFn=l._errorListener.bind(l),l._node.addEventListener("error",l._errorFn,!1),l._loadFn=l._loadListener.bind(l),l._node.addEventListener(r._canPlayEvent,l._loadFn,!1),l._endFn=l._endListener.bind(l),l._node.addEventListener("ended",l._endFn,!1),l._node.src=h._src,l._node.preload=h._preload===!0?"auto":h._preload,l._node.volume=d*r.volume(),l._node.load()),l},reset:function(){var l=this,h=l._parent;return l._muted=h._muted,l._loop=h._loop,l._volume=h._volume,l._rate=h._rate,l._seek=0,l._rateSeek=0,l._paused=!0,l._ended=!0,l._sprite="__default",l._id=++r._counter,l},_errorListener:function(){var l=this;l._parent._emit("loaderror",l._id,l._node.error?l._node.error.code:0),l._node.removeEventListener("error",l._errorFn,!1)},_loadListener:function(){var l=this,h=l._parent;h._duration=Math.ceil(l._node.duration*10)/10,Object.keys(h._sprite).length===0&&(h._sprite={__default:[0,h._duration*1e3]}),h._state!=="loaded"&&(h._state="loaded",h._emit("load"),h._loadQueue()),l._node.removeEventListener(r._canPlayEvent,l._loadFn,!1)},_endListener:function(){var l=this,h=l._parent;h._duration===1/0&&(h._duration=Math.ceil(l._node.duration*10)/10,h._sprite.__default[1]===1/0&&(h._sprite.__default[1]=h._duration*1e3),h._ended(l)),l._node.removeEventListener("ended",l._endFn,!1)}};var s={},a=function(l){var h=l._src;if(s[h]){l._duration=s[h].duration,c(l);return}if(/^data:[^;]+;base64,/.test(h)){for(var d=atob(h.split(",")[1]),p=new Uint8Array(d.length),m=0;m<d.length;++m)p[m]=d.charCodeAt(m);u(p.buffer,l)}else{var _=new XMLHttpRequest;_.open(l._xhr.method,h,!0),_.withCredentials=l._xhr.withCredentials,_.responseType="arraybuffer",l._xhr.headers&&Object.keys(l._xhr.headers).forEach(function(g){_.setRequestHeader(g,l._xhr.headers[g])}),_.onload=function(){var g=(_.status+"")[0];if(g!=="0"&&g!=="2"&&g!=="3"){l._emit("loaderror",null,"Failed loading audio file with status: "+_.status+".");return}u(_.response,l)},_.onerror=function(){l._webAudio&&(l._html5=!0,l._webAudio=!1,l._sounds=[],delete s[h],l.load())},o(_)}},o=function(l){try{l.send()}catch{l.onerror()}},u=function(l,h){var d=function(){h._emit("loaderror",null,"Decoding audio data failed.")},p=function(m){m&&h._sounds.length>0?(s[h._src]=m,c(h,m)):d()};typeof Promise<"u"&&r.ctx.decodeAudioData.length===1?r.ctx.decodeAudioData(l).then(p).catch(d):r.ctx.decodeAudioData(l,p,d)},c=function(l,h){h&&!l._duration&&(l._duration=h.duration),Object.keys(l._sprite).length===0&&(l._sprite={__default:[0,l._duration*1e3]}),l._state!=="loaded"&&(l._state="loaded",l._emit("load"),l._loadQueue())},f=function(){if(r.usingWebAudio){try{typeof AudioContext<"u"?r.ctx=new AudioContext:typeof webkitAudioContext<"u"?r.ctx=new webkitAudioContext:r.usingWebAudio=!1}catch{r.usingWebAudio=!1}r.ctx||(r.usingWebAudio=!1);var l=/iP(hone|od|ad)/.test(r._navigator&&r._navigator.platform),h=r._navigator&&r._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),d=h?parseInt(h[1],10):null;if(l&&d&&d<9){var p=/safari/.test(r._navigator&&r._navigator.userAgent.toLowerCase());r._navigator&&!p&&(r.usingWebAudio=!1)}r.usingWebAudio&&(r.masterGain=typeof r.ctx.createGain>"u"?r.ctx.createGainNode():r.ctx.createGain(),r.masterGain.gain.setValueAtTime(r._muted?0:r._volume,r.ctx.currentTime),r.masterGain.connect(r.ctx.destination)),r._setup()}};t.Howler=r,t.Howl=i,typeof We<"u"?(We.HowlerGlobal=e,We.Howler=r,We.Howl=i,We.Sound=n):typeof window<"u"&&(window.HowlerGlobal=e,window.Howler=r,window.Howl=i,window.Sound=n)})();/*!
|
|
1981
1981
|
* Spatial Plugin - Adds support for stereo and 3D audio where Web Audio is supported.
|
|
1982
1982
|
*
|
|
1983
1983
|
* howler.js v2.2.3
|
|
@@ -1987,30 +1987,4 @@ void main() {
|
|
|
1987
1987
|
* goldfirestudios.com
|
|
1988
1988
|
*
|
|
1989
1989
|
* MIT License
|
|
1990
|
-
*/(function(){HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(r){var n=this;if(!n.ctx||!n.ctx.listener)return n;for(var i=n._howls.length-1;i>=0;i--)n._howls[i].stereo(r);return n},HowlerGlobal.prototype.pos=function(r,n,i){var a=this;if(!a.ctx||!a.ctx.listener)return a;if(n=typeof n!="number"?a._pos[1]:n,i=typeof i!="number"?a._pos[2]:i,typeof r=="number")a._pos=[r,n,i],typeof a.ctx.listener.positionX<"u"?(a.ctx.listener.positionX.setTargetAtTime(a._pos[0],Howler.ctx.currentTime,.1),a.ctx.listener.positionY.setTargetAtTime(a._pos[1],Howler.ctx.currentTime,.1),a.ctx.listener.positionZ.setTargetAtTime(a._pos[2],Howler.ctx.currentTime,.1)):a.ctx.listener.setPosition(a._pos[0],a._pos[1],a._pos[2]);else return a._pos;return a},HowlerGlobal.prototype.orientation=function(r,n,i,a,u,l){var h=this;if(!h.ctx||!h.ctx.listener)return h;var p=h._orientation;if(n=typeof n!="number"?p[1]:n,i=typeof i!="number"?p[2]:i,a=typeof a!="number"?p[3]:a,u=typeof u!="number"?p[4]:u,l=typeof l!="number"?p[5]:l,typeof r=="number")h._orientation=[r,n,i,a,u,l],typeof h.ctx.listener.forwardX<"u"?(h.ctx.listener.forwardX.setTargetAtTime(r,Howler.ctx.currentTime,.1),h.ctx.listener.forwardY.setTargetAtTime(n,Howler.ctx.currentTime,.1),h.ctx.listener.forwardZ.setTargetAtTime(i,Howler.ctx.currentTime,.1),h.ctx.listener.upX.setTargetAtTime(a,Howler.ctx.currentTime,.1),h.ctx.listener.upY.setTargetAtTime(u,Howler.ctx.currentTime,.1),h.ctx.listener.upZ.setTargetAtTime(l,Howler.ctx.currentTime,.1)):h.ctx.listener.setOrientation(r,n,i,a,u,l);else return p;return h},Howl.prototype.init=function(r){return function(n){var i=this;return i._orientation=n.orientation||[1,0,0],i._stereo=n.stereo||null,i._pos=n.pos||null,i._pannerAttr={coneInnerAngle:typeof n.coneInnerAngle<"u"?n.coneInnerAngle:360,coneOuterAngle:typeof n.coneOuterAngle<"u"?n.coneOuterAngle:360,coneOuterGain:typeof n.coneOuterGain<"u"?n.coneOuterGain:0,distanceModel:typeof n.distanceModel<"u"?n.distanceModel:"inverse",maxDistance:typeof n.maxDistance<"u"?n.maxDistance:1e4,panningModel:typeof n.panningModel<"u"?n.panningModel:"HRTF",refDistance:typeof n.refDistance<"u"?n.refDistance:1,rolloffFactor:typeof n.rolloffFactor<"u"?n.rolloffFactor:1},i._onstereo=n.onstereo?[{fn:n.onstereo}]:[],i._onpos=n.onpos?[{fn:n.onpos}]:[],i._onorientation=n.onorientation?[{fn:n.onorientation}]:[],r.call(this,n)}}(Howl.prototype.init),Howl.prototype.stereo=function(r,n){var i=this;if(!i._webAudio)return i;if(i._state!=="loaded")return i._queue.push({event:"stereo",action:function(){i.stereo(r,n)}}),i;var a=typeof Howler.ctx.createStereoPanner>"u"?"spatial":"stereo";if(typeof n>"u")if(typeof r=="number")i._stereo=r,i._pos=[r,0,0];else return i._stereo;for(var u=i._getSoundIds(n),l=0;l<u.length;l++){var h=i._soundById(u[l]);if(h)if(typeof r=="number")h._stereo=r,h._pos=[r,0,0],h._node&&(h._pannerAttr.panningModel="equalpower",(!h._panner||!h._panner.pan)&&e(h,a),a==="spatial"?typeof h._panner.positionX<"u"?(h._panner.positionX.setValueAtTime(r,Howler.ctx.currentTime),h._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),h._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):h._panner.setPosition(r,0,0):h._panner.pan.setValueAtTime(r,Howler.ctx.currentTime)),i._emit("stereo",h._id);else return h._stereo}return i},Howl.prototype.pos=function(r,n,i,a){var u=this;if(!u._webAudio)return u;if(u._state!=="loaded")return u._queue.push({event:"pos",action:function(){u.pos(r,n,i,a)}}),u;if(n=typeof n!="number"?0:n,i=typeof i!="number"?-.5:i,typeof a>"u")if(typeof r=="number")u._pos=[r,n,i];else return u._pos;for(var l=u._getSoundIds(a),h=0;h<l.length;h++){var p=u._soundById(l[h]);if(p)if(typeof r=="number")p._pos=[r,n,i],p._node&&((!p._panner||p._panner.pan)&&e(p,"spatial"),typeof p._panner.positionX<"u"?(p._panner.positionX.setValueAtTime(r,Howler.ctx.currentTime),p._panner.positionY.setValueAtTime(n,Howler.ctx.currentTime),p._panner.positionZ.setValueAtTime(i,Howler.ctx.currentTime)):p._panner.setPosition(r,n,i)),u._emit("pos",p._id);else return p._pos}return u},Howl.prototype.orientation=function(r,n,i,a){var u=this;if(!u._webAudio)return u;if(u._state!=="loaded")return u._queue.push({event:"orientation",action:function(){u.orientation(r,n,i,a)}}),u;if(n=typeof n!="number"?u._orientation[1]:n,i=typeof i!="number"?u._orientation[2]:i,typeof a>"u")if(typeof r=="number")u._orientation=[r,n,i];else return u._orientation;for(var l=u._getSoundIds(a),h=0;h<l.length;h++){var p=u._soundById(l[h]);if(p)if(typeof r=="number")p._orientation=[r,n,i],p._node&&(p._panner||(p._pos||(p._pos=u._pos||[0,0,-.5]),e(p,"spatial")),typeof p._panner.orientationX<"u"?(p._panner.orientationX.setValueAtTime(r,Howler.ctx.currentTime),p._panner.orientationY.setValueAtTime(n,Howler.ctx.currentTime),p._panner.orientationZ.setValueAtTime(i,Howler.ctx.currentTime)):p._panner.setOrientation(r,n,i)),u._emit("orientation",p._id);else return p._orientation}return u},Howl.prototype.pannerAttr=function(){var r=this,n=arguments,i,a,u;if(!r._webAudio)return r;if(n.length===0)return r._pannerAttr;if(n.length===1)if(typeof n[0]=="object")i=n[0],typeof a>"u"&&(i.pannerAttr||(i.pannerAttr={coneInnerAngle:i.coneInnerAngle,coneOuterAngle:i.coneOuterAngle,coneOuterGain:i.coneOuterGain,distanceModel:i.distanceModel,maxDistance:i.maxDistance,refDistance:i.refDistance,rolloffFactor:i.rolloffFactor,panningModel:i.panningModel}),r._pannerAttr={coneInnerAngle:typeof i.pannerAttr.coneInnerAngle<"u"?i.pannerAttr.coneInnerAngle:r._coneInnerAngle,coneOuterAngle:typeof i.pannerAttr.coneOuterAngle<"u"?i.pannerAttr.coneOuterAngle:r._coneOuterAngle,coneOuterGain:typeof i.pannerAttr.coneOuterGain<"u"?i.pannerAttr.coneOuterGain:r._coneOuterGain,distanceModel:typeof i.pannerAttr.distanceModel<"u"?i.pannerAttr.distanceModel:r._distanceModel,maxDistance:typeof i.pannerAttr.maxDistance<"u"?i.pannerAttr.maxDistance:r._maxDistance,refDistance:typeof i.pannerAttr.refDistance<"u"?i.pannerAttr.refDistance:r._refDistance,rolloffFactor:typeof i.pannerAttr.rolloffFactor<"u"?i.pannerAttr.rolloffFactor:r._rolloffFactor,panningModel:typeof i.pannerAttr.panningModel<"u"?i.pannerAttr.panningModel:r._panningModel});else return u=r._soundById(parseInt(n[0],10)),u?u._pannerAttr:r._pannerAttr;else n.length===2&&(i=n[0],a=parseInt(n[1],10));for(var l=r._getSoundIds(a),h=0;h<l.length;h++)if(u=r._soundById(l[h]),u){var p=u._pannerAttr;p={coneInnerAngle:typeof i.coneInnerAngle<"u"?i.coneInnerAngle:p.coneInnerAngle,coneOuterAngle:typeof i.coneOuterAngle<"u"?i.coneOuterAngle:p.coneOuterAngle,coneOuterGain:typeof i.coneOuterGain<"u"?i.coneOuterGain:p.coneOuterGain,distanceModel:typeof i.distanceModel<"u"?i.distanceModel:p.distanceModel,maxDistance:typeof i.maxDistance<"u"?i.maxDistance:p.maxDistance,refDistance:typeof i.refDistance<"u"?i.refDistance:p.refDistance,rolloffFactor:typeof i.rolloffFactor<"u"?i.rolloffFactor:p.rolloffFactor,panningModel:typeof i.panningModel<"u"?i.panningModel:p.panningModel};var m=u._panner;m?(m.coneInnerAngle=p.coneInnerAngle,m.coneOuterAngle=p.coneOuterAngle,m.coneOuterGain=p.coneOuterGain,m.distanceModel=p.distanceModel,m.maxDistance=p.maxDistance,m.refDistance=p.refDistance,m.rolloffFactor=p.rolloffFactor,m.panningModel=p.panningModel):(u._pos||(u._pos=r._pos||[0,0,-.5]),e(u,"spatial"))}return r},Sound.prototype.init=function(r){return function(){var n=this,i=n._parent;n._orientation=i._orientation,n._stereo=i._stereo,n._pos=i._pos,n._pannerAttr=i._pannerAttr,r.call(this),n._stereo?i.stereo(n._stereo):n._pos&&i.pos(n._pos[0],n._pos[1],n._pos[2],n._id)}}(Sound.prototype.init),Sound.prototype.reset=function(r){return function(){var n=this,i=n._parent;return n._orientation=i._orientation,n._stereo=i._stereo,n._pos=i._pos,n._pannerAttr=i._pannerAttr,n._stereo?i.stereo(n._stereo):n._pos?i.pos(n._pos[0],n._pos[1],n._pos[2],n._id):n._panner&&(n._panner.disconnect(0),n._panner=void 0,i._refreshBuffer(n)),r.call(this)}}(Sound.prototype.reset);var e=function(r,n){n=n||"spatial",n==="spatial"?(r._panner=Howler.ctx.createPanner(),r._panner.coneInnerAngle=r._pannerAttr.coneInnerAngle,r._panner.coneOuterAngle=r._pannerAttr.coneOuterAngle,r._panner.coneOuterGain=r._pannerAttr.coneOuterGain,r._panner.distanceModel=r._pannerAttr.distanceModel,r._panner.maxDistance=r._pannerAttr.maxDistance,r._panner.refDistance=r._pannerAttr.refDistance,r._panner.rolloffFactor=r._pannerAttr.rolloffFactor,r._panner.panningModel=r._pannerAttr.panningModel,typeof r._panner.positionX<"u"?(r._panner.positionX.setValueAtTime(r._pos[0],Howler.ctx.currentTime),r._panner.positionY.setValueAtTime(r._pos[1],Howler.ctx.currentTime),r._panner.positionZ.setValueAtTime(r._pos[2],Howler.ctx.currentTime)):r._panner.setPosition(r._pos[0],r._pos[1],r._pos[2]),typeof r._panner.orientationX<"u"?(r._panner.orientationX.setValueAtTime(r._orientation[0],Howler.ctx.currentTime),r._panner.orientationY.setValueAtTime(r._orientation[1],Howler.ctx.currentTime),r._panner.orientationZ.setValueAtTime(r._orientation[2],Howler.ctx.currentTime)):r._panner.setOrientation(r._orientation[0],r._orientation[1],r._orientation[2])):(r._panner=Howler.ctx.createStereoPanner(),r._panner.pan.setValueAtTime(r._stereo,Howler.ctx.currentTime)),r._panner.connect(r._node),r._paused||r._parent.pause(r._id,!0).play(r._id,!0)}})()})(Zg);const oP=t=>{const e={isPlaying:!1,progress:0,speed:1,mute:!1,isWaiting:!1,loaded:!1,size:{width:50,height:50},isDragging:!1},[,r]=te.useState(!1),n=j.useRef(null),i=j.useRef(e),a=j.useRef(null),u=te.useRef(null),{tl:l,dragModeRef:h}=j.useContext(on),{uniqueId:p,src:m,startAt:c,endAt:d,mute:g,speed:v,audioStartAt:y,audioEndAt:b,visible:x}=t;ht(Ze.PAUSE,()=>{var F;n.current&&u.current&&((F=u.current)==null||F.pause(),i.current.isPlaying=!1)}),ht(Ze.COMPLETE,()=>{y>0&&u.current&&u.current.seek(y)}),ht(Ze.SCRUBBER_CLICKED,()=>{var F;n.current&&u.current&&((F=u.current)==null||F.pause(),i.current.isPlaying=!1)}),te.useEffect(()=>{u.current&&(h.current?(u.current.pause(),i.current.isPlaying=!1,i.current.isDragging=!0):i.current.isDragging=!1)},[h]);const E=(F,N)=>{l.current&&l.current.isActive()&&a.current&&a.current.isActive()&&!h.current&&u.current&&(console.log("gsap on start 0020",p,F,N),u.current.play(),i.current.isPlaying=!0)},w=()=>{var F;n.current&&((F=u.current)==null||F.stop(),i.current.isPlaying=!1,i.current.completed=!0)},I=F=>{var L,D;const N=F+((L=a.current)==null?void 0:L.time());u.current&&h.current?(u.current.seek(N),u.current.pause(),i.current.isPlaying=!1):n.current&&!i.current.isPlaying&&((D=l.current)!=null&&D.isActive())&&u.current&&(u.current.seek(N),u.current.play(),i.current.isPlaying=!0)},O=()=>{};return j.useEffect(()=>{let F=ee.context(()=>{});if(n.current&&l.current){const N={duration:Number(b)-Number(y),onStart:E,onComplete:w,onStartParams:[y,b],onCompleteParams:[],onInterrupt:O,onUpdate:I,onUpdateParams:[y,b]};F=ee.context(()=>{a.current=ee.from(n.current,N,y),l.current.to(n.current,{alpha:1,duration:.01},c).to(n.current,{alpha:0,duration:.1},Number(d)),l.current.add(a.current,c)})}return()=>{a.current&&(a.current.kill(),ee.killTweensOf(a.current)),F.revert()}},[c,d,y,b]),te.useEffect(()=>{n.current&&r(!0)},[]),te.useEffect(()=>(ss(m)||(u.current=new Zg.Howl({src:[m],autoplay:!1,loop:!1,rate:v||1,volume:!g&&x?1:0,onload:()=>{console.log("loaded audio sprite"+p),i.current.loaded=!0,u.current&&(y>0&&u.current.seek(y),u.current.volume(!g&&x?1:0),u.current.rate(v||1),u.current.pause(),i.current.isPlaying=!1,i.current.completed=!1)},onend:()=>{console.log("end of playing audio sprite"+p),i.current.isPlaying=!1,i.current.completed=!0},onplay:()=>{console.log("play of playing audio sprite"+p),i.current.isPlaying=!0},onpause:()=>{console.log("pause of playing audio sprite"+p),i.current.isPlaying=!1},onstop:()=>{console.log("stop of playing audio sprite"+p),i.current.isPlaying=!1}})),()=>{u.current&&u.current.unload()}),[p,m,c,d,y,b,g,x,v]),te.useEffect(()=>{u.current&&(console.log("running updateEffect 2002",p,b),u.current.volume(!g&&x?1:0),u.current.rate(v||1),i.current.isPlaying=!0)},[g,x,v]),Se.jsx(De.Container,{ref:n})};function uP(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var Qg=uP,lP=Zh,cP=Su,hP=1,fP=2;function dP(t,e,r,n){var i=r.length,a=i,u=!n;if(t==null)return!a;for(t=Object(t);i--;){var l=r[i];if(u&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++i<a;){l=r[i];var h=l[0],p=t[h],m=l[1];if(u&&l[2]){if(p===void 0&&!(h in t))return!1}else{var c=new lP;if(n)var d=n(p,m,h,t,e,c);if(!(d===void 0?cP(m,p,hP|fP,n,c):d))return!1}}return!0}var pP=dP,gP=ns;function mP(t){return t===t&&!gP(t)}var Jg=mP,_P=Jg,vP=_u;function yP(t){for(var e=vP(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,_P(i)]}return e}var xP=yP;function bP(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}var e0=bP,TP=pP,wP=xP,SP=e0;function AP(t){var e=wP(t);return e.length==1&&e[0][2]?SP(e[0][0],e[0][1]):function(r){return r===t||TP(r,t,e)}}var EP=AP,CP=rs,IP=is,RP="[object Symbol]";function PP(t){return typeof t=="symbol"||IP(t)&&CP(t)==RP}var fo=PP,MP=Lr,OP=fo,FP=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,NP=/^\w*$/;function LP(t,e){if(MP(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||OP(t)?!0:NP.test(t)||!FP.test(t)||e!=null&&t in Object(e)}var lc=LP,t0=hu,kP="Expected a function";function cc(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(kP);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var u=t.apply(this,n);return r.cache=a.set(i,u)||a,u};return r.cache=new(cc.Cache||t0),r}cc.Cache=t0;var DP=cc,BP=DP,UP=500;function $P(t){var e=BP(t,function(n){return r.size===UP&&r.clear(),n}),r=e.cache;return e}var GP=$P,zP=GP,HP=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,VP=/\\(\\)?/g,XP=zP(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(HP,function(r,n,i,a){e.push(i?a.replace(VP,"$1"):n||r)}),e}),jP=XP,r0=ea,WP=Qg,qP=Lr,YP=fo,KP=1/0,n0=r0?r0.prototype:void 0,i0=n0?n0.toString:void 0;function s0(t){if(typeof t=="string")return t;if(qP(t))return WP(t,s0)+"";if(YP(t))return i0?i0.call(t):"";var e=t+"";return e=="0"&&1/t==-KP?"-0":e}var ZP=s0,QP=ZP;function JP(t){return t==null?"":QP(t)}var eM=JP,tM=Lr,rM=lc,nM=jP,iM=eM;function sM(t,e){return tM(t)?t:rM(t,e)?[t]:nM(iM(t))}var a0=sM,aM=fo,oM=1/0;function uM(t){if(typeof t=="string"||aM(t))return t;var e=t+"";return e=="0"&&1/t==-oM?"-0":e}var po=uM,lM=a0,cM=po;function hM(t,e){e=lM(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[cM(e[r++])];return r&&r==n?t:void 0}var o0=hM,fM=o0;function dM(t,e,r){var n=t==null?void 0:fM(t,e);return n===void 0?r:n}var pM=dM;function gM(t,e){return t!=null&&e in Object(t)}var mM=gM,_M=a0,vM=du,yM=Lr,xM=af,bM=gu,TM=po;function wM(t,e,r){e=_M(e,t);for(var n=-1,i=e.length,a=!1;++n<i;){var u=TM(e[n]);if(!(a=t!=null&&r(t,u)))break;t=t[u]}return a||++n!=i?a:(i=t==null?0:t.length,!!i&&bM(i)&&xM(u,i)&&(yM(t)||vM(t)))}var SM=wM,AM=mM,EM=SM;function CM(t,e){return t!=null&&EM(t,e,AM)}var IM=CM,RM=Su,PM=pM,MM=IM,OM=lc,FM=Jg,NM=e0,LM=po,kM=1,DM=2;function BM(t,e){return OM(t)&&FM(e)?NM(LM(t),e):function(r){var n=PM(r,t);return n===void 0&&n===e?MM(r,t):RM(e,n,kM|DM)}}var UM=BM;function $M(t){return t}var GM=$M;function zM(t){return function(e){return e==null?void 0:e[t]}}var HM=zM,VM=o0;function XM(t){return function(e){return VM(e,t)}}var jM=XM,WM=HM,qM=jM,YM=lc,KM=po;function ZM(t){return YM(t)?WM(KM(t)):qM(t)}var QM=ZM,JM=EP,eO=UM,tO=GM,rO=Lr,nO=QM;function iO(t){return typeof t=="function"?t:t==null?tO:typeof t=="object"?rO(t)?eO(t[0],t[1]):JM(t):nO(t)}var sO=iO;function aO(t){return function(e,r,n){for(var i=-1,a=Object(e),u=n(e),l=u.length;l--;){var h=u[t?l:++i];if(r(a[h],h,a)===!1)break}return e}}var oO=aO,uO=oO,lO=uO(),cO=lO,hO=cO,fO=_u;function dO(t,e){return t&&hO(t,e,fO)}var pO=dO,gO=aa;function mO(t,e){return function(r,n){if(r==null)return r;if(!gO(r))return t(r,n);for(var i=r.length,a=e?i:-1,u=Object(r);(e?a--:++a<i)&&n(u[a],a,u)!==!1;);return r}}var _O=mO,vO=pO,yO=_O,xO=yO(vO),bO=xO,TO=bO,wO=aa;function SO(t,e){var r=-1,n=wO(t)?Array(t.length):[];return TO(t,function(i,a,u){n[++r]=e(i,a,u)}),n}var AO=SO,EO=Qg,CO=sO,IO=AO,RO=Lr;function PO(t,e){var r=RO(t)?EO:IO;return r(t,CO(e))}var MO=PO;const OO=Cn(MO);var qn={},u0={},Kr={};Object.defineProperty(Kr,"__esModule",{value:!0}),Kr.loop=Kr.conditional=Kr.parse=void 0;var FO=function t(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:n;if(Array.isArray(r))r.forEach(function(u){return t(e,u,n,i)});else if(typeof r=="function")r(e,n,i,t);else{var a=Object.keys(r)[0];Array.isArray(r[a])?(i[a]={},t(e,r[a],n,i[a])):i[a]=r[a](e,n,i,t)}return n};Kr.parse=FO;var NO=function(e,r){return function(n,i,a,u){r(n,i,a)&&u(n,e,i,a)}};Kr.conditional=NO;var LO=function(e,r){return function(n,i,a,u){for(var l=[],h=n.pos;r(n,i,a);){var p={};if(u(n,e,i,p),n.pos===h)break;h=n.pos,l.push(p)}return l}};Kr.loop=LO;var pt={};Object.defineProperty(pt,"__esModule",{value:!0}),pt.readBits=pt.readArray=pt.readUnsigned=pt.readString=pt.peekBytes=pt.readBytes=pt.peekByte=pt.readByte=pt.buildStream=void 0;var kO=function(e){return{data:e,pos:0}};pt.buildStream=kO;var l0=function(){return function(e){return e.data[e.pos++]}};pt.readByte=l0;var DO=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(r){return r.data[r.pos+e]}};pt.peekByte=DO;var go=function(e){return function(r){return r.data.subarray(r.pos,r.pos+=e)}};pt.readBytes=go;var BO=function(e){return function(r){return r.data.subarray(r.pos,r.pos+e)}};pt.peekBytes=BO;var UO=function(e){return function(r){return Array.from(go(e)(r)).map(function(n){return String.fromCharCode(n)}).join("")}};pt.readString=UO;var $O=function(e){return function(r){var n=go(2)(r);return e?(n[1]<<8)+n[0]:(n[0]<<8)+n[1]}};pt.readUnsigned=$O;var GO=function(e,r){return function(n,i,a){for(var u=typeof r=="function"?r(n,i,a):r,l=go(e),h=new Array(u),p=0;p<u;p++)h[p]=l(n);return h}};pt.readArray=GO;var zO=function(e,r,n){for(var i=0,a=0;a<n;a++)i+=e[r+a]&&Math.pow(2,n-a-1);return i},HO=function(e){return function(r){for(var n=l0()(r),i=new Array(8),a=0;a<8;a++)i[7-a]=!!(n&1<<a);return Object.keys(e).reduce(function(u,l){var h=e[l];return h.length?u[l]=zO(i,h.index,h.length):u[l]=i[h.index],u},{})}};pt.readBits=HO,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=Kr,r=pt,n={blocks:function(d){for(var g=0,v=[],y=d.data.length,b=0,x=(0,r.readByte)()(d);x!==g&&x;x=(0,r.readByte)()(d)){if(d.pos+x>=y){var E=y-d.pos;v.push((0,r.readBytes)(E)(d)),b+=E;break}v.push((0,r.readBytes)(x)(d)),b+=x}for(var w=new Uint8Array(b),I=0,O=0;O<v.length;O++)w.set(v[O],I),I+=v[O].length;return w}},i=(0,e.conditional)({gce:[{codes:(0,r.readBytes)(2)},{byteSize:(0,r.readByte)()},{extras:(0,r.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,r.readUnsigned)(!0)},{transparentColorIndex:(0,r.readByte)()},{terminator:(0,r.readByte)()}]},function(c){var d=(0,r.peekBytes)(2)(c);return d[0]===33&&d[1]===249}),a=(0,e.conditional)({image:[{code:(0,r.readByte)()},{descriptor:[{left:(0,r.readUnsigned)(!0)},{top:(0,r.readUnsigned)(!0)},{width:(0,r.readUnsigned)(!0)},{height:(0,r.readUnsigned)(!0)},{lct:(0,r.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,e.conditional)({lct:(0,r.readArray)(3,function(c,d,g){return Math.pow(2,g.descriptor.lct.size+1)})},function(c,d,g){return g.descriptor.lct.exists}),{data:[{minCodeSize:(0,r.readByte)()},n]}]},function(c){return(0,r.peekByte)()(c)===44}),u=(0,e.conditional)({text:[{codes:(0,r.readBytes)(2)},{blockSize:(0,r.readByte)()},{preData:function(d,g,v){return(0,r.readBytes)(v.text.blockSize)(d)}},n]},function(c){var d=(0,r.peekBytes)(2)(c);return d[0]===33&&d[1]===1}),l=(0,e.conditional)({application:[{codes:(0,r.readBytes)(2)},{blockSize:(0,r.readByte)()},{id:function(d,g,v){return(0,r.readString)(v.blockSize)(d)}},n]},function(c){var d=(0,r.peekBytes)(2)(c);return d[0]===33&&d[1]===255}),h=(0,e.conditional)({comment:[{codes:(0,r.readBytes)(2)},n]},function(c){var d=(0,r.peekBytes)(2)(c);return d[0]===33&&d[1]===254}),p=[{header:[{signature:(0,r.readString)(3)},{version:(0,r.readString)(3)}]},{lsd:[{width:(0,r.readUnsigned)(!0)},{height:(0,r.readUnsigned)(!0)},{gct:(0,r.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,r.readByte)()},{pixelAspectRatio:(0,r.readByte)()}]},(0,e.conditional)({gct:(0,r.readArray)(3,function(c,d){return Math.pow(2,d.lsd.gct.size+1)})},function(c,d){return d.lsd.gct.exists}),{frames:(0,e.loop)([i,l,h,a,u],function(c){var d=(0,r.peekByte)()(c);return d===33||d===44})}],m=p;t.default=m}(u0);var mo={};Object.defineProperty(mo,"__esModule",{value:!0}),mo.deinterlace=void 0;var VO=function(e,r){for(var n=new Array(e.length),i=e.length/r,a=function(d,g){var v=e.slice(g*r,(g+1)*r);n.splice.apply(n,[d*r,r].concat(v))},u=[0,4,2,1],l=[8,8,4,2],h=0,p=0;p<4;p++)for(var m=u[p];m<i;m+=l[p])a(m,h),h++;return n};mo.deinterlace=VO;var _o={};Object.defineProperty(_o,"__esModule",{value:!0}),_o.lzw=void 0;var XO=function(e,r,n){var i=4096,a=-1,u=n,l,h,p,m,c,d,g,F,v,y,O,b,N,L,V,D,x=new Array(n),E=new Array(i),w=new Array(i),I=new Array(i+1);for(b=e,h=1<<b,c=h+1,l=h+2,g=a,m=b+1,p=(1<<m)-1,v=0;v<h;v++)E[v]=0,w[v]=v;var O,F,N,L,D,V;for(O=F=N=L=D=V=0,y=0;y<u;){if(L===0){if(F<m){O+=r[V]<<F,F+=8,V++;continue}if(v=O&p,O>>=m,F-=m,v>l||v==c)break;if(v==h){m=b+1,p=(1<<m)-1,l=h+2,g=a;continue}if(g==a){I[L++]=w[v],g=v,N=v;continue}for(d=v,v==l&&(I[L++]=N,v=g);v>h;)I[L++]=w[v],v=E[v];N=w[v]&255,I[L++]=N,l<i&&(E[l]=g,w[l]=N,l++,!(l&p)&&l<i&&(m++,p+=l)),g=d}L--,x[D++]=I[L],y++}for(y=D;y<u;y++)x[y]=0;return x};_o.lzw=XO,Object.defineProperty(qn,"__esModule",{value:!0}),qn.decompressFrames=qn.decompressFrame=qn.parseGIF=void 0;var jO=ZO(u0),WO=Kr,qO=pt,YO=mo,KO=_o;function ZO(t){return t&&t.__esModule?t:{default:t}}var QO=function(e){var r=new Uint8Array(e);return(0,WO.parse)((0,qO.buildStream)(r),jO.default)};qn.parseGIF=QO;var JO=function(e){for(var r=e.pixels.length,n=new Uint8ClampedArray(r*4),i=0;i<r;i++){var a=i*4,u=e.pixels[i],l=e.colorTable[u]||[0,0,0];n[a]=l[0],n[a+1]=l[1],n[a+2]=l[2],n[a+3]=u!==e.transparentIndex?255:0}return n},c0=function(e,r,n){if(!e.image){console.warn("gif frame does not have associated image.");return}var i=e.image,a=i.descriptor.width*i.descriptor.height,u=(0,KO.lzw)(i.data.minCodeSize,i.data.blocks,a);i.descriptor.lct.interlaced&&(u=(0,YO.deinterlace)(u,i.descriptor.width));var l={pixels:u,dims:{top:e.image.descriptor.top,left:e.image.descriptor.left,width:e.image.descriptor.width,height:e.image.descriptor.height}};return i.descriptor.lct&&i.descriptor.lct.exists?l.colorTable=i.lct:l.colorTable=r,e.gce&&(l.delay=(e.gce.delay||10)*10,l.disposalType=e.gce.extras.disposal,e.gce.extras.transparentColorGiven&&(l.transparentIndex=e.gce.transparentColorIndex)),n&&(l.patch=JO(l)),l};qn.decompressFrame=c0;var eF=function(e,r){return e.frames.filter(function(n){return n.image}).map(function(n){return c0(n,e.gct,r)})};qn.decompressFrames=eF;const h0=(t,e={})=>{typeof e=="function"&&(e=e(t));const r=e.loaded&&t.loaded!==e.loaded,{playing:n,...i}=e,a={...t,...i};return r&&Object.assign(a,{playing:a.autoPlay&&a.loaded}),(e.delays!=null||e.frames!=null)&&Object.assign(a,{length:a.frames.length}),(e.index!=null||e.frames!=null)&&Object.assign(a,{index:a.length===0?0:(a.length+a.index)%a.length}),e.playing!=null&&Object.assign(a,a.loaded?{playing:n}:{autoPlay:n}),a},tF=t=>h0({autoPlay:!0,playing:!1,frames:[],delays:[],index:0,length:0,loaded:!1},t),rF=t=>j.useReducer(h0,t,tF);var nF='function e(e){var r={exports:{}};return e(r,r.exports),r.exports}var r=e((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.loop=r.conditional=r.parse=void 0;r.parse=function e(r,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n;if(Array.isArray(t))t.forEach((function(t){return e(r,t,n,a)}));else if("function"==typeof t)t(r,n,a,e);else{var i=Object.keys(t)[0];Array.isArray(t[i])?(a[i]={},e(r,t[i],n,a[i])):a[i]=t[i](r,n,a,e)}return n};r.conditional=function(e,r){return function(t,n,a,i){r(t,n,a)&&i(t,e,n,a)}};r.loop=function(e,r){return function(t,n,a,i){for(var o=[];r(t,n,a);){var s={};i(t,e,n,s),o.push(s)}return o}}})),t=e((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.readBits=r.readArray=r.readUnsigned=r.readString=r.peekBytes=r.readBytes=r.peekByte=r.readByte=r.buildStream=void 0;r.buildStream=function(e){return{data:e,pos:0}};var t=function(){return function(e){return e.data[e.pos++]}};r.readByte=t;r.peekByte=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return function(r){return r.data[r.pos+e]}};var n=function(e){return function(r){return r.data.subarray(r.pos,r.pos+=e)}};r.readBytes=n;r.peekBytes=function(e){return function(r){return r.data.subarray(r.pos,r.pos+e)}};r.readString=function(e){return function(r){return Array.from(n(e)(r)).map((function(e){return String.fromCharCode(e)})).join("")}};r.readUnsigned=function(e){return function(r){var t=n(2)(r);return e?(t[1]<<8)+t[0]:(t[0]<<8)+t[1]}};r.readArray=function(e,r){return function(t,a,i){for(var o="function"==typeof r?r(t,a,i):r,s=n(e),d=new Array(o),c=0;c<o;c++)d[c]=s(t);return d}};r.readBits=function(e){return function(r){for(var t=function(e){return e.data[e.pos++]}(r),n=new Array(8),a=0;a<8;a++)n[7-a]=!!(t&1<<a);return Object.keys(e).reduce((function(r,t){var a=e[t];return a.length?r[t]=function(e,r,t){for(var n=0,a=0;a<t;a++)n+=e[r+a]&&Math.pow(2,t-a-1);return n}(n,a.index,a.length):r[t]=n[a.index],r}),{})}}})),n=e((function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var a={blocks:function(e){for(var r=[],n=e.data.length,a=0,i=(0,t.readByte)()(e);0!==i;i=(0,t.readByte)()(e)){if(e.pos+i>=n){var o=n-e.pos;r.push((0,t.readBytes)(o)(e)),a+=o;break}r.push((0,t.readBytes)(i)(e)),a+=i}for(var s=new Uint8Array(a),d=0,c=0;c<r.length;c++)s.set(r[c],d),d+=r[c].length;return s}},i=(0,r.conditional)({gce:[{codes:(0,t.readBytes)(2)},{byteSize:(0,t.readByte)()},{extras:(0,t.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,t.readUnsigned)(!0)},{transparentColorIndex:(0,t.readByte)()},{terminator:(0,t.readByte)()}]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&249===r[1]})),o=(0,r.conditional)({image:[{code:(0,t.readByte)()},{descriptor:[{left:(0,t.readUnsigned)(!0)},{top:(0,t.readUnsigned)(!0)},{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{lct:(0,t.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,r.conditional)({lct:(0,t.readArray)(3,(function(e,r,t){return Math.pow(2,t.descriptor.lct.size+1)}))},(function(e,r,t){return t.descriptor.lct.exists})),{data:[{minCodeSize:(0,t.readByte)()},a]}]},(function(e){return 44===(0,t.peekByte)()(e)})),s=(0,r.conditional)({text:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{preData:function(e,r,n){return(0,t.readBytes)(n.text.blockSize)(e)}},a]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&1===r[1]})),d=(0,r.conditional)({application:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{id:function(e,r,n){return(0,t.readString)(n.blockSize)(e)}},a]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&255===r[1]})),c=(0,r.conditional)({comment:[{codes:(0,t.readBytes)(2)},a]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&254===r[1]})),u=[{header:[{signature:(0,t.readString)(3)},{version:(0,t.readString)(3)}]},{lsd:[{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{gct:(0,t.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,t.readByte)()},{pixelAspectRatio:(0,t.readByte)()}]},(0,r.conditional)({gct:(0,t.readArray)(3,(function(e,r){return Math.pow(2,r.lsd.gct.size+1)}))},(function(e,r){return r.lsd.gct.exists})),{frames:(0,r.loop)([i,d,c,o,s],(function(e){var r=(0,t.peekByte)()(e);return 33===r||44===r}))}];n.default=u})),a=e((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.deinterlace=void 0;r.deinterlace=function(e,r){for(var t=new Array(e.length),n=e.length/r,a=function(n,a){var i=e.slice(a*r,(a+1)*r);t.splice.apply(t,[n*r,r].concat(i))},i=[0,4,2,1],o=[8,8,4,2],s=0,d=0;d<4;d++)for(var c=i[d];c<n;c+=o[d])a(c,s),s++;return t}})),i=e((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.lzw=void 0;r.lzw=function(e,r,t){var n,a,i,o,s,d,c,u,l,f,p,g,y,h,v,m,x=4096,B=t,w=new Array(t),b=new Array(x),k=new Array(x),A=new Array(4097);for(s=(a=1<<(f=e))+1,n=a+2,c=-1,i=(1<<(o=f+1))-1,u=0;u<a;u++)b[u]=0,k[u]=u;for(p=g=y=h=v=m=0,l=0;l<B;){if(0===h){if(g<o){p+=r[m]<<g,g+=8,m++;continue}if(u=p&i,p>>=o,g-=o,u>n||u==s)break;if(u==a){i=(1<<(o=f+1))-1,n=a+2,c=-1;continue}if(-1==c){A[h++]=k[u],c=u,y=u;continue}for(d=u,u==n&&(A[h++]=y,u=c);u>a;)A[h++]=k[u],u=b[u];y=255&k[u],A[h++]=y,n<x&&(b[n]=c,k[n]=y,0==(++n&i)&&n<x&&(o++,i+=n)),c=d}h--,w[v++]=A[h],l++}for(l=v;l<B;l++)w[l]=0;return w}})),o=e((function(e,o){Object.defineProperty(o,"__esModule",{value:!0}),o.decompressFrames=o.decompressFrame=o.parseGIF=void 0;var s,d=(s=n)&&s.__esModule?s:{default:s};o.parseGIF=function(e){var n=new Uint8Array(e);return(0,r.parse)((0,t.buildStream)(n),d.default)};var c=function(e,r,t){if(e.image){var n=e.image,o=n.descriptor.width*n.descriptor.height,s=(0,i.lzw)(n.data.minCodeSize,n.data.blocks,o);n.descriptor.lct.interlaced&&(s=(0,a.deinterlace)(s,n.descriptor.width));var d={pixels:s,dims:{top:e.image.descriptor.top,left:e.image.descriptor.left,width:e.image.descriptor.width,height:e.image.descriptor.height}};return n.descriptor.lct&&n.descriptor.lct.exists?d.colorTable=n.lct:d.colorTable=r,e.gce&&(d.delay=10*(e.gce.delay||10),d.disposalType=e.gce.extras.disposal,e.gce.extras.transparentColorGiven&&(d.transparentIndex=e.gce.transparentColorIndex)),t&&(d.patch=function(e){for(var r=e.pixels.length,t=new Uint8ClampedArray(4*r),n=0;n<r;n++){var a=4*n,i=e.pixels[n],o=e.colorTable[i]||[0,0,0];t[a]=o[0],t[a+1]=o[1],t[a+2]=o[2],t[a+3]=i!==e.transparentIndex?255:0}return t}(d)),d}console.warn("gif frame does not have associated image.")};o.decompressFrame=c;o.decompressFrames=function(e,r){return e.frames.filter((function(e){return e.image})).map((function(t){return c(t,e.gct,r)}))}}));const s=(e,r,t)=>{const{width:n,height:a,top:i,left:o}=r.dims,s=i*t.width+o;for(let i=0;i<a;i++)for(let a=0;a<n;a++){const o=i*n+a,d=r.pixels[o];if(d!==r.transparentIndex){const n=s+i*t.width+a,o=r.colorTable[d]||[0,0,0];e[4*n]=o[0],e[4*n+1]=o[1],e[4*n+2]=o[2],e[4*n+3]=255}}return e},d=new Map;self.addEventListener("message",(e=>{const{type:r,src:t}=e.data||e;switch(r){case"parse":if(!d.has(t)){const e=new AbortController,r={signal:e.signal};d.set(t,e),((e,{signal:r})=>fetch(e,{signal:r}).then((e=>{if(!e.headers.get("Content-Type").includes("image/gif"))throw Error(`Wrong content type: "${e.headers.get("Content-Type")}"`);return e.arrayBuffer()})).then((e=>o.parseGIF(e))).then((e=>((e=>{let r=null;for(const t of e.frames)r=t.gce?t.gce:r,"image"in t&&!("gce"in t)&&(t.gce=r)})(e),e))).then((e=>Promise.all([o.decompressFrames(e,!1),{width:e.lsd.width,height:e.lsd.height}]))).then((([e,r])=>{const t=[],n=r.width*r.height*4;for(let a=0;a<e.length;++a){const i=e[a],o=0===a||2===e[a-1].disposalType?new Uint8ClampedArray(n):t[a-1].slice();t.push(s(o,i,r))}return{...r,loaded:!0,delays:e.map((e=>e.delay)),frames:t}})))(t,r).then((e=>{self.postMessage(Object.assign(e,{src:t}),e.frames.map((e=>e.buffer)))})).catch((e=>{self.postMessage({src:t,error:e,loaded:!0})})).finally((()=>{d.delete(t)}))}break;case"cancel":if(d.has(t)){d.get(t).abort(),d.delete(t)}}}));\n';function iF(t){const e=new Blob([nF],{type:"application/javascript"}),r=URL.createObjectURL(e),n=new Worker(r,t);return URL.revokeObjectURL(r),n}const sF=t=>({...t,frames:t.frames.map(e=>{const r=new ImageData(t.width,t.height);return r.data.set(new Uint8ClampedArray(e)),r})}),aF=(t,e)=>{const r={};return()=>(r.instance||(r.instance=t()),j.useLayoutEffect(()=>(r.timeout?(clearTimeout(r.timeout),delete r.timeout):r.usageCount=(r.usageCount||0)+1,()=>{r.timeout=setTimeout(()=>{r.usageCount=r.usageCount-1,r.usageCount===0&&(e&&e(r.instance),delete r.instance,delete r.timeout)})}),[r,e]),r.instance)},oF=t=>{const e=j.useRef(t);return j.useEffect(()=>{e.current=t},[t]),e},uF=t=>{const e=oF(t);return j.useCallback(r=>e.current&&e.current(r),[])},lF=aF(()=>new iF,t=>t.terminate()),cF=(t,e)=>{const r=uF(e),n=lF();j.useEffect(()=>{if(typeof t=="string"){const i=a=>{const u=a.data||a;if(u.src===t){const l=u.error?u:sF(u);r(l)}};return n.addEventListener("message",i),n.postMessage({src:t,type:"parse"}),()=>{n.postMessage({src:t,type:"cancel"}),n.removeEventListener("message",i)}}},[n,t])},hF=({isPlaying:t,forwardRef:e,...r})=>{const n=te.useRef(null);return te.useImperativeHandle(e,()=>n.current,[n]),te.useEffect(()=>{if(n.current===null)return;const i=n.current;i[t?"gotoAndPlay":"gotoAndStop"](i.currentFrame)},[t]),Se.jsx(De.AnimatedSprite,{ref:n,...r,isPlaying:t})},f0=te.memo(hF);var vo={exports:{}};/**
|
|
1991
|
-
* @license
|
|
1992
|
-
* Lodash <https://lodash.com/>
|
|
1993
|
-
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
1994
|
-
* Released under MIT license <https://lodash.com/license>
|
|
1995
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
1996
|
-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
1997
|
-
*/vo.exports,function(t,e){(function(){var r,n="4.17.21",i=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",u="Expected a function",l="Invalid `variable` option passed into `_.template`",h="__lodash_hash_undefined__",p=500,m="__lodash_placeholder__",c=1,d=2,g=4,v=1,y=2,b=1,x=2,E=4,w=8,I=16,O=32,F=64,N=128,L=256,D=512,V=30,Y="...",ie=800,X=16,G=1,ae=2,se=3,z=1/0,Q=9007199254740991,ge=17976931348623157e292,W=0/0,q=4294967295,he=q-1,fe=q>>>1,me=[["ary",N],["bind",b],["bindKey",x],["curry",w],["curryRight",I],["flip",D],["partial",O],["partialRight",F],["rearg",L]],Te="[object Arguments]",Ce="[object Array]",Ue="[object AsyncFunction]",He="[object Boolean]",Re="[object Date]",xe="[object DOMException]",Ae="[object Error]",$e="[object Function]",Ke="[object GeneratorFunction]",pe="[object Map]",ve="[object Number]",st="[object Null]",oe="[object Object]",Ne="[object Promise]",Kt="[object Proxy]",zt="[object RegExp]",ft="[object Set]",lr="[object String]",Bi="[object Symbol]",dc="[object Undefined]",Yn="[object WeakMap]",Rr="[object WeakSet]",Ui="[object ArrayBuffer]",$i="[object DataView]",pc="[object Float32Array]",gc="[object Float64Array]",mc="[object Int8Array]",_c="[object Int16Array]",vc="[object Int32Array]",yc="[object Uint8Array]",xc="[object Uint8ClampedArray]",bc="[object Uint16Array]",Tc="[object Uint32Array]",VF=/\b__p \+= '';/g,XF=/\b(__p \+=) '' \+/g,jF=/(__e\(.*?\)|\b__t\)) \+\n'';/g,y0=/&(?:amp|lt|gt|quot|#39);/g,x0=/[&<>"']/g,WF=RegExp(y0.source),qF=RegExp(x0.source),YF=/<%-([\s\S]+?)%>/g,KF=/<%([\s\S]+?)%>/g,b0=/<%=([\s\S]+?)%>/g,ZF=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,QF=/^\w*$/,JF=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,wc=/[\\^$.*+?()[\]{}|]/g,eN=RegExp(wc.source),Sc=/^\s+/,tN=/\s/,rN=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,nN=/\{\n\/\* \[wrapped with (.+)\] \*/,iN=/,? & /,sN=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,aN=/[()=,{}\[\]\/\s]/,oN=/\\(\\)?/g,uN=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,T0=/\w*$/,lN=/^[-+]0x[0-9a-f]+$/i,cN=/^0b[01]+$/i,hN=/^\[object .+?Constructor\]$/,fN=/^0o[0-7]+$/i,dN=/^(?:0|[1-9]\d*)$/,pN=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,xo=/($^)/,gN=/['\n\r\u2028\u2029\\]/g,bo="\\ud800-\\udfff",mN="\\u0300-\\u036f",_N="\\ufe20-\\ufe2f",vN="\\u20d0-\\u20ff",w0=mN+_N+vN,S0="\\u2700-\\u27bf",A0="a-z\\xdf-\\xf6\\xf8-\\xff",yN="\\xac\\xb1\\xd7\\xf7",xN="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",bN="\\u2000-\\u206f",TN=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",E0="A-Z\\xc0-\\xd6\\xd8-\\xde",C0="\\ufe0e\\ufe0f",I0=yN+xN+bN+TN,Ac="['’]",wN="["+bo+"]",R0="["+I0+"]",To="["+w0+"]",P0="\\d+",SN="["+S0+"]",M0="["+A0+"]",O0="[^"+bo+I0+P0+S0+A0+E0+"]",Ec="\\ud83c[\\udffb-\\udfff]",AN="(?:"+To+"|"+Ec+")",F0="[^"+bo+"]",Cc="(?:\\ud83c[\\udde6-\\uddff]){2}",Ic="[\\ud800-\\udbff][\\udc00-\\udfff]",Gi="["+E0+"]",N0="\\u200d",L0="(?:"+M0+"|"+O0+")",EN="(?:"+Gi+"|"+O0+")",k0="(?:"+Ac+"(?:d|ll|m|re|s|t|ve))?",D0="(?:"+Ac+"(?:D|LL|M|RE|S|T|VE))?",B0=AN+"?",U0="["+C0+"]?",CN="(?:"+N0+"(?:"+[F0,Cc,Ic].join("|")+")"+U0+B0+")*",IN="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",RN="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",$0=U0+B0+CN,PN="(?:"+[SN,Cc,Ic].join("|")+")"+$0,MN="(?:"+[F0+To+"?",To,Cc,Ic,wN].join("|")+")",ON=RegExp(Ac,"g"),FN=RegExp(To,"g"),Rc=RegExp(Ec+"(?="+Ec+")|"+MN+$0,"g"),NN=RegExp([Gi+"?"+M0+"+"+k0+"(?="+[R0,Gi,"$"].join("|")+")",EN+"+"+D0+"(?="+[R0,Gi+L0,"$"].join("|")+")",Gi+"?"+L0+"+"+k0,Gi+"+"+D0,RN,IN,P0,PN].join("|"),"g"),LN=RegExp("["+N0+bo+w0+C0+"]"),kN=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,DN=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],BN=-1,nt={};nt[pc]=nt[gc]=nt[mc]=nt[_c]=nt[vc]=nt[yc]=nt[xc]=nt[bc]=nt[Tc]=!0,nt[Te]=nt[Ce]=nt[Ui]=nt[He]=nt[$i]=nt[Re]=nt[Ae]=nt[$e]=nt[pe]=nt[ve]=nt[oe]=nt[zt]=nt[ft]=nt[lr]=nt[Yn]=!1;var tt={};tt[Te]=tt[Ce]=tt[Ui]=tt[$i]=tt[He]=tt[Re]=tt[pc]=tt[gc]=tt[mc]=tt[_c]=tt[vc]=tt[pe]=tt[ve]=tt[oe]=tt[zt]=tt[ft]=tt[lr]=tt[Bi]=tt[yc]=tt[xc]=tt[bc]=tt[Tc]=!0,tt[Ae]=tt[$e]=tt[Yn]=!1;var UN={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},$N={"&":"&","<":"<",">":">",'"':""","'":"'"},GN={"&":"&","<":"<",">":">",""":'"',"'":"'"},zN={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},HN=parseFloat,VN=parseInt,G0=typeof Et=="object"&&Et&&Et.Object===Object&&Et,XN=typeof self=="object"&&self&&self.Object===Object&&self,It=G0||XN||Function("return this")(),Pc=e&&!e.nodeType&&e,Kn=Pc&&!0&&t&&!t.nodeType&&t,z0=Kn&&Kn.exports===Pc,Mc=z0&&G0.process,cr=function(){try{var P=Kn&&Kn.require&&Kn.require("util").types;return P||Mc&&Mc.binding&&Mc.binding("util")}catch{}}(),H0=cr&&cr.isArrayBuffer,V0=cr&&cr.isDate,X0=cr&&cr.isMap,j0=cr&&cr.isRegExp,W0=cr&&cr.isSet,q0=cr&&cr.isTypedArray;function Zt(P,B,k){switch(k.length){case 0:return P.call(B);case 1:return P.call(B,k[0]);case 2:return P.call(B,k[0],k[1]);case 3:return P.call(B,k[0],k[1],k[2])}return P.apply(B,k)}function jN(P,B,k,J){for(var _e=-1,Ve=P==null?0:P.length;++_e<Ve;){var yt=P[_e];B(J,yt,k(yt),P)}return J}function hr(P,B){for(var k=-1,J=P==null?0:P.length;++k<J&&B(P[k],k,P)!==!1;);return P}function WN(P,B){for(var k=P==null?0:P.length;k--&&B(P[k],k,P)!==!1;);return P}function Y0(P,B){for(var k=-1,J=P==null?0:P.length;++k<J;)if(!B(P[k],k,P))return!1;return!0}function vn(P,B){for(var k=-1,J=P==null?0:P.length,_e=0,Ve=[];++k<J;){var yt=P[k];B(yt,k,P)&&(Ve[_e++]=yt)}return Ve}function wo(P,B){var k=P==null?0:P.length;return!!k&&zi(P,B,0)>-1}function Oc(P,B,k){for(var J=-1,_e=P==null?0:P.length;++J<_e;)if(k(B,P[J]))return!0;return!1}function at(P,B){for(var k=-1,J=P==null?0:P.length,_e=Array(J);++k<J;)_e[k]=B(P[k],k,P);return _e}function yn(P,B){for(var k=-1,J=B.length,_e=P.length;++k<J;)P[_e+k]=B[k];return P}function Fc(P,B,k,J){var _e=-1,Ve=P==null?0:P.length;for(J&&Ve&&(k=P[++_e]);++_e<Ve;)k=B(k,P[_e],_e,P);return k}function qN(P,B,k,J){var _e=P==null?0:P.length;for(J&&_e&&(k=P[--_e]);_e--;)k=B(k,P[_e],_e,P);return k}function Nc(P,B){for(var k=-1,J=P==null?0:P.length;++k<J;)if(B(P[k],k,P))return!0;return!1}var YN=Lc("length");function KN(P){return P.split("")}function ZN(P){return P.match(sN)||[]}function K0(P,B,k){var J;return k(P,function(_e,Ve,yt){if(B(_e,Ve,yt))return J=Ve,!1}),J}function So(P,B,k,J){for(var _e=P.length,Ve=k+(J?1:-1);J?Ve--:++Ve<_e;)if(B(P[Ve],Ve,P))return Ve;return-1}function zi(P,B,k){return B===B?l3(P,B,k):So(P,Z0,k)}function QN(P,B,k,J){for(var _e=k-1,Ve=P.length;++_e<Ve;)if(J(P[_e],B))return _e;return-1}function Z0(P){return P!==P}function Q0(P,B){var k=P==null?0:P.length;return k?Dc(P,B)/k:W}function Lc(P){return function(B){return B==null?r:B[P]}}function kc(P){return function(B){return P==null?r:P[B]}}function J0(P,B,k,J,_e){return _e(P,function(Ve,yt,Je){k=J?(J=!1,Ve):B(k,Ve,yt,Je)}),k}function JN(P,B){var k=P.length;for(P.sort(B);k--;)P[k]=P[k].value;return P}function Dc(P,B){for(var k,J=-1,_e=P.length;++J<_e;){var Ve=B(P[J]);Ve!==r&&(k=k===r?Ve:k+Ve)}return k}function Bc(P,B){for(var k=-1,J=Array(P);++k<P;)J[k]=B(k);return J}function e3(P,B){return at(B,function(k){return[k,P[k]]})}function em(P){return P&&P.slice(0,im(P)+1).replace(Sc,"")}function Qt(P){return function(B){return P(B)}}function Uc(P,B){return at(B,function(k){return P[k]})}function ks(P,B){return P.has(B)}function tm(P,B){for(var k=-1,J=P.length;++k<J&&zi(B,P[k],0)>-1;);return k}function rm(P,B){for(var k=P.length;k--&&zi(B,P[k],0)>-1;);return k}function t3(P,B){for(var k=P.length,J=0;k--;)P[k]===B&&++J;return J}var r3=kc(UN),n3=kc($N);function i3(P){return"\\"+zN[P]}function s3(P,B){return P==null?r:P[B]}function Hi(P){return LN.test(P)}function a3(P){return kN.test(P)}function o3(P){for(var B,k=[];!(B=P.next()).done;)k.push(B.value);return k}function $c(P){var B=-1,k=Array(P.size);return P.forEach(function(J,_e){k[++B]=[_e,J]}),k}function nm(P,B){return function(k){return P(B(k))}}function xn(P,B){for(var k=-1,J=P.length,_e=0,Ve=[];++k<J;){var yt=P[k];(yt===B||yt===m)&&(P[k]=m,Ve[_e++]=k)}return Ve}function Ao(P){var B=-1,k=Array(P.size);return P.forEach(function(J){k[++B]=J}),k}function u3(P){var B=-1,k=Array(P.size);return P.forEach(function(J){k[++B]=[J,J]}),k}function l3(P,B,k){for(var J=k-1,_e=P.length;++J<_e;)if(P[J]===B)return J;return-1}function c3(P,B,k){for(var J=k+1;J--;)if(P[J]===B)return J;return J}function Vi(P){return Hi(P)?f3(P):YN(P)}function Pr(P){return Hi(P)?d3(P):KN(P)}function im(P){for(var B=P.length;B--&&tN.test(P.charAt(B)););return B}var h3=kc(GN);function f3(P){for(var B=Rc.lastIndex=0;Rc.test(P);)++B;return B}function d3(P){return P.match(Rc)||[]}function p3(P){return P.match(NN)||[]}var g3=function P(B){B=B==null?It:Xi.defaults(It.Object(),B,Xi.pick(It,DN));var k=B.Array,J=B.Date,_e=B.Error,Ve=B.Function,yt=B.Math,Je=B.Object,Gc=B.RegExp,m3=B.String,fr=B.TypeError,Eo=k.prototype,_3=Ve.prototype,ji=Je.prototype,Co=B["__core-js_shared__"],Io=_3.toString,Ye=ji.hasOwnProperty,v3=0,sm=function(){var s=/[^.]+$/.exec(Co&&Co.keys&&Co.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),Ro=ji.toString,y3=Io.call(Je),x3=It._,b3=Gc("^"+Io.call(Ye).replace(wc,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Po=z0?B.Buffer:r,bn=B.Symbol,Mo=B.Uint8Array,am=Po?Po.allocUnsafe:r,Oo=nm(Je.getPrototypeOf,Je),om=Je.create,um=ji.propertyIsEnumerable,Fo=Eo.splice,lm=bn?bn.isConcatSpreadable:r,Ds=bn?bn.iterator:r,Zn=bn?bn.toStringTag:r,No=function(){try{var s=ri(Je,"defineProperty");return s({},"",{}),s}catch{}}(),T3=B.clearTimeout!==It.clearTimeout&&B.clearTimeout,w3=J&&J.now!==It.Date.now&&J.now,S3=B.setTimeout!==It.setTimeout&&B.setTimeout,Lo=yt.ceil,ko=yt.floor,zc=Je.getOwnPropertySymbols,A3=Po?Po.isBuffer:r,cm=B.isFinite,E3=Eo.join,C3=nm(Je.keys,Je),xt=yt.max,Ft=yt.min,I3=J.now,R3=B.parseInt,hm=yt.random,P3=Eo.reverse,Hc=ri(B,"DataView"),Bs=ri(B,"Map"),Vc=ri(B,"Promise"),Wi=ri(B,"Set"),Us=ri(B,"WeakMap"),$s=ri(Je,"create"),Do=Us&&new Us,qi={},M3=ni(Hc),O3=ni(Bs),F3=ni(Vc),N3=ni(Wi),L3=ni(Us),Bo=bn?bn.prototype:r,Gs=Bo?Bo.valueOf:r,fm=Bo?Bo.toString:r;function S(s){if(dt(s)&&!ye(s)&&!(s instanceof Oe)){if(s instanceof dr)return s;if(Ye.call(s,"__wrapped__"))return d_(s)}return new dr(s)}var Yi=function(){function s(){}return function(o){if(!ct(o))return{};if(om)return om(o);s.prototype=o;var f=new s;return s.prototype=r,f}}();function Uo(){}function dr(s,o){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!o,this.__index__=0,this.__values__=r}S.templateSettings={escape:YF,evaluate:KF,interpolate:b0,variable:"",imports:{_:S}},S.prototype=Uo.prototype,S.prototype.constructor=S,dr.prototype=Yi(Uo.prototype),dr.prototype.constructor=dr;function Oe(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=q,this.__views__=[]}function k3(){var s=new Oe(this.__wrapped__);return s.__actions__=Ht(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=Ht(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=Ht(this.__views__),s}function D3(){if(this.__filtered__){var s=new Oe(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function B3(){var s=this.__wrapped__.value(),o=this.__dir__,f=ye(s),_=o<0,T=f?s.length:0,A=KL(0,T,this.__views__),C=A.start,R=A.end,M=R-C,U=_?R:C-1,$=this.__iteratees__,H=$.length,K=0,re=Ft(M,this.__takeCount__);if(!f||!_&&T==M&&re==M)return km(s,this.__actions__);var le=[];e:for(;M--&&K<re;){U+=o;for(var we=-1,ce=s[U];++we<H;){var Pe=$[we],Le=Pe.iteratee,tr=Pe.type,Ut=Le(ce);if(tr==ae)ce=Ut;else if(!Ut){if(tr==G)continue e;break e}}le[K++]=ce}return le}Oe.prototype=Yi(Uo.prototype),Oe.prototype.constructor=Oe;function Qn(s){var o=-1,f=s==null?0:s.length;for(this.clear();++o<f;){var _=s[o];this.set(_[0],_[1])}}function U3(){this.__data__=$s?$s(null):{},this.size=0}function $3(s){var o=this.has(s)&&delete this.__data__[s];return this.size-=o?1:0,o}function G3(s){var o=this.__data__;if($s){var f=o[s];return f===h?r:f}return Ye.call(o,s)?o[s]:r}function z3(s){var o=this.__data__;return $s?o[s]!==r:Ye.call(o,s)}function H3(s,o){var f=this.__data__;return this.size+=this.has(s)?0:1,f[s]=$s&&o===r?h:o,this}Qn.prototype.clear=U3,Qn.prototype.delete=$3,Qn.prototype.get=G3,Qn.prototype.has=z3,Qn.prototype.set=H3;function Zr(s){var o=-1,f=s==null?0:s.length;for(this.clear();++o<f;){var _=s[o];this.set(_[0],_[1])}}function V3(){this.__data__=[],this.size=0}function X3(s){var o=this.__data__,f=$o(o,s);if(f<0)return!1;var _=o.length-1;return f==_?o.pop():Fo.call(o,f,1),--this.size,!0}function j3(s){var o=this.__data__,f=$o(o,s);return f<0?r:o[f][1]}function W3(s){return $o(this.__data__,s)>-1}function q3(s,o){var f=this.__data__,_=$o(f,s);return _<0?(++this.size,f.push([s,o])):f[_][1]=o,this}Zr.prototype.clear=V3,Zr.prototype.delete=X3,Zr.prototype.get=j3,Zr.prototype.has=W3,Zr.prototype.set=q3;function Qr(s){var o=-1,f=s==null?0:s.length;for(this.clear();++o<f;){var _=s[o];this.set(_[0],_[1])}}function Y3(){this.size=0,this.__data__={hash:new Qn,map:new(Bs||Zr),string:new Qn}}function K3(s){var o=Qo(this,s).delete(s);return this.size-=o?1:0,o}function Z3(s){return Qo(this,s).get(s)}function Q3(s){return Qo(this,s).has(s)}function J3(s,o){var f=Qo(this,s),_=f.size;return f.set(s,o),this.size+=f.size==_?0:1,this}Qr.prototype.clear=Y3,Qr.prototype.delete=K3,Qr.prototype.get=Z3,Qr.prototype.has=Q3,Qr.prototype.set=J3;function Jn(s){var o=-1,f=s==null?0:s.length;for(this.__data__=new Qr;++o<f;)this.add(s[o])}function eL(s){return this.__data__.set(s,h),this}function tL(s){return this.__data__.has(s)}Jn.prototype.add=Jn.prototype.push=eL,Jn.prototype.has=tL;function Mr(s){var o=this.__data__=new Zr(s);this.size=o.size}function rL(){this.__data__=new Zr,this.size=0}function nL(s){var o=this.__data__,f=o.delete(s);return this.size=o.size,f}function iL(s){return this.__data__.get(s)}function sL(s){return this.__data__.has(s)}function aL(s,o){var f=this.__data__;if(f instanceof Zr){var _=f.__data__;if(!Bs||_.length<i-1)return _.push([s,o]),this.size=++f.size,this;f=this.__data__=new Qr(_)}return f.set(s,o),this.size=f.size,this}Mr.prototype.clear=rL,Mr.prototype.delete=nL,Mr.prototype.get=iL,Mr.prototype.has=sL,Mr.prototype.set=aL;function dm(s,o){var f=ye(s),_=!f&&ii(s),T=!f&&!_&&En(s),A=!f&&!_&&!T&&Ji(s),C=f||_||T||A,R=C?Bc(s.length,m3):[],M=R.length;for(var U in s)(o||Ye.call(s,U))&&!(C&&(U=="length"||T&&(U=="offset"||U=="parent")||A&&(U=="buffer"||U=="byteLength"||U=="byteOffset")||rn(U,M)))&&R.push(U);return R}function pm(s){var o=s.length;return o?s[th(0,o-1)]:r}function oL(s,o){return Jo(Ht(s),ei(o,0,s.length))}function uL(s){return Jo(Ht(s))}function Xc(s,o,f){(f!==r&&!Or(s[o],f)||f===r&&!(o in s))&&Jr(s,o,f)}function zs(s,o,f){var _=s[o];(!(Ye.call(s,o)&&Or(_,f))||f===r&&!(o in s))&&Jr(s,o,f)}function $o(s,o){for(var f=s.length;f--;)if(Or(s[f][0],o))return f;return-1}function lL(s,o,f,_){return Tn(s,function(T,A,C){o(_,T,f(T),C)}),_}function gm(s,o){return s&&Hr(o,At(o),s)}function cL(s,o){return s&&Hr(o,Xt(o),s)}function Jr(s,o,f){o=="__proto__"&&No?No(s,o,{configurable:!0,enumerable:!0,value:f,writable:!0}):s[o]=f}function jc(s,o){for(var f=-1,_=o.length,T=k(_),A=s==null;++f<_;)T[f]=A?r:Eh(s,o[f]);return T}function ei(s,o,f){return s===s&&(f!==r&&(s=s<=f?s:f),o!==r&&(s=s>=o?s:o)),s}function pr(s,o,f,_,T,A){var C,R=o&c,M=o&d,U=o&g;if(f&&(C=T?f(s,_,T,A):f(s)),C!==r)return C;if(!ct(s))return s;var $=ye(s);if($){if(C=QL(s),!R)return Ht(s,C)}else{var H=Nt(s),K=H==$e||H==Ke;if(En(s))return Um(s,R);if(H==oe||H==Te||K&&!T){if(C=M||K?{}:i_(s),!R)return M?GL(s,cL(C,s)):$L(s,gm(C,s))}else{if(!tt[H])return T?s:{};C=JL(s,H,R)}}A||(A=new Mr);var re=A.get(s);if(re)return re;A.set(s,C),F_(s)?s.forEach(function(ce){C.add(pr(ce,o,f,ce,s,A))}):M_(s)&&s.forEach(function(ce,Pe){C.set(Pe,pr(ce,o,f,Pe,s,A))});var le=U?M?fh:hh:M?Xt:At,we=$?r:le(s);return hr(we||s,function(ce,Pe){we&&(Pe=ce,ce=s[Pe]),zs(C,Pe,pr(ce,o,f,Pe,s,A))}),C}function hL(s){var o=At(s);return function(f){return mm(f,s,o)}}function mm(s,o,f){var _=f.length;if(s==null)return!_;for(s=Je(s);_--;){var T=f[_],A=o[T],C=s[T];if(C===r&&!(T in s)||!A(C))return!1}return!0}function _m(s,o,f){if(typeof s!="function")throw new fr(u);return Ys(function(){s.apply(r,f)},o)}function Hs(s,o,f,_){var T=-1,A=wo,C=!0,R=s.length,M=[],U=o.length;if(!R)return M;f&&(o=at(o,Qt(f))),_?(A=Oc,C=!1):o.length>=i&&(A=ks,C=!1,o=new Jn(o));e:for(;++T<R;){var $=s[T],H=f==null?$:f($);if($=_||$!==0?$:0,C&&H===H){for(var K=U;K--;)if(o[K]===H)continue e;M.push($)}else A(o,H,_)||M.push($)}return M}var Tn=Vm(zr),vm=Vm(qc,!0);function fL(s,o){var f=!0;return Tn(s,function(_,T,A){return f=!!o(_,T,A),f}),f}function Go(s,o,f){for(var _=-1,T=s.length;++_<T;){var A=s[_],C=o(A);if(C!=null&&(R===r?C===C&&!er(C):f(C,R)))var R=C,M=A}return M}function dL(s,o,f,_){var T=s.length;for(f=be(f),f<0&&(f=-f>T?0:T+f),_=_===r||_>T?T:be(_),_<0&&(_+=T),_=f>_?0:L_(_);f<_;)s[f++]=o;return s}function ym(s,o){var f=[];return Tn(s,function(_,T,A){o(_,T,A)&&f.push(_)}),f}function Rt(s,o,f,_,T){var A=-1,C=s.length;for(f||(f=tk),T||(T=[]);++A<C;){var R=s[A];o>0&&f(R)?o>1?Rt(R,o-1,f,_,T):yn(T,R):_||(T[T.length]=R)}return T}var Wc=Xm(),xm=Xm(!0);function zr(s,o){return s&&Wc(s,o,At)}function qc(s,o){return s&&xm(s,o,At)}function zo(s,o){return vn(o,function(f){return nn(s[f])})}function ti(s,o){o=Sn(o,s);for(var f=0,_=o.length;s!=null&&f<_;)s=s[Vr(o[f++])];return f&&f==_?s:r}function bm(s,o,f){var _=o(s);return ye(s)?_:yn(_,f(s))}function Dt(s){return s==null?s===r?dc:st:Zn&&Zn in Je(s)?YL(s):uk(s)}function Yc(s,o){return s>o}function pL(s,o){return s!=null&&Ye.call(s,o)}function gL(s,o){return s!=null&&o in Je(s)}function mL(s,o,f){return s>=Ft(o,f)&&s<xt(o,f)}function Kc(s,o,f){for(var _=f?Oc:wo,T=s[0].length,A=s.length,C=A,R=k(A),M=1/0,U=[];C--;){var $=s[C];C&&o&&($=at($,Qt(o))),M=Ft($.length,M),R[C]=!f&&(o||T>=120&&$.length>=120)?new Jn(C&&$):r}$=s[0];var H=-1,K=R[0];e:for(;++H<T&&U.length<M;){var re=$[H],le=o?o(re):re;if(re=f||re!==0?re:0,!(K?ks(K,le):_(U,le,f))){for(C=A;--C;){var we=R[C];if(!(we?ks(we,le):_(s[C],le,f)))continue e}K&&K.push(le),U.push(re)}}return U}function _L(s,o,f,_){return zr(s,function(T,A,C){o(_,f(T),A,C)}),_}function Vs(s,o,f){o=Sn(o,s),s=u_(s,o);var _=s==null?s:s[Vr(mr(o))];return _==null?r:Zt(_,s,f)}function Tm(s){return dt(s)&&Dt(s)==Te}function vL(s){return dt(s)&&Dt(s)==Ui}function yL(s){return dt(s)&&Dt(s)==Re}function Xs(s,o,f,_,T){return s===o?!0:s==null||o==null||!dt(s)&&!dt(o)?s!==s&&o!==o:xL(s,o,f,_,Xs,T)}function xL(s,o,f,_,T,A){var C=ye(s),R=ye(o),M=C?Ce:Nt(s),U=R?Ce:Nt(o);M=M==Te?oe:M,U=U==Te?oe:U;var $=M==oe,H=U==oe,K=M==U;if(K&&En(s)){if(!En(o))return!1;C=!0,$=!1}if(K&&!$)return A||(A=new Mr),C||Ji(s)?t_(s,o,f,_,T,A):WL(s,o,M,f,_,T,A);if(!(f&v)){var re=$&&Ye.call(s,"__wrapped__"),le=H&&Ye.call(o,"__wrapped__");if(re||le){var we=re?s.value():s,ce=le?o.value():o;return A||(A=new Mr),T(we,ce,f,_,A)}}return K?(A||(A=new Mr),qL(s,o,f,_,T,A)):!1}function bL(s){return dt(s)&&Nt(s)==pe}function Zc(s,o,f,_){var T=f.length,A=T,C=!_;if(s==null)return!A;for(s=Je(s);T--;){var R=f[T];if(C&&R[2]?R[1]!==s[R[0]]:!(R[0]in s))return!1}for(;++T<A;){R=f[T];var M=R[0],U=s[M],$=R[1];if(C&&R[2]){if(U===r&&!(M in s))return!1}else{var H=new Mr;if(_)var K=_(U,$,M,s,o,H);if(!(K===r?Xs($,U,v|y,_,H):K))return!1}}return!0}function wm(s){if(!ct(s)||nk(s))return!1;var o=nn(s)?b3:hN;return o.test(ni(s))}function TL(s){return dt(s)&&Dt(s)==zt}function wL(s){return dt(s)&&Nt(s)==ft}function SL(s){return dt(s)&&su(s.length)&&!!nt[Dt(s)]}function Sm(s){return typeof s=="function"?s:s==null?jt:typeof s=="object"?ye(s)?Cm(s[0],s[1]):Em(s):j_(s)}function Qc(s){if(!qs(s))return C3(s);var o=[];for(var f in Je(s))Ye.call(s,f)&&f!="constructor"&&o.push(f);return o}function AL(s){if(!ct(s))return ok(s);var o=qs(s),f=[];for(var _ in s)_=="constructor"&&(o||!Ye.call(s,_))||f.push(_);return f}function Jc(s,o){return s<o}function Am(s,o){var f=-1,_=Vt(s)?k(s.length):[];return Tn(s,function(T,A,C){_[++f]=o(T,A,C)}),_}function Em(s){var o=ph(s);return o.length==1&&o[0][2]?a_(o[0][0],o[0][1]):function(f){return f===s||Zc(f,s,o)}}function Cm(s,o){return mh(s)&&s_(o)?a_(Vr(s),o):function(f){var _=Eh(f,s);return _===r&&_===o?Ch(f,s):Xs(o,_,v|y)}}function Ho(s,o,f,_,T){s!==o&&Wc(o,function(A,C){if(T||(T=new Mr),ct(A))EL(s,o,C,f,Ho,_,T);else{var R=_?_(vh(s,C),A,C+"",s,o,T):r;R===r&&(R=A),Xc(s,C,R)}},Xt)}function EL(s,o,f,_,T,A,C){var R=vh(s,f),M=vh(o,f),U=C.get(M);if(U){Xc(s,f,U);return}var $=A?A(R,M,f+"",s,o,C):r,H=$===r;if(H){var K=ye(M),re=!K&&En(M),le=!K&&!re&&Ji(M);$=M,K||re||le?ye(R)?$=R:gt(R)?$=Ht(R):re?(H=!1,$=Um(M,!0)):le?(H=!1,$=$m(M,!0)):$=[]:Ks(M)||ii(M)?($=R,ii(R)?$=k_(R):(!ct(R)||nn(R))&&($=i_(M))):H=!1}H&&(C.set(M,$),T($,M,_,A,C),C.delete(M)),Xc(s,f,$)}function Im(s,o){var f=s.length;if(f)return o+=o<0?f:0,rn(o,f)?s[o]:r}function Rm(s,o,f){o.length?o=at(o,function(A){return ye(A)?function(C){return ti(C,A.length===1?A[0]:A)}:A}):o=[jt];var _=-1;o=at(o,Qt(ue()));var T=Am(s,function(A,C,R){var M=at(o,function(U){return U(A)});return{criteria:M,index:++_,value:A}});return JN(T,function(A,C){return UL(A,C,f)})}function CL(s,o){return Pm(s,o,function(f,_){return Ch(s,_)})}function Pm(s,o,f){for(var _=-1,T=o.length,A={};++_<T;){var C=o[_],R=ti(s,C);f(R,C)&&js(A,Sn(C,s),R)}return A}function IL(s){return function(o){return ti(o,s)}}function eh(s,o,f,_){var T=_?QN:zi,A=-1,C=o.length,R=s;for(s===o&&(o=Ht(o)),f&&(R=at(s,Qt(f)));++A<C;)for(var M=0,U=o[A],$=f?f(U):U;(M=T(R,$,M,_))>-1;)R!==s&&Fo.call(R,M,1),Fo.call(s,M,1);return s}function Mm(s,o){for(var f=s?o.length:0,_=f-1;f--;){var T=o[f];if(f==_||T!==A){var A=T;rn(T)?Fo.call(s,T,1):ih(s,T)}}return s}function th(s,o){return s+ko(hm()*(o-s+1))}function RL(s,o,f,_){for(var T=-1,A=xt(Lo((o-s)/(f||1)),0),C=k(A);A--;)C[_?A:++T]=s,s+=f;return C}function rh(s,o){var f="";if(!s||o<1||o>Q)return f;do o%2&&(f+=s),o=ko(o/2),o&&(s+=s);while(o);return f}function Ee(s,o){return yh(o_(s,o,jt),s+"")}function PL(s){return pm(es(s))}function ML(s,o){var f=es(s);return Jo(f,ei(o,0,f.length))}function js(s,o,f,_){if(!ct(s))return s;o=Sn(o,s);for(var T=-1,A=o.length,C=A-1,R=s;R!=null&&++T<A;){var M=Vr(o[T]),U=f;if(M==="__proto__"||M==="constructor"||M==="prototype")return s;if(T!=C){var $=R[M];U=_?_($,M,R):r,U===r&&(U=ct($)?$:rn(o[T+1])?[]:{})}zs(R,M,U),R=R[M]}return s}var Om=Do?function(s,o){return Do.set(s,o),s}:jt,OL=No?function(s,o){return No(s,"toString",{configurable:!0,enumerable:!1,value:Rh(o),writable:!0})}:jt;function FL(s){return Jo(es(s))}function gr(s,o,f){var _=-1,T=s.length;o<0&&(o=-o>T?0:T+o),f=f>T?T:f,f<0&&(f+=T),T=o>f?0:f-o>>>0,o>>>=0;for(var A=k(T);++_<T;)A[_]=s[_+o];return A}function NL(s,o){var f;return Tn(s,function(_,T,A){return f=o(_,T,A),!f}),!!f}function Vo(s,o,f){var _=0,T=s==null?_:s.length;if(typeof o=="number"&&o===o&&T<=fe){for(;_<T;){var A=_+T>>>1,C=s[A];C!==null&&!er(C)&&(f?C<=o:C<o)?_=A+1:T=A}return T}return nh(s,o,jt,f)}function nh(s,o,f,_){var T=0,A=s==null?0:s.length;if(A===0)return 0;o=f(o);for(var C=o!==o,R=o===null,M=er(o),U=o===r;T<A;){var $=ko((T+A)/2),H=f(s[$]),K=H!==r,re=H===null,le=H===H,we=er(H);if(C)var ce=_||le;else U?ce=le&&(_||K):R?ce=le&&K&&(_||!re):M?ce=le&&K&&!re&&(_||!we):re||we?ce=!1:ce=_?H<=o:H<o;ce?T=$+1:A=$}return Ft(A,he)}function Fm(s,o){for(var f=-1,_=s.length,T=0,A=[];++f<_;){var C=s[f],R=o?o(C):C;if(!f||!Or(R,M)){var M=R;A[T++]=C===0?0:C}}return A}function Nm(s){return typeof s=="number"?s:er(s)?W:+s}function Jt(s){if(typeof s=="string")return s;if(ye(s))return at(s,Jt)+"";if(er(s))return fm?fm.call(s):"";var o=s+"";return o=="0"&&1/s==-z?"-0":o}function wn(s,o,f){var _=-1,T=wo,A=s.length,C=!0,R=[],M=R;if(f)C=!1,T=Oc;else if(A>=i){var U=o?null:XL(s);if(U)return Ao(U);C=!1,T=ks,M=new Jn}else M=o?[]:R;e:for(;++_<A;){var $=s[_],H=o?o($):$;if($=f||$!==0?$:0,C&&H===H){for(var K=M.length;K--;)if(M[K]===H)continue e;o&&M.push(H),R.push($)}else T(M,H,f)||(M!==R&&M.push(H),R.push($))}return R}function ih(s,o){return o=Sn(o,s),s=u_(s,o),s==null||delete s[Vr(mr(o))]}function Lm(s,o,f,_){return js(s,o,f(ti(s,o)),_)}function Xo(s,o,f,_){for(var T=s.length,A=_?T:-1;(_?A--:++A<T)&&o(s[A],A,s););return f?gr(s,_?0:A,_?A+1:T):gr(s,_?A+1:0,_?T:A)}function km(s,o){var f=s;return f instanceof Oe&&(f=f.value()),Fc(o,function(_,T){return T.func.apply(T.thisArg,yn([_],T.args))},f)}function sh(s,o,f){var _=s.length;if(_<2)return _?wn(s[0]):[];for(var T=-1,A=k(_);++T<_;)for(var C=s[T],R=-1;++R<_;)R!=T&&(A[T]=Hs(A[T]||C,s[R],o,f));return wn(Rt(A,1),o,f)}function Dm(s,o,f){for(var _=-1,T=s.length,A=o.length,C={};++_<T;){var R=_<A?o[_]:r;f(C,s[_],R)}return C}function ah(s){return gt(s)?s:[]}function oh(s){return typeof s=="function"?s:jt}function Sn(s,o){return ye(s)?s:mh(s,o)?[s]:f_(We(s))}var LL=Ee;function An(s,o,f){var _=s.length;return f=f===r?_:f,!o&&f>=_?s:gr(s,o,f)}var Bm=T3||function(s){return It.clearTimeout(s)};function Um(s,o){if(o)return s.slice();var f=s.length,_=am?am(f):new s.constructor(f);return s.copy(_),_}function uh(s){var o=new s.constructor(s.byteLength);return new Mo(o).set(new Mo(s)),o}function kL(s,o){var f=o?uh(s.buffer):s.buffer;return new s.constructor(f,s.byteOffset,s.byteLength)}function DL(s){var o=new s.constructor(s.source,T0.exec(s));return o.lastIndex=s.lastIndex,o}function BL(s){return Gs?Je(Gs.call(s)):{}}function $m(s,o){var f=o?uh(s.buffer):s.buffer;return new s.constructor(f,s.byteOffset,s.length)}function Gm(s,o){if(s!==o){var f=s!==r,_=s===null,T=s===s,A=er(s),C=o!==r,R=o===null,M=o===o,U=er(o);if(!R&&!U&&!A&&s>o||A&&C&&M&&!R&&!U||_&&C&&M||!f&&M||!T)return 1;if(!_&&!A&&!U&&s<o||U&&f&&T&&!_&&!A||R&&f&&T||!C&&T||!M)return-1}return 0}function UL(s,o,f){for(var _=-1,T=s.criteria,A=o.criteria,C=T.length,R=f.length;++_<C;){var M=Gm(T[_],A[_]);if(M){if(_>=R)return M;var U=f[_];return M*(U=="desc"?-1:1)}}return s.index-o.index}function zm(s,o,f,_){for(var T=-1,A=s.length,C=f.length,R=-1,M=o.length,U=xt(A-C,0),$=k(M+U),H=!_;++R<M;)$[R]=o[R];for(;++T<C;)(H||T<A)&&($[f[T]]=s[T]);for(;U--;)$[R++]=s[T++];return $}function Hm(s,o,f,_){for(var T=-1,A=s.length,C=-1,R=f.length,M=-1,U=o.length,$=xt(A-R,0),H=k($+U),K=!_;++T<$;)H[T]=s[T];for(var re=T;++M<U;)H[re+M]=o[M];for(;++C<R;)(K||T<A)&&(H[re+f[C]]=s[T++]);return H}function Ht(s,o){var f=-1,_=s.length;for(o||(o=k(_));++f<_;)o[f]=s[f];return o}function Hr(s,o,f,_){var T=!f;f||(f={});for(var A=-1,C=o.length;++A<C;){var R=o[A],M=_?_(f[R],s[R],R,f,s):r;M===r&&(M=s[R]),T?Jr(f,R,M):zs(f,R,M)}return f}function $L(s,o){return Hr(s,gh(s),o)}function GL(s,o){return Hr(s,r_(s),o)}function jo(s,o){return function(f,_){var T=ye(f)?jN:lL,A=o?o():{};return T(f,s,ue(_,2),A)}}function Ki(s){return Ee(function(o,f){var _=-1,T=f.length,A=T>1?f[T-1]:r,C=T>2?f[2]:r;for(A=s.length>3&&typeof A=="function"?(T--,A):r,C&&Bt(f[0],f[1],C)&&(A=T<3?r:A,T=1),o=Je(o);++_<T;){var R=f[_];R&&s(o,R,_,A)}return o})}function Vm(s,o){return function(f,_){if(f==null)return f;if(!Vt(f))return s(f,_);for(var T=f.length,A=o?T:-1,C=Je(f);(o?A--:++A<T)&&_(C[A],A,C)!==!1;);return f}}function Xm(s){return function(o,f,_){for(var T=-1,A=Je(o),C=_(o),R=C.length;R--;){var M=C[s?R:++T];if(f(A[M],M,A)===!1)break}return o}}function zL(s,o,f){var _=o&b,T=Ws(s);function A(){var C=this&&this!==It&&this instanceof A?T:s;return C.apply(_?f:this,arguments)}return A}function jm(s){return function(o){o=We(o);var f=Hi(o)?Pr(o):r,_=f?f[0]:o.charAt(0),T=f?An(f,1).join(""):o.slice(1);return _[s]()+T}}function Zi(s){return function(o){return Fc(V_(H_(o).replace(ON,"")),s,"")}}function Ws(s){return function(){var o=arguments;switch(o.length){case 0:return new s;case 1:return new s(o[0]);case 2:return new s(o[0],o[1]);case 3:return new s(o[0],o[1],o[2]);case 4:return new s(o[0],o[1],o[2],o[3]);case 5:return new s(o[0],o[1],o[2],o[3],o[4]);case 6:return new s(o[0],o[1],o[2],o[3],o[4],o[5]);case 7:return new s(o[0],o[1],o[2],o[3],o[4],o[5],o[6])}var f=Yi(s.prototype),_=s.apply(f,o);return ct(_)?_:f}}function HL(s,o,f){var _=Ws(s);function T(){for(var A=arguments.length,C=k(A),R=A,M=Qi(T);R--;)C[R]=arguments[R];var U=A<3&&C[0]!==M&&C[A-1]!==M?[]:xn(C,M);if(A-=U.length,A<f)return Zm(s,o,Wo,T.placeholder,r,C,U,r,r,f-A);var $=this&&this!==It&&this instanceof T?_:s;return Zt($,this,C)}return T}function Wm(s){return function(o,f,_){var T=Je(o);if(!Vt(o)){var A=ue(f,3);o=At(o),f=function(R){return A(T[R],R,T)}}var C=s(o,f,_);return C>-1?T[A?o[C]:C]:r}}function qm(s){return tn(function(o){var f=o.length,_=f,T=dr.prototype.thru;for(s&&o.reverse();_--;){var A=o[_];if(typeof A!="function")throw new fr(u);if(T&&!C&&Zo(A)=="wrapper")var C=new dr([],!0)}for(_=C?_:f;++_<f;){A=o[_];var R=Zo(A),M=R=="wrapper"?dh(A):r;M&&_h(M[0])&&M[1]==(N|w|O|L)&&!M[4].length&&M[9]==1?C=C[Zo(M[0])].apply(C,M[3]):C=A.length==1&&_h(A)?C[R]():C.thru(A)}return function(){var U=arguments,$=U[0];if(C&&U.length==1&&ye($))return C.plant($).value();for(var H=0,K=f?o[H].apply(this,U):$;++H<f;)K=o[H].call(this,K);return K}})}function Wo(s,o,f,_,T,A,C,R,M,U){var $=o&N,H=o&b,K=o&x,re=o&(w|I),le=o&D,we=K?r:Ws(s);function ce(){for(var Pe=arguments.length,Le=k(Pe),tr=Pe;tr--;)Le[tr]=arguments[tr];if(re)var Ut=Qi(ce),rr=t3(Le,Ut);if(_&&(Le=zm(Le,_,T,re)),A&&(Le=Hm(Le,A,C,re)),Pe-=rr,re&&Pe<U){var mt=xn(Le,Ut);return Zm(s,o,Wo,ce.placeholder,f,Le,mt,R,M,U-Pe)}var Fr=H?f:this,an=K?Fr[s]:s;return Pe=Le.length,R?Le=lk(Le,R):le&&Pe>1&&Le.reverse(),$&&M<Pe&&(Le.length=M),this&&this!==It&&this instanceof ce&&(an=we||Ws(an)),an.apply(Fr,Le)}return ce}function Ym(s,o){return function(f,_){return _L(f,s,o(_),{})}}function qo(s,o){return function(f,_){var T;if(f===r&&_===r)return o;if(f!==r&&(T=f),_!==r){if(T===r)return _;typeof f=="string"||typeof _=="string"?(f=Jt(f),_=Jt(_)):(f=Nm(f),_=Nm(_)),T=s(f,_)}return T}}function lh(s){return tn(function(o){return o=at(o,Qt(ue())),Ee(function(f){var _=this;return s(o,function(T){return Zt(T,_,f)})})})}function Yo(s,o){o=o===r?" ":Jt(o);var f=o.length;if(f<2)return f?rh(o,s):o;var _=rh(o,Lo(s/Vi(o)));return Hi(o)?An(Pr(_),0,s).join(""):_.slice(0,s)}function VL(s,o,f,_){var T=o&b,A=Ws(s);function C(){for(var R=-1,M=arguments.length,U=-1,$=_.length,H=k($+M),K=this&&this!==It&&this instanceof C?A:s;++U<$;)H[U]=_[U];for(;M--;)H[U++]=arguments[++R];return Zt(K,T?f:this,H)}return C}function Km(s){return function(o,f,_){return _&&typeof _!="number"&&Bt(o,f,_)&&(f=_=r),o=sn(o),f===r?(f=o,o=0):f=sn(f),_=_===r?o<f?1:-1:sn(_),RL(o,f,_,s)}}function Ko(s){return function(o,f){return typeof o=="string"&&typeof f=="string"||(o=_r(o),f=_r(f)),s(o,f)}}function Zm(s,o,f,_,T,A,C,R,M,U){var $=o&w,H=$?C:r,K=$?r:C,re=$?A:r,le=$?r:A;o|=$?O:F,o&=~($?F:O),o&E||(o&=~(b|x));var we=[s,o,T,re,H,le,K,R,M,U],ce=f.apply(r,we);return _h(s)&&l_(ce,we),ce.placeholder=_,c_(ce,s,o)}function ch(s){var o=yt[s];return function(f,_){if(f=_r(f),_=_==null?0:Ft(be(_),292),_&&cm(f)){var T=(We(f)+"e").split("e"),A=o(T[0]+"e"+(+T[1]+_));return T=(We(A)+"e").split("e"),+(T[0]+"e"+(+T[1]-_))}return o(f)}}var XL=Wi&&1/Ao(new Wi([,-0]))[1]==z?function(s){return new Wi(s)}:Oh;function Qm(s){return function(o){var f=Nt(o);return f==pe?$c(o):f==ft?u3(o):e3(o,s(o))}}function en(s,o,f,_,T,A,C,R){var M=o&x;if(!M&&typeof s!="function")throw new fr(u);var U=_?_.length:0;if(U||(o&=~(O|F),_=T=r),C=C===r?C:xt(be(C),0),R=R===r?R:be(R),U-=T?T.length:0,o&F){var $=_,H=T;_=T=r}var K=M?r:dh(s),re=[s,o,f,_,T,$,H,A,C,R];if(K&&ak(re,K),s=re[0],o=re[1],f=re[2],_=re[3],T=re[4],R=re[9]=re[9]===r?M?0:s.length:xt(re[9]-U,0),!R&&o&(w|I)&&(o&=~(w|I)),!o||o==b)var le=zL(s,o,f);else o==w||o==I?le=HL(s,o,R):(o==O||o==(b|O))&&!T.length?le=VL(s,o,f,_):le=Wo.apply(r,re);var we=K?Om:l_;return c_(we(le,re),s,o)}function Jm(s,o,f,_){return s===r||Or(s,ji[f])&&!Ye.call(_,f)?o:s}function e_(s,o,f,_,T,A){return ct(s)&&ct(o)&&(A.set(o,s),Ho(s,o,r,e_,A),A.delete(o)),s}function jL(s){return Ks(s)?r:s}function t_(s,o,f,_,T,A){var C=f&v,R=s.length,M=o.length;if(R!=M&&!(C&&M>R))return!1;var U=A.get(s),$=A.get(o);if(U&&$)return U==o&&$==s;var H=-1,K=!0,re=f&y?new Jn:r;for(A.set(s,o),A.set(o,s);++H<R;){var le=s[H],we=o[H];if(_)var ce=C?_(we,le,H,o,s,A):_(le,we,H,s,o,A);if(ce!==r){if(ce)continue;K=!1;break}if(re){if(!Nc(o,function(Pe,Le){if(!ks(re,Le)&&(le===Pe||T(le,Pe,f,_,A)))return re.push(Le)})){K=!1;break}}else if(!(le===we||T(le,we,f,_,A))){K=!1;break}}return A.delete(s),A.delete(o),K}function WL(s,o,f,_,T,A,C){switch(f){case $i:if(s.byteLength!=o.byteLength||s.byteOffset!=o.byteOffset)return!1;s=s.buffer,o=o.buffer;case Ui:return!(s.byteLength!=o.byteLength||!A(new Mo(s),new Mo(o)));case He:case Re:case ve:return Or(+s,+o);case Ae:return s.name==o.name&&s.message==o.message;case zt:case lr:return s==o+"";case pe:var R=$c;case ft:var M=_&v;if(R||(R=Ao),s.size!=o.size&&!M)return!1;var U=C.get(s);if(U)return U==o;_|=y,C.set(s,o);var $=t_(R(s),R(o),_,T,A,C);return C.delete(s),$;case Bi:if(Gs)return Gs.call(s)==Gs.call(o)}return!1}function qL(s,o,f,_,T,A){var C=f&v,R=hh(s),M=R.length,U=hh(o),$=U.length;if(M!=$&&!C)return!1;for(var H=M;H--;){var K=R[H];if(!(C?K in o:Ye.call(o,K)))return!1}var re=A.get(s),le=A.get(o);if(re&&le)return re==o&&le==s;var we=!0;A.set(s,o),A.set(o,s);for(var ce=C;++H<M;){K=R[H];var Pe=s[K],Le=o[K];if(_)var tr=C?_(Le,Pe,K,o,s,A):_(Pe,Le,K,s,o,A);if(!(tr===r?Pe===Le||T(Pe,Le,f,_,A):tr)){we=!1;break}ce||(ce=K=="constructor")}if(we&&!ce){var Ut=s.constructor,rr=o.constructor;Ut!=rr&&"constructor"in s&&"constructor"in o&&!(typeof Ut=="function"&&Ut instanceof Ut&&typeof rr=="function"&&rr instanceof rr)&&(we=!1)}return A.delete(s),A.delete(o),we}function tn(s){return yh(o_(s,r,m_),s+"")}function hh(s){return bm(s,At,gh)}function fh(s){return bm(s,Xt,r_)}var dh=Do?function(s){return Do.get(s)}:Oh;function Zo(s){for(var o=s.name+"",f=qi[o],_=Ye.call(qi,o)?f.length:0;_--;){var T=f[_],A=T.func;if(A==null||A==s)return T.name}return o}function Qi(s){var o=Ye.call(S,"placeholder")?S:s;return o.placeholder}function ue(){var s=S.iteratee||Ph;return s=s===Ph?Sm:s,arguments.length?s(arguments[0],arguments[1]):s}function Qo(s,o){var f=s.__data__;return rk(o)?f[typeof o=="string"?"string":"hash"]:f.map}function ph(s){for(var o=At(s),f=o.length;f--;){var _=o[f],T=s[_];o[f]=[_,T,s_(T)]}return o}function ri(s,o){var f=s3(s,o);return wm(f)?f:r}function YL(s){var o=Ye.call(s,Zn),f=s[Zn];try{s[Zn]=r;var _=!0}catch{}var T=Ro.call(s);return _&&(o?s[Zn]=f:delete s[Zn]),T}var gh=zc?function(s){return s==null?[]:(s=Je(s),vn(zc(s),function(o){return um.call(s,o)}))}:Fh,r_=zc?function(s){for(var o=[];s;)yn(o,gh(s)),s=Oo(s);return o}:Fh,Nt=Dt;(Hc&&Nt(new Hc(new ArrayBuffer(1)))!=$i||Bs&&Nt(new Bs)!=pe||Vc&&Nt(Vc.resolve())!=Ne||Wi&&Nt(new Wi)!=ft||Us&&Nt(new Us)!=Yn)&&(Nt=function(s){var o=Dt(s),f=o==oe?s.constructor:r,_=f?ni(f):"";if(_)switch(_){case M3:return $i;case O3:return pe;case F3:return Ne;case N3:return ft;case L3:return Yn}return o});function KL(s,o,f){for(var _=-1,T=f.length;++_<T;){var A=f[_],C=A.size;switch(A.type){case"drop":s+=C;break;case"dropRight":o-=C;break;case"take":o=Ft(o,s+C);break;case"takeRight":s=xt(s,o-C);break}}return{start:s,end:o}}function ZL(s){var o=s.match(nN);return o?o[1].split(iN):[]}function n_(s,o,f){o=Sn(o,s);for(var _=-1,T=o.length,A=!1;++_<T;){var C=Vr(o[_]);if(!(A=s!=null&&f(s,C)))break;s=s[C]}return A||++_!=T?A:(T=s==null?0:s.length,!!T&&su(T)&&rn(C,T)&&(ye(s)||ii(s)))}function QL(s){var o=s.length,f=new s.constructor(o);return o&&typeof s[0]=="string"&&Ye.call(s,"index")&&(f.index=s.index,f.input=s.input),f}function i_(s){return typeof s.constructor=="function"&&!qs(s)?Yi(Oo(s)):{}}function JL(s,o,f){var _=s.constructor;switch(o){case Ui:return uh(s);case He:case Re:return new _(+s);case $i:return kL(s,f);case pc:case gc:case mc:case _c:case vc:case yc:case xc:case bc:case Tc:return $m(s,f);case pe:return new _;case ve:case lr:return new _(s);case zt:return DL(s);case ft:return new _;case Bi:return BL(s)}}function ek(s,o){var f=o.length;if(!f)return s;var _=f-1;return o[_]=(f>1?"& ":"")+o[_],o=o.join(f>2?", ":" "),s.replace(rN,`{
|
|
1998
|
-
/* [wrapped with `+o+`] */
|
|
1999
|
-
`)}function tk(s){return ye(s)||ii(s)||!!(lm&&s&&s[lm])}function rn(s,o){var f=typeof s;return o=o??Q,!!o&&(f=="number"||f!="symbol"&&dN.test(s))&&s>-1&&s%1==0&&s<o}function Bt(s,o,f){if(!ct(f))return!1;var _=typeof o;return(_=="number"?Vt(f)&&rn(o,f.length):_=="string"&&o in f)?Or(f[o],s):!1}function mh(s,o){if(ye(s))return!1;var f=typeof s;return f=="number"||f=="symbol"||f=="boolean"||s==null||er(s)?!0:QF.test(s)||!ZF.test(s)||o!=null&&s in Je(o)}function rk(s){var o=typeof s;return o=="string"||o=="number"||o=="symbol"||o=="boolean"?s!=="__proto__":s===null}function _h(s){var o=Zo(s),f=S[o];if(typeof f!="function"||!(o in Oe.prototype))return!1;if(s===f)return!0;var _=dh(f);return!!_&&s===_[0]}function nk(s){return!!sm&&sm in s}var ik=Co?nn:Nh;function qs(s){var o=s&&s.constructor,f=typeof o=="function"&&o.prototype||ji;return s===f}function s_(s){return s===s&&!ct(s)}function a_(s,o){return function(f){return f==null?!1:f[s]===o&&(o!==r||s in Je(f))}}function sk(s){var o=nu(s,function(_){return f.size===p&&f.clear(),_}),f=o.cache;return o}function ak(s,o){var f=s[1],_=o[1],T=f|_,A=T<(b|x|N),C=_==N&&f==w||_==N&&f==L&&s[7].length<=o[8]||_==(N|L)&&o[7].length<=o[8]&&f==w;if(!(A||C))return s;_&b&&(s[2]=o[2],T|=f&b?0:E);var R=o[3];if(R){var M=s[3];s[3]=M?zm(M,R,o[4]):R,s[4]=M?xn(s[3],m):o[4]}return R=o[5],R&&(M=s[5],s[5]=M?Hm(M,R,o[6]):R,s[6]=M?xn(s[5],m):o[6]),R=o[7],R&&(s[7]=R),_&N&&(s[8]=s[8]==null?o[8]:Ft(s[8],o[8])),s[9]==null&&(s[9]=o[9]),s[0]=o[0],s[1]=T,s}function ok(s){var o=[];if(s!=null)for(var f in Je(s))o.push(f);return o}function uk(s){return Ro.call(s)}function o_(s,o,f){return o=xt(o===r?s.length-1:o,0),function(){for(var _=arguments,T=-1,A=xt(_.length-o,0),C=k(A);++T<A;)C[T]=_[o+T];T=-1;for(var R=k(o+1);++T<o;)R[T]=_[T];return R[o]=f(C),Zt(s,this,R)}}function u_(s,o){return o.length<2?s:ti(s,gr(o,0,-1))}function lk(s,o){for(var f=s.length,_=Ft(o.length,f),T=Ht(s);_--;){var A=o[_];s[_]=rn(A,f)?T[A]:r}return s}function vh(s,o){if(!(o==="constructor"&&typeof s[o]=="function")&&o!="__proto__")return s[o]}var l_=h_(Om),Ys=S3||function(s,o){return It.setTimeout(s,o)},yh=h_(OL);function c_(s,o,f){var _=o+"";return yh(s,ek(_,ck(ZL(_),f)))}function h_(s){var o=0,f=0;return function(){var _=I3(),T=X-(_-f);if(f=_,T>0){if(++o>=ie)return arguments[0]}else o=0;return s.apply(r,arguments)}}function Jo(s,o){var f=-1,_=s.length,T=_-1;for(o=o===r?_:o;++f<o;){var A=th(f,T),C=s[A];s[A]=s[f],s[f]=C}return s.length=o,s}var f_=sk(function(s){var o=[];return s.charCodeAt(0)===46&&o.push(""),s.replace(JF,function(f,_,T,A){o.push(T?A.replace(oN,"$1"):_||f)}),o});function Vr(s){if(typeof s=="string"||er(s))return s;var o=s+"";return o=="0"&&1/s==-z?"-0":o}function ni(s){if(s!=null){try{return Io.call(s)}catch{}try{return s+""}catch{}}return""}function ck(s,o){return hr(me,function(f){var _="_."+f[0];o&f[1]&&!wo(s,_)&&s.push(_)}),s.sort()}function d_(s){if(s instanceof Oe)return s.clone();var o=new dr(s.__wrapped__,s.__chain__);return o.__actions__=Ht(s.__actions__),o.__index__=s.__index__,o.__values__=s.__values__,o}function hk(s,o,f){(f?Bt(s,o,f):o===r)?o=1:o=xt(be(o),0);var _=s==null?0:s.length;if(!_||o<1)return[];for(var T=0,A=0,C=k(Lo(_/o));T<_;)C[A++]=gr(s,T,T+=o);return C}function fk(s){for(var o=-1,f=s==null?0:s.length,_=0,T=[];++o<f;){var A=s[o];A&&(T[_++]=A)}return T}function dk(){var s=arguments.length;if(!s)return[];for(var o=k(s-1),f=arguments[0],_=s;_--;)o[_-1]=arguments[_];return yn(ye(f)?Ht(f):[f],Rt(o,1))}var pk=Ee(function(s,o){return gt(s)?Hs(s,Rt(o,1,gt,!0)):[]}),gk=Ee(function(s,o){var f=mr(o);return gt(f)&&(f=r),gt(s)?Hs(s,Rt(o,1,gt,!0),ue(f,2)):[]}),mk=Ee(function(s,o){var f=mr(o);return gt(f)&&(f=r),gt(s)?Hs(s,Rt(o,1,gt,!0),r,f):[]});function _k(s,o,f){var _=s==null?0:s.length;return _?(o=f||o===r?1:be(o),gr(s,o<0?0:o,_)):[]}function vk(s,o,f){var _=s==null?0:s.length;return _?(o=f||o===r?1:be(o),o=_-o,gr(s,0,o<0?0:o)):[]}function yk(s,o){return s&&s.length?Xo(s,ue(o,3),!0,!0):[]}function xk(s,o){return s&&s.length?Xo(s,ue(o,3),!0):[]}function bk(s,o,f,_){var T=s==null?0:s.length;return T?(f&&typeof f!="number"&&Bt(s,o,f)&&(f=0,_=T),dL(s,o,f,_)):[]}function p_(s,o,f){var _=s==null?0:s.length;if(!_)return-1;var T=f==null?0:be(f);return T<0&&(T=xt(_+T,0)),So(s,ue(o,3),T)}function g_(s,o,f){var _=s==null?0:s.length;if(!_)return-1;var T=_-1;return f!==r&&(T=be(f),T=f<0?xt(_+T,0):Ft(T,_-1)),So(s,ue(o,3),T,!0)}function m_(s){var o=s==null?0:s.length;return o?Rt(s,1):[]}function Tk(s){var o=s==null?0:s.length;return o?Rt(s,z):[]}function wk(s,o){var f=s==null?0:s.length;return f?(o=o===r?1:be(o),Rt(s,o)):[]}function Sk(s){for(var o=-1,f=s==null?0:s.length,_={};++o<f;){var T=s[o];_[T[0]]=T[1]}return _}function __(s){return s&&s.length?s[0]:r}function Ak(s,o,f){var _=s==null?0:s.length;if(!_)return-1;var T=f==null?0:be(f);return T<0&&(T=xt(_+T,0)),zi(s,o,T)}function Ek(s){var o=s==null?0:s.length;return o?gr(s,0,-1):[]}var Ck=Ee(function(s){var o=at(s,ah);return o.length&&o[0]===s[0]?Kc(o):[]}),Ik=Ee(function(s){var o=mr(s),f=at(s,ah);return o===mr(f)?o=r:f.pop(),f.length&&f[0]===s[0]?Kc(f,ue(o,2)):[]}),Rk=Ee(function(s){var o=mr(s),f=at(s,ah);return o=typeof o=="function"?o:r,o&&f.pop(),f.length&&f[0]===s[0]?Kc(f,r,o):[]});function Pk(s,o){return s==null?"":E3.call(s,o)}function mr(s){var o=s==null?0:s.length;return o?s[o-1]:r}function Mk(s,o,f){var _=s==null?0:s.length;if(!_)return-1;var T=_;return f!==r&&(T=be(f),T=T<0?xt(_+T,0):Ft(T,_-1)),o===o?c3(s,o,T):So(s,Z0,T,!0)}function Ok(s,o){return s&&s.length?Im(s,be(o)):r}var Fk=Ee(v_);function v_(s,o){return s&&s.length&&o&&o.length?eh(s,o):s}function Nk(s,o,f){return s&&s.length&&o&&o.length?eh(s,o,ue(f,2)):s}function Lk(s,o,f){return s&&s.length&&o&&o.length?eh(s,o,r,f):s}var kk=tn(function(s,o){var f=s==null?0:s.length,_=jc(s,o);return Mm(s,at(o,function(T){return rn(T,f)?+T:T}).sort(Gm)),_});function Dk(s,o){var f=[];if(!(s&&s.length))return f;var _=-1,T=[],A=s.length;for(o=ue(o,3);++_<A;){var C=s[_];o(C,_,s)&&(f.push(C),T.push(_))}return Mm(s,T),f}function xh(s){return s==null?s:P3.call(s)}function Bk(s,o,f){var _=s==null?0:s.length;return _?(f&&typeof f!="number"&&Bt(s,o,f)?(o=0,f=_):(o=o==null?0:be(o),f=f===r?_:be(f)),gr(s,o,f)):[]}function Uk(s,o){return Vo(s,o)}function $k(s,o,f){return nh(s,o,ue(f,2))}function Gk(s,o){var f=s==null?0:s.length;if(f){var _=Vo(s,o);if(_<f&&Or(s[_],o))return _}return-1}function zk(s,o){return Vo(s,o,!0)}function Hk(s,o,f){return nh(s,o,ue(f,2),!0)}function Vk(s,o){var f=s==null?0:s.length;if(f){var _=Vo(s,o,!0)-1;if(Or(s[_],o))return _}return-1}function Xk(s){return s&&s.length?Fm(s):[]}function jk(s,o){return s&&s.length?Fm(s,ue(o,2)):[]}function Wk(s){var o=s==null?0:s.length;return o?gr(s,1,o):[]}function qk(s,o,f){return s&&s.length?(o=f||o===r?1:be(o),gr(s,0,o<0?0:o)):[]}function Yk(s,o,f){var _=s==null?0:s.length;return _?(o=f||o===r?1:be(o),o=_-o,gr(s,o<0?0:o,_)):[]}function Kk(s,o){return s&&s.length?Xo(s,ue(o,3),!1,!0):[]}function Zk(s,o){return s&&s.length?Xo(s,ue(o,3)):[]}var Qk=Ee(function(s){return wn(Rt(s,1,gt,!0))}),Jk=Ee(function(s){var o=mr(s);return gt(o)&&(o=r),wn(Rt(s,1,gt,!0),ue(o,2))}),e5=Ee(function(s){var o=mr(s);return o=typeof o=="function"?o:r,wn(Rt(s,1,gt,!0),r,o)});function t5(s){return s&&s.length?wn(s):[]}function r5(s,o){return s&&s.length?wn(s,ue(o,2)):[]}function n5(s,o){return o=typeof o=="function"?o:r,s&&s.length?wn(s,r,o):[]}function bh(s){if(!(s&&s.length))return[];var o=0;return s=vn(s,function(f){if(gt(f))return o=xt(f.length,o),!0}),Bc(o,function(f){return at(s,Lc(f))})}function y_(s,o){if(!(s&&s.length))return[];var f=bh(s);return o==null?f:at(f,function(_){return Zt(o,r,_)})}var i5=Ee(function(s,o){return gt(s)?Hs(s,o):[]}),s5=Ee(function(s){return sh(vn(s,gt))}),a5=Ee(function(s){var o=mr(s);return gt(o)&&(o=r),sh(vn(s,gt),ue(o,2))}),o5=Ee(function(s){var o=mr(s);return o=typeof o=="function"?o:r,sh(vn(s,gt),r,o)}),u5=Ee(bh);function l5(s,o){return Dm(s||[],o||[],zs)}function c5(s,o){return Dm(s||[],o||[],js)}var h5=Ee(function(s){var o=s.length,f=o>1?s[o-1]:r;return f=typeof f=="function"?(s.pop(),f):r,y_(s,f)});function x_(s){var o=S(s);return o.__chain__=!0,o}function f5(s,o){return o(s),s}function eu(s,o){return o(s)}var d5=tn(function(s){var o=s.length,f=o?s[0]:0,_=this.__wrapped__,T=function(A){return jc(A,s)};return o>1||this.__actions__.length||!(_ instanceof Oe)||!rn(f)?this.thru(T):(_=_.slice(f,+f+(o?1:0)),_.__actions__.push({func:eu,args:[T],thisArg:r}),new dr(_,this.__chain__).thru(function(A){return o&&!A.length&&A.push(r),A}))});function p5(){return x_(this)}function g5(){return new dr(this.value(),this.__chain__)}function m5(){this.__values__===r&&(this.__values__=N_(this.value()));var s=this.__index__>=this.__values__.length,o=s?r:this.__values__[this.__index__++];return{done:s,value:o}}function _5(){return this}function v5(s){for(var o,f=this;f instanceof Uo;){var _=d_(f);_.__index__=0,_.__values__=r,o?T.__wrapped__=_:o=_;var T=_;f=f.__wrapped__}return T.__wrapped__=s,o}function y5(){var s=this.__wrapped__;if(s instanceof Oe){var o=s;return this.__actions__.length&&(o=new Oe(this)),o=o.reverse(),o.__actions__.push({func:eu,args:[xh],thisArg:r}),new dr(o,this.__chain__)}return this.thru(xh)}function x5(){return km(this.__wrapped__,this.__actions__)}var b5=jo(function(s,o,f){Ye.call(s,f)?++s[f]:Jr(s,f,1)});function T5(s,o,f){var _=ye(s)?Y0:fL;return f&&Bt(s,o,f)&&(o=r),_(s,ue(o,3))}function w5(s,o){var f=ye(s)?vn:ym;return f(s,ue(o,3))}var S5=Wm(p_),A5=Wm(g_);function E5(s,o){return Rt(tu(s,o),1)}function C5(s,o){return Rt(tu(s,o),z)}function I5(s,o,f){return f=f===r?1:be(f),Rt(tu(s,o),f)}function b_(s,o){var f=ye(s)?hr:Tn;return f(s,ue(o,3))}function T_(s,o){var f=ye(s)?WN:vm;return f(s,ue(o,3))}var R5=jo(function(s,o,f){Ye.call(s,f)?s[f].push(o):Jr(s,f,[o])});function P5(s,o,f,_){s=Vt(s)?s:es(s),f=f&&!_?be(f):0;var T=s.length;return f<0&&(f=xt(T+f,0)),au(s)?f<=T&&s.indexOf(o,f)>-1:!!T&&zi(s,o,f)>-1}var M5=Ee(function(s,o,f){var _=-1,T=typeof o=="function",A=Vt(s)?k(s.length):[];return Tn(s,function(C){A[++_]=T?Zt(o,C,f):Vs(C,o,f)}),A}),O5=jo(function(s,o,f){Jr(s,f,o)});function tu(s,o){var f=ye(s)?at:Am;return f(s,ue(o,3))}function F5(s,o,f,_){return s==null?[]:(ye(o)||(o=o==null?[]:[o]),f=_?r:f,ye(f)||(f=f==null?[]:[f]),Rm(s,o,f))}var N5=jo(function(s,o,f){s[f?0:1].push(o)},function(){return[[],[]]});function L5(s,o,f){var _=ye(s)?Fc:J0,T=arguments.length<3;return _(s,ue(o,4),f,T,Tn)}function k5(s,o,f){var _=ye(s)?qN:J0,T=arguments.length<3;return _(s,ue(o,4),f,T,vm)}function D5(s,o){var f=ye(s)?vn:ym;return f(s,iu(ue(o,3)))}function B5(s){var o=ye(s)?pm:PL;return o(s)}function U5(s,o,f){(f?Bt(s,o,f):o===r)?o=1:o=be(o);var _=ye(s)?oL:ML;return _(s,o)}function $5(s){var o=ye(s)?uL:FL;return o(s)}function G5(s){if(s==null)return 0;if(Vt(s))return au(s)?Vi(s):s.length;var o=Nt(s);return o==pe||o==ft?s.size:Qc(s).length}function z5(s,o,f){var _=ye(s)?Nc:NL;return f&&Bt(s,o,f)&&(o=r),_(s,ue(o,3))}var H5=Ee(function(s,o){if(s==null)return[];var f=o.length;return f>1&&Bt(s,o[0],o[1])?o=[]:f>2&&Bt(o[0],o[1],o[2])&&(o=[o[0]]),Rm(s,Rt(o,1),[])}),ru=w3||function(){return It.Date.now()};function V5(s,o){if(typeof o!="function")throw new fr(u);return s=be(s),function(){if(--s<1)return o.apply(this,arguments)}}function w_(s,o,f){return o=f?r:o,o=s&&o==null?s.length:o,en(s,N,r,r,r,r,o)}function S_(s,o){var f;if(typeof o!="function")throw new fr(u);return s=be(s),function(){return--s>0&&(f=o.apply(this,arguments)),s<=1&&(o=r),f}}var Th=Ee(function(s,o,f){var _=b;if(f.length){var T=xn(f,Qi(Th));_|=O}return en(s,_,o,f,T)}),A_=Ee(function(s,o,f){var _=b|x;if(f.length){var T=xn(f,Qi(A_));_|=O}return en(o,_,s,f,T)});function E_(s,o,f){o=f?r:o;var _=en(s,w,r,r,r,r,r,o);return _.placeholder=E_.placeholder,_}function C_(s,o,f){o=f?r:o;var _=en(s,I,r,r,r,r,r,o);return _.placeholder=C_.placeholder,_}function I_(s,o,f){var _,T,A,C,R,M,U=0,$=!1,H=!1,K=!0;if(typeof s!="function")throw new fr(u);o=_r(o)||0,ct(f)&&($=!!f.leading,H="maxWait"in f,A=H?xt(_r(f.maxWait)||0,o):A,K="trailing"in f?!!f.trailing:K);function re(mt){var Fr=_,an=T;return _=T=r,U=mt,C=s.apply(an,Fr),C}function le(mt){return U=mt,R=Ys(Pe,o),$?re(mt):C}function we(mt){var Fr=mt-M,an=mt-U,W_=o-Fr;return H?Ft(W_,A-an):W_}function ce(mt){var Fr=mt-M,an=mt-U;return M===r||Fr>=o||Fr<0||H&&an>=A}function Pe(){var mt=ru();if(ce(mt))return Le(mt);R=Ys(Pe,we(mt))}function Le(mt){return R=r,K&&_?re(mt):(_=T=r,C)}function tr(){R!==r&&Bm(R),U=0,_=M=T=R=r}function Ut(){return R===r?C:Le(ru())}function rr(){var mt=ru(),Fr=ce(mt);if(_=arguments,T=this,M=mt,Fr){if(R===r)return le(M);if(H)return Bm(R),R=Ys(Pe,o),re(M)}return R===r&&(R=Ys(Pe,o)),C}return rr.cancel=tr,rr.flush=Ut,rr}var X5=Ee(function(s,o){return _m(s,1,o)}),j5=Ee(function(s,o,f){return _m(s,_r(o)||0,f)});function W5(s){return en(s,D)}function nu(s,o){if(typeof s!="function"||o!=null&&typeof o!="function")throw new fr(u);var f=function(){var _=arguments,T=o?o.apply(this,_):_[0],A=f.cache;if(A.has(T))return A.get(T);var C=s.apply(this,_);return f.cache=A.set(T,C)||A,C};return f.cache=new(nu.Cache||Qr),f}nu.Cache=Qr;function iu(s){if(typeof s!="function")throw new fr(u);return function(){var o=arguments;switch(o.length){case 0:return!s.call(this);case 1:return!s.call(this,o[0]);case 2:return!s.call(this,o[0],o[1]);case 3:return!s.call(this,o[0],o[1],o[2])}return!s.apply(this,o)}}function q5(s){return S_(2,s)}var Y5=LL(function(s,o){o=o.length==1&&ye(o[0])?at(o[0],Qt(ue())):at(Rt(o,1),Qt(ue()));var f=o.length;return Ee(function(_){for(var T=-1,A=Ft(_.length,f);++T<A;)_[T]=o[T].call(this,_[T]);return Zt(s,this,_)})}),wh=Ee(function(s,o){var f=xn(o,Qi(wh));return en(s,O,r,o,f)}),R_=Ee(function(s,o){var f=xn(o,Qi(R_));return en(s,F,r,o,f)}),K5=tn(function(s,o){return en(s,L,r,r,r,o)});function Z5(s,o){if(typeof s!="function")throw new fr(u);return o=o===r?o:be(o),Ee(s,o)}function Q5(s,o){if(typeof s!="function")throw new fr(u);return o=o==null?0:xt(be(o),0),Ee(function(f){var _=f[o],T=An(f,0,o);return _&&yn(T,_),Zt(s,this,T)})}function J5(s,o,f){var _=!0,T=!0;if(typeof s!="function")throw new fr(u);return ct(f)&&(_="leading"in f?!!f.leading:_,T="trailing"in f?!!f.trailing:T),I_(s,o,{leading:_,maxWait:o,trailing:T})}function eD(s){return w_(s,1)}function tD(s,o){return wh(oh(o),s)}function rD(){if(!arguments.length)return[];var s=arguments[0];return ye(s)?s:[s]}function nD(s){return pr(s,g)}function iD(s,o){return o=typeof o=="function"?o:r,pr(s,g,o)}function sD(s){return pr(s,c|g)}function aD(s,o){return o=typeof o=="function"?o:r,pr(s,c|g,o)}function oD(s,o){return o==null||mm(s,o,At(o))}function Or(s,o){return s===o||s!==s&&o!==o}var uD=Ko(Yc),lD=Ko(function(s,o){return s>=o}),ii=Tm(function(){return arguments}())?Tm:function(s){return dt(s)&&Ye.call(s,"callee")&&!um.call(s,"callee")},ye=k.isArray,cD=H0?Qt(H0):vL;function Vt(s){return s!=null&&su(s.length)&&!nn(s)}function gt(s){return dt(s)&&Vt(s)}function hD(s){return s===!0||s===!1||dt(s)&&Dt(s)==He}var En=A3||Nh,fD=V0?Qt(V0):yL;function dD(s){return dt(s)&&s.nodeType===1&&!Ks(s)}function pD(s){if(s==null)return!0;if(Vt(s)&&(ye(s)||typeof s=="string"||typeof s.splice=="function"||En(s)||Ji(s)||ii(s)))return!s.length;var o=Nt(s);if(o==pe||o==ft)return!s.size;if(qs(s))return!Qc(s).length;for(var f in s)if(Ye.call(s,f))return!1;return!0}function gD(s,o){return Xs(s,o)}function mD(s,o,f){f=typeof f=="function"?f:r;var _=f?f(s,o):r;return _===r?Xs(s,o,r,f):!!_}function Sh(s){if(!dt(s))return!1;var o=Dt(s);return o==Ae||o==xe||typeof s.message=="string"&&typeof s.name=="string"&&!Ks(s)}function _D(s){return typeof s=="number"&&cm(s)}function nn(s){if(!ct(s))return!1;var o=Dt(s);return o==$e||o==Ke||o==Ue||o==Kt}function P_(s){return typeof s=="number"&&s==be(s)}function su(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=Q}function ct(s){var o=typeof s;return s!=null&&(o=="object"||o=="function")}function dt(s){return s!=null&&typeof s=="object"}var M_=X0?Qt(X0):bL;function vD(s,o){return s===o||Zc(s,o,ph(o))}function yD(s,o,f){return f=typeof f=="function"?f:r,Zc(s,o,ph(o),f)}function xD(s){return O_(s)&&s!=+s}function bD(s){if(ik(s))throw new _e(a);return wm(s)}function TD(s){return s===null}function wD(s){return s==null}function O_(s){return typeof s=="number"||dt(s)&&Dt(s)==ve}function Ks(s){if(!dt(s)||Dt(s)!=oe)return!1;var o=Oo(s);if(o===null)return!0;var f=Ye.call(o,"constructor")&&o.constructor;return typeof f=="function"&&f instanceof f&&Io.call(f)==y3}var Ah=j0?Qt(j0):TL;function SD(s){return P_(s)&&s>=-Q&&s<=Q}var F_=W0?Qt(W0):wL;function au(s){return typeof s=="string"||!ye(s)&&dt(s)&&Dt(s)==lr}function er(s){return typeof s=="symbol"||dt(s)&&Dt(s)==Bi}var Ji=q0?Qt(q0):SL;function AD(s){return s===r}function ED(s){return dt(s)&&Nt(s)==Yn}function CD(s){return dt(s)&&Dt(s)==Rr}var ID=Ko(Jc),RD=Ko(function(s,o){return s<=o});function N_(s){if(!s)return[];if(Vt(s))return au(s)?Pr(s):Ht(s);if(Ds&&s[Ds])return o3(s[Ds]());var o=Nt(s),f=o==pe?$c:o==ft?Ao:es;return f(s)}function sn(s){if(!s)return s===0?s:0;if(s=_r(s),s===z||s===-z){var o=s<0?-1:1;return o*ge}return s===s?s:0}function be(s){var o=sn(s),f=o%1;return o===o?f?o-f:o:0}function L_(s){return s?ei(be(s),0,q):0}function _r(s){if(typeof s=="number")return s;if(er(s))return W;if(ct(s)){var o=typeof s.valueOf=="function"?s.valueOf():s;s=ct(o)?o+"":o}if(typeof s!="string")return s===0?s:+s;s=em(s);var f=cN.test(s);return f||fN.test(s)?VN(s.slice(2),f?2:8):lN.test(s)?W:+s}function k_(s){return Hr(s,Xt(s))}function PD(s){return s?ei(be(s),-Q,Q):s===0?s:0}function We(s){return s==null?"":Jt(s)}var MD=Ki(function(s,o){if(qs(o)||Vt(o)){Hr(o,At(o),s);return}for(var f in o)Ye.call(o,f)&&zs(s,f,o[f])}),D_=Ki(function(s,o){Hr(o,Xt(o),s)}),ou=Ki(function(s,o,f,_){Hr(o,Xt(o),s,_)}),OD=Ki(function(s,o,f,_){Hr(o,At(o),s,_)}),FD=tn(jc);function ND(s,o){var f=Yi(s);return o==null?f:gm(f,o)}var LD=Ee(function(s,o){s=Je(s);var f=-1,_=o.length,T=_>2?o[2]:r;for(T&&Bt(o[0],o[1],T)&&(_=1);++f<_;)for(var A=o[f],C=Xt(A),R=-1,M=C.length;++R<M;){var U=C[R],$=s[U];($===r||Or($,ji[U])&&!Ye.call(s,U))&&(s[U]=A[U])}return s}),kD=Ee(function(s){return s.push(r,e_),Zt(B_,r,s)});function DD(s,o){return K0(s,ue(o,3),zr)}function BD(s,o){return K0(s,ue(o,3),qc)}function UD(s,o){return s==null?s:Wc(s,ue(o,3),Xt)}function $D(s,o){return s==null?s:xm(s,ue(o,3),Xt)}function GD(s,o){return s&&zr(s,ue(o,3))}function zD(s,o){return s&&qc(s,ue(o,3))}function HD(s){return s==null?[]:zo(s,At(s))}function VD(s){return s==null?[]:zo(s,Xt(s))}function Eh(s,o,f){var _=s==null?r:ti(s,o);return _===r?f:_}function XD(s,o){return s!=null&&n_(s,o,pL)}function Ch(s,o){return s!=null&&n_(s,o,gL)}var jD=Ym(function(s,o,f){o!=null&&typeof o.toString!="function"&&(o=Ro.call(o)),s[o]=f},Rh(jt)),WD=Ym(function(s,o,f){o!=null&&typeof o.toString!="function"&&(o=Ro.call(o)),Ye.call(s,o)?s[o].push(f):s[o]=[f]},ue),qD=Ee(Vs);function At(s){return Vt(s)?dm(s):Qc(s)}function Xt(s){return Vt(s)?dm(s,!0):AL(s)}function YD(s,o){var f={};return o=ue(o,3),zr(s,function(_,T,A){Jr(f,o(_,T,A),_)}),f}function KD(s,o){var f={};return o=ue(o,3),zr(s,function(_,T,A){Jr(f,T,o(_,T,A))}),f}var ZD=Ki(function(s,o,f){Ho(s,o,f)}),B_=Ki(function(s,o,f,_){Ho(s,o,f,_)}),QD=tn(function(s,o){var f={};if(s==null)return f;var _=!1;o=at(o,function(A){return A=Sn(A,s),_||(_=A.length>1),A}),Hr(s,fh(s),f),_&&(f=pr(f,c|d|g,jL));for(var T=o.length;T--;)ih(f,o[T]);return f});function JD(s,o){return U_(s,iu(ue(o)))}var eB=tn(function(s,o){return s==null?{}:CL(s,o)});function U_(s,o){if(s==null)return{};var f=at(fh(s),function(_){return[_]});return o=ue(o),Pm(s,f,function(_,T){return o(_,T[0])})}function tB(s,o,f){o=Sn(o,s);var _=-1,T=o.length;for(T||(T=1,s=r);++_<T;){var A=s==null?r:s[Vr(o[_])];A===r&&(_=T,A=f),s=nn(A)?A.call(s):A}return s}function rB(s,o,f){return s==null?s:js(s,o,f)}function nB(s,o,f,_){return _=typeof _=="function"?_:r,s==null?s:js(s,o,f,_)}var $_=Qm(At),G_=Qm(Xt);function iB(s,o,f){var _=ye(s),T=_||En(s)||Ji(s);if(o=ue(o,4),f==null){var A=s&&s.constructor;T?f=_?new A:[]:ct(s)?f=nn(A)?Yi(Oo(s)):{}:f={}}return(T?hr:zr)(s,function(C,R,M){return o(f,C,R,M)}),f}function sB(s,o){return s==null?!0:ih(s,o)}function aB(s,o,f){return s==null?s:Lm(s,o,oh(f))}function oB(s,o,f,_){return _=typeof _=="function"?_:r,s==null?s:Lm(s,o,oh(f),_)}function es(s){return s==null?[]:Uc(s,At(s))}function uB(s){return s==null?[]:Uc(s,Xt(s))}function lB(s,o,f){return f===r&&(f=o,o=r),f!==r&&(f=_r(f),f=f===f?f:0),o!==r&&(o=_r(o),o=o===o?o:0),ei(_r(s),o,f)}function cB(s,o,f){return o=sn(o),f===r?(f=o,o=0):f=sn(f),s=_r(s),mL(s,o,f)}function hB(s,o,f){if(f&&typeof f!="boolean"&&Bt(s,o,f)&&(o=f=r),f===r&&(typeof o=="boolean"?(f=o,o=r):typeof s=="boolean"&&(f=s,s=r)),s===r&&o===r?(s=0,o=1):(s=sn(s),o===r?(o=s,s=0):o=sn(o)),s>o){var _=s;s=o,o=_}if(f||s%1||o%1){var T=hm();return Ft(s+T*(o-s+HN("1e-"+((T+"").length-1))),o)}return th(s,o)}var fB=Zi(function(s,o,f){return o=o.toLowerCase(),s+(f?z_(o):o)});function z_(s){return Ih(We(s).toLowerCase())}function H_(s){return s=We(s),s&&s.replace(pN,r3).replace(FN,"")}function dB(s,o,f){s=We(s),o=Jt(o);var _=s.length;f=f===r?_:ei(be(f),0,_);var T=f;return f-=o.length,f>=0&&s.slice(f,T)==o}function pB(s){return s=We(s),s&&qF.test(s)?s.replace(x0,n3):s}function gB(s){return s=We(s),s&&eN.test(s)?s.replace(wc,"\\$&"):s}var mB=Zi(function(s,o,f){return s+(f?"-":"")+o.toLowerCase()}),_B=Zi(function(s,o,f){return s+(f?" ":"")+o.toLowerCase()}),vB=jm("toLowerCase");function yB(s,o,f){s=We(s),o=be(o);var _=o?Vi(s):0;if(!o||_>=o)return s;var T=(o-_)/2;return Yo(ko(T),f)+s+Yo(Lo(T),f)}function xB(s,o,f){s=We(s),o=be(o);var _=o?Vi(s):0;return o&&_<o?s+Yo(o-_,f):s}function bB(s,o,f){s=We(s),o=be(o);var _=o?Vi(s):0;return o&&_<o?Yo(o-_,f)+s:s}function TB(s,o,f){return f||o==null?o=0:o&&(o=+o),R3(We(s).replace(Sc,""),o||0)}function wB(s,o,f){return(f?Bt(s,o,f):o===r)?o=1:o=be(o),rh(We(s),o)}function SB(){var s=arguments,o=We(s[0]);return s.length<3?o:o.replace(s[1],s[2])}var AB=Zi(function(s,o,f){return s+(f?"_":"")+o.toLowerCase()});function EB(s,o,f){return f&&typeof f!="number"&&Bt(s,o,f)&&(o=f=r),f=f===r?q:f>>>0,f?(s=We(s),s&&(typeof o=="string"||o!=null&&!Ah(o))&&(o=Jt(o),!o&&Hi(s))?An(Pr(s),0,f):s.split(o,f)):[]}var CB=Zi(function(s,o,f){return s+(f?" ":"")+Ih(o)});function IB(s,o,f){return s=We(s),f=f==null?0:ei(be(f),0,s.length),o=Jt(o),s.slice(f,f+o.length)==o}function RB(s,o,f){var _=S.templateSettings;f&&Bt(s,o,f)&&(o=r),s=We(s),o=ou({},o,_,Jm);var T=ou({},o.imports,_.imports,Jm),A=At(T),C=Uc(T,A),R,M,U=0,$=o.interpolate||xo,H="__p += '",K=Gc((o.escape||xo).source+"|"+$.source+"|"+($===b0?uN:xo).source+"|"+(o.evaluate||xo).source+"|$","g"),re="//# sourceURL="+(Ye.call(o,"sourceURL")?(o.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++BN+"]")+`
|
|
2000
|
-
`;s.replace(K,function(ce,Pe,Le,tr,Ut,rr){return Le||(Le=tr),H+=s.slice(U,rr).replace(gN,i3),Pe&&(R=!0,H+=`' +
|
|
2001
|
-
__e(`+Pe+`) +
|
|
2002
|
-
'`),Ut&&(M=!0,H+=`';
|
|
2003
|
-
`+Ut+`;
|
|
2004
|
-
__p += '`),Le&&(H+=`' +
|
|
2005
|
-
((__t = (`+Le+`)) == null ? '' : __t) +
|
|
2006
|
-
'`),U=rr+ce.length,ce}),H+=`';
|
|
2007
|
-
`;var le=Ye.call(o,"variable")&&o.variable;if(!le)H=`with (obj) {
|
|
2008
|
-
`+H+`
|
|
2009
|
-
}
|
|
2010
|
-
`;else if(aN.test(le))throw new _e(l);H=(M?H.replace(VF,""):H).replace(XF,"$1").replace(jF,"$1;"),H="function("+(le||"obj")+`) {
|
|
2011
|
-
`+(le?"":`obj || (obj = {});
|
|
2012
|
-
`)+"var __t, __p = ''"+(R?", __e = _.escape":"")+(M?`, __j = Array.prototype.join;
|
|
2013
|
-
function print() { __p += __j.call(arguments, '') }
|
|
2014
|
-
`:`;
|
|
2015
|
-
`)+H+`return __p
|
|
2016
|
-
}`;var we=X_(function(){return Ve(A,re+"return "+H).apply(r,C)});if(we.source=H,Sh(we))throw we;return we}function PB(s){return We(s).toLowerCase()}function MB(s){return We(s).toUpperCase()}function OB(s,o,f){if(s=We(s),s&&(f||o===r))return em(s);if(!s||!(o=Jt(o)))return s;var _=Pr(s),T=Pr(o),A=tm(_,T),C=rm(_,T)+1;return An(_,A,C).join("")}function FB(s,o,f){if(s=We(s),s&&(f||o===r))return s.slice(0,im(s)+1);if(!s||!(o=Jt(o)))return s;var _=Pr(s),T=rm(_,Pr(o))+1;return An(_,0,T).join("")}function NB(s,o,f){if(s=We(s),s&&(f||o===r))return s.replace(Sc,"");if(!s||!(o=Jt(o)))return s;var _=Pr(s),T=tm(_,Pr(o));return An(_,T).join("")}function LB(s,o){var f=V,_=Y;if(ct(o)){var T="separator"in o?o.separator:T;f="length"in o?be(o.length):f,_="omission"in o?Jt(o.omission):_}s=We(s);var A=s.length;if(Hi(s)){var C=Pr(s);A=C.length}if(f>=A)return s;var R=f-Vi(_);if(R<1)return _;var M=C?An(C,0,R).join(""):s.slice(0,R);if(T===r)return M+_;if(C&&(R+=M.length-R),Ah(T)){if(s.slice(R).search(T)){var U,$=M;for(T.global||(T=Gc(T.source,We(T0.exec(T))+"g")),T.lastIndex=0;U=T.exec($);)var H=U.index;M=M.slice(0,H===r?R:H)}}else if(s.indexOf(Jt(T),R)!=R){var K=M.lastIndexOf(T);K>-1&&(M=M.slice(0,K))}return M+_}function kB(s){return s=We(s),s&&WF.test(s)?s.replace(y0,h3):s}var DB=Zi(function(s,o,f){return s+(f?" ":"")+o.toUpperCase()}),Ih=jm("toUpperCase");function V_(s,o,f){return s=We(s),o=f?r:o,o===r?a3(s)?p3(s):ZN(s):s.match(o)||[]}var X_=Ee(function(s,o){try{return Zt(s,r,o)}catch(f){return Sh(f)?f:new _e(f)}}),BB=tn(function(s,o){return hr(o,function(f){f=Vr(f),Jr(s,f,Th(s[f],s))}),s});function UB(s){var o=s==null?0:s.length,f=ue();return s=o?at(s,function(_){if(typeof _[1]!="function")throw new fr(u);return[f(_[0]),_[1]]}):[],Ee(function(_){for(var T=-1;++T<o;){var A=s[T];if(Zt(A[0],this,_))return Zt(A[1],this,_)}})}function $B(s){return hL(pr(s,c))}function Rh(s){return function(){return s}}function GB(s,o){return s==null||s!==s?o:s}var zB=qm(),HB=qm(!0);function jt(s){return s}function Ph(s){return Sm(typeof s=="function"?s:pr(s,c))}function VB(s){return Em(pr(s,c))}function XB(s,o){return Cm(s,pr(o,c))}var jB=Ee(function(s,o){return function(f){return Vs(f,s,o)}}),WB=Ee(function(s,o){return function(f){return Vs(s,f,o)}});function Mh(s,o,f){var _=At(o),T=zo(o,_);f==null&&!(ct(o)&&(T.length||!_.length))&&(f=o,o=s,s=this,T=zo(o,At(o)));var A=!(ct(f)&&"chain"in f)||!!f.chain,C=nn(s);return hr(T,function(R){var M=o[R];s[R]=M,C&&(s.prototype[R]=function(){var U=this.__chain__;if(A||U){var $=s(this.__wrapped__),H=$.__actions__=Ht(this.__actions__);return H.push({func:M,args:arguments,thisArg:s}),$.__chain__=U,$}return M.apply(s,yn([this.value()],arguments))})}),s}function qB(){return It._===this&&(It._=x3),this}function Oh(){}function YB(s){return s=be(s),Ee(function(o){return Im(o,s)})}var KB=lh(at),ZB=lh(Y0),QB=lh(Nc);function j_(s){return mh(s)?Lc(Vr(s)):IL(s)}function JB(s){return function(o){return s==null?r:ti(s,o)}}var eU=Km(),tU=Km(!0);function Fh(){return[]}function Nh(){return!1}function rU(){return{}}function nU(){return""}function iU(){return!0}function sU(s,o){if(s=be(s),s<1||s>Q)return[];var f=q,_=Ft(s,q);o=ue(o),s-=q;for(var T=Bc(_,o);++f<s;)o(f);return T}function aU(s){return ye(s)?at(s,Vr):er(s)?[s]:Ht(f_(We(s)))}function oU(s){var o=++v3;return We(s)+o}var uU=qo(function(s,o){return s+o},0),lU=ch("ceil"),cU=qo(function(s,o){return s/o},1),hU=ch("floor");function fU(s){return s&&s.length?Go(s,jt,Yc):r}function dU(s,o){return s&&s.length?Go(s,ue(o,2),Yc):r}function pU(s){return Q0(s,jt)}function gU(s,o){return Q0(s,ue(o,2))}function mU(s){return s&&s.length?Go(s,jt,Jc):r}function _U(s,o){return s&&s.length?Go(s,ue(o,2),Jc):r}var vU=qo(function(s,o){return s*o},1),yU=ch("round"),xU=qo(function(s,o){return s-o},0);function bU(s){return s&&s.length?Dc(s,jt):0}function TU(s,o){return s&&s.length?Dc(s,ue(o,2)):0}return S.after=V5,S.ary=w_,S.assign=MD,S.assignIn=D_,S.assignInWith=ou,S.assignWith=OD,S.at=FD,S.before=S_,S.bind=Th,S.bindAll=BB,S.bindKey=A_,S.castArray=rD,S.chain=x_,S.chunk=hk,S.compact=fk,S.concat=dk,S.cond=UB,S.conforms=$B,S.constant=Rh,S.countBy=b5,S.create=ND,S.curry=E_,S.curryRight=C_,S.debounce=I_,S.defaults=LD,S.defaultsDeep=kD,S.defer=X5,S.delay=j5,S.difference=pk,S.differenceBy=gk,S.differenceWith=mk,S.drop=_k,S.dropRight=vk,S.dropRightWhile=yk,S.dropWhile=xk,S.fill=bk,S.filter=w5,S.flatMap=E5,S.flatMapDeep=C5,S.flatMapDepth=I5,S.flatten=m_,S.flattenDeep=Tk,S.flattenDepth=wk,S.flip=W5,S.flow=zB,S.flowRight=HB,S.fromPairs=Sk,S.functions=HD,S.functionsIn=VD,S.groupBy=R5,S.initial=Ek,S.intersection=Ck,S.intersectionBy=Ik,S.intersectionWith=Rk,S.invert=jD,S.invertBy=WD,S.invokeMap=M5,S.iteratee=Ph,S.keyBy=O5,S.keys=At,S.keysIn=Xt,S.map=tu,S.mapKeys=YD,S.mapValues=KD,S.matches=VB,S.matchesProperty=XB,S.memoize=nu,S.merge=ZD,S.mergeWith=B_,S.method=jB,S.methodOf=WB,S.mixin=Mh,S.negate=iu,S.nthArg=YB,S.omit=QD,S.omitBy=JD,S.once=q5,S.orderBy=F5,S.over=KB,S.overArgs=Y5,S.overEvery=ZB,S.overSome=QB,S.partial=wh,S.partialRight=R_,S.partition=N5,S.pick=eB,S.pickBy=U_,S.property=j_,S.propertyOf=JB,S.pull=Fk,S.pullAll=v_,S.pullAllBy=Nk,S.pullAllWith=Lk,S.pullAt=kk,S.range=eU,S.rangeRight=tU,S.rearg=K5,S.reject=D5,S.remove=Dk,S.rest=Z5,S.reverse=xh,S.sampleSize=U5,S.set=rB,S.setWith=nB,S.shuffle=$5,S.slice=Bk,S.sortBy=H5,S.sortedUniq=Xk,S.sortedUniqBy=jk,S.split=EB,S.spread=Q5,S.tail=Wk,S.take=qk,S.takeRight=Yk,S.takeRightWhile=Kk,S.takeWhile=Zk,S.tap=f5,S.throttle=J5,S.thru=eu,S.toArray=N_,S.toPairs=$_,S.toPairsIn=G_,S.toPath=aU,S.toPlainObject=k_,S.transform=iB,S.unary=eD,S.union=Qk,S.unionBy=Jk,S.unionWith=e5,S.uniq=t5,S.uniqBy=r5,S.uniqWith=n5,S.unset=sB,S.unzip=bh,S.unzipWith=y_,S.update=aB,S.updateWith=oB,S.values=es,S.valuesIn=uB,S.without=i5,S.words=V_,S.wrap=tD,S.xor=s5,S.xorBy=a5,S.xorWith=o5,S.zip=u5,S.zipObject=l5,S.zipObjectDeep=c5,S.zipWith=h5,S.entries=$_,S.entriesIn=G_,S.extend=D_,S.extendWith=ou,Mh(S,S),S.add=uU,S.attempt=X_,S.camelCase=fB,S.capitalize=z_,S.ceil=lU,S.clamp=lB,S.clone=nD,S.cloneDeep=sD,S.cloneDeepWith=aD,S.cloneWith=iD,S.conformsTo=oD,S.deburr=H_,S.defaultTo=GB,S.divide=cU,S.endsWith=dB,S.eq=Or,S.escape=pB,S.escapeRegExp=gB,S.every=T5,S.find=S5,S.findIndex=p_,S.findKey=DD,S.findLast=A5,S.findLastIndex=g_,S.findLastKey=BD,S.floor=hU,S.forEach=b_,S.forEachRight=T_,S.forIn=UD,S.forInRight=$D,S.forOwn=GD,S.forOwnRight=zD,S.get=Eh,S.gt=uD,S.gte=lD,S.has=XD,S.hasIn=Ch,S.head=__,S.identity=jt,S.includes=P5,S.indexOf=Ak,S.inRange=cB,S.invoke=qD,S.isArguments=ii,S.isArray=ye,S.isArrayBuffer=cD,S.isArrayLike=Vt,S.isArrayLikeObject=gt,S.isBoolean=hD,S.isBuffer=En,S.isDate=fD,S.isElement=dD,S.isEmpty=pD,S.isEqual=gD,S.isEqualWith=mD,S.isError=Sh,S.isFinite=_D,S.isFunction=nn,S.isInteger=P_,S.isLength=su,S.isMap=M_,S.isMatch=vD,S.isMatchWith=yD,S.isNaN=xD,S.isNative=bD,S.isNil=wD,S.isNull=TD,S.isNumber=O_,S.isObject=ct,S.isObjectLike=dt,S.isPlainObject=Ks,S.isRegExp=Ah,S.isSafeInteger=SD,S.isSet=F_,S.isString=au,S.isSymbol=er,S.isTypedArray=Ji,S.isUndefined=AD,S.isWeakMap=ED,S.isWeakSet=CD,S.join=Pk,S.kebabCase=mB,S.last=mr,S.lastIndexOf=Mk,S.lowerCase=_B,S.lowerFirst=vB,S.lt=ID,S.lte=RD,S.max=fU,S.maxBy=dU,S.mean=pU,S.meanBy=gU,S.min=mU,S.minBy=_U,S.stubArray=Fh,S.stubFalse=Nh,S.stubObject=rU,S.stubString=nU,S.stubTrue=iU,S.multiply=vU,S.nth=Ok,S.noConflict=qB,S.noop=Oh,S.now=ru,S.pad=yB,S.padEnd=xB,S.padStart=bB,S.parseInt=TB,S.random=hB,S.reduce=L5,S.reduceRight=k5,S.repeat=wB,S.replace=SB,S.result=tB,S.round=yU,S.runInContext=P,S.sample=B5,S.size=G5,S.snakeCase=AB,S.some=z5,S.sortedIndex=Uk,S.sortedIndexBy=$k,S.sortedIndexOf=Gk,S.sortedLastIndex=zk,S.sortedLastIndexBy=Hk,S.sortedLastIndexOf=Vk,S.startCase=CB,S.startsWith=IB,S.subtract=xU,S.sum=bU,S.sumBy=TU,S.template=RB,S.times=sU,S.toFinite=sn,S.toInteger=be,S.toLength=L_,S.toLower=PB,S.toNumber=_r,S.toSafeInteger=PD,S.toString=We,S.toUpper=MB,S.trim=OB,S.trimEnd=FB,S.trimStart=NB,S.truncate=LB,S.unescape=kB,S.uniqueId=oU,S.upperCase=DB,S.upperFirst=Ih,S.each=b_,S.eachRight=T_,S.first=__,Mh(S,function(){var s={};return zr(S,function(o,f){Ye.call(S.prototype,f)||(s[f]=o)}),s}(),{chain:!1}),S.VERSION=n,hr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){S[s].placeholder=S}),hr(["drop","take"],function(s,o){Oe.prototype[s]=function(f){f=f===r?1:xt(be(f),0);var _=this.__filtered__&&!o?new Oe(this):this.clone();return _.__filtered__?_.__takeCount__=Ft(f,_.__takeCount__):_.__views__.push({size:Ft(f,q),type:s+(_.__dir__<0?"Right":"")}),_},Oe.prototype[s+"Right"]=function(f){return this.reverse()[s](f).reverse()}}),hr(["filter","map","takeWhile"],function(s,o){var f=o+1,_=f==G||f==se;Oe.prototype[s]=function(T){var A=this.clone();return A.__iteratees__.push({iteratee:ue(T,3),type:f}),A.__filtered__=A.__filtered__||_,A}}),hr(["head","last"],function(s,o){var f="take"+(o?"Right":"");Oe.prototype[s]=function(){return this[f](1).value()[0]}}),hr(["initial","tail"],function(s,o){var f="drop"+(o?"":"Right");Oe.prototype[s]=function(){return this.__filtered__?new Oe(this):this[f](1)}}),Oe.prototype.compact=function(){return this.filter(jt)},Oe.prototype.find=function(s){return this.filter(s).head()},Oe.prototype.findLast=function(s){return this.reverse().find(s)},Oe.prototype.invokeMap=Ee(function(s,o){return typeof s=="function"?new Oe(this):this.map(function(f){return Vs(f,s,o)})}),Oe.prototype.reject=function(s){return this.filter(iu(ue(s)))},Oe.prototype.slice=function(s,o){s=be(s);var f=this;return f.__filtered__&&(s>0||o<0)?new Oe(f):(s<0?f=f.takeRight(-s):s&&(f=f.drop(s)),o!==r&&(o=be(o),f=o<0?f.dropRight(-o):f.take(o-s)),f)},Oe.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},Oe.prototype.toArray=function(){return this.take(q)},zr(Oe.prototype,function(s,o){var f=/^(?:filter|find|map|reject)|While$/.test(o),_=/^(?:head|last)$/.test(o),T=S[_?"take"+(o=="last"?"Right":""):o],A=_||/^find/.test(o);T&&(S.prototype[o]=function(){var C=this.__wrapped__,R=_?[1]:arguments,M=C instanceof Oe,U=R[0],$=M||ye(C),H=function(Pe){var Le=T.apply(S,yn([Pe],R));return _&&K?Le[0]:Le};$&&f&&typeof U=="function"&&U.length!=1&&(M=$=!1);var K=this.__chain__,re=!!this.__actions__.length,le=A&&!K,we=M&&!re;if(!A&&$){C=we?C:new Oe(this);var ce=s.apply(C,R);return ce.__actions__.push({func:eu,args:[H],thisArg:r}),new dr(ce,K)}return le&&we?s.apply(this,R):(ce=this.thru(H),le?_?ce.value()[0]:ce.value():ce)})}),hr(["pop","push","shift","sort","splice","unshift"],function(s){var o=Eo[s],f=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",_=/^(?:pop|shift)$/.test(s);S.prototype[s]=function(){var T=arguments;if(_&&!this.__chain__){var A=this.value();return o.apply(ye(A)?A:[],T)}return this[f](function(C){return o.apply(ye(C)?C:[],T)})}}),zr(Oe.prototype,function(s,o){var f=S[o];if(f){var _=f.name+"";Ye.call(qi,_)||(qi[_]=[]),qi[_].push({name:o,func:f})}}),qi[Wo(r,x).name]=[{name:"wrapper",func:r}],Oe.prototype.clone=k3,Oe.prototype.reverse=D3,Oe.prototype.value=B3,S.prototype.at=d5,S.prototype.chain=p5,S.prototype.commit=g5,S.prototype.next=m5,S.prototype.plant=v5,S.prototype.reverse=y5,S.prototype.toJSON=S.prototype.valueOf=S.prototype.value=x5,S.prototype.first=S.prototype.head,Ds&&(S.prototype[Ds]=_5),S},Xi=g3();Kn?((Kn.exports=Xi)._=Xi,Pc._=Xi):It._=Xi}).call(Et)}(vo,vo.exports);var d0=vo.exports;const fF={isPlaying:!1,progress:0,speed:1,isMuted:!1,isWaiting:!1,loaded:!1,size:{width:50,height:50},isDragging:!1,totalFrames:0,totalDuration:0},dF=te.forwardRef((t,e)=>{const[r,n]=te.useState([]),[,i]=te.useState(0),[a,u]=te.useState([]),[,l]=j.useState(!1),[h,p]=rF({autoPlay:!1}),m=j.useRef(null),c=j.useRef(null),d=j.useRef(fF),g=j.useRef(),{tl:v,dragModeRef:y}=j.useContext(on),{frames:b,delays:x}=h,{src:E,startAt:w,endAt:I,frameStartAt:O,frameEndAt:F,loop:N,visible:L,disabled:D,transformation:{width:V=0,height:Y=0,x:ie,y:X,colorCorrection:G={}},pointerdown:ae}=t,{temperatureFilter:se,sharpnessFilter:z,hueFilter:Q,blurFilter:ge,adjustmentFilter:W,vignetteFilter:q,noiseFilter:he}=Xn(G),{blurRadius:fe=0,vignette:me=0,noise:Te=0}=G,Ce=.1;cF(E,p),ht(Ze.PAUSE,()=>{m.current&&(m.current.stop(),d.current.isPlaying=!1)}),ht(Ze.SEEK_END,()=>{m.current&&(m.current.stop(),d.current.isPlaying=!1)}),ht(Ze.SCRUBBER_CLICKED,()=>{m.current&&(m.current.stop(),d.current.isPlaying=!1)}),te.useEffect(()=>{d.current&&m.current&&(y.current?(m.current.stop(),d.current.isPlaying=!1,d.current.isDragging=!0):d.current.isDragging=!1)},[y]),te.useEffect(()=>{if(!ss(b)){const pe=OO(b,oe=>{const{data:Ne,width:Kt,height:zt}=oe,ft=new Uint8Array(Ne);return $t.Texture.fromBuffer(ft,Kt,zt)}),ve=pe.map((oe,Ne)=>({texture:oe,time:x[Ne]}));n(pe),u(ve);let st=0;x.forEach(oe=>{st+=oe*10}),i(st),d.current.totalDuration=st,d.current.totalFrames=b.length}},[b,x]);const Ue=d0.debounce(pe=>{if(m.current){let ve=pe===0?0:pe/Ce;ve=isNaN(ve)?0:ve;const st=d.current.totalFrames;ve=ve>st?st:ve,ve>=st?(m.current.gotoAndStop(0),d.current.isPlaying=!1):(m.current.gotoAndPlay(ve||0),d.current.isPlaying=!0)}},20),He=d0.debounce(()=>{m.current&&(m.current.stop(),d.current.isPlaying=!1)},50),Re=pe=>{if(m.current){let ve=pe===0?0:pe/Ce;ve=isNaN(ve)?0:ve;const st=d.current.totalFrames;ve=ve>st?st:ve,ve>=st?(m.current.gotoAndStop(0),d.current.isPlaying=!1):(m.current.gotoAndPlay(ve||0),d.current.isPlaying=!0)}},xe=()=>{m.current&&(m.current.stop(),d.current.isPlaying=!1)},Ae=()=>{m.current&&(m.current.stop(),d.current.isPlaying=!1)},$e=pe=>{var st;const ve=pe+((st=g.current)==null?void 0:st.time());m.current&&y.current?(Ue(ve),He(),d.current.isPlaying=!1):g.current&&m.current&&!d.current.isPlaying&&g.current.isActive()&&v.current.isActive()&&(Ue(ve),d.current.isPlaying=!0)},Ke=()=>{l(!0)};return j.useEffect(()=>{let pe=ee.context(()=>{});if(c.current&&v.current){const ve={duration:Number(F)-Number(O),onStart:Re,onComplete:xe,onStartParams:[O,F],onCompleteParams:[],onInterrupt:Ae,onUpdate:$e,onUpdateParams:[O,F]};g.current&&g.current.kill(),pe=ee.context(()=>{g.current=ee.from(c.current,ve,O),v.current.add(g.current,w)})}return()=>{g.current&&(g.current.kill(),ee.killTweensOf(g.current)),pe.revert()}},[w,I,O,F]),Se.jsx(Pn,{...t,ref:e,ignoreTlForVideo:!0,isGif:!0,children:Se.jsx(De.Container,{ref:c,children:r&&r.length>0&&Se.jsx(f0,{x:ie,y:X,width:V,height:Y,animationSpeed:1,alpha:L?1:0,loop:N,textures:a,onComplete:Ke,anchor:.5,forwardRef:m,...!D&&L&&{interactive:!0,pointerdown:ae},filters:[se,z,Q,W,...fe>0?[ge]:[],...me>0?[q]:[],...Te>0?[he]:[]]})})})}),pF=te.forwardRef((t,e)=>{const n=j.useRef(null),i=j.useRef(0),a=j.useRef(null),u=j.useRef(null),l=j.useRef(16),h=j.useRef(null),{visible:p,text:m,disabled:c,transformation:d,pointerdown:g,onDobuleClick:v}=t,{x:y,y:b,fontFamily:x="Arial",fontWeight:E="normal",fontStyle:w="normal",fontSize:I=16,fontVariant:O="normal",fill:F="black",stroke:N,strokeThickness:L=0,blurRadius:D=0,blurEnabled:V=!1,dropShadowColor:Y=null,dropShadow:ie=!1,dropShadowBlur:X=0,wordWrapWidth:G=5e7,leading:ae=0,letterSpacing:se,colorCorrection:z={}}=d,{temperatureFilter:Q,sharpnessFilter:ge,hueFilter:W,blurFilter:q,adjustmentFilter:he}=Xn(z),{blurRadius:fe=0}=z;te.useEffect(()=>{l.current=Number(I)},[I]);const me=["italic","oblique"].includes(w)?w:void 0,Te=["small-caps"].includes(O),Ce=["bold","bolder","lighter","100","200","300"].includes(E)?E:void 0,Ue=Number(se)>0?se:void 0,He=te.useMemo(()=>new $t.TextStyle({fontFamily:x,fontSize:I,fill:F||"white",...N&&L>0&&{stroke:N,strokeThickness:L},...me&&{fontStyle:me},...Te&&{fontVariant:Te},...Ce&&{fontWeight:Ce},...Ue&&{letterSpacing:Ue},...V&&{dropShadow:!0,dropShadowBlur:Number(D),dropShadowColor:(Y==null?void 0:Y.toString())||"black",dropShadowAngle:.5235987755982988,dropShadowDistance:5},...ie&&{dropShadow:!0,dropShadowBlur:Number(X),dropShadowColor:(Y==null?void 0:Y.toString())||"black",dropShadowAngle:.5235987755982988,dropShadowDistance:5},wordWrap:!0,breakWords:!0,wordWrapWidth:G||500,leading:ae||0}),[V,D,F,x,I,w,ae,me,Ce,Te,Ue,Y,N,L,G,ie,X]);te.useEffect(()=>{h.current={...d}},[d]);const Re=()=>{const Ae=new Date().getTime();Ae-i.current<300&&v?v():g&&g(),i.current=Ae},xe=()=>{!c&&v&&v()};return Se.jsx(Pn,{...t,ref:e,isText:!0,onDoubleClick:xe,children:Se.jsx(De.Container,{ref:n,children:Se.jsx(De.Container,{alpha:1,ref:u,children:Se.jsx(De.Text,{style:He,x:y,y:b,anchor:.5,text:m,alpha:p?1:0,...p&&!c&&{interactive:!0,buttonMode:!0,pointerdown:Re},ref:a,filters:[Q,ge,W,he,...fe>0?[q]:[]]})})})})});var gF=Nr,mF=function(){return gF.Date.now()},_F=mF,vF=/\s/;function yF(t){for(var e=t.length;e--&&vF.test(t.charAt(e)););return e}var xF=yF,bF=xF,TF=/^\s+/;function wF(t){return t&&t.slice(0,bF(t)+1).replace(TF,"")}var SF=wF,AF=SF,p0=ns,EF=fo,g0=0/0,CF=/^[-+]0x[0-9a-f]+$/i,IF=/^0b[01]+$/i,RF=/^0o[0-7]+$/i,PF=parseInt;function MF(t){if(typeof t=="number")return t;if(EF(t))return g0;if(p0(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=p0(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=AF(t);var r=IF.test(t);return r||RF.test(t)?PF(t.slice(2),r?2:8):CF.test(t)?g0:+t}var OF=MF,FF=ns,hc=_F,m0=OF,NF="Expected a function",LF=Math.max,kF=Math.min;function DF(t,e,r){var n,i,a,u,l,h,p=0,m=!1,c=!1,d=!0;if(typeof t!="function")throw new TypeError(NF);e=m0(e)||0,FF(r)&&(m=!!r.leading,c="maxWait"in r,a=c?LF(m0(r.maxWait)||0,e):a,d="trailing"in r?!!r.trailing:d);function g(F){var N=n,L=i;return n=i=void 0,p=F,u=t.apply(L,N),u}function v(F){return p=F,l=setTimeout(x,e),m?g(F):u}function y(F){var N=F-h,L=F-p,D=e-N;return c?kF(D,a-L):D}function b(F){var N=F-h,L=F-p;return h===void 0||N>=e||N<0||c&&L>=a}function x(){var F=hc();if(b(F))return E(F);l=setTimeout(x,y(F))}function E(F){return l=void 0,d&&n?g(F):(n=i=void 0,u)}function w(){l!==void 0&&clearTimeout(l),p=0,n=h=i=l=void 0}function I(){return l===void 0?u:E(hc())}function O(){var F=hc(),N=b(F);if(n=arguments,i=this,h=F,N){if(l===void 0)return v(h);if(c)return clearTimeout(l),l=setTimeout(x,e),g(h)}return l===void 0&&(l=setTimeout(x,e)),u}return O.cancel=w,O.flush=I,O}var BF=DF;const yo=Cn(BF),fc=(t,e,r,n)=>{const i=j.useCallback(yo(t,n),[t,n]),a=j.useCallback(yo(e,n),[e,n]),u=j.useCallback(yo(r,n),[r,n]),l=j.useCallback(()=>{i()},[i]),h=j.useCallback(()=>{a()},[a]),p=j.useCallback(()=>{u()},[u]);return{onPointerOver:l,onPointerDown:h,onPointerOut:p}},UF={isPlaying:!1,progress:0,speed:1,isMuted:!1,isWaiting:!1,isStalled:!1,loaded:!1,size:{width:50,height:50},isDragging:!1,timeDiff:0},_0=te.forwardRef((t,e)=>{const[r,n]=te.useState(0),[i,a]=te.useState(),u=j.useRef(null),l=j.useRef(null),h=j.useRef(null),p=j.useRef(UF),m=j.useRef(),{uniqueId:c,mute:d=!1,src:g,startAt:v,endAt:y,frameStartAt:b,frameEndAt:x,visible:E,disabled:w,transformation:{x:I,y:O,width:F,height:N,animation:L,colorCorrection:D={}},pointerdown:V=()=>{},pointerout:Y=()=>{},pointerover:ie=()=>{},fps:X=0}=t,{tl:G,dragModeRef:ae,isRemotion:se}=j.useContext(on),{onPointerDown:z,onPointerOut:Q,onPointerOver:ge}=fc(ie,V,Y,1),{blurRadius:W=0,vignette:q=0,noise:he=0}=D,{temperatureFilter:fe,sharpnessFilter:me,hueFilter:Te,blurFilter:Ce,adjustmentFilter:Ue,vignetteFilter:He,noiseFilter:Re}=Xn(D),xe=g||"",Ae=te.useMemo(()=>{const oe=document.createElement("video");return oe.src=g,oe.crossOrigin="Anonymus",oe.autoplay=!1,oe.currentTime=b===0?.001:b,oe},[g,b]);ht(Ze.PAUSE,()=>{h.current&&(h.current.pause(),p.current.isPlaying=!1)}),ht(Ze.SCRUBBER_CLICKED,()=>{h.current&&(h.current.pause(),p.current.isPlaying=!1)}),ht(Ze.REVERSE_MODE_END,()=>{h.current&&(h.current.pause(),p.current.isPlaying=!1)});const $e=te.useCallback(yo(()=>{if(h.current){const oe=h.current;oe.currentTime>0&&!oe.paused&&!oe.ended&&oe.readyState>oe.HAVE_CURRENT_DATA&&h.current.pause(),p.current.isPlaying=!1}},400),[h]);te.useEffect(()=>{h.current&&!se?(ae.current?($e(),p.current.isPlaying=!1,p.current.isDragging=!0):p.current.isDragging=!1,h.current.muted=d):p.current.isDragging=!1,p.current.isMuted=d},[d,ae,$e,h]);const Ke=oe=>{if(h.current){if(h.current.currentTime=Number(oe),!ae.current){const Ne=h.current,Kt=Ne.currentTime>0&&!Ne.paused&&!Ne.ended&&Ne.readyState>Ne.HAVE_CURRENT_DATA;G.current&&G.current.isActive()&&m.current&&m.current.isActive()&&(Kt||h.current.play(),p.current.isPlaying=!0,n(zt=>zt+1))}p.current.progress=0}},pe=()=>{if(h.current){const oe=h.current;oe.currentTime>0&&!oe.paused&&!oe.ended&&oe.readyState>oe.HAVE_CURRENT_DATA&&h.current.pause(),p.current.isPlaying=!1,m.current&&(p.current.progress=m.current.progress())}},ve=()=>{},st=()=>{var oe,Ne;if(m.current&&(p.current.progress=m.current.progress()),h.current&&m.current){const Kt=b+((oe=m==null?void 0:m.current)==null?void 0:oe.time()),zt=Math.abs(h.current.currentTime-Kt),ft=h.current,lr=ft.currentTime>0&&!ft.paused&&!ft.ended&&ft.readyState>ft.HAVE_CURRENT_DATA;ae.current?(h.current.currentTime=Kt,setTimeout(()=>{h.current&&h.current.play().then(()=>{p.current.isPlaying=!1,h.current&&h.current.pause()})},100),p.current.isPlaying=!1):(lr!==p.current.isPlaying||!lr)&&p.current.progress>.01&&p.current.progress<.99?(Ne=G.current)!=null&&Ne.isActive()&&m.current&&m.current.isActive()&&(lr||h.current.play(),p.current.isPlaying=!0):zt>.3&&p.current.progress>.01&&p.current.progress<.99&&(h.current.currentTime=Kt)}};return j.useEffect(()=>{let oe=ee.context(()=>{});if(l.current&&G.current){const Ne={duration:Number(x)-Number(b),onStart:Ke,onComplete:pe,onStartParams:[b,x],onCompleteParams:[],onInterrupt:ve,onUpdate:st,onUpdateParams:[b,x],onPause:()=>{console.log("onPause video sprite pause",c)},onResume:()=>{console.log("onResume video sprite resume",c)},onReverseComplete:()=>{console.log("onReverseComplete video sprite reverse complete",c)},onKill:()=>{console.log("onKill video sprite kill",c)}};oe=ee.context(()=>{m.current=ee.from(l.current,Ne,b),G.current.add(m.current,v)})}return()=>{m.current&&(m.current.kill(),ee.killTweensOf(m.current)),oe.revert()}},[L,v,y,b,x]),te.useEffect(()=>{h.current&&(h.current.muted=d,p.current.isMuted=d);const oe=setTimeout(()=>{h.current&&(h.current.muted=d,p.current.isMuted=d)},1500);return()=>{clearTimeout(oe)}},[d]),te.useEffect(()=>{const oe=Math.round((Number(b)+Number.EPSILON)*100)/100,Ne=function(){h.current&&(h.current.currentTime=oe,h.current.muted=d)},Kt=function(){if(h.current){const Rr=h.current;Rr.currentTime>0&&!Rr.paused&&!Rr.ended&&Rr.readyState>Rr.HAVE_CURRENT_DATA&&h.current.pause()}p.current.isWaiting=!1,p.current.isStalled=!1},zt=function(){h.current&&h.current.pause(),p.current.isWaiting=!0,p.current.isStalled=!1},ft=function(){p.current.isWaiting=!1,p.current.isStalled=!1},lr=function(){p.current.isWaiting=!1,p.current.isStalled=!0},Bi=Math.round((Number(b)+Number.EPSILON)*100)/100,dc=Math.round((Number(x)+Number.EPSILON)*100)/100,Yn=`${xe}#t=${Bi},${dc}`;return $t.Texture.fromLoader(Ae,Yn,c,{pixiIdPrefix:c,resourceOptions:{autoPlay:!1,crossorigin:"Anonymus",updateFPS:X?Math.max(120,Number(X)):30}}).then(Rr=>{Rr&&(a(Rr),h.current=Rr.baseTexture.resource.source,h.current.id=c,h.current.addEventListener("loadedmetadata",Ne),h.current.addEventListener("ended",Kt),h.current.addEventListener("loadstart",zt),h.current.addEventListener("canplaythrough",ft),h.current.addEventListener("stalled",lr))}),()=>{h.current&&(h.current.pause(),h.current.removeEventListener("loadedmetadata",Ne),h.current.removeEventListener("ended",Kt),h.current.removeEventListener("loadstart",zt),h.current.removeEventListener("canplaythrough",ft),h.current.removeEventListener("stalled",lr))}},[xe,c,b,x,Ae]),te.useEffect(()=>{const oe=setTimeout(()=>{i&&m.current&&G.current&&m.current.progress()<.1&&h.current&&!m.current.isActive()&&!se&&h.current.play().then(()=>{p.current.isPlaying=!1,h.current&&h.current.pause()})},30);return()=>{clearTimeout(oe)}},[i]),te.useEffect(()=>{G.current&&!G.current.isActive()&&!se&&(p.current.isPlaying=!1,h.current&&h.current.pause());const oe=setTimeout(()=>{if(i&&G.current&&r>0&&!se){G.current.isActive()||(p.current.isPlaying=!1,h.current&&h.current.pause());const Ne=h.current;Ne&&G.current.isActive()&&m.current&&m.current.isActive()&&(Ne.currentTime>0&&!Ne.paused&&!Ne.ended&&Ne.readyState>Ne.HAVE_CURRENT_DATA||h.current.play(),p.current.isPlaying=!0)}},10);return()=>{clearTimeout(oe)}},[r,i]),Se.jsx(Pn,{...t,ref:e,ignoreTlForVideo:!0,pointerdown:z,pointerover:ge,pointerout:Q,children:Se.jsx(De.Container,{ref:l,children:i&&Se.jsx(De.Sprite,{texture:i,width:F,height:N,anchor:.5,x:I,y:O,ref:u,alpha:E?1:0,...!w&&E&&{interactive:!0,pointerdown:V},filters:[fe,me,Te,Ue,...W>0?[Ce]:[],...q>0?[He]:[],...he>0?[Re]:[]]})})})});_0.whyDidYouRender={logOnDifferentValues:!0,customName:"PixiVideoSprite"};const $F=te.forwardRef((t,e)=>{const[r,n]=te.useState(),i=j.useRef(null),a=j.useRef(null),{visible:u,disabled:l,transformation:{x:h,y:p,width:m,height:c,colorCorrection:d={}},pointerdown:g=()=>{},pointerout:v=()=>{},pointerover:y=()=>{},canvasImageRef:b}=t,x=b&&(b==null?void 0:b.getCanvas()),E=De.useApp(),{onPointerDown:w,onPointerOut:I,onPointerOver:O}=fc(y,g,v,1),{blurRadius:F=0,vignette:N=0,noise:L=0}=d,{temperatureFilter:D,sharpnessFilter:V,hueFilter:Y,blurFilter:ie,adjustmentFilter:X,vignetteFilter:G,noiseFilter:ae}=Xn(d);return De.useTick(()=>{if(i.current&&i.current.texture){const se=i.current.texture.baseTexture;se&&se.update(),a.current&&E.renderer.render(a.current)}}),te.useEffect(()=>{if(!ss(x)){const se=$t.Texture.from(x);n(se)}},[x]),Se.jsx(Pn,{...t,ref:e,ignoreTlForVideo:!0,pointerdown:w,pointerover:O,pointerout:I,children:Se.jsx(De.Container,{ref:a,children:r&&Se.jsx(De.Sprite,{texture:r,width:m,height:c,anchor:.5,x:h,y:p,ref:i,alpha:u?1:0,...!l&&u&&{interactive:!0,pointerdown:g},filters:[D,V,Y,X,...F>0?[ie]:[],...N>0?[G]:[],...L>0?[ae]:[]]})})})}),GF=t=>{const{startAt:e,endAt:r,uniqueId:n}=t,i=j.useRef(null),a=j.useRef(null),u=j.useRef(null),l=j.useRef(null),h=j.useRef(!1),{tl:p,totalDuration:m=0,reverseModeRef:c}=j.useContext(on),d=e<.2?"static":"none",g=j.useRef(1);ht(Ze.COMPLETE,()=>{i.current&&(i.current.eventMode=d)}),ht(Ze.REVERSE_MODE_END,()=>{if(p.current){const y=p.current.time();y>e&&y<r?(a.current&&(a.current.alpha=1),i.current&&(i.current.alpha=1,i.current.eventMode="static")):(a.current&&(a.current.alpha=0),i.current&&(i.current.alpha=0,i.current.eventMode="none"))}});const v=()=>{if(c.current&&l.current&&p.current){h.current=!0;const y=p.current.time();y>e&&y<r?(a.current&&(a.current.alpha=1),i.current&&(i.current.alpha=1)):(a.current&&(a.current.alpha=0),i.current&&(i.current.alpha=0))}};return ht(Ze.COMPLETE,()=>{}),te.useEffect(()=>{const y=ee.context(()=>{if(i.current&&p.current){const b=ee.to(i.current,{alpha:1,duration:.1});l.current=ee.to(a.current,{alpha:1,duration:Number(r)-Number(e),onStart:()=>{i.current&&(i.current.alpha=1,i.current.eventMode="static",g.current=1)},onUpdate:v,onComplete:()=>{i.current&&(i.current.alpha=0,i.current.eventMode="none",g.current=0)}}),p.current.add([b,l.current],e)}});return()=>{l.current&&(p.current.remove(l.current),l.current.progress(0).kill()),y.revert()}},[e,r,m,n]),Se.jsx(De.Container,{ref:i,alpha:e<.2?1:0,eventMode:e<.2?"static":"none",children:Se.jsx(De.Container,{ref:u,children:Se.jsx(De.Container,{ref:a,alpha:1,children:t.children})})})},zF=t=>{const{startAt:e,endAt:r}=t,{setTotalDuration:n}=j.useContext(on);return te.useEffect(()=>{n&&n(Number(r)+.2)},[e,r]),t.children},HF=te.forwardRef((t,e)=>{const[r,n]=te.useState(),i=j.useRef(null),a=j.useRef(null),{visible:u,disabled:l,transformation:{x:h,y:p,width:m,height:c,colorCorrection:d={}},pointerdown:g=()=>{},pointerout:v=()=>{},pointerover:y=()=>{},canvasImageRef:b}=t,x=b&&(b==null?void 0:b.getCanvas()),E=De.useApp(),{onPointerDown:w,onPointerOut:I,onPointerOver:O}=fc(y,g,v,1),{blurRadius:F=0,vignette:N=0,noise:L=0}=d,{temperatureFilter:D,sharpnessFilter:V,hueFilter:Y,blurFilter:ie,adjustmentFilter:X,vignetteFilter:G,noiseFilter:ae}=Xn(d);return De.useTick(()=>{if(i.current&&i.current.texture){const se=i.current.texture.baseTexture;se&&se.update(),a.current&&E.renderer.render(a.current)}}),te.useEffect(()=>{if(!ss(x)){const se=$t.Texture.from(x);n(se)}},[x]),Se.jsx(Pn,{...t,ref:e,ignoreTlForVideo:!0,pointerdown:w,pointerover:O,pointerout:I,children:Se.jsx(De.Container,{ref:a,children:r&&Se.jsx(De.Sprite,{texture:r,width:m,height:c,anchor:.5,x:h,y:p,ref:i,alpha:u?1:0,...!l&&u&&{interactive:!0,pointerdown:g},filters:[D,V,Y,X,...F>0?[ie]:[],...N>0?[G]:[],...L>0?[ae]:[]]})})})});var v0=(t=>(t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t))(v0||{});Xe.Animations=Ru,Xe.BlendModes=v0,Xe.Events=Ze,Xe.GsapPixieContext=on,Xe.GsapPixieContextProvider=av,Xe.PixiAnimatedSprite=f0,Xe.PixiAudioSprite=oP,Xe.PixiGifSprite=dF,Xe.PixiImageSprite=Rg,Xe.PixiRemotionSprite=HF,Xe.PixiSequence=GF,Xe.PixiSequenceWrapper=zF,Xe.PixiSvgPathSprite=aP,Xe.PixiTextSprite=pF,Xe.PixiVideoCanvasSyncSprite=$F,Xe.PixiVideoSprite=_0,Xe.emitCustomEvent=si,Xe.newCustomEventEmitter=sv,Xe.useCustomEventListener=ht,Xe.useGsapEffect=Wf,Object.defineProperty(Xe,Symbol.toStringTag,{value:"Module"})});
|
|
1990
|
+
*/(function(){HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(r){var i=this;if(!i.ctx||!i.ctx.listener)return i;for(var n=i._howls.length-1;n>=0;n--)i._howls[n].stereo(r);return i},HowlerGlobal.prototype.pos=function(r,i,n){var s=this;if(!s.ctx||!s.ctx.listener)return s;if(i=typeof i!="number"?s._pos[1]:i,n=typeof n!="number"?s._pos[2]:n,typeof r=="number")s._pos=[r,i,n],typeof s.ctx.listener.positionX<"u"?(s.ctx.listener.positionX.setTargetAtTime(s._pos[0],Howler.ctx.currentTime,.1),s.ctx.listener.positionY.setTargetAtTime(s._pos[1],Howler.ctx.currentTime,.1),s.ctx.listener.positionZ.setTargetAtTime(s._pos[2],Howler.ctx.currentTime,.1)):s.ctx.listener.setPosition(s._pos[0],s._pos[1],s._pos[2]);else return s._pos;return s},HowlerGlobal.prototype.orientation=function(r,i,n,s,a,o){var u=this;if(!u.ctx||!u.ctx.listener)return u;var c=u._orientation;if(i=typeof i!="number"?c[1]:i,n=typeof n!="number"?c[2]:n,s=typeof s!="number"?c[3]:s,a=typeof a!="number"?c[4]:a,o=typeof o!="number"?c[5]:o,typeof r=="number")u._orientation=[r,i,n,s,a,o],typeof u.ctx.listener.forwardX<"u"?(u.ctx.listener.forwardX.setTargetAtTime(r,Howler.ctx.currentTime,.1),u.ctx.listener.forwardY.setTargetAtTime(i,Howler.ctx.currentTime,.1),u.ctx.listener.forwardZ.setTargetAtTime(n,Howler.ctx.currentTime,.1),u.ctx.listener.upX.setTargetAtTime(s,Howler.ctx.currentTime,.1),u.ctx.listener.upY.setTargetAtTime(a,Howler.ctx.currentTime,.1),u.ctx.listener.upZ.setTargetAtTime(o,Howler.ctx.currentTime,.1)):u.ctx.listener.setOrientation(r,i,n,s,a,o);else return c;return u},Howl.prototype.init=function(r){return function(i){var n=this;return n._orientation=i.orientation||[1,0,0],n._stereo=i.stereo||null,n._pos=i.pos||null,n._pannerAttr={coneInnerAngle:typeof i.coneInnerAngle<"u"?i.coneInnerAngle:360,coneOuterAngle:typeof i.coneOuterAngle<"u"?i.coneOuterAngle:360,coneOuterGain:typeof i.coneOuterGain<"u"?i.coneOuterGain:0,distanceModel:typeof i.distanceModel<"u"?i.distanceModel:"inverse",maxDistance:typeof i.maxDistance<"u"?i.maxDistance:1e4,panningModel:typeof i.panningModel<"u"?i.panningModel:"HRTF",refDistance:typeof i.refDistance<"u"?i.refDistance:1,rolloffFactor:typeof i.rolloffFactor<"u"?i.rolloffFactor:1},n._onstereo=i.onstereo?[{fn:i.onstereo}]:[],n._onpos=i.onpos?[{fn:i.onpos}]:[],n._onorientation=i.onorientation?[{fn:i.onorientation}]:[],r.call(this,i)}}(Howl.prototype.init),Howl.prototype.stereo=function(r,i){var n=this;if(!n._webAudio)return n;if(n._state!=="loaded")return n._queue.push({event:"stereo",action:function(){n.stereo(r,i)}}),n;var s=typeof Howler.ctx.createStereoPanner>"u"?"spatial":"stereo";if(typeof i>"u")if(typeof r=="number")n._stereo=r,n._pos=[r,0,0];else return n._stereo;for(var a=n._getSoundIds(i),o=0;o<a.length;o++){var u=n._soundById(a[o]);if(u)if(typeof r=="number")u._stereo=r,u._pos=[r,0,0],u._node&&(u._pannerAttr.panningModel="equalpower",(!u._panner||!u._panner.pan)&&e(u,s),s==="spatial"?typeof u._panner.positionX<"u"?(u._panner.positionX.setValueAtTime(r,Howler.ctx.currentTime),u._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),u._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):u._panner.setPosition(r,0,0):u._panner.pan.setValueAtTime(r,Howler.ctx.currentTime)),n._emit("stereo",u._id);else return u._stereo}return n},Howl.prototype.pos=function(r,i,n,s){var a=this;if(!a._webAudio)return a;if(a._state!=="loaded")return a._queue.push({event:"pos",action:function(){a.pos(r,i,n,s)}}),a;if(i=typeof i!="number"?0:i,n=typeof n!="number"?-.5:n,typeof s>"u")if(typeof r=="number")a._pos=[r,i,n];else return a._pos;for(var o=a._getSoundIds(s),u=0;u<o.length;u++){var c=a._soundById(o[u]);if(c)if(typeof r=="number")c._pos=[r,i,n],c._node&&((!c._panner||c._panner.pan)&&e(c,"spatial"),typeof c._panner.positionX<"u"?(c._panner.positionX.setValueAtTime(r,Howler.ctx.currentTime),c._panner.positionY.setValueAtTime(i,Howler.ctx.currentTime),c._panner.positionZ.setValueAtTime(n,Howler.ctx.currentTime)):c._panner.setPosition(r,i,n)),a._emit("pos",c._id);else return c._pos}return a},Howl.prototype.orientation=function(r,i,n,s){var a=this;if(!a._webAudio)return a;if(a._state!=="loaded")return a._queue.push({event:"orientation",action:function(){a.orientation(r,i,n,s)}}),a;if(i=typeof i!="number"?a._orientation[1]:i,n=typeof n!="number"?a._orientation[2]:n,typeof s>"u")if(typeof r=="number")a._orientation=[r,i,n];else return a._orientation;for(var o=a._getSoundIds(s),u=0;u<o.length;u++){var c=a._soundById(o[u]);if(c)if(typeof r=="number")c._orientation=[r,i,n],c._node&&(c._panner||(c._pos||(c._pos=a._pos||[0,0,-.5]),e(c,"spatial")),typeof c._panner.orientationX<"u"?(c._panner.orientationX.setValueAtTime(r,Howler.ctx.currentTime),c._panner.orientationY.setValueAtTime(i,Howler.ctx.currentTime),c._panner.orientationZ.setValueAtTime(n,Howler.ctx.currentTime)):c._panner.setOrientation(r,i,n)),a._emit("orientation",c._id);else return c._orientation}return a},Howl.prototype.pannerAttr=function(){var r=this,i=arguments,n,s,a;if(!r._webAudio)return r;if(i.length===0)return r._pannerAttr;if(i.length===1)if(typeof i[0]=="object")n=i[0],typeof s>"u"&&(n.pannerAttr||(n.pannerAttr={coneInnerAngle:n.coneInnerAngle,coneOuterAngle:n.coneOuterAngle,coneOuterGain:n.coneOuterGain,distanceModel:n.distanceModel,maxDistance:n.maxDistance,refDistance:n.refDistance,rolloffFactor:n.rolloffFactor,panningModel:n.panningModel}),r._pannerAttr={coneInnerAngle:typeof n.pannerAttr.coneInnerAngle<"u"?n.pannerAttr.coneInnerAngle:r._coneInnerAngle,coneOuterAngle:typeof n.pannerAttr.coneOuterAngle<"u"?n.pannerAttr.coneOuterAngle:r._coneOuterAngle,coneOuterGain:typeof n.pannerAttr.coneOuterGain<"u"?n.pannerAttr.coneOuterGain:r._coneOuterGain,distanceModel:typeof n.pannerAttr.distanceModel<"u"?n.pannerAttr.distanceModel:r._distanceModel,maxDistance:typeof n.pannerAttr.maxDistance<"u"?n.pannerAttr.maxDistance:r._maxDistance,refDistance:typeof n.pannerAttr.refDistance<"u"?n.pannerAttr.refDistance:r._refDistance,rolloffFactor:typeof n.pannerAttr.rolloffFactor<"u"?n.pannerAttr.rolloffFactor:r._rolloffFactor,panningModel:typeof n.pannerAttr.panningModel<"u"?n.pannerAttr.panningModel:r._panningModel});else return a=r._soundById(parseInt(i[0],10)),a?a._pannerAttr:r._pannerAttr;else i.length===2&&(n=i[0],s=parseInt(i[1],10));for(var o=r._getSoundIds(s),u=0;u<o.length;u++)if(a=r._soundById(o[u]),a){var c=a._pannerAttr;c={coneInnerAngle:typeof n.coneInnerAngle<"u"?n.coneInnerAngle:c.coneInnerAngle,coneOuterAngle:typeof n.coneOuterAngle<"u"?n.coneOuterAngle:c.coneOuterAngle,coneOuterGain:typeof n.coneOuterGain<"u"?n.coneOuterGain:c.coneOuterGain,distanceModel:typeof n.distanceModel<"u"?n.distanceModel:c.distanceModel,maxDistance:typeof n.maxDistance<"u"?n.maxDistance:c.maxDistance,refDistance:typeof n.refDistance<"u"?n.refDistance:c.refDistance,rolloffFactor:typeof n.rolloffFactor<"u"?n.rolloffFactor:c.rolloffFactor,panningModel:typeof n.panningModel<"u"?n.panningModel:c.panningModel};var f=a._panner;f?(f.coneInnerAngle=c.coneInnerAngle,f.coneOuterAngle=c.coneOuterAngle,f.coneOuterGain=c.coneOuterGain,f.distanceModel=c.distanceModel,f.maxDistance=c.maxDistance,f.refDistance=c.refDistance,f.rolloffFactor=c.rolloffFactor,f.panningModel=c.panningModel):(a._pos||(a._pos=r._pos||[0,0,-.5]),e(a,"spatial"))}return r},Sound.prototype.init=function(r){return function(){var i=this,n=i._parent;i._orientation=n._orientation,i._stereo=n._stereo,i._pos=n._pos,i._pannerAttr=n._pannerAttr,r.call(this),i._stereo?n.stereo(i._stereo):i._pos&&n.pos(i._pos[0],i._pos[1],i._pos[2],i._id)}}(Sound.prototype.init),Sound.prototype.reset=function(r){return function(){var i=this,n=i._parent;return i._orientation=n._orientation,i._stereo=n._stereo,i._pos=n._pos,i._pannerAttr=n._pannerAttr,i._stereo?n.stereo(i._stereo):i._pos?n.pos(i._pos[0],i._pos[1],i._pos[2],i._id):i._panner&&(i._panner.disconnect(0),i._panner=void 0,n._refreshBuffer(i)),r.call(this)}}(Sound.prototype.reset);var e=function(r,i){i=i||"spatial",i==="spatial"?(r._panner=Howler.ctx.createPanner(),r._panner.coneInnerAngle=r._pannerAttr.coneInnerAngle,r._panner.coneOuterAngle=r._pannerAttr.coneOuterAngle,r._panner.coneOuterGain=r._pannerAttr.coneOuterGain,r._panner.distanceModel=r._pannerAttr.distanceModel,r._panner.maxDistance=r._pannerAttr.maxDistance,r._panner.refDistance=r._pannerAttr.refDistance,r._panner.rolloffFactor=r._pannerAttr.rolloffFactor,r._panner.panningModel=r._pannerAttr.panningModel,typeof r._panner.positionX<"u"?(r._panner.positionX.setValueAtTime(r._pos[0],Howler.ctx.currentTime),r._panner.positionY.setValueAtTime(r._pos[1],Howler.ctx.currentTime),r._panner.positionZ.setValueAtTime(r._pos[2],Howler.ctx.currentTime)):r._panner.setPosition(r._pos[0],r._pos[1],r._pos[2]),typeof r._panner.orientationX<"u"?(r._panner.orientationX.setValueAtTime(r._orientation[0],Howler.ctx.currentTime),r._panner.orientationY.setValueAtTime(r._orientation[1],Howler.ctx.currentTime),r._panner.orientationZ.setValueAtTime(r._orientation[2],Howler.ctx.currentTime)):r._panner.setOrientation(r._orientation[0],r._orientation[1],r._orientation[2])):(r._panner=Howler.ctx.createStereoPanner(),r._panner.pan.setValueAtTime(r._stereo,Howler.ctx.currentTime)),r._panner.connect(r._node),r._paused||r._parent.pause(r._id,!0).play(r._id,!0)}})()})(vc);const nS=t=>{const e={isPlaying:!1,progress:0,speed:1,mute:!1,isWaiting:!1,loaded:!1,size:{width:50,height:50},isDragging:!1},[,r]=D.useState(!1),i=P.useRef(null),n=P.useRef(e),s=P.useRef(null),a=D.useRef(null),{tl:o,dragModeRef:u}=P.useContext(Ct),{uniqueId:c,src:f,startAt:l,endAt:h,mute:d,speed:p,audioStartAt:m,audioEndAt:_,visible:g}=t;Ee(ve.PAUSE,()=>{var b;i.current&&a.current&&((b=a.current)==null||b.pause(),n.current.isPlaying=!1)}),Ee(ve.COMPLETE,()=>{m>0&&a.current&&a.current.seek(m)}),Ee(ve.SCRUBBER_CLICKED,()=>{var b;i.current&&a.current&&((b=a.current)==null||b.pause(),n.current.isPlaying=!1)}),D.useEffect(()=>{a.current&&(u.current?(a.current.pause(),n.current.isPlaying=!1,n.current.isDragging=!0):n.current.isDragging=!1)},[u]);const y=(b,w)=>{o.current&&o.current.isActive()&&s.current&&s.current.isActive()&&!u.current&&a.current&&(console.log("gsap on start 0020",c,b,w),a.current.play(),n.current.isPlaying=!0)},v=()=>{var b;i.current&&((b=a.current)==null||b.stop(),n.current.isPlaying=!1,n.current.completed=!0)},x=b=>{var S,A;const w=b+((S=s.current)==null?void 0:S.time());a.current&&u.current?(a.current.seek(w),a.current.pause(),n.current.isPlaying=!1):i.current&&!n.current.isPlaying&&((A=o.current)!=null&&A.isActive())&&a.current&&(a.current.seek(w),a.current.play(),n.current.isPlaying=!0)},T=()=>{};return P.useEffect(()=>{let b=k.context(()=>{});if(i.current&&o.current){const w={duration:Number(_)-Number(m),onStart:y,onComplete:v,onStartParams:[m,_],onCompleteParams:[],onInterrupt:T,onUpdate:x,onUpdateParams:[m,_]};b=k.context(()=>{s.current=k.from(i.current,w,m),o.current.to(i.current,{alpha:1,duration:.01},l).to(i.current,{alpha:0,duration:.1},Number(h)),o.current.add(s.current,l)})}return()=>{s.current&&(s.current.kill(),k.killTweensOf(s.current)),b.revert()}},[l,h,m,_]),D.useEffect(()=>{i.current&&r(!0)},[]),D.useEffect(()=>(Xr(f)||(a.current=new vc.Howl({src:[f],autoplay:!1,loop:!1,rate:p||1,volume:!d&&g?1:0,onload:()=>{console.log("loaded audio sprite"+c),n.current.loaded=!0,a.current&&(m>0&&a.current.seek(m),a.current.volume(!d&&g?1:0),a.current.rate(p||1),a.current.pause(),n.current.isPlaying=!1,n.current.completed=!1)},onend:()=>{console.log("end of playing audio sprite"+c),n.current.isPlaying=!1,n.current.completed=!0},onplay:()=>{console.log("play of playing audio sprite"+c),n.current.isPlaying=!0},onpause:()=>{console.log("pause of playing audio sprite"+c),n.current.isPlaying=!1},onstop:()=>{console.log("stop of playing audio sprite"+c),n.current.isPlaying=!1}})),()=>{a.current&&a.current.unload()}),[c,f,l,h,m,_,d,g,p]),D.useEffect(()=>{a.current&&(console.log("running updateEffect 2002",c,_),a.current.volume(!d&&g?1:0),a.current.rate(p||1),n.current.isPlaying=!0)},[d,g,p]),Y.jsx(ie.Container,{ref:i})};function sS(t,e){for(var r=-1,i=t==null?0:t.length,n=Array(i);++r<i;)n[r]=e(t[r],r,t);return n}var yc=sS,aS=vo,oS=fs,lS=1,uS=2;function hS(t,e,r,i){var n=r.length,s=n,a=!i;if(t==null)return!s;for(t=Object(t);n--;){var o=r[n];if(a&&o[2]?o[1]!==t[o[0]]:!(o[0]in t))return!1}for(;++n<s;){o=r[n];var u=o[0],c=t[u],f=o[1];if(a&&o[2]){if(c===void 0&&!(u in t))return!1}else{var l=new aS;if(i)var h=i(c,f,u,t,e,l);if(!(h===void 0?oS(f,c,lS|uS,i,l):h))return!1}}return!0}var cS=hS,fS=Hr;function dS(t){return t===t&&!fS(t)}var xc=dS,pS=xc,mS=ss;function gS(t){for(var e=mS(t),r=e.length;r--;){var i=e[r],n=t[i];e[r]=[i,n,pS(n)]}return e}var _S=gS;function vS(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}var bc=vS,yS=cS,xS=_S,bS=bc;function TS(t){var e=xS(t);return e.length==1&&e[0][2]?bS(e[0][0],e[0][1]):function(r){return r===t||yS(r,t,e)}}var wS=TS,SS=jr,AS=Vr,ES="[object Symbol]";function CS(t){return typeof t=="symbol"||AS(t)&&SS(t)==ES}var Hn=CS,IS=dt,RS=Hn,PS=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,MS=/^\w*$/;function FS(t,e){if(IS(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||RS(t)?!0:MS.test(t)||!PS.test(t)||e!=null&&t in Object(e)}var Ka=FS,Tc=Jn,OS="Expected a function";function Za(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(OS);var r=function(){var i=arguments,n=e?e.apply(this,i):i[0],s=r.cache;if(s.has(n))return s.get(n);var a=t.apply(this,i);return r.cache=s.set(n,a)||s,a};return r.cache=new(Za.Cache||Tc),r}Za.Cache=Tc;var NS=Za,kS=NS,DS=500;function LS(t){var e=kS(t,function(i){return r.size===DS&&r.clear(),i}),r=e.cache;return e}var BS=LS,US=BS,$S=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,GS=/\\(\\)?/g,zS=US(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace($S,function(r,i,n,s){e.push(n?s.replace(GS,"$1"):i||r)}),e}),jS=zS,wc=Pi,HS=yc,VS=dt,XS=Hn,WS=1/0,Sc=wc?wc.prototype:void 0,Ac=Sc?Sc.toString:void 0;function Ec(t){if(typeof t=="string")return t;if(VS(t))return HS(t,Ec)+"";if(XS(t))return Ac?Ac.call(t):"";var e=t+"";return e=="0"&&1/t==-WS?"-0":e}var qS=Ec,YS=qS;function KS(t){return t==null?"":YS(t)}var ZS=KS,QS=dt,JS=Ka,eA=jS,tA=ZS;function rA(t,e){return QS(t)?t:JS(t,e)?[t]:eA(tA(t))}var Cc=rA,iA=Hn,nA=1/0;function sA(t){if(typeof t=="string"||iA(t))return t;var e=t+"";return e=="0"&&1/t==-nA?"-0":e}var Vn=sA,aA=Cc,oA=Vn;function lA(t,e){e=aA(e,t);for(var r=0,i=e.length;t!=null&&r<i;)t=t[oA(e[r++])];return r&&r==i?t:void 0}var Ic=lA,uA=Ic;function hA(t,e,r){var i=t==null?void 0:uA(t,e);return i===void 0?r:i}var cA=hA;function fA(t,e){return t!=null&&e in Object(t)}var dA=fA,pA=Cc,mA=ts,gA=dt,_A=Eo,vA=is,yA=Vn;function xA(t,e,r){e=pA(e,t);for(var i=-1,n=e.length,s=!1;++i<n;){var a=yA(e[i]);if(!(s=t!=null&&r(t,a)))break;t=t[a]}return s||++i!=n?s:(n=t==null?0:t.length,!!n&&vA(n)&&_A(a,n)&&(gA(t)||mA(t)))}var bA=xA,TA=dA,wA=bA;function SA(t,e){return t!=null&&wA(t,e,TA)}var AA=SA,EA=fs,CA=cA,IA=AA,RA=Ka,PA=xc,MA=bc,FA=Vn,OA=1,NA=2;function kA(t,e){return RA(t)&&PA(e)?MA(FA(t),e):function(r){var i=CA(r,t);return i===void 0&&i===e?IA(r,t):EA(e,i,OA|NA)}}var DA=kA;function LA(t){return t}var BA=LA;function UA(t){return function(e){return e==null?void 0:e[t]}}var $A=UA,GA=Ic;function zA(t){return function(e){return GA(e,t)}}var jA=zA,HA=$A,VA=jA,XA=Ka,WA=Vn;function qA(t){return XA(t)?HA(WA(t)):VA(t)}var YA=qA,KA=wS,ZA=DA,QA=BA,JA=dt,eE=YA;function tE(t){return typeof t=="function"?t:t==null?QA:typeof t=="object"?JA(t)?ZA(t[0],t[1]):KA(t):eE(t)}var rE=tE;function iE(t){return function(e,r,i){for(var n=-1,s=Object(e),a=i(e),o=a.length;o--;){var u=a[t?o:++n];if(r(s[u],u,s)===!1)break}return e}}var nE=iE,sE=nE,aE=sE(),oE=aE,lE=oE,uE=ss;function hE(t,e){return t&&lE(t,e,uE)}var cE=hE,fE=Di;function dE(t,e){return function(r,i){if(r==null)return r;if(!fE(r))return t(r,i);for(var n=r.length,s=e?n:-1,a=Object(r);(e?s--:++s<n)&&i(a[s],s,a)!==!1;);return r}}var pE=dE,mE=cE,gE=pE,_E=gE(mE),vE=_E,yE=vE,xE=Di;function bE(t,e){var r=-1,i=xE(t)?Array(t.length):[];return yE(t,function(n,s,a){i[++r]=e(n,s,a)}),i}var TE=bE,wE=yc,SE=rE,AE=TE,EE=dt;function CE(t,e){var r=EE(t)?wE:AE;return r(t,SE(e))}var IE=CE;const RE=$t(IE),PE=({isPlaying:t,forwardRef:e,...r})=>{const i=D.useRef(null);return D.useImperativeHandle(e,()=>i.current,[i]),D.useEffect(()=>{if(i.current===null)return;const n=i.current;n[t?"gotoAndPlay":"gotoAndStop"](n.currentFrame)},[t]),Y.jsx(ie.AnimatedSprite,{ref:i,...r,isPlaying:t})},Rc=D.memo(PE),Ai=new me,ME=new Uint16Array([0,1,2,0,2,3]);class Qa extends ar{constructor(e){super(),this._anchor=new Dt(this._onAnchorUpdate,this,e?e.defaultAnchor.x:0,e?e.defaultAnchor.y:0),this._texture=null,this._width=0,this._height=0,this._tintColor=new Oe(16777215),this._tintRGB=null,this.tint=16777215,this.blendMode=z.NORMAL,this._cachedTint=16777215,this.uvs=null,this.texture=e||K.EMPTY,this.vertexData=new Float32Array(8),this.vertexTrimmedData=null,this._transformID=-1,this._textureID=-1,this._transformTrimmedID=-1,this._textureTrimmedID=-1,this.indices=ME,this.pluginName="batch",this.isSprite=!0,this._roundPixels=q.ROUND_PIXELS}_onTextureUpdate(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=fn(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=fn(this.scale.y)*this._height/this._texture.orig.height)}_onAnchorUpdate(){this._transformID=-1,this._transformTrimmedID=-1}calculateVertices(){const e=this._texture;if(this._transformID===this.transform._worldID&&this._textureID===e._updateID)return;this._textureID!==e._updateID&&(this.uvs=this._texture._uvs.uvsFloat32),this._transformID=this.transform._worldID,this._textureID=e._updateID;const r=this.transform.worldTransform,i=r.a,n=r.b,s=r.c,a=r.d,o=r.tx,u=r.ty,c=this.vertexData,f=e.trim,l=e.orig,h=this._anchor;let d=0,p=0,m=0,_=0;if(f?(p=f.x-h._x*l.width,d=p+f.width,_=f.y-h._y*l.height,m=_+f.height):(p=-h._x*l.width,d=p+l.width,_=-h._y*l.height,m=_+l.height),c[0]=i*p+s*_+o,c[1]=a*_+n*p+u,c[2]=i*d+s*_+o,c[3]=a*_+n*d+u,c[4]=i*d+s*m+o,c[5]=a*m+n*d+u,c[6]=i*p+s*m+o,c[7]=a*m+n*p+u,this._roundPixels){const g=q.RESOLUTION;for(let y=0;y<c.length;++y)c[y]=Math.round(c[y]*g)/g}}calculateTrimmedVertices(){if(!this.vertexTrimmedData)this.vertexTrimmedData=new Float32Array(8);else if(this._transformTrimmedID===this.transform._worldID&&this._textureTrimmedID===this._texture._updateID)return;this._transformTrimmedID=this.transform._worldID,this._textureTrimmedID=this._texture._updateID;const e=this._texture,r=this.vertexTrimmedData,i=e.orig,n=this._anchor,s=this.transform.worldTransform,a=s.a,o=s.b,u=s.c,c=s.d,f=s.tx,l=s.ty,h=-n._x*i.width,d=h+i.width,p=-n._y*i.height,m=p+i.height;r[0]=a*h+u*p+f,r[1]=c*p+o*h+l,r[2]=a*d+u*p+f,r[3]=c*p+o*d+l,r[4]=a*d+u*m+f,r[5]=c*m+o*d+l,r[6]=a*h+u*m+f,r[7]=c*m+o*h+l}_render(e){this.calculateVertices(),e.batch.setObjectRenderer(e.plugins[this.pluginName]),e.plugins[this.pluginName].render(this)}_calculateBounds(){const e=this._texture.trim,r=this._texture.orig;!e||e.width===r.width&&e.height===r.height?(this.calculateVertices(),this._bounds.addQuad(this.vertexData)):(this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData))}getLocalBounds(e){return this.children.length===0?(this._localBounds||(this._localBounds=new Ln),this._localBounds.minX=this._texture.orig.width*-this._anchor._x,this._localBounds.minY=this._texture.orig.height*-this._anchor._y,this._localBounds.maxX=this._texture.orig.width*(1-this._anchor._x),this._localBounds.maxY=this._texture.orig.height*(1-this._anchor._y),e||(this._localBoundsRect||(this._localBoundsRect=new pe),e=this._localBoundsRect),this._localBounds.getRectangle(e)):super.getLocalBounds.call(this,e)}containsPoint(e){this.worldTransform.applyInverse(e,Ai);const r=this._texture.orig.width,i=this._texture.orig.height,n=-r*this.anchor.x;let s=0;return Ai.x>=n&&Ai.x<n+r&&(s=-i*this.anchor.y,Ai.y>=s&&Ai.y<s+i)}destroy(e){if(super.destroy(e),this._texture.off("update",this._onTextureUpdate,this),this._anchor=null,typeof e=="boolean"?e:e==null?void 0:e.texture){const i=typeof e=="boolean"?e:e==null?void 0:e.baseTexture;this._texture.destroy(!!i)}this._texture=null}static from(e,r){const i=e instanceof K?e:K.from(e,r);return new Qa(i)}set roundPixels(e){this._roundPixels!==e&&(this._transformID=-1),this._roundPixels=e}get roundPixels(){return this._roundPixels}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(e){const r=fn(this.scale.x)||1;this.scale.x=r*e/this._texture.orig.width,this._width=e}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(e){const r=fn(this.scale.y)||1;this.scale.y=r*e/this._texture.orig.height,this._height=e}get anchor(){return this._anchor}set anchor(e){this._anchor.copyFrom(e)}get tint(){return this._tintColor.value}set tint(e){this._tintColor.setValue(e),this._tintRGB=this._tintColor.toLittleEndianNumber()}get tintValue(){return this._tintColor.toNumber()}get texture(){return this._texture}set texture(e){this._texture!==e&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=e||K.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,e&&(e.baseTexture.valid?this._onTextureUpdate():e.once("update",this._onTextureUpdate,this)))}}var or={},Pc={},St={};Object.defineProperty(St,"__esModule",{value:!0}),St.loop=St.conditional=St.parse=void 0;var FE=function t(e,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:i;if(Array.isArray(r))r.forEach(function(a){return t(e,a,i,n)});else if(typeof r=="function")r(e,i,n,t);else{var s=Object.keys(r)[0];Array.isArray(r[s])?(n[s]={},t(e,r[s],i,n[s])):n[s]=r[s](e,i,n,t)}return i};St.parse=FE;var OE=function(e,r){return function(i,n,s,a){r(i,n,s)&&a(i,e,n,s)}};St.conditional=OE;var NE=function(e,r){return function(i,n,s,a){for(var o=[],u=i.pos;r(i,n,s);){var c={};if(a(i,e,n,c),i.pos===u)break;u=i.pos,o.push(c)}return o}};St.loop=NE;var Se={};Object.defineProperty(Se,"__esModule",{value:!0}),Se.readBits=Se.readArray=Se.readUnsigned=Se.readString=Se.peekBytes=Se.readBytes=Se.peekByte=Se.readByte=Se.buildStream=void 0;var kE=function(e){return{data:e,pos:0}};Se.buildStream=kE;var Mc=function(){return function(e){return e.data[e.pos++]}};Se.readByte=Mc;var DE=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(r){return r.data[r.pos+e]}};Se.peekByte=DE;var Xn=function(e){return function(r){return r.data.subarray(r.pos,r.pos+=e)}};Se.readBytes=Xn;var LE=function(e){return function(r){return r.data.subarray(r.pos,r.pos+e)}};Se.peekBytes=LE;var BE=function(e){return function(r){return Array.from(Xn(e)(r)).map(function(i){return String.fromCharCode(i)}).join("")}};Se.readString=BE;var UE=function(e){return function(r){var i=Xn(2)(r);return e?(i[1]<<8)+i[0]:(i[0]<<8)+i[1]}};Se.readUnsigned=UE;var $E=function(e,r){return function(i,n,s){for(var a=typeof r=="function"?r(i,n,s):r,o=Xn(e),u=new Array(a),c=0;c<a;c++)u[c]=o(i);return u}};Se.readArray=$E;var GE=function(e,r,i){for(var n=0,s=0;s<i;s++)n+=e[r+s]&&Math.pow(2,i-s-1);return n},zE=function(e){return function(r){for(var i=Mc()(r),n=new Array(8),s=0;s<8;s++)n[7-s]=!!(i&1<<s);return Object.keys(e).reduce(function(a,o){var u=e[o];return u.length?a[o]=GE(n,u.index,u.length):a[o]=n[u.index],a},{})}};Se.readBits=zE,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=St,r=Se,i={blocks:function(h){for(var d=0,p=[],m=h.data.length,_=0,g=(0,r.readByte)()(h);g!==d&&g;g=(0,r.readByte)()(h)){if(h.pos+g>=m){var y=m-h.pos;p.push((0,r.readBytes)(y)(h)),_+=y;break}p.push((0,r.readBytes)(g)(h)),_+=g}for(var v=new Uint8Array(_),x=0,T=0;T<p.length;T++)v.set(p[T],x),x+=p[T].length;return v}},n=(0,e.conditional)({gce:[{codes:(0,r.readBytes)(2)},{byteSize:(0,r.readByte)()},{extras:(0,r.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,r.readUnsigned)(!0)},{transparentColorIndex:(0,r.readByte)()},{terminator:(0,r.readByte)()}]},function(l){var h=(0,r.peekBytes)(2)(l);return h[0]===33&&h[1]===249}),s=(0,e.conditional)({image:[{code:(0,r.readByte)()},{descriptor:[{left:(0,r.readUnsigned)(!0)},{top:(0,r.readUnsigned)(!0)},{width:(0,r.readUnsigned)(!0)},{height:(0,r.readUnsigned)(!0)},{lct:(0,r.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,e.conditional)({lct:(0,r.readArray)(3,function(l,h,d){return Math.pow(2,d.descriptor.lct.size+1)})},function(l,h,d){return d.descriptor.lct.exists}),{data:[{minCodeSize:(0,r.readByte)()},i]}]},function(l){return(0,r.peekByte)()(l)===44}),a=(0,e.conditional)({text:[{codes:(0,r.readBytes)(2)},{blockSize:(0,r.readByte)()},{preData:function(h,d,p){return(0,r.readBytes)(p.text.blockSize)(h)}},i]},function(l){var h=(0,r.peekBytes)(2)(l);return h[0]===33&&h[1]===1}),o=(0,e.conditional)({application:[{codes:(0,r.readBytes)(2)},{blockSize:(0,r.readByte)()},{id:function(h,d,p){return(0,r.readString)(p.blockSize)(h)}},i]},function(l){var h=(0,r.peekBytes)(2)(l);return h[0]===33&&h[1]===255}),u=(0,e.conditional)({comment:[{codes:(0,r.readBytes)(2)},i]},function(l){var h=(0,r.peekBytes)(2)(l);return h[0]===33&&h[1]===254}),c=[{header:[{signature:(0,r.readString)(3)},{version:(0,r.readString)(3)}]},{lsd:[{width:(0,r.readUnsigned)(!0)},{height:(0,r.readUnsigned)(!0)},{gct:(0,r.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,r.readByte)()},{pixelAspectRatio:(0,r.readByte)()}]},(0,e.conditional)({gct:(0,r.readArray)(3,function(l,h){return Math.pow(2,h.lsd.gct.size+1)})},function(l,h){return h.lsd.gct.exists}),{frames:(0,e.loop)([n,o,u,s,a],function(l){var h=(0,r.peekByte)()(l);return h===33||h===44})}],f=c;t.default=f}(Pc);var Wn={};Object.defineProperty(Wn,"__esModule",{value:!0}),Wn.deinterlace=void 0;var jE=function(e,r){for(var i=new Array(e.length),n=e.length/r,s=function(h,d){var p=e.slice(d*r,(d+1)*r);i.splice.apply(i,[h*r,r].concat(p))},a=[0,4,2,1],o=[8,8,4,2],u=0,c=0;c<4;c++)for(var f=a[c];f<n;f+=o[c])s(f,u),u++;return i};Wn.deinterlace=jE;var qn={};Object.defineProperty(qn,"__esModule",{value:!0}),qn.lzw=void 0;var HE=function(e,r,i){var n=4096,s=-1,a=i,o,u,c,f,l,h,d,b,p,m,T,_,w,S,C,A,g=new Array(i),y=new Array(n),v=new Array(n),x=new Array(n+1);for(_=e,u=1<<_,l=u+1,o=u+2,d=s,f=_+1,c=(1<<f)-1,p=0;p<u;p++)y[p]=0,v[p]=p;var T,b,w,S,A,C;for(T=b=w=S=A=C=0,m=0;m<a;){if(S===0){if(b<f){T+=r[C]<<b,b+=8,C++;continue}if(p=T&c,T>>=f,b-=f,p>o||p==l)break;if(p==u){f=_+1,c=(1<<f)-1,o=u+2,d=s;continue}if(d==s){x[S++]=v[p],d=p,w=p;continue}for(h=p,p==o&&(x[S++]=w,p=d);p>u;)x[S++]=v[p],p=y[p];w=v[p]&255,x[S++]=w,o<n&&(y[o]=d,v[o]=w,o++,!(o&c)&&o<n&&(f++,c+=o)),d=h}S--,g[A++]=x[S],m++}for(m=A;m<a;m++)g[m]=0;return g};qn.lzw=HE,Object.defineProperty(or,"__esModule",{value:!0});var Fc=or.decompressFrames=or.decompressFrame=Oc=or.parseGIF=void 0,VE=KE(Pc),XE=St,WE=Se,qE=Wn,YE=qn;function KE(t){return t&&t.__esModule?t:{default:t}}var ZE=function(e){var r=new Uint8Array(e);return(0,XE.parse)((0,WE.buildStream)(r),VE.default)},Oc=or.parseGIF=ZE,QE=function(e){for(var r=e.pixels.length,i=new Uint8ClampedArray(r*4),n=0;n<r;n++){var s=n*4,a=e.pixels[n],o=e.colorTable[a]||[0,0,0];i[s]=o[0],i[s+1]=o[1],i[s+2]=o[2],i[s+3]=a!==e.transparentIndex?255:0}return i},Nc=function(e,r,i){if(!e.image){console.warn("gif frame does not have associated image.");return}var n=e.image,s=n.descriptor.width*n.descriptor.height,a=(0,YE.lzw)(n.data.minCodeSize,n.data.blocks,s);n.descriptor.lct.interlaced&&(a=(0,qE.deinterlace)(a,n.descriptor.width));var o={pixels:a,dims:{top:e.image.descriptor.top,left:e.image.descriptor.left,width:e.image.descriptor.width,height:e.image.descriptor.height}};return n.descriptor.lct&&n.descriptor.lct.exists?o.colorTable=n.lct:o.colorTable=r,e.gce&&(o.delay=(e.gce.delay||10)*10,o.disposalType=e.gce.extras.disposal,e.gce.extras.transparentColorGiven&&(o.transparentIndex=e.gce.transparentColorIndex)),i&&(o.patch=QE(o)),o};or.decompressFrame=Nc;var JE=function(e,r){return e.frames.filter(function(i){return i.image}).map(function(i){return Nc(i,e.gct,r)})};Fc=or.decompressFrames=JE;const Ei=class extends Qa{constructor(t,e){super(K.EMPTY),this.animationSpeed=1,this.loop=!0,this.duration=0,this.autoPlay=!0,this.dirty=!1,this._currentFrame=0,this._autoUpdate=!1,this._isConnectedToTicker=!1,this._playing=!1,this._currentTime=0;const{scaleMode:r,width:i,height:n,...s}=Object.assign({},Ei.defaultOptions,e),a=document.createElement("canvas"),o=a.getContext("2d");a.width=i,a.height=n,this.texture=K.from(a,{scaleMode:r}),this.duration=t[t.length-1].end,this._frames=t,this._context=o,this._playing=!1,this._currentTime=0,this._isConnectedToTicker=!1,Object.assign(this,s),this.currentFrame=0,s.autoPlay&&this.play()}static fromBuffer(t,e){if(!t||t.byteLength===0)throw new Error("Invalid buffer");const r=m=>{let _=null;for(const g of m.frames)_=g.gce??_,"image"in g&&!("gce"in g)&&(g.gce=_)},i=Oc(t);r(i);const n=Fc(i,!0),s=[],a=document.createElement("canvas"),o=a.getContext("2d",{willReadFrequently:!0}),u=document.createElement("canvas"),c=u.getContext("2d");a.width=i.lsd.width,a.height=i.lsd.height;let f=0;const{fps:l}=Object.assign({},Ei.defaultOptions,e),h=1e3/l;for(let m=0;m<n.length;m++){const{disposalType:_=2,delay:g=h,patch:y,dims:{width:v,height:x,left:T,top:b}}=n[m];u.width=v,u.height=x,c.clearRect(0,0,v,x);const w=c.createImageData(v,x);w.data.set(y),c.putImageData(w,0,0),o.drawImage(u,T,b);const S=o.getImageData(0,0,a.width,a.height);(_===2||_===3)&&o.clearRect(0,0,a.width,a.height),s.push({start:f,end:f+g,imageData:S}),f+=g}a.width=a.height=0,u.width=u.height=0;const{width:d,height:p}=i.lsd;return new Ei(s,{width:d,height:p,...e})}stop(){this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&($e.shared.remove(this.update,this),this._isConnectedToTicker=!1))}play(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&($e.shared.add(this.update,this,_i.HIGH),this._isConnectedToTicker=!0),!this.loop&&this.currentFrame===this._frames.length-1&&(this._currentTime=0))}get progress(){return this._currentTime/this.duration}get playing(){return this._playing}update(t){var s,a;if(!this._playing)return;const e=this.animationSpeed*t/q.TARGET_FPMS,r=this._currentTime+e,i=r%this.duration,n=this._frames.findIndex(o=>o.start<=i&&o.end>i);r>=this.duration?this.loop?(this._currentTime=i,this.updateFrameIndex(n),(s=this.onLoop)==null||s.call(this)):(this._currentTime=this.duration,this.updateFrameIndex(this._frames.length-1),(a=this.onComplete)==null||a.call(this),this.stop()):(this._currentTime=i,this.updateFrameIndex(n))}updateFrame(){if(!this.dirty)return;const{imageData:t}=this._frames[this._currentFrame];this._context.putImageData(t,0,0),this._context.fillStyle="transparent",this._context.fillRect(0,0,0,1),this.texture.update(),this.dirty=!1}_render(t){this.updateFrame(),super._render(t)}_renderCanvas(t){this.updateFrame(),super._renderCanvas(t)}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?($e.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&($e.shared.add(this.update,this),this._isConnectedToTicker=!0))}get currentFrame(){return this._currentFrame}set currentFrame(t){this.updateFrameIndex(t),this._currentTime=this._frames[t].start}updateFrameIndex(t){var e;if(t<0||t>=this._frames.length)throw new Error(`Frame index out of range, expecting 0 to ${this.totalFrames}, got ${t}`);this._currentFrame!==t&&(this._currentFrame=t,this.dirty=!0,(e=this.onFrameChange)==null||e.call(this,t))}get totalFrames(){return this._frames.length}destroy(){this.stop(),super.destroy(!0);const t=null;this._context=t,this._frames=t,this.onComplete=t,this.onFrameChange=t,this.onLoop=t}clone(){return new Ei([...this._frames],{autoUpdate:this._autoUpdate,loop:this.loop,autoPlay:this.autoPlay,scaleMode:this.texture.baseTexture.scaleMode,animationSpeed:this.animationSpeed,width:this._context.canvas.width,height:this._context.canvas.height,onComplete:this.onComplete,onFrameChange:this.onFrameChange,onLoop:this.onLoop})}};let kc=Ei;kc.defaultOptions={scaleMode:et.LINEAR,fps:30,loop:!0,animationSpeed:1,autoPlay:!0,autoUpdate:!0,onComplete:null,onFrameChange:null,onLoop:null};const eC={extension:re.Asset,detection:{test:async()=>!0,add:async t=>[...t,"gif"],remove:async t=>t.filter(e=>e!=="gif")},loader:{test:t=>pu.extname(t)===".gif",load:async(t,e)=>{const i=await(await q.ADAPTER.fetch(t)).arrayBuffer();return kc.fromBuffer(i,e==null?void 0:e.data)},unload:async t=>{t.destroy()}}};he.add(eC);const tC={isPlaying:!1,progress:0,speed:1,isMuted:!1,isWaiting:!1,loaded:!1,size:{width:50,height:50},isDragging:!1,totalFrames:0,totalDuration:0,currentFrame:0},rC=D.forwardRef((t,e)=>{const[r,i]=D.useState(0),[n,s]=D.useState([]),[,a]=P.useState(!1),o=P.useRef(null),u=P.useRef(null),c=P.useRef(tC),f=P.useRef(),{tl:l}=P.useContext(Ct),{src:h,uniqueId:d,startAt:p,endAt:m,frameStartAt:_,frameEndAt:g,loop:y,visible:v,disabled:x,transformation:{width:T=0,height:b=0,x:w,y:S,colorCorrection:A={}},pointerdown:C}=t,{temperatureFilter:F,sharpnessFilter:G,hueFilter:R,blurFilter:E,adjustmentFilter:B,vignetteFilter:U,noiseFilter:I}=ir(A),{blurRadius:$=0,vignette:X=0,noise:M=0}=A,O=.1;D.useEffect(()=>{(async()=>{const V=await Le.Assets.load(h),J=RE(V._frames,ge=>({texture:Le.Texture.fromBuffer(ge.imageData,ge.imageData.width,ge.imageData.height),time:ge.end-ge.start}));s(J);const de=V.duration/1e3;i(de),c.current.totalDuration=de,c.current.totalFrames=J.length})()},[h,d]);const j=()=>{o.current&&(o.current.stop(),c.current.isPlaying=!1)},H=()=>{if(o.current&&f.current){const Q=f.current.time();let V=Q===0?0:Q/O;V=isNaN(V)?0:V;const J=c.current.totalFrames;V=V>J?J:V,V=Math.round(V),V>=J?(o.current.gotoAndStop(0),c.current.isPlaying=!1):(o.current.currentFrame=V,c.current.isPlaying=!0)}},W=()=>{a(!0)};return P.useEffect(()=>{let Q=k.context(()=>{});if(u.current&&l.current&&r>0){const V={duration:Number(r),onInterrupt:j,onUpdate:H,onUpdateParams:[_,g]},J=Number(m)-Number(p),de=Math.max(0,Math.floor(J/r)-1);f.current&&f.current.kill(),Q=k.context(()=>{f.current=k.timeline({repeat:y?de:0,repeatDelay:0}).from(u.current,V,_),l.current.add(f.current,p)})}return()=>{f.current&&(f.current.kill(),k.killTweensOf(f.current)),Q.revert()}},[h,d,p,m,_,g,r,y]),Y.jsx(jt,{...t,ref:e,ignoreTlForVideo:!0,isGif:!0,children:Y.jsx(ie.Container,{ref:u,children:!Xr(n)&&Y.jsx(Rc,{x:w,y:S,width:T,height:b,animationSpeed:1,alpha:v?1:0,loop:y,textures:n,onComplete:W,anchor:.5,forwardRef:o,...!x&&v&&{interactive:!0,pointerdown:C},filters:[F,G,R,B,...$>0?[E]:[],...X>0?[U]:[],...M>0?[I]:[]]})})})}),iC=D.forwardRef((t,e)=>{const i=P.useRef(null),n=P.useRef(0),s=P.useRef(null),a=P.useRef(null),o=P.useRef(16),u=P.useRef(null),{visible:c,text:f,disabled:l,transformation:h,pointerdown:d,onDobuleClick:p}=t,{x:m,y:_,fontFamily:g="Arial",fontWeight:y="normal",fontStyle:v="normal",fontSize:x=16,fontVariant:T="normal",fill:b="black",stroke:w,strokeThickness:S=0,blurRadius:A=0,blurEnabled:C=!1,dropShadowColor:F=null,dropShadow:G=!1,dropShadowBlur:R=0,wordWrapWidth:E=5e7,leading:B=0,letterSpacing:U,colorCorrection:I={}}=h,{temperatureFilter:$,sharpnessFilter:X,hueFilter:M,blurFilter:O,adjustmentFilter:j}=ir(I),{blurRadius:H=0}=I;D.useEffect(()=>{o.current=Number(x)},[x]);const W=["italic","oblique"].includes(v)?v:void 0,Q=["small-caps"].includes(T),V=["bold","bolder","lighter","100","200","300"].includes(y)?y:void 0,J=Number(U)>0?U:void 0,de=D.useMemo(()=>new Le.TextStyle({fontFamily:g,fontSize:x,fill:b||"white",...w&&S>0&&{stroke:w,strokeThickness:S},...W&&{fontStyle:W},...Q&&{fontVariant:Q},...V&&{fontWeight:V},...J&&{letterSpacing:J},...C&&{dropShadow:!0,dropShadowBlur:Number(A),dropShadowColor:(F==null?void 0:F.toString())||"black",dropShadowAngle:.5235987755982988,dropShadowDistance:5},...G&&{dropShadow:!0,dropShadowBlur:Number(R),dropShadowColor:(F==null?void 0:F.toString())||"black",dropShadowAngle:.5235987755982988,dropShadowDistance:5},wordWrap:!0,breakWords:!0,wordWrapWidth:E||500,leading:B||0}),[C,A,b,g,x,v,B,W,V,Q,J,F,w,S,E,G,R]);D.useEffect(()=>{u.current={...h}},[h]);const ge=()=>{const le=new Date().getTime();le-n.current<300&&p?p():d&&d(),n.current=le},Z=()=>{!l&&p&&p()};return Y.jsx(jt,{...t,ref:e,isText:!0,onDoubleClick:Z,children:Y.jsx(ie.Container,{ref:i,children:Y.jsx(ie.Container,{alpha:1,ref:a,children:Y.jsx(ie.Text,{style:de,x:m,y:_,anchor:.5,text:f,alpha:c?1:0,...c&&!l&&{interactive:!0,buttonMode:!0,pointerdown:ge},ref:s,filters:[$,X,M,j,...H>0?[O]:[]]})})})})});var nC=ft,sC=function(){return nC.Date.now()},aC=sC,oC=/\s/;function lC(t){for(var e=t.length;e--&&oC.test(t.charAt(e)););return e}var uC=lC,hC=uC,cC=/^\s+/;function fC(t){return t&&t.slice(0,hC(t)+1).replace(cC,"")}var dC=fC,pC=dC,Dc=Hr,mC=Hn,Lc=0/0,gC=/^[-+]0x[0-9a-f]+$/i,_C=/^0b[01]+$/i,vC=/^0o[0-7]+$/i,yC=parseInt;function xC(t){if(typeof t=="number")return t;if(mC(t))return Lc;if(Dc(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Dc(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=pC(t);var r=_C.test(t);return r||vC.test(t)?yC(t.slice(2),r?2:8):gC.test(t)?Lc:+t}var bC=xC,TC=Hr,Ja=aC,Bc=bC,wC="Expected a function",SC=Math.max,AC=Math.min;function EC(t,e,r){var i,n,s,a,o,u,c=0,f=!1,l=!1,h=!0;if(typeof t!="function")throw new TypeError(wC);e=Bc(e)||0,TC(r)&&(f=!!r.leading,l="maxWait"in r,s=l?SC(Bc(r.maxWait)||0,e):s,h="trailing"in r?!!r.trailing:h);function d(b){var w=i,S=n;return i=n=void 0,c=b,a=t.apply(S,w),a}function p(b){return c=b,o=setTimeout(g,e),f?d(b):a}function m(b){var w=b-u,S=b-c,A=e-w;return l?AC(A,s-S):A}function _(b){var w=b-u,S=b-c;return u===void 0||w>=e||w<0||l&&S>=s}function g(){var b=Ja();if(_(b))return y(b);o=setTimeout(g,m(b))}function y(b){return o=void 0,h&&i?d(b):(i=n=void 0,a)}function v(){o!==void 0&&clearTimeout(o),c=0,i=u=n=o=void 0}function x(){return o===void 0?a:y(Ja())}function T(){var b=Ja(),w=_(b);if(i=arguments,n=this,u=b,w){if(o===void 0)return p(u);if(l)return clearTimeout(o),o=setTimeout(g,e),d(u)}return o===void 0&&(o=setTimeout(g,e)),a}return T.cancel=v,T.flush=x,T}var CC=EC;const Yn=$t(CC),eo=(t,e,r,i)=>{const n=P.useCallback(Yn(t,i),[t,i]),s=P.useCallback(Yn(e,i),[e,i]),a=P.useCallback(Yn(r,i),[r,i]),o=P.useCallback(()=>{n()},[n]),u=P.useCallback(()=>{s()},[s]),c=P.useCallback(()=>{a()},[a]);return{onPointerOver:o,onPointerDown:u,onPointerOut:c}},IC={isPlaying:!1,progress:0,speed:1,isMuted:!1,isWaiting:!1,isStalled:!1,loaded:!1,size:{width:50,height:50},isDragging:!1,timeDiff:0},Uc=D.forwardRef((t,e)=>{const[r,i]=D.useState(0),[n,s]=D.useState(),a=P.useRef(null),o=P.useRef(null),u=P.useRef(null),c=P.useRef(IC),f=P.useRef(),{uniqueId:l,mute:h=!1,src:d,startAt:p,endAt:m,frameStartAt:_,frameEndAt:g,visible:y,disabled:v,transformation:{x,y:T,width:b,height:w,animation:S,colorCorrection:A={}},pointerdown:C=()=>{},pointerout:F=()=>{},pointerover:G=()=>{},fps:R=0}=t,{tl:E,dragModeRef:B,isRemotion:U}=P.useContext(Ct),{onPointerDown:I,onPointerOut:$,onPointerOver:X}=eo(G,C,F,1),{blurRadius:M=0,vignette:O=0,noise:j=0}=A,{temperatureFilter:H,sharpnessFilter:W,hueFilter:Q,blurFilter:V,adjustmentFilter:J,vignetteFilter:de,noiseFilter:ge}=ir(A),Z=d||"",le=D.useMemo(()=>{const ee=document.createElement("video");return ee.src=d,ee.crossOrigin="Anonymus",ee.autoplay=!1,ee.currentTime=_===0?.001:_,ee},[d,_]);Ee(ve.PAUSE,()=>{u.current&&(u.current.pause(),c.current.isPlaying=!1)}),Ee(ve.SCRUBBER_CLICKED,()=>{u.current&&(u.current.pause(),c.current.isPlaying=!1)}),Ee(ve.REVERSE_MODE_END,()=>{u.current&&(u.current.pause(),c.current.isPlaying=!1)});const se=D.useCallback(Yn(()=>{if(u.current){const ee=u.current;ee.currentTime>0&&!ee.paused&&!ee.ended&&ee.readyState>ee.HAVE_CURRENT_DATA&&u.current.pause(),c.current.isPlaying=!1}},400),[u]);D.useEffect(()=>{u.current&&!U?(B.current?(se(),c.current.isPlaying=!1,c.current.isDragging=!0):c.current.isDragging=!1,u.current.muted=h):c.current.isDragging=!1,c.current.isMuted=h},[h,B,se,u]);const we=ee=>{if(u.current){if(u.current.currentTime=Number(ee),!B.current){const fe=u.current,Fe=fe.currentTime>0&&!fe.paused&&!fe.ended&&fe.readyState>fe.HAVE_CURRENT_DATA;E.current&&E.current.isActive()&&f.current&&f.current.isActive()&&(Fe||u.current.play(),c.current.isPlaying=!0,i($r=>$r+1))}c.current.progress=0}},ze=()=>{if(u.current){const ee=u.current;ee.currentTime>0&&!ee.paused&&!ee.ended&&ee.readyState>ee.HAVE_CURRENT_DATA&&u.current.pause(),c.current.isPlaying=!1,f.current&&(c.current.progress=f.current.progress())}},je=()=>{},At=()=>{var ee,fe;if(f.current&&(c.current.progress=f.current.progress()),u.current&&f.current){const Fe=_+((ee=f==null?void 0:f.current)==null?void 0:ee.time()),$r=Math.abs(u.current.currentTime-Fe),Ut=u.current,Gr=Ut.currentTime>0&&!Ut.paused&&!Ut.ended&&Ut.readyState>Ut.HAVE_CURRENT_DATA;B.current?(u.current.currentTime=Fe,setTimeout(()=>{u.current&&u.current.play().then(()=>{c.current.isPlaying=!1,u.current&&u.current.pause()})},100),c.current.isPlaying=!1):(Gr!==c.current.isPlaying||!Gr)&&c.current.progress>.01&&c.current.progress<.99?(fe=E.current)!=null&&fe.isActive()&&f.current&&f.current.isActive()&&(Gr||u.current.play(),c.current.isPlaying=!0):$r>.3&&c.current.progress>.01&&c.current.progress<.99&&(u.current.currentTime=Fe)}};return P.useEffect(()=>{let ee=k.context(()=>{});if(o.current&&E.current){const fe={duration:Number(g)-Number(_),onStart:we,onComplete:ze,onStartParams:[_,g],onCompleteParams:[],onInterrupt:je,onUpdate:At,onUpdateParams:[_,g],onPause:()=>{console.log("onPause video sprite pause",l)},onResume:()=>{console.log("onResume video sprite resume",l)},onReverseComplete:()=>{console.log("onReverseComplete video sprite reverse complete",l)},onKill:()=>{console.log("onKill video sprite kill",l)}};ee=k.context(()=>{f.current=k.from(o.current,fe,_),E.current.add(f.current,p)})}return()=>{f.current&&(f.current.kill(),k.killTweensOf(f.current)),ee.revert()}},[S,p,m,_,g]),D.useEffect(()=>{u.current&&(u.current.muted=h,c.current.isMuted=h);const ee=setTimeout(()=>{u.current&&(u.current.muted=h,c.current.isMuted=h)},1500);return()=>{clearTimeout(ee)}},[h]),D.useEffect(()=>{const ee=Math.round((Number(_)+Number.EPSILON)*100)/100,fe=function(){u.current&&(u.current.currentTime=ee,u.current.muted=h)},Fe=function(){if(u.current){const Et=u.current;Et.currentTime>0&&!Et.paused&&!Et.ended&&Et.readyState>Et.HAVE_CURRENT_DATA&&u.current.pause()}c.current.isWaiting=!1,c.current.isStalled=!1},$r=function(){u.current&&u.current.pause(),c.current.isWaiting=!0,c.current.isStalled=!1},Ut=function(){c.current.isWaiting=!1,c.current.isStalled=!1},Gr=function(){c.current.isWaiting=!1,c.current.isStalled=!0},OC=Math.round((Number(_)+Number.EPSILON)*100)/100,NC=Math.round((Number(g)+Number.EPSILON)*100)/100,kC=`${Z}#t=${OC},${NC}`;return Le.Texture.fromLoader(le,kC,l,{pixiIdPrefix:l,resourceOptions:{autoPlay:!1,crossorigin:"Anonymus",updateFPS:R?Math.max(120,Number(R)):30}}).then(Et=>{Et&&(s(Et),u.current=Et.baseTexture.resource.source,u.current.id=l,u.current.addEventListener("loadedmetadata",fe),u.current.addEventListener("ended",Fe),u.current.addEventListener("loadstart",$r),u.current.addEventListener("canplaythrough",Ut),u.current.addEventListener("stalled",Gr))}),()=>{u.current&&(u.current.pause(),u.current.removeEventListener("loadedmetadata",fe),u.current.removeEventListener("ended",Fe),u.current.removeEventListener("loadstart",$r),u.current.removeEventListener("canplaythrough",Ut),u.current.removeEventListener("stalled",Gr))}},[Z,l,_,g,le]),D.useEffect(()=>{const ee=setTimeout(()=>{n&&f.current&&E.current&&f.current.progress()<.1&&u.current&&!f.current.isActive()&&!U&&u.current.play().then(()=>{c.current.isPlaying=!1,u.current&&u.current.pause()})},30);return()=>{clearTimeout(ee)}},[n]),D.useEffect(()=>{E.current&&!E.current.isActive()&&!U&&(c.current.isPlaying=!1,u.current&&u.current.pause());const ee=setTimeout(()=>{if(n&&E.current&&r>0&&!U){E.current.isActive()||(c.current.isPlaying=!1,u.current&&u.current.pause());const fe=u.current;fe&&E.current.isActive()&&f.current&&f.current.isActive()&&(fe.currentTime>0&&!fe.paused&&!fe.ended&&fe.readyState>fe.HAVE_CURRENT_DATA||u.current.play(),c.current.isPlaying=!0)}},10);return()=>{clearTimeout(ee)}},[r,n]),Y.jsx(jt,{...t,ref:e,ignoreTlForVideo:!0,pointerdown:I,pointerover:X,pointerout:$,children:Y.jsx(ie.Container,{ref:o,children:n&&Y.jsx(ie.Sprite,{texture:n,width:b,height:w,anchor:.5,x,y:T,ref:a,alpha:y?1:0,...!v&&y&&{interactive:!0,pointerdown:C},filters:[H,W,Q,J,...M>0?[V]:[],...O>0?[de]:[],...j>0?[ge]:[]]})})})});Uc.whyDidYouRender={logOnDifferentValues:!0,customName:"PixiVideoSprite"};const RC=D.forwardRef((t,e)=>{const[r,i]=D.useState(),n=P.useRef(null),s=P.useRef(null),{visible:a,disabled:o,transformation:{x:u,y:c,width:f,height:l,colorCorrection:h={}},pointerdown:d=()=>{},pointerout:p=()=>{},pointerover:m=()=>{},canvasImageRef:_}=t,g=_&&(_==null?void 0:_.getCanvas()),y=ie.useApp(),{onPointerDown:v,onPointerOut:x,onPointerOver:T}=eo(m,d,p,1),{blurRadius:b=0,vignette:w=0,noise:S=0}=h,{temperatureFilter:A,sharpnessFilter:C,hueFilter:F,blurFilter:G,adjustmentFilter:R,vignetteFilter:E,noiseFilter:B}=ir(h);return ie.useTick(()=>{if(n.current&&n.current.texture){const U=n.current.texture.baseTexture;U&&U.update(),s.current&&y.renderer.render(s.current)}}),D.useEffect(()=>{if(!Xr(g)){const U=Le.Texture.from(g);i(U)}},[g]),Y.jsx(jt,{...t,ref:e,ignoreTlForVideo:!0,pointerdown:v,pointerover:T,pointerout:x,children:Y.jsx(ie.Container,{ref:s,children:r&&Y.jsx(ie.Sprite,{texture:r,width:f,height:l,anchor:.5,x:u,y:c,ref:n,alpha:a?1:0,...!o&&a&&{interactive:!0,pointerdown:d},filters:[A,C,F,R,...b>0?[G]:[],...w>0?[E]:[],...S>0?[B]:[]]})})})}),PC=t=>{const{startAt:e,endAt:r,uniqueId:i}=t,n=P.useRef(null),s=P.useRef(null),a=P.useRef(null),o=P.useRef(null),u=P.useRef(!1),{tl:c,totalDuration:f=0,reverseModeRef:l}=P.useContext(Ct),h=e<.2?"static":"none",d=P.useRef(1);Ee(ve.COMPLETE,()=>{n.current&&(n.current.eventMode=h)}),Ee(ve.REVERSE_MODE_END,()=>{if(c.current){const m=c.current.time();m>e&&m<r?(s.current&&(s.current.alpha=1),n.current&&(n.current.alpha=1,n.current.eventMode="static")):(s.current&&(s.current.alpha=0),n.current&&(n.current.alpha=0,n.current.eventMode="none"))}});const p=()=>{if(l.current&&o.current&&c.current){u.current=!0;const m=c.current.time();m>e&&m<r?(s.current&&(s.current.alpha=1),n.current&&(n.current.alpha=1)):(s.current&&(s.current.alpha=0),n.current&&(n.current.alpha=0))}};return Ee(ve.COMPLETE,()=>{}),D.useEffect(()=>{const m=k.context(()=>{if(n.current&&c.current){const _=k.to(n.current,{alpha:1,duration:.1});o.current=k.to(s.current,{alpha:1,duration:Number(r)-Number(e),onStart:()=>{n.current&&(n.current.alpha=1,n.current.eventMode="static",d.current=1)},onUpdate:p,onComplete:()=>{n.current&&(n.current.alpha=0,n.current.eventMode="none",d.current=0)}}),c.current.add([_,o.current],e)}});return()=>{o.current&&(c.current.remove(o.current),o.current.progress(0).kill()),m.revert()}},[e,r,f,i]),Y.jsx(ie.Container,{ref:n,alpha:e<.2?1:0,eventMode:e<.2?"static":"none",children:Y.jsx(ie.Container,{ref:a,children:Y.jsx(ie.Container,{ref:s,alpha:1,children:t.children})})})},MC=t=>{const{startAt:e,endAt:r}=t,{setTotalDuration:i}=P.useContext(Ct);return D.useEffect(()=>{i&&i(Number(r)+.2)},[e,r]),t.children},FC=D.forwardRef((t,e)=>{const[r,i]=D.useState(),n=P.useRef(null),s=P.useRef(null),{visible:a,disabled:o,transformation:{x:u,y:c,width:f,height:l,colorCorrection:h={}},pointerdown:d=()=>{},pointerout:p=()=>{},pointerover:m=()=>{},canvasImageRef:_}=t,g=_&&(_==null?void 0:_.getCanvas()),y=ie.useApp(),{onPointerDown:v,onPointerOut:x,onPointerOver:T}=eo(m,d,p,1),{blurRadius:b=0,vignette:w=0,noise:S=0}=h,{temperatureFilter:A,sharpnessFilter:C,hueFilter:F,blurFilter:G,adjustmentFilter:R,vignetteFilter:E,noiseFilter:B}=ir(h);return ie.useTick(()=>{if(n.current&&n.current.texture){const U=n.current.texture.baseTexture;U&&U.update(),s.current&&y.renderer.render(s.current)}}),D.useEffect(()=>{if(!Xr(g)){const U=Le.Texture.from(g);i(U)}},[g]),Y.jsx(jt,{...t,ref:e,ignoreTlForVideo:!0,pointerdown:v,pointerover:T,pointerout:x,children:Y.jsx(ie.Container,{ref:s,children:r&&Y.jsx(ie.Sprite,{texture:r,width:f,height:l,anchor:.5,x:u,y:c,ref:n,alpha:a?1:0,...!o&&a&&{interactive:!0,pointerdown:d},filters:[A,C,F,R,...b>0?[G]:[],...w>0?[E]:[],...S>0?[B]:[]]})})})});var $c=(t=>(t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t))($c||{});ue.Animations=_s,ue.BlendModes=$c,ue.Events=ve,ue.GsapPixieContext=Ct,ue.GsapPixieContextProvider=Jc,ue.PixiAnimatedSprite=Rc,ue.PixiAudioSprite=nS,ue.PixiGifSprite=rC,ue.PixiImageSprite=Kh,ue.PixiRemotionSprite=FC,ue.PixiSequence=PC,ue.PixiSequenceWrapper=MC,ue.PixiSvgPathSprite=iS,ue.PixiTextSprite=iC,ue.PixiVideoCanvasSyncSprite=RC,ue.PixiVideoSprite=Uc,ue.emitCustomEvent=lr,ue.newCustomEventEmitter=Qc,ue.useCustomEventListener=Ee,ue.useGsapEffect=dl,Object.defineProperty(ue,Symbol.toStringTag,{value:"Module"})});
|