@netless/app-slide 0.2.44 → 0.2.45-alpha.2
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.d.ts +5 -1
- package/dist/main.cjs.js +33 -33
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.es.js +13 -3
- package/dist/main.es.js.map +1 -1
- package/dist/main.iife.js +33 -33
- package/dist/main.iife.js.map +1 -1
- package/package.json +1 -1
- package/src/SlideController/index.ts +5 -1
- package/src/SlideDocsViewer/index.ts +12 -0
- package/src/SlideDocsViewer/style.scss +5 -0
- package/src/index.ts +1 -0
package/dist/main.cjs.js
CHANGED
|
@@ -4,19 +4,19 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @pixi/constants is licensed under the MIT License.
|
|
6
6
|
* http://www.opensource.org/licenses/mit-license
|
|
7
|
-
*/var O,M,I,D,k,
|
|
7
|
+
*/var O,M,I,D,k,V,W,X,et,ft,Dt,At,L,R,B,Y,P,H,tt;v.d(w,"a",function(){return L}),v.d(w,"b",function(){return D}),v.d(w,"c",function(){return I}),v.d(w,"d",function(){return tt}),v.d(w,"e",function(){return R}),v.d(w,"f",function(){return k}),v.d(w,"g",function(){return O}),v.d(w,"h",function(){return V}),v.d(w,"i",function(){return B}),v.d(w,"j",function(){return P}),v.d(w,"k",function(){return At}),v.d(w,"l",function(){return H}),v.d(w,"m",function(){return Y}),v.d(w,"n",function(){return M}),v.d(w,"o",function(){return et}),v.d(w,"p",function(){return ft}),v.d(w,"q",function(){return W}),v.d(w,"r",function(){return X}),v.d(w,"s",function(){return Dt}),function(G){G[G.WEBGL_LEGACY=0]="WEBGL_LEGACY",G[G.WEBGL=1]="WEBGL",G[G.WEBGL2=2]="WEBGL2"}(O||(O={})),function(G){G[G.UNKNOWN=0]="UNKNOWN",G[G.WEBGL=1]="WEBGL",G[G.CANVAS=2]="CANVAS"}(M||(M={})),function(G){G[G.COLOR=16384]="COLOR",G[G.DEPTH=256]="DEPTH",G[G.STENCIL=1024]="STENCIL"}(I||(I={})),function(G){G[G.NORMAL=0]="NORMAL",G[G.ADD=1]="ADD",G[G.MULTIPLY=2]="MULTIPLY",G[G.SCREEN=3]="SCREEN",G[G.OVERLAY=4]="OVERLAY",G[G.DARKEN=5]="DARKEN",G[G.LIGHTEN=6]="LIGHTEN",G[G.COLOR_DODGE=7]="COLOR_DODGE",G[G.COLOR_BURN=8]="COLOR_BURN",G[G.HARD_LIGHT=9]="HARD_LIGHT",G[G.SOFT_LIGHT=10]="SOFT_LIGHT",G[G.DIFFERENCE=11]="DIFFERENCE",G[G.EXCLUSION=12]="EXCLUSION",G[G.HUE=13]="HUE",G[G.SATURATION=14]="SATURATION",G[G.COLOR=15]="COLOR",G[G.LUMINOSITY=16]="LUMINOSITY",G[G.NORMAL_NPM=17]="NORMAL_NPM",G[G.ADD_NPM=18]="ADD_NPM",G[G.SCREEN_NPM=19]="SCREEN_NPM",G[G.NONE=20]="NONE",G[G.SRC_OVER=0]="SRC_OVER",G[G.SRC_IN=21]="SRC_IN",G[G.SRC_OUT=22]="SRC_OUT",G[G.SRC_ATOP=23]="SRC_ATOP",G[G.DST_OVER=24]="DST_OVER",G[G.DST_IN=25]="DST_IN",G[G.DST_OUT=26]="DST_OUT",G[G.DST_ATOP=27]="DST_ATOP",G[G.ERASE=26]="ERASE",G[G.SUBTRACT=28]="SUBTRACT",G[G.XOR=29]="XOR"}(D||(D={})),function(G){G[G.POINTS=0]="POINTS",G[G.LINES=1]="LINES",G[G.LINE_LOOP=2]="LINE_LOOP",G[G.LINE_STRIP=3]="LINE_STRIP",G[G.TRIANGLES=4]="TRIANGLES",G[G.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",G[G.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(k||(k={})),function(G){G[G.RGBA=6408]="RGBA",G[G.RGB=6407]="RGB",G[G.RG=33319]="RG",G[G.RED=6403]="RED",G[G.RGBA_INTEGER=36249]="RGBA_INTEGER",G[G.RGB_INTEGER=36248]="RGB_INTEGER",G[G.RG_INTEGER=33320]="RG_INTEGER",G[G.RED_INTEGER=36244]="RED_INTEGER",G[G.ALPHA=6406]="ALPHA",G[G.LUMINANCE=6409]="LUMINANCE",G[G.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",G[G.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",G[G.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(V||(V={})),function(G){G[G.TEXTURE_2D=3553]="TEXTURE_2D",G[G.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",G[G.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",G[G.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",G[G.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",G[G.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",G[G.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",G[G.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",G[G.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(W||(W={})),function(G){G[G.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",G[G.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",G[G.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",G[G.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",G[G.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",G[G.UNSIGNED_INT=5125]="UNSIGNED_INT",G[G.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",G[G.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",G[G.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",G[G.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",G[G.BYTE=5120]="BYTE",G[G.SHORT=5122]="SHORT",G[G.INT=5124]="INT",G[G.FLOAT=5126]="FLOAT",G[G.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",G[G.HALF_FLOAT=36193]="HALF_FLOAT"}(X||(X={})),function(G){G[G.FLOAT=0]="FLOAT",G[G.INT=1]="INT",G[G.UINT=2]="UINT"}(et||(et={})),function(G){G[G.NEAREST=0]="NEAREST",G[G.LINEAR=1]="LINEAR"}(ft||(ft={})),function(G){G[G.CLAMP=33071]="CLAMP",G[G.REPEAT=10497]="REPEAT",G[G.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(Dt||(Dt={})),function(G){G[G.OFF=0]="OFF",G[G.POW2=1]="POW2",G[G.ON=2]="ON",G[G.ON_MANUAL=3]="ON_MANUAL"}(At||(At={})),function(G){G[G.NPM=0]="NPM",G[G.UNPACK=1]="UNPACK",G[G.PMA=2]="PMA",G[G.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",G[G.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",G[G.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",G[G.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"}(L||(L={})),function(G){G[G.NO=0]="NO",G[G.YES=1]="YES",G[G.AUTO=2]="AUTO",G[G.BLEND=0]="BLEND",G[G.CLEAR=1]="CLEAR",G[G.BLIT=2]="BLIT"}(R||(R={})),function(G){G[G.AUTO=0]="AUTO",G[G.MANUAL=1]="MANUAL"}(B||(B={})),function(G){G.LOW="lowp",G.MEDIUM="mediump",G.HIGH="highp"}(Y||(Y={})),function(G){G[G.NONE=0]="NONE",G[G.SCISSOR=1]="SCISSOR",G[G.STENCIL=2]="STENCIL",G[G.SPRITE=3]="SPRITE"}(P||(P={})),function(G){G[G.NONE=0]="NONE",G[G.LOW=2]="LOW",G[G.MEDIUM=4]="MEDIUM",G[G.HIGH=8]="HIGH"}(H||(H={})),function(G){G[G.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",G[G.ARRAY_BUFFER=34962]="ARRAY_BUFFER",G[G.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(tt||(tt={}))},function(b,w,v){v.d(w,"a",function(){return X}),v.d(w,"b",function(){return D}),v.d(w,"c",function(){return et}),v.d(w,"d",function(){return L}),v.d(w,"e",function(){return At}),v.d(w,"f",function(){return M}),v.d(w,"g",function(){return k}),v.d(w,"h",function(){return ft}),v.d(w,"i",function(){return I}),v.d(w,"j",function(){return W}),v.d(w,"k",function(){return Dt}),v.d(w,"l",function(){return O}),v.d(w,"m",function(){return zt}),v.d(w,"n",function(){return Ot});/*!
|
|
8
8
|
* @pixi/math - v6.4.2
|
|
9
9
|
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
|
|
10
10
|
*
|
|
11
11
|
* @pixi/math is licensed under the MIT License.
|
|
12
12
|
* http://www.opensource.org/licenses/mit-license
|
|
13
|
-
*/var O,M=2*Math.PI,I=180/Math.PI,D=Math.PI/180;(function(st){st[st.POLY=0]="POLY",st[st.RECT=1]="RECT",st[st.CIRC=2]="CIRC",st[st.ELIP=3]="ELIP",st[st.RREC=4]="RREC"})(O||(O={}));var k=function(){function st(V,U){V===void 0&&(V=0),U===void 0&&(U=0),this.x=0,this.y=0,this.x=V,this.y=U}return st.prototype.clone=function(){return new st(this.x,this.y)},st.prototype.copyFrom=function(V){return this.set(V.x,V.y),this},st.prototype.copyTo=function(V){return V.set(this.x,this.y),V},st.prototype.equals=function(V){return V.x===this.x&&V.y===this.y},st.prototype.set=function(V,U){return V===void 0&&(V=0),U===void 0&&(U=V),this.x=V,this.y=U,this},st.prototype.toString=function(){return"[@pixi/math:Point x="+this.x+" y="+this.y+"]"},st}(),z=[new k,new k,new k,new k],W=function(){function st(V,U,dt,$){V===void 0&&(V=0),U===void 0&&(U=0),dt===void 0&&(dt=0),$===void 0&&($=0),this.x=Number(V),this.y=Number(U),this.width=Number(dt),this.height=Number($),this.type=O.RECT}return Object.defineProperty(st.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(st.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(st.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(st.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(st,"EMPTY",{get:function(){return new st(0,0,0,0)},enumerable:!1,configurable:!0}),st.prototype.clone=function(){return new st(this.x,this.y,this.width,this.height)},st.prototype.copyFrom=function(V){return this.x=V.x,this.y=V.y,this.width=V.width,this.height=V.height,this},st.prototype.copyTo=function(V){return V.x=this.x,V.y=this.y,V.width=this.width,V.height=this.height,V},st.prototype.contains=function(V,U){return!(this.width<=0||this.height<=0)&&V>=this.x&&V<this.x+this.width&&U>=this.y&&U<this.y+this.height},st.prototype.intersects=function(V,U){if(!U){var dt=this.x<V.x?V.x:this.x;if((this.right>V.right?V.right:this.right)<=dt)return!1;var $=this.y<V.y?V.y:this.y;return(this.bottom>V.bottom?V.bottom:this.bottom)>$}var vt=this.left,Lt=this.right,K=this.top,ct=this.bottom;if(Lt<=vt||ct<=K)return!1;var nt=z[0].set(V.left,V.top),_t=z[1].set(V.left,V.bottom),St=z[2].set(V.right,V.top),kt=z[3].set(V.right,V.bottom);if(St.x<=nt.x||_t.y<=nt.y)return!1;var Xt=Math.sign(U.a*U.d-U.b*U.c);if(Xt===0||(U.apply(nt,nt),U.apply(_t,_t),U.apply(St,St),U.apply(kt,kt),Math.max(nt.x,_t.x,St.x,kt.x)<=vt||Math.min(nt.x,_t.x,St.x,kt.x)>=Lt||Math.max(nt.y,_t.y,St.y,kt.y)<=K||Math.min(nt.y,_t.y,St.y,kt.y)>=ct))return!1;var Jt=Xt*(_t.y-nt.y),at=Xt*(nt.x-_t.x),_e=Jt*vt+at*K,Ue=Jt*Lt+at*K,Oe=Jt*vt+at*ct,Ae=Jt*Lt+at*ct;if(Math.max(_e,Ue,Oe,Ae)<=Jt*nt.x+at*nt.y||Math.min(_e,Ue,Oe,Ae)>=Jt*kt.x+at*kt.y)return!1;var ze=Xt*(nt.y-St.y),$e=Xt*(St.x-nt.x),cn=ze*vt+$e*K,ke=ze*Lt+$e*K,Ge=ze*vt+$e*ct,Rn=ze*Lt+$e*ct;return!(Math.max(cn,ke,Ge,Rn)<=ze*nt.x+$e*nt.y||Math.min(cn,ke,Ge,Rn)>=ze*kt.x+$e*kt.y)},st.prototype.pad=function(V,U){return V===void 0&&(V=0),U===void 0&&(U=V),this.x-=V,this.y-=U,this.width+=2*V,this.height+=2*U,this},st.prototype.fit=function(V){var U=Math.max(this.x,V.x),dt=Math.min(this.x+this.width,V.x+V.width),$=Math.max(this.y,V.y),vt=Math.min(this.y+this.height,V.y+V.height);return this.x=U,this.width=Math.max(dt-U,0),this.y=$,this.height=Math.max(vt-$,0),this},st.prototype.ceil=function(V,U){V===void 0&&(V=1),U===void 0&&(U=.001);var dt=Math.ceil((this.x+this.width-U)*V)/V,$=Math.ceil((this.y+this.height-U)*V)/V;return this.x=Math.floor((this.x+U)*V)/V,this.y=Math.floor((this.y+U)*V)/V,this.width=dt-this.x,this.height=$-this.y,this},st.prototype.enlarge=function(V){var U=Math.min(this.x,V.x),dt=Math.max(this.x+this.width,V.x+V.width),$=Math.min(this.y,V.y),vt=Math.max(this.y+this.height,V.y+V.height);return this.x=U,this.width=dt-U,this.y=$,this.height=vt-$,this},st.prototype.toString=function(){return"[@pixi/math:Rectangle x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},st}(),Y=function(){function st(V,U,dt){V===void 0&&(V=0),U===void 0&&(U=0),dt===void 0&&(dt=0),this.x=V,this.y=U,this.radius=dt,this.type=O.CIRC}return st.prototype.clone=function(){return new st(this.x,this.y,this.radius)},st.prototype.contains=function(V,U){if(this.radius<=0)return!1;var dt=this.radius*this.radius,$=this.x-V,vt=this.y-U;return($*=$)+(vt*=vt)<=dt},st.prototype.getBounds=function(){return new W(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},st.prototype.toString=function(){return"[@pixi/math:Circle x="+this.x+" y="+this.y+" radius="+this.radius+"]"},st}(),et=function(){function st(V,U,dt,$){V===void 0&&(V=0),U===void 0&&(U=0),dt===void 0&&(dt=0),$===void 0&&($=0),this.x=V,this.y=U,this.width=dt,this.height=$,this.type=O.ELIP}return st.prototype.clone=function(){return new st(this.x,this.y,this.width,this.height)},st.prototype.contains=function(V,U){if(this.width<=0||this.height<=0)return!1;var dt=(V-this.x)/this.width,$=(U-this.y)/this.height;return(dt*=dt)+($*=$)<=1},st.prototype.getBounds=function(){return new W(this.x-this.width,this.y-this.height,this.width,this.height)},st.prototype.toString=function(){return"[@pixi/math:Ellipse x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},st}(),ft=function(){function st(){for(var V=arguments,U=[],dt=0;dt<arguments.length;dt++)U[dt]=V[dt];var $=Array.isArray(U[0])?U[0]:U;if(typeof $[0]!="number"){for(var vt=[],Lt=0,K=$.length;Lt<K;Lt++)vt.push($[Lt].x,$[Lt].y);$=vt}this.points=$,this.type=O.POLY,this.closeStroke=!0}return st.prototype.clone=function(){var V=new st(this.points.slice());return V.closeStroke=this.closeStroke,V},st.prototype.contains=function(V,U){for(var dt=!1,$=this.points.length/2,vt=0,Lt=$-1;vt<$;Lt=vt++){var K=this.points[2*vt],ct=this.points[2*vt+1],nt=this.points[2*Lt],_t=this.points[2*Lt+1];ct>U!=_t>U&&V<(U-ct)/(_t-ct)*(nt-K)+K&&(dt=!dt)}return dt},st.prototype.toString=function(){return"[@pixi/math:PolygoncloseStroke="+this.closeStroke+"points="+this.points.reduce(function(V,U){return V+", "+U},"")+"]"},st}(),Dt=function(){function st(V,U,dt,$,vt){V===void 0&&(V=0),U===void 0&&(U=0),dt===void 0&&(dt=0),$===void 0&&($=0),vt===void 0&&(vt=20),this.x=V,this.y=U,this.width=dt,this.height=$,this.radius=vt,this.type=O.RREC}return st.prototype.clone=function(){return new st(this.x,this.y,this.width,this.height,this.radius)},st.prototype.contains=function(V,U){if(this.width<=0||this.height<=0)return!1;if(V>=this.x&&V<=this.x+this.width&&U>=this.y&&U<=this.y+this.height){var dt=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(U>=this.y+dt&&U<=this.y+this.height-dt||V>=this.x+dt&&V<=this.x+this.width-dt)return!0;var $=V-(this.x+dt),vt=U-(this.y+dt),Lt=dt*dt;if($*$+vt*vt<=Lt||($=V-(this.x+this.width-dt))*$+vt*vt<=Lt||$*$+(vt=U-(this.y+this.height-dt))*vt<=Lt||($=V-(this.x+dt))*$+vt*vt<=Lt)return!0}return!1},st.prototype.toString=function(){return"[@pixi/math:RoundedRectangle x="+this.x+" y="+this.y+"width="+this.width+" height="+this.height+" radius="+this.radius+"]"},st}(),At=function(){function st(V,U,dt,$){dt===void 0&&(dt=0),$===void 0&&($=0),this._x=dt,this._y=$,this.cb=V,this.scope=U}return st.prototype.clone=function(V,U){return V===void 0&&(V=this.cb),U===void 0&&(U=this.scope),new st(V,U,this._x,this._y)},st.prototype.set=function(V,U){return V===void 0&&(V=0),U===void 0&&(U=V),this._x===V&&this._y===U||(this._x=V,this._y=U,this.cb.call(this.scope)),this},st.prototype.copyFrom=function(V){return this._x===V.x&&this._y===V.y||(this._x=V.x,this._y=V.y,this.cb.call(this.scope)),this},st.prototype.copyTo=function(V){return V.set(this._x,this._y),V},st.prototype.equals=function(V){return V.x===this._x&&V.y===this._y},st.prototype.toString=function(){return"[@pixi/math:ObservablePoint x=0 y=0 scope="+this.scope+"]"},Object.defineProperty(st.prototype,"x",{get:function(){return this._x},set:function(V){this._x!==V&&(this._x=V,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(st.prototype,"y",{get:function(){return this._y},set:function(V){this._y!==V&&(this._y=V,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),st}(),L=function(){function st(V,U,dt,$,vt,Lt){V===void 0&&(V=1),U===void 0&&(U=0),dt===void 0&&(dt=0),$===void 0&&($=1),vt===void 0&&(vt=0),Lt===void 0&&(Lt=0),this.array=null,this.a=V,this.b=U,this.c=dt,this.d=$,this.tx=vt,this.ty=Lt}return st.prototype.fromArray=function(V){this.a=V[0],this.b=V[1],this.c=V[3],this.d=V[4],this.tx=V[2],this.ty=V[5]},st.prototype.set=function(V,U,dt,$,vt,Lt){return this.a=V,this.b=U,this.c=dt,this.d=$,this.tx=vt,this.ty=Lt,this},st.prototype.toArray=function(V,U){this.array||(this.array=new Float32Array(9));var dt=U||this.array;return V?(dt[0]=this.a,dt[1]=this.b,dt[2]=0,dt[3]=this.c,dt[4]=this.d,dt[5]=0,dt[6]=this.tx,dt[7]=this.ty,dt[8]=1):(dt[0]=this.a,dt[1]=this.c,dt[2]=this.tx,dt[3]=this.b,dt[4]=this.d,dt[5]=this.ty,dt[6]=0,dt[7]=0,dt[8]=1),dt},st.prototype.apply=function(V,U){U=U||new k;var dt=V.x,$=V.y;return U.x=this.a*dt+this.c*$+this.tx,U.y=this.b*dt+this.d*$+this.ty,U},st.prototype.applyInverse=function(V,U){U=U||new k;var dt=1/(this.a*this.d+this.c*-this.b),$=V.x,vt=V.y;return U.x=this.d*dt*$+-this.c*dt*vt+(this.ty*this.c-this.tx*this.d)*dt,U.y=this.a*dt*vt+-this.b*dt*$+(-this.ty*this.a+this.tx*this.b)*dt,U},st.prototype.translate=function(V,U){return this.tx+=V,this.ty+=U,this},st.prototype.scale=function(V,U){return this.a*=V,this.d*=U,this.c*=V,this.b*=U,this.tx*=V,this.ty*=U,this},st.prototype.rotate=function(V){var U=Math.cos(V),dt=Math.sin(V),$=this.a,vt=this.c,Lt=this.tx;return this.a=$*U-this.b*dt,this.b=$*dt+this.b*U,this.c=vt*U-this.d*dt,this.d=vt*dt+this.d*U,this.tx=Lt*U-this.ty*dt,this.ty=Lt*dt+this.ty*U,this},st.prototype.append=function(V){var U=this.a,dt=this.b,$=this.c,vt=this.d;return this.a=V.a*U+V.b*$,this.b=V.a*dt+V.b*vt,this.c=V.c*U+V.d*$,this.d=V.c*dt+V.d*vt,this.tx=V.tx*U+V.ty*$+this.tx,this.ty=V.tx*dt+V.ty*vt+this.ty,this},st.prototype.setTransform=function(V,U,dt,$,vt,Lt,K,ct,nt){return this.a=Math.cos(K+nt)*vt,this.b=Math.sin(K+nt)*vt,this.c=-Math.sin(K-ct)*Lt,this.d=Math.cos(K-ct)*Lt,this.tx=V-(dt*this.a+$*this.c),this.ty=U-(dt*this.b+$*this.d),this},st.prototype.prepend=function(V){var U=this.tx;if(V.a!==1||V.b!==0||V.c!==0||V.d!==1){var dt=this.a,$=this.c;this.a=dt*V.a+this.b*V.c,this.b=dt*V.b+this.b*V.d,this.c=$*V.a+this.d*V.c,this.d=$*V.b+this.d*V.d}return this.tx=U*V.a+this.ty*V.c+V.tx,this.ty=U*V.b+this.ty*V.d+V.ty,this},st.prototype.decompose=function(V){var U=this.a,dt=this.b,$=this.c,vt=this.d,Lt=V.pivot,K=-Math.atan2(-$,vt),ct=Math.atan2(dt,U),nt=Math.abs(K+ct);return nt<1e-5||Math.abs(M-nt)<1e-5?(V.rotation=ct,V.skew.x=V.skew.y=0):(V.rotation=0,V.skew.x=K,V.skew.y=ct),V.scale.x=Math.sqrt(U*U+dt*dt),V.scale.y=Math.sqrt($*$+vt*vt),V.position.x=this.tx+(Lt.x*U+Lt.y*$),V.position.y=this.ty+(Lt.x*dt+Lt.y*vt),V},st.prototype.invert=function(){var V=this.a,U=this.b,dt=this.c,$=this.d,vt=this.tx,Lt=V*$-U*dt;return this.a=$/Lt,this.b=-U/Lt,this.c=-dt/Lt,this.d=V/Lt,this.tx=(dt*this.ty-$*vt)/Lt,this.ty=-(V*this.ty-U*vt)/Lt,this},st.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},st.prototype.clone=function(){var V=new st;return V.a=this.a,V.b=this.b,V.c=this.c,V.d=this.d,V.tx=this.tx,V.ty=this.ty,V},st.prototype.copyTo=function(V){return V.a=this.a,V.b=this.b,V.c=this.c,V.d=this.d,V.tx=this.tx,V.ty=this.ty,V},st.prototype.copyFrom=function(V){return this.a=V.a,this.b=V.b,this.c=V.c,this.d=V.d,this.tx=V.tx,this.ty=V.ty,this},st.prototype.toString=function(){return"[@pixi/math:Matrix a="+this.a+" b="+this.b+" c="+this.c+" d="+this.d+" tx="+this.tx+" ty="+this.ty+"]"},Object.defineProperty(st,"IDENTITY",{get:function(){return new st},enumerable:!1,configurable:!0}),Object.defineProperty(st,"TEMP_MATRIX",{get:function(){return new st},enumerable:!1,configurable:!0}),st}(),R=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],B=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],X=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],P=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],H=[],tt=[],G=Math.sign;(function(){for(var st=0;st<16;st++){var V=[];H.push(V);for(var U=0;U<16;U++)for(var dt=G(R[st]*R[U]+X[st]*B[U]),$=G(B[st]*R[U]+P[st]*B[U]),vt=G(R[st]*X[U]+X[st]*P[U]),Lt=G(B[st]*X[U]+P[st]*P[U]),K=0;K<16;K++)if(R[K]===dt&&B[K]===$&&X[K]===vt&&P[K]===Lt){V.push(K);break}}for(st=0;st<16;st++){var ct=new L;ct.set(R[st],B[st],X[st],P[st],0,0),tt.push(ct)}})();var Ot={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:function(st){return R[st]},uY:function(st){return B[st]},vX:function(st){return X[st]},vY:function(st){return P[st]},inv:function(st){return 8&st?15&st:7&-st},add:function(st,V){return H[st][V]},sub:function(st,V){return H[st][Ot.inv(V)]},rotate180:function(st){return 4^st},isVertical:function(st){return(3&st)==2},byDirection:function(st,V){return 2*Math.abs(st)<=Math.abs(V)?V>=0?Ot.S:Ot.N:2*Math.abs(V)<=Math.abs(st)?st>0?Ot.E:Ot.W:V>0?st>0?Ot.SE:Ot.SW:st>0?Ot.NE:Ot.NW},matrixAppendRotationInv:function(st,V,U,dt){U===void 0&&(U=0),dt===void 0&&(dt=0);var $=tt[Ot.inv(V)];$.tx=U,$.ty=dt,st.append($)}},zt=function(){function st(){this.worldTransform=new L,this.localTransform=new L,this.position=new At(this.onChange,this,0,0),this.scale=new At(this.onChange,this,1,1),this.pivot=new At(this.onChange,this,0,0),this.skew=new At(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}return st.prototype.onChange=function(){this._localID++},st.prototype.updateSkew=function(){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++},st.prototype.toString=function(){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+") ]"},st.prototype.updateLocalTransform=function(){var V=this.localTransform;this._localID!==this._currentLocalID&&(V.a=this._cx*this.scale.x,V.b=this._sx*this.scale.x,V.c=this._cy*this.scale.y,V.d=this._sy*this.scale.y,V.tx=this.position.x-(this.pivot.x*V.a+this.pivot.y*V.c),V.ty=this.position.y-(this.pivot.x*V.b+this.pivot.y*V.d),this._currentLocalID=this._localID,this._parentID=-1)},st.prototype.updateTransform=function(V){var U=this.localTransform;if(this._localID!==this._currentLocalID&&(U.a=this._cx*this.scale.x,U.b=this._sx*this.scale.x,U.c=this._cy*this.scale.y,U.d=this._sy*this.scale.y,U.tx=this.position.x-(this.pivot.x*U.a+this.pivot.y*U.c),U.ty=this.position.y-(this.pivot.x*U.b+this.pivot.y*U.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==V._worldID){var dt=V.worldTransform,$=this.worldTransform;$.a=U.a*dt.a+U.b*dt.c,$.b=U.a*dt.b+U.b*dt.d,$.c=U.c*dt.a+U.d*dt.c,$.d=U.c*dt.b+U.d*dt.d,$.tx=U.tx*dt.a+U.ty*dt.c+dt.tx,$.ty=U.tx*dt.b+U.ty*dt.d+dt.ty,this._parentID=V._worldID,this._worldID++}},st.prototype.setFromMatrix=function(V){V.decompose(this),this._localID++},Object.defineProperty(st.prototype,"rotation",{get:function(){return this._rotation},set:function(V){this._rotation!==V&&(this._rotation=V,this.updateSkew())},enumerable:!1,configurable:!0}),st.IDENTITY=new st,st}()},function(b,w,v){v.d(w,"a",function(){return xi}),v.d(w,"b",function(){return $}),v.d(w,"c",function(){return B}),v.d(w,"d",function(){return Eo}),v.d(w,"e",function(){return or}),v.d(w,"f",function(){return Mo}),v.d(w,"g",function(){return Fr}),v.d(w,"h",function(){return Xt}),v.d(w,"i",function(){return L}),v.d(w,"j",function(){return tt}),v.d(w,"k",function(){return Mi}),v.d(w,"l",function(){return Oe}),v.d(w,"m",function(){return pe}),v.d(w,"n",function(){return jn}),v.d(w,"o",function(){return ze}),v.d(w,"p",function(){return nt}),v.d(w,"q",function(){return Oi}),v.d(w,"r",function(){return Ki}),v.d(w,"s",function(){return Vr}),v.d(w,"t",function(){return ct}),v.d(w,"u",function(){return Lr}),v.d(w,"v",function(){return cn}),v.d(w,"w",function(){return st}),v.d(w,"x",function(){return So}),v.d(w,"y",function(){return so}),v.d(w,"z",function(){return Wn}),v.d(w,"A",function(){return fi});var O=v(4),M=v(0),I=v(3),D=v(12),k=v(7),z=v(1);/*!
|
|
13
|
+
*/var O,M=2*Math.PI,I=180/Math.PI,D=Math.PI/180;(function(st){st[st.POLY=0]="POLY",st[st.RECT=1]="RECT",st[st.CIRC=2]="CIRC",st[st.ELIP=3]="ELIP",st[st.RREC=4]="RREC"})(O||(O={}));var k=function(){function st(z,U){z===void 0&&(z=0),U===void 0&&(U=0),this.x=0,this.y=0,this.x=z,this.y=U}return st.prototype.clone=function(){return new st(this.x,this.y)},st.prototype.copyFrom=function(z){return this.set(z.x,z.y),this},st.prototype.copyTo=function(z){return z.set(this.x,this.y),z},st.prototype.equals=function(z){return z.x===this.x&&z.y===this.y},st.prototype.set=function(z,U){return z===void 0&&(z=0),U===void 0&&(U=z),this.x=z,this.y=U,this},st.prototype.toString=function(){return"[@pixi/math:Point x="+this.x+" y="+this.y+"]"},st}(),V=[new k,new k,new k,new k],W=function(){function st(z,U,dt,$){z===void 0&&(z=0),U===void 0&&(U=0),dt===void 0&&(dt=0),$===void 0&&($=0),this.x=Number(z),this.y=Number(U),this.width=Number(dt),this.height=Number($),this.type=O.RECT}return Object.defineProperty(st.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(st.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(st.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(st.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(st,"EMPTY",{get:function(){return new st(0,0,0,0)},enumerable:!1,configurable:!0}),st.prototype.clone=function(){return new st(this.x,this.y,this.width,this.height)},st.prototype.copyFrom=function(z){return this.x=z.x,this.y=z.y,this.width=z.width,this.height=z.height,this},st.prototype.copyTo=function(z){return z.x=this.x,z.y=this.y,z.width=this.width,z.height=this.height,z},st.prototype.contains=function(z,U){return!(this.width<=0||this.height<=0)&&z>=this.x&&z<this.x+this.width&&U>=this.y&&U<this.y+this.height},st.prototype.intersects=function(z,U){if(!U){var dt=this.x<z.x?z.x:this.x;if((this.right>z.right?z.right:this.right)<=dt)return!1;var $=this.y<z.y?z.y:this.y;return(this.bottom>z.bottom?z.bottom:this.bottom)>$}var vt=this.left,Lt=this.right,K=this.top,ct=this.bottom;if(Lt<=vt||ct<=K)return!1;var nt=V[0].set(z.left,z.top),_t=V[1].set(z.left,z.bottom),St=V[2].set(z.right,z.top),kt=V[3].set(z.right,z.bottom);if(St.x<=nt.x||_t.y<=nt.y)return!1;var Xt=Math.sign(U.a*U.d-U.b*U.c);if(Xt===0||(U.apply(nt,nt),U.apply(_t,_t),U.apply(St,St),U.apply(kt,kt),Math.max(nt.x,_t.x,St.x,kt.x)<=vt||Math.min(nt.x,_t.x,St.x,kt.x)>=Lt||Math.max(nt.y,_t.y,St.y,kt.y)<=K||Math.min(nt.y,_t.y,St.y,kt.y)>=ct))return!1;var Jt=Xt*(_t.y-nt.y),at=Xt*(nt.x-_t.x),_e=Jt*vt+at*K,Ue=Jt*Lt+at*K,Oe=Jt*vt+at*ct,Ae=Jt*Lt+at*ct;if(Math.max(_e,Ue,Oe,Ae)<=Jt*nt.x+at*nt.y||Math.min(_e,Ue,Oe,Ae)>=Jt*kt.x+at*kt.y)return!1;var ze=Xt*(nt.y-St.y),$e=Xt*(St.x-nt.x),cn=ze*vt+$e*K,ke=ze*Lt+$e*K,Ge=ze*vt+$e*ct,Rn=ze*Lt+$e*ct;return!(Math.max(cn,ke,Ge,Rn)<=ze*nt.x+$e*nt.y||Math.min(cn,ke,Ge,Rn)>=ze*kt.x+$e*kt.y)},st.prototype.pad=function(z,U){return z===void 0&&(z=0),U===void 0&&(U=z),this.x-=z,this.y-=U,this.width+=2*z,this.height+=2*U,this},st.prototype.fit=function(z){var U=Math.max(this.x,z.x),dt=Math.min(this.x+this.width,z.x+z.width),$=Math.max(this.y,z.y),vt=Math.min(this.y+this.height,z.y+z.height);return this.x=U,this.width=Math.max(dt-U,0),this.y=$,this.height=Math.max(vt-$,0),this},st.prototype.ceil=function(z,U){z===void 0&&(z=1),U===void 0&&(U=.001);var dt=Math.ceil((this.x+this.width-U)*z)/z,$=Math.ceil((this.y+this.height-U)*z)/z;return this.x=Math.floor((this.x+U)*z)/z,this.y=Math.floor((this.y+U)*z)/z,this.width=dt-this.x,this.height=$-this.y,this},st.prototype.enlarge=function(z){var U=Math.min(this.x,z.x),dt=Math.max(this.x+this.width,z.x+z.width),$=Math.min(this.y,z.y),vt=Math.max(this.y+this.height,z.y+z.height);return this.x=U,this.width=dt-U,this.y=$,this.height=vt-$,this},st.prototype.toString=function(){return"[@pixi/math:Rectangle x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},st}(),X=function(){function st(z,U,dt){z===void 0&&(z=0),U===void 0&&(U=0),dt===void 0&&(dt=0),this.x=z,this.y=U,this.radius=dt,this.type=O.CIRC}return st.prototype.clone=function(){return new st(this.x,this.y,this.radius)},st.prototype.contains=function(z,U){if(this.radius<=0)return!1;var dt=this.radius*this.radius,$=this.x-z,vt=this.y-U;return($*=$)+(vt*=vt)<=dt},st.prototype.getBounds=function(){return new W(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},st.prototype.toString=function(){return"[@pixi/math:Circle x="+this.x+" y="+this.y+" radius="+this.radius+"]"},st}(),et=function(){function st(z,U,dt,$){z===void 0&&(z=0),U===void 0&&(U=0),dt===void 0&&(dt=0),$===void 0&&($=0),this.x=z,this.y=U,this.width=dt,this.height=$,this.type=O.ELIP}return st.prototype.clone=function(){return new st(this.x,this.y,this.width,this.height)},st.prototype.contains=function(z,U){if(this.width<=0||this.height<=0)return!1;var dt=(z-this.x)/this.width,$=(U-this.y)/this.height;return(dt*=dt)+($*=$)<=1},st.prototype.getBounds=function(){return new W(this.x-this.width,this.y-this.height,this.width,this.height)},st.prototype.toString=function(){return"[@pixi/math:Ellipse x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},st}(),ft=function(){function st(){for(var z=arguments,U=[],dt=0;dt<arguments.length;dt++)U[dt]=z[dt];var $=Array.isArray(U[0])?U[0]:U;if(typeof $[0]!="number"){for(var vt=[],Lt=0,K=$.length;Lt<K;Lt++)vt.push($[Lt].x,$[Lt].y);$=vt}this.points=$,this.type=O.POLY,this.closeStroke=!0}return st.prototype.clone=function(){var z=new st(this.points.slice());return z.closeStroke=this.closeStroke,z},st.prototype.contains=function(z,U){for(var dt=!1,$=this.points.length/2,vt=0,Lt=$-1;vt<$;Lt=vt++){var K=this.points[2*vt],ct=this.points[2*vt+1],nt=this.points[2*Lt],_t=this.points[2*Lt+1];ct>U!=_t>U&&z<(U-ct)/(_t-ct)*(nt-K)+K&&(dt=!dt)}return dt},st.prototype.toString=function(){return"[@pixi/math:PolygoncloseStroke="+this.closeStroke+"points="+this.points.reduce(function(z,U){return z+", "+U},"")+"]"},st}(),Dt=function(){function st(z,U,dt,$,vt){z===void 0&&(z=0),U===void 0&&(U=0),dt===void 0&&(dt=0),$===void 0&&($=0),vt===void 0&&(vt=20),this.x=z,this.y=U,this.width=dt,this.height=$,this.radius=vt,this.type=O.RREC}return st.prototype.clone=function(){return new st(this.x,this.y,this.width,this.height,this.radius)},st.prototype.contains=function(z,U){if(this.width<=0||this.height<=0)return!1;if(z>=this.x&&z<=this.x+this.width&&U>=this.y&&U<=this.y+this.height){var dt=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(U>=this.y+dt&&U<=this.y+this.height-dt||z>=this.x+dt&&z<=this.x+this.width-dt)return!0;var $=z-(this.x+dt),vt=U-(this.y+dt),Lt=dt*dt;if($*$+vt*vt<=Lt||($=z-(this.x+this.width-dt))*$+vt*vt<=Lt||$*$+(vt=U-(this.y+this.height-dt))*vt<=Lt||($=z-(this.x+dt))*$+vt*vt<=Lt)return!0}return!1},st.prototype.toString=function(){return"[@pixi/math:RoundedRectangle x="+this.x+" y="+this.y+"width="+this.width+" height="+this.height+" radius="+this.radius+"]"},st}(),At=function(){function st(z,U,dt,$){dt===void 0&&(dt=0),$===void 0&&($=0),this._x=dt,this._y=$,this.cb=z,this.scope=U}return st.prototype.clone=function(z,U){return z===void 0&&(z=this.cb),U===void 0&&(U=this.scope),new st(z,U,this._x,this._y)},st.prototype.set=function(z,U){return z===void 0&&(z=0),U===void 0&&(U=z),this._x===z&&this._y===U||(this._x=z,this._y=U,this.cb.call(this.scope)),this},st.prototype.copyFrom=function(z){return this._x===z.x&&this._y===z.y||(this._x=z.x,this._y=z.y,this.cb.call(this.scope)),this},st.prototype.copyTo=function(z){return z.set(this._x,this._y),z},st.prototype.equals=function(z){return z.x===this._x&&z.y===this._y},st.prototype.toString=function(){return"[@pixi/math:ObservablePoint x=0 y=0 scope="+this.scope+"]"},Object.defineProperty(st.prototype,"x",{get:function(){return this._x},set:function(z){this._x!==z&&(this._x=z,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(st.prototype,"y",{get:function(){return this._y},set:function(z){this._y!==z&&(this._y=z,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),st}(),L=function(){function st(z,U,dt,$,vt,Lt){z===void 0&&(z=1),U===void 0&&(U=0),dt===void 0&&(dt=0),$===void 0&&($=1),vt===void 0&&(vt=0),Lt===void 0&&(Lt=0),this.array=null,this.a=z,this.b=U,this.c=dt,this.d=$,this.tx=vt,this.ty=Lt}return st.prototype.fromArray=function(z){this.a=z[0],this.b=z[1],this.c=z[3],this.d=z[4],this.tx=z[2],this.ty=z[5]},st.prototype.set=function(z,U,dt,$,vt,Lt){return this.a=z,this.b=U,this.c=dt,this.d=$,this.tx=vt,this.ty=Lt,this},st.prototype.toArray=function(z,U){this.array||(this.array=new Float32Array(9));var dt=U||this.array;return z?(dt[0]=this.a,dt[1]=this.b,dt[2]=0,dt[3]=this.c,dt[4]=this.d,dt[5]=0,dt[6]=this.tx,dt[7]=this.ty,dt[8]=1):(dt[0]=this.a,dt[1]=this.c,dt[2]=this.tx,dt[3]=this.b,dt[4]=this.d,dt[5]=this.ty,dt[6]=0,dt[7]=0,dt[8]=1),dt},st.prototype.apply=function(z,U){U=U||new k;var dt=z.x,$=z.y;return U.x=this.a*dt+this.c*$+this.tx,U.y=this.b*dt+this.d*$+this.ty,U},st.prototype.applyInverse=function(z,U){U=U||new k;var dt=1/(this.a*this.d+this.c*-this.b),$=z.x,vt=z.y;return U.x=this.d*dt*$+-this.c*dt*vt+(this.ty*this.c-this.tx*this.d)*dt,U.y=this.a*dt*vt+-this.b*dt*$+(-this.ty*this.a+this.tx*this.b)*dt,U},st.prototype.translate=function(z,U){return this.tx+=z,this.ty+=U,this},st.prototype.scale=function(z,U){return this.a*=z,this.d*=U,this.c*=z,this.b*=U,this.tx*=z,this.ty*=U,this},st.prototype.rotate=function(z){var U=Math.cos(z),dt=Math.sin(z),$=this.a,vt=this.c,Lt=this.tx;return this.a=$*U-this.b*dt,this.b=$*dt+this.b*U,this.c=vt*U-this.d*dt,this.d=vt*dt+this.d*U,this.tx=Lt*U-this.ty*dt,this.ty=Lt*dt+this.ty*U,this},st.prototype.append=function(z){var U=this.a,dt=this.b,$=this.c,vt=this.d;return this.a=z.a*U+z.b*$,this.b=z.a*dt+z.b*vt,this.c=z.c*U+z.d*$,this.d=z.c*dt+z.d*vt,this.tx=z.tx*U+z.ty*$+this.tx,this.ty=z.tx*dt+z.ty*vt+this.ty,this},st.prototype.setTransform=function(z,U,dt,$,vt,Lt,K,ct,nt){return this.a=Math.cos(K+nt)*vt,this.b=Math.sin(K+nt)*vt,this.c=-Math.sin(K-ct)*Lt,this.d=Math.cos(K-ct)*Lt,this.tx=z-(dt*this.a+$*this.c),this.ty=U-(dt*this.b+$*this.d),this},st.prototype.prepend=function(z){var U=this.tx;if(z.a!==1||z.b!==0||z.c!==0||z.d!==1){var dt=this.a,$=this.c;this.a=dt*z.a+this.b*z.c,this.b=dt*z.b+this.b*z.d,this.c=$*z.a+this.d*z.c,this.d=$*z.b+this.d*z.d}return this.tx=U*z.a+this.ty*z.c+z.tx,this.ty=U*z.b+this.ty*z.d+z.ty,this},st.prototype.decompose=function(z){var U=this.a,dt=this.b,$=this.c,vt=this.d,Lt=z.pivot,K=-Math.atan2(-$,vt),ct=Math.atan2(dt,U),nt=Math.abs(K+ct);return nt<1e-5||Math.abs(M-nt)<1e-5?(z.rotation=ct,z.skew.x=z.skew.y=0):(z.rotation=0,z.skew.x=K,z.skew.y=ct),z.scale.x=Math.sqrt(U*U+dt*dt),z.scale.y=Math.sqrt($*$+vt*vt),z.position.x=this.tx+(Lt.x*U+Lt.y*$),z.position.y=this.ty+(Lt.x*dt+Lt.y*vt),z},st.prototype.invert=function(){var z=this.a,U=this.b,dt=this.c,$=this.d,vt=this.tx,Lt=z*$-U*dt;return this.a=$/Lt,this.b=-U/Lt,this.c=-dt/Lt,this.d=z/Lt,this.tx=(dt*this.ty-$*vt)/Lt,this.ty=-(z*this.ty-U*vt)/Lt,this},st.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},st.prototype.clone=function(){var z=new st;return z.a=this.a,z.b=this.b,z.c=this.c,z.d=this.d,z.tx=this.tx,z.ty=this.ty,z},st.prototype.copyTo=function(z){return z.a=this.a,z.b=this.b,z.c=this.c,z.d=this.d,z.tx=this.tx,z.ty=this.ty,z},st.prototype.copyFrom=function(z){return this.a=z.a,this.b=z.b,this.c=z.c,this.d=z.d,this.tx=z.tx,this.ty=z.ty,this},st.prototype.toString=function(){return"[@pixi/math:Matrix a="+this.a+" b="+this.b+" c="+this.c+" d="+this.d+" tx="+this.tx+" ty="+this.ty+"]"},Object.defineProperty(st,"IDENTITY",{get:function(){return new st},enumerable:!1,configurable:!0}),Object.defineProperty(st,"TEMP_MATRIX",{get:function(){return new st},enumerable:!1,configurable:!0}),st}(),R=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],B=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Y=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],P=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],H=[],tt=[],G=Math.sign;(function(){for(var st=0;st<16;st++){var z=[];H.push(z);for(var U=0;U<16;U++)for(var dt=G(R[st]*R[U]+Y[st]*B[U]),$=G(B[st]*R[U]+P[st]*B[U]),vt=G(R[st]*Y[U]+Y[st]*P[U]),Lt=G(B[st]*Y[U]+P[st]*P[U]),K=0;K<16;K++)if(R[K]===dt&&B[K]===$&&Y[K]===vt&&P[K]===Lt){z.push(K);break}}for(st=0;st<16;st++){var ct=new L;ct.set(R[st],B[st],Y[st],P[st],0,0),tt.push(ct)}})();var Ot={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:function(st){return R[st]},uY:function(st){return B[st]},vX:function(st){return Y[st]},vY:function(st){return P[st]},inv:function(st){return 8&st?15&st:7&-st},add:function(st,z){return H[st][z]},sub:function(st,z){return H[st][Ot.inv(z)]},rotate180:function(st){return 4^st},isVertical:function(st){return(3&st)==2},byDirection:function(st,z){return 2*Math.abs(st)<=Math.abs(z)?z>=0?Ot.S:Ot.N:2*Math.abs(z)<=Math.abs(st)?st>0?Ot.E:Ot.W:z>0?st>0?Ot.SE:Ot.SW:st>0?Ot.NE:Ot.NW},matrixAppendRotationInv:function(st,z,U,dt){U===void 0&&(U=0),dt===void 0&&(dt=0);var $=tt[Ot.inv(z)];$.tx=U,$.ty=dt,st.append($)}},zt=function(){function st(){this.worldTransform=new L,this.localTransform=new L,this.position=new At(this.onChange,this,0,0),this.scale=new At(this.onChange,this,1,1),this.pivot=new At(this.onChange,this,0,0),this.skew=new At(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}return st.prototype.onChange=function(){this._localID++},st.prototype.updateSkew=function(){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++},st.prototype.toString=function(){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+") ]"},st.prototype.updateLocalTransform=function(){var z=this.localTransform;this._localID!==this._currentLocalID&&(z.a=this._cx*this.scale.x,z.b=this._sx*this.scale.x,z.c=this._cy*this.scale.y,z.d=this._sy*this.scale.y,z.tx=this.position.x-(this.pivot.x*z.a+this.pivot.y*z.c),z.ty=this.position.y-(this.pivot.x*z.b+this.pivot.y*z.d),this._currentLocalID=this._localID,this._parentID=-1)},st.prototype.updateTransform=function(z){var U=this.localTransform;if(this._localID!==this._currentLocalID&&(U.a=this._cx*this.scale.x,U.b=this._sx*this.scale.x,U.c=this._cy*this.scale.y,U.d=this._sy*this.scale.y,U.tx=this.position.x-(this.pivot.x*U.a+this.pivot.y*U.c),U.ty=this.position.y-(this.pivot.x*U.b+this.pivot.y*U.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==z._worldID){var dt=z.worldTransform,$=this.worldTransform;$.a=U.a*dt.a+U.b*dt.c,$.b=U.a*dt.b+U.b*dt.d,$.c=U.c*dt.a+U.d*dt.c,$.d=U.c*dt.b+U.d*dt.d,$.tx=U.tx*dt.a+U.ty*dt.c+dt.tx,$.ty=U.tx*dt.b+U.ty*dt.d+dt.ty,this._parentID=z._worldID,this._worldID++}},st.prototype.setFromMatrix=function(z){z.decompose(this),this._localID++},Object.defineProperty(st.prototype,"rotation",{get:function(){return this._rotation},set:function(z){this._rotation!==z&&(this._rotation=z,this.updateSkew())},enumerable:!1,configurable:!0}),st.IDENTITY=new st,st}()},function(b,w,v){v.d(w,"a",function(){return xi}),v.d(w,"b",function(){return $}),v.d(w,"c",function(){return B}),v.d(w,"d",function(){return Eo}),v.d(w,"e",function(){return or}),v.d(w,"f",function(){return Mo}),v.d(w,"g",function(){return Fr}),v.d(w,"h",function(){return Xt}),v.d(w,"i",function(){return L}),v.d(w,"j",function(){return tt}),v.d(w,"k",function(){return Mi}),v.d(w,"l",function(){return Oe}),v.d(w,"m",function(){return pe}),v.d(w,"n",function(){return jn}),v.d(w,"o",function(){return ze}),v.d(w,"p",function(){return nt}),v.d(w,"q",function(){return Oi}),v.d(w,"r",function(){return Ki}),v.d(w,"s",function(){return Vr}),v.d(w,"t",function(){return ct}),v.d(w,"u",function(){return Lr}),v.d(w,"v",function(){return cn}),v.d(w,"w",function(){return st}),v.d(w,"x",function(){return So}),v.d(w,"y",function(){return so}),v.d(w,"z",function(){return Wn}),v.d(w,"A",function(){return fi});var O=v(4),M=v(0),I=v(3),D=v(12),k=v(7),V=v(1);/*!
|
|
14
14
|
* @pixi/core - v6.4.2
|
|
15
15
|
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
|
|
16
16
|
*
|
|
17
17
|
* @pixi/core is licensed under the MIT License.
|
|
18
18
|
* http://www.opensource.org/licenses/mit-license
|
|
19
|
-
*/O.b.PREFER_ENV=I.isMobile.any?M.g.WEBGL:M.g.WEBGL2,O.b.STRICT_TEXTURE_CACHE=!1;var W=[];function
|
|
19
|
+
*/O.b.PREFER_ENV=I.isMobile.any?M.g.WEBGL:M.g.WEBGL2,O.b.STRICT_TEXTURE_CACHE=!1;var W=[];function X(q,g){if(!q)return null;var m="";if(typeof q=="string"){var _=/\.(\w{3,4})(?:$|\?|#)/i.exec(q);_&&(m=_[1].toLowerCase())}for(var N=W.length-1;N>=0;--N){var J=W[N];if(J.test&&J.test(q,m))return new J(q,g)}throw new Error("Unrecognized source type to auto-detect Resource")}/*! *****************************************************************************
|
|
20
20
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
21
21
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
22
22
|
this file except in compliance with the License. You may obtain a copy of the
|
|
@@ -29,7 +29,7 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
|
29
29
|
|
|
30
30
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
31
31
|
and limitations under the License.
|
|
32
|
-
***************************************************************************** */var et=function(q,g){return(et=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,_){m.__proto__=_}||function(m,_){for(var N in _)_.hasOwnProperty(N)&&(m[N]=_[N])})(q,g)};function ft(q,g){function m(){this.constructor=q}et(q,g),q.prototype=g===null?Object.create(g):(m.prototype=g.prototype,new m)}var Dt=function(){return(Dt=Object.assign||function(q){for(var g,m=arguments,_=1,N=arguments.length;_<N;_++)for(var J in g=m[_])Object.prototype.hasOwnProperty.call(g,J)&&(q[J]=g[J]);return q}).apply(this,arguments)},At=function(){function q(g,m){g===void 0&&(g=0),m===void 0&&(m=0),this._width=g,this._height=m,this.destroyed=!1,this.internal=!1,this.onResize=new D.a("setRealSize"),this.onUpdate=new D.a("update"),this.onError=new D.a("onError")}return q.prototype.bind=function(g){this.onResize.add(g),this.onUpdate.add(g),this.onError.add(g),(this._width||this._height)&&this.onResize.emit(this._width,this._height)},q.prototype.unbind=function(g){this.onResize.remove(g),this.onUpdate.remove(g),this.onError.remove(g)},q.prototype.resize=function(g,m){g===this._width&&m===this._height||(this._width=g,this._height=m,this.onResize.emit(g,m))},Object.defineProperty(q.prototype,"valid",{get:function(){return!!this._width&&!!this._height},enumerable:!1,configurable:!0}),q.prototype.update=function(){this.destroyed||this.onUpdate.emit()},q.prototype.load=function(){return Promise.resolve(this)},Object.defineProperty(q.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"height",{get:function(){return this._height},enumerable:!1,configurable:!0}),q.prototype.style=function(g,m,_){return!1},q.prototype.dispose=function(){},q.prototype.destroy=function(){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)},q.test=function(g,m){return!1},q}(),L=function(q){function g(m,_){var N=this,J=_||{},lt=J.width,xt=J.height;if(!lt||!xt)throw new Error("BufferResource width or height invalid");return(N=q.call(this,lt,xt)||this).data=m,N}return ft(g,q),g.prototype.upload=function(m,_,N){var J=m.gl;J.pixelStorei(J.UNPACK_PREMULTIPLY_ALPHA_WEBGL,_.alphaMode===M.a.UNPACK);var lt=_.realWidth,xt=_.realHeight;return N.width===lt&&N.height===xt?J.texSubImage2D(_.target,0,0,0,lt,xt,_.format,N.type,this.data):(N.width=lt,N.height=xt,J.texImage2D(_.target,0,N.internalFormat,lt,xt,0,_.format,N.type,this.data)),!0},g.prototype.dispose=function(){this.data=null},g.test=function(m){return m instanceof Float32Array||m instanceof Uint8Array||m instanceof Uint32Array},g}(At),R={scaleMode:M.p.NEAREST,format:M.h.RGBA,alphaMode:M.a.NPM},B=function(q){function g(m,_){m===void 0&&(m=null),_===void 0&&(_=null);var N=q.call(this)||this,J=(_=_||{}).alphaMode,lt=_.mipmap,xt=_.anisotropicLevel,Tt=_.scaleMode,Zt=_.width,ee=_.height,Fe=_.wrapMode,Te=_.format,Qe=_.type,hn=_.target,vn=_.resolution,un=_.resourceOptions;return!m||m instanceof At||((m=Y(m,un)).internal=!0),N.resolution=vn||O.b.RESOLUTION,N.width=Math.round((Zt||0)*N.resolution)/N.resolution,N.height=Math.round((ee||0)*N.resolution)/N.resolution,N._mipmap=lt!==void 0?lt:O.b.MIPMAP_TEXTURES,N.anisotropicLevel=xt!==void 0?xt:O.b.ANISOTROPIC_LEVEL,N._wrapMode=Fe||O.b.WRAP_MODE,N._scaleMode=Tt!==void 0?Tt:O.b.SCALE_MODE,N.format=Te||M.h.RGBA,N.type=Qe||M.r.UNSIGNED_BYTE,N.target=hn||M.q.TEXTURE_2D,N.alphaMode=J!==void 0?J:M.a.UNPACK,N.uid=Object(I.uid)(),N.touched=0,N.isPowerOfTwo=!1,N._refreshPOT(),N._glTextures={},N.dirtyId=0,N.dirtyStyleId=0,N.cacheId=null,N.valid=Zt>0&&ee>0,N.textureCacheIds=[],N.destroyed=!1,N.resource=null,N._batchEnabled=0,N._batchLocation=0,N.parentTextureArray=null,N.setResource(m),N}return ft(g,q),Object.defineProperty(g.prototype,"realWidth",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"realHeight",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"mipmap",{get:function(){return this._mipmap},set:function(m){this._mipmap!==m&&(this._mipmap=m,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(m){this._scaleMode!==m&&(this._scaleMode=m,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"wrapMode",{get:function(){return this._wrapMode},set:function(m){this._wrapMode!==m&&(this._wrapMode=m,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),g.prototype.setStyle=function(m,_){var N;return m!==void 0&&m!==this.scaleMode&&(this.scaleMode=m,N=!0),_!==void 0&&_!==this.mipmap&&(this.mipmap=_,N=!0),N&&this.dirtyStyleId++,this},g.prototype.setSize=function(m,_,N){return N=N||this.resolution,this.setRealSize(m*N,_*N,N)},g.prototype.setRealSize=function(m,_,N){return this.resolution=N||this.resolution,this.width=Math.round(m)/this.resolution,this.height=Math.round(_)/this.resolution,this._refreshPOT(),this.update(),this},g.prototype._refreshPOT=function(){this.isPowerOfTwo=Object(I.isPow2)(this.realWidth)&&Object(I.isPow2)(this.realHeight)},g.prototype.setResolution=function(m){var _=this.resolution;return _===m||(this.resolution=m,this.valid&&(this.width=Math.round(this.width*_)/m,this.height=Math.round(this.height*_)/m,this.emit("update",this)),this._refreshPOT()),this},g.prototype.setResource=function(m){if(this.resource===m)return this;if(this.resource)throw new Error("Resource can be set only once");return m.bind(this),this.resource=m,this},g.prototype.update=function(){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))},g.prototype.onError=function(m){this.emit("error",this,m)},g.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete I.BaseTextureCache[this.cacheId],delete I.TextureCache[this.cacheId],this.cacheId=null),this.dispose(),g.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},g.prototype.dispose=function(){this.emit("dispose",this)},g.prototype.castToBaseTexture=function(){return this},g.from=function(m,_,N){N===void 0&&(N=O.b.STRICT_TEXTURE_CACHE);var J=typeof m=="string",lt=null;if(J)lt=m;else{if(!m._pixiId){var xt=_&&_.pixiIdPrefix||"pixiid";m._pixiId=xt+"_"+Object(I.uid)()}lt=m._pixiId}var Tt=I.BaseTextureCache[lt];if(J&&N&&!Tt)throw new Error('The cacheId "'+lt+'" does not exist in BaseTextureCache.');return Tt||((Tt=new g(m,_)).cacheId=lt,g.addToCache(Tt,lt)),Tt},g.fromBuffer=function(m,_,N,J){m=m||new Float32Array(_*N*4);var lt=new L(m,{width:_,height:N}),xt=m instanceof Float32Array?M.r.FLOAT:M.r.UNSIGNED_BYTE;return new g(lt,Object.assign(R,J||{width:_,height:N,type:xt}))},g.addToCache=function(m,_){_&&(m.textureCacheIds.indexOf(_)===-1&&m.textureCacheIds.push(_),I.BaseTextureCache[_]&&console.warn("BaseTexture added to the cache with an id ["+_+"] that already had an entry"),I.BaseTextureCache[_]=m)},g.removeFromCache=function(m){if(typeof m=="string"){var _=I.BaseTextureCache[m];if(_){var N=_.textureCacheIds.indexOf(m);return N>-1&&_.textureCacheIds.splice(N,1),delete I.BaseTextureCache[m],_}}else if(m&&m.textureCacheIds){for(var J=0;J<m.textureCacheIds.length;++J)delete I.BaseTextureCache[m.textureCacheIds[J]];return m.textureCacheIds.length=0,m}return null},g._globalBatch=0,g}(I.EventEmitter),X=function(q){function g(m,_){var N=this,J=_||{},lt=J.width,xt=J.height;(N=q.call(this,lt,xt)||this).items=[],N.itemDirtyIds=[];for(var Tt=0;Tt<m;Tt++){var Zt=new B;N.items.push(Zt),N.itemDirtyIds.push(-2)}return N.length=m,N._load=null,N.baseTexture=null,N}return ft(g,q),g.prototype.initFromArray=function(m,_){for(var N=0;N<this.length;N++)m[N]&&(m[N].castToBaseTexture?this.addBaseTextureAt(m[N].castToBaseTexture(),N):m[N]instanceof At?this.addResourceAt(m[N],N):this.addResourceAt(Y(m[N],_),N))},g.prototype.dispose=function(){for(var m=0,_=this.length;m<_;m++)this.items[m].destroy();this.items=null,this.itemDirtyIds=null,this._load=null},g.prototype.addResourceAt=function(m,_){if(!this.items[_])throw new Error("Index "+_+" is out of bounds");return m.valid&&!this.valid&&this.resize(m.width,m.height),this.items[_].setResource(m),this},g.prototype.bind=function(m){if(this.baseTexture!==null)throw new Error("Only one base texture per TextureArray is allowed");q.prototype.bind.call(this,m);for(var _=0;_<this.length;_++)this.items[_].parentTextureArray=m,this.items[_].on("update",m.update,m)},g.prototype.unbind=function(m){q.prototype.unbind.call(this,m);for(var _=0;_<this.length;_++)this.items[_].parentTextureArray=null,this.items[_].off("update",m.update,m)},g.prototype.load=function(){var m=this;if(this._load)return this._load;var _=this.items.map(function(N){return N.resource}).filter(function(N){return N}).map(function(N){return N.load()});return this._load=Promise.all(_).then(function(){var N=m.items[0],J=N.realWidth,lt=N.realHeight;return m.resize(J,lt),Promise.resolve(m)}),this._load},g}(At),P=function(q){function g(m,_){var N,J,lt=this,xt=_||{},Tt=xt.width,Zt=xt.height;return Array.isArray(m)?(N=m,J=m.length):J=m,lt=q.call(this,J,{width:Tt,height:Zt})||this,N&<.initFromArray(N,_),lt}return ft(g,q),g.prototype.addBaseTextureAt=function(m,_){if(!m.resource)throw new Error("ArrayResource does not support RenderTexture");return this.addResourceAt(m.resource,_),this},g.prototype.bind=function(m){q.prototype.bind.call(this,m),m.target=M.q.TEXTURE_2D_ARRAY},g.prototype.upload=function(m,_,N){var J=this.length,lt=this.itemDirtyIds,xt=this.items,Tt=m.gl;N.dirtyId<0&&Tt.texImage3D(Tt.TEXTURE_2D_ARRAY,0,N.internalFormat,this._width,this._height,J,0,_.format,N.type,null);for(var Zt=0;Zt<J;Zt++){var ee=xt[Zt];lt[Zt]<ee.dirtyId&&(lt[Zt]=ee.dirtyId,ee.valid&&Tt.texSubImage3D(Tt.TEXTURE_2D_ARRAY,0,0,0,Zt,ee.resource.width,ee.resource.height,1,_.format,N.type,ee.resource.source))}return!0},g}(X),H=function(q){function g(m){var _=this,N=m,J=N.naturalWidth||N.videoWidth||N.width,lt=N.naturalHeight||N.videoHeight||N.height;return(_=q.call(this,J,lt)||this).source=m,_.noSubImage=!1,_}return ft(g,q),g.crossOrigin=function(m,_,N){N===void 0&&_.indexOf("data:")!==0?m.crossOrigin=Object(I.determineCrossOrigin)(_):N!==!1&&(m.crossOrigin=typeof N=="string"?N:"anonymous")},g.prototype.upload=function(m,_,N,J){var lt=m.gl,xt=_.realWidth,Tt=_.realHeight;if((J=J||this.source)instanceof HTMLImageElement){if(!J.complete||J.naturalWidth===0)return!1}else if(J instanceof HTMLVideoElement&&J.readyState<=1)return!1;return lt.pixelStorei(lt.UNPACK_PREMULTIPLY_ALPHA_WEBGL,_.alphaMode===M.a.UNPACK),this.noSubImage||_.target!==lt.TEXTURE_2D||N.width!==xt||N.height!==Tt?(N.width=xt,N.height=Tt,lt.texImage2D(_.target,0,N.internalFormat,_.format,N.type,J)):lt.texSubImage2D(lt.TEXTURE_2D,0,0,0,_.format,N.type,J),!0},g.prototype.update=function(){if(!this.destroyed){var m=this.source,_=m.naturalWidth||m.videoWidth||m.width,N=m.naturalHeight||m.videoHeight||m.height;this.resize(_,N),q.prototype.update.call(this)}},g.prototype.dispose=function(){this.source=null},g}(At),tt=function(q){function g(m){return q.call(this,m)||this}return ft(g,q),g.test=function(m){var _=globalThis.OffscreenCanvas;return!!(_&&m instanceof _)||globalThis.HTMLCanvasElement&&m instanceof HTMLCanvasElement},g}(H),G=function(q){function g(m,_){var N=this,J=_||{},lt=J.width,xt=J.height,Tt=J.autoLoad,Zt=J.linkBaseTexture;if(m&&m.length!==g.SIDES)throw new Error("Invalid length. Got "+m.length+", expected 6");N=q.call(this,6,{width:lt,height:xt})||this;for(var ee=0;ee<g.SIDES;ee++)N.items[ee].target=M.q.TEXTURE_CUBE_MAP_POSITIVE_X+ee;return N.linkBaseTexture=Zt!==!1,m&&N.initFromArray(m,_),Tt!==!1&&N.load(),N}return ft(g,q),g.prototype.bind=function(m){q.prototype.bind.call(this,m),m.target=M.q.TEXTURE_CUBE_MAP},g.prototype.addBaseTextureAt=function(m,_,N){if(!this.items[_])throw new Error("Index "+_+" is out of bounds");if(!this.linkBaseTexture||m.parentTextureArray||Object.keys(m._glTextures).length>0){if(!m.resource)throw new Error("CubeResource does not support copying of renderTexture.");this.addResourceAt(m.resource,_)}else m.target=M.q.TEXTURE_CUBE_MAP_POSITIVE_X+_,m.parentTextureArray=this.baseTexture,this.items[_]=m;return m.valid&&!this.valid&&this.resize(m.realWidth,m.realHeight),this.items[_]=m,this},g.prototype.upload=function(m,_,N){for(var J=this.itemDirtyIds,lt=0;lt<g.SIDES;lt++){var xt=this.items[lt];J[lt]<xt.dirtyId&&(xt.valid&&xt.resource?(xt.resource.upload(m,xt,N),J[lt]=xt.dirtyId):J[lt]<-1&&(m.gl.texImage2D(xt.target,0,N.internalFormat,_.realWidth,_.realHeight,0,_.format,N.type,null),J[lt]=-1))}return!0},g.test=function(m){return Array.isArray(m)&&m.length===g.SIDES},g.SIDES=6,g}(X),Ot=function(q){function g(m,_){var N=this;if(_=_||{},!(m instanceof HTMLImageElement)){var J=new Image;H.crossOrigin(J,m,_.crossorigin),J.src=m,m=J}return N=q.call(this,m)||this,!m.complete&&N._width&&N._height&&(N._width=0,N._height=0),N.url=m.src,N._process=null,N.preserveBitmap=!1,N.createBitmap=(_.createBitmap!==void 0?_.createBitmap:O.b.CREATE_IMAGE_BITMAP)&&!!globalThis.createImageBitmap,N.alphaMode=typeof _.alphaMode=="number"?_.alphaMode:null,N.bitmap=null,N._load=null,_.autoLoad!==!1&&N.load(),N}return ft(g,q),g.prototype.load=function(m){var _=this;return this._load||(m!==void 0&&(this.createBitmap=m),this._load=new Promise(function(N,J){var lt=_.source;_.url=lt.src;var xt=function(){_.destroyed||(lt.onload=null,lt.onerror=null,_.resize(lt.width,lt.height),_._load=null,_.createBitmap?N(_.process()):N(_))};lt.complete&<.src?xt():(lt.onload=xt,lt.onerror=function(Tt){J(Tt),_.onError.emit(Tt)})})),this._load},g.prototype.process=function(){var m=this,_=this.source;if(this._process!==null)return this._process;if(this.bitmap!==null||!globalThis.createImageBitmap)return Promise.resolve(this);var N=globalThis.createImageBitmap,J=!_.crossOrigin||_.crossOrigin==="anonymous";return this._process=fetch(_.src,{mode:J?"cors":"no-cors"}).then(function(lt){return lt.blob()}).then(function(lt){return N(lt,0,0,_.width,_.height,{premultiplyAlpha:m.alphaMode===M.a.UNPACK?"premultiply":"none"})}).then(function(lt){return m.destroyed?Promise.reject():(m.bitmap=lt,m.update(),m._process=null,Promise.resolve(m))}),this._process},g.prototype.upload=function(m,_,N){if(typeof this.alphaMode=="number"&&(_.alphaMode=this.alphaMode),!this.createBitmap)return q.prototype.upload.call(this,m,_,N);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(q.prototype.upload.call(this,m,_,N,this.bitmap),!this.preserveBitmap){var J=!0,lt=_._glTextures;for(var xt in lt){var Tt=lt[xt];if(Tt!==N&&Tt.dirtyId!==_.dirtyId){J=!1;break}}J&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},g.prototype.dispose=function(){this.source.onload=null,this.source.onerror=null,q.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},g.test=function(m){return typeof m=="string"||m instanceof HTMLImageElement},g}(H),zt=function(q){function g(m,_){var N=this;return _=_||{},(N=q.call(this,document.createElement("canvas"))||this)._width=0,N._height=0,N.svg=m,N.scale=_.scale||1,N._overrideWidth=_.width,N._overrideHeight=_.height,N._resolve=null,N._crossorigin=_.crossorigin,N._load=null,_.autoLoad!==!1&&N.load(),N}return ft(g,q),g.prototype.load=function(){var m=this;return this._load||(this._load=new Promise(function(_){if(m._resolve=function(){m.resize(m.source.width,m.source.height),_(m)},g.SVG_XML.test(m.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");m.svg="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(m.svg)))}m._loadSvg()})),this._load},g.prototype._loadSvg=function(){var m=this,_=new Image;H.crossOrigin(_,this.svg,this._crossorigin),_.src=this.svg,_.onerror=function(N){m._resolve&&(_.onerror=null,m.onError.emit(N))},_.onload=function(){if(m._resolve){var N=_.width,J=_.height;if(!N||!J)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");var lt=N*m.scale,xt=J*m.scale;(m._overrideWidth||m._overrideHeight)&&(lt=m._overrideWidth||m._overrideHeight/J*N,xt=m._overrideHeight||m._overrideWidth/N*J),lt=Math.round(lt),xt=Math.round(xt);var Tt=m.source;Tt.width=lt,Tt.height=xt,Tt._pixiId="canvas_"+Object(I.uid)(),Tt.getContext("2d").drawImage(_,0,0,N,J,0,0,lt,xt),m._resolve(),m._resolve=null}}},g.getSize=function(m){var _=g.SVG_SIZE.exec(m),N={};return _&&(N[_[1]]=Math.round(parseFloat(_[3])),N[_[5]]=Math.round(parseFloat(_[7]))),N},g.prototype.dispose=function(){q.prototype.dispose.call(this),this._resolve=null,this._crossorigin=null},g.test=function(m,_){return _==="svg"||typeof m=="string"&&/^data:image\/svg\+xml(;(charset=utf8|utf8))?;base64/.test(m)||typeof m=="string"&&g.SVG_XML.test(m)},g.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,g.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,g}(H),st=function(q){function g(m,_){var N=this;if(_=_||{},!(m instanceof HTMLVideoElement)){var J=document.createElement("video");J.setAttribute("preload","auto"),J.setAttribute("webkit-playsinline",""),J.setAttribute("playsinline",""),typeof m=="string"&&(m=[m]);var lt=m[0].src||m[0];H.crossOrigin(J,lt,_.crossorigin);for(var xt=0;xt<m.length;++xt){var Tt=document.createElement("source"),Zt=m[xt],ee=Zt.src,Fe=Zt.mime,Te=(ee=ee||m[xt]).split("?").shift().toLowerCase(),Qe=Te.slice(Te.lastIndexOf(".")+1);Fe=Fe||g.MIME_TYPES[Qe]||"video/"+Qe,Tt.src=ee,Tt.type=Fe,J.appendChild(Tt)}m=J}return(N=q.call(this,m)||this).noSubImage=!0,N._autoUpdate=!0,N._isConnectedToTicker=!1,N._updateFPS=_.updateFPS||0,N._msToNextUpdate=0,N.autoPlay=_.autoPlay!==!1,N._load=null,N._resolve=null,N._onCanPlay=N._onCanPlay.bind(N),N._onError=N._onError.bind(N),_.autoLoad!==!1&&N.load(),N}return ft(g,q),g.prototype.update=function(m){if(!this.destroyed){var _=k.a.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-_),(!this._updateFPS||this._msToNextUpdate<=0)&&(q.prototype.update.call(this),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}},g.prototype.load=function(){var m=this;if(this._load)return this._load;var _=this.source;return(_.readyState===_.HAVE_ENOUGH_DATA||_.readyState===_.HAVE_FUTURE_DATA)&&_.width&&_.height&&(_.complete=!0),_.addEventListener("play",this._onPlayStart.bind(this)),_.addEventListener("pause",this._onPlayStop.bind(this)),this._isSourceReady()?this._onCanPlay():(_.addEventListener("canplay",this._onCanPlay),_.addEventListener("canplaythrough",this._onCanPlay),_.addEventListener("error",this._onError,!0)),this._load=new Promise(function(N){m.valid?N(m):(m._resolve=N,_.load())}),this._load},g.prototype._onError=function(m){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(m)},g.prototype._isSourcePlaying=function(){var m=this.source;return m.currentTime>0&&m.paused===!1&&m.ended===!1&&m.readyState>2},g.prototype._isSourceReady=function(){var m=this.source;return m.readyState===3||m.readyState===4},g.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(k.a.shared.add(this.update,this),this._isConnectedToTicker=!0)},g.prototype._onPlayStop=function(){this._isConnectedToTicker&&(k.a.shared.remove(this.update,this),this._isConnectedToTicker=!1)},g.prototype._onCanPlay=function(){var m=this.source;m.removeEventListener("canplay",this._onCanPlay),m.removeEventListener("canplaythrough",this._onCanPlay);var _=this.valid;this.resize(m.videoWidth,m.videoHeight),!_&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&m.play()},g.prototype.dispose=function(){this._isConnectedToTicker&&(k.a.shared.remove(this.update,this),this._isConnectedToTicker=!1);var m=this.source;m&&(m.removeEventListener("error",this._onError,!0),m.pause(),m.src="",m.load()),q.prototype.dispose.call(this)},Object.defineProperty(g.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(m){m!==this._autoUpdate&&(this._autoUpdate=m,!this._autoUpdate&&this._isConnectedToTicker?(k.a.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(k.a.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(m){m!==this._updateFPS&&(this._updateFPS=m)},enumerable:!1,configurable:!0}),g.test=function(m,_){return globalThis.HTMLVideoElement&&m instanceof HTMLVideoElement||g.TYPES.indexOf(_)>-1},g.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],g.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},g}(H),V=function(q){function g(m){return q.call(this,m)||this}return ft(g,q),g.test=function(m){return!!globalThis.createImageBitmap&&m instanceof ImageBitmap},g}(H);W.push(Ot,V,tt,st,zt,L,G,P);var U=function(q){function g(){return q!==null&&q.apply(this,arguments)||this}return ft(g,q),g.prototype.upload=function(m,_,N){var J=m.gl;J.pixelStorei(J.UNPACK_PREMULTIPLY_ALPHA_WEBGL,_.alphaMode===M.a.UNPACK);var lt=_.realWidth,xt=_.realHeight;return N.width===lt&&N.height===xt?J.texSubImage2D(_.target,0,0,0,lt,xt,_.format,N.type,this.data):(N.width=lt,N.height=xt,J.texImage2D(_.target,0,N.internalFormat,lt,xt,0,_.format,N.type,this.data)),!0},g}(L),dt=function(){function q(g,m){this.width=Math.round(g||100),this.height=Math.round(m||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 D.a("disposeFramebuffer"),this.multisample=M.l.NONE}return Object.defineProperty(q.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),q.prototype.addColorTexture=function(g,m){return g===void 0&&(g=0),this.colorTextures[g]=m||new B(null,{scaleMode:M.p.NEAREST,resolution:1,mipmap:M.k.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},q.prototype.addDepthTexture=function(g){return this.depthTexture=g||new B(new U(null,{width:this.width,height:this.height}),{scaleMode:M.p.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:M.k.OFF,format:M.h.DEPTH_COMPONENT,type:M.r.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},q.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},q.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},q.prototype.resize=function(g,m){if(g=Math.round(g),m=Math.round(m),g!==this.width||m!==this.height){this.width=g,this.height=m,this.dirtyId++,this.dirtySize++;for(var _=0;_<this.colorTextures.length;_++){var N=this.colorTextures[_],J=N.resolution;N.setSize(g/J,m/J)}this.depthTexture&&(J=this.depthTexture.resolution,this.depthTexture.setSize(g/J,m/J))}},q.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},q.prototype.destroyDepthTexture=function(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)},q}(),$=function(q){function g(m){m===void 0&&(m={});var _=this;if(typeof m=="number"){var N=arguments[0],J=arguments[1],lt=arguments[2],xt=arguments[3];m={width:N,height:J,scaleMode:lt,resolution:xt}}return m.width=m.width||100,m.height=m.height||100,m.multisample=m.multisample!==void 0?m.multisample:M.l.NONE,(_=q.call(this,null,m)||this).mipmap=M.k.OFF,_.valid=!0,_.clearColor=[0,0,0,0],_.framebuffer=new dt(_.realWidth,_.realHeight).addColorTexture(0,_),_.framebuffer.multisample=m.multisample,_.maskStack=[],_.filterStack=[{}],_}return ft(g,q),g.prototype.resize=function(m,_){this.framebuffer.resize(m*this.resolution,_*this.resolution),this.setRealSize(this.framebuffer.width,this.framebuffer.height)},g.prototype.dispose=function(){this.framebuffer.dispose(),q.prototype.dispose.call(this)},g.prototype.destroy=function(){q.prototype.destroy.call(this),this.framebuffer.destroyDepthTexture(),this.framebuffer=null},g}(B),vt=function(){function q(){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)}return q.prototype.set=function(g,m,_){var N=m.width,J=m.height;if(_){var lt=g.width/2/N,xt=g.height/2/J,Tt=g.x/N+lt,Zt=g.y/J+xt;_=z.n.add(_,z.n.NW),this.x0=Tt+lt*z.n.uX(_),this.y0=Zt+xt*z.n.uY(_),_=z.n.add(_,2),this.x1=Tt+lt*z.n.uX(_),this.y1=Zt+xt*z.n.uY(_),_=z.n.add(_,2),this.x2=Tt+lt*z.n.uX(_),this.y2=Zt+xt*z.n.uY(_),_=z.n.add(_,2),this.x3=Tt+lt*z.n.uX(_),this.y3=Zt+xt*z.n.uY(_)}else this.x0=g.x/N,this.y0=g.y/J,this.x1=(g.x+g.width)/N,this.y1=g.y/J,this.x2=(g.x+g.width)/N,this.y2=(g.y+g.height)/J,this.x3=g.x/N,this.y3=(g.y+g.height)/J;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},q.prototype.toString=function(){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+"]"},q}(),Lt=new vt;function K(q){q.destroy=function(){},q.on=function(){},q.once=function(){},q.emit=function(){}}var ct=function(q){function g(m,_,N,J,lt,xt){var Tt=q.call(this)||this;if(Tt.noFrame=!1,_||(Tt.noFrame=!0,_=new z.j(0,0,1,1)),m instanceof g&&(m=m.baseTexture),Tt.baseTexture=m,Tt._frame=_,Tt.trim=J,Tt.valid=!1,Tt._uvs=Lt,Tt.uvMatrix=null,Tt.orig=N||_,Tt._rotate=Number(lt||0),lt===!0)Tt._rotate=2;else if(Tt._rotate%2!=0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");return Tt.defaultAnchor=xt?new z.g(xt.x,xt.y):new z.g(0,0),Tt._updateID=0,Tt.textureCacheIds=[],m.valid?Tt.noFrame?m.valid&&Tt.onBaseTextureUpdated(m):Tt.frame=_:m.once("loaded",Tt.onBaseTextureUpdated,Tt),Tt.noFrame&&m.on("update",Tt.onBaseTextureUpdated,Tt),Tt}return ft(g,q),g.prototype.update=function(){this.baseTexture.resource&&this.baseTexture.resource.update()},g.prototype.onBaseTextureUpdated=function(m){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=m.width,this._frame.height=m.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)},g.prototype.destroy=function(m){if(this.baseTexture){if(m){var _=this.baseTexture.resource;_&&_.url&&I.TextureCache[_.url]&&g.removeFromCache(_.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,g.removeFromCache(this),this.textureCacheIds=null},g.prototype.clone=function(){var m=this._frame.clone(),_=this._frame===this.orig?m:this.orig.clone(),N=new g(this.baseTexture,!this.noFrame&&m,_,this.trim&&this.trim.clone(),this.rotate,this.defaultAnchor);return this.noFrame&&(N._frame=m),N},g.prototype.updateUvs=function(){this._uvs===Lt&&(this._uvs=new vt),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++},g.from=function(m,_,N){_===void 0&&(_={}),N===void 0&&(N=O.b.STRICT_TEXTURE_CACHE);var J=typeof m=="string",lt=null;if(J)lt=m;else if(m instanceof B){if(!m.cacheId){var xt=_&&_.pixiIdPrefix||"pixiid";m.cacheId=xt+"-"+Object(I.uid)(),B.addToCache(m,m.cacheId)}lt=m.cacheId}else m._pixiId||(xt=_&&_.pixiIdPrefix||"pixiid",m._pixiId=xt+"_"+Object(I.uid)()),lt=m._pixiId;var Tt=I.TextureCache[lt];if(J&&N&&!Tt)throw new Error('The cacheId "'+lt+'" does not exist in TextureCache.');return Tt||m instanceof B?!Tt&&m instanceof B&&(Tt=new g(m),g.addToCache(Tt,lt)):(_.resolution||(_.resolution=Object(I.getResolutionOfUrl)(m)),(Tt=new g(new B(m,_))).baseTexture.cacheId=lt,B.addToCache(Tt.baseTexture,lt),g.addToCache(Tt,lt)),Tt},g.fromURL=function(m,_){var N=Object.assign({autoLoad:!1},_==null?void 0:_.resourceOptions),J=g.from(m,Object.assign({resourceOptions:N},_),!1),lt=J.baseTexture.resource;return J.baseTexture.valid?Promise.resolve(J):lt.load().then(function(){return Promise.resolve(J)})},g.fromBuffer=function(m,_,N,J){return new g(B.fromBuffer(m,_,N,J))},g.fromLoader=function(m,_,N,J){var lt=new B(m,Object.assign({scaleMode:O.b.SCALE_MODE,resolution:Object(I.getResolutionOfUrl)(_)},J)),xt=lt.resource;xt instanceof Ot&&(xt.url=_);var Tt=new g(lt);return N||(N=_),B.addToCache(Tt.baseTexture,N),g.addToCache(Tt,N),N!==_&&(B.addToCache(Tt.baseTexture,_),g.addToCache(Tt,_)),Tt.baseTexture.valid?Promise.resolve(Tt):new Promise(function(Zt){Tt.baseTexture.once("loaded",function(){return Zt(Tt)})})},g.addToCache=function(m,_){_&&(m.textureCacheIds.indexOf(_)===-1&&m.textureCacheIds.push(_),I.TextureCache[_]&&console.warn("Texture added to the cache with an id ["+_+"] that already had an entry"),I.TextureCache[_]=m)},g.removeFromCache=function(m){if(typeof m=="string"){var _=I.TextureCache[m];if(_){var N=_.textureCacheIds.indexOf(m);return N>-1&&_.textureCacheIds.splice(N,1),delete I.TextureCache[m],_}}else if(m&&m.textureCacheIds){for(var J=0;J<m.textureCacheIds.length;++J)I.TextureCache[m.textureCacheIds[J]]===m&&delete I.TextureCache[m.textureCacheIds[J]];return m.textureCacheIds.length=0,m}return null},Object.defineProperty(g.prototype,"resolution",{get:function(){return this.baseTexture.resolution},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"frame",{get:function(){return this._frame},set:function(m){this._frame=m,this.noFrame=!1;var _=m.x,N=m.y,J=m.width,lt=m.height,xt=_+J>this.baseTexture.width,Tt=N+lt>this.baseTexture.height;if(xt||Tt){var Zt=xt&&Tt?"and":"or",ee="X: "+_+" + "+J+" = "+(_+J)+" > "+this.baseTexture.width,Fe="Y: "+N+" + "+lt+" = "+(N+lt)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+ee+" "+Zt+" "+Fe)}this.valid=J&<&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=m),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"rotate",{get:function(){return this._rotate},set:function(m){this._rotate=m,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),g.prototype.castToBaseTexture=function(){return this.baseTexture},Object.defineProperty(g,"EMPTY",{get:function(){return g._EMPTY||(g._EMPTY=new g(new B),K(g._EMPTY),K(g._EMPTY.baseTexture)),g._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(g,"WHITE",{get:function(){if(!g._WHITE){var m=document.createElement("canvas"),_=m.getContext("2d");m.width=16,m.height=16,_.fillStyle="white",_.fillRect(0,0,16,16),g._WHITE=new g(new B(new tt(m))),K(g._WHITE),K(g._WHITE.baseTexture)}return g._WHITE},enumerable:!1,configurable:!0}),g}(I.EventEmitter),nt=function(q){function g(m,_){var N=q.call(this,m,_)||this;return N.valid=!0,N.filterFrame=null,N.filterPoolKey=null,N.updateUvs(),N}return ft(g,q),Object.defineProperty(g.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(m){this.framebuffer.multisample=m},enumerable:!1,configurable:!0}),g.prototype.resize=function(m,_,N){N===void 0&&(N=!0);var J=this.baseTexture.resolution,lt=Math.round(m*J)/J,xt=Math.round(_*J)/J;this.valid=lt>0&&xt>0,this._frame.width=this.orig.width=lt,this._frame.height=this.orig.height=xt,N&&this.baseTexture.resize(lt,xt),this.updateUvs()},g.prototype.setResolution=function(m){var _=this.baseTexture;_.resolution!==m&&(_.setResolution(m),this.resize(_.width,_.height,!1))},g.create=function(m){for(var _=arguments,N=[],J=1;J<arguments.length;J++)N[J-1]=_[J];return typeof m=="number"&&(Object(I.deprecation)("6.0.0","Arguments (width, height, scaleMode, resolution) have been deprecated."),m={width:m,height:N[0],scaleMode:N[1],resolution:N[2]}),new g(new $(m))},g}(ct),_t=function(){function q(g){this.texturePool={},this.textureOptions=g||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}return q.prototype.createTexture=function(g,m,_){_===void 0&&(_=M.l.NONE);var N=new $(Object.assign({width:g,height:m,resolution:1,multisample:_},this.textureOptions));return new nt(N)},q.prototype.getOptimalTexture=function(g,m,_,N){var J;_===void 0&&(_=1),N===void 0&&(N=M.l.NONE),g=Math.ceil(g*_-1e-6),m=Math.ceil(m*_-1e-6),this.enableFullScreen&&g===this._pixelsWidth&&m===this._pixelsHeight?J=N>1?-N:-1:(J=((65535&(g=Object(I.nextPow2)(g)))<<16|65535&(m=Object(I.nextPow2)(m)))>>>0,N>1&&(J+=4294967296*N)),this.texturePool[J]||(this.texturePool[J]=[]);var lt=this.texturePool[J].pop();return lt||(lt=this.createTexture(g,m,N)),lt.filterPoolKey=J,lt.setResolution(_),lt},q.prototype.getFilterTexture=function(g,m,_){var N=this.getOptimalTexture(g.width,g.height,m||g.resolution,_||M.l.NONE);return N.filterFrame=g.filterFrame,N},q.prototype.returnTexture=function(g){var m=g.filterPoolKey;g.filterFrame=null,this.texturePool[m].push(g)},q.prototype.returnFilterTexture=function(g){this.returnTexture(g)},q.prototype.clear=function(g){if(g=g!==!1)for(var m in this.texturePool){var _=this.texturePool[m];if(_)for(var N=0;N<_.length;N++)_[N].destroy(!0)}this.texturePool={}},q.prototype.setScreenSize=function(g){if(g.width!==this._pixelsWidth||g.height!==this._pixelsHeight){for(var m in this.enableFullScreen=g.width>0&&g.height>0,this.texturePool)if(Number(m)<0){var _=this.texturePool[m];if(_)for(var N=0;N<_.length;N++)_[N].destroy(!0);this.texturePool[m]=[]}this._pixelsWidth=g.width,this._pixelsHeight=g.height}},q.SCREEN_KEY=-1,q}(),St=function(){function q(g,m,_,N,J,lt,xt){m===void 0&&(m=0),_===void 0&&(_=!1),N===void 0&&(N=M.r.FLOAT),this.buffer=g,this.size=m,this.normalized=_,this.type=N,this.stride=J,this.start=lt,this.instance=xt}return q.prototype.destroy=function(){this.buffer=null},q.from=function(g,m,_,N,J){return new q(g,m,_,N,J)},q}(),kt=0,Xt=function(){function q(g,m,_){m===void 0&&(m=!0),_===void 0&&(_=!1),this.data=g||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=_,this.static=m,this.id=kt++,this.disposeRunner=new D.a("disposeBuffer")}return q.prototype.update=function(g){g instanceof Array&&(g=new Float32Array(g)),this.data=g||this.data,this._updateID++},q.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},q.prototype.destroy=function(){this.dispose(),this.data=null},Object.defineProperty(q.prototype,"index",{get:function(){return this.type===M.d.ELEMENT_ARRAY_BUFFER},set:function(g){this.type=g?M.d.ELEMENT_ARRAY_BUFFER:M.d.ARRAY_BUFFER},enumerable:!1,configurable:!0}),q.from=function(g){return g instanceof Array&&(g=new Float32Array(g)),new q(g)},q}(),Jt={Float32Array,Uint32Array,Int32Array,Uint8Array},at={5126:4,5123:2,5121:1},_e=0,Ue={Float32Array,Uint32Array,Int32Array,Uint8Array,Uint16Array},Oe=function(){function q(g,m){g===void 0&&(g=[]),m===void 0&&(m={}),this.buffers=g,this.indexBuffer=null,this.attributes=m,this.glVertexArrayObjects={},this.id=_e++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new D.a("disposeGeometry"),this.refCount=0}return q.prototype.addAttribute=function(g,m,_,N,J,lt,xt,Tt){if(_===void 0&&(_=0),N===void 0&&(N=!1),Tt===void 0&&(Tt=!1),!m)throw new Error("You must pass a buffer when creating an attribute");m instanceof Xt||(m instanceof Array&&(m=new Float32Array(m)),m=new Xt(m));var Zt=g.split("|");if(Zt.length>1){for(var ee=0;ee<Zt.length;ee++)this.addAttribute(Zt[ee],m,_,N,J);return this}var Fe=this.buffers.indexOf(m);return Fe===-1&&(this.buffers.push(m),Fe=this.buffers.length-1),this.attributes[g]=new St(Fe,_,N,J,lt,xt,Tt),this.instanced=this.instanced||Tt,this},q.prototype.getAttribute=function(g){return this.attributes[g]},q.prototype.getBuffer=function(g){return this.buffers[this.getAttribute(g).buffer]},q.prototype.addIndex=function(g){return g instanceof Xt||(g instanceof Array&&(g=new Uint16Array(g)),g=new Xt(g)),g.type=M.d.ELEMENT_ARRAY_BUFFER,this.indexBuffer=g,this.buffers.indexOf(g)===-1&&this.buffers.push(g),this},q.prototype.getIndex=function(){return this.indexBuffer},q.prototype.interleave=function(){if(this.buffers.length===1||this.buffers.length===2&&this.indexBuffer)return this;var g,m=[],_=[],N=new Xt;for(g in this.attributes){var J=this.attributes[g],lt=this.buffers[J.buffer];m.push(lt.data),_.push(J.size*at[J.type]/4),J.buffer=0}for(N.data=function(xt,Tt){for(var Zt=0,ee=0,Fe={},Te=0;Te<xt.length;Te++)ee+=Tt[Te],Zt+=xt[Te].length;var Qe=new ArrayBuffer(4*Zt),hn=null,vn=0;for(Te=0;Te<xt.length;Te++){var un=Tt[Te],Zn=xt[Te],mi=Object(I.getBufferType)(Zn);Fe[mi]||(Fe[mi]=new Jt[mi](Qe)),hn=Fe[mi];for(var gi=0;gi<Zn.length;gi++)hn[(gi/un|0)*ee+vn+gi%un]=Zn[gi];vn+=un}return new Float32Array(Qe)}(m,_),g=0;g<this.buffers.length;g++)this.buffers[g]!==this.indexBuffer&&this.buffers[g].destroy();return this.buffers=[N],this.indexBuffer&&this.buffers.push(this.indexBuffer),this},q.prototype.getSize=function(){for(var g in this.attributes){var m=this.attributes[g];return this.buffers[m.buffer].data.length/(m.stride/4||m.size)}return 0},q.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},q.prototype.destroy=function(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null},q.prototype.clone=function(){for(var g=new q,m=0;m<this.buffers.length;m++)g.buffers[m]=new Xt(this.buffers[m].data.slice(0));for(var m in this.attributes){var _=this.attributes[m];g.attributes[m]=new St(_.buffer,_.size,_.normalized,_.type,_.stride,_.start,_.instance)}return this.indexBuffer&&(g.indexBuffer=g.buffers[this.buffers.indexOf(this.indexBuffer)],g.indexBuffer.type=M.d.ELEMENT_ARRAY_BUFFER),g},q.merge=function(g){for(var m,_=new q,N=[],J=[],lt=[],xt=0;xt<g.length;xt++){m=g[xt];for(var Tt=0;Tt<m.buffers.length;Tt++)J[Tt]=J[Tt]||0,J[Tt]+=m.buffers[Tt].data.length,lt[Tt]=0}for(xt=0;xt<m.buffers.length;xt++)N[xt]=new Ue[Object(I.getBufferType)(m.buffers[xt].data)](J[xt]),_.buffers[xt]=new Xt(N[xt]);for(xt=0;xt<g.length;xt++)for(m=g[xt],Tt=0;Tt<m.buffers.length;Tt++)N[Tt].set(m.buffers[Tt].data,lt[Tt]),lt[Tt]+=m.buffers[Tt].data.length;if(_.attributes=m.attributes,m.indexBuffer){_.indexBuffer=_.buffers[m.buffers.indexOf(m.indexBuffer)],_.indexBuffer.type=M.d.ELEMENT_ARRAY_BUFFER;var Zt=0,ee=0,Fe=0,Te=0;for(xt=0;xt<m.buffers.length;xt++)if(m.buffers[xt]!==m.indexBuffer){Te=xt;break}for(var xt in m.attributes){var Qe=m.attributes[xt];(0|Qe.buffer)===Te&&(ee+=Qe.size*at[Qe.type]/4)}for(xt=0;xt<g.length;xt++){var hn=g[xt].indexBuffer.data;for(Tt=0;Tt<hn.length;Tt++)_.indexBuffer.data[Tt+Fe]+=Zt;Zt+=g[xt].buffers[Te].data.length/ee,Fe+=hn.length}}return _},q}(),Ae=function(q){function g(){var m=q.call(this)||this;return m.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2]),m}return ft(g,q),g}(Oe),ze=function(q){function g(){var m=q.call(this)||this;return m.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),m.uvs=new Float32Array([0,0,1,0,1,1,0,1]),m.vertexBuffer=new Xt(m.vertices),m.uvBuffer=new Xt(m.uvs),m.addAttribute("aVertexPosition",m.vertexBuffer).addAttribute("aTextureCoord",m.uvBuffer).addIndex([0,1,2,0,2,3]),m}return ft(g,q),g.prototype.map=function(m,_){var N=0,J=0;return this.uvs[0]=N,this.uvs[1]=J,this.uvs[2]=N+_.width/m.width,this.uvs[3]=J,this.uvs[4]=N+_.width/m.width,this.uvs[5]=J+_.height/m.height,this.uvs[6]=N,this.uvs[7]=J+_.height/m.height,N=_.x,J=_.y,this.vertices[0]=N,this.vertices[1]=J,this.vertices[2]=N+_.width,this.vertices[3]=J,this.vertices[4]=N+_.width,this.vertices[5]=J+_.height,this.vertices[6]=N,this.vertices[7]=J+_.height,this.invalidate(),this},g.prototype.invalidate=function(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this},g}(Oe),$e=0,cn=function(){function q(g,m,_){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=$e++,this.static=!!m,this.ubo=!!_,g instanceof Xt?(this.buffer=g,this.buffer.type=M.d.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=g,this.ubo&&(this.buffer=new Xt(new Float32Array(1)),this.buffer.type=M.d.UNIFORM_BUFFER,this.autoManage=!0))}return q.prototype.update=function(){this.dirtyId++,!this.autoManage&&this.buffer&&this.buffer.update()},q.prototype.add=function(g,m,_){if(this.ubo)throw new Error("[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them");this.uniforms[g]=new q(m,_)},q.from=function(g,m,_){return new q(g,m,_)},q.uboFrom=function(g,m){return new q(g,m==null||m,!0)},q}(),ke=function(){function q(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=M.l.NONE,this.sourceFrame=new z.j,this.destinationFrame=new z.j,this.bindingSourceFrame=new z.j,this.bindingDestinationFrame=new z.j,this.filters=[],this.transform=null}return q.prototype.clear=function(){this.target=null,this.filters=null,this.renderTexture=null},q}(),Ge=[new z.g,new z.g,new z.g,new z.g],Rn=new z.d,re=function(){function q(g){this.renderer=g,this.defaultFilterStack=[{}],this.texturePool=new _t,this.texturePool.setScreenSize(g.view),this.statePool=[],this.quad=new Ae,this.quadUv=new ze,this.tempRect=new z.j,this.activeState={},this.globalUniforms=new cn({outputFrame:new z.j,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}return q.prototype.push=function(g,m){for(var _,N,J=this.renderer,lt=this.defaultFilterStack,xt=this.statePool.pop()||new ke,Tt=this.renderer.renderTexture,Zt=m[0].resolution,ee=m[0].multisample,Fe=m[0].padding,Te=m[0].autoFit,Qe=(_=m[0].legacy)===null||_===void 0||_,hn=1;hn<m.length;hn++){var vn=m[hn];Zt=Math.min(Zt,vn.resolution),ee=Math.min(ee,vn.multisample),Fe=this.useMaxPadding?Math.max(Fe,vn.padding):Fe+vn.padding,Te=Te&&vn.autoFit,Qe=Qe||(N=vn.legacy)===null||N===void 0||N}lt.length===1&&(this.defaultFilterStack[0].renderTexture=Tt.current),lt.push(xt),xt.resolution=Zt,xt.multisample=ee,xt.legacy=Qe,xt.target=g,xt.sourceFrame.copyFrom(g.filterArea||g.getBounds(!0)),xt.sourceFrame.pad(Fe);var un=this.tempRect.copyFrom(Tt.sourceFrame);J.projection.transform&&this.transformAABB(Rn.copyFrom(J.projection.transform).invert(),un),Te?(xt.sourceFrame.fit(un),(xt.sourceFrame.width<=0||xt.sourceFrame.height<=0)&&(xt.sourceFrame.width=0,xt.sourceFrame.height=0)):xt.sourceFrame.intersects(un)||(xt.sourceFrame.width=0,xt.sourceFrame.height=0),this.roundFrame(xt.sourceFrame,Tt.current?Tt.current.resolution:J.resolution,Tt.sourceFrame,Tt.destinationFrame,J.projection.transform),xt.renderTexture=this.getOptimalFilterTexture(xt.sourceFrame.width,xt.sourceFrame.height,Zt,ee),xt.filters=m,xt.destinationFrame.width=xt.renderTexture.width,xt.destinationFrame.height=xt.renderTexture.height;var Zn=this.tempRect;Zn.x=0,Zn.y=0,Zn.width=xt.sourceFrame.width,Zn.height=xt.sourceFrame.height,xt.renderTexture.filterFrame=xt.sourceFrame,xt.bindingSourceFrame.copyFrom(Tt.sourceFrame),xt.bindingDestinationFrame.copyFrom(Tt.destinationFrame),xt.transform=J.projection.transform,J.projection.transform=null,Tt.bind(xt.renderTexture,xt.sourceFrame,Zn),J.framebuffer.clear(0,0,0,0)},q.prototype.pop=function(){var g=this.defaultFilterStack,m=g.pop(),_=m.filters;this.activeState=m;var N=this.globalUniforms.uniforms;N.outputFrame=m.sourceFrame,N.resolution=m.resolution;var J=N.inputSize,lt=N.inputPixel,xt=N.inputClamp;if(J[0]=m.destinationFrame.width,J[1]=m.destinationFrame.height,J[2]=1/J[0],J[3]=1/J[1],lt[0]=Math.round(J[0]*m.resolution),lt[1]=Math.round(J[1]*m.resolution),lt[2]=1/lt[0],lt[3]=1/lt[1],xt[0]=.5*lt[2],xt[1]=.5*lt[3],xt[2]=m.sourceFrame.width*J[2]-.5*lt[2],xt[3]=m.sourceFrame.height*J[3]-.5*lt[3],m.legacy){var Tt=N.filterArea;Tt[0]=m.destinationFrame.width,Tt[1]=m.destinationFrame.height,Tt[2]=m.sourceFrame.x,Tt[3]=m.sourceFrame.y,N.filterClamp=N.inputClamp}this.globalUniforms.update();var Zt=g[g.length-1];if(this.renderer.framebuffer.blit(),_.length===1)_[0].apply(this,m.renderTexture,Zt.renderTexture,M.e.BLEND,m),this.returnFilterTexture(m.renderTexture);else{var ee=m.renderTexture,Fe=this.getOptimalFilterTexture(ee.width,ee.height,m.resolution);Fe.filterFrame=ee.filterFrame;var Te=0;for(Te=0;Te<_.length-1;++Te){Te===1&&m.multisample>1&&((Fe=this.getOptimalFilterTexture(ee.width,ee.height,m.resolution)).filterFrame=ee.filterFrame),_[Te].apply(this,ee,Fe,M.e.CLEAR,m);var Qe=ee;ee=Fe,Fe=Qe}_[Te].apply(this,ee,Zt.renderTexture,M.e.BLEND,m),Te>1&&m.multisample>1&&this.returnFilterTexture(m.renderTexture),this.returnFilterTexture(ee),this.returnFilterTexture(Fe)}m.clear(),this.statePool.push(m)},q.prototype.bindAndClear=function(g,m){m===void 0&&(m=M.e.CLEAR);var _=this.renderer,N=_.renderTexture,J=_.state;if(g===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,g&&g.filterFrame){var lt=this.tempRect;lt.x=0,lt.y=0,lt.width=g.filterFrame.width,lt.height=g.filterFrame.height,N.bind(g,g.filterFrame,lt)}else g!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?N.bind(g):this.renderer.renderTexture.bind(g,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var xt=1&J.stateId||this.forceClear;(m===M.e.CLEAR||m===M.e.BLIT&&xt)&&this.renderer.framebuffer.clear(0,0,0,0)},q.prototype.applyFilter=function(g,m,_,N){var J=this.renderer;J.state.set(g.state),this.bindAndClear(_,N),g.uniforms.uSampler=m,g.uniforms.filterGlobals=this.globalUniforms,J.shader.bind(g),g.legacy=!!g.program.attributeData.aTextureCoord,g.legacy?(this.quadUv.map(m._frame,m.filterFrame),J.geometry.bind(this.quadUv),J.geometry.draw(M.f.TRIANGLES)):(J.geometry.bind(this.quad),J.geometry.draw(M.f.TRIANGLE_STRIP))},q.prototype.calculateSpriteMatrix=function(g,m){var _=this.activeState,N=_.sourceFrame,J=_.destinationFrame,lt=m._texture.orig,xt=g.set(J.width,0,0,J.height,N.x,N.y),Tt=m.worldTransform.copyTo(z.d.TEMP_MATRIX);return Tt.invert(),xt.prepend(Tt),xt.scale(1/lt.width,1/lt.height),xt.translate(m.anchor.x,m.anchor.y),xt},q.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},q.prototype.getOptimalFilterTexture=function(g,m,_,N){return _===void 0&&(_=1),N===void 0&&(N=M.l.NONE),this.texturePool.getOptimalTexture(g,m,_,N)},q.prototype.getFilterTexture=function(g,m,_){if(typeof g=="number"){var N=g;g=m,m=N}g=g||this.activeState.renderTexture;var J=this.texturePool.getOptimalTexture(g.width,g.height,m||g.resolution,_||M.l.NONE);return J.filterFrame=g.filterFrame,J},q.prototype.returnFilterTexture=function(g){this.texturePool.returnTexture(g)},q.prototype.emptyPool=function(){this.texturePool.clear(!0)},q.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},q.prototype.transformAABB=function(g,m){var _=Ge[0],N=Ge[1],J=Ge[2],lt=Ge[3];_.set(m.left,m.top),N.set(m.left,m.bottom),J.set(m.right,m.top),lt.set(m.right,m.bottom),g.apply(_,_),g.apply(N,N),g.apply(J,J),g.apply(lt,lt);var xt=Math.min(_.x,N.x,J.x,lt.x),Tt=Math.min(_.y,N.y,J.y,lt.y),Zt=Math.max(_.x,N.x,J.x,lt.x),ee=Math.max(_.y,N.y,J.y,lt.y);m.x=xt,m.y=Tt,m.width=Zt-xt,m.height=ee-Tt},q.prototype.roundFrame=function(g,m,_,N,J){if(!(g.width<=0||g.height<=0||_.width<=0||_.height<=0)){if(J){var lt=J.a,xt=J.b,Tt=J.c,Zt=J.d;if((Math.abs(xt)>1e-4||Math.abs(Tt)>1e-4)&&(Math.abs(lt)>1e-4||Math.abs(Zt)>1e-4))return}(J=J?Rn.copyFrom(J):Rn.identity()).translate(-_.x,-_.y).scale(N.width/_.width,N.height/_.height).translate(N.x,N.y),this.transformAABB(J,g),g.ceil(m),this.transformAABB(J.invert(),g)}},q}(),pe=function(){function q(g){this.renderer=g}return q.prototype.flush=function(){},q.prototype.destroy=function(){this.renderer=null},q.prototype.start=function(){},q.prototype.stop=function(){this.flush()},q.prototype.render=function(g){},q}(),Ee=function(){function q(g){this.renderer=g,this.emptyRenderer=new pe(g),this.currentRenderer=this.emptyRenderer}return q.prototype.setObjectRenderer=function(g){this.currentRenderer!==g&&(this.currentRenderer.stop(),this.currentRenderer=g,this.currentRenderer.start())},q.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},q.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},q.prototype.copyBoundTextures=function(g,m){for(var _=this.renderer.texture.boundTextures,N=m-1;N>=0;--N)g[N]=_[N]||null,g[N]&&(g[N]._batchLocation=N)},q.prototype.boundArray=function(g,m,_,N){for(var J=g.elements,lt=g.ids,xt=g.count,Tt=0,Zt=0;Zt<xt;Zt++){var ee=J[Zt],Fe=ee._batchLocation;if(Fe>=0&&Fe<N&&m[Fe]===ee)lt[Zt]=Fe;else for(;Tt<N;){var Te=m[Tt];if(!Te||Te._batchEnabled!==_||Te._batchLocation!==Tt){lt[Zt]=Tt,ee._batchLocation=Tt,m[Tt]=ee;break}Tt++}}},q.prototype.destroy=function(){this.renderer=null},q}(),ln=0,In=function(){function q(g){this.renderer=g,this.webGLVersion=1,this.extensions={},this.supports={uint32Indices:!1},this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this),g.view.addEventListener("webglcontextlost",this.handleContextLost,!1),g.view.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}return Object.defineProperty(q.prototype,"isLost",{get:function(){return!this.gl||this.gl.isContextLost()},enumerable:!1,configurable:!0}),q.prototype.contextChange=function(g){this.gl=g,this.renderer.gl=g,this.renderer.CONTEXT_UID=ln++,g.isContextLost()&&g.getExtension("WEBGL_lose_context")&&g.getExtension("WEBGL_lose_context").restoreContext()},q.prototype.initFromContext=function(g){this.gl=g,this.validateContext(g),this.renderer.gl=g,this.renderer.CONTEXT_UID=ln++,this.renderer.runners.contextChange.emit(g)},q.prototype.initFromOptions=function(g){var m=this.createContext(this.renderer.view,g);this.initFromContext(m)},q.prototype.createContext=function(g,m){var _;if(O.b.PREFER_ENV>=M.g.WEBGL2&&(_=g.getContext("webgl2",m)),_)this.webGLVersion=2;else if(this.webGLVersion=1,!(_=g.getContext("webgl",m)||g.getContext("experimental-webgl",m)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=_,this.getExtensions(),this.gl},q.prototype.getExtensions=function(){var g=this.gl,m={anisotropicFiltering:g.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:g.getExtension("OES_texture_float_linear"),s3tc:g.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:g.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:g.getExtension("WEBGL_compressed_texture_etc"),etc1:g.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:g.getExtension("WEBGL_compressed_texture_pvrtc")||g.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:g.getExtension("WEBGL_compressed_texture_atc"),astc:g.getExtension("WEBGL_compressed_texture_astc")};this.webGLVersion===1?Object.assign(this.extensions,m,{drawBuffers:g.getExtension("WEBGL_draw_buffers"),depthTexture:g.getExtension("WEBGL_depth_texture"),loseContext:g.getExtension("WEBGL_lose_context"),vertexArrayObject:g.getExtension("OES_vertex_array_object")||g.getExtension("MOZ_OES_vertex_array_object")||g.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:g.getExtension("OES_element_index_uint"),floatTexture:g.getExtension("OES_texture_float"),floatTextureLinear:g.getExtension("OES_texture_float_linear"),textureHalfFloat:g.getExtension("OES_texture_half_float"),textureHalfFloatLinear:g.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,m,{colorBufferFloat:g.getExtension("EXT_color_buffer_float")})},q.prototype.handleContextLost=function(g){g.preventDefault()},q.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},q.prototype.destroy=function(){var g=this.renderer.view;this.renderer=null,g.removeEventListener("webglcontextlost",this.handleContextLost),g.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},q.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},q.prototype.validateContext=function(g){var m=g.getContextAttributes(),_="WebGL2RenderingContext"in globalThis&&g instanceof globalThis.WebGL2RenderingContext;_&&(this.webGLVersion=2),m&&!m.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var N=_||!!g.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")},q}(),Kn=function(q){this.framebuffer=q,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=M.l.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0},pi=new z.j,tn=function(){function q(g){this.renderer=g,this.managedFramebuffers=[],this.unknownFramebuffer=new dt(10,10),this.msaaSamples=null}return q.prototype.contextChange=function(){var g=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new z.j,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),this.renderer.context.webGLVersion===1){var m=this.renderer.context.extensions.drawBuffers,_=this.renderer.context.extensions.depthTexture;O.b.PREFER_ENV===M.g.WEBGL_LEGACY&&(m=null,_=null),m?g.drawBuffers=function(N){return m.drawBuffersWEBGL(N)}:(this.hasMRT=!1,g.drawBuffers=function(){}),_||(this.writeDepthTexture=!1)}else this.msaaSamples=g.getInternalformatParameter(g.RENDERBUFFER,g.RGBA8,g.SAMPLES)},q.prototype.bind=function(g,m,_){_===void 0&&(_=0);var N=this.gl;if(g){var J=g.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(g);this.current!==g&&(this.current=g,N.bindFramebuffer(N.FRAMEBUFFER,J.framebuffer)),J.mipLevel!==_&&(g.dirtyId++,g.dirtyFormat++,J.mipLevel=_),J.dirtyId!==g.dirtyId&&(J.dirtyId=g.dirtyId,J.dirtyFormat!==g.dirtyFormat?(J.dirtyFormat=g.dirtyFormat,J.dirtySize=g.dirtySize,this.updateFramebuffer(g,_)):J.dirtySize!==g.dirtySize&&(J.dirtySize=g.dirtySize,this.resizeFramebuffer(g)));for(var lt=0;lt<g.colorTextures.length;lt++){var xt=g.colorTextures[lt];this.renderer.texture.unbind(xt.parentTextureArray||xt)}if(g.depthTexture&&this.renderer.texture.unbind(g.depthTexture),m){var Tt=m.width>>_,Zt=m.height>>_,ee=Tt/m.width;this.setViewport(m.x*ee,m.y*ee,Tt,Zt)}else Tt=g.width>>_,Zt=g.height>>_,this.setViewport(0,0,Tt,Zt)}else this.current&&(this.current=null,N.bindFramebuffer(N.FRAMEBUFFER,null)),m?this.setViewport(m.x,m.y,m.width,m.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},q.prototype.setViewport=function(g,m,_,N){var J=this.viewport;g=Math.round(g),m=Math.round(m),_=Math.round(_),N=Math.round(N),J.width===_&&J.height===N&&J.x===g&&J.y===m||(J.x=g,J.y=m,J.width=_,J.height=N,this.gl.viewport(g,m,_,N))},Object.defineProperty(q.prototype,"size",{get:function(){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}},enumerable:!1,configurable:!0}),q.prototype.clear=function(g,m,_,N,J){J===void 0&&(J=M.c.COLOR|M.c.DEPTH);var lt=this.gl;lt.clearColor(g,m,_,N),lt.clear(J)},q.prototype.initFramebuffer=function(g){var m=this.gl,_=new Kn(m.createFramebuffer());return _.multisample=this.detectSamples(g.multisample),g.glFramebuffers[this.CONTEXT_UID]=_,this.managedFramebuffers.push(g),g.disposeRunner.add(this),_},q.prototype.resizeFramebuffer=function(g){var m=this.gl,_=g.glFramebuffers[this.CONTEXT_UID];_.msaaBuffer&&(m.bindRenderbuffer(m.RENDERBUFFER,_.msaaBuffer),m.renderbufferStorageMultisample(m.RENDERBUFFER,_.multisample,m.RGBA8,g.width,g.height)),_.stencil&&(m.bindRenderbuffer(m.RENDERBUFFER,_.stencil),_.msaaBuffer?m.renderbufferStorageMultisample(m.RENDERBUFFER,_.multisample,m.DEPTH24_STENCIL8,g.width,g.height):m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_STENCIL,g.width,g.height));var N=g.colorTextures,J=N.length;m.drawBuffers||(J=Math.min(J,1));for(var lt=0;lt<J;lt++){var xt=N[lt],Tt=xt.parentTextureArray||xt;this.renderer.texture.bind(Tt,0)}g.depthTexture&&this.writeDepthTexture&&this.renderer.texture.bind(g.depthTexture,0)},q.prototype.updateFramebuffer=function(g,m){var _=this.gl,N=g.glFramebuffers[this.CONTEXT_UID],J=g.colorTextures,lt=J.length;_.drawBuffers||(lt=Math.min(lt,1)),N.multisample>1&&this.canMultisampleFramebuffer(g)?(N.msaaBuffer=N.msaaBuffer||_.createRenderbuffer(),_.bindRenderbuffer(_.RENDERBUFFER,N.msaaBuffer),_.renderbufferStorageMultisample(_.RENDERBUFFER,N.multisample,_.RGBA8,g.width,g.height),_.framebufferRenderbuffer(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0,_.RENDERBUFFER,N.msaaBuffer)):N.msaaBuffer&&(_.deleteRenderbuffer(N.msaaBuffer),N.msaaBuffer=null,N.blitFramebuffer&&(N.blitFramebuffer.dispose(),N.blitFramebuffer=null));for(var xt=[],Tt=0;Tt<lt;Tt++){var Zt=J[Tt],ee=Zt.parentTextureArray||Zt;this.renderer.texture.bind(ee,0),Tt===0&&N.msaaBuffer||(_.framebufferTexture2D(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0+Tt,Zt.target,ee._glTextures[this.CONTEXT_UID].texture,m),xt.push(_.COLOR_ATTACHMENT0+Tt))}if(xt.length>1&&_.drawBuffers(xt),g.depthTexture&&this.writeDepthTexture){var Fe=g.depthTexture;this.renderer.texture.bind(Fe,0),_.framebufferTexture2D(_.FRAMEBUFFER,_.DEPTH_ATTACHMENT,_.TEXTURE_2D,Fe._glTextures[this.CONTEXT_UID].texture,m)}!g.stencil&&!g.depth||g.depthTexture&&this.writeDepthTexture?N.stencil&&(_.deleteRenderbuffer(N.stencil),N.stencil=null):(N.stencil=N.stencil||_.createRenderbuffer(),_.bindRenderbuffer(_.RENDERBUFFER,N.stencil),N.msaaBuffer?_.renderbufferStorageMultisample(_.RENDERBUFFER,N.multisample,_.DEPTH24_STENCIL8,g.width,g.height):_.renderbufferStorage(_.RENDERBUFFER,_.DEPTH_STENCIL,g.width,g.height),_.framebufferRenderbuffer(_.FRAMEBUFFER,_.DEPTH_STENCIL_ATTACHMENT,_.RENDERBUFFER,N.stencil))},q.prototype.canMultisampleFramebuffer=function(g){return this.renderer.context.webGLVersion!==1&&g.colorTextures.length<=1&&!g.depthTexture},q.prototype.detectSamples=function(g){var m=this.msaaSamples,_=M.l.NONE;if(g<=1||m===null)return _;for(var N=0;N<m.length;N++)if(m[N]<=g){_=m[N];break}return _===1&&(_=M.l.NONE),_},q.prototype.blit=function(g,m,_){var N=this.current,J=this.renderer,lt=this.gl,xt=this.CONTEXT_UID;if(J.context.webGLVersion===2&&N){var Tt=N.glFramebuffers[xt];if(Tt){if(!g){if(!Tt.msaaBuffer)return;var Zt=N.colorTextures[0];if(!Zt)return;Tt.blitFramebuffer||(Tt.blitFramebuffer=new dt(N.width,N.height),Tt.blitFramebuffer.addColorTexture(0,Zt)),(g=Tt.blitFramebuffer).colorTextures[0]!==Zt&&(g.colorTextures[0]=Zt,g.dirtyId++,g.dirtyFormat++),g.width===N.width&&g.height===N.height||(g.width=N.width,g.height=N.height,g.dirtyId++,g.dirtySize++)}m||((m=pi).width=N.width,m.height=N.height),_||(_=m);var ee=m.width===_.width&&m.height===_.height;this.bind(g),lt.bindFramebuffer(lt.READ_FRAMEBUFFER,Tt.framebuffer),lt.blitFramebuffer(m.left,m.top,m.right,m.bottom,_.left,_.top,_.right,_.bottom,lt.COLOR_BUFFER_BIT,ee?lt.NEAREST:lt.LINEAR)}}},q.prototype.disposeFramebuffer=function(g,m){var _=g.glFramebuffers[this.CONTEXT_UID],N=this.gl;if(_){delete g.glFramebuffers[this.CONTEXT_UID];var J=this.managedFramebuffers.indexOf(g);J>=0&&this.managedFramebuffers.splice(J,1),g.disposeRunner.remove(this),m||(N.deleteFramebuffer(_.framebuffer),_.msaaBuffer&&N.deleteRenderbuffer(_.msaaBuffer),_.stencil&&N.deleteRenderbuffer(_.stencil)),_.blitFramebuffer&&_.blitFramebuffer.dispose()}},q.prototype.disposeAll=function(g){var m=this.managedFramebuffers;this.managedFramebuffers=[];for(var _=0;_<m.length;_++)this.disposeFramebuffer(m[_],g)},q.prototype.forceStencil=function(){var g=this.current;if(g){var m=g.glFramebuffers[this.CONTEXT_UID];if(m&&!m.stencil){g.stencil=!0;var _=g.width,N=g.height,J=this.gl,lt=J.createRenderbuffer();J.bindRenderbuffer(J.RENDERBUFFER,lt),m.msaaBuffer?J.renderbufferStorageMultisample(J.RENDERBUFFER,m.multisample,J.DEPTH24_STENCIL8,_,N):J.renderbufferStorage(J.RENDERBUFFER,J.DEPTH_STENCIL,_,N),m.stencil=lt,J.framebufferRenderbuffer(J.FRAMEBUFFER,J.DEPTH_STENCIL_ATTACHMENT,J.RENDERBUFFER,lt)}}},q.prototype.reset=function(){this.current=this.unknownFramebuffer,this.viewport=new z.j},q.prototype.destroy=function(){this.renderer=null},q}(),yt={5126:4,5123:2,5121:1},Et=function(){function q(g){this.renderer=g,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.canUseUInt32ElementIndex=!1,this.managedGeometries={}}return q.prototype.contextChange=function(){this.disposeAll(!0);var g=this.gl=this.renderer.gl,m=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,m.webGLVersion!==2){var _=this.renderer.context.extensions.vertexArrayObject;O.b.PREFER_ENV===M.g.WEBGL_LEGACY&&(_=null),_?(g.createVertexArray=function(){return _.createVertexArrayOES()},g.bindVertexArray=function(J){return _.bindVertexArrayOES(J)},g.deleteVertexArray=function(J){return _.deleteVertexArrayOES(J)}):(this.hasVao=!1,g.createVertexArray=function(){return null},g.bindVertexArray=function(){return null},g.deleteVertexArray=function(){return null})}if(m.webGLVersion!==2){var N=g.getExtension("ANGLE_instanced_arrays");N?(g.vertexAttribDivisor=function(J,lt){return N.vertexAttribDivisorANGLE(J,lt)},g.drawElementsInstanced=function(J,lt,xt,Tt,Zt){return N.drawElementsInstancedANGLE(J,lt,xt,Tt,Zt)},g.drawArraysInstanced=function(J,lt,xt,Tt){return N.drawArraysInstancedANGLE(J,lt,xt,Tt)}):this.hasInstance=!1}this.canUseUInt32ElementIndex=m.webGLVersion===2||!!m.extensions.uint32ElementIndex},q.prototype.bind=function(g,m){m=m||this.renderer.shader.shader;var _=this.gl,N=g.glVertexArrayObjects[this.CONTEXT_UID],J=!1;N||(this.managedGeometries[g.id]=g,g.disposeRunner.add(this),g.glVertexArrayObjects[this.CONTEXT_UID]=N={},J=!0);var lt=N[m.program.id]||this.initGeometryVao(g,m,J);this._activeGeometry=g,this._activeVao!==lt&&(this._activeVao=lt,this.hasVao?_.bindVertexArray(lt):this.activateVao(g,m.program)),this.updateBuffers()},q.prototype.reset=function(){this.unbind()},q.prototype.updateBuffers=function(){for(var g=this._activeGeometry,m=this.renderer.buffer,_=0;_<g.buffers.length;_++){var N=g.buffers[_];m.update(N)}},q.prototype.checkCompatibility=function(g,m){var _=g.attributes,N=m.attributeData;for(var J in N)if(!_[J])throw new Error('shader and geometry incompatible, geometry missing the "'+J+'" attribute')},q.prototype.getSignature=function(g,m){var _=g.attributes,N=m.attributeData,J=["g",g.id];for(var lt in _)N[lt]&&J.push(lt,N[lt].location);return J.join("-")},q.prototype.initGeometryVao=function(g,m,_){_===void 0&&(_=!0);var N=this.gl,J=this.CONTEXT_UID,lt=this.renderer.buffer,xt=m.program;xt.glPrograms[J]||this.renderer.shader.generateProgram(m),this.checkCompatibility(g,xt);var Tt=this.getSignature(g,xt),Zt=g.glVertexArrayObjects[this.CONTEXT_UID],ee=Zt[Tt];if(ee)return Zt[xt.id]=ee,ee;var Fe=g.buffers,Te=g.attributes,Qe={},hn={};for(var vn in Fe)Qe[vn]=0,hn[vn]=0;for(var vn in Te)!Te[vn].size&&xt.attributeData[vn]?Te[vn].size=xt.attributeData[vn].size:Te[vn].size||console.warn("PIXI Geometry attribute '"+vn+"' size cannot be determined (likely the bound shader does not have the attribute)"),Qe[Te[vn].buffer]+=Te[vn].size*yt[Te[vn].type];for(var vn in Te){var un=Te[vn],Zn=un.size;un.stride===void 0&&(Qe[un.buffer]===Zn*yt[un.type]?un.stride=0:un.stride=Qe[un.buffer]),un.start===void 0&&(un.start=hn[un.buffer],hn[un.buffer]+=Zn*yt[un.type])}ee=N.createVertexArray(),N.bindVertexArray(ee);for(var mi=0;mi<Fe.length;mi++){var gi=Fe[mi];lt.bind(gi),_&&gi._glBuffers[J].refCount++}return this.activateVao(g,xt),this._activeVao=ee,Zt[xt.id]=ee,Zt[Tt]=ee,ee},q.prototype.disposeGeometry=function(g,m){var _;if(this.managedGeometries[g.id]){delete this.managedGeometries[g.id];var N=g.glVertexArrayObjects[this.CONTEXT_UID],J=this.gl,lt=g.buffers,xt=(_=this.renderer)===null||_===void 0?void 0:_.buffer;if(g.disposeRunner.remove(this),N){if(xt)for(var Tt=0;Tt<lt.length;Tt++){var Zt=lt[Tt]._glBuffers[this.CONTEXT_UID];Zt&&(Zt.refCount--,Zt.refCount!==0||m||xt.dispose(lt[Tt],m))}if(!m){for(var ee in N)if(ee[0]==="g"){var Fe=N[ee];this._activeVao===Fe&&this.unbind(),J.deleteVertexArray(Fe)}}delete g.glVertexArrayObjects[this.CONTEXT_UID]}}},q.prototype.disposeAll=function(g){for(var m=Object.keys(this.managedGeometries),_=0;_<m.length;_++)this.disposeGeometry(this.managedGeometries[m[_]],g)},q.prototype.activateVao=function(g,m){var _=this.gl,N=this.CONTEXT_UID,J=this.renderer.buffer,lt=g.buffers,xt=g.attributes;g.indexBuffer&&J.bind(g.indexBuffer);var Tt=null;for(var Zt in xt){var ee=xt[Zt],Fe=lt[ee.buffer],Te=Fe._glBuffers[N];if(m.attributeData[Zt]){Tt!==Te&&(J.bind(Fe),Tt=Te);var Qe=m.attributeData[Zt].location;if(_.enableVertexAttribArray(Qe),_.vertexAttribPointer(Qe,ee.size,ee.type||_.FLOAT,ee.normalized,ee.stride,ee.start),ee.instance){if(!this.hasInstance)throw new Error("geometry error, GPU Instancing is not supported on this device");_.vertexAttribDivisor(Qe,1)}}}},q.prototype.draw=function(g,m,_,N){var J=this.gl,lt=this._activeGeometry;if(lt.indexBuffer){var xt=lt.indexBuffer.data.BYTES_PER_ELEMENT,Tt=xt===2?J.UNSIGNED_SHORT:J.UNSIGNED_INT;xt===2||xt===4&&this.canUseUInt32ElementIndex?lt.instanced?J.drawElementsInstanced(g,m||lt.indexBuffer.data.length,Tt,(_||0)*xt,N||1):J.drawElements(g,m||lt.indexBuffer.data.length,Tt,(_||0)*xt):console.warn("unsupported index buffer type: uint32")}else lt.instanced?J.drawArraysInstanced(g,_,m||lt.getSize(),N||1):J.drawArrays(g,_,m||lt.getSize());return this},q.prototype.unbind=function(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null},q.prototype.destroy=function(){this.renderer=null},q}(),Rt=function(){function q(g){g===void 0&&(g=null),this.type=M.j.NONE,this.autoDetect=!0,this.maskObject=g||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=O.b.FILTER_MULTISAMPLE,this.enabled=!0,this._filters=null,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._scissorRectLocal=null,this._target=null}return Object.defineProperty(q.prototype,"filter",{get:function(){return this._filters?this._filters[0]:null},set:function(g){g?this._filters?this._filters[0]=g:this._filters=[g]:this._filters=null},enumerable:!1,configurable:!0}),q.prototype.reset=function(){this.pooled&&(this.maskObject=null,this.type=M.j.NONE,this.autoDetect=!0),this._target=null,this._scissorRectLocal=null},q.prototype.copyCountersOrReset=function(g){g?(this._stencilCounter=g._stencilCounter,this._scissorCounter=g._scissorCounter,this._scissorRect=g._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)},q}();function Qt(q,g,m){var _=q.createShader(g);return q.shaderSource(_,m),q.compileShader(_),_}function Wt(q,g){var m=q.getShaderSource(g).split(`
|
|
32
|
+
***************************************************************************** */var et=function(q,g){return(et=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,_){m.__proto__=_}||function(m,_){for(var N in _)_.hasOwnProperty(N)&&(m[N]=_[N])})(q,g)};function ft(q,g){function m(){this.constructor=q}et(q,g),q.prototype=g===null?Object.create(g):(m.prototype=g.prototype,new m)}var Dt=function(){return(Dt=Object.assign||function(q){for(var g,m=arguments,_=1,N=arguments.length;_<N;_++)for(var J in g=m[_])Object.prototype.hasOwnProperty.call(g,J)&&(q[J]=g[J]);return q}).apply(this,arguments)},At=function(){function q(g,m){g===void 0&&(g=0),m===void 0&&(m=0),this._width=g,this._height=m,this.destroyed=!1,this.internal=!1,this.onResize=new D.a("setRealSize"),this.onUpdate=new D.a("update"),this.onError=new D.a("onError")}return q.prototype.bind=function(g){this.onResize.add(g),this.onUpdate.add(g),this.onError.add(g),(this._width||this._height)&&this.onResize.emit(this._width,this._height)},q.prototype.unbind=function(g){this.onResize.remove(g),this.onUpdate.remove(g),this.onError.remove(g)},q.prototype.resize=function(g,m){g===this._width&&m===this._height||(this._width=g,this._height=m,this.onResize.emit(g,m))},Object.defineProperty(q.prototype,"valid",{get:function(){return!!this._width&&!!this._height},enumerable:!1,configurable:!0}),q.prototype.update=function(){this.destroyed||this.onUpdate.emit()},q.prototype.load=function(){return Promise.resolve(this)},Object.defineProperty(q.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"height",{get:function(){return this._height},enumerable:!1,configurable:!0}),q.prototype.style=function(g,m,_){return!1},q.prototype.dispose=function(){},q.prototype.destroy=function(){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)},q.test=function(g,m){return!1},q}(),L=function(q){function g(m,_){var N=this,J=_||{},lt=J.width,xt=J.height;if(!lt||!xt)throw new Error("BufferResource width or height invalid");return(N=q.call(this,lt,xt)||this).data=m,N}return ft(g,q),g.prototype.upload=function(m,_,N){var J=m.gl;J.pixelStorei(J.UNPACK_PREMULTIPLY_ALPHA_WEBGL,_.alphaMode===M.a.UNPACK);var lt=_.realWidth,xt=_.realHeight;return N.width===lt&&N.height===xt?J.texSubImage2D(_.target,0,0,0,lt,xt,_.format,N.type,this.data):(N.width=lt,N.height=xt,J.texImage2D(_.target,0,N.internalFormat,lt,xt,0,_.format,N.type,this.data)),!0},g.prototype.dispose=function(){this.data=null},g.test=function(m){return m instanceof Float32Array||m instanceof Uint8Array||m instanceof Uint32Array},g}(At),R={scaleMode:M.p.NEAREST,format:M.h.RGBA,alphaMode:M.a.NPM},B=function(q){function g(m,_){m===void 0&&(m=null),_===void 0&&(_=null);var N=q.call(this)||this,J=(_=_||{}).alphaMode,lt=_.mipmap,xt=_.anisotropicLevel,Tt=_.scaleMode,Zt=_.width,ee=_.height,Fe=_.wrapMode,Te=_.format,Qe=_.type,hn=_.target,vn=_.resolution,un=_.resourceOptions;return!m||m instanceof At||((m=X(m,un)).internal=!0),N.resolution=vn||O.b.RESOLUTION,N.width=Math.round((Zt||0)*N.resolution)/N.resolution,N.height=Math.round((ee||0)*N.resolution)/N.resolution,N._mipmap=lt!==void 0?lt:O.b.MIPMAP_TEXTURES,N.anisotropicLevel=xt!==void 0?xt:O.b.ANISOTROPIC_LEVEL,N._wrapMode=Fe||O.b.WRAP_MODE,N._scaleMode=Tt!==void 0?Tt:O.b.SCALE_MODE,N.format=Te||M.h.RGBA,N.type=Qe||M.r.UNSIGNED_BYTE,N.target=hn||M.q.TEXTURE_2D,N.alphaMode=J!==void 0?J:M.a.UNPACK,N.uid=Object(I.uid)(),N.touched=0,N.isPowerOfTwo=!1,N._refreshPOT(),N._glTextures={},N.dirtyId=0,N.dirtyStyleId=0,N.cacheId=null,N.valid=Zt>0&&ee>0,N.textureCacheIds=[],N.destroyed=!1,N.resource=null,N._batchEnabled=0,N._batchLocation=0,N.parentTextureArray=null,N.setResource(m),N}return ft(g,q),Object.defineProperty(g.prototype,"realWidth",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"realHeight",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"mipmap",{get:function(){return this._mipmap},set:function(m){this._mipmap!==m&&(this._mipmap=m,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(m){this._scaleMode!==m&&(this._scaleMode=m,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"wrapMode",{get:function(){return this._wrapMode},set:function(m){this._wrapMode!==m&&(this._wrapMode=m,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),g.prototype.setStyle=function(m,_){var N;return m!==void 0&&m!==this.scaleMode&&(this.scaleMode=m,N=!0),_!==void 0&&_!==this.mipmap&&(this.mipmap=_,N=!0),N&&this.dirtyStyleId++,this},g.prototype.setSize=function(m,_,N){return N=N||this.resolution,this.setRealSize(m*N,_*N,N)},g.prototype.setRealSize=function(m,_,N){return this.resolution=N||this.resolution,this.width=Math.round(m)/this.resolution,this.height=Math.round(_)/this.resolution,this._refreshPOT(),this.update(),this},g.prototype._refreshPOT=function(){this.isPowerOfTwo=Object(I.isPow2)(this.realWidth)&&Object(I.isPow2)(this.realHeight)},g.prototype.setResolution=function(m){var _=this.resolution;return _===m||(this.resolution=m,this.valid&&(this.width=Math.round(this.width*_)/m,this.height=Math.round(this.height*_)/m,this.emit("update",this)),this._refreshPOT()),this},g.prototype.setResource=function(m){if(this.resource===m)return this;if(this.resource)throw new Error("Resource can be set only once");return m.bind(this),this.resource=m,this},g.prototype.update=function(){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))},g.prototype.onError=function(m){this.emit("error",this,m)},g.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete I.BaseTextureCache[this.cacheId],delete I.TextureCache[this.cacheId],this.cacheId=null),this.dispose(),g.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},g.prototype.dispose=function(){this.emit("dispose",this)},g.prototype.castToBaseTexture=function(){return this},g.from=function(m,_,N){N===void 0&&(N=O.b.STRICT_TEXTURE_CACHE);var J=typeof m=="string",lt=null;if(J)lt=m;else{if(!m._pixiId){var xt=_&&_.pixiIdPrefix||"pixiid";m._pixiId=xt+"_"+Object(I.uid)()}lt=m._pixiId}var Tt=I.BaseTextureCache[lt];if(J&&N&&!Tt)throw new Error('The cacheId "'+lt+'" does not exist in BaseTextureCache.');return Tt||((Tt=new g(m,_)).cacheId=lt,g.addToCache(Tt,lt)),Tt},g.fromBuffer=function(m,_,N,J){m=m||new Float32Array(_*N*4);var lt=new L(m,{width:_,height:N}),xt=m instanceof Float32Array?M.r.FLOAT:M.r.UNSIGNED_BYTE;return new g(lt,Object.assign(R,J||{width:_,height:N,type:xt}))},g.addToCache=function(m,_){_&&(m.textureCacheIds.indexOf(_)===-1&&m.textureCacheIds.push(_),I.BaseTextureCache[_]&&console.warn("BaseTexture added to the cache with an id ["+_+"] that already had an entry"),I.BaseTextureCache[_]=m)},g.removeFromCache=function(m){if(typeof m=="string"){var _=I.BaseTextureCache[m];if(_){var N=_.textureCacheIds.indexOf(m);return N>-1&&_.textureCacheIds.splice(N,1),delete I.BaseTextureCache[m],_}}else if(m&&m.textureCacheIds){for(var J=0;J<m.textureCacheIds.length;++J)delete I.BaseTextureCache[m.textureCacheIds[J]];return m.textureCacheIds.length=0,m}return null},g._globalBatch=0,g}(I.EventEmitter),Y=function(q){function g(m,_){var N=this,J=_||{},lt=J.width,xt=J.height;(N=q.call(this,lt,xt)||this).items=[],N.itemDirtyIds=[];for(var Tt=0;Tt<m;Tt++){var Zt=new B;N.items.push(Zt),N.itemDirtyIds.push(-2)}return N.length=m,N._load=null,N.baseTexture=null,N}return ft(g,q),g.prototype.initFromArray=function(m,_){for(var N=0;N<this.length;N++)m[N]&&(m[N].castToBaseTexture?this.addBaseTextureAt(m[N].castToBaseTexture(),N):m[N]instanceof At?this.addResourceAt(m[N],N):this.addResourceAt(X(m[N],_),N))},g.prototype.dispose=function(){for(var m=0,_=this.length;m<_;m++)this.items[m].destroy();this.items=null,this.itemDirtyIds=null,this._load=null},g.prototype.addResourceAt=function(m,_){if(!this.items[_])throw new Error("Index "+_+" is out of bounds");return m.valid&&!this.valid&&this.resize(m.width,m.height),this.items[_].setResource(m),this},g.prototype.bind=function(m){if(this.baseTexture!==null)throw new Error("Only one base texture per TextureArray is allowed");q.prototype.bind.call(this,m);for(var _=0;_<this.length;_++)this.items[_].parentTextureArray=m,this.items[_].on("update",m.update,m)},g.prototype.unbind=function(m){q.prototype.unbind.call(this,m);for(var _=0;_<this.length;_++)this.items[_].parentTextureArray=null,this.items[_].off("update",m.update,m)},g.prototype.load=function(){var m=this;if(this._load)return this._load;var _=this.items.map(function(N){return N.resource}).filter(function(N){return N}).map(function(N){return N.load()});return this._load=Promise.all(_).then(function(){var N=m.items[0],J=N.realWidth,lt=N.realHeight;return m.resize(J,lt),Promise.resolve(m)}),this._load},g}(At),P=function(q){function g(m,_){var N,J,lt=this,xt=_||{},Tt=xt.width,Zt=xt.height;return Array.isArray(m)?(N=m,J=m.length):J=m,lt=q.call(this,J,{width:Tt,height:Zt})||this,N&<.initFromArray(N,_),lt}return ft(g,q),g.prototype.addBaseTextureAt=function(m,_){if(!m.resource)throw new Error("ArrayResource does not support RenderTexture");return this.addResourceAt(m.resource,_),this},g.prototype.bind=function(m){q.prototype.bind.call(this,m),m.target=M.q.TEXTURE_2D_ARRAY},g.prototype.upload=function(m,_,N){var J=this.length,lt=this.itemDirtyIds,xt=this.items,Tt=m.gl;N.dirtyId<0&&Tt.texImage3D(Tt.TEXTURE_2D_ARRAY,0,N.internalFormat,this._width,this._height,J,0,_.format,N.type,null);for(var Zt=0;Zt<J;Zt++){var ee=xt[Zt];lt[Zt]<ee.dirtyId&&(lt[Zt]=ee.dirtyId,ee.valid&&Tt.texSubImage3D(Tt.TEXTURE_2D_ARRAY,0,0,0,Zt,ee.resource.width,ee.resource.height,1,_.format,N.type,ee.resource.source))}return!0},g}(Y),H=function(q){function g(m){var _=this,N=m,J=N.naturalWidth||N.videoWidth||N.width,lt=N.naturalHeight||N.videoHeight||N.height;return(_=q.call(this,J,lt)||this).source=m,_.noSubImage=!1,_}return ft(g,q),g.crossOrigin=function(m,_,N){N===void 0&&_.indexOf("data:")!==0?m.crossOrigin=Object(I.determineCrossOrigin)(_):N!==!1&&(m.crossOrigin=typeof N=="string"?N:"anonymous")},g.prototype.upload=function(m,_,N,J){var lt=m.gl,xt=_.realWidth,Tt=_.realHeight;if((J=J||this.source)instanceof HTMLImageElement){if(!J.complete||J.naturalWidth===0)return!1}else if(J instanceof HTMLVideoElement&&J.readyState<=1)return!1;return lt.pixelStorei(lt.UNPACK_PREMULTIPLY_ALPHA_WEBGL,_.alphaMode===M.a.UNPACK),this.noSubImage||_.target!==lt.TEXTURE_2D||N.width!==xt||N.height!==Tt?(N.width=xt,N.height=Tt,lt.texImage2D(_.target,0,N.internalFormat,_.format,N.type,J)):lt.texSubImage2D(lt.TEXTURE_2D,0,0,0,_.format,N.type,J),!0},g.prototype.update=function(){if(!this.destroyed){var m=this.source,_=m.naturalWidth||m.videoWidth||m.width,N=m.naturalHeight||m.videoHeight||m.height;this.resize(_,N),q.prototype.update.call(this)}},g.prototype.dispose=function(){this.source=null},g}(At),tt=function(q){function g(m){return q.call(this,m)||this}return ft(g,q),g.test=function(m){var _=globalThis.OffscreenCanvas;return!!(_&&m instanceof _)||globalThis.HTMLCanvasElement&&m instanceof HTMLCanvasElement},g}(H),G=function(q){function g(m,_){var N=this,J=_||{},lt=J.width,xt=J.height,Tt=J.autoLoad,Zt=J.linkBaseTexture;if(m&&m.length!==g.SIDES)throw new Error("Invalid length. Got "+m.length+", expected 6");N=q.call(this,6,{width:lt,height:xt})||this;for(var ee=0;ee<g.SIDES;ee++)N.items[ee].target=M.q.TEXTURE_CUBE_MAP_POSITIVE_X+ee;return N.linkBaseTexture=Zt!==!1,m&&N.initFromArray(m,_),Tt!==!1&&N.load(),N}return ft(g,q),g.prototype.bind=function(m){q.prototype.bind.call(this,m),m.target=M.q.TEXTURE_CUBE_MAP},g.prototype.addBaseTextureAt=function(m,_,N){if(!this.items[_])throw new Error("Index "+_+" is out of bounds");if(!this.linkBaseTexture||m.parentTextureArray||Object.keys(m._glTextures).length>0){if(!m.resource)throw new Error("CubeResource does not support copying of renderTexture.");this.addResourceAt(m.resource,_)}else m.target=M.q.TEXTURE_CUBE_MAP_POSITIVE_X+_,m.parentTextureArray=this.baseTexture,this.items[_]=m;return m.valid&&!this.valid&&this.resize(m.realWidth,m.realHeight),this.items[_]=m,this},g.prototype.upload=function(m,_,N){for(var J=this.itemDirtyIds,lt=0;lt<g.SIDES;lt++){var xt=this.items[lt];J[lt]<xt.dirtyId&&(xt.valid&&xt.resource?(xt.resource.upload(m,xt,N),J[lt]=xt.dirtyId):J[lt]<-1&&(m.gl.texImage2D(xt.target,0,N.internalFormat,_.realWidth,_.realHeight,0,_.format,N.type,null),J[lt]=-1))}return!0},g.test=function(m){return Array.isArray(m)&&m.length===g.SIDES},g.SIDES=6,g}(Y),Ot=function(q){function g(m,_){var N=this;if(_=_||{},!(m instanceof HTMLImageElement)){var J=new Image;H.crossOrigin(J,m,_.crossorigin),J.src=m,m=J}return N=q.call(this,m)||this,!m.complete&&N._width&&N._height&&(N._width=0,N._height=0),N.url=m.src,N._process=null,N.preserveBitmap=!1,N.createBitmap=(_.createBitmap!==void 0?_.createBitmap:O.b.CREATE_IMAGE_BITMAP)&&!!globalThis.createImageBitmap,N.alphaMode=typeof _.alphaMode=="number"?_.alphaMode:null,N.bitmap=null,N._load=null,_.autoLoad!==!1&&N.load(),N}return ft(g,q),g.prototype.load=function(m){var _=this;return this._load||(m!==void 0&&(this.createBitmap=m),this._load=new Promise(function(N,J){var lt=_.source;_.url=lt.src;var xt=function(){_.destroyed||(lt.onload=null,lt.onerror=null,_.resize(lt.width,lt.height),_._load=null,_.createBitmap?N(_.process()):N(_))};lt.complete&<.src?xt():(lt.onload=xt,lt.onerror=function(Tt){J(Tt),_.onError.emit(Tt)})})),this._load},g.prototype.process=function(){var m=this,_=this.source;if(this._process!==null)return this._process;if(this.bitmap!==null||!globalThis.createImageBitmap)return Promise.resolve(this);var N=globalThis.createImageBitmap,J=!_.crossOrigin||_.crossOrigin==="anonymous";return this._process=fetch(_.src,{mode:J?"cors":"no-cors"}).then(function(lt){return lt.blob()}).then(function(lt){return N(lt,0,0,_.width,_.height,{premultiplyAlpha:m.alphaMode===M.a.UNPACK?"premultiply":"none"})}).then(function(lt){return m.destroyed?Promise.reject():(m.bitmap=lt,m.update(),m._process=null,Promise.resolve(m))}),this._process},g.prototype.upload=function(m,_,N){if(typeof this.alphaMode=="number"&&(_.alphaMode=this.alphaMode),!this.createBitmap)return q.prototype.upload.call(this,m,_,N);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(q.prototype.upload.call(this,m,_,N,this.bitmap),!this.preserveBitmap){var J=!0,lt=_._glTextures;for(var xt in lt){var Tt=lt[xt];if(Tt!==N&&Tt.dirtyId!==_.dirtyId){J=!1;break}}J&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},g.prototype.dispose=function(){this.source.onload=null,this.source.onerror=null,q.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},g.test=function(m){return typeof m=="string"||m instanceof HTMLImageElement},g}(H),zt=function(q){function g(m,_){var N=this;return _=_||{},(N=q.call(this,document.createElement("canvas"))||this)._width=0,N._height=0,N.svg=m,N.scale=_.scale||1,N._overrideWidth=_.width,N._overrideHeight=_.height,N._resolve=null,N._crossorigin=_.crossorigin,N._load=null,_.autoLoad!==!1&&N.load(),N}return ft(g,q),g.prototype.load=function(){var m=this;return this._load||(this._load=new Promise(function(_){if(m._resolve=function(){m.resize(m.source.width,m.source.height),_(m)},g.SVG_XML.test(m.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");m.svg="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(m.svg)))}m._loadSvg()})),this._load},g.prototype._loadSvg=function(){var m=this,_=new Image;H.crossOrigin(_,this.svg,this._crossorigin),_.src=this.svg,_.onerror=function(N){m._resolve&&(_.onerror=null,m.onError.emit(N))},_.onload=function(){if(m._resolve){var N=_.width,J=_.height;if(!N||!J)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");var lt=N*m.scale,xt=J*m.scale;(m._overrideWidth||m._overrideHeight)&&(lt=m._overrideWidth||m._overrideHeight/J*N,xt=m._overrideHeight||m._overrideWidth/N*J),lt=Math.round(lt),xt=Math.round(xt);var Tt=m.source;Tt.width=lt,Tt.height=xt,Tt._pixiId="canvas_"+Object(I.uid)(),Tt.getContext("2d").drawImage(_,0,0,N,J,0,0,lt,xt),m._resolve(),m._resolve=null}}},g.getSize=function(m){var _=g.SVG_SIZE.exec(m),N={};return _&&(N[_[1]]=Math.round(parseFloat(_[3])),N[_[5]]=Math.round(parseFloat(_[7]))),N},g.prototype.dispose=function(){q.prototype.dispose.call(this),this._resolve=null,this._crossorigin=null},g.test=function(m,_){return _==="svg"||typeof m=="string"&&/^data:image\/svg\+xml(;(charset=utf8|utf8))?;base64/.test(m)||typeof m=="string"&&g.SVG_XML.test(m)},g.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,g.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,g}(H),st=function(q){function g(m,_){var N=this;if(_=_||{},!(m instanceof HTMLVideoElement)){var J=document.createElement("video");J.setAttribute("preload","auto"),J.setAttribute("webkit-playsinline",""),J.setAttribute("playsinline",""),typeof m=="string"&&(m=[m]);var lt=m[0].src||m[0];H.crossOrigin(J,lt,_.crossorigin);for(var xt=0;xt<m.length;++xt){var Tt=document.createElement("source"),Zt=m[xt],ee=Zt.src,Fe=Zt.mime,Te=(ee=ee||m[xt]).split("?").shift().toLowerCase(),Qe=Te.slice(Te.lastIndexOf(".")+1);Fe=Fe||g.MIME_TYPES[Qe]||"video/"+Qe,Tt.src=ee,Tt.type=Fe,J.appendChild(Tt)}m=J}return(N=q.call(this,m)||this).noSubImage=!0,N._autoUpdate=!0,N._isConnectedToTicker=!1,N._updateFPS=_.updateFPS||0,N._msToNextUpdate=0,N.autoPlay=_.autoPlay!==!1,N._load=null,N._resolve=null,N._onCanPlay=N._onCanPlay.bind(N),N._onError=N._onError.bind(N),_.autoLoad!==!1&&N.load(),N}return ft(g,q),g.prototype.update=function(m){if(!this.destroyed){var _=k.a.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-_),(!this._updateFPS||this._msToNextUpdate<=0)&&(q.prototype.update.call(this),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}},g.prototype.load=function(){var m=this;if(this._load)return this._load;var _=this.source;return(_.readyState===_.HAVE_ENOUGH_DATA||_.readyState===_.HAVE_FUTURE_DATA)&&_.width&&_.height&&(_.complete=!0),_.addEventListener("play",this._onPlayStart.bind(this)),_.addEventListener("pause",this._onPlayStop.bind(this)),this._isSourceReady()?this._onCanPlay():(_.addEventListener("canplay",this._onCanPlay),_.addEventListener("canplaythrough",this._onCanPlay),_.addEventListener("error",this._onError,!0)),this._load=new Promise(function(N){m.valid?N(m):(m._resolve=N,_.load())}),this._load},g.prototype._onError=function(m){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(m)},g.prototype._isSourcePlaying=function(){var m=this.source;return m.currentTime>0&&m.paused===!1&&m.ended===!1&&m.readyState>2},g.prototype._isSourceReady=function(){var m=this.source;return m.readyState===3||m.readyState===4},g.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(k.a.shared.add(this.update,this),this._isConnectedToTicker=!0)},g.prototype._onPlayStop=function(){this._isConnectedToTicker&&(k.a.shared.remove(this.update,this),this._isConnectedToTicker=!1)},g.prototype._onCanPlay=function(){var m=this.source;m.removeEventListener("canplay",this._onCanPlay),m.removeEventListener("canplaythrough",this._onCanPlay);var _=this.valid;this.resize(m.videoWidth,m.videoHeight),!_&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&m.play()},g.prototype.dispose=function(){this._isConnectedToTicker&&(k.a.shared.remove(this.update,this),this._isConnectedToTicker=!1);var m=this.source;m&&(m.removeEventListener("error",this._onError,!0),m.pause(),m.src="",m.load()),q.prototype.dispose.call(this)},Object.defineProperty(g.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(m){m!==this._autoUpdate&&(this._autoUpdate=m,!this._autoUpdate&&this._isConnectedToTicker?(k.a.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(k.a.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(m){m!==this._updateFPS&&(this._updateFPS=m)},enumerable:!1,configurable:!0}),g.test=function(m,_){return globalThis.HTMLVideoElement&&m instanceof HTMLVideoElement||g.TYPES.indexOf(_)>-1},g.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],g.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},g}(H),z=function(q){function g(m){return q.call(this,m)||this}return ft(g,q),g.test=function(m){return!!globalThis.createImageBitmap&&m instanceof ImageBitmap},g}(H);W.push(Ot,z,tt,st,zt,L,G,P);var U=function(q){function g(){return q!==null&&q.apply(this,arguments)||this}return ft(g,q),g.prototype.upload=function(m,_,N){var J=m.gl;J.pixelStorei(J.UNPACK_PREMULTIPLY_ALPHA_WEBGL,_.alphaMode===M.a.UNPACK);var lt=_.realWidth,xt=_.realHeight;return N.width===lt&&N.height===xt?J.texSubImage2D(_.target,0,0,0,lt,xt,_.format,N.type,this.data):(N.width=lt,N.height=xt,J.texImage2D(_.target,0,N.internalFormat,lt,xt,0,_.format,N.type,this.data)),!0},g}(L),dt=function(){function q(g,m){this.width=Math.round(g||100),this.height=Math.round(m||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 D.a("disposeFramebuffer"),this.multisample=M.l.NONE}return Object.defineProperty(q.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),q.prototype.addColorTexture=function(g,m){return g===void 0&&(g=0),this.colorTextures[g]=m||new B(null,{scaleMode:M.p.NEAREST,resolution:1,mipmap:M.k.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},q.prototype.addDepthTexture=function(g){return this.depthTexture=g||new B(new U(null,{width:this.width,height:this.height}),{scaleMode:M.p.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:M.k.OFF,format:M.h.DEPTH_COMPONENT,type:M.r.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},q.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},q.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},q.prototype.resize=function(g,m){if(g=Math.round(g),m=Math.round(m),g!==this.width||m!==this.height){this.width=g,this.height=m,this.dirtyId++,this.dirtySize++;for(var _=0;_<this.colorTextures.length;_++){var N=this.colorTextures[_],J=N.resolution;N.setSize(g/J,m/J)}this.depthTexture&&(J=this.depthTexture.resolution,this.depthTexture.setSize(g/J,m/J))}},q.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},q.prototype.destroyDepthTexture=function(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)},q}(),$=function(q){function g(m){m===void 0&&(m={});var _=this;if(typeof m=="number"){var N=arguments[0],J=arguments[1],lt=arguments[2],xt=arguments[3];m={width:N,height:J,scaleMode:lt,resolution:xt}}return m.width=m.width||100,m.height=m.height||100,m.multisample=m.multisample!==void 0?m.multisample:M.l.NONE,(_=q.call(this,null,m)||this).mipmap=M.k.OFF,_.valid=!0,_.clearColor=[0,0,0,0],_.framebuffer=new dt(_.realWidth,_.realHeight).addColorTexture(0,_),_.framebuffer.multisample=m.multisample,_.maskStack=[],_.filterStack=[{}],_}return ft(g,q),g.prototype.resize=function(m,_){this.framebuffer.resize(m*this.resolution,_*this.resolution),this.setRealSize(this.framebuffer.width,this.framebuffer.height)},g.prototype.dispose=function(){this.framebuffer.dispose(),q.prototype.dispose.call(this)},g.prototype.destroy=function(){q.prototype.destroy.call(this),this.framebuffer.destroyDepthTexture(),this.framebuffer=null},g}(B),vt=function(){function q(){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)}return q.prototype.set=function(g,m,_){var N=m.width,J=m.height;if(_){var lt=g.width/2/N,xt=g.height/2/J,Tt=g.x/N+lt,Zt=g.y/J+xt;_=V.n.add(_,V.n.NW),this.x0=Tt+lt*V.n.uX(_),this.y0=Zt+xt*V.n.uY(_),_=V.n.add(_,2),this.x1=Tt+lt*V.n.uX(_),this.y1=Zt+xt*V.n.uY(_),_=V.n.add(_,2),this.x2=Tt+lt*V.n.uX(_),this.y2=Zt+xt*V.n.uY(_),_=V.n.add(_,2),this.x3=Tt+lt*V.n.uX(_),this.y3=Zt+xt*V.n.uY(_)}else this.x0=g.x/N,this.y0=g.y/J,this.x1=(g.x+g.width)/N,this.y1=g.y/J,this.x2=(g.x+g.width)/N,this.y2=(g.y+g.height)/J,this.x3=g.x/N,this.y3=(g.y+g.height)/J;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},q.prototype.toString=function(){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+"]"},q}(),Lt=new vt;function K(q){q.destroy=function(){},q.on=function(){},q.once=function(){},q.emit=function(){}}var ct=function(q){function g(m,_,N,J,lt,xt){var Tt=q.call(this)||this;if(Tt.noFrame=!1,_||(Tt.noFrame=!0,_=new V.j(0,0,1,1)),m instanceof g&&(m=m.baseTexture),Tt.baseTexture=m,Tt._frame=_,Tt.trim=J,Tt.valid=!1,Tt._uvs=Lt,Tt.uvMatrix=null,Tt.orig=N||_,Tt._rotate=Number(lt||0),lt===!0)Tt._rotate=2;else if(Tt._rotate%2!=0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");return Tt.defaultAnchor=xt?new V.g(xt.x,xt.y):new V.g(0,0),Tt._updateID=0,Tt.textureCacheIds=[],m.valid?Tt.noFrame?m.valid&&Tt.onBaseTextureUpdated(m):Tt.frame=_:m.once("loaded",Tt.onBaseTextureUpdated,Tt),Tt.noFrame&&m.on("update",Tt.onBaseTextureUpdated,Tt),Tt}return ft(g,q),g.prototype.update=function(){this.baseTexture.resource&&this.baseTexture.resource.update()},g.prototype.onBaseTextureUpdated=function(m){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=m.width,this._frame.height=m.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)},g.prototype.destroy=function(m){if(this.baseTexture){if(m){var _=this.baseTexture.resource;_&&_.url&&I.TextureCache[_.url]&&g.removeFromCache(_.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,g.removeFromCache(this),this.textureCacheIds=null},g.prototype.clone=function(){var m=this._frame.clone(),_=this._frame===this.orig?m:this.orig.clone(),N=new g(this.baseTexture,!this.noFrame&&m,_,this.trim&&this.trim.clone(),this.rotate,this.defaultAnchor);return this.noFrame&&(N._frame=m),N},g.prototype.updateUvs=function(){this._uvs===Lt&&(this._uvs=new vt),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++},g.from=function(m,_,N){_===void 0&&(_={}),N===void 0&&(N=O.b.STRICT_TEXTURE_CACHE);var J=typeof m=="string",lt=null;if(J)lt=m;else if(m instanceof B){if(!m.cacheId){var xt=_&&_.pixiIdPrefix||"pixiid";m.cacheId=xt+"-"+Object(I.uid)(),B.addToCache(m,m.cacheId)}lt=m.cacheId}else m._pixiId||(xt=_&&_.pixiIdPrefix||"pixiid",m._pixiId=xt+"_"+Object(I.uid)()),lt=m._pixiId;var Tt=I.TextureCache[lt];if(J&&N&&!Tt)throw new Error('The cacheId "'+lt+'" does not exist in TextureCache.');return Tt||m instanceof B?!Tt&&m instanceof B&&(Tt=new g(m),g.addToCache(Tt,lt)):(_.resolution||(_.resolution=Object(I.getResolutionOfUrl)(m)),(Tt=new g(new B(m,_))).baseTexture.cacheId=lt,B.addToCache(Tt.baseTexture,lt),g.addToCache(Tt,lt)),Tt},g.fromURL=function(m,_){var N=Object.assign({autoLoad:!1},_==null?void 0:_.resourceOptions),J=g.from(m,Object.assign({resourceOptions:N},_),!1),lt=J.baseTexture.resource;return J.baseTexture.valid?Promise.resolve(J):lt.load().then(function(){return Promise.resolve(J)})},g.fromBuffer=function(m,_,N,J){return new g(B.fromBuffer(m,_,N,J))},g.fromLoader=function(m,_,N,J){var lt=new B(m,Object.assign({scaleMode:O.b.SCALE_MODE,resolution:Object(I.getResolutionOfUrl)(_)},J)),xt=lt.resource;xt instanceof Ot&&(xt.url=_);var Tt=new g(lt);return N||(N=_),B.addToCache(Tt.baseTexture,N),g.addToCache(Tt,N),N!==_&&(B.addToCache(Tt.baseTexture,_),g.addToCache(Tt,_)),Tt.baseTexture.valid?Promise.resolve(Tt):new Promise(function(Zt){Tt.baseTexture.once("loaded",function(){return Zt(Tt)})})},g.addToCache=function(m,_){_&&(m.textureCacheIds.indexOf(_)===-1&&m.textureCacheIds.push(_),I.TextureCache[_]&&console.warn("Texture added to the cache with an id ["+_+"] that already had an entry"),I.TextureCache[_]=m)},g.removeFromCache=function(m){if(typeof m=="string"){var _=I.TextureCache[m];if(_){var N=_.textureCacheIds.indexOf(m);return N>-1&&_.textureCacheIds.splice(N,1),delete I.TextureCache[m],_}}else if(m&&m.textureCacheIds){for(var J=0;J<m.textureCacheIds.length;++J)I.TextureCache[m.textureCacheIds[J]]===m&&delete I.TextureCache[m.textureCacheIds[J]];return m.textureCacheIds.length=0,m}return null},Object.defineProperty(g.prototype,"resolution",{get:function(){return this.baseTexture.resolution},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"frame",{get:function(){return this._frame},set:function(m){this._frame=m,this.noFrame=!1;var _=m.x,N=m.y,J=m.width,lt=m.height,xt=_+J>this.baseTexture.width,Tt=N+lt>this.baseTexture.height;if(xt||Tt){var Zt=xt&&Tt?"and":"or",ee="X: "+_+" + "+J+" = "+(_+J)+" > "+this.baseTexture.width,Fe="Y: "+N+" + "+lt+" = "+(N+lt)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+ee+" "+Zt+" "+Fe)}this.valid=J&<&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=m),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"rotate",{get:function(){return this._rotate},set:function(m){this._rotate=m,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),g.prototype.castToBaseTexture=function(){return this.baseTexture},Object.defineProperty(g,"EMPTY",{get:function(){return g._EMPTY||(g._EMPTY=new g(new B),K(g._EMPTY),K(g._EMPTY.baseTexture)),g._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(g,"WHITE",{get:function(){if(!g._WHITE){var m=document.createElement("canvas"),_=m.getContext("2d");m.width=16,m.height=16,_.fillStyle="white",_.fillRect(0,0,16,16),g._WHITE=new g(new B(new tt(m))),K(g._WHITE),K(g._WHITE.baseTexture)}return g._WHITE},enumerable:!1,configurable:!0}),g}(I.EventEmitter),nt=function(q){function g(m,_){var N=q.call(this,m,_)||this;return N.valid=!0,N.filterFrame=null,N.filterPoolKey=null,N.updateUvs(),N}return ft(g,q),Object.defineProperty(g.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(m){this.framebuffer.multisample=m},enumerable:!1,configurable:!0}),g.prototype.resize=function(m,_,N){N===void 0&&(N=!0);var J=this.baseTexture.resolution,lt=Math.round(m*J)/J,xt=Math.round(_*J)/J;this.valid=lt>0&&xt>0,this._frame.width=this.orig.width=lt,this._frame.height=this.orig.height=xt,N&&this.baseTexture.resize(lt,xt),this.updateUvs()},g.prototype.setResolution=function(m){var _=this.baseTexture;_.resolution!==m&&(_.setResolution(m),this.resize(_.width,_.height,!1))},g.create=function(m){for(var _=arguments,N=[],J=1;J<arguments.length;J++)N[J-1]=_[J];return typeof m=="number"&&(Object(I.deprecation)("6.0.0","Arguments (width, height, scaleMode, resolution) have been deprecated."),m={width:m,height:N[0],scaleMode:N[1],resolution:N[2]}),new g(new $(m))},g}(ct),_t=function(){function q(g){this.texturePool={},this.textureOptions=g||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}return q.prototype.createTexture=function(g,m,_){_===void 0&&(_=M.l.NONE);var N=new $(Object.assign({width:g,height:m,resolution:1,multisample:_},this.textureOptions));return new nt(N)},q.prototype.getOptimalTexture=function(g,m,_,N){var J;_===void 0&&(_=1),N===void 0&&(N=M.l.NONE),g=Math.ceil(g*_-1e-6),m=Math.ceil(m*_-1e-6),this.enableFullScreen&&g===this._pixelsWidth&&m===this._pixelsHeight?J=N>1?-N:-1:(J=((65535&(g=Object(I.nextPow2)(g)))<<16|65535&(m=Object(I.nextPow2)(m)))>>>0,N>1&&(J+=4294967296*N)),this.texturePool[J]||(this.texturePool[J]=[]);var lt=this.texturePool[J].pop();return lt||(lt=this.createTexture(g,m,N)),lt.filterPoolKey=J,lt.setResolution(_),lt},q.prototype.getFilterTexture=function(g,m,_){var N=this.getOptimalTexture(g.width,g.height,m||g.resolution,_||M.l.NONE);return N.filterFrame=g.filterFrame,N},q.prototype.returnTexture=function(g){var m=g.filterPoolKey;g.filterFrame=null,this.texturePool[m].push(g)},q.prototype.returnFilterTexture=function(g){this.returnTexture(g)},q.prototype.clear=function(g){if(g=g!==!1)for(var m in this.texturePool){var _=this.texturePool[m];if(_)for(var N=0;N<_.length;N++)_[N].destroy(!0)}this.texturePool={}},q.prototype.setScreenSize=function(g){if(g.width!==this._pixelsWidth||g.height!==this._pixelsHeight){for(var m in this.enableFullScreen=g.width>0&&g.height>0,this.texturePool)if(Number(m)<0){var _=this.texturePool[m];if(_)for(var N=0;N<_.length;N++)_[N].destroy(!0);this.texturePool[m]=[]}this._pixelsWidth=g.width,this._pixelsHeight=g.height}},q.SCREEN_KEY=-1,q}(),St=function(){function q(g,m,_,N,J,lt,xt){m===void 0&&(m=0),_===void 0&&(_=!1),N===void 0&&(N=M.r.FLOAT),this.buffer=g,this.size=m,this.normalized=_,this.type=N,this.stride=J,this.start=lt,this.instance=xt}return q.prototype.destroy=function(){this.buffer=null},q.from=function(g,m,_,N,J){return new q(g,m,_,N,J)},q}(),kt=0,Xt=function(){function q(g,m,_){m===void 0&&(m=!0),_===void 0&&(_=!1),this.data=g||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=_,this.static=m,this.id=kt++,this.disposeRunner=new D.a("disposeBuffer")}return q.prototype.update=function(g){g instanceof Array&&(g=new Float32Array(g)),this.data=g||this.data,this._updateID++},q.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},q.prototype.destroy=function(){this.dispose(),this.data=null},Object.defineProperty(q.prototype,"index",{get:function(){return this.type===M.d.ELEMENT_ARRAY_BUFFER},set:function(g){this.type=g?M.d.ELEMENT_ARRAY_BUFFER:M.d.ARRAY_BUFFER},enumerable:!1,configurable:!0}),q.from=function(g){return g instanceof Array&&(g=new Float32Array(g)),new q(g)},q}(),Jt={Float32Array,Uint32Array,Int32Array,Uint8Array},at={5126:4,5123:2,5121:1},_e=0,Ue={Float32Array,Uint32Array,Int32Array,Uint8Array,Uint16Array},Oe=function(){function q(g,m){g===void 0&&(g=[]),m===void 0&&(m={}),this.buffers=g,this.indexBuffer=null,this.attributes=m,this.glVertexArrayObjects={},this.id=_e++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new D.a("disposeGeometry"),this.refCount=0}return q.prototype.addAttribute=function(g,m,_,N,J,lt,xt,Tt){if(_===void 0&&(_=0),N===void 0&&(N=!1),Tt===void 0&&(Tt=!1),!m)throw new Error("You must pass a buffer when creating an attribute");m instanceof Xt||(m instanceof Array&&(m=new Float32Array(m)),m=new Xt(m));var Zt=g.split("|");if(Zt.length>1){for(var ee=0;ee<Zt.length;ee++)this.addAttribute(Zt[ee],m,_,N,J);return this}var Fe=this.buffers.indexOf(m);return Fe===-1&&(this.buffers.push(m),Fe=this.buffers.length-1),this.attributes[g]=new St(Fe,_,N,J,lt,xt,Tt),this.instanced=this.instanced||Tt,this},q.prototype.getAttribute=function(g){return this.attributes[g]},q.prototype.getBuffer=function(g){return this.buffers[this.getAttribute(g).buffer]},q.prototype.addIndex=function(g){return g instanceof Xt||(g instanceof Array&&(g=new Uint16Array(g)),g=new Xt(g)),g.type=M.d.ELEMENT_ARRAY_BUFFER,this.indexBuffer=g,this.buffers.indexOf(g)===-1&&this.buffers.push(g),this},q.prototype.getIndex=function(){return this.indexBuffer},q.prototype.interleave=function(){if(this.buffers.length===1||this.buffers.length===2&&this.indexBuffer)return this;var g,m=[],_=[],N=new Xt;for(g in this.attributes){var J=this.attributes[g],lt=this.buffers[J.buffer];m.push(lt.data),_.push(J.size*at[J.type]/4),J.buffer=0}for(N.data=function(xt,Tt){for(var Zt=0,ee=0,Fe={},Te=0;Te<xt.length;Te++)ee+=Tt[Te],Zt+=xt[Te].length;var Qe=new ArrayBuffer(4*Zt),hn=null,vn=0;for(Te=0;Te<xt.length;Te++){var un=Tt[Te],Zn=xt[Te],mi=Object(I.getBufferType)(Zn);Fe[mi]||(Fe[mi]=new Jt[mi](Qe)),hn=Fe[mi];for(var gi=0;gi<Zn.length;gi++)hn[(gi/un|0)*ee+vn+gi%un]=Zn[gi];vn+=un}return new Float32Array(Qe)}(m,_),g=0;g<this.buffers.length;g++)this.buffers[g]!==this.indexBuffer&&this.buffers[g].destroy();return this.buffers=[N],this.indexBuffer&&this.buffers.push(this.indexBuffer),this},q.prototype.getSize=function(){for(var g in this.attributes){var m=this.attributes[g];return this.buffers[m.buffer].data.length/(m.stride/4||m.size)}return 0},q.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},q.prototype.destroy=function(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null},q.prototype.clone=function(){for(var g=new q,m=0;m<this.buffers.length;m++)g.buffers[m]=new Xt(this.buffers[m].data.slice(0));for(var m in this.attributes){var _=this.attributes[m];g.attributes[m]=new St(_.buffer,_.size,_.normalized,_.type,_.stride,_.start,_.instance)}return this.indexBuffer&&(g.indexBuffer=g.buffers[this.buffers.indexOf(this.indexBuffer)],g.indexBuffer.type=M.d.ELEMENT_ARRAY_BUFFER),g},q.merge=function(g){for(var m,_=new q,N=[],J=[],lt=[],xt=0;xt<g.length;xt++){m=g[xt];for(var Tt=0;Tt<m.buffers.length;Tt++)J[Tt]=J[Tt]||0,J[Tt]+=m.buffers[Tt].data.length,lt[Tt]=0}for(xt=0;xt<m.buffers.length;xt++)N[xt]=new Ue[Object(I.getBufferType)(m.buffers[xt].data)](J[xt]),_.buffers[xt]=new Xt(N[xt]);for(xt=0;xt<g.length;xt++)for(m=g[xt],Tt=0;Tt<m.buffers.length;Tt++)N[Tt].set(m.buffers[Tt].data,lt[Tt]),lt[Tt]+=m.buffers[Tt].data.length;if(_.attributes=m.attributes,m.indexBuffer){_.indexBuffer=_.buffers[m.buffers.indexOf(m.indexBuffer)],_.indexBuffer.type=M.d.ELEMENT_ARRAY_BUFFER;var Zt=0,ee=0,Fe=0,Te=0;for(xt=0;xt<m.buffers.length;xt++)if(m.buffers[xt]!==m.indexBuffer){Te=xt;break}for(var xt in m.attributes){var Qe=m.attributes[xt];(0|Qe.buffer)===Te&&(ee+=Qe.size*at[Qe.type]/4)}for(xt=0;xt<g.length;xt++){var hn=g[xt].indexBuffer.data;for(Tt=0;Tt<hn.length;Tt++)_.indexBuffer.data[Tt+Fe]+=Zt;Zt+=g[xt].buffers[Te].data.length/ee,Fe+=hn.length}}return _},q}(),Ae=function(q){function g(){var m=q.call(this)||this;return m.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2]),m}return ft(g,q),g}(Oe),ze=function(q){function g(){var m=q.call(this)||this;return m.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),m.uvs=new Float32Array([0,0,1,0,1,1,0,1]),m.vertexBuffer=new Xt(m.vertices),m.uvBuffer=new Xt(m.uvs),m.addAttribute("aVertexPosition",m.vertexBuffer).addAttribute("aTextureCoord",m.uvBuffer).addIndex([0,1,2,0,2,3]),m}return ft(g,q),g.prototype.map=function(m,_){var N=0,J=0;return this.uvs[0]=N,this.uvs[1]=J,this.uvs[2]=N+_.width/m.width,this.uvs[3]=J,this.uvs[4]=N+_.width/m.width,this.uvs[5]=J+_.height/m.height,this.uvs[6]=N,this.uvs[7]=J+_.height/m.height,N=_.x,J=_.y,this.vertices[0]=N,this.vertices[1]=J,this.vertices[2]=N+_.width,this.vertices[3]=J,this.vertices[4]=N+_.width,this.vertices[5]=J+_.height,this.vertices[6]=N,this.vertices[7]=J+_.height,this.invalidate(),this},g.prototype.invalidate=function(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this},g}(Oe),$e=0,cn=function(){function q(g,m,_){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=$e++,this.static=!!m,this.ubo=!!_,g instanceof Xt?(this.buffer=g,this.buffer.type=M.d.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=g,this.ubo&&(this.buffer=new Xt(new Float32Array(1)),this.buffer.type=M.d.UNIFORM_BUFFER,this.autoManage=!0))}return q.prototype.update=function(){this.dirtyId++,!this.autoManage&&this.buffer&&this.buffer.update()},q.prototype.add=function(g,m,_){if(this.ubo)throw new Error("[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them");this.uniforms[g]=new q(m,_)},q.from=function(g,m,_){return new q(g,m,_)},q.uboFrom=function(g,m){return new q(g,m==null||m,!0)},q}(),ke=function(){function q(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=M.l.NONE,this.sourceFrame=new V.j,this.destinationFrame=new V.j,this.bindingSourceFrame=new V.j,this.bindingDestinationFrame=new V.j,this.filters=[],this.transform=null}return q.prototype.clear=function(){this.target=null,this.filters=null,this.renderTexture=null},q}(),Ge=[new V.g,new V.g,new V.g,new V.g],Rn=new V.d,re=function(){function q(g){this.renderer=g,this.defaultFilterStack=[{}],this.texturePool=new _t,this.texturePool.setScreenSize(g.view),this.statePool=[],this.quad=new Ae,this.quadUv=new ze,this.tempRect=new V.j,this.activeState={},this.globalUniforms=new cn({outputFrame:new V.j,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}return q.prototype.push=function(g,m){for(var _,N,J=this.renderer,lt=this.defaultFilterStack,xt=this.statePool.pop()||new ke,Tt=this.renderer.renderTexture,Zt=m[0].resolution,ee=m[0].multisample,Fe=m[0].padding,Te=m[0].autoFit,Qe=(_=m[0].legacy)===null||_===void 0||_,hn=1;hn<m.length;hn++){var vn=m[hn];Zt=Math.min(Zt,vn.resolution),ee=Math.min(ee,vn.multisample),Fe=this.useMaxPadding?Math.max(Fe,vn.padding):Fe+vn.padding,Te=Te&&vn.autoFit,Qe=Qe||(N=vn.legacy)===null||N===void 0||N}lt.length===1&&(this.defaultFilterStack[0].renderTexture=Tt.current),lt.push(xt),xt.resolution=Zt,xt.multisample=ee,xt.legacy=Qe,xt.target=g,xt.sourceFrame.copyFrom(g.filterArea||g.getBounds(!0)),xt.sourceFrame.pad(Fe);var un=this.tempRect.copyFrom(Tt.sourceFrame);J.projection.transform&&this.transformAABB(Rn.copyFrom(J.projection.transform).invert(),un),Te?(xt.sourceFrame.fit(un),(xt.sourceFrame.width<=0||xt.sourceFrame.height<=0)&&(xt.sourceFrame.width=0,xt.sourceFrame.height=0)):xt.sourceFrame.intersects(un)||(xt.sourceFrame.width=0,xt.sourceFrame.height=0),this.roundFrame(xt.sourceFrame,Tt.current?Tt.current.resolution:J.resolution,Tt.sourceFrame,Tt.destinationFrame,J.projection.transform),xt.renderTexture=this.getOptimalFilterTexture(xt.sourceFrame.width,xt.sourceFrame.height,Zt,ee),xt.filters=m,xt.destinationFrame.width=xt.renderTexture.width,xt.destinationFrame.height=xt.renderTexture.height;var Zn=this.tempRect;Zn.x=0,Zn.y=0,Zn.width=xt.sourceFrame.width,Zn.height=xt.sourceFrame.height,xt.renderTexture.filterFrame=xt.sourceFrame,xt.bindingSourceFrame.copyFrom(Tt.sourceFrame),xt.bindingDestinationFrame.copyFrom(Tt.destinationFrame),xt.transform=J.projection.transform,J.projection.transform=null,Tt.bind(xt.renderTexture,xt.sourceFrame,Zn),J.framebuffer.clear(0,0,0,0)},q.prototype.pop=function(){var g=this.defaultFilterStack,m=g.pop(),_=m.filters;this.activeState=m;var N=this.globalUniforms.uniforms;N.outputFrame=m.sourceFrame,N.resolution=m.resolution;var J=N.inputSize,lt=N.inputPixel,xt=N.inputClamp;if(J[0]=m.destinationFrame.width,J[1]=m.destinationFrame.height,J[2]=1/J[0],J[3]=1/J[1],lt[0]=Math.round(J[0]*m.resolution),lt[1]=Math.round(J[1]*m.resolution),lt[2]=1/lt[0],lt[3]=1/lt[1],xt[0]=.5*lt[2],xt[1]=.5*lt[3],xt[2]=m.sourceFrame.width*J[2]-.5*lt[2],xt[3]=m.sourceFrame.height*J[3]-.5*lt[3],m.legacy){var Tt=N.filterArea;Tt[0]=m.destinationFrame.width,Tt[1]=m.destinationFrame.height,Tt[2]=m.sourceFrame.x,Tt[3]=m.sourceFrame.y,N.filterClamp=N.inputClamp}this.globalUniforms.update();var Zt=g[g.length-1];if(this.renderer.framebuffer.blit(),_.length===1)_[0].apply(this,m.renderTexture,Zt.renderTexture,M.e.BLEND,m),this.returnFilterTexture(m.renderTexture);else{var ee=m.renderTexture,Fe=this.getOptimalFilterTexture(ee.width,ee.height,m.resolution);Fe.filterFrame=ee.filterFrame;var Te=0;for(Te=0;Te<_.length-1;++Te){Te===1&&m.multisample>1&&((Fe=this.getOptimalFilterTexture(ee.width,ee.height,m.resolution)).filterFrame=ee.filterFrame),_[Te].apply(this,ee,Fe,M.e.CLEAR,m);var Qe=ee;ee=Fe,Fe=Qe}_[Te].apply(this,ee,Zt.renderTexture,M.e.BLEND,m),Te>1&&m.multisample>1&&this.returnFilterTexture(m.renderTexture),this.returnFilterTexture(ee),this.returnFilterTexture(Fe)}m.clear(),this.statePool.push(m)},q.prototype.bindAndClear=function(g,m){m===void 0&&(m=M.e.CLEAR);var _=this.renderer,N=_.renderTexture,J=_.state;if(g===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,g&&g.filterFrame){var lt=this.tempRect;lt.x=0,lt.y=0,lt.width=g.filterFrame.width,lt.height=g.filterFrame.height,N.bind(g,g.filterFrame,lt)}else g!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?N.bind(g):this.renderer.renderTexture.bind(g,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var xt=1&J.stateId||this.forceClear;(m===M.e.CLEAR||m===M.e.BLIT&&xt)&&this.renderer.framebuffer.clear(0,0,0,0)},q.prototype.applyFilter=function(g,m,_,N){var J=this.renderer;J.state.set(g.state),this.bindAndClear(_,N),g.uniforms.uSampler=m,g.uniforms.filterGlobals=this.globalUniforms,J.shader.bind(g),g.legacy=!!g.program.attributeData.aTextureCoord,g.legacy?(this.quadUv.map(m._frame,m.filterFrame),J.geometry.bind(this.quadUv),J.geometry.draw(M.f.TRIANGLES)):(J.geometry.bind(this.quad),J.geometry.draw(M.f.TRIANGLE_STRIP))},q.prototype.calculateSpriteMatrix=function(g,m){var _=this.activeState,N=_.sourceFrame,J=_.destinationFrame,lt=m._texture.orig,xt=g.set(J.width,0,0,J.height,N.x,N.y),Tt=m.worldTransform.copyTo(V.d.TEMP_MATRIX);return Tt.invert(),xt.prepend(Tt),xt.scale(1/lt.width,1/lt.height),xt.translate(m.anchor.x,m.anchor.y),xt},q.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},q.prototype.getOptimalFilterTexture=function(g,m,_,N){return _===void 0&&(_=1),N===void 0&&(N=M.l.NONE),this.texturePool.getOptimalTexture(g,m,_,N)},q.prototype.getFilterTexture=function(g,m,_){if(typeof g=="number"){var N=g;g=m,m=N}g=g||this.activeState.renderTexture;var J=this.texturePool.getOptimalTexture(g.width,g.height,m||g.resolution,_||M.l.NONE);return J.filterFrame=g.filterFrame,J},q.prototype.returnFilterTexture=function(g){this.texturePool.returnTexture(g)},q.prototype.emptyPool=function(){this.texturePool.clear(!0)},q.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},q.prototype.transformAABB=function(g,m){var _=Ge[0],N=Ge[1],J=Ge[2],lt=Ge[3];_.set(m.left,m.top),N.set(m.left,m.bottom),J.set(m.right,m.top),lt.set(m.right,m.bottom),g.apply(_,_),g.apply(N,N),g.apply(J,J),g.apply(lt,lt);var xt=Math.min(_.x,N.x,J.x,lt.x),Tt=Math.min(_.y,N.y,J.y,lt.y),Zt=Math.max(_.x,N.x,J.x,lt.x),ee=Math.max(_.y,N.y,J.y,lt.y);m.x=xt,m.y=Tt,m.width=Zt-xt,m.height=ee-Tt},q.prototype.roundFrame=function(g,m,_,N,J){if(!(g.width<=0||g.height<=0||_.width<=0||_.height<=0)){if(J){var lt=J.a,xt=J.b,Tt=J.c,Zt=J.d;if((Math.abs(xt)>1e-4||Math.abs(Tt)>1e-4)&&(Math.abs(lt)>1e-4||Math.abs(Zt)>1e-4))return}(J=J?Rn.copyFrom(J):Rn.identity()).translate(-_.x,-_.y).scale(N.width/_.width,N.height/_.height).translate(N.x,N.y),this.transformAABB(J,g),g.ceil(m),this.transformAABB(J.invert(),g)}},q}(),pe=function(){function q(g){this.renderer=g}return q.prototype.flush=function(){},q.prototype.destroy=function(){this.renderer=null},q.prototype.start=function(){},q.prototype.stop=function(){this.flush()},q.prototype.render=function(g){},q}(),Ee=function(){function q(g){this.renderer=g,this.emptyRenderer=new pe(g),this.currentRenderer=this.emptyRenderer}return q.prototype.setObjectRenderer=function(g){this.currentRenderer!==g&&(this.currentRenderer.stop(),this.currentRenderer=g,this.currentRenderer.start())},q.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},q.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},q.prototype.copyBoundTextures=function(g,m){for(var _=this.renderer.texture.boundTextures,N=m-1;N>=0;--N)g[N]=_[N]||null,g[N]&&(g[N]._batchLocation=N)},q.prototype.boundArray=function(g,m,_,N){for(var J=g.elements,lt=g.ids,xt=g.count,Tt=0,Zt=0;Zt<xt;Zt++){var ee=J[Zt],Fe=ee._batchLocation;if(Fe>=0&&Fe<N&&m[Fe]===ee)lt[Zt]=Fe;else for(;Tt<N;){var Te=m[Tt];if(!Te||Te._batchEnabled!==_||Te._batchLocation!==Tt){lt[Zt]=Tt,ee._batchLocation=Tt,m[Tt]=ee;break}Tt++}}},q.prototype.destroy=function(){this.renderer=null},q}(),ln=0,In=function(){function q(g){this.renderer=g,this.webGLVersion=1,this.extensions={},this.supports={uint32Indices:!1},this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this),g.view.addEventListener("webglcontextlost",this.handleContextLost,!1),g.view.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}return Object.defineProperty(q.prototype,"isLost",{get:function(){return!this.gl||this.gl.isContextLost()},enumerable:!1,configurable:!0}),q.prototype.contextChange=function(g){this.gl=g,this.renderer.gl=g,this.renderer.CONTEXT_UID=ln++,g.isContextLost()&&g.getExtension("WEBGL_lose_context")&&g.getExtension("WEBGL_lose_context").restoreContext()},q.prototype.initFromContext=function(g){this.gl=g,this.validateContext(g),this.renderer.gl=g,this.renderer.CONTEXT_UID=ln++,this.renderer.runners.contextChange.emit(g)},q.prototype.initFromOptions=function(g){var m=this.createContext(this.renderer.view,g);this.initFromContext(m)},q.prototype.createContext=function(g,m){var _;if(O.b.PREFER_ENV>=M.g.WEBGL2&&(_=g.getContext("webgl2",m)),_)this.webGLVersion=2;else if(this.webGLVersion=1,!(_=g.getContext("webgl",m)||g.getContext("experimental-webgl",m)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=_,this.getExtensions(),this.gl},q.prototype.getExtensions=function(){var g=this.gl,m={anisotropicFiltering:g.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:g.getExtension("OES_texture_float_linear"),s3tc:g.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:g.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:g.getExtension("WEBGL_compressed_texture_etc"),etc1:g.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:g.getExtension("WEBGL_compressed_texture_pvrtc")||g.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:g.getExtension("WEBGL_compressed_texture_atc"),astc:g.getExtension("WEBGL_compressed_texture_astc")};this.webGLVersion===1?Object.assign(this.extensions,m,{drawBuffers:g.getExtension("WEBGL_draw_buffers"),depthTexture:g.getExtension("WEBGL_depth_texture"),loseContext:g.getExtension("WEBGL_lose_context"),vertexArrayObject:g.getExtension("OES_vertex_array_object")||g.getExtension("MOZ_OES_vertex_array_object")||g.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:g.getExtension("OES_element_index_uint"),floatTexture:g.getExtension("OES_texture_float"),floatTextureLinear:g.getExtension("OES_texture_float_linear"),textureHalfFloat:g.getExtension("OES_texture_half_float"),textureHalfFloatLinear:g.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,m,{colorBufferFloat:g.getExtension("EXT_color_buffer_float")})},q.prototype.handleContextLost=function(g){g.preventDefault()},q.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},q.prototype.destroy=function(){var g=this.renderer.view;this.renderer=null,g.removeEventListener("webglcontextlost",this.handleContextLost),g.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},q.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},q.prototype.validateContext=function(g){var m=g.getContextAttributes(),_="WebGL2RenderingContext"in globalThis&&g instanceof globalThis.WebGL2RenderingContext;_&&(this.webGLVersion=2),m&&!m.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var N=_||!!g.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")},q}(),Kn=function(q){this.framebuffer=q,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=M.l.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0},pi=new V.j,tn=function(){function q(g){this.renderer=g,this.managedFramebuffers=[],this.unknownFramebuffer=new dt(10,10),this.msaaSamples=null}return q.prototype.contextChange=function(){var g=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new V.j,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),this.renderer.context.webGLVersion===1){var m=this.renderer.context.extensions.drawBuffers,_=this.renderer.context.extensions.depthTexture;O.b.PREFER_ENV===M.g.WEBGL_LEGACY&&(m=null,_=null),m?g.drawBuffers=function(N){return m.drawBuffersWEBGL(N)}:(this.hasMRT=!1,g.drawBuffers=function(){}),_||(this.writeDepthTexture=!1)}else this.msaaSamples=g.getInternalformatParameter(g.RENDERBUFFER,g.RGBA8,g.SAMPLES)},q.prototype.bind=function(g,m,_){_===void 0&&(_=0);var N=this.gl;if(g){var J=g.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(g);this.current!==g&&(this.current=g,N.bindFramebuffer(N.FRAMEBUFFER,J.framebuffer)),J.mipLevel!==_&&(g.dirtyId++,g.dirtyFormat++,J.mipLevel=_),J.dirtyId!==g.dirtyId&&(J.dirtyId=g.dirtyId,J.dirtyFormat!==g.dirtyFormat?(J.dirtyFormat=g.dirtyFormat,J.dirtySize=g.dirtySize,this.updateFramebuffer(g,_)):J.dirtySize!==g.dirtySize&&(J.dirtySize=g.dirtySize,this.resizeFramebuffer(g)));for(var lt=0;lt<g.colorTextures.length;lt++){var xt=g.colorTextures[lt];this.renderer.texture.unbind(xt.parentTextureArray||xt)}if(g.depthTexture&&this.renderer.texture.unbind(g.depthTexture),m){var Tt=m.width>>_,Zt=m.height>>_,ee=Tt/m.width;this.setViewport(m.x*ee,m.y*ee,Tt,Zt)}else Tt=g.width>>_,Zt=g.height>>_,this.setViewport(0,0,Tt,Zt)}else this.current&&(this.current=null,N.bindFramebuffer(N.FRAMEBUFFER,null)),m?this.setViewport(m.x,m.y,m.width,m.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},q.prototype.setViewport=function(g,m,_,N){var J=this.viewport;g=Math.round(g),m=Math.round(m),_=Math.round(_),N=Math.round(N),J.width===_&&J.height===N&&J.x===g&&J.y===m||(J.x=g,J.y=m,J.width=_,J.height=N,this.gl.viewport(g,m,_,N))},Object.defineProperty(q.prototype,"size",{get:function(){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}},enumerable:!1,configurable:!0}),q.prototype.clear=function(g,m,_,N,J){J===void 0&&(J=M.c.COLOR|M.c.DEPTH);var lt=this.gl;lt.clearColor(g,m,_,N),lt.clear(J)},q.prototype.initFramebuffer=function(g){var m=this.gl,_=new Kn(m.createFramebuffer());return _.multisample=this.detectSamples(g.multisample),g.glFramebuffers[this.CONTEXT_UID]=_,this.managedFramebuffers.push(g),g.disposeRunner.add(this),_},q.prototype.resizeFramebuffer=function(g){var m=this.gl,_=g.glFramebuffers[this.CONTEXT_UID];_.msaaBuffer&&(m.bindRenderbuffer(m.RENDERBUFFER,_.msaaBuffer),m.renderbufferStorageMultisample(m.RENDERBUFFER,_.multisample,m.RGBA8,g.width,g.height)),_.stencil&&(m.bindRenderbuffer(m.RENDERBUFFER,_.stencil),_.msaaBuffer?m.renderbufferStorageMultisample(m.RENDERBUFFER,_.multisample,m.DEPTH24_STENCIL8,g.width,g.height):m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_STENCIL,g.width,g.height));var N=g.colorTextures,J=N.length;m.drawBuffers||(J=Math.min(J,1));for(var lt=0;lt<J;lt++){var xt=N[lt],Tt=xt.parentTextureArray||xt;this.renderer.texture.bind(Tt,0)}g.depthTexture&&this.writeDepthTexture&&this.renderer.texture.bind(g.depthTexture,0)},q.prototype.updateFramebuffer=function(g,m){var _=this.gl,N=g.glFramebuffers[this.CONTEXT_UID],J=g.colorTextures,lt=J.length;_.drawBuffers||(lt=Math.min(lt,1)),N.multisample>1&&this.canMultisampleFramebuffer(g)?(N.msaaBuffer=N.msaaBuffer||_.createRenderbuffer(),_.bindRenderbuffer(_.RENDERBUFFER,N.msaaBuffer),_.renderbufferStorageMultisample(_.RENDERBUFFER,N.multisample,_.RGBA8,g.width,g.height),_.framebufferRenderbuffer(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0,_.RENDERBUFFER,N.msaaBuffer)):N.msaaBuffer&&(_.deleteRenderbuffer(N.msaaBuffer),N.msaaBuffer=null,N.blitFramebuffer&&(N.blitFramebuffer.dispose(),N.blitFramebuffer=null));for(var xt=[],Tt=0;Tt<lt;Tt++){var Zt=J[Tt],ee=Zt.parentTextureArray||Zt;this.renderer.texture.bind(ee,0),Tt===0&&N.msaaBuffer||(_.framebufferTexture2D(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0+Tt,Zt.target,ee._glTextures[this.CONTEXT_UID].texture,m),xt.push(_.COLOR_ATTACHMENT0+Tt))}if(xt.length>1&&_.drawBuffers(xt),g.depthTexture&&this.writeDepthTexture){var Fe=g.depthTexture;this.renderer.texture.bind(Fe,0),_.framebufferTexture2D(_.FRAMEBUFFER,_.DEPTH_ATTACHMENT,_.TEXTURE_2D,Fe._glTextures[this.CONTEXT_UID].texture,m)}!g.stencil&&!g.depth||g.depthTexture&&this.writeDepthTexture?N.stencil&&(_.deleteRenderbuffer(N.stencil),N.stencil=null):(N.stencil=N.stencil||_.createRenderbuffer(),_.bindRenderbuffer(_.RENDERBUFFER,N.stencil),N.msaaBuffer?_.renderbufferStorageMultisample(_.RENDERBUFFER,N.multisample,_.DEPTH24_STENCIL8,g.width,g.height):_.renderbufferStorage(_.RENDERBUFFER,_.DEPTH_STENCIL,g.width,g.height),_.framebufferRenderbuffer(_.FRAMEBUFFER,_.DEPTH_STENCIL_ATTACHMENT,_.RENDERBUFFER,N.stencil))},q.prototype.canMultisampleFramebuffer=function(g){return this.renderer.context.webGLVersion!==1&&g.colorTextures.length<=1&&!g.depthTexture},q.prototype.detectSamples=function(g){var m=this.msaaSamples,_=M.l.NONE;if(g<=1||m===null)return _;for(var N=0;N<m.length;N++)if(m[N]<=g){_=m[N];break}return _===1&&(_=M.l.NONE),_},q.prototype.blit=function(g,m,_){var N=this.current,J=this.renderer,lt=this.gl,xt=this.CONTEXT_UID;if(J.context.webGLVersion===2&&N){var Tt=N.glFramebuffers[xt];if(Tt){if(!g){if(!Tt.msaaBuffer)return;var Zt=N.colorTextures[0];if(!Zt)return;Tt.blitFramebuffer||(Tt.blitFramebuffer=new dt(N.width,N.height),Tt.blitFramebuffer.addColorTexture(0,Zt)),(g=Tt.blitFramebuffer).colorTextures[0]!==Zt&&(g.colorTextures[0]=Zt,g.dirtyId++,g.dirtyFormat++),g.width===N.width&&g.height===N.height||(g.width=N.width,g.height=N.height,g.dirtyId++,g.dirtySize++)}m||((m=pi).width=N.width,m.height=N.height),_||(_=m);var ee=m.width===_.width&&m.height===_.height;this.bind(g),lt.bindFramebuffer(lt.READ_FRAMEBUFFER,Tt.framebuffer),lt.blitFramebuffer(m.left,m.top,m.right,m.bottom,_.left,_.top,_.right,_.bottom,lt.COLOR_BUFFER_BIT,ee?lt.NEAREST:lt.LINEAR)}}},q.prototype.disposeFramebuffer=function(g,m){var _=g.glFramebuffers[this.CONTEXT_UID],N=this.gl;if(_){delete g.glFramebuffers[this.CONTEXT_UID];var J=this.managedFramebuffers.indexOf(g);J>=0&&this.managedFramebuffers.splice(J,1),g.disposeRunner.remove(this),m||(N.deleteFramebuffer(_.framebuffer),_.msaaBuffer&&N.deleteRenderbuffer(_.msaaBuffer),_.stencil&&N.deleteRenderbuffer(_.stencil)),_.blitFramebuffer&&_.blitFramebuffer.dispose()}},q.prototype.disposeAll=function(g){var m=this.managedFramebuffers;this.managedFramebuffers=[];for(var _=0;_<m.length;_++)this.disposeFramebuffer(m[_],g)},q.prototype.forceStencil=function(){var g=this.current;if(g){var m=g.glFramebuffers[this.CONTEXT_UID];if(m&&!m.stencil){g.stencil=!0;var _=g.width,N=g.height,J=this.gl,lt=J.createRenderbuffer();J.bindRenderbuffer(J.RENDERBUFFER,lt),m.msaaBuffer?J.renderbufferStorageMultisample(J.RENDERBUFFER,m.multisample,J.DEPTH24_STENCIL8,_,N):J.renderbufferStorage(J.RENDERBUFFER,J.DEPTH_STENCIL,_,N),m.stencil=lt,J.framebufferRenderbuffer(J.FRAMEBUFFER,J.DEPTH_STENCIL_ATTACHMENT,J.RENDERBUFFER,lt)}}},q.prototype.reset=function(){this.current=this.unknownFramebuffer,this.viewport=new V.j},q.prototype.destroy=function(){this.renderer=null},q}(),yt={5126:4,5123:2,5121:1},Et=function(){function q(g){this.renderer=g,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.canUseUInt32ElementIndex=!1,this.managedGeometries={}}return q.prototype.contextChange=function(){this.disposeAll(!0);var g=this.gl=this.renderer.gl,m=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,m.webGLVersion!==2){var _=this.renderer.context.extensions.vertexArrayObject;O.b.PREFER_ENV===M.g.WEBGL_LEGACY&&(_=null),_?(g.createVertexArray=function(){return _.createVertexArrayOES()},g.bindVertexArray=function(J){return _.bindVertexArrayOES(J)},g.deleteVertexArray=function(J){return _.deleteVertexArrayOES(J)}):(this.hasVao=!1,g.createVertexArray=function(){return null},g.bindVertexArray=function(){return null},g.deleteVertexArray=function(){return null})}if(m.webGLVersion!==2){var N=g.getExtension("ANGLE_instanced_arrays");N?(g.vertexAttribDivisor=function(J,lt){return N.vertexAttribDivisorANGLE(J,lt)},g.drawElementsInstanced=function(J,lt,xt,Tt,Zt){return N.drawElementsInstancedANGLE(J,lt,xt,Tt,Zt)},g.drawArraysInstanced=function(J,lt,xt,Tt){return N.drawArraysInstancedANGLE(J,lt,xt,Tt)}):this.hasInstance=!1}this.canUseUInt32ElementIndex=m.webGLVersion===2||!!m.extensions.uint32ElementIndex},q.prototype.bind=function(g,m){m=m||this.renderer.shader.shader;var _=this.gl,N=g.glVertexArrayObjects[this.CONTEXT_UID],J=!1;N||(this.managedGeometries[g.id]=g,g.disposeRunner.add(this),g.glVertexArrayObjects[this.CONTEXT_UID]=N={},J=!0);var lt=N[m.program.id]||this.initGeometryVao(g,m,J);this._activeGeometry=g,this._activeVao!==lt&&(this._activeVao=lt,this.hasVao?_.bindVertexArray(lt):this.activateVao(g,m.program)),this.updateBuffers()},q.prototype.reset=function(){this.unbind()},q.prototype.updateBuffers=function(){for(var g=this._activeGeometry,m=this.renderer.buffer,_=0;_<g.buffers.length;_++){var N=g.buffers[_];m.update(N)}},q.prototype.checkCompatibility=function(g,m){var _=g.attributes,N=m.attributeData;for(var J in N)if(!_[J])throw new Error('shader and geometry incompatible, geometry missing the "'+J+'" attribute')},q.prototype.getSignature=function(g,m){var _=g.attributes,N=m.attributeData,J=["g",g.id];for(var lt in _)N[lt]&&J.push(lt,N[lt].location);return J.join("-")},q.prototype.initGeometryVao=function(g,m,_){_===void 0&&(_=!0);var N=this.gl,J=this.CONTEXT_UID,lt=this.renderer.buffer,xt=m.program;xt.glPrograms[J]||this.renderer.shader.generateProgram(m),this.checkCompatibility(g,xt);var Tt=this.getSignature(g,xt),Zt=g.glVertexArrayObjects[this.CONTEXT_UID],ee=Zt[Tt];if(ee)return Zt[xt.id]=ee,ee;var Fe=g.buffers,Te=g.attributes,Qe={},hn={};for(var vn in Fe)Qe[vn]=0,hn[vn]=0;for(var vn in Te)!Te[vn].size&&xt.attributeData[vn]?Te[vn].size=xt.attributeData[vn].size:Te[vn].size||console.warn("PIXI Geometry attribute '"+vn+"' size cannot be determined (likely the bound shader does not have the attribute)"),Qe[Te[vn].buffer]+=Te[vn].size*yt[Te[vn].type];for(var vn in Te){var un=Te[vn],Zn=un.size;un.stride===void 0&&(Qe[un.buffer]===Zn*yt[un.type]?un.stride=0:un.stride=Qe[un.buffer]),un.start===void 0&&(un.start=hn[un.buffer],hn[un.buffer]+=Zn*yt[un.type])}ee=N.createVertexArray(),N.bindVertexArray(ee);for(var mi=0;mi<Fe.length;mi++){var gi=Fe[mi];lt.bind(gi),_&&gi._glBuffers[J].refCount++}return this.activateVao(g,xt),this._activeVao=ee,Zt[xt.id]=ee,Zt[Tt]=ee,ee},q.prototype.disposeGeometry=function(g,m){var _;if(this.managedGeometries[g.id]){delete this.managedGeometries[g.id];var N=g.glVertexArrayObjects[this.CONTEXT_UID],J=this.gl,lt=g.buffers,xt=(_=this.renderer)===null||_===void 0?void 0:_.buffer;if(g.disposeRunner.remove(this),N){if(xt)for(var Tt=0;Tt<lt.length;Tt++){var Zt=lt[Tt]._glBuffers[this.CONTEXT_UID];Zt&&(Zt.refCount--,Zt.refCount!==0||m||xt.dispose(lt[Tt],m))}if(!m){for(var ee in N)if(ee[0]==="g"){var Fe=N[ee];this._activeVao===Fe&&this.unbind(),J.deleteVertexArray(Fe)}}delete g.glVertexArrayObjects[this.CONTEXT_UID]}}},q.prototype.disposeAll=function(g){for(var m=Object.keys(this.managedGeometries),_=0;_<m.length;_++)this.disposeGeometry(this.managedGeometries[m[_]],g)},q.prototype.activateVao=function(g,m){var _=this.gl,N=this.CONTEXT_UID,J=this.renderer.buffer,lt=g.buffers,xt=g.attributes;g.indexBuffer&&J.bind(g.indexBuffer);var Tt=null;for(var Zt in xt){var ee=xt[Zt],Fe=lt[ee.buffer],Te=Fe._glBuffers[N];if(m.attributeData[Zt]){Tt!==Te&&(J.bind(Fe),Tt=Te);var Qe=m.attributeData[Zt].location;if(_.enableVertexAttribArray(Qe),_.vertexAttribPointer(Qe,ee.size,ee.type||_.FLOAT,ee.normalized,ee.stride,ee.start),ee.instance){if(!this.hasInstance)throw new Error("geometry error, GPU Instancing is not supported on this device");_.vertexAttribDivisor(Qe,1)}}}},q.prototype.draw=function(g,m,_,N){var J=this.gl,lt=this._activeGeometry;if(lt.indexBuffer){var xt=lt.indexBuffer.data.BYTES_PER_ELEMENT,Tt=xt===2?J.UNSIGNED_SHORT:J.UNSIGNED_INT;xt===2||xt===4&&this.canUseUInt32ElementIndex?lt.instanced?J.drawElementsInstanced(g,m||lt.indexBuffer.data.length,Tt,(_||0)*xt,N||1):J.drawElements(g,m||lt.indexBuffer.data.length,Tt,(_||0)*xt):console.warn("unsupported index buffer type: uint32")}else lt.instanced?J.drawArraysInstanced(g,_,m||lt.getSize(),N||1):J.drawArrays(g,_,m||lt.getSize());return this},q.prototype.unbind=function(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null},q.prototype.destroy=function(){this.renderer=null},q}(),Rt=function(){function q(g){g===void 0&&(g=null),this.type=M.j.NONE,this.autoDetect=!0,this.maskObject=g||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=O.b.FILTER_MULTISAMPLE,this.enabled=!0,this._filters=null,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._scissorRectLocal=null,this._target=null}return Object.defineProperty(q.prototype,"filter",{get:function(){return this._filters?this._filters[0]:null},set:function(g){g?this._filters?this._filters[0]=g:this._filters=[g]:this._filters=null},enumerable:!1,configurable:!0}),q.prototype.reset=function(){this.pooled&&(this.maskObject=null,this.type=M.j.NONE,this.autoDetect=!0),this._target=null,this._scissorRectLocal=null},q.prototype.copyCountersOrReset=function(g){g?(this._stencilCounter=g._stencilCounter,this._scissorCounter=g._scissorCounter,this._scissorRect=g._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)},q}();function Qt(q,g,m){var _=q.createShader(g);return q.shaderSource(_,m),q.compileShader(_),_}function Wt(q,g){var m=q.getShaderSource(g).split(`
|
|
33
33
|
`).map(function(Zt,ee){return ee+": "+Zt}),_=q.getShaderInfoLog(g),N=_.split(`
|
|
34
34
|
`),J={},lt=N.map(function(Zt){return parseFloat(Zt.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))}).filter(function(Zt){return!(!Zt||J[Zt])&&(J[Zt]=!0,!0)}),xt=[""];lt.forEach(function(Zt){m[Zt-1]="%c"+m[Zt-1]+"%c",xt.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});var Tt=m.join(`
|
|
35
35
|
`);xt[0]=Tt,console.error(_),console.groupCollapsed("click to view full shader code"),console.warn.apply(console,xt),console.groupEnd()}function Kt(q){for(var g=new Array(q),m=0;m<g.length;m++)g[m]=!1;return g}function oe(q,g){switch(q){case"float":return 0;case"vec2":return new Float32Array(2*g);case"vec3":return new Float32Array(3*g);case"vec4":return new Float32Array(4*g);case"int":case"uint":case"sampler2D":case"sampler2DArray":return 0;case"ivec2":return new Int32Array(2*g);case"ivec3":return new Int32Array(3*g);case"ivec4":return new Int32Array(4*g);case"uvec2":return new Uint32Array(2*g);case"uvec3":return new Uint32Array(3*g);case"uvec4":return new Uint32Array(4*g);case"bool":return!1;case"bvec2":return Kt(2*g);case"bvec3":return Kt(3*g);case"bvec4":return Kt(4*g);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}var Me,we={},Se=we;function Ve(){if(!Me){Me=M.m.MEDIUM;var q=function(){if(Se===we||Se&&Se.isContextLost()){var m=document.createElement("canvas"),_=void 0;O.b.PREFER_ENV>=M.g.WEBGL2&&(_=m.getContext("webgl2",{})),_||((_=m.getContext("webgl",{})||m.getContext("experimental-webgl",{}))?_.getExtension("WEBGL_draw_buffers"):_=null),Se=_}return Se}();if(q&&q.getShaderPrecisionFormat){var g=q.getShaderPrecisionFormat(q.FRAGMENT_SHADER,q.HIGH_FLOAT);Me=g.precision?M.m.HIGH:M.m.MEDIUM}}return Me}function en(q,g,m){if(q.substring(0,9)!=="precision"){var _=g;return g===M.m.HIGH&&m!==M.m.HIGH&&(_=M.m.MEDIUM),"precision "+_+` float;
|
|
@@ -290,7 +290,7 @@ uniform sampler2D uSampler;
|
|
|
290
290
|
void main(void){
|
|
291
291
|
gl_FragColor = texture2D(uSampler, vTextureCoord);
|
|
292
292
|
}
|
|
293
|
-
`},enumerable:!1,configurable:!0}),g}(Ki),wr=new
|
|
293
|
+
`},enumerable:!1,configurable:!0}),g}(Ki),wr=new V.d,Lr=function(){function q(g,m){this._texture=g,this.mapCoord=new V.d,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=m===void 0?.5:m,this.isSimple=!1}return Object.defineProperty(q.prototype,"texture",{get:function(){return this._texture},set:function(g){this._texture=g,this._textureID=-1},enumerable:!1,configurable:!0}),q.prototype.multiplyUvs=function(g,m){m===void 0&&(m=g);for(var _=this.mapCoord,N=0;N<g.length;N+=2){var J=g[N],lt=g[N+1];m[N]=J*_.a+lt*_.c+_.tx,m[N+1]=J*_.b+lt*_.d+_.ty}return m},q.prototype.update=function(g){var m=this._texture;if(!m||!m.valid||!g&&this._textureID===m._updateID)return!1;this._textureID=m._updateID,this._updateID++;var _=m._uvs;this.mapCoord.set(_.x1-_.x0,_.y1-_.y0,_.x3-_.x0,_.y3-_.y0,_.x0,_.y0);var N=m.orig,J=m.trim;J&&(wr.set(N.width/J.width,0,0,N.height/J.height,-J.x/J.width,-J.y/J.height),this.mapCoord.append(wr));var lt=m.baseTexture,xt=this.uClampFrame,Tt=this.clampMargin/lt.resolution,Zt=this.clampOffset;return xt[0]=(m._frame.x+Tt+Zt)/lt.width,xt[1]=(m._frame.y+Tt+Zt)/lt.height,xt[2]=(m._frame.x+m._frame.width-Tt+Zt)/lt.width,xt[3]=(m._frame.y+m._frame.height-Tt+Zt)/lt.height,this.uClampOffset[0]=Zt/lt.realWidth,this.uClampOffset[1]=Zt/lt.realHeight,this.isSimple=m._frame.width===lt.width&&m._frame.height===lt.height&&m.rotate===0,!0},q}(),qo=function(q){function g(m,_,N){var J=this,lt=null;return typeof m!="string"&&_===void 0&&N===void 0&&(lt=m,m=void 0,_=void 0,N=void 0),(J=q.call(this,m||`attribute vec2 aVertexPosition;
|
|
294
294
|
attribute vec2 aTextureCoord;
|
|
295
295
|
|
|
296
296
|
uniform mat3 projectionMatrix;
|
|
@@ -331,7 +331,7 @@ void main(void)
|
|
|
331
331
|
|
|
332
332
|
gl_FragColor = original;
|
|
333
333
|
}
|
|
334
|
-
`,N)||this).maskSprite=lt,J.maskMatrix=new
|
|
334
|
+
`,N)||this).maskSprite=lt,J.maskMatrix=new V.d,J}return ft(g,q),Object.defineProperty(g.prototype,"maskSprite",{get:function(){return this._maskSprite},set:function(m){this._maskSprite=m,this._maskSprite&&(this._maskSprite.renderable=!1)},enumerable:!1,configurable:!0}),g.prototype.apply=function(m,_,N,J){var lt=this._maskSprite,xt=lt._texture;xt.valid&&(xt.uvMatrix||(xt.uvMatrix=new Lr(xt,0)),xt.uvMatrix.update(),this.uniforms.npmAlpha=xt.baseTexture.alphaMode?0:1,this.uniforms.mask=xt,this.uniforms.otherMatrix=m.calculateSpriteMatrix(this.maskMatrix,lt).prepend(xt.uvMatrix.mapCoord),this.uniforms.alpha=lt.worldAlpha,this.uniforms.maskClamp=xt.uvMatrix.uClampFrame,m.applyFilter(this,_,N,J))},g}(Mi),Jo=function(){function q(g){this.renderer=g,this.enableScissor=!0,this.alphaMaskPool=[],this.maskDataPool=[],this.maskStack=[],this.alphaMaskIndex=0}return q.prototype.setMaskStack=function(g){this.maskStack=g,this.renderer.scissor.setMaskStack(g),this.renderer.stencil.setMaskStack(g)},q.prototype.push=function(g,m){var _=m;if(!_.isMaskData){var N=this.maskDataPool.pop()||new Rt;N.pooled=!0,N.maskObject=m,_=N}var J=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null;if(_.copyCountersOrReset(J),_.autoDetect&&this.detect(_),_._target=g,_.type!==M.j.SPRITE&&this.maskStack.push(_),_.enabled)switch(_.type){case M.j.SCISSOR:this.renderer.scissor.push(_);break;case M.j.STENCIL:this.renderer.stencil.push(_);break;case M.j.SPRITE:_.copyCountersOrReset(null),this.pushSpriteMask(_)}_.type===M.j.SPRITE&&this.maskStack.push(_)},q.prototype.pop=function(g){var m=this.maskStack.pop();if(m&&m._target===g){if(m.enabled)switch(m.type){case M.j.SCISSOR:this.renderer.scissor.pop();break;case M.j.STENCIL:this.renderer.stencil.pop(m.maskObject);break;case M.j.SPRITE:this.popSpriteMask(m)}if(m.reset(),m.pooled&&this.maskDataPool.push(m),this.maskStack.length!==0){var _=this.maskStack[this.maskStack.length-1];_.type===M.j.SPRITE&&_._filters&&(_._filters[0].maskSprite=_.maskObject)}}},q.prototype.detect=function(g){g.maskObject.isSprite?g.type=M.j.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(g)?g.type=M.j.SCISSOR:g.type=M.j.STENCIL},q.prototype.pushSpriteMask=function(g){var m,_,N=g.maskObject,J=g._target,lt=g._filters;lt||(lt=this.alphaMaskPool[this.alphaMaskIndex])||(lt=this.alphaMaskPool[this.alphaMaskIndex]=[new qo]);var xt,Tt,Zt=this.renderer,ee=Zt.renderTexture;if(ee.current){var Fe=ee.current;xt=g.resolution||Fe.resolution,Tt=(m=g.multisample)!==null&&m!==void 0?m:Fe.multisample}else xt=g.resolution||Zt.resolution,Tt=(_=g.multisample)!==null&&_!==void 0?_:Zt.multisample;lt[0].resolution=xt,lt[0].multisample=Tt,lt[0].maskSprite=N;var Te=J.filterArea;J.filterArea=N.getBounds(!0),Zt.filter.push(J,lt),J.filterArea=Te,g._filters||this.alphaMaskIndex++},q.prototype.popSpriteMask=function(g){this.renderer.filter.pop(),g._filters?g._filters[0].maskSprite=null:(this.alphaMaskIndex--,this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite=null)},q.prototype.destroy=function(){this.renderer=null},q}(),vo=function(){function q(g){this.renderer=g,this.maskStack=[],this.glConst=0}return q.prototype.getStackLength=function(){return this.maskStack.length},q.prototype.setMaskStack=function(g){var m=this.renderer.gl,_=this.getStackLength();this.maskStack=g;var N=this.getStackLength();N!==_&&(N===0?m.disable(this.glConst):(m.enable(this.glConst),this._useCurrent()))},q.prototype._useCurrent=function(){},q.prototype.destroy=function(){this.renderer=null,this.maskStack=null},q}(),_o=new V.d,ui=function(q){function g(m){var _=q.call(this,m)||this;return _.glConst=WebGLRenderingContext.SCISSOR_TEST,_}return ft(g,q),g.prototype.getStackLength=function(){var m=this.maskStack[this.maskStack.length-1];return m?m._scissorCounter:0},g.prototype.calcScissorRect=function(m){if(!m._scissorRectLocal){var _=m._scissorRect,N=m.maskObject,J=this.renderer,lt=J.renderTexture;N.renderable=!0;var xt=N.getBounds();this.roundFrameToPixels(xt,lt.current?lt.current.resolution:J.resolution,lt.sourceFrame,lt.destinationFrame,J.projection.transform),N.renderable=!1,_&&xt.fit(_),m._scissorRectLocal=xt}},g.isMatrixRotated=function(m){if(!m)return!1;var _=m.a,N=m.b,J=m.c,lt=m.d;return(Math.abs(N)>1e-4||Math.abs(J)>1e-4)&&(Math.abs(_)>1e-4||Math.abs(lt)>1e-4)},g.prototype.testScissor=function(m){var _=m.maskObject;if(!_.isFastRect||!_.isFastRect()||g.isMatrixRotated(_.worldTransform)||g.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(m);var N=m._scissorRectLocal;return N.width>0&&N.height>0},g.prototype.roundFrameToPixels=function(m,_,N,J,lt){g.isMatrixRotated(lt)||((lt=lt?_o.copyFrom(lt):_o.identity()).translate(-N.x,-N.y).scale(J.width/N.width,J.height/N.height).translate(J.x,J.y),this.renderer.filter.transformAABB(lt,m),m.fit(J),m.x=Math.round(m.x*_),m.y=Math.round(m.y*_),m.width=Math.round(m.width*_),m.height=Math.round(m.height*_))},g.prototype.push=function(m){m._scissorRectLocal||this.calcScissorRect(m);var _=this.renderer.gl;m._scissorRect||_.enable(_.SCISSOR_TEST),m._scissorCounter++,m._scissorRect=m._scissorRectLocal,this._useCurrent()},g.prototype.pop=function(){var m=this.renderer.gl;this.getStackLength()>0?this._useCurrent():m.disable(m.SCISSOR_TEST)},g.prototype._useCurrent=function(){var m,_=this.maskStack[this.maskStack.length-1]._scissorRect;m=this.renderer.renderTexture.current?_.y:this.renderer.height-_.height-_.y,this.renderer.gl.scissor(_.x,m,_.width,_.height)},g}(vo),Ko=function(q){function g(m){var _=q.call(this,m)||this;return _.glConst=WebGLRenderingContext.STENCIL_TEST,_}return ft(g,q),g.prototype.getStackLength=function(){var m=this.maskStack[this.maskStack.length-1];return m?m._stencilCounter:0},g.prototype.push=function(m){var _=m.maskObject,N=this.renderer.gl,J=m._stencilCounter;J===0&&(this.renderer.framebuffer.forceStencil(),N.clearStencil(0),N.clear(N.STENCIL_BUFFER_BIT),N.enable(N.STENCIL_TEST)),m._stencilCounter++,N.colorMask(!1,!1,!1,!1),N.stencilFunc(N.EQUAL,J,4294967295),N.stencilOp(N.KEEP,N.KEEP,N.INCR),_.renderable=!0,_.render(this.renderer),this.renderer.batch.flush(),_.renderable=!1,this._useCurrent()},g.prototype.pop=function(m){var _=this.renderer.gl;this.getStackLength()===0?_.disable(_.STENCIL_TEST):(_.colorMask(!1,!1,!1,!1),_.stencilOp(_.KEEP,_.KEEP,_.DECR),m.renderable=!0,m.render(this.renderer),this.renderer.batch.flush(),m.renderable=!1,this._useCurrent())},g.prototype._useCurrent=function(){var m=this.renderer.gl;m.colorMask(!0,!0,!0,!0),m.stencilFunc(m.EQUAL,this.getStackLength(),4294967295),m.stencilOp(m.KEEP,m.KEEP,m.KEEP)},g}(vo),Ci=function(){function q(g){this.renderer=g,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new V.d,this.transform=null}return q.prototype.update=function(g,m,_,N){this.destinationFrame=g||this.destinationFrame||this.defaultFrame,this.sourceFrame=m||this.sourceFrame||g,this.calculateProjection(this.destinationFrame,this.sourceFrame,_,N),this.transform&&this.projectionMatrix.append(this.transform);var J=this.renderer;J.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,J.globalUniforms.update(),J.shader.shader&&J.shader.syncUniformGroup(J.shader.shader.uniforms.globals)},q.prototype.calculateProjection=function(g,m,_,N){var J=this.projectionMatrix,lt=N?-1:1;J.identity(),J.a=1/m.width*2,J.d=lt*(1/m.height*2),J.tx=-1-m.x*J.a,J.ty=-lt-m.y*J.d},q.prototype.setTransform=function(g){},q.prototype.destroy=function(){this.renderer=null},q}(),mr=new V.j,Pi=new V.j,Dr=function(){function q(g){this.renderer=g,this.clearColor=g._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new V.j,this.destinationFrame=new V.j,this.viewportFrame=new V.j}return q.prototype.bind=function(g,m,_){g===void 0&&(g=null);var N,J,lt,xt=this.renderer;this.current=g,g?(lt=(N=g.baseTexture).resolution,m||(mr.width=g.frame.width,mr.height=g.frame.height,m=mr),_||(Pi.x=g.frame.x,Pi.y=g.frame.y,Pi.width=m.width,Pi.height=m.height,_=Pi),J=N.framebuffer):(lt=xt.resolution,m||(mr.width=xt.screen.width,mr.height=xt.screen.height,m=mr),_||((_=mr).width=m.width,_.height=m.height));var Tt=this.viewportFrame;Tt.x=_.x*lt,Tt.y=_.y*lt,Tt.width=_.width*lt,Tt.height=_.height*lt,g||(Tt.y=xt.view.height-(Tt.y+Tt.height)),Tt.ceil(),this.renderer.framebuffer.bind(J,Tt),this.renderer.projection.update(_,m,lt,!J),g?this.renderer.mask.setMaskStack(N.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(m),this.destinationFrame.copyFrom(_)},q.prototype.clear=function(g,m){g=this.current?g||this.current.baseTexture.clearColor:g||this.clearColor;var _=this.destinationFrame,N=this.current?this.current.baseTexture:this.renderer.screen,J=_.width!==N.width||_.height!==N.height;if(J){var lt=this.viewportFrame,xt=lt.x,Tt=lt.y,Zt=lt.width,ee=lt.height;xt=Math.round(xt),Tt=Math.round(Tt),Zt=Math.round(Zt),ee=Math.round(ee),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(xt,Tt,Zt,ee)}this.renderer.framebuffer.clear(g[0],g[1],g[2],g[3],m),J&&this.renderer.scissor.pop()},q.prototype.resize=function(){this.bind(null)},q.prototype.reset=function(){this.bind(null)},q.prototype.destroy=function(){this.renderer=null},q}();function yo(q,g,m,_,N){m.buffer.update(N)}var oo={float:`
|
|
335
335
|
data[offset] = v;
|
|
336
336
|
`,vec2:`
|
|
337
337
|
data[offset] = v[0];
|
|
@@ -416,7 +416,7 @@ void main(void)
|
|
|
416
416
|
`):lt.push(`
|
|
417
417
|
renderer.shader.syncUniformGroup(uv.`+xt+`, syncData);
|
|
418
418
|
`))}return new Function("ud","uv","renderer","syncData",lt.join(`
|
|
419
|
-
`))}(g,this.shader.program.uniformData)),g.syncUniforms[this.shader.program.id]=this.cache[m],g.syncUniforms[this.shader.program.id]},q.prototype.syncUniformBufferGroup=function(g,m){var _=this.getGlProgram();if(!g.static||g.dirtyId!==0||!_.uniformGroups[g.id]){g.dirtyId=0;var N=_.uniformGroups[g.id]||this.createSyncBufferGroup(g,_,m);g.buffer.update(),N(_.uniformData,g.uniforms,this.renderer,Yn,g.buffer)}this.renderer.buffer.bindBufferBase(g.buffer,_.uniformBufferBindings[m])},q.prototype.createSyncBufferGroup=function(g,m,_){var N=this.renderer.gl;this.renderer.buffer.bind(g.buffer);var J=this.gl.getUniformBlockIndex(m.program,_);m.uniformBufferBindings[_]=this.shader.uniformBindCount,N.uniformBlockBinding(m.program,J,this.shader.uniformBindCount),this.shader.uniformBindCount++;var lt=this.getSignature(g,this.shader.program.uniformData,"ubo"),xt=this._uboCache[lt];if(xt||(xt=this._uboCache[lt]=fn(g,this.shader.program.uniformData)),g.autoManage){var Tt=new Float32Array(xt.size/4);g.buffer.update(Tt)}return m.uniformGroups[g.id]=xt.syncFunc,m.uniformGroups[g.id]},q.prototype.getSignature=function(g,m,_){var N=g.uniforms,J=[_+"-"];for(var lt in N)J.push(lt),m[lt]&&J.push(m[lt].type);return J.join("-")},q.prototype.getGlProgram=function(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null},q.prototype.generateProgram=function(g){var m=this.gl,_=g.program,N=Mn(m,_);return _.glPrograms[this.renderer.CONTEXT_UID]=N,N},q.prototype.reset=function(){this.program=null,this.shader=null},q.prototype.destroy=function(){this.renderer=null,this.destroyed=!0},q}(),ea=function(){function q(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=M.b.NONE,this._blendEq=!1,this.map=[],this.map[0]=this.setBlend,this.map[1]=this.setOffset,this.map[2]=this.setCullFace,this.map[3]=this.setDepthTest,this.map[4]=this.setFrontFace,this.map[5]=this.setDepthMask,this.checks=[],this.defaultState=new Vr,this.defaultState.blend=!0}return q.prototype.contextChange=function(g){this.gl=g,this.blendModes=function(m,_){return _===void 0&&(_=[]),_[M.b.NORMAL]=[m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.ADD]=[m.ONE,m.ONE],_[M.b.MULTIPLY]=[m.DST_COLOR,m.ONE_MINUS_SRC_ALPHA,m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.SCREEN]=[m.ONE,m.ONE_MINUS_SRC_COLOR,m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.OVERLAY]=[m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.DARKEN]=[m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.LIGHTEN]=[m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.COLOR_DODGE]=[m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.COLOR_BURN]=[m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.HARD_LIGHT]=[m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.SOFT_LIGHT]=[m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.DIFFERENCE]=[m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.EXCLUSION]=[m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.HUE]=[m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.SATURATION]=[m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.COLOR]=[m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.LUMINOSITY]=[m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.NONE]=[0,0],_[M.b.NORMAL_NPM]=[m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA,m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.ADD_NPM]=[m.SRC_ALPHA,m.ONE,m.ONE,m.ONE],_[M.b.SCREEN_NPM]=[m.SRC_ALPHA,m.ONE_MINUS_SRC_COLOR,m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.SRC_IN]=[m.DST_ALPHA,m.ZERO],_[M.b.SRC_OUT]=[m.ONE_MINUS_DST_ALPHA,m.ZERO],_[M.b.SRC_ATOP]=[m.DST_ALPHA,m.ONE_MINUS_SRC_ALPHA],_[M.b.DST_OVER]=[m.ONE_MINUS_DST_ALPHA,m.ONE],_[M.b.DST_IN]=[m.ZERO,m.SRC_ALPHA],_[M.b.DST_OUT]=[m.ZERO,m.ONE_MINUS_SRC_ALPHA],_[M.b.DST_ATOP]=[m.ONE_MINUS_DST_ALPHA,m.SRC_ALPHA],_[M.b.XOR]=[m.ONE_MINUS_DST_ALPHA,m.ONE_MINUS_SRC_ALPHA],_[M.b.SUBTRACT]=[m.ONE,m.ONE,m.ONE,m.ONE,m.FUNC_REVERSE_SUBTRACT,m.FUNC_ADD],_}(g),this.set(this.defaultState),this.reset()},q.prototype.set=function(g){if(g=g||this.defaultState,this.stateId!==g.data){for(var m=this.stateId^g.data,_=0;m;)1&m&&this.map[_].call(this,!!(g.data&1<<_)),m>>=1,_++;this.stateId=g.data}for(_=0;_<this.checks.length;_++)this.checks[_](this,g)},q.prototype.forceState=function(g){g=g||this.defaultState;for(var m=0;m<this.map.length;m++)this.map[m].call(this,!!(g.data&1<<m));for(m=0;m<this.checks.length;m++)this.checks[m](this,g);this.stateId=g.data},q.prototype.setBlend=function(g){this.updateCheck(q.checkBlendMode,g),this.gl[g?"enable":"disable"](this.gl.BLEND)},q.prototype.setOffset=function(g){this.updateCheck(q.checkPolygonOffset,g),this.gl[g?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)},q.prototype.setDepthTest=function(g){this.gl[g?"enable":"disable"](this.gl.DEPTH_TEST)},q.prototype.setDepthMask=function(g){this.gl.depthMask(g)},q.prototype.setCullFace=function(g){this.gl[g?"enable":"disable"](this.gl.CULL_FACE)},q.prototype.setFrontFace=function(g){this.gl.frontFace(this.gl[g?"CW":"CCW"])},q.prototype.setBlendMode=function(g){if(g!==this.blendMode){this.blendMode=g;var m=this.blendModes[g],_=this.gl;m.length===2?_.blendFunc(m[0],m[1]):_.blendFuncSeparate(m[0],m[1],m[2],m[3]),m.length===6?(this._blendEq=!0,_.blendEquationSeparate(m[4],m[5])):this._blendEq&&(this._blendEq=!1,_.blendEquationSeparate(_.FUNC_ADD,_.FUNC_ADD))}},q.prototype.setPolygonOffset=function(g,m){this.gl.polygonOffset(g,m)},q.prototype.reset=function(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)},q.prototype.updateCheck=function(g,m){var _=this.checks.indexOf(g);m&&_===-1?this.checks.push(g):m||_===-1||this.checks.splice(_,1)},q.checkBlendMode=function(g,m){g.setBlendMode(m.blendMode)},q.checkPolygonOffset=function(g,m){g.setPolygonOffset(1,m.polygonOffset)},q.prototype.destroy=function(){this.gl=null},q}(),To=function(){function q(g){this.renderer=g,this.count=0,this.checkCount=0,this.maxIdle=O.b.GC_MAX_IDLE,this.checkCountMax=O.b.GC_MAX_CHECK_COUNT,this.mode=O.b.GC_MODE}return q.prototype.postrender=function(){this.renderer.renderingToScreen&&(this.count++,this.mode!==M.i.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))},q.prototype.run=function(){for(var g=this.renderer.texture,m=g.managedTextures,_=!1,N=0;N<m.length;N++){var J=m[N];!J.framebuffer&&this.count-J.touched>this.maxIdle&&(g.destroyTexture(J,!0),m[N]=null,_=!0)}if(_){var lt=0;for(N=0;N<m.length;N++)m[N]!==null&&(m[lt++]=m[N]);m.length=lt}},q.prototype.unload=function(g){var m=this.renderer.texture,_=g._texture;_&&!_.framebuffer&&m.destroyTexture(_);for(var N=g.children.length-1;N>=0;N--)this.unload(g.children[N])},q.prototype.destroy=function(){this.renderer=null},q}(),An=function(q){this.texture=q,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=M.r.UNSIGNED_BYTE,this.internalFormat=M.h.RGBA,this.samplerType=0},_s=function(){function q(g){this.renderer=g,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new B,this.hasIntegerTextures=!1}return q.prototype.contextChange=function(){var g=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=function(J){var lt,xt,Tt,Zt,ee,Fe,Te,Qe,hn,vn,un,Zn,mi,gi,ei,Li,Di,hi,bi,vr,Br,$o,ts;return"WebGL2RenderingContext"in globalThis&&J instanceof globalThis.WebGL2RenderingContext?((lt={})[M.r.UNSIGNED_BYTE]=((xt={})[M.h.RGBA]=J.RGBA8,xt[M.h.RGB]=J.RGB8,xt[M.h.RG]=J.RG8,xt[M.h.RED]=J.R8,xt[M.h.RGBA_INTEGER]=J.RGBA8UI,xt[M.h.RGB_INTEGER]=J.RGB8UI,xt[M.h.RG_INTEGER]=J.RG8UI,xt[M.h.RED_INTEGER]=J.R8UI,xt[M.h.ALPHA]=J.ALPHA,xt[M.h.LUMINANCE]=J.LUMINANCE,xt[M.h.LUMINANCE_ALPHA]=J.LUMINANCE_ALPHA,xt),lt[M.r.BYTE]=((Tt={})[M.h.RGBA]=J.RGBA8_SNORM,Tt[M.h.RGB]=J.RGB8_SNORM,Tt[M.h.RG]=J.RG8_SNORM,Tt[M.h.RED]=J.R8_SNORM,Tt[M.h.RGBA_INTEGER]=J.RGBA8I,Tt[M.h.RGB_INTEGER]=J.RGB8I,Tt[M.h.RG_INTEGER]=J.RG8I,Tt[M.h.RED_INTEGER]=J.R8I,Tt),lt[M.r.UNSIGNED_SHORT]=((Zt={})[M.h.RGBA_INTEGER]=J.RGBA16UI,Zt[M.h.RGB_INTEGER]=J.RGB16UI,Zt[M.h.RG_INTEGER]=J.RG16UI,Zt[M.h.RED_INTEGER]=J.R16UI,Zt[M.h.DEPTH_COMPONENT]=J.DEPTH_COMPONENT16,Zt),lt[M.r.SHORT]=((ee={})[M.h.RGBA_INTEGER]=J.RGBA16I,ee[M.h.RGB_INTEGER]=J.RGB16I,ee[M.h.RG_INTEGER]=J.RG16I,ee[M.h.RED_INTEGER]=J.R16I,ee),lt[M.r.UNSIGNED_INT]=((Fe={})[M.h.RGBA_INTEGER]=J.RGBA32UI,Fe[M.h.RGB_INTEGER]=J.RGB32UI,Fe[M.h.RG_INTEGER]=J.RG32UI,Fe[M.h.RED_INTEGER]=J.R32UI,Fe[M.h.DEPTH_COMPONENT]=J.DEPTH_COMPONENT24,Fe),lt[M.r.INT]=((Te={})[M.h.RGBA_INTEGER]=J.RGBA32I,Te[M.h.RGB_INTEGER]=J.RGB32I,Te[M.h.RG_INTEGER]=J.RG32I,Te[M.h.RED_INTEGER]=J.R32I,Te),lt[M.r.FLOAT]=((Qe={})[M.h.RGBA]=J.RGBA32F,Qe[M.h.RGB]=J.RGB32F,Qe[M.h.RG]=J.RG32F,Qe[M.h.RED]=J.R32F,Qe[M.h.DEPTH_COMPONENT]=J.DEPTH_COMPONENT32F,Qe),lt[M.r.HALF_FLOAT]=((hn={})[M.h.RGBA]=J.RGBA16F,hn[M.h.RGB]=J.RGB16F,hn[M.h.RG]=J.RG16F,hn[M.h.RED]=J.R16F,hn),lt[M.r.UNSIGNED_SHORT_5_6_5]=((vn={})[M.h.RGB]=J.RGB565,vn),lt[M.r.UNSIGNED_SHORT_4_4_4_4]=((un={})[M.h.RGBA]=J.RGBA4,un),lt[M.r.UNSIGNED_SHORT_5_5_5_1]=((Zn={})[M.h.RGBA]=J.RGB5_A1,Zn),lt[M.r.UNSIGNED_INT_2_10_10_10_REV]=((mi={})[M.h.RGBA]=J.RGB10_A2,mi[M.h.RGBA_INTEGER]=J.RGB10_A2UI,mi),lt[M.r.UNSIGNED_INT_10F_11F_11F_REV]=((gi={})[M.h.RGB]=J.R11F_G11F_B10F,gi),lt[M.r.UNSIGNED_INT_5_9_9_9_REV]=((ei={})[M.h.RGB]=J.RGB9_E5,ei),lt[M.r.UNSIGNED_INT_24_8]=((Li={})[M.h.DEPTH_STENCIL]=J.DEPTH24_STENCIL8,Li),lt[M.r.FLOAT_32_UNSIGNED_INT_24_8_REV]=((Di={})[M.h.DEPTH_STENCIL]=J.DEPTH32F_STENCIL8,Di),ts=lt):((hi={})[M.r.UNSIGNED_BYTE]=((bi={})[M.h.RGBA]=J.RGBA,bi[M.h.RGB]=J.RGB,bi[M.h.ALPHA]=J.ALPHA,bi[M.h.LUMINANCE]=J.LUMINANCE,bi[M.h.LUMINANCE_ALPHA]=J.LUMINANCE_ALPHA,bi),hi[M.r.UNSIGNED_SHORT_5_6_5]=((vr={})[M.h.RGB]=J.RGB,vr),hi[M.r.UNSIGNED_SHORT_4_4_4_4]=((Br={})[M.h.RGBA]=J.RGBA,Br),hi[M.r.UNSIGNED_SHORT_5_5_5_1]=(($o={})[M.h.RGBA]=J.RGBA,$o),ts=hi),ts}(g);var m=g.getParameter(g.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=m;for(var _=0;_<m;_++)this.boundTextures[_]=null;this.emptyTextures={};var N=new An(g.createTexture());for(g.bindTexture(g.TEXTURE_2D,N.texture),g.texImage2D(g.TEXTURE_2D,0,g.RGBA,1,1,0,g.RGBA,g.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[g.TEXTURE_2D]=N,this.emptyTextures[g.TEXTURE_CUBE_MAP]=new An(g.createTexture()),g.bindTexture(g.TEXTURE_CUBE_MAP,this.emptyTextures[g.TEXTURE_CUBE_MAP].texture),_=0;_<6;_++)g.texImage2D(g.TEXTURE_CUBE_MAP_POSITIVE_X+_,0,g.RGBA,1,1,0,g.RGBA,g.UNSIGNED_BYTE,null);for(g.texParameteri(g.TEXTURE_CUBE_MAP,g.TEXTURE_MAG_FILTER,g.LINEAR),g.texParameteri(g.TEXTURE_CUBE_MAP,g.TEXTURE_MIN_FILTER,g.LINEAR),_=0;_<this.boundTextures.length;_++)this.bind(null,_)},q.prototype.bind=function(g,m){m===void 0&&(m=0);var _=this.gl;if((g=g==null?void 0:g.castToBaseTexture())&&g.valid&&!g.parentTextureArray){g.touched=this.renderer.textureGC.count;var N=g._glTextures[this.CONTEXT_UID]||this.initTexture(g);this.boundTextures[m]!==g&&(this.currentLocation!==m&&(this.currentLocation=m,_.activeTexture(_.TEXTURE0+m)),_.bindTexture(g.target,N.texture)),N.dirtyId!==g.dirtyId&&(this.currentLocation!==m&&(this.currentLocation=m,_.activeTexture(_.TEXTURE0+m)),this.updateTexture(g)),this.boundTextures[m]=g}else this.currentLocation!==m&&(this.currentLocation=m,_.activeTexture(_.TEXTURE0+m)),_.bindTexture(_.TEXTURE_2D,this.emptyTextures[_.TEXTURE_2D].texture),this.boundTextures[m]=null},q.prototype.reset=function(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(var g=0;g<this.boundTextures.length;g++)this.boundTextures[g]=this.unknownTexture},q.prototype.unbind=function(g){var m=this.gl,_=this.boundTextures;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(var N=0;N<_.length;N++)_[N]===this.unknownTexture&&this.bind(null,N)}for(N=0;N<_.length;N++)_[N]===g&&(this.currentLocation!==N&&(m.activeTexture(m.TEXTURE0+N),this.currentLocation=N),m.bindTexture(g.target,this.emptyTextures[g.target].texture),_[N]=null)},q.prototype.ensureSamplerType=function(g){var m=this.boundTextures,_=this.hasIntegerTextures,N=this.CONTEXT_UID;if(_)for(var J=g-1;J>=0;--J){var lt=m[J];lt&<._glTextures[N].samplerType!==M.o.FLOAT&&this.renderer.texture.unbind(lt)}},q.prototype.initTexture=function(g){var m=new An(this.gl.createTexture());return m.dirtyId=-1,g._glTextures[this.CONTEXT_UID]=m,this.managedTextures.push(g),g.on("dispose",this.destroyTexture,this),m},q.prototype.initTextureType=function(g,m){var _,N;m.internalFormat=(N=(_=this.internalFormats[g.type])===null||_===void 0?void 0:_[g.format])!==null&&N!==void 0?N:g.format,this.webGLVersion===2&&g.type===M.r.HALF_FLOAT?m.type=this.gl.HALF_FLOAT:m.type=g.type},q.prototype.updateTexture=function(g){var m=g._glTextures[this.CONTEXT_UID];if(m){var _=this.renderer;if(this.initTextureType(g,m),g.resource&&g.resource.upload(_,g,m))m.samplerType!==M.o.FLOAT&&(this.hasIntegerTextures=!0);else{var N=g.realWidth,J=g.realHeight,lt=_.gl;(m.width!==N||m.height!==J||m.dirtyId<0)&&(m.width=N,m.height=J,lt.texImage2D(g.target,0,m.internalFormat,N,J,0,g.format,m.type,null))}g.dirtyStyleId!==m.dirtyStyleId&&this.updateTextureStyle(g),m.dirtyId=g.dirtyId}},q.prototype.destroyTexture=function(g,m){var _=this.gl;if((g=g.castToBaseTexture())._glTextures[this.CONTEXT_UID]&&(this.unbind(g),_.deleteTexture(g._glTextures[this.CONTEXT_UID].texture),g.off("dispose",this.destroyTexture,this),delete g._glTextures[this.CONTEXT_UID],!m)){var N=this.managedTextures.indexOf(g);N!==-1&&Object(I.removeItems)(this.managedTextures,N,1)}},q.prototype.updateTextureStyle=function(g){var m=g._glTextures[this.CONTEXT_UID];m&&(g.mipmap!==M.k.POW2&&this.webGLVersion===2||g.isPowerOfTwo?m.mipmap=g.mipmap>=1:m.mipmap=!1,this.webGLVersion===2||g.isPowerOfTwo?m.wrapMode=g.wrapMode:m.wrapMode=M.s.CLAMP,g.resource&&g.resource.style(this.renderer,g,m)||this.setStyle(g,m),m.dirtyStyleId=g.dirtyStyleId)},q.prototype.setStyle=function(g,m){var _=this.gl;if(m.mipmap&&g.mipmap!==M.k.ON_MANUAL&&_.generateMipmap(g.target),_.texParameteri(g.target,_.TEXTURE_WRAP_S,m.wrapMode),_.texParameteri(g.target,_.TEXTURE_WRAP_T,m.wrapMode),m.mipmap){_.texParameteri(g.target,_.TEXTURE_MIN_FILTER,g.scaleMode===M.p.LINEAR?_.LINEAR_MIPMAP_LINEAR:_.NEAREST_MIPMAP_NEAREST);var N=this.renderer.context.extensions.anisotropicFiltering;if(N&&g.anisotropicLevel>0&&g.scaleMode===M.p.LINEAR){var J=Math.min(g.anisotropicLevel,_.getParameter(N.MAX_TEXTURE_MAX_ANISOTROPY_EXT));_.texParameterf(g.target,N.TEXTURE_MAX_ANISOTROPY_EXT,J)}}else _.texParameteri(g.target,_.TEXTURE_MIN_FILTER,g.scaleMode===M.p.LINEAR?_.LINEAR:_.NEAREST);_.texParameteri(g.target,_.TEXTURE_MAG_FILTER,g.scaleMode===M.p.LINEAR?_.LINEAR:_.NEAREST)},q.prototype.destroy=function(){this.renderer=null},q}(),Zo=new z.d,xi=function(q){function g(m,_){m===void 0&&(m=M.n.UNKNOWN);var N=q.call(this)||this;return _=Object.assign({},O.b.RENDER_OPTIONS,_),N.options=_,N.type=m,N.screen=new z.j(0,0,_.width,_.height),N.view=_.view||document.createElement("canvas"),N.resolution=_.resolution||O.b.RESOLUTION,N.useContextAlpha=_.useContextAlpha,N.autoDensity=!!_.autoDensity,N.preserveDrawingBuffer=_.preserveDrawingBuffer,N.clearBeforeRender=_.clearBeforeRender,N._backgroundColor=0,N._backgroundColorRgba=[0,0,0,1],N._backgroundColorString="#000000",N.backgroundColor=_.backgroundColor||N._backgroundColor,N.backgroundAlpha=_.backgroundAlpha,_.transparent!==void 0&&(Object(I.deprecation)("6.0.0","Option transparent is deprecated, please use backgroundAlpha instead."),N.useContextAlpha=_.transparent,N.backgroundAlpha=_.transparent?0:1),N._lastObjectRendered=null,N.plugins={},N}return ft(g,q),g.prototype.initPlugins=function(m){for(var _ in m)this.plugins[_]=new m[_](this)},Object.defineProperty(g.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),g.prototype.resize=function(m,_){this.view.width=Math.round(m*this.resolution),this.view.height=Math.round(_*this.resolution);var N=this.view.width/this.resolution,J=this.view.height/this.resolution;this.screen.width=N,this.screen.height=J,this.autoDensity&&(this.view.style.width=N+"px",this.view.style.height=J+"px"),this.emit("resize",N,J)},g.prototype.generateTexture=function(m,_,N,J){_===void 0&&(_={}),typeof _=="number"&&(Object(I.deprecation)("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),_={scaleMode:_,resolution:N,region:J});var lt=_.region,xt=function(Zt,ee){var Fe={};for(var Te in Zt)Object.prototype.hasOwnProperty.call(Zt,Te)&&ee.indexOf(Te)<0&&(Fe[Te]=Zt[Te]);if(Zt!=null&&typeof Object.getOwnPropertySymbols=="function"){var Qe=0;for(Te=Object.getOwnPropertySymbols(Zt);Qe<Te.length;Qe++)ee.indexOf(Te[Qe])<0&&(Fe[Te[Qe]]=Zt[Te[Qe]])}return Fe}(_,["region"]);(J=lt||m.getLocalBounds(null,!0)).width===0&&(J.width=1),J.height===0&&(J.height=1);var Tt=nt.create(Dt({width:J.width,height:J.height},xt));return Zo.tx=-J.x,Zo.ty=-J.y,this.render(m,{renderTexture:Tt,clear:!1,transform:Zo,skipUpdateTransform:!!m.parent}),Tt},g.prototype.destroy=function(m){for(var _ in this.plugins)this.plugins[_].destroy(),this.plugins[_]=null;m&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.plugins=null,this.type=M.n.UNKNOWN,this.view=null,this.screen=null,this._tempDisplayObjectParent=null,this.options=null,this._backgroundColorRgba=null,this._backgroundColorString=null,this._lastObjectRendered=null},Object.defineProperty(g.prototype,"backgroundColor",{get:function(){return this._backgroundColor},set:function(m){this._backgroundColor=m,this._backgroundColorString=Object(I.hex2string)(m),Object(I.hex2rgb)(m,this._backgroundColorRgba)},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"backgroundAlpha",{get:function(){return this._backgroundColorRgba[3]},set:function(m){this._backgroundColorRgba[3]=m},enumerable:!1,configurable:!0}),g}(I.EventEmitter),Qo=function(q){this.buffer=q||null,this.updateID=-1,this.byteLength=-1,this.refCount=0},gr=function(){function q(g){this.renderer=g,this.managedBuffers={},this.boundBufferBases={}}return q.prototype.destroy=function(){this.renderer=null},q.prototype.contextChange=function(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID},q.prototype.bind=function(g){var m=this.gl,_=this.CONTEXT_UID,N=g._glBuffers[_]||this.createGLBuffer(g);m.bindBuffer(g.type,N.buffer)},q.prototype.bindBufferBase=function(g,m){var _=this.gl,N=this.CONTEXT_UID;if(this.boundBufferBases[m]!==g){var J=g._glBuffers[N]||this.createGLBuffer(g);this.boundBufferBases[m]=g,_.bindBufferBase(_.UNIFORM_BUFFER,m,J.buffer)}},q.prototype.bindBufferRange=function(g,m,_){var N=this.gl,J=this.CONTEXT_UID;_=_||0;var lt=g._glBuffers[J]||this.createGLBuffer(g);N.bindBufferRange(N.UNIFORM_BUFFER,m||0,lt.buffer,256*_,256)},q.prototype.update=function(g){var m=this.gl,_=this.CONTEXT_UID,N=g._glBuffers[_];if(g._updateID!==N.updateID)if(N.updateID=g._updateID,m.bindBuffer(g.type,N.buffer),N.byteLength>=g.data.byteLength)m.bufferSubData(g.type,0,g.data);else{var J=g.static?m.STATIC_DRAW:m.DYNAMIC_DRAW;N.byteLength=g.data.byteLength,m.bufferData(g.type,g.data,J)}},q.prototype.dispose=function(g,m){if(this.managedBuffers[g.id]){delete this.managedBuffers[g.id];var _=g._glBuffers[this.CONTEXT_UID],N=this.gl;g.disposeRunner.remove(this),_&&(m||N.deleteBuffer(_.buffer),delete g._glBuffers[this.CONTEXT_UID])}},q.prototype.disposeAll=function(g){for(var m=Object.keys(this.managedBuffers),_=0;_<m.length;_++)this.dispose(this.managedBuffers[m[_]],g)},q.prototype.createGLBuffer=function(g){var m=this.CONTEXT_UID,_=this.gl;return g._glBuffers[m]=new Qo(_.createBuffer()),this.managedBuffers[g.id]=g,g.disposeRunner.add(this),g._glBuffers[m]},q}(),Oi=function(q){function g(m){var _=q.call(this,M.n.WEBGL,m)||this;return m=_.options,_.gl=null,_.CONTEXT_UID=0,_.runners={destroy:new D.a("destroy"),contextChange:new D.a("contextChange"),reset:new D.a("reset"),update:new D.a("update"),postrender:new D.a("postrender"),prerender:new D.a("prerender"),resize:new D.a("resize")},_.runners.contextChange.add(_),_.globalUniforms=new cn({projectionMatrix:new z.d},!0),_.addSystem(Jo,"mask").addSystem(In,"context").addSystem(ea,"state").addSystem(vs,"shader").addSystem(_s,"texture").addSystem(gr,"buffer").addSystem(Et,"geometry").addSystem(tn,"framebuffer").addSystem(ui,"scissor").addSystem(Ko,"stencil").addSystem(Ci,"projection").addSystem(To,"textureGC").addSystem(re,"filter").addSystem(Dr,"renderTexture").addSystem(Ee,"batch"),_.initPlugins(g.__plugins),_.multisample=void 0,m.context?_.context.initFromContext(m.context):_.context.initFromOptions({alpha:!!_.useContextAlpha,antialias:m.antialias,premultipliedAlpha:_.useContextAlpha&&_.useContextAlpha!=="notMultiplied",stencil:!0,preserveDrawingBuffer:m.preserveDrawingBuffer,powerPreference:_.options.powerPreference}),_.renderingToScreen=!0,Object(I.sayHello)(_.context.webGLVersion===2?"WebGL 2":"WebGL 1"),_.resize(_.options.width,_.options.height),_}return ft(g,q),g.create=function(m){if(Object(I.isWebGLSupported)())return new g(m);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},g.prototype.contextChange=function(){var m,_=this.gl;if(this.context.webGLVersion===1){var N=_.getParameter(_.FRAMEBUFFER_BINDING);_.bindFramebuffer(_.FRAMEBUFFER,null),m=_.getParameter(_.SAMPLES),_.bindFramebuffer(_.FRAMEBUFFER,N)}else N=_.getParameter(_.DRAW_FRAMEBUFFER_BINDING),_.bindFramebuffer(_.DRAW_FRAMEBUFFER,null),m=_.getParameter(_.SAMPLES),_.bindFramebuffer(_.DRAW_FRAMEBUFFER,N);m>=M.l.HIGH?this.multisample=M.l.HIGH:m>=M.l.MEDIUM?this.multisample=M.l.MEDIUM:m>=M.l.LOW?this.multisample=M.l.LOW:this.multisample=M.l.NONE},g.prototype.addSystem=function(m,_){var N=new m(this);if(this[_])throw new Error('Whoops! The name "'+_+'" is already in use');for(var J in this[_]=N,this.runners)this.runners[J].add(N);return this},g.prototype.render=function(m,_){var N,J,lt,xt;if(_&&(_ instanceof nt?(Object(I.deprecation)("6.0.0","Renderer#render arguments changed, use options instead."),N=_,J=arguments[2],lt=arguments[3],xt=arguments[4]):(N=_.renderTexture,J=_.clear,lt=_.transform,xt=_.skipUpdateTransform)),this.renderingToScreen=!N,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=lt,!this.context.isLost){if(N||(this._lastObjectRendered=m),!xt){var Tt=m.enableTempParent();m.updateTransform(),m.disableTempParent(Tt)}this.renderTexture.bind(N),this.batch.currentRenderer.start(),(J!==void 0?J:this.clearBeforeRender)&&this.renderTexture.clear(),m.render(this),this.batch.currentRenderer.flush(),N&&N.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},g.prototype.generateTexture=function(m,_,N,J){_===void 0&&(_={});var lt=q.prototype.generateTexture.call(this,m,_,N,J);return this.framebuffer.blit(),lt},g.prototype.resize=function(m,_){q.prototype.resize.call(this,m,_),this.runners.resize.emit(this.screen.height,this.screen.width)},g.prototype.reset=function(){return this.runners.reset.emit(),this},g.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},g.prototype.destroy=function(m){for(var _ in this.runners.destroy.emit(),this.runners)this.runners[_].destroy();q.prototype.destroy.call(this,m),this.gl=null},Object.defineProperty(g.prototype,"extract",{get:function(){return Object(I.deprecation)("6.0.0","Renderer#extract has been deprecated, please use Renderer#plugins.extract instead."),this.plugins.extract},enumerable:!1,configurable:!0}),g.registerPlugin=function(m,_){g.__plugins=g.__plugins||{},g.__plugins[m]=_},g}(xi);function so(q){return Oi.create(q)}var fi=`attribute vec2 aVertexPosition;
|
|
419
|
+
`))}(g,this.shader.program.uniformData)),g.syncUniforms[this.shader.program.id]=this.cache[m],g.syncUniforms[this.shader.program.id]},q.prototype.syncUniformBufferGroup=function(g,m){var _=this.getGlProgram();if(!g.static||g.dirtyId!==0||!_.uniformGroups[g.id]){g.dirtyId=0;var N=_.uniformGroups[g.id]||this.createSyncBufferGroup(g,_,m);g.buffer.update(),N(_.uniformData,g.uniforms,this.renderer,Yn,g.buffer)}this.renderer.buffer.bindBufferBase(g.buffer,_.uniformBufferBindings[m])},q.prototype.createSyncBufferGroup=function(g,m,_){var N=this.renderer.gl;this.renderer.buffer.bind(g.buffer);var J=this.gl.getUniformBlockIndex(m.program,_);m.uniformBufferBindings[_]=this.shader.uniformBindCount,N.uniformBlockBinding(m.program,J,this.shader.uniformBindCount),this.shader.uniformBindCount++;var lt=this.getSignature(g,this.shader.program.uniformData,"ubo"),xt=this._uboCache[lt];if(xt||(xt=this._uboCache[lt]=fn(g,this.shader.program.uniformData)),g.autoManage){var Tt=new Float32Array(xt.size/4);g.buffer.update(Tt)}return m.uniformGroups[g.id]=xt.syncFunc,m.uniformGroups[g.id]},q.prototype.getSignature=function(g,m,_){var N=g.uniforms,J=[_+"-"];for(var lt in N)J.push(lt),m[lt]&&J.push(m[lt].type);return J.join("-")},q.prototype.getGlProgram=function(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null},q.prototype.generateProgram=function(g){var m=this.gl,_=g.program,N=Mn(m,_);return _.glPrograms[this.renderer.CONTEXT_UID]=N,N},q.prototype.reset=function(){this.program=null,this.shader=null},q.prototype.destroy=function(){this.renderer=null,this.destroyed=!0},q}(),ea=function(){function q(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=M.b.NONE,this._blendEq=!1,this.map=[],this.map[0]=this.setBlend,this.map[1]=this.setOffset,this.map[2]=this.setCullFace,this.map[3]=this.setDepthTest,this.map[4]=this.setFrontFace,this.map[5]=this.setDepthMask,this.checks=[],this.defaultState=new Vr,this.defaultState.blend=!0}return q.prototype.contextChange=function(g){this.gl=g,this.blendModes=function(m,_){return _===void 0&&(_=[]),_[M.b.NORMAL]=[m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.ADD]=[m.ONE,m.ONE],_[M.b.MULTIPLY]=[m.DST_COLOR,m.ONE_MINUS_SRC_ALPHA,m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.SCREEN]=[m.ONE,m.ONE_MINUS_SRC_COLOR,m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.OVERLAY]=[m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.DARKEN]=[m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.LIGHTEN]=[m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.COLOR_DODGE]=[m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.COLOR_BURN]=[m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.HARD_LIGHT]=[m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.SOFT_LIGHT]=[m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.DIFFERENCE]=[m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.EXCLUSION]=[m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.HUE]=[m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.SATURATION]=[m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.COLOR]=[m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.LUMINOSITY]=[m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.NONE]=[0,0],_[M.b.NORMAL_NPM]=[m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA,m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.ADD_NPM]=[m.SRC_ALPHA,m.ONE,m.ONE,m.ONE],_[M.b.SCREEN_NPM]=[m.SRC_ALPHA,m.ONE_MINUS_SRC_COLOR,m.ONE,m.ONE_MINUS_SRC_ALPHA],_[M.b.SRC_IN]=[m.DST_ALPHA,m.ZERO],_[M.b.SRC_OUT]=[m.ONE_MINUS_DST_ALPHA,m.ZERO],_[M.b.SRC_ATOP]=[m.DST_ALPHA,m.ONE_MINUS_SRC_ALPHA],_[M.b.DST_OVER]=[m.ONE_MINUS_DST_ALPHA,m.ONE],_[M.b.DST_IN]=[m.ZERO,m.SRC_ALPHA],_[M.b.DST_OUT]=[m.ZERO,m.ONE_MINUS_SRC_ALPHA],_[M.b.DST_ATOP]=[m.ONE_MINUS_DST_ALPHA,m.SRC_ALPHA],_[M.b.XOR]=[m.ONE_MINUS_DST_ALPHA,m.ONE_MINUS_SRC_ALPHA],_[M.b.SUBTRACT]=[m.ONE,m.ONE,m.ONE,m.ONE,m.FUNC_REVERSE_SUBTRACT,m.FUNC_ADD],_}(g),this.set(this.defaultState),this.reset()},q.prototype.set=function(g){if(g=g||this.defaultState,this.stateId!==g.data){for(var m=this.stateId^g.data,_=0;m;)1&m&&this.map[_].call(this,!!(g.data&1<<_)),m>>=1,_++;this.stateId=g.data}for(_=0;_<this.checks.length;_++)this.checks[_](this,g)},q.prototype.forceState=function(g){g=g||this.defaultState;for(var m=0;m<this.map.length;m++)this.map[m].call(this,!!(g.data&1<<m));for(m=0;m<this.checks.length;m++)this.checks[m](this,g);this.stateId=g.data},q.prototype.setBlend=function(g){this.updateCheck(q.checkBlendMode,g),this.gl[g?"enable":"disable"](this.gl.BLEND)},q.prototype.setOffset=function(g){this.updateCheck(q.checkPolygonOffset,g),this.gl[g?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)},q.prototype.setDepthTest=function(g){this.gl[g?"enable":"disable"](this.gl.DEPTH_TEST)},q.prototype.setDepthMask=function(g){this.gl.depthMask(g)},q.prototype.setCullFace=function(g){this.gl[g?"enable":"disable"](this.gl.CULL_FACE)},q.prototype.setFrontFace=function(g){this.gl.frontFace(this.gl[g?"CW":"CCW"])},q.prototype.setBlendMode=function(g){if(g!==this.blendMode){this.blendMode=g;var m=this.blendModes[g],_=this.gl;m.length===2?_.blendFunc(m[0],m[1]):_.blendFuncSeparate(m[0],m[1],m[2],m[3]),m.length===6?(this._blendEq=!0,_.blendEquationSeparate(m[4],m[5])):this._blendEq&&(this._blendEq=!1,_.blendEquationSeparate(_.FUNC_ADD,_.FUNC_ADD))}},q.prototype.setPolygonOffset=function(g,m){this.gl.polygonOffset(g,m)},q.prototype.reset=function(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)},q.prototype.updateCheck=function(g,m){var _=this.checks.indexOf(g);m&&_===-1?this.checks.push(g):m||_===-1||this.checks.splice(_,1)},q.checkBlendMode=function(g,m){g.setBlendMode(m.blendMode)},q.checkPolygonOffset=function(g,m){g.setPolygonOffset(1,m.polygonOffset)},q.prototype.destroy=function(){this.gl=null},q}(),To=function(){function q(g){this.renderer=g,this.count=0,this.checkCount=0,this.maxIdle=O.b.GC_MAX_IDLE,this.checkCountMax=O.b.GC_MAX_CHECK_COUNT,this.mode=O.b.GC_MODE}return q.prototype.postrender=function(){this.renderer.renderingToScreen&&(this.count++,this.mode!==M.i.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))},q.prototype.run=function(){for(var g=this.renderer.texture,m=g.managedTextures,_=!1,N=0;N<m.length;N++){var J=m[N];!J.framebuffer&&this.count-J.touched>this.maxIdle&&(g.destroyTexture(J,!0),m[N]=null,_=!0)}if(_){var lt=0;for(N=0;N<m.length;N++)m[N]!==null&&(m[lt++]=m[N]);m.length=lt}},q.prototype.unload=function(g){var m=this.renderer.texture,_=g._texture;_&&!_.framebuffer&&m.destroyTexture(_);for(var N=g.children.length-1;N>=0;N--)this.unload(g.children[N])},q.prototype.destroy=function(){this.renderer=null},q}(),An=function(q){this.texture=q,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=M.r.UNSIGNED_BYTE,this.internalFormat=M.h.RGBA,this.samplerType=0},_s=function(){function q(g){this.renderer=g,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new B,this.hasIntegerTextures=!1}return q.prototype.contextChange=function(){var g=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=function(J){var lt,xt,Tt,Zt,ee,Fe,Te,Qe,hn,vn,un,Zn,mi,gi,ei,Li,Di,hi,bi,vr,Br,$o,ts;return"WebGL2RenderingContext"in globalThis&&J instanceof globalThis.WebGL2RenderingContext?((lt={})[M.r.UNSIGNED_BYTE]=((xt={})[M.h.RGBA]=J.RGBA8,xt[M.h.RGB]=J.RGB8,xt[M.h.RG]=J.RG8,xt[M.h.RED]=J.R8,xt[M.h.RGBA_INTEGER]=J.RGBA8UI,xt[M.h.RGB_INTEGER]=J.RGB8UI,xt[M.h.RG_INTEGER]=J.RG8UI,xt[M.h.RED_INTEGER]=J.R8UI,xt[M.h.ALPHA]=J.ALPHA,xt[M.h.LUMINANCE]=J.LUMINANCE,xt[M.h.LUMINANCE_ALPHA]=J.LUMINANCE_ALPHA,xt),lt[M.r.BYTE]=((Tt={})[M.h.RGBA]=J.RGBA8_SNORM,Tt[M.h.RGB]=J.RGB8_SNORM,Tt[M.h.RG]=J.RG8_SNORM,Tt[M.h.RED]=J.R8_SNORM,Tt[M.h.RGBA_INTEGER]=J.RGBA8I,Tt[M.h.RGB_INTEGER]=J.RGB8I,Tt[M.h.RG_INTEGER]=J.RG8I,Tt[M.h.RED_INTEGER]=J.R8I,Tt),lt[M.r.UNSIGNED_SHORT]=((Zt={})[M.h.RGBA_INTEGER]=J.RGBA16UI,Zt[M.h.RGB_INTEGER]=J.RGB16UI,Zt[M.h.RG_INTEGER]=J.RG16UI,Zt[M.h.RED_INTEGER]=J.R16UI,Zt[M.h.DEPTH_COMPONENT]=J.DEPTH_COMPONENT16,Zt),lt[M.r.SHORT]=((ee={})[M.h.RGBA_INTEGER]=J.RGBA16I,ee[M.h.RGB_INTEGER]=J.RGB16I,ee[M.h.RG_INTEGER]=J.RG16I,ee[M.h.RED_INTEGER]=J.R16I,ee),lt[M.r.UNSIGNED_INT]=((Fe={})[M.h.RGBA_INTEGER]=J.RGBA32UI,Fe[M.h.RGB_INTEGER]=J.RGB32UI,Fe[M.h.RG_INTEGER]=J.RG32UI,Fe[M.h.RED_INTEGER]=J.R32UI,Fe[M.h.DEPTH_COMPONENT]=J.DEPTH_COMPONENT24,Fe),lt[M.r.INT]=((Te={})[M.h.RGBA_INTEGER]=J.RGBA32I,Te[M.h.RGB_INTEGER]=J.RGB32I,Te[M.h.RG_INTEGER]=J.RG32I,Te[M.h.RED_INTEGER]=J.R32I,Te),lt[M.r.FLOAT]=((Qe={})[M.h.RGBA]=J.RGBA32F,Qe[M.h.RGB]=J.RGB32F,Qe[M.h.RG]=J.RG32F,Qe[M.h.RED]=J.R32F,Qe[M.h.DEPTH_COMPONENT]=J.DEPTH_COMPONENT32F,Qe),lt[M.r.HALF_FLOAT]=((hn={})[M.h.RGBA]=J.RGBA16F,hn[M.h.RGB]=J.RGB16F,hn[M.h.RG]=J.RG16F,hn[M.h.RED]=J.R16F,hn),lt[M.r.UNSIGNED_SHORT_5_6_5]=((vn={})[M.h.RGB]=J.RGB565,vn),lt[M.r.UNSIGNED_SHORT_4_4_4_4]=((un={})[M.h.RGBA]=J.RGBA4,un),lt[M.r.UNSIGNED_SHORT_5_5_5_1]=((Zn={})[M.h.RGBA]=J.RGB5_A1,Zn),lt[M.r.UNSIGNED_INT_2_10_10_10_REV]=((mi={})[M.h.RGBA]=J.RGB10_A2,mi[M.h.RGBA_INTEGER]=J.RGB10_A2UI,mi),lt[M.r.UNSIGNED_INT_10F_11F_11F_REV]=((gi={})[M.h.RGB]=J.R11F_G11F_B10F,gi),lt[M.r.UNSIGNED_INT_5_9_9_9_REV]=((ei={})[M.h.RGB]=J.RGB9_E5,ei),lt[M.r.UNSIGNED_INT_24_8]=((Li={})[M.h.DEPTH_STENCIL]=J.DEPTH24_STENCIL8,Li),lt[M.r.FLOAT_32_UNSIGNED_INT_24_8_REV]=((Di={})[M.h.DEPTH_STENCIL]=J.DEPTH32F_STENCIL8,Di),ts=lt):((hi={})[M.r.UNSIGNED_BYTE]=((bi={})[M.h.RGBA]=J.RGBA,bi[M.h.RGB]=J.RGB,bi[M.h.ALPHA]=J.ALPHA,bi[M.h.LUMINANCE]=J.LUMINANCE,bi[M.h.LUMINANCE_ALPHA]=J.LUMINANCE_ALPHA,bi),hi[M.r.UNSIGNED_SHORT_5_6_5]=((vr={})[M.h.RGB]=J.RGB,vr),hi[M.r.UNSIGNED_SHORT_4_4_4_4]=((Br={})[M.h.RGBA]=J.RGBA,Br),hi[M.r.UNSIGNED_SHORT_5_5_5_1]=(($o={})[M.h.RGBA]=J.RGBA,$o),ts=hi),ts}(g);var m=g.getParameter(g.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=m;for(var _=0;_<m;_++)this.boundTextures[_]=null;this.emptyTextures={};var N=new An(g.createTexture());for(g.bindTexture(g.TEXTURE_2D,N.texture),g.texImage2D(g.TEXTURE_2D,0,g.RGBA,1,1,0,g.RGBA,g.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[g.TEXTURE_2D]=N,this.emptyTextures[g.TEXTURE_CUBE_MAP]=new An(g.createTexture()),g.bindTexture(g.TEXTURE_CUBE_MAP,this.emptyTextures[g.TEXTURE_CUBE_MAP].texture),_=0;_<6;_++)g.texImage2D(g.TEXTURE_CUBE_MAP_POSITIVE_X+_,0,g.RGBA,1,1,0,g.RGBA,g.UNSIGNED_BYTE,null);for(g.texParameteri(g.TEXTURE_CUBE_MAP,g.TEXTURE_MAG_FILTER,g.LINEAR),g.texParameteri(g.TEXTURE_CUBE_MAP,g.TEXTURE_MIN_FILTER,g.LINEAR),_=0;_<this.boundTextures.length;_++)this.bind(null,_)},q.prototype.bind=function(g,m){m===void 0&&(m=0);var _=this.gl;if((g=g==null?void 0:g.castToBaseTexture())&&g.valid&&!g.parentTextureArray){g.touched=this.renderer.textureGC.count;var N=g._glTextures[this.CONTEXT_UID]||this.initTexture(g);this.boundTextures[m]!==g&&(this.currentLocation!==m&&(this.currentLocation=m,_.activeTexture(_.TEXTURE0+m)),_.bindTexture(g.target,N.texture)),N.dirtyId!==g.dirtyId&&(this.currentLocation!==m&&(this.currentLocation=m,_.activeTexture(_.TEXTURE0+m)),this.updateTexture(g)),this.boundTextures[m]=g}else this.currentLocation!==m&&(this.currentLocation=m,_.activeTexture(_.TEXTURE0+m)),_.bindTexture(_.TEXTURE_2D,this.emptyTextures[_.TEXTURE_2D].texture),this.boundTextures[m]=null},q.prototype.reset=function(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(var g=0;g<this.boundTextures.length;g++)this.boundTextures[g]=this.unknownTexture},q.prototype.unbind=function(g){var m=this.gl,_=this.boundTextures;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(var N=0;N<_.length;N++)_[N]===this.unknownTexture&&this.bind(null,N)}for(N=0;N<_.length;N++)_[N]===g&&(this.currentLocation!==N&&(m.activeTexture(m.TEXTURE0+N),this.currentLocation=N),m.bindTexture(g.target,this.emptyTextures[g.target].texture),_[N]=null)},q.prototype.ensureSamplerType=function(g){var m=this.boundTextures,_=this.hasIntegerTextures,N=this.CONTEXT_UID;if(_)for(var J=g-1;J>=0;--J){var lt=m[J];lt&<._glTextures[N].samplerType!==M.o.FLOAT&&this.renderer.texture.unbind(lt)}},q.prototype.initTexture=function(g){var m=new An(this.gl.createTexture());return m.dirtyId=-1,g._glTextures[this.CONTEXT_UID]=m,this.managedTextures.push(g),g.on("dispose",this.destroyTexture,this),m},q.prototype.initTextureType=function(g,m){var _,N;m.internalFormat=(N=(_=this.internalFormats[g.type])===null||_===void 0?void 0:_[g.format])!==null&&N!==void 0?N:g.format,this.webGLVersion===2&&g.type===M.r.HALF_FLOAT?m.type=this.gl.HALF_FLOAT:m.type=g.type},q.prototype.updateTexture=function(g){var m=g._glTextures[this.CONTEXT_UID];if(m){var _=this.renderer;if(this.initTextureType(g,m),g.resource&&g.resource.upload(_,g,m))m.samplerType!==M.o.FLOAT&&(this.hasIntegerTextures=!0);else{var N=g.realWidth,J=g.realHeight,lt=_.gl;(m.width!==N||m.height!==J||m.dirtyId<0)&&(m.width=N,m.height=J,lt.texImage2D(g.target,0,m.internalFormat,N,J,0,g.format,m.type,null))}g.dirtyStyleId!==m.dirtyStyleId&&this.updateTextureStyle(g),m.dirtyId=g.dirtyId}},q.prototype.destroyTexture=function(g,m){var _=this.gl;if((g=g.castToBaseTexture())._glTextures[this.CONTEXT_UID]&&(this.unbind(g),_.deleteTexture(g._glTextures[this.CONTEXT_UID].texture),g.off("dispose",this.destroyTexture,this),delete g._glTextures[this.CONTEXT_UID],!m)){var N=this.managedTextures.indexOf(g);N!==-1&&Object(I.removeItems)(this.managedTextures,N,1)}},q.prototype.updateTextureStyle=function(g){var m=g._glTextures[this.CONTEXT_UID];m&&(g.mipmap!==M.k.POW2&&this.webGLVersion===2||g.isPowerOfTwo?m.mipmap=g.mipmap>=1:m.mipmap=!1,this.webGLVersion===2||g.isPowerOfTwo?m.wrapMode=g.wrapMode:m.wrapMode=M.s.CLAMP,g.resource&&g.resource.style(this.renderer,g,m)||this.setStyle(g,m),m.dirtyStyleId=g.dirtyStyleId)},q.prototype.setStyle=function(g,m){var _=this.gl;if(m.mipmap&&g.mipmap!==M.k.ON_MANUAL&&_.generateMipmap(g.target),_.texParameteri(g.target,_.TEXTURE_WRAP_S,m.wrapMode),_.texParameteri(g.target,_.TEXTURE_WRAP_T,m.wrapMode),m.mipmap){_.texParameteri(g.target,_.TEXTURE_MIN_FILTER,g.scaleMode===M.p.LINEAR?_.LINEAR_MIPMAP_LINEAR:_.NEAREST_MIPMAP_NEAREST);var N=this.renderer.context.extensions.anisotropicFiltering;if(N&&g.anisotropicLevel>0&&g.scaleMode===M.p.LINEAR){var J=Math.min(g.anisotropicLevel,_.getParameter(N.MAX_TEXTURE_MAX_ANISOTROPY_EXT));_.texParameterf(g.target,N.TEXTURE_MAX_ANISOTROPY_EXT,J)}}else _.texParameteri(g.target,_.TEXTURE_MIN_FILTER,g.scaleMode===M.p.LINEAR?_.LINEAR:_.NEAREST);_.texParameteri(g.target,_.TEXTURE_MAG_FILTER,g.scaleMode===M.p.LINEAR?_.LINEAR:_.NEAREST)},q.prototype.destroy=function(){this.renderer=null},q}(),Zo=new V.d,xi=function(q){function g(m,_){m===void 0&&(m=M.n.UNKNOWN);var N=q.call(this)||this;return _=Object.assign({},O.b.RENDER_OPTIONS,_),N.options=_,N.type=m,N.screen=new V.j(0,0,_.width,_.height),N.view=_.view||document.createElement("canvas"),N.resolution=_.resolution||O.b.RESOLUTION,N.useContextAlpha=_.useContextAlpha,N.autoDensity=!!_.autoDensity,N.preserveDrawingBuffer=_.preserveDrawingBuffer,N.clearBeforeRender=_.clearBeforeRender,N._backgroundColor=0,N._backgroundColorRgba=[0,0,0,1],N._backgroundColorString="#000000",N.backgroundColor=_.backgroundColor||N._backgroundColor,N.backgroundAlpha=_.backgroundAlpha,_.transparent!==void 0&&(Object(I.deprecation)("6.0.0","Option transparent is deprecated, please use backgroundAlpha instead."),N.useContextAlpha=_.transparent,N.backgroundAlpha=_.transparent?0:1),N._lastObjectRendered=null,N.plugins={},N}return ft(g,q),g.prototype.initPlugins=function(m){for(var _ in m)this.plugins[_]=new m[_](this)},Object.defineProperty(g.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),g.prototype.resize=function(m,_){this.view.width=Math.round(m*this.resolution),this.view.height=Math.round(_*this.resolution);var N=this.view.width/this.resolution,J=this.view.height/this.resolution;this.screen.width=N,this.screen.height=J,this.autoDensity&&(this.view.style.width=N+"px",this.view.style.height=J+"px"),this.emit("resize",N,J)},g.prototype.generateTexture=function(m,_,N,J){_===void 0&&(_={}),typeof _=="number"&&(Object(I.deprecation)("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),_={scaleMode:_,resolution:N,region:J});var lt=_.region,xt=function(Zt,ee){var Fe={};for(var Te in Zt)Object.prototype.hasOwnProperty.call(Zt,Te)&&ee.indexOf(Te)<0&&(Fe[Te]=Zt[Te]);if(Zt!=null&&typeof Object.getOwnPropertySymbols=="function"){var Qe=0;for(Te=Object.getOwnPropertySymbols(Zt);Qe<Te.length;Qe++)ee.indexOf(Te[Qe])<0&&(Fe[Te[Qe]]=Zt[Te[Qe]])}return Fe}(_,["region"]);(J=lt||m.getLocalBounds(null,!0)).width===0&&(J.width=1),J.height===0&&(J.height=1);var Tt=nt.create(Dt({width:J.width,height:J.height},xt));return Zo.tx=-J.x,Zo.ty=-J.y,this.render(m,{renderTexture:Tt,clear:!1,transform:Zo,skipUpdateTransform:!!m.parent}),Tt},g.prototype.destroy=function(m){for(var _ in this.plugins)this.plugins[_].destroy(),this.plugins[_]=null;m&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.plugins=null,this.type=M.n.UNKNOWN,this.view=null,this.screen=null,this._tempDisplayObjectParent=null,this.options=null,this._backgroundColorRgba=null,this._backgroundColorString=null,this._lastObjectRendered=null},Object.defineProperty(g.prototype,"backgroundColor",{get:function(){return this._backgroundColor},set:function(m){this._backgroundColor=m,this._backgroundColorString=Object(I.hex2string)(m),Object(I.hex2rgb)(m,this._backgroundColorRgba)},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"backgroundAlpha",{get:function(){return this._backgroundColorRgba[3]},set:function(m){this._backgroundColorRgba[3]=m},enumerable:!1,configurable:!0}),g}(I.EventEmitter),Qo=function(q){this.buffer=q||null,this.updateID=-1,this.byteLength=-1,this.refCount=0},gr=function(){function q(g){this.renderer=g,this.managedBuffers={},this.boundBufferBases={}}return q.prototype.destroy=function(){this.renderer=null},q.prototype.contextChange=function(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID},q.prototype.bind=function(g){var m=this.gl,_=this.CONTEXT_UID,N=g._glBuffers[_]||this.createGLBuffer(g);m.bindBuffer(g.type,N.buffer)},q.prototype.bindBufferBase=function(g,m){var _=this.gl,N=this.CONTEXT_UID;if(this.boundBufferBases[m]!==g){var J=g._glBuffers[N]||this.createGLBuffer(g);this.boundBufferBases[m]=g,_.bindBufferBase(_.UNIFORM_BUFFER,m,J.buffer)}},q.prototype.bindBufferRange=function(g,m,_){var N=this.gl,J=this.CONTEXT_UID;_=_||0;var lt=g._glBuffers[J]||this.createGLBuffer(g);N.bindBufferRange(N.UNIFORM_BUFFER,m||0,lt.buffer,256*_,256)},q.prototype.update=function(g){var m=this.gl,_=this.CONTEXT_UID,N=g._glBuffers[_];if(g._updateID!==N.updateID)if(N.updateID=g._updateID,m.bindBuffer(g.type,N.buffer),N.byteLength>=g.data.byteLength)m.bufferSubData(g.type,0,g.data);else{var J=g.static?m.STATIC_DRAW:m.DYNAMIC_DRAW;N.byteLength=g.data.byteLength,m.bufferData(g.type,g.data,J)}},q.prototype.dispose=function(g,m){if(this.managedBuffers[g.id]){delete this.managedBuffers[g.id];var _=g._glBuffers[this.CONTEXT_UID],N=this.gl;g.disposeRunner.remove(this),_&&(m||N.deleteBuffer(_.buffer),delete g._glBuffers[this.CONTEXT_UID])}},q.prototype.disposeAll=function(g){for(var m=Object.keys(this.managedBuffers),_=0;_<m.length;_++)this.dispose(this.managedBuffers[m[_]],g)},q.prototype.createGLBuffer=function(g){var m=this.CONTEXT_UID,_=this.gl;return g._glBuffers[m]=new Qo(_.createBuffer()),this.managedBuffers[g.id]=g,g.disposeRunner.add(this),g._glBuffers[m]},q}(),Oi=function(q){function g(m){var _=q.call(this,M.n.WEBGL,m)||this;return m=_.options,_.gl=null,_.CONTEXT_UID=0,_.runners={destroy:new D.a("destroy"),contextChange:new D.a("contextChange"),reset:new D.a("reset"),update:new D.a("update"),postrender:new D.a("postrender"),prerender:new D.a("prerender"),resize:new D.a("resize")},_.runners.contextChange.add(_),_.globalUniforms=new cn({projectionMatrix:new V.d},!0),_.addSystem(Jo,"mask").addSystem(In,"context").addSystem(ea,"state").addSystem(vs,"shader").addSystem(_s,"texture").addSystem(gr,"buffer").addSystem(Et,"geometry").addSystem(tn,"framebuffer").addSystem(ui,"scissor").addSystem(Ko,"stencil").addSystem(Ci,"projection").addSystem(To,"textureGC").addSystem(re,"filter").addSystem(Dr,"renderTexture").addSystem(Ee,"batch"),_.initPlugins(g.__plugins),_.multisample=void 0,m.context?_.context.initFromContext(m.context):_.context.initFromOptions({alpha:!!_.useContextAlpha,antialias:m.antialias,premultipliedAlpha:_.useContextAlpha&&_.useContextAlpha!=="notMultiplied",stencil:!0,preserveDrawingBuffer:m.preserveDrawingBuffer,powerPreference:_.options.powerPreference}),_.renderingToScreen=!0,Object(I.sayHello)(_.context.webGLVersion===2?"WebGL 2":"WebGL 1"),_.resize(_.options.width,_.options.height),_}return ft(g,q),g.create=function(m){if(Object(I.isWebGLSupported)())return new g(m);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},g.prototype.contextChange=function(){var m,_=this.gl;if(this.context.webGLVersion===1){var N=_.getParameter(_.FRAMEBUFFER_BINDING);_.bindFramebuffer(_.FRAMEBUFFER,null),m=_.getParameter(_.SAMPLES),_.bindFramebuffer(_.FRAMEBUFFER,N)}else N=_.getParameter(_.DRAW_FRAMEBUFFER_BINDING),_.bindFramebuffer(_.DRAW_FRAMEBUFFER,null),m=_.getParameter(_.SAMPLES),_.bindFramebuffer(_.DRAW_FRAMEBUFFER,N);m>=M.l.HIGH?this.multisample=M.l.HIGH:m>=M.l.MEDIUM?this.multisample=M.l.MEDIUM:m>=M.l.LOW?this.multisample=M.l.LOW:this.multisample=M.l.NONE},g.prototype.addSystem=function(m,_){var N=new m(this);if(this[_])throw new Error('Whoops! The name "'+_+'" is already in use');for(var J in this[_]=N,this.runners)this.runners[J].add(N);return this},g.prototype.render=function(m,_){var N,J,lt,xt;if(_&&(_ instanceof nt?(Object(I.deprecation)("6.0.0","Renderer#render arguments changed, use options instead."),N=_,J=arguments[2],lt=arguments[3],xt=arguments[4]):(N=_.renderTexture,J=_.clear,lt=_.transform,xt=_.skipUpdateTransform)),this.renderingToScreen=!N,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=lt,!this.context.isLost){if(N||(this._lastObjectRendered=m),!xt){var Tt=m.enableTempParent();m.updateTransform(),m.disableTempParent(Tt)}this.renderTexture.bind(N),this.batch.currentRenderer.start(),(J!==void 0?J:this.clearBeforeRender)&&this.renderTexture.clear(),m.render(this),this.batch.currentRenderer.flush(),N&&N.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},g.prototype.generateTexture=function(m,_,N,J){_===void 0&&(_={});var lt=q.prototype.generateTexture.call(this,m,_,N,J);return this.framebuffer.blit(),lt},g.prototype.resize=function(m,_){q.prototype.resize.call(this,m,_),this.runners.resize.emit(this.screen.height,this.screen.width)},g.prototype.reset=function(){return this.runners.reset.emit(),this},g.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},g.prototype.destroy=function(m){for(var _ in this.runners.destroy.emit(),this.runners)this.runners[_].destroy();q.prototype.destroy.call(this,m),this.gl=null},Object.defineProperty(g.prototype,"extract",{get:function(){return Object(I.deprecation)("6.0.0","Renderer#extract has been deprecated, please use Renderer#plugins.extract instead."),this.plugins.extract},enumerable:!1,configurable:!0}),g.registerPlugin=function(m,_){g.__plugins=g.__plugins||{},g.__plugins[m]=_},g}(xi);function so(q){return Oi.create(q)}var fi=`attribute vec2 aVertexPosition;
|
|
420
420
|
attribute vec2 aTextureCoord;
|
|
421
421
|
|
|
422
422
|
uniform mat3 projectionMatrix;
|
|
@@ -453,7 +453,7 @@ void main(void)
|
|
|
453
453
|
gl_Position = filterVertexPosition();
|
|
454
454
|
vTextureCoord = filterTextureCoord();
|
|
455
455
|
}
|
|
456
|
-
`,Eo=function(){this.texArray=null,this.blend=0,this.type=M.f.TRIANGLES,this.start=0,this.size=0,this.data=null},Fr=function(){function q(){this.elements=[],this.ids=[],this.count=0}return q.prototype.clear=function(){for(var g=0;g<this.count;g++)this.elements[g]=null;this.count=0},q}(),So=function(){function q(g){typeof g=="number"?this.rawBinaryData=new ArrayBuffer(g):g instanceof Uint8Array?this.rawBinaryData=g.buffer:this.rawBinaryData=g,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}return Object.defineProperty(q.prototype,"int8View",{get:function(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"uint8View",{get:function(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"int16View",{get:function(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"uint16View",{get:function(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"int32View",{get:function(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View},enumerable:!1,configurable:!0}),q.prototype.view=function(g){return this[g+"View"]},q.prototype.destroy=function(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null},q.sizeOf=function(g){switch(g){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(g+" isn't a valid view type")}},q}(),Ar=function(q){function g(m){var _=q.call(this,m)||this;return _.shaderGenerator=null,_.geometryClass=null,_.vertexSize=null,_.state=Vr.for2d(),_.size=4*O.b.SPRITE_BATCH_SIZE,_._vertexCount=0,_._indexCount=0,_._bufferedElements=[],_._bufferedTextures=[],_._bufferSize=0,_._shader=null,_._packedGeometries=[],_._packedGeometryPoolSize=2,_._flushId=0,_._aBuffers={},_._iBuffers={},_.MAX_TEXTURES=1,_.renderer.on("prerender",_.onPrerender,_),m.runners.contextChange.add(_),_._dcIndex=0,_._aIndex=0,_._iIndex=0,_._attributeBuffer=null,_._indexBuffer=null,_._tempBoundTextures=[],_}return ft(g,q),g.prototype.contextChange=function(){var m=this.renderer.gl;O.b.PREFER_ENV===M.g.WEBGL_LEGACY?this.MAX_TEXTURES=1:(this.MAX_TEXTURES=Math.min(m.getParameter(m.MAX_TEXTURE_IMAGE_UNITS),O.b.SPRITE_MAX_TEXTURES),this.MAX_TEXTURES=function(N,J){if(N===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");for(var lt=J.createShader(J.FRAGMENT_SHADER);;){var xt=Yo.replace(/%forloop%/gi,ro(N));if(J.shaderSource(lt,xt),J.compileShader(lt),J.getShaderParameter(lt,J.COMPILE_STATUS))break;N=N/2|0}return N}(this.MAX_TEXTURES,m)),this._shader=this.shaderGenerator.generateShader(this.MAX_TEXTURES);for(var _=0;_<this._packedGeometryPoolSize;_++)this._packedGeometries[_]=new this.geometryClass;this.initFlushBuffers()},g.prototype.initFlushBuffers=function(){for(var m=g._drawCallPool,_=g._textureArrayPool,N=this.size/4,J=Math.floor(N/this.MAX_TEXTURES)+1;m.length<N;)m.push(new Eo);for(;_.length<J;)_.push(new Fr);for(var lt=0;lt<this.MAX_TEXTURES;lt++)this._tempBoundTextures[lt]=null},g.prototype.onPrerender=function(){this._flushId=0},g.prototype.render=function(m){m._texture.valid&&(this._vertexCount+m.vertexData.length/2>this.size&&this.flush(),this._vertexCount+=m.vertexData.length/2,this._indexCount+=m.indices.length,this._bufferedTextures[this._bufferSize]=m._texture.baseTexture,this._bufferedElements[this._bufferSize++]=m)},g.prototype.buildTexturesAndDrawCalls=function(){var m=this._bufferedTextures,_=this.MAX_TEXTURES,N=g._textureArrayPool,J=this.renderer.batch,lt=this._tempBoundTextures,xt=this.renderer.textureGC.count,Tt=++B._globalBatch,Zt=0,ee=N[0],Fe=0;J.copyBoundTextures(lt,_);for(var Te=0;Te<this._bufferSize;++Te){var Qe=m[Te];m[Te]=null,Qe._batchEnabled!==Tt&&(ee.count>=_&&(J.boundArray(ee,lt,Tt,_),this.buildDrawCalls(ee,Fe,Te),Fe=Te,ee=N[++Zt],++Tt),Qe._batchEnabled=Tt,Qe.touched=xt,ee.elements[ee.count++]=Qe)}for(ee.count>0&&(J.boundArray(ee,lt,Tt,_),this.buildDrawCalls(ee,Fe,this._bufferSize),++Zt,++Tt),Te=0;Te<lt.length;Te++)lt[Te]=null;B._globalBatch=Tt},g.prototype.buildDrawCalls=function(m,_,N){var J=this._bufferedElements,lt=this._attributeBuffer,xt=this._indexBuffer,Tt=this.vertexSize,Zt=g._drawCallPool,ee=this._dcIndex,Fe=this._aIndex,Te=this._iIndex,Qe=Zt[ee];Qe.start=this._iIndex,Qe.texArray=m;for(var hn=_;hn<N;++hn){var vn=J[hn],un=vn._texture.baseTexture,Zn=I.premultiplyBlendMode[un.alphaMode?1:0][vn.blendMode];J[hn]=null,_<hn&&Qe.blend!==Zn&&(Qe.size=Te-Qe.start,_=hn,(Qe=Zt[++ee]).texArray=m,Qe.start=Te),this.packInterleavedGeometry(vn,lt,xt,Fe,Te),Fe+=vn.vertexData.length/2*Tt,Te+=vn.indices.length,Qe.blend=Zn}_<N&&(Qe.size=Te-Qe.start,++ee),this._dcIndex=ee,this._aIndex=Fe,this._iIndex=Te},g.prototype.bindAndClearTexArray=function(m){for(var _=this.renderer.texture,N=0;N<m.count;N++)_.bind(m.elements[N],m.ids[N]),m.elements[N]=null;m.count=0},g.prototype.updateGeometry=function(){var m=this._packedGeometries,_=this._attributeBuffer,N=this._indexBuffer;O.b.CAN_UPLOAD_SAME_BUFFER?(m[this._flushId]._buffer.update(_.rawBinaryData),m[this._flushId]._indexBuffer.update(N),this.renderer.geometry.updateBuffers()):(this._packedGeometryPoolSize<=this._flushId&&(this._packedGeometryPoolSize++,m[this._flushId]=new this.geometryClass),m[this._flushId]._buffer.update(_.rawBinaryData),m[this._flushId]._indexBuffer.update(N),this.renderer.geometry.bind(m[this._flushId]),this.renderer.geometry.updateBuffers(),this._flushId++)},g.prototype.drawBatches=function(){for(var m=this._dcIndex,_=this.renderer,N=_.gl,J=_.state,lt=g._drawCallPool,xt=null,Tt=0;Tt<m;Tt++){var Zt=lt[Tt],ee=Zt.texArray,Fe=Zt.type,Te=Zt.size,Qe=Zt.start,hn=Zt.blend;xt!==ee&&(xt=ee,this.bindAndClearTexArray(ee)),this.state.blendMode=hn,J.set(this.state),N.drawElements(Fe,Te,N.UNSIGNED_SHORT,2*Qe)}},g.prototype.flush=function(){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)},g.prototype.start=function(){this.renderer.state.set(this.state),this.renderer.texture.ensureSamplerType(this.MAX_TEXTURES),this.renderer.shader.bind(this._shader),O.b.CAN_UPLOAD_SAME_BUFFER&&this.renderer.geometry.bind(this._packedGeometries[this._flushId])},g.prototype.stop=function(){this.flush()},g.prototype.destroy=function(){for(var m=0;m<this._packedGeometryPoolSize;m++)this._packedGeometries[m]&&this._packedGeometries[m].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),q.prototype.destroy.call(this)},g.prototype.getAttributeBuffer=function(m){var _=Object(I.nextPow2)(Math.ceil(m/8)),N=Object(I.log2)(_),J=8*_;this._aBuffers.length<=N&&(this._iBuffers.length=N+1);var lt=this._aBuffers[J];return lt||(this._aBuffers[J]=lt=new So(J*this.vertexSize*4)),lt},g.prototype.getIndexBuffer=function(m){var _=Object(I.nextPow2)(Math.ceil(m/12)),N=Object(I.log2)(_),J=12*_;this._iBuffers.length<=N&&(this._iBuffers.length=N+1);var lt=this._iBuffers[N];return lt||(this._iBuffers[N]=lt=new Uint16Array(J)),lt},g.prototype.packInterleavedGeometry=function(m,_,N,J,lt){for(var xt=_.uint32View,Tt=_.float32View,Zt=J/this.vertexSize,ee=m.uvs,Fe=m.indices,Te=m.vertexData,Qe=m._texture.baseTexture._batchLocation,hn=Math.min(m.worldAlpha,1),vn=hn<1&&m._texture.baseTexture.alphaMode?Object(I.premultiplyTint)(m._tintRGB,hn):m._tintRGB+(255*hn<<24),un=0;un<Te.length;un+=2)Tt[J++]=Te[un],Tt[J++]=Te[un+1],Tt[J++]=ee[un],Tt[J++]=ee[un+1],xt[J++]=vn,Tt[J++]=Qe;for(un=0;un<Fe.length;un++)N[lt++]=Zt+Fe[un]},g._drawCallPool=[],g._textureArrayPool=[],g}(pe),Mr=function(){function q(g,m){if(this.vertexSrc=g,this.fragTemplate=m,this.programCache={},this.defaultGroupCache={},m.indexOf("%count%")<0)throw new Error('Fragment template must contain "%count%".');if(m.indexOf("%forloop%")<0)throw new Error('Fragment template must contain "%forloop%".')}return q.prototype.generateShader=function(g){if(!this.programCache[g]){for(var m=new Int32Array(g),_=0;_<g;_++)m[_]=_;this.defaultGroupCache[g]=cn.from({uSamplers:m},!0);var N=this.fragTemplate;N=(N=N.replace(/%count%/gi,""+g)).replace(/%forloop%/gi,this.generateSampleSrc(g)),this.programCache[g]=new jn(this.vertexSrc,N)}var J={tint:new Float32Array([1,1,1,1]),translationMatrix:new
|
|
456
|
+
`,Eo=function(){this.texArray=null,this.blend=0,this.type=M.f.TRIANGLES,this.start=0,this.size=0,this.data=null},Fr=function(){function q(){this.elements=[],this.ids=[],this.count=0}return q.prototype.clear=function(){for(var g=0;g<this.count;g++)this.elements[g]=null;this.count=0},q}(),So=function(){function q(g){typeof g=="number"?this.rawBinaryData=new ArrayBuffer(g):g instanceof Uint8Array?this.rawBinaryData=g.buffer:this.rawBinaryData=g,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}return Object.defineProperty(q.prototype,"int8View",{get:function(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"uint8View",{get:function(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"int16View",{get:function(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"uint16View",{get:function(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"int32View",{get:function(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View},enumerable:!1,configurable:!0}),q.prototype.view=function(g){return this[g+"View"]},q.prototype.destroy=function(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null},q.sizeOf=function(g){switch(g){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(g+" isn't a valid view type")}},q}(),Ar=function(q){function g(m){var _=q.call(this,m)||this;return _.shaderGenerator=null,_.geometryClass=null,_.vertexSize=null,_.state=Vr.for2d(),_.size=4*O.b.SPRITE_BATCH_SIZE,_._vertexCount=0,_._indexCount=0,_._bufferedElements=[],_._bufferedTextures=[],_._bufferSize=0,_._shader=null,_._packedGeometries=[],_._packedGeometryPoolSize=2,_._flushId=0,_._aBuffers={},_._iBuffers={},_.MAX_TEXTURES=1,_.renderer.on("prerender",_.onPrerender,_),m.runners.contextChange.add(_),_._dcIndex=0,_._aIndex=0,_._iIndex=0,_._attributeBuffer=null,_._indexBuffer=null,_._tempBoundTextures=[],_}return ft(g,q),g.prototype.contextChange=function(){var m=this.renderer.gl;O.b.PREFER_ENV===M.g.WEBGL_LEGACY?this.MAX_TEXTURES=1:(this.MAX_TEXTURES=Math.min(m.getParameter(m.MAX_TEXTURE_IMAGE_UNITS),O.b.SPRITE_MAX_TEXTURES),this.MAX_TEXTURES=function(N,J){if(N===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");for(var lt=J.createShader(J.FRAGMENT_SHADER);;){var xt=Yo.replace(/%forloop%/gi,ro(N));if(J.shaderSource(lt,xt),J.compileShader(lt),J.getShaderParameter(lt,J.COMPILE_STATUS))break;N=N/2|0}return N}(this.MAX_TEXTURES,m)),this._shader=this.shaderGenerator.generateShader(this.MAX_TEXTURES);for(var _=0;_<this._packedGeometryPoolSize;_++)this._packedGeometries[_]=new this.geometryClass;this.initFlushBuffers()},g.prototype.initFlushBuffers=function(){for(var m=g._drawCallPool,_=g._textureArrayPool,N=this.size/4,J=Math.floor(N/this.MAX_TEXTURES)+1;m.length<N;)m.push(new Eo);for(;_.length<J;)_.push(new Fr);for(var lt=0;lt<this.MAX_TEXTURES;lt++)this._tempBoundTextures[lt]=null},g.prototype.onPrerender=function(){this._flushId=0},g.prototype.render=function(m){m._texture.valid&&(this._vertexCount+m.vertexData.length/2>this.size&&this.flush(),this._vertexCount+=m.vertexData.length/2,this._indexCount+=m.indices.length,this._bufferedTextures[this._bufferSize]=m._texture.baseTexture,this._bufferedElements[this._bufferSize++]=m)},g.prototype.buildTexturesAndDrawCalls=function(){var m=this._bufferedTextures,_=this.MAX_TEXTURES,N=g._textureArrayPool,J=this.renderer.batch,lt=this._tempBoundTextures,xt=this.renderer.textureGC.count,Tt=++B._globalBatch,Zt=0,ee=N[0],Fe=0;J.copyBoundTextures(lt,_);for(var Te=0;Te<this._bufferSize;++Te){var Qe=m[Te];m[Te]=null,Qe._batchEnabled!==Tt&&(ee.count>=_&&(J.boundArray(ee,lt,Tt,_),this.buildDrawCalls(ee,Fe,Te),Fe=Te,ee=N[++Zt],++Tt),Qe._batchEnabled=Tt,Qe.touched=xt,ee.elements[ee.count++]=Qe)}for(ee.count>0&&(J.boundArray(ee,lt,Tt,_),this.buildDrawCalls(ee,Fe,this._bufferSize),++Zt,++Tt),Te=0;Te<lt.length;Te++)lt[Te]=null;B._globalBatch=Tt},g.prototype.buildDrawCalls=function(m,_,N){var J=this._bufferedElements,lt=this._attributeBuffer,xt=this._indexBuffer,Tt=this.vertexSize,Zt=g._drawCallPool,ee=this._dcIndex,Fe=this._aIndex,Te=this._iIndex,Qe=Zt[ee];Qe.start=this._iIndex,Qe.texArray=m;for(var hn=_;hn<N;++hn){var vn=J[hn],un=vn._texture.baseTexture,Zn=I.premultiplyBlendMode[un.alphaMode?1:0][vn.blendMode];J[hn]=null,_<hn&&Qe.blend!==Zn&&(Qe.size=Te-Qe.start,_=hn,(Qe=Zt[++ee]).texArray=m,Qe.start=Te),this.packInterleavedGeometry(vn,lt,xt,Fe,Te),Fe+=vn.vertexData.length/2*Tt,Te+=vn.indices.length,Qe.blend=Zn}_<N&&(Qe.size=Te-Qe.start,++ee),this._dcIndex=ee,this._aIndex=Fe,this._iIndex=Te},g.prototype.bindAndClearTexArray=function(m){for(var _=this.renderer.texture,N=0;N<m.count;N++)_.bind(m.elements[N],m.ids[N]),m.elements[N]=null;m.count=0},g.prototype.updateGeometry=function(){var m=this._packedGeometries,_=this._attributeBuffer,N=this._indexBuffer;O.b.CAN_UPLOAD_SAME_BUFFER?(m[this._flushId]._buffer.update(_.rawBinaryData),m[this._flushId]._indexBuffer.update(N),this.renderer.geometry.updateBuffers()):(this._packedGeometryPoolSize<=this._flushId&&(this._packedGeometryPoolSize++,m[this._flushId]=new this.geometryClass),m[this._flushId]._buffer.update(_.rawBinaryData),m[this._flushId]._indexBuffer.update(N),this.renderer.geometry.bind(m[this._flushId]),this.renderer.geometry.updateBuffers(),this._flushId++)},g.prototype.drawBatches=function(){for(var m=this._dcIndex,_=this.renderer,N=_.gl,J=_.state,lt=g._drawCallPool,xt=null,Tt=0;Tt<m;Tt++){var Zt=lt[Tt],ee=Zt.texArray,Fe=Zt.type,Te=Zt.size,Qe=Zt.start,hn=Zt.blend;xt!==ee&&(xt=ee,this.bindAndClearTexArray(ee)),this.state.blendMode=hn,J.set(this.state),N.drawElements(Fe,Te,N.UNSIGNED_SHORT,2*Qe)}},g.prototype.flush=function(){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)},g.prototype.start=function(){this.renderer.state.set(this.state),this.renderer.texture.ensureSamplerType(this.MAX_TEXTURES),this.renderer.shader.bind(this._shader),O.b.CAN_UPLOAD_SAME_BUFFER&&this.renderer.geometry.bind(this._packedGeometries[this._flushId])},g.prototype.stop=function(){this.flush()},g.prototype.destroy=function(){for(var m=0;m<this._packedGeometryPoolSize;m++)this._packedGeometries[m]&&this._packedGeometries[m].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),q.prototype.destroy.call(this)},g.prototype.getAttributeBuffer=function(m){var _=Object(I.nextPow2)(Math.ceil(m/8)),N=Object(I.log2)(_),J=8*_;this._aBuffers.length<=N&&(this._iBuffers.length=N+1);var lt=this._aBuffers[J];return lt||(this._aBuffers[J]=lt=new So(J*this.vertexSize*4)),lt},g.prototype.getIndexBuffer=function(m){var _=Object(I.nextPow2)(Math.ceil(m/12)),N=Object(I.log2)(_),J=12*_;this._iBuffers.length<=N&&(this._iBuffers.length=N+1);var lt=this._iBuffers[N];return lt||(this._iBuffers[N]=lt=new Uint16Array(J)),lt},g.prototype.packInterleavedGeometry=function(m,_,N,J,lt){for(var xt=_.uint32View,Tt=_.float32View,Zt=J/this.vertexSize,ee=m.uvs,Fe=m.indices,Te=m.vertexData,Qe=m._texture.baseTexture._batchLocation,hn=Math.min(m.worldAlpha,1),vn=hn<1&&m._texture.baseTexture.alphaMode?Object(I.premultiplyTint)(m._tintRGB,hn):m._tintRGB+(255*hn<<24),un=0;un<Te.length;un+=2)Tt[J++]=Te[un],Tt[J++]=Te[un+1],Tt[J++]=ee[un],Tt[J++]=ee[un+1],xt[J++]=vn,Tt[J++]=Qe;for(un=0;un<Fe.length;un++)N[lt++]=Zt+Fe[un]},g._drawCallPool=[],g._textureArrayPool=[],g}(pe),Mr=function(){function q(g,m){if(this.vertexSrc=g,this.fragTemplate=m,this.programCache={},this.defaultGroupCache={},m.indexOf("%count%")<0)throw new Error('Fragment template must contain "%count%".');if(m.indexOf("%forloop%")<0)throw new Error('Fragment template must contain "%forloop%".')}return q.prototype.generateShader=function(g){if(!this.programCache[g]){for(var m=new Int32Array(g),_=0;_<g;_++)m[_]=_;this.defaultGroupCache[g]=cn.from({uSamplers:m},!0);var N=this.fragTemplate;N=(N=N.replace(/%count%/gi,""+g)).replace(/%forloop%/gi,this.generateSampleSrc(g)),this.programCache[g]=new jn(this.vertexSrc,N)}var J={tint:new Float32Array([1,1,1,1]),translationMatrix:new V.d,default:this.defaultGroupCache[g]};return new Ki(this.programCache[g],J)},q.prototype.generateSampleSrc=function(g){var m="";m+=`
|
|
457
457
|
`,m+=`
|
|
458
458
|
`;for(var _=0;_<g;_++)_>0&&(m+=`
|
|
459
459
|
else `),_<g-1&&(m+="if(vTextureId < "+_+".5)"),m+=`
|
|
@@ -492,21 +492,21 @@ void main(void){
|
|
|
492
492
|
%forloop%
|
|
493
493
|
gl_FragColor = color * vColor;
|
|
494
494
|
}
|
|
495
|
-
`,Mo=function(){function q(){}return q.create=function(g){var m=Object.assign({vertex:wo,fragment:Ao,geometryClass:or,vertexSize:6},g),_=m.vertex,N=m.fragment,J=m.vertexSize,lt=m.geometryClass;return function(xt){function Tt(Zt){var ee=xt.call(this,Zt)||this;return ee.shaderGenerator=new Mr(_,N),ee.geometryClass=lt,ee.vertexSize=J,ee}return ft(Tt,xt),Tt}(Ar)},Object.defineProperty(q,"defaultVertexSrc",{get:function(){return wo},enumerable:!1,configurable:!0}),Object.defineProperty(q,"defaultFragmentTemplate",{get:function(){return Ao},enumerable:!1,configurable:!0}),q}().create()},function(b,w,v){v.r(w),v.d(w,"BaseTextureCache",function(){return _e}),v.d(w,"CanvasRenderTarget",function(){return Ae}),v.d(w,"DATA_URI",function(){return cn}),v.d(w,"ProgramCache",function(){return Jt}),v.d(w,"TextureCache",function(){return at}),v.d(w,"clearTextureCache",function(){return Oe}),v.d(w,"correctBlendMode",function(){return G}),v.d(w,"createIndicesForQuads",function(){return
|
|
495
|
+
`,Mo=function(){function q(){}return q.create=function(g){var m=Object.assign({vertex:wo,fragment:Ao,geometryClass:or,vertexSize:6},g),_=m.vertex,N=m.fragment,J=m.vertexSize,lt=m.geometryClass;return function(xt){function Tt(Zt){var ee=xt.call(this,Zt)||this;return ee.shaderGenerator=new Mr(_,N),ee.geometryClass=lt,ee.vertexSize=J,ee}return ft(Tt,xt),Tt}(Ar)},Object.defineProperty(q,"defaultVertexSrc",{get:function(){return wo},enumerable:!1,configurable:!0}),Object.defineProperty(q,"defaultFragmentTemplate",{get:function(){return Ao},enumerable:!1,configurable:!0}),q}().create()},function(b,w,v){v.r(w),v.d(w,"BaseTextureCache",function(){return _e}),v.d(w,"CanvasRenderTarget",function(){return Ae}),v.d(w,"DATA_URI",function(){return cn}),v.d(w,"ProgramCache",function(){return Jt}),v.d(w,"TextureCache",function(){return at}),v.d(w,"clearTextureCache",function(){return Oe}),v.d(w,"correctBlendMode",function(){return G}),v.d(w,"createIndicesForQuads",function(){return z}),v.d(w,"decomposeDataUri",function(){return ke}),v.d(w,"deprecation",function(){return Xt}),v.d(w,"destroyTextureCache",function(){return Ue}),v.d(w,"determineCrossOrigin",function(){return Ge}),v.d(w,"getBufferType",function(){return U}),v.d(w,"getResolutionOfUrl",function(){return Rn}),v.d(w,"hex2rgb",function(){return B}),v.d(w,"hex2string",function(){return Y}),v.d(w,"interleaveTypedArrays",function(){return $}),v.d(w,"isPow2",function(){return Lt}),v.d(w,"isWebGLSupported",function(){return L}),v.d(w,"log2",function(){return K}),v.d(w,"nextPow2",function(){return vt}),v.d(w,"premultiplyBlendMode",function(){return tt}),v.d(w,"premultiplyRgba",function(){return Ot}),v.d(w,"premultiplyTint",function(){return zt}),v.d(w,"premultiplyTintToRgba",function(){return st}),v.d(w,"removeItems",function(){return ct}),v.d(w,"rgb2hex",function(){return H}),v.d(w,"sayHello",function(){return At}),v.d(w,"sign",function(){return nt}),v.d(w,"skipHello",function(){return Dt}),v.d(w,"string2hex",function(){return P}),v.d(w,"trimCanvas",function(){return ze}),v.d(w,"uid",function(){return St}),v.d(w,"url",function(){return X});var O=v(4);v.d(w,"isMobile",function(){return O.a});var M=v(52),I=v.n(M);v.d(w,"EventEmitter",function(){return I.a});var D=v(53),k=v.n(D);v.d(w,"earcut",function(){return k.a});var V=v(35),W=v(0),X={parse:V.parse,format:V.format,resolve:V.resolve};O.b.RETINA_PREFIX=/@([0-9\.]+)x/,O.b.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var et,ft=!1;function Dt(){ft=!0}function At(re){var pe;if(!ft){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var Ee=[`
|
|
496
496
|
%c %c %c PixiJS 6.4.2 - \u2730 `+re+` \u2730 %c %c http://www.pixijs.com/ %c %c \u2665%c\u2665%c\u2665
|
|
497
497
|
|
|
498
|
-
`,"background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];(pe=globalThis.console).log.apply(pe,Ee)}else globalThis.console&&globalThis.console.log("PixiJS 6.4.2 - "+re+" - http://www.pixijs.com/");ft=!0}}function L(){return et===void 0&&(et=function(){var re={stencil:!0,failIfMajorPerformanceCaveat:O.b.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!globalThis.WebGLRenderingContext)return!1;var pe=document.createElement("canvas"),Ee=pe.getContext("webgl",re)||pe.getContext("experimental-webgl",re),ln=!(!Ee||!Ee.getContextAttributes().stencil);if(Ee){var In=Ee.getExtension("WEBGL_lose_context");In&&In.loseContext()}return Ee=null,ln}catch{return!1}}()),et}var R={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",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:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",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:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",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:"#ff0000",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:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function B(re,pe){return pe===void 0&&(pe=[]),pe[0]=(re>>16&255)/255,pe[1]=(re>>8&255)/255,pe[2]=(255&re)/255,pe}function
|
|
498
|
+
`,"background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];(pe=globalThis.console).log.apply(pe,Ee)}else globalThis.console&&globalThis.console.log("PixiJS 6.4.2 - "+re+" - http://www.pixijs.com/");ft=!0}}function L(){return et===void 0&&(et=function(){var re={stencil:!0,failIfMajorPerformanceCaveat:O.b.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!globalThis.WebGLRenderingContext)return!1;var pe=document.createElement("canvas"),Ee=pe.getContext("webgl",re)||pe.getContext("experimental-webgl",re),ln=!(!Ee||!Ee.getContextAttributes().stencil);if(Ee){var In=Ee.getExtension("WEBGL_lose_context");In&&In.loseContext()}return Ee=null,ln}catch{return!1}}()),et}var R={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",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:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",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:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",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:"#ff0000",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:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function B(re,pe){return pe===void 0&&(pe=[]),pe[0]=(re>>16&255)/255,pe[1]=(re>>8&255)/255,pe[2]=(255&re)/255,pe}function Y(re){var pe=re.toString(16);return"#"+(pe="000000".substring(0,6-pe.length)+pe)}function P(re){return typeof re=="string"&&(re=R[re.toLowerCase()]||re)[0]==="#"&&(re=re.slice(1)),parseInt(re,16)}function H(re){return(255*re[0]<<16)+(255*re[1]<<8)+(255*re[2]|0)}var tt=function(){for(var re=[],pe=[],Ee=0;Ee<32;Ee++)re[Ee]=Ee,pe[Ee]=Ee;re[W.b.NORMAL_NPM]=W.b.NORMAL,re[W.b.ADD_NPM]=W.b.ADD,re[W.b.SCREEN_NPM]=W.b.SCREEN,pe[W.b.NORMAL]=W.b.NORMAL_NPM,pe[W.b.ADD]=W.b.ADD_NPM,pe[W.b.SCREEN]=W.b.SCREEN_NPM;var ln=[];return ln.push(pe),ln.push(re),ln}();function G(re,pe){return tt[pe?1:0][re]}function Ot(re,pe,Ee,ln){return Ee=Ee||new Float32Array(4),ln||ln===void 0?(Ee[0]=re[0]*pe,Ee[1]=re[1]*pe,Ee[2]=re[2]*pe):(Ee[0]=re[0],Ee[1]=re[1],Ee[2]=re[2]),Ee[3]=pe,Ee}function zt(re,pe){if(pe===1)return(255*pe<<24)+re;if(pe===0)return 0;var Ee=re>>16&255,ln=re>>8&255,In=255&re;return(255*pe<<24)+((Ee=Ee*pe+.5|0)<<16)+((ln=ln*pe+.5|0)<<8)+(In=In*pe+.5|0)}function st(re,pe,Ee,ln){return(Ee=Ee||new Float32Array(4))[0]=(re>>16&255)/255,Ee[1]=(re>>8&255)/255,Ee[2]=(255&re)/255,(ln||ln===void 0)&&(Ee[0]*=pe,Ee[1]*=pe,Ee[2]*=pe),Ee[3]=pe,Ee}function z(re,pe){pe===void 0&&(pe=null);var Ee=6*re;if((pe=pe||new Uint16Array(Ee)).length!==Ee)throw new Error("Out buffer length is incorrect, got "+pe.length+" and expected "+Ee);for(var ln=0,In=0;ln<Ee;ln+=6,In+=4)pe[ln+0]=In+0,pe[ln+1]=In+1,pe[ln+2]=In+2,pe[ln+3]=In+0,pe[ln+4]=In+2,pe[ln+5]=In+3;return pe}function U(re){if(re.BYTES_PER_ELEMENT===4)return re instanceof Float32Array?"Float32Array":re instanceof Uint32Array?"Uint32Array":"Int32Array";if(re.BYTES_PER_ELEMENT===2){if(re instanceof Uint16Array)return"Uint16Array"}else if(re.BYTES_PER_ELEMENT===1&&re instanceof Uint8Array)return"Uint8Array";return null}var dt={Float32Array,Uint32Array,Int32Array,Uint8Array};function $(re,pe){for(var Ee=0,ln=0,In={},Kn=0;Kn<re.length;Kn++)ln+=pe[Kn],Ee+=re[Kn].length;var pi=new ArrayBuffer(4*Ee),tn=null,yt=0;for(Kn=0;Kn<re.length;Kn++){var Et=pe[Kn],Rt=re[Kn],Qt=U(Rt);In[Qt]||(In[Qt]=new dt[Qt](pi)),tn=In[Qt];for(var Wt=0;Wt<Rt.length;Wt++)tn[(Wt/Et|0)*ln+yt+Wt%Et]=Rt[Wt];yt+=Et}return new Float32Array(pi)}function vt(re){return re+=re===0?1:0,--re,re|=re>>>1,re|=re>>>2,re|=re>>>4,re|=re>>>8,(re|=re>>>16)+1}function Lt(re){return!(re&re-1||!re)}function K(re){var pe=(re>65535?1:0)<<4,Ee=((re>>>=pe)>255?1:0)<<3;return pe|=Ee,pe|=Ee=((re>>>=Ee)>15?1:0)<<2,(pe|=Ee=((re>>>=Ee)>3?1:0)<<1)|(re>>>=Ee)>>1}function ct(re,pe,Ee){var ln,In=re.length;if(!(pe>=In||Ee===0)){var Kn=In-(Ee=pe+Ee>In?In-pe:Ee);for(ln=pe;ln<Kn;++ln)re[ln]=re[ln+Ee];re.length=Kn}}function nt(re){return re===0?0:re<0?-1:1}var _t=0;function St(){return++_t}var kt={};function Xt(re,pe,Ee){if(Ee===void 0&&(Ee=3),!kt[pe]){var ln=new Error().stack;ln===void 0?console.warn("PixiJS Deprecation Warning: ",pe+`
|
|
499
499
|
Deprecated since v`+re):(ln=ln.split(`
|
|
500
500
|
`).splice(Ee).join(`
|
|
501
501
|
`),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",pe+`
|
|
502
502
|
Deprecated since v`+re),console.warn(ln),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",pe+`
|
|
503
|
-
Deprecated since v`+re),console.warn(ln))),kt[pe]=!0}}var Jt={},at=Object.create(null),_e=Object.create(null);function Ue(){var re;for(re in at)at[re].destroy();for(re in _e)_e[re].destroy()}function Oe(){var re;for(re in at)delete at[re];for(re in _e)delete _e[re]}var Ae=function(){function re(pe,Ee,ln){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.resolution=ln||O.b.RESOLUTION,this.resize(pe,Ee)}return re.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},re.prototype.resize=function(pe,Ee){this.canvas.width=Math.round(pe*this.resolution),this.canvas.height=Math.round(Ee*this.resolution)},re.prototype.destroy=function(){this.context=null,this.canvas=null},Object.defineProperty(re.prototype,"width",{get:function(){return this.canvas.width},set:function(pe){this.canvas.width=Math.round(pe)},enumerable:!1,configurable:!0}),Object.defineProperty(re.prototype,"height",{get:function(){return this.canvas.height},set:function(pe){this.canvas.height=Math.round(pe)},enumerable:!1,configurable:!0}),re}();function ze(re){var pe,Ee,ln,In=re.width,Kn=re.height,pi=re.getContext("2d"),tn=pi.getImageData(0,0,In,Kn).data,yt=tn.length,Et={top:null,left:null,right:null,bottom:null},Rt=null;for(pe=0;pe<yt;pe+=4)tn[pe+3]!==0&&(Ee=pe/4%In,ln=~~(pe/4/In),Et.top===null&&(Et.top=ln),(Et.left===null||Ee<Et.left)&&(Et.left=Ee),(Et.right===null||Et.right<Ee)&&(Et.right=Ee+1),(Et.bottom===null||Et.bottom<ln)&&(Et.bottom=ln));return Et.top!==null&&(In=Et.right-Et.left,Kn=Et.bottom-Et.top+1,Rt=pi.getImageData(Et.left,Et.top,In,Kn)),{height:Kn,width:In,data:Rt}}var $e,cn=/^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i;function ke(re){var pe=cn.exec(re);if(pe)return{mediaType:pe[1]?pe[1].toLowerCase():void 0,subType:pe[2]?pe[2].toLowerCase():void 0,charset:pe[3]?pe[3].toLowerCase():void 0,encoding:pe[4]?pe[4].toLowerCase():void 0,data:pe[5]}}function Ge(re,pe){if(pe===void 0&&(pe=globalThis.location),re.indexOf("data:")===0)return"";pe=pe||globalThis.location,$e||($e=document.createElement("a")),$e.href=re;var Ee=
|
|
503
|
+
Deprecated since v`+re),console.warn(ln))),kt[pe]=!0}}var Jt={},at=Object.create(null),_e=Object.create(null);function Ue(){var re;for(re in at)at[re].destroy();for(re in _e)_e[re].destroy()}function Oe(){var re;for(re in at)delete at[re];for(re in _e)delete _e[re]}var Ae=function(){function re(pe,Ee,ln){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.resolution=ln||O.b.RESOLUTION,this.resize(pe,Ee)}return re.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},re.prototype.resize=function(pe,Ee){this.canvas.width=Math.round(pe*this.resolution),this.canvas.height=Math.round(Ee*this.resolution)},re.prototype.destroy=function(){this.context=null,this.canvas=null},Object.defineProperty(re.prototype,"width",{get:function(){return this.canvas.width},set:function(pe){this.canvas.width=Math.round(pe)},enumerable:!1,configurable:!0}),Object.defineProperty(re.prototype,"height",{get:function(){return this.canvas.height},set:function(pe){this.canvas.height=Math.round(pe)},enumerable:!1,configurable:!0}),re}();function ze(re){var pe,Ee,ln,In=re.width,Kn=re.height,pi=re.getContext("2d"),tn=pi.getImageData(0,0,In,Kn).data,yt=tn.length,Et={top:null,left:null,right:null,bottom:null},Rt=null;for(pe=0;pe<yt;pe+=4)tn[pe+3]!==0&&(Ee=pe/4%In,ln=~~(pe/4/In),Et.top===null&&(Et.top=ln),(Et.left===null||Ee<Et.left)&&(Et.left=Ee),(Et.right===null||Et.right<Ee)&&(Et.right=Ee+1),(Et.bottom===null||Et.bottom<ln)&&(Et.bottom=ln));return Et.top!==null&&(In=Et.right-Et.left,Kn=Et.bottom-Et.top+1,Rt=pi.getImageData(Et.left,Et.top,In,Kn)),{height:Kn,width:In,data:Rt}}var $e,cn=/^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i;function ke(re){var pe=cn.exec(re);if(pe)return{mediaType:pe[1]?pe[1].toLowerCase():void 0,subType:pe[2]?pe[2].toLowerCase():void 0,charset:pe[3]?pe[3].toLowerCase():void 0,encoding:pe[4]?pe[4].toLowerCase():void 0,data:pe[5]}}function Ge(re,pe){if(pe===void 0&&(pe=globalThis.location),re.indexOf("data:")===0)return"";pe=pe||globalThis.location,$e||($e=document.createElement("a")),$e.href=re;var Ee=X.parse($e.href),ln=!Ee.port&&pe.port===""||Ee.port===pe.port;return Ee.hostname===pe.hostname&&ln&&Ee.protocol===pe.protocol?"":"anonymous"}function Rn(re,pe){var Ee=O.b.RETINA_PREFIX.exec(re);return Ee?parseFloat(Ee[1]):pe!==void 0?pe:1}},function(b,w,v){v.d(w,"a",function(){return Xt}),v.d(w,"b",function(){return Jt});var O=/iPhone/i,M=/iPod/i,I=/iPad/i,D=/\biOS-universal(?:.+)Mac\b/i,k=/\bAndroid(?:.+)Mobile\b/i,V=/Android/i,W=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,X=/Silk/i,et=/Windows Phone/i,ft=/\bWindows(?:.+)ARM\b/i,Dt=/BlackBerry/i,At=/BB10/i,L=/Opera Mini/i,R=/\b(CriOS|Chrome)(?:.+)Mobile/i,B=/Mobile(?:.+)Firefox\b/i,Y=function(at){return at!==void 0&&at.platform==="MacIntel"&&typeof at.maxTouchPoints=="number"&&at.maxTouchPoints>1&&typeof MSStream=="undefined"};/*!
|
|
504
504
|
* @pixi/settings - v6.4.2
|
|
505
505
|
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
|
|
506
506
|
*
|
|
507
507
|
* @pixi/settings is licensed under the MIT License.
|
|
508
508
|
* http://www.opensource.org/licenses/mit-license
|
|
509
|
-
*/var P,H,tt,G,Ot,zt,st,
|
|
509
|
+
*/var P,H,tt,G,Ot,zt,st,z,U,dt,$,vt,Lt,K,ct,nt,_t,St,kt,Xt=function(at){var _e={userAgent:"",platform:"",maxTouchPoints:0};at||typeof navigator=="undefined"?typeof at=="string"?_e.userAgent=at:at&&at.userAgent&&(_e={userAgent:at.userAgent,platform:at.platform,maxTouchPoints:at.maxTouchPoints||0}):_e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var Ue=_e.userAgent,Oe=Ue.split("[FBAN");Oe[1]!==void 0&&(Ue=Oe[0]),(Oe=Ue.split("Twitter"))[1]!==void 0&&(Ue=Oe[0]);var Ae=function($e){return function(cn){return cn.test($e)}}(Ue),ze={apple:{phone:Ae(O)&&!Ae(et),ipod:Ae(M),tablet:!Ae(O)&&(Ae(I)||Y(_e))&&!Ae(et),universal:Ae(D),device:(Ae(O)||Ae(M)||Ae(I)||Ae(D)||Y(_e))&&!Ae(et)},amazon:{phone:Ae(W),tablet:!Ae(W)&&Ae(X),device:Ae(W)||Ae(X)},android:{phone:!Ae(et)&&Ae(W)||!Ae(et)&&Ae(k),tablet:!Ae(et)&&!Ae(W)&&!Ae(k)&&(Ae(X)||Ae(V)),device:!Ae(et)&&(Ae(W)||Ae(X)||Ae(k)||Ae(V))||Ae(/\bokhttp\b/i)},windows:{phone:Ae(et),tablet:Ae(ft),device:Ae(et)||Ae(ft)},other:{blackberry:Ae(Dt),blackberry10:Ae(At),opera:Ae(L),firefox:Ae(B),chrome:Ae(R),device:Ae(Dt)||Ae(At)||Ae(L)||Ae(B)||Ae(R)},any:!1,phone:!1,tablet:!1};return ze.any=ze.apple.device||ze.android.device||ze.windows.device||ze.other.device,ze.phone=ze.apple.phone||ze.android.phone||ze.windows.phone,ze.tablet=ze.apple.tablet||ze.android.tablet||ze.windows.tablet,ze}(globalThis.navigator);(function(at){at[at.WEBGL_LEGACY=0]="WEBGL_LEGACY",at[at.WEBGL=1]="WEBGL",at[at.WEBGL2=2]="WEBGL2"})(P||(P={})),function(at){at[at.UNKNOWN=0]="UNKNOWN",at[at.WEBGL=1]="WEBGL",at[at.CANVAS=2]="CANVAS"}(H||(H={})),function(at){at[at.COLOR=16384]="COLOR",at[at.DEPTH=256]="DEPTH",at[at.STENCIL=1024]="STENCIL"}(tt||(tt={})),function(at){at[at.NORMAL=0]="NORMAL",at[at.ADD=1]="ADD",at[at.MULTIPLY=2]="MULTIPLY",at[at.SCREEN=3]="SCREEN",at[at.OVERLAY=4]="OVERLAY",at[at.DARKEN=5]="DARKEN",at[at.LIGHTEN=6]="LIGHTEN",at[at.COLOR_DODGE=7]="COLOR_DODGE",at[at.COLOR_BURN=8]="COLOR_BURN",at[at.HARD_LIGHT=9]="HARD_LIGHT",at[at.SOFT_LIGHT=10]="SOFT_LIGHT",at[at.DIFFERENCE=11]="DIFFERENCE",at[at.EXCLUSION=12]="EXCLUSION",at[at.HUE=13]="HUE",at[at.SATURATION=14]="SATURATION",at[at.COLOR=15]="COLOR",at[at.LUMINOSITY=16]="LUMINOSITY",at[at.NORMAL_NPM=17]="NORMAL_NPM",at[at.ADD_NPM=18]="ADD_NPM",at[at.SCREEN_NPM=19]="SCREEN_NPM",at[at.NONE=20]="NONE",at[at.SRC_OVER=0]="SRC_OVER",at[at.SRC_IN=21]="SRC_IN",at[at.SRC_OUT=22]="SRC_OUT",at[at.SRC_ATOP=23]="SRC_ATOP",at[at.DST_OVER=24]="DST_OVER",at[at.DST_IN=25]="DST_IN",at[at.DST_OUT=26]="DST_OUT",at[at.DST_ATOP=27]="DST_ATOP",at[at.ERASE=26]="ERASE",at[at.SUBTRACT=28]="SUBTRACT",at[at.XOR=29]="XOR"}(G||(G={})),function(at){at[at.POINTS=0]="POINTS",at[at.LINES=1]="LINES",at[at.LINE_LOOP=2]="LINE_LOOP",at[at.LINE_STRIP=3]="LINE_STRIP",at[at.TRIANGLES=4]="TRIANGLES",at[at.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",at[at.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(Ot||(Ot={})),function(at){at[at.RGBA=6408]="RGBA",at[at.RGB=6407]="RGB",at[at.RG=33319]="RG",at[at.RED=6403]="RED",at[at.RGBA_INTEGER=36249]="RGBA_INTEGER",at[at.RGB_INTEGER=36248]="RGB_INTEGER",at[at.RG_INTEGER=33320]="RG_INTEGER",at[at.RED_INTEGER=36244]="RED_INTEGER",at[at.ALPHA=6406]="ALPHA",at[at.LUMINANCE=6409]="LUMINANCE",at[at.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",at[at.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",at[at.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(zt||(zt={})),function(at){at[at.TEXTURE_2D=3553]="TEXTURE_2D",at[at.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",at[at.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",at[at.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",at[at.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",at[at.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",at[at.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",at[at.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",at[at.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(st||(st={})),function(at){at[at.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",at[at.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",at[at.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",at[at.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",at[at.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",at[at.UNSIGNED_INT=5125]="UNSIGNED_INT",at[at.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",at[at.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",at[at.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",at[at.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",at[at.BYTE=5120]="BYTE",at[at.SHORT=5122]="SHORT",at[at.INT=5124]="INT",at[at.FLOAT=5126]="FLOAT",at[at.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",at[at.HALF_FLOAT=36193]="HALF_FLOAT"}(z||(z={})),function(at){at[at.FLOAT=0]="FLOAT",at[at.INT=1]="INT",at[at.UINT=2]="UINT"}(U||(U={})),function(at){at[at.NEAREST=0]="NEAREST",at[at.LINEAR=1]="LINEAR"}(dt||(dt={})),function(at){at[at.CLAMP=33071]="CLAMP",at[at.REPEAT=10497]="REPEAT",at[at.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}($||($={})),function(at){at[at.OFF=0]="OFF",at[at.POW2=1]="POW2",at[at.ON=2]="ON",at[at.ON_MANUAL=3]="ON_MANUAL"}(vt||(vt={})),function(at){at[at.NPM=0]="NPM",at[at.UNPACK=1]="UNPACK",at[at.PMA=2]="PMA",at[at.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",at[at.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",at[at.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",at[at.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"}(Lt||(Lt={})),function(at){at[at.NO=0]="NO",at[at.YES=1]="YES",at[at.AUTO=2]="AUTO",at[at.BLEND=0]="BLEND",at[at.CLEAR=1]="CLEAR",at[at.BLIT=2]="BLIT"}(K||(K={})),function(at){at[at.AUTO=0]="AUTO",at[at.MANUAL=1]="MANUAL"}(ct||(ct={})),function(at){at.LOW="lowp",at.MEDIUM="mediump",at.HIGH="highp"}(nt||(nt={})),function(at){at[at.NONE=0]="NONE",at[at.SCISSOR=1]="SCISSOR",at[at.STENCIL=2]="STENCIL",at[at.SPRITE=3]="SPRITE"}(_t||(_t={})),function(at){at[at.NONE=0]="NONE",at[at.LOW=2]="LOW",at[at.MEDIUM=4]="MEDIUM",at[at.HIGH=8]="HIGH"}(St||(St={})),function(at){at[at.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",at[at.ARRAY_BUFFER=34962]="ARRAY_BUFFER",at[at.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(kt||(kt={}));var Jt={MIPMAP_TEXTURES:vt.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:St.NONE,SPRITE_MAX_TEXTURES:function(at){var _e=!0;if(Xt.tablet||Xt.phone){var Ue;Xt.apple.device&&(Ue=navigator.userAgent.match(/OS (\d+)_(\d+)?/))&&parseInt(Ue[1],10)<11&&(_e=!1),Xt.android.device&&(Ue=navigator.userAgent.match(/Android\s([0-9.]*)/))&&parseInt(Ue[1],10)<7&&(_e=!1)}return _e?at:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:ct.AUTO,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:$.CLAMP,SCALE_MODE:dt.LINEAR,PRECISION_VERTEX:nt.HIGH,PRECISION_FRAGMENT:Xt.apple.device?nt.HIGH:nt.MEDIUM,CAN_UPLOAD_SAME_BUFFER:!Xt.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1}},function(b,w,v){v.d(w,"a",function(){return D}),v.d(w,"b",function(){return Lt}),v.d(w,"c",function(){return dt}),v.d(w,"d",function(){return $});var O=v(4),M=v(1),I=v(3);/*!
|
|
510
510
|
* @pixi/display - v6.4.2
|
|
511
511
|
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
|
|
512
512
|
*
|
|
@@ -525,13 +525,13 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
|
525
525
|
|
|
526
526
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
527
527
|
and limitations under the License.
|
|
528
|
-
***************************************************************************** */function z(K,ct){function nt(){this.constructor=K}k(K,ct),K.prototype=ct===null?Object.create(ct):(nt.prototype=ct.prototype,new nt)}var W,Y,et,ft,Dt,At,L,R,B,X,P,H,tt,G,Ot,zt,st,V,U,dt=function(K){function ct(){var nt=K.call(this)||this;return nt.tempDisplayObjectParent=null,nt.transform=new M.m,nt.alpha=1,nt.visible=!0,nt.renderable=!0,nt.cullable=!1,nt.cullArea=null,nt.parent=null,nt.worldAlpha=1,nt._lastSortedIndex=0,nt._zIndex=0,nt.filterArea=null,nt.filters=null,nt._enabledFilters=null,nt._bounds=new D,nt._localBounds=null,nt._boundsID=0,nt._boundsRect=null,nt._localBoundsRect=null,nt._mask=null,nt._maskRefCount=0,nt._destroyed=!1,nt.isSprite=!1,nt.isMask=!1,nt}return z(ct,K),ct.mixin=function(nt){for(var _t=Object.keys(nt),St=0;St<_t.length;++St){var kt=_t[St];Object.defineProperty(ct.prototype,kt,Object.getOwnPropertyDescriptor(nt,kt))}},Object.defineProperty(ct.prototype,"destroyed",{get:function(){return this._destroyed},enumerable:!1,configurable:!0}),ct.prototype._recursivePostUpdateTransform=function(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)},ct.prototype.updateTransform=function(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha},ct.prototype.getBounds=function(nt,_t){return nt||(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),_t||(this._boundsRect||(this._boundsRect=new M.j),_t=this._boundsRect),this._bounds.getRectangle(_t)},ct.prototype.getLocalBounds=function(nt){nt||(this._localBoundsRect||(this._localBoundsRect=new M.j),nt=this._localBoundsRect),this._localBounds||(this._localBounds=new D);var _t=this.transform,St=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform;var kt=this._bounds,Xt=this._boundsID;this._bounds=this._localBounds;var Jt=this.getBounds(!1,nt);return this.parent=St,this.transform=_t,this._bounds=kt,this._bounds.updateID+=this._boundsID-Xt,Jt},ct.prototype.toGlobal=function(nt,_t,St){return St===void 0&&(St=!1),St||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(nt,_t)},ct.prototype.toLocal=function(nt,_t,St,kt){return _t&&(nt=_t.toGlobal(nt,St,kt)),kt||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(nt,St)},ct.prototype.setParent=function(nt){if(!nt||!nt.addChild)throw new Error("setParent: Argument must be a Container");return nt.addChild(this),nt},ct.prototype.setTransform=function(nt,_t,St,kt,Xt,Jt,at,_e,Ue){return nt===void 0&&(nt=0),_t===void 0&&(_t=0),St===void 0&&(St=1),kt===void 0&&(kt=1),Xt===void 0&&(Xt=0),Jt===void 0&&(Jt=0),at===void 0&&(at=0),_e===void 0&&(_e=0),Ue===void 0&&(Ue=0),this.position.x=nt,this.position.y=_t,this.scale.x=St||1,this.scale.y=kt||1,this.rotation=Xt,this.skew.x=Jt,this.skew.y=at,this.pivot.x=_e,this.pivot.y=Ue,this},ct.prototype.destroy=function(nt){this.parent&&this.parent.removeChild(this),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.interactive=!1,this.interactiveChildren=!1,this.emit("destroyed"),this.removeAllListeners()},Object.defineProperty(ct.prototype,"_tempDisplayObjectParent",{get:function(){return this.tempDisplayObjectParent===null&&(this.tempDisplayObjectParent=new $),this.tempDisplayObjectParent},enumerable:!1,configurable:!0}),ct.prototype.enableTempParent=function(){var nt=this.parent;return this.parent=this._tempDisplayObjectParent,nt},ct.prototype.disableTempParent=function(nt){this.parent=nt},Object.defineProperty(ct.prototype,"x",{get:function(){return this.position.x},set:function(nt){this.transform.position.x=nt},enumerable:!1,configurable:!0}),Object.defineProperty(ct.prototype,"y",{get:function(){return this.position.y},set:function(nt){this.transform.position.y=nt},enumerable:!1,configurable:!0}),Object.defineProperty(ct.prototype,"worldTransform",{get:function(){return this.transform.worldTransform},enumerable:!1,configurable:!0}),Object.defineProperty(ct.prototype,"localTransform",{get:function(){return this.transform.localTransform},enumerable:!1,configurable:!0}),Object.defineProperty(ct.prototype,"position",{get:function(){return this.transform.position},set:function(nt){this.transform.position.copyFrom(nt)},enumerable:!1,configurable:!0}),Object.defineProperty(ct.prototype,"scale",{get:function(){return this.transform.scale},set:function(nt){this.transform.scale.copyFrom(nt)},enumerable:!1,configurable:!0}),Object.defineProperty(ct.prototype,"pivot",{get:function(){return this.transform.pivot},set:function(nt){this.transform.pivot.copyFrom(nt)},enumerable:!1,configurable:!0}),Object.defineProperty(ct.prototype,"skew",{get:function(){return this.transform.skew},set:function(nt){this.transform.skew.copyFrom(nt)},enumerable:!1,configurable:!0}),Object.defineProperty(ct.prototype,"rotation",{get:function(){return this.transform.rotation},set:function(nt){this.transform.rotation=nt},enumerable:!1,configurable:!0}),Object.defineProperty(ct.prototype,"angle",{get:function(){return this.transform.rotation*M.i},set:function(nt){this.transform.rotation=nt*M.b},enumerable:!1,configurable:!0}),Object.defineProperty(ct.prototype,"zIndex",{get:function(){return this._zIndex},set:function(nt){this._zIndex=nt,this.parent&&(this.parent.sortDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(ct.prototype,"worldVisible",{get:function(){var nt=this;do{if(!nt.visible)return!1;nt=nt.parent}while(nt);return!0},enumerable:!1,configurable:!0}),Object.defineProperty(ct.prototype,"mask",{get:function(){return this._mask},set:function(nt){if(this._mask!==nt){var _t;this._mask&&((_t=this._mask.maskObject||this._mask)._maskRefCount--,_t._maskRefCount===0&&(_t.renderable=!0,_t.isMask=!1)),this._mask=nt,this._mask&&((_t=this._mask.maskObject||this._mask)._maskRefCount===0&&(_t.renderable=!1,_t.isMask=!0),_t._maskRefCount++)}},enumerable:!1,configurable:!0}),ct}(I.EventEmitter),$=function(K){function ct(){var nt=K!==null&&K.apply(this,arguments)||this;return nt.sortDirty=null,nt}return z(ct,K),ct}(dt);function vt(K,ct){return K.zIndex===ct.zIndex?K._lastSortedIndex-ct._lastSortedIndex:K.zIndex-ct.zIndex}dt.prototype.displayObjectUpdateTransform=dt.prototype.updateTransform,function(K){K[K.WEBGL_LEGACY=0]="WEBGL_LEGACY",K[K.WEBGL=1]="WEBGL",K[K.WEBGL2=2]="WEBGL2"}(W||(W={})),function(K){K[K.UNKNOWN=0]="UNKNOWN",K[K.WEBGL=1]="WEBGL",K[K.CANVAS=2]="CANVAS"}(Y||(Y={})),function(K){K[K.COLOR=16384]="COLOR",K[K.DEPTH=256]="DEPTH",K[K.STENCIL=1024]="STENCIL"}(et||(et={})),function(K){K[K.NORMAL=0]="NORMAL",K[K.ADD=1]="ADD",K[K.MULTIPLY=2]="MULTIPLY",K[K.SCREEN=3]="SCREEN",K[K.OVERLAY=4]="OVERLAY",K[K.DARKEN=5]="DARKEN",K[K.LIGHTEN=6]="LIGHTEN",K[K.COLOR_DODGE=7]="COLOR_DODGE",K[K.COLOR_BURN=8]="COLOR_BURN",K[K.HARD_LIGHT=9]="HARD_LIGHT",K[K.SOFT_LIGHT=10]="SOFT_LIGHT",K[K.DIFFERENCE=11]="DIFFERENCE",K[K.EXCLUSION=12]="EXCLUSION",K[K.HUE=13]="HUE",K[K.SATURATION=14]="SATURATION",K[K.COLOR=15]="COLOR",K[K.LUMINOSITY=16]="LUMINOSITY",K[K.NORMAL_NPM=17]="NORMAL_NPM",K[K.ADD_NPM=18]="ADD_NPM",K[K.SCREEN_NPM=19]="SCREEN_NPM",K[K.NONE=20]="NONE",K[K.SRC_OVER=0]="SRC_OVER",K[K.SRC_IN=21]="SRC_IN",K[K.SRC_OUT=22]="SRC_OUT",K[K.SRC_ATOP=23]="SRC_ATOP",K[K.DST_OVER=24]="DST_OVER",K[K.DST_IN=25]="DST_IN",K[K.DST_OUT=26]="DST_OUT",K[K.DST_ATOP=27]="DST_ATOP",K[K.ERASE=26]="ERASE",K[K.SUBTRACT=28]="SUBTRACT",K[K.XOR=29]="XOR"}(ft||(ft={})),function(K){K[K.POINTS=0]="POINTS",K[K.LINES=1]="LINES",K[K.LINE_LOOP=2]="LINE_LOOP",K[K.LINE_STRIP=3]="LINE_STRIP",K[K.TRIANGLES=4]="TRIANGLES",K[K.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",K[K.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(Dt||(Dt={})),function(K){K[K.RGBA=6408]="RGBA",K[K.RGB=6407]="RGB",K[K.RG=33319]="RG",K[K.RED=6403]="RED",K[K.RGBA_INTEGER=36249]="RGBA_INTEGER",K[K.RGB_INTEGER=36248]="RGB_INTEGER",K[K.RG_INTEGER=33320]="RG_INTEGER",K[K.RED_INTEGER=36244]="RED_INTEGER",K[K.ALPHA=6406]="ALPHA",K[K.LUMINANCE=6409]="LUMINANCE",K[K.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",K[K.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",K[K.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(At||(At={})),function(K){K[K.TEXTURE_2D=3553]="TEXTURE_2D",K[K.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",K[K.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",K[K.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",K[K.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",K[K.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",K[K.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",K[K.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",K[K.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(L||(L={})),function(K){K[K.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",K[K.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",K[K.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",K[K.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",K[K.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",K[K.UNSIGNED_INT=5125]="UNSIGNED_INT",K[K.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",K[K.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",K[K.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",K[K.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",K[K.BYTE=5120]="BYTE",K[K.SHORT=5122]="SHORT",K[K.INT=5124]="INT",K[K.FLOAT=5126]="FLOAT",K[K.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",K[K.HALF_FLOAT=36193]="HALF_FLOAT"}(R||(R={})),function(K){K[K.FLOAT=0]="FLOAT",K[K.INT=1]="INT",K[K.UINT=2]="UINT"}(B||(B={})),function(K){K[K.NEAREST=0]="NEAREST",K[K.LINEAR=1]="LINEAR"}(X||(X={})),function(K){K[K.CLAMP=33071]="CLAMP",K[K.REPEAT=10497]="REPEAT",K[K.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(P||(P={})),function(K){K[K.OFF=0]="OFF",K[K.POW2=1]="POW2",K[K.ON=2]="ON",K[K.ON_MANUAL=3]="ON_MANUAL"}(H||(H={})),function(K){K[K.NPM=0]="NPM",K[K.UNPACK=1]="UNPACK",K[K.PMA=2]="PMA",K[K.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",K[K.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",K[K.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",K[K.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"}(tt||(tt={})),function(K){K[K.NO=0]="NO",K[K.YES=1]="YES",K[K.AUTO=2]="AUTO",K[K.BLEND=0]="BLEND",K[K.CLEAR=1]="CLEAR",K[K.BLIT=2]="BLIT"}(G||(G={})),function(K){K[K.AUTO=0]="AUTO",K[K.MANUAL=1]="MANUAL"}(Ot||(Ot={})),function(K){K.LOW="lowp",K.MEDIUM="mediump",K.HIGH="highp"}(zt||(zt={})),function(K){K[K.NONE=0]="NONE",K[K.SCISSOR=1]="SCISSOR",K[K.STENCIL=2]="STENCIL",K[K.SPRITE=3]="SPRITE"}(st||(st={})),function(K){K[K.NONE=0]="NONE",K[K.LOW=2]="LOW",K[K.MEDIUM=4]="MEDIUM",K[K.HIGH=8]="HIGH"}(V||(V={})),function(K){K[K.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",K[K.ARRAY_BUFFER=34962]="ARRAY_BUFFER",K[K.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(U||(U={}));var Lt=function(K){function ct(){var nt=K.call(this)||this;return nt.children=[],nt.sortableChildren=O.b.SORTABLE_CHILDREN,nt.sortDirty=!1,nt}return z(ct,K),ct.prototype.onChildrenChange=function(nt){},ct.prototype.addChild=function(){for(var nt=arguments,_t=[],St=0;St<arguments.length;St++)_t[St]=nt[St];if(_t.length>1)for(var kt=0;kt<_t.length;kt++)this.addChild(_t[kt]);else{var Xt=_t[0];Xt.parent&&Xt.parent.removeChild(Xt),Xt.parent=this,this.sortDirty=!0,Xt.transform._parentID=-1,this.children.push(Xt),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",Xt,this,this.children.length-1),Xt.emit("added",this)}return _t[0]},ct.prototype.addChildAt=function(nt,_t){if(_t<0||_t>this.children.length)throw new Error(nt+"addChildAt: The index "+_t+" supplied is out of bounds "+this.children.length);return nt.parent&&nt.parent.removeChild(nt),nt.parent=this,this.sortDirty=!0,nt.transform._parentID=-1,this.children.splice(_t,0,nt),this._boundsID++,this.onChildrenChange(_t),nt.emit("added",this),this.emit("childAdded",nt,this,_t),nt},ct.prototype.swapChildren=function(nt,_t){if(nt!==_t){var St=this.getChildIndex(nt),kt=this.getChildIndex(_t);this.children[St]=_t,this.children[kt]=nt,this.onChildrenChange(St<kt?St:kt)}},ct.prototype.getChildIndex=function(nt){var _t=this.children.indexOf(nt);if(_t===-1)throw new Error("The supplied DisplayObject must be a child of the caller");return _t},ct.prototype.setChildIndex=function(nt,_t){if(_t<0||_t>=this.children.length)throw new Error("The index "+_t+" supplied is out of bounds "+this.children.length);var St=this.getChildIndex(nt);Object(I.removeItems)(this.children,St,1),this.children.splice(_t,0,nt),this.onChildrenChange(_t)},ct.prototype.getChildAt=function(nt){if(nt<0||nt>=this.children.length)throw new Error("getChildAt: Index ("+nt+") does not exist.");return this.children[nt]},ct.prototype.removeChild=function(){for(var nt=arguments,_t=[],St=0;St<arguments.length;St++)_t[St]=nt[St];if(_t.length>1)for(var kt=0;kt<_t.length;kt++)this.removeChild(_t[kt]);else{var Xt=_t[0],Jt=this.children.indexOf(Xt);if(Jt===-1)return null;Xt.parent=null,Xt.transform._parentID=-1,Object(I.removeItems)(this.children,Jt,1),this._boundsID++,this.onChildrenChange(Jt),Xt.emit("removed",this),this.emit("childRemoved",Xt,this,Jt)}return _t[0]},ct.prototype.removeChildAt=function(nt){var _t=this.getChildAt(nt);return _t.parent=null,_t.transform._parentID=-1,Object(I.removeItems)(this.children,nt,1),this._boundsID++,this.onChildrenChange(nt),_t.emit("removed",this),this.emit("childRemoved",_t,this,nt),_t},ct.prototype.removeChildren=function(nt,_t){nt===void 0&&(nt=0),_t===void 0&&(_t=this.children.length);var St,kt=nt,Xt=_t-kt;if(Xt>0&&Xt<=_t){St=this.children.splice(kt,Xt);for(var Jt=0;Jt<St.length;++Jt)St[Jt].parent=null,St[Jt].transform&&(St[Jt].transform._parentID=-1);for(this._boundsID++,this.onChildrenChange(nt),Jt=0;Jt<St.length;++Jt)St[Jt].emit("removed",this),this.emit("childRemoved",St[Jt],this,Jt);return St}if(Xt===0&&this.children.length===0)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},ct.prototype.sortChildren=function(){for(var nt=!1,_t=0,St=this.children.length;_t<St;++_t){var kt=this.children[_t];kt._lastSortedIndex=_t,nt||kt.zIndex===0||(nt=!0)}nt&&this.children.length>1&&this.children.sort(vt),this.sortDirty=!1},ct.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var nt=0,_t=this.children.length;nt<_t;++nt){var St=this.children[nt];St.visible&&St.updateTransform()}},ct.prototype.calculateBounds=function(){this._bounds.clear(),this._calculateBounds();for(var nt=0;nt<this.children.length;nt++){var _t=this.children[nt];if(_t.visible&&_t.renderable)if(_t.calculateBounds(),_t._mask){var St=_t._mask.maskObject||_t._mask;St.calculateBounds(),this._bounds.addBoundsMask(_t._bounds,St._bounds)}else _t.filterArea?this._bounds.addBoundsArea(_t._bounds,_t.filterArea):this._bounds.addBounds(_t._bounds)}this._bounds.updateID=this._boundsID},ct.prototype.getLocalBounds=function(nt,_t){_t===void 0&&(_t=!1);var St=K.prototype.getLocalBounds.call(this,nt);if(!_t)for(var kt=0,Xt=this.children.length;kt<Xt;++kt){var Jt=this.children[kt];Jt.visible&&Jt.updateTransform()}return St},ct.prototype._calculateBounds=function(){},ct.prototype._renderWithCulling=function(nt){var _t=nt.renderTexture.sourceFrame;if(_t.width>0&&_t.height>0){var St,kt;if(this.cullArea?(St=this.cullArea,kt=this.worldTransform):this._render!==ct.prototype._render&&(St=this.getBounds(!0)),St&&_t.intersects(St,kt))this._render(nt);else if(this.cullArea)return;for(var Xt=0,Jt=this.children.length;Xt<Jt;++Xt){var at=this.children[Xt],_e=at.cullable;at.cullable=_e||!this.cullArea,at.render(nt),at.cullable=_e}}},ct.prototype.render=function(nt){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable)if(this._mask||this.filters&&this.filters.length)this.renderAdvanced(nt);else if(this.cullable)this._renderWithCulling(nt);else{this._render(nt);for(var _t=0,St=this.children.length;_t<St;++_t)this.children[_t].render(nt)}},ct.prototype.renderAdvanced=function(nt){var _t=this.filters,St=this._mask;if(_t){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(var kt=0;kt<_t.length;kt++)_t[kt].enabled&&this._enabledFilters.push(_t[kt])}var Xt=_t&&this._enabledFilters&&this._enabledFilters.length||St&&(!St.isMaskData||St.enabled&&(St.autoDetect||St.type!==st.NONE));if(Xt&&nt.batch.flush(),_t&&this._enabledFilters&&this._enabledFilters.length&&nt.filter.push(this,this._enabledFilters),St&&nt.mask.push(this,this._mask),this.cullable)this._renderWithCulling(nt);else{this._render(nt),kt=0;for(var Jt=this.children.length;kt<Jt;++kt)this.children[kt].render(nt)}Xt&&nt.batch.flush(),St&&nt.mask.pop(this),_t&&this._enabledFilters&&this._enabledFilters.length&&nt.filter.pop()},ct.prototype._render=function(nt){},ct.prototype.destroy=function(nt){K.prototype.destroy.call(this),this.sortDirty=!1;var _t=typeof nt=="boolean"?nt:nt&&nt.children,St=this.removeChildren(0,this.children.length);if(_t)for(var kt=0;kt<St.length;++kt)St[kt].destroy(nt)},Object.defineProperty(ct.prototype,"width",{get:function(){return this.scale.x*this.getLocalBounds().width},set:function(nt){var _t=this.getLocalBounds().width;this.scale.x=_t!==0?nt/_t:1,this._width=nt},enumerable:!1,configurable:!0}),Object.defineProperty(ct.prototype,"height",{get:function(){return this.scale.y*this.getLocalBounds().height},set:function(nt){var _t=this.getLocalBounds().height;this.scale.y=_t!==0?nt/_t:1,this._height=nt},enumerable:!1,configurable:!0}),ct}(dt);Lt.prototype.containerUpdateTransform=Lt.prototype.updateTransform},function(b,w,v){var O=Object.prototype.hasOwnProperty,M="~";function I(){}function D(Y,et,ft){this.fn=Y,this.context=et,this.once=ft||!1}function k(Y,et,ft,Dt,At){if(typeof ft!="function")throw new TypeError("The listener must be a function");var L=new D(ft,Dt||Y,At),R=M?M+et:et;return Y._events[R]?Y._events[R].fn?Y._events[R]=[Y._events[R],L]:Y._events[R].push(L):(Y._events[R]=L,Y._eventsCount++),Y}function z(Y,et){--Y._eventsCount==0?Y._events=new I:delete Y._events[et]}function W(){this._events=new I,this._eventsCount=0}Object.create&&(I.prototype=Object.create(null),new I().__proto__||(M=!1)),W.prototype.eventNames=function(){var Y,et,ft=[];if(this._eventsCount===0)return ft;for(et in Y=this._events)O.call(Y,et)&&ft.push(M?et.slice(1):et);return Object.getOwnPropertySymbols?ft.concat(Object.getOwnPropertySymbols(Y)):ft},W.prototype.listeners=function(Y){var et=M?M+Y:Y,ft=this._events[et];if(!ft)return[];if(ft.fn)return[ft.fn];for(var Dt=0,At=ft.length,L=new Array(At);Dt<At;Dt++)L[Dt]=ft[Dt].fn;return L},W.prototype.listenerCount=function(Y){var et=M?M+Y:Y,ft=this._events[et];return ft?ft.fn?1:ft.length:0},W.prototype.emit=function(Y,et,ft,Dt,At,L){var R=M?M+Y:Y;if(!this._events[R])return!1;var B,X,P=this._events[R],H=arguments.length;if(P.fn){switch(P.once&&this.removeListener(Y,P.fn,void 0,!0),H){case 1:return P.fn.call(P.context),!0;case 2:return P.fn.call(P.context,et),!0;case 3:return P.fn.call(P.context,et,ft),!0;case 4:return P.fn.call(P.context,et,ft,Dt),!0;case 5:return P.fn.call(P.context,et,ft,Dt,At),!0;case 6:return P.fn.call(P.context,et,ft,Dt,At,L),!0}for(X=1,B=new Array(H-1);X<H;X++)B[X-1]=arguments[X];P.fn.apply(P.context,B)}else{var tt,G=P.length;for(X=0;X<G;X++)switch(P[X].once&&this.removeListener(Y,P[X].fn,void 0,!0),H){case 1:P[X].fn.call(P[X].context);break;case 2:P[X].fn.call(P[X].context,et);break;case 3:P[X].fn.call(P[X].context,et,ft);break;case 4:P[X].fn.call(P[X].context,et,ft,Dt);break;default:if(!B)for(tt=1,B=new Array(H-1);tt<H;tt++)B[tt-1]=arguments[tt];P[X].fn.apply(P[X].context,B)}}return!0},W.prototype.on=function(Y,et,ft){return k(this,Y,et,ft,!1)},W.prototype.once=function(Y,et,ft){return k(this,Y,et,ft,!0)},W.prototype.removeListener=function(Y,et,ft,Dt){var At=M?M+Y:Y;if(!this._events[At])return this;if(!et)return z(this,At),this;var L=this._events[At];if(L.fn)L.fn!==et||Dt&&!L.once||ft&&L.context!==ft||z(this,At);else{for(var R=0,B=[],X=L.length;R<X;R++)(L[R].fn!==et||Dt&&!L[R].once||ft&&L[R].context!==ft)&&B.push(L[R]);B.length?this._events[At]=B.length===1?B[0]:B:z(this,At)}return this},W.prototype.removeAllListeners=function(Y){var et;return Y?(et=M?M+Y:Y,this._events[et]&&z(this,et)):(this._events=new I,this._eventsCount=0),this},W.prototype.off=W.prototype.removeListener,W.prototype.addListener=W.prototype.on,W.prefixed=M,W.EventEmitter=W,b.exports=W},function(b,w,v){v.d(w,"a",function(){return D}),v.d(w,"b",function(){return k}),v.d(w,"c",function(){return O});var O,M=v(4);/*!
|
|
528
|
+
***************************************************************************** */function V(K,ct){function nt(){this.constructor=K}k(K,ct),K.prototype=ct===null?Object.create(ct):(nt.prototype=ct.prototype,new nt)}var W,X,et,ft,Dt,At,L,R,B,Y,P,H,tt,G,Ot,zt,st,z,U,dt=function(K){function ct(){var nt=K.call(this)||this;return nt.tempDisplayObjectParent=null,nt.transform=new M.m,nt.alpha=1,nt.visible=!0,nt.renderable=!0,nt.cullable=!1,nt.cullArea=null,nt.parent=null,nt.worldAlpha=1,nt._lastSortedIndex=0,nt._zIndex=0,nt.filterArea=null,nt.filters=null,nt._enabledFilters=null,nt._bounds=new D,nt._localBounds=null,nt._boundsID=0,nt._boundsRect=null,nt._localBoundsRect=null,nt._mask=null,nt._maskRefCount=0,nt._destroyed=!1,nt.isSprite=!1,nt.isMask=!1,nt}return V(ct,K),ct.mixin=function(nt){for(var _t=Object.keys(nt),St=0;St<_t.length;++St){var kt=_t[St];Object.defineProperty(ct.prototype,kt,Object.getOwnPropertyDescriptor(nt,kt))}},Object.defineProperty(ct.prototype,"destroyed",{get:function(){return this._destroyed},enumerable:!1,configurable:!0}),ct.prototype._recursivePostUpdateTransform=function(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)},ct.prototype.updateTransform=function(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha},ct.prototype.getBounds=function(nt,_t){return nt||(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),_t||(this._boundsRect||(this._boundsRect=new M.j),_t=this._boundsRect),this._bounds.getRectangle(_t)},ct.prototype.getLocalBounds=function(nt){nt||(this._localBoundsRect||(this._localBoundsRect=new M.j),nt=this._localBoundsRect),this._localBounds||(this._localBounds=new D);var _t=this.transform,St=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform;var kt=this._bounds,Xt=this._boundsID;this._bounds=this._localBounds;var Jt=this.getBounds(!1,nt);return this.parent=St,this.transform=_t,this._bounds=kt,this._bounds.updateID+=this._boundsID-Xt,Jt},ct.prototype.toGlobal=function(nt,_t,St){return St===void 0&&(St=!1),St||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(nt,_t)},ct.prototype.toLocal=function(nt,_t,St,kt){return _t&&(nt=_t.toGlobal(nt,St,kt)),kt||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(nt,St)},ct.prototype.setParent=function(nt){if(!nt||!nt.addChild)throw new Error("setParent: Argument must be a Container");return nt.addChild(this),nt},ct.prototype.setTransform=function(nt,_t,St,kt,Xt,Jt,at,_e,Ue){return nt===void 0&&(nt=0),_t===void 0&&(_t=0),St===void 0&&(St=1),kt===void 0&&(kt=1),Xt===void 0&&(Xt=0),Jt===void 0&&(Jt=0),at===void 0&&(at=0),_e===void 0&&(_e=0),Ue===void 0&&(Ue=0),this.position.x=nt,this.position.y=_t,this.scale.x=St||1,this.scale.y=kt||1,this.rotation=Xt,this.skew.x=Jt,this.skew.y=at,this.pivot.x=_e,this.pivot.y=Ue,this},ct.prototype.destroy=function(nt){this.parent&&this.parent.removeChild(this),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.interactive=!1,this.interactiveChildren=!1,this.emit("destroyed"),this.removeAllListeners()},Object.defineProperty(ct.prototype,"_tempDisplayObjectParent",{get:function(){return this.tempDisplayObjectParent===null&&(this.tempDisplayObjectParent=new $),this.tempDisplayObjectParent},enumerable:!1,configurable:!0}),ct.prototype.enableTempParent=function(){var nt=this.parent;return this.parent=this._tempDisplayObjectParent,nt},ct.prototype.disableTempParent=function(nt){this.parent=nt},Object.defineProperty(ct.prototype,"x",{get:function(){return this.position.x},set:function(nt){this.transform.position.x=nt},enumerable:!1,configurable:!0}),Object.defineProperty(ct.prototype,"y",{get:function(){return this.position.y},set:function(nt){this.transform.position.y=nt},enumerable:!1,configurable:!0}),Object.defineProperty(ct.prototype,"worldTransform",{get:function(){return this.transform.worldTransform},enumerable:!1,configurable:!0}),Object.defineProperty(ct.prototype,"localTransform",{get:function(){return this.transform.localTransform},enumerable:!1,configurable:!0}),Object.defineProperty(ct.prototype,"position",{get:function(){return this.transform.position},set:function(nt){this.transform.position.copyFrom(nt)},enumerable:!1,configurable:!0}),Object.defineProperty(ct.prototype,"scale",{get:function(){return this.transform.scale},set:function(nt){this.transform.scale.copyFrom(nt)},enumerable:!1,configurable:!0}),Object.defineProperty(ct.prototype,"pivot",{get:function(){return this.transform.pivot},set:function(nt){this.transform.pivot.copyFrom(nt)},enumerable:!1,configurable:!0}),Object.defineProperty(ct.prototype,"skew",{get:function(){return this.transform.skew},set:function(nt){this.transform.skew.copyFrom(nt)},enumerable:!1,configurable:!0}),Object.defineProperty(ct.prototype,"rotation",{get:function(){return this.transform.rotation},set:function(nt){this.transform.rotation=nt},enumerable:!1,configurable:!0}),Object.defineProperty(ct.prototype,"angle",{get:function(){return this.transform.rotation*M.i},set:function(nt){this.transform.rotation=nt*M.b},enumerable:!1,configurable:!0}),Object.defineProperty(ct.prototype,"zIndex",{get:function(){return this._zIndex},set:function(nt){this._zIndex=nt,this.parent&&(this.parent.sortDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(ct.prototype,"worldVisible",{get:function(){var nt=this;do{if(!nt.visible)return!1;nt=nt.parent}while(nt);return!0},enumerable:!1,configurable:!0}),Object.defineProperty(ct.prototype,"mask",{get:function(){return this._mask},set:function(nt){if(this._mask!==nt){var _t;this._mask&&((_t=this._mask.maskObject||this._mask)._maskRefCount--,_t._maskRefCount===0&&(_t.renderable=!0,_t.isMask=!1)),this._mask=nt,this._mask&&((_t=this._mask.maskObject||this._mask)._maskRefCount===0&&(_t.renderable=!1,_t.isMask=!0),_t._maskRefCount++)}},enumerable:!1,configurable:!0}),ct}(I.EventEmitter),$=function(K){function ct(){var nt=K!==null&&K.apply(this,arguments)||this;return nt.sortDirty=null,nt}return V(ct,K),ct}(dt);function vt(K,ct){return K.zIndex===ct.zIndex?K._lastSortedIndex-ct._lastSortedIndex:K.zIndex-ct.zIndex}dt.prototype.displayObjectUpdateTransform=dt.prototype.updateTransform,function(K){K[K.WEBGL_LEGACY=0]="WEBGL_LEGACY",K[K.WEBGL=1]="WEBGL",K[K.WEBGL2=2]="WEBGL2"}(W||(W={})),function(K){K[K.UNKNOWN=0]="UNKNOWN",K[K.WEBGL=1]="WEBGL",K[K.CANVAS=2]="CANVAS"}(X||(X={})),function(K){K[K.COLOR=16384]="COLOR",K[K.DEPTH=256]="DEPTH",K[K.STENCIL=1024]="STENCIL"}(et||(et={})),function(K){K[K.NORMAL=0]="NORMAL",K[K.ADD=1]="ADD",K[K.MULTIPLY=2]="MULTIPLY",K[K.SCREEN=3]="SCREEN",K[K.OVERLAY=4]="OVERLAY",K[K.DARKEN=5]="DARKEN",K[K.LIGHTEN=6]="LIGHTEN",K[K.COLOR_DODGE=7]="COLOR_DODGE",K[K.COLOR_BURN=8]="COLOR_BURN",K[K.HARD_LIGHT=9]="HARD_LIGHT",K[K.SOFT_LIGHT=10]="SOFT_LIGHT",K[K.DIFFERENCE=11]="DIFFERENCE",K[K.EXCLUSION=12]="EXCLUSION",K[K.HUE=13]="HUE",K[K.SATURATION=14]="SATURATION",K[K.COLOR=15]="COLOR",K[K.LUMINOSITY=16]="LUMINOSITY",K[K.NORMAL_NPM=17]="NORMAL_NPM",K[K.ADD_NPM=18]="ADD_NPM",K[K.SCREEN_NPM=19]="SCREEN_NPM",K[K.NONE=20]="NONE",K[K.SRC_OVER=0]="SRC_OVER",K[K.SRC_IN=21]="SRC_IN",K[K.SRC_OUT=22]="SRC_OUT",K[K.SRC_ATOP=23]="SRC_ATOP",K[K.DST_OVER=24]="DST_OVER",K[K.DST_IN=25]="DST_IN",K[K.DST_OUT=26]="DST_OUT",K[K.DST_ATOP=27]="DST_ATOP",K[K.ERASE=26]="ERASE",K[K.SUBTRACT=28]="SUBTRACT",K[K.XOR=29]="XOR"}(ft||(ft={})),function(K){K[K.POINTS=0]="POINTS",K[K.LINES=1]="LINES",K[K.LINE_LOOP=2]="LINE_LOOP",K[K.LINE_STRIP=3]="LINE_STRIP",K[K.TRIANGLES=4]="TRIANGLES",K[K.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",K[K.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(Dt||(Dt={})),function(K){K[K.RGBA=6408]="RGBA",K[K.RGB=6407]="RGB",K[K.RG=33319]="RG",K[K.RED=6403]="RED",K[K.RGBA_INTEGER=36249]="RGBA_INTEGER",K[K.RGB_INTEGER=36248]="RGB_INTEGER",K[K.RG_INTEGER=33320]="RG_INTEGER",K[K.RED_INTEGER=36244]="RED_INTEGER",K[K.ALPHA=6406]="ALPHA",K[K.LUMINANCE=6409]="LUMINANCE",K[K.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",K[K.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",K[K.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(At||(At={})),function(K){K[K.TEXTURE_2D=3553]="TEXTURE_2D",K[K.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",K[K.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",K[K.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",K[K.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",K[K.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",K[K.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",K[K.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",K[K.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(L||(L={})),function(K){K[K.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",K[K.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",K[K.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",K[K.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",K[K.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",K[K.UNSIGNED_INT=5125]="UNSIGNED_INT",K[K.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",K[K.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",K[K.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",K[K.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",K[K.BYTE=5120]="BYTE",K[K.SHORT=5122]="SHORT",K[K.INT=5124]="INT",K[K.FLOAT=5126]="FLOAT",K[K.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",K[K.HALF_FLOAT=36193]="HALF_FLOAT"}(R||(R={})),function(K){K[K.FLOAT=0]="FLOAT",K[K.INT=1]="INT",K[K.UINT=2]="UINT"}(B||(B={})),function(K){K[K.NEAREST=0]="NEAREST",K[K.LINEAR=1]="LINEAR"}(Y||(Y={})),function(K){K[K.CLAMP=33071]="CLAMP",K[K.REPEAT=10497]="REPEAT",K[K.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(P||(P={})),function(K){K[K.OFF=0]="OFF",K[K.POW2=1]="POW2",K[K.ON=2]="ON",K[K.ON_MANUAL=3]="ON_MANUAL"}(H||(H={})),function(K){K[K.NPM=0]="NPM",K[K.UNPACK=1]="UNPACK",K[K.PMA=2]="PMA",K[K.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",K[K.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",K[K.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",K[K.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"}(tt||(tt={})),function(K){K[K.NO=0]="NO",K[K.YES=1]="YES",K[K.AUTO=2]="AUTO",K[K.BLEND=0]="BLEND",K[K.CLEAR=1]="CLEAR",K[K.BLIT=2]="BLIT"}(G||(G={})),function(K){K[K.AUTO=0]="AUTO",K[K.MANUAL=1]="MANUAL"}(Ot||(Ot={})),function(K){K.LOW="lowp",K.MEDIUM="mediump",K.HIGH="highp"}(zt||(zt={})),function(K){K[K.NONE=0]="NONE",K[K.SCISSOR=1]="SCISSOR",K[K.STENCIL=2]="STENCIL",K[K.SPRITE=3]="SPRITE"}(st||(st={})),function(K){K[K.NONE=0]="NONE",K[K.LOW=2]="LOW",K[K.MEDIUM=4]="MEDIUM",K[K.HIGH=8]="HIGH"}(z||(z={})),function(K){K[K.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",K[K.ARRAY_BUFFER=34962]="ARRAY_BUFFER",K[K.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(U||(U={}));var Lt=function(K){function ct(){var nt=K.call(this)||this;return nt.children=[],nt.sortableChildren=O.b.SORTABLE_CHILDREN,nt.sortDirty=!1,nt}return V(ct,K),ct.prototype.onChildrenChange=function(nt){},ct.prototype.addChild=function(){for(var nt=arguments,_t=[],St=0;St<arguments.length;St++)_t[St]=nt[St];if(_t.length>1)for(var kt=0;kt<_t.length;kt++)this.addChild(_t[kt]);else{var Xt=_t[0];Xt.parent&&Xt.parent.removeChild(Xt),Xt.parent=this,this.sortDirty=!0,Xt.transform._parentID=-1,this.children.push(Xt),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",Xt,this,this.children.length-1),Xt.emit("added",this)}return _t[0]},ct.prototype.addChildAt=function(nt,_t){if(_t<0||_t>this.children.length)throw new Error(nt+"addChildAt: The index "+_t+" supplied is out of bounds "+this.children.length);return nt.parent&&nt.parent.removeChild(nt),nt.parent=this,this.sortDirty=!0,nt.transform._parentID=-1,this.children.splice(_t,0,nt),this._boundsID++,this.onChildrenChange(_t),nt.emit("added",this),this.emit("childAdded",nt,this,_t),nt},ct.prototype.swapChildren=function(nt,_t){if(nt!==_t){var St=this.getChildIndex(nt),kt=this.getChildIndex(_t);this.children[St]=_t,this.children[kt]=nt,this.onChildrenChange(St<kt?St:kt)}},ct.prototype.getChildIndex=function(nt){var _t=this.children.indexOf(nt);if(_t===-1)throw new Error("The supplied DisplayObject must be a child of the caller");return _t},ct.prototype.setChildIndex=function(nt,_t){if(_t<0||_t>=this.children.length)throw new Error("The index "+_t+" supplied is out of bounds "+this.children.length);var St=this.getChildIndex(nt);Object(I.removeItems)(this.children,St,1),this.children.splice(_t,0,nt),this.onChildrenChange(_t)},ct.prototype.getChildAt=function(nt){if(nt<0||nt>=this.children.length)throw new Error("getChildAt: Index ("+nt+") does not exist.");return this.children[nt]},ct.prototype.removeChild=function(){for(var nt=arguments,_t=[],St=0;St<arguments.length;St++)_t[St]=nt[St];if(_t.length>1)for(var kt=0;kt<_t.length;kt++)this.removeChild(_t[kt]);else{var Xt=_t[0],Jt=this.children.indexOf(Xt);if(Jt===-1)return null;Xt.parent=null,Xt.transform._parentID=-1,Object(I.removeItems)(this.children,Jt,1),this._boundsID++,this.onChildrenChange(Jt),Xt.emit("removed",this),this.emit("childRemoved",Xt,this,Jt)}return _t[0]},ct.prototype.removeChildAt=function(nt){var _t=this.getChildAt(nt);return _t.parent=null,_t.transform._parentID=-1,Object(I.removeItems)(this.children,nt,1),this._boundsID++,this.onChildrenChange(nt),_t.emit("removed",this),this.emit("childRemoved",_t,this,nt),_t},ct.prototype.removeChildren=function(nt,_t){nt===void 0&&(nt=0),_t===void 0&&(_t=this.children.length);var St,kt=nt,Xt=_t-kt;if(Xt>0&&Xt<=_t){St=this.children.splice(kt,Xt);for(var Jt=0;Jt<St.length;++Jt)St[Jt].parent=null,St[Jt].transform&&(St[Jt].transform._parentID=-1);for(this._boundsID++,this.onChildrenChange(nt),Jt=0;Jt<St.length;++Jt)St[Jt].emit("removed",this),this.emit("childRemoved",St[Jt],this,Jt);return St}if(Xt===0&&this.children.length===0)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},ct.prototype.sortChildren=function(){for(var nt=!1,_t=0,St=this.children.length;_t<St;++_t){var kt=this.children[_t];kt._lastSortedIndex=_t,nt||kt.zIndex===0||(nt=!0)}nt&&this.children.length>1&&this.children.sort(vt),this.sortDirty=!1},ct.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var nt=0,_t=this.children.length;nt<_t;++nt){var St=this.children[nt];St.visible&&St.updateTransform()}},ct.prototype.calculateBounds=function(){this._bounds.clear(),this._calculateBounds();for(var nt=0;nt<this.children.length;nt++){var _t=this.children[nt];if(_t.visible&&_t.renderable)if(_t.calculateBounds(),_t._mask){var St=_t._mask.maskObject||_t._mask;St.calculateBounds(),this._bounds.addBoundsMask(_t._bounds,St._bounds)}else _t.filterArea?this._bounds.addBoundsArea(_t._bounds,_t.filterArea):this._bounds.addBounds(_t._bounds)}this._bounds.updateID=this._boundsID},ct.prototype.getLocalBounds=function(nt,_t){_t===void 0&&(_t=!1);var St=K.prototype.getLocalBounds.call(this,nt);if(!_t)for(var kt=0,Xt=this.children.length;kt<Xt;++kt){var Jt=this.children[kt];Jt.visible&&Jt.updateTransform()}return St},ct.prototype._calculateBounds=function(){},ct.prototype._renderWithCulling=function(nt){var _t=nt.renderTexture.sourceFrame;if(_t.width>0&&_t.height>0){var St,kt;if(this.cullArea?(St=this.cullArea,kt=this.worldTransform):this._render!==ct.prototype._render&&(St=this.getBounds(!0)),St&&_t.intersects(St,kt))this._render(nt);else if(this.cullArea)return;for(var Xt=0,Jt=this.children.length;Xt<Jt;++Xt){var at=this.children[Xt],_e=at.cullable;at.cullable=_e||!this.cullArea,at.render(nt),at.cullable=_e}}},ct.prototype.render=function(nt){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable)if(this._mask||this.filters&&this.filters.length)this.renderAdvanced(nt);else if(this.cullable)this._renderWithCulling(nt);else{this._render(nt);for(var _t=0,St=this.children.length;_t<St;++_t)this.children[_t].render(nt)}},ct.prototype.renderAdvanced=function(nt){var _t=this.filters,St=this._mask;if(_t){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(var kt=0;kt<_t.length;kt++)_t[kt].enabled&&this._enabledFilters.push(_t[kt])}var Xt=_t&&this._enabledFilters&&this._enabledFilters.length||St&&(!St.isMaskData||St.enabled&&(St.autoDetect||St.type!==st.NONE));if(Xt&&nt.batch.flush(),_t&&this._enabledFilters&&this._enabledFilters.length&&nt.filter.push(this,this._enabledFilters),St&&nt.mask.push(this,this._mask),this.cullable)this._renderWithCulling(nt);else{this._render(nt),kt=0;for(var Jt=this.children.length;kt<Jt;++kt)this.children[kt].render(nt)}Xt&&nt.batch.flush(),St&&nt.mask.pop(this),_t&&this._enabledFilters&&this._enabledFilters.length&&nt.filter.pop()},ct.prototype._render=function(nt){},ct.prototype.destroy=function(nt){K.prototype.destroy.call(this),this.sortDirty=!1;var _t=typeof nt=="boolean"?nt:nt&&nt.children,St=this.removeChildren(0,this.children.length);if(_t)for(var kt=0;kt<St.length;++kt)St[kt].destroy(nt)},Object.defineProperty(ct.prototype,"width",{get:function(){return this.scale.x*this.getLocalBounds().width},set:function(nt){var _t=this.getLocalBounds().width;this.scale.x=_t!==0?nt/_t:1,this._width=nt},enumerable:!1,configurable:!0}),Object.defineProperty(ct.prototype,"height",{get:function(){return this.scale.y*this.getLocalBounds().height},set:function(nt){var _t=this.getLocalBounds().height;this.scale.y=_t!==0?nt/_t:1,this._height=nt},enumerable:!1,configurable:!0}),ct}(dt);Lt.prototype.containerUpdateTransform=Lt.prototype.updateTransform},function(b,w,v){var O=Object.prototype.hasOwnProperty,M="~";function I(){}function D(X,et,ft){this.fn=X,this.context=et,this.once=ft||!1}function k(X,et,ft,Dt,At){if(typeof ft!="function")throw new TypeError("The listener must be a function");var L=new D(ft,Dt||X,At),R=M?M+et:et;return X._events[R]?X._events[R].fn?X._events[R]=[X._events[R],L]:X._events[R].push(L):(X._events[R]=L,X._eventsCount++),X}function V(X,et){--X._eventsCount==0?X._events=new I:delete X._events[et]}function W(){this._events=new I,this._eventsCount=0}Object.create&&(I.prototype=Object.create(null),new I().__proto__||(M=!1)),W.prototype.eventNames=function(){var X,et,ft=[];if(this._eventsCount===0)return ft;for(et in X=this._events)O.call(X,et)&&ft.push(M?et.slice(1):et);return Object.getOwnPropertySymbols?ft.concat(Object.getOwnPropertySymbols(X)):ft},W.prototype.listeners=function(X){var et=M?M+X:X,ft=this._events[et];if(!ft)return[];if(ft.fn)return[ft.fn];for(var Dt=0,At=ft.length,L=new Array(At);Dt<At;Dt++)L[Dt]=ft[Dt].fn;return L},W.prototype.listenerCount=function(X){var et=M?M+X:X,ft=this._events[et];return ft?ft.fn?1:ft.length:0},W.prototype.emit=function(X,et,ft,Dt,At,L){var R=M?M+X:X;if(!this._events[R])return!1;var B,Y,P=this._events[R],H=arguments.length;if(P.fn){switch(P.once&&this.removeListener(X,P.fn,void 0,!0),H){case 1:return P.fn.call(P.context),!0;case 2:return P.fn.call(P.context,et),!0;case 3:return P.fn.call(P.context,et,ft),!0;case 4:return P.fn.call(P.context,et,ft,Dt),!0;case 5:return P.fn.call(P.context,et,ft,Dt,At),!0;case 6:return P.fn.call(P.context,et,ft,Dt,At,L),!0}for(Y=1,B=new Array(H-1);Y<H;Y++)B[Y-1]=arguments[Y];P.fn.apply(P.context,B)}else{var tt,G=P.length;for(Y=0;Y<G;Y++)switch(P[Y].once&&this.removeListener(X,P[Y].fn,void 0,!0),H){case 1:P[Y].fn.call(P[Y].context);break;case 2:P[Y].fn.call(P[Y].context,et);break;case 3:P[Y].fn.call(P[Y].context,et,ft);break;case 4:P[Y].fn.call(P[Y].context,et,ft,Dt);break;default:if(!B)for(tt=1,B=new Array(H-1);tt<H;tt++)B[tt-1]=arguments[tt];P[Y].fn.apply(P[Y].context,B)}}return!0},W.prototype.on=function(X,et,ft){return k(this,X,et,ft,!1)},W.prototype.once=function(X,et,ft){return k(this,X,et,ft,!0)},W.prototype.removeListener=function(X,et,ft,Dt){var At=M?M+X:X;if(!this._events[At])return this;if(!et)return V(this,At),this;var L=this._events[At];if(L.fn)L.fn!==et||Dt&&!L.once||ft&&L.context!==ft||V(this,At);else{for(var R=0,B=[],Y=L.length;R<Y;R++)(L[R].fn!==et||Dt&&!L[R].once||ft&&L[R].context!==ft)&&B.push(L[R]);B.length?this._events[At]=B.length===1?B[0]:B:V(this,At)}return this},W.prototype.removeAllListeners=function(X){var et;return X?(et=M?M+X:X,this._events[et]&&V(this,et)):(this._events=new I,this._eventsCount=0),this},W.prototype.off=W.prototype.removeListener,W.prototype.addListener=W.prototype.on,W.prefixed=M,W.EventEmitter=W,b.exports=W},function(b,w,v){v.d(w,"a",function(){return D}),v.d(w,"b",function(){return k}),v.d(w,"c",function(){return O});var O,M=v(4);/*!
|
|
529
529
|
* @pixi/ticker - v6.4.2
|
|
530
530
|
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
|
|
531
531
|
*
|
|
532
532
|
* @pixi/ticker is licensed under the MIT License.
|
|
533
533
|
* http://www.opensource.org/licenses/mit-license
|
|
534
|
-
*/M.b.TARGET_FPMS=.06,function(z){z[z.INTERACTION=50]="INTERACTION",z[z.HIGH=25]="HIGH",z[z.NORMAL=0]="NORMAL",z[z.LOW=-25]="LOW",z[z.UTILITY=-50]="UTILITY"}(O||(O={}));var I=function(){function z(W,Y,et,ft){Y===void 0&&(Y=null),et===void 0&&(et=0),ft===void 0&&(ft=!1),this.next=null,this.previous=null,this._destroyed=!1,this.fn=W,this.context=Y,this.priority=et,this.once=ft}return z.prototype.match=function(W,Y){return Y===void 0&&(Y=null),this.fn===W&&this.context===Y},z.prototype.emit=function(W){this.fn&&(this.context?this.fn.call(this.context,W):this.fn(W));var Y=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),Y},z.prototype.connect=function(W){this.previous=W,W.next&&(W.next.previous=this),this.next=W.next,W.next=this},z.prototype.destroy=function(W){W===void 0&&(W=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var Y=this.next;return this.next=W?null:Y,this.previous=null,Y},z}(),D=function(){function z(){var W=this;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 I(null,null,1/0),this.deltaMS=1/M.b.TARGET_FPMS,this.elapsedMS=1/M.b.TARGET_FPMS,this._tick=function(Y){W._requestId=null,W.started&&(W.update(Y),W.started&&W._requestId===null&&W._head.next&&(W._requestId=requestAnimationFrame(W._tick)))}}return z.prototype._requestIfNeeded=function(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},z.prototype._cancelIfNeeded=function(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)},z.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},z.prototype.add=function(W,Y,et){return et===void 0&&(et=O.NORMAL),this._addListener(new I(W,Y,et))},z.prototype.addOnce=function(W,Y,et){return et===void 0&&(et=O.NORMAL),this._addListener(new I(W,Y,et,!0))},z.prototype._addListener=function(W){var Y=this._head.next,et=this._head;if(Y){for(;Y;){if(W.priority>Y.priority){W.connect(et);break}et=Y,Y=Y.next}W.previous||W.connect(et)}else W.connect(et);return this._startIfPossible(),this},z.prototype.remove=function(W,Y){for(var et=this._head.next;et;)et=et.match(W,Y)?et.destroy():et.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(z.prototype,"count",{get:function(){if(!this._head)return 0;for(var W=0,Y=this._head;Y=Y.next;)W++;return W},enumerable:!1,configurable:!0}),z.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},z.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},z.prototype.destroy=function(){if(!this._protected){this.stop();for(var W=this._head.next;W;)W=W.destroy(!0);this._head.destroy(),this._head=null}},z.prototype.update=function(W){var Y;if(W===void 0&&(W=performance.now()),W>this.lastTime){if((Y=this.elapsedMS=W-this.lastTime)>this._maxElapsedMS&&(Y=this._maxElapsedMS),Y*=this.speed,this._minElapsedMS){var et=W-this._lastFrame|0;if(et<this._minElapsedMS)return;this._lastFrame=W-et%this._minElapsedMS}this.deltaMS=Y,this.deltaTime=this.deltaMS*M.b.TARGET_FPMS;for(var ft=this._head,Dt=ft.next;Dt;)Dt=Dt.emit(this.deltaTime);ft.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=W},Object.defineProperty(z.prototype,"FPS",{get:function(){return 1e3/this.elapsedMS},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"minFPS",{get:function(){return 1e3/this._maxElapsedMS},set:function(W){var Y=Math.min(this.maxFPS,W),et=Math.min(Math.max(0,Y)/1e3,M.b.TARGET_FPMS);this._maxElapsedMS=1/et},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"maxFPS",{get:function(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0},set:function(W){if(W===0)this._minElapsedMS=0;else{var Y=Math.max(this.minFPS,W);this._minElapsedMS=1/(Y/1e3)}},enumerable:!1,configurable:!0}),Object.defineProperty(z,"shared",{get:function(){if(!z._shared){var W=z._shared=new z;W.autoStart=!0,W._protected=!0}return z._shared},enumerable:!1,configurable:!0}),Object.defineProperty(z,"system",{get:function(){if(!z._system){var W=z._system=new z;W.autoStart=!0,W._protected=!0}return z._system},enumerable:!1,configurable:!0}),z}(),k=function(){function z(){}return z.init=function(W){var Y=this;W=Object.assign({autoStart:!0,sharedTicker:!1},W),Object.defineProperty(this,"ticker",{set:function(et){this._ticker&&this._ticker.remove(this.render,this),this._ticker=et,et&&et.add(this.render,this,O.LOW)},get:function(){return this._ticker}}),this.stop=function(){Y._ticker.stop()},this.start=function(){Y._ticker.start()},this._ticker=null,this.ticker=W.sharedTicker?D.shared:new D,W.autoStart&&this.start()},z.destroy=function(){if(this._ticker){var W=this._ticker;this.ticker=null,W.destroy()}},z}()},function(b,w,v){v.d(w,"a",function(){return At}),v.d(w,"b",function(){return R}),v.d(w,"c",function(){return L});var O=v(2),M=v(1),I=v(0),D=v(5),k=v(4),z=v(3),W=function(B,X){return(W=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(P,H){P.__proto__=H}||function(P,H){for(var tt in H)H.hasOwnProperty(tt)&&(P[tt]=H[tt])})(B,X)};function Y(B,X){function P(){this.constructor=B}W(B,X),B.prototype=X===null?Object.create(X):(P.prototype=X.prototype,new P)}var et=function(){function B(X,P){this.uvBuffer=X,this.uvMatrix=P,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0}return B.prototype.update=function(X){if(X||this._bufferUpdateId!==this.uvBuffer._updateID||this._textureUpdateId!==this.uvMatrix._updateID){this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;var P=this.uvBuffer.data;this.data&&this.data.length===P.length||(this.data=new Float32Array(P.length)),this.uvMatrix.multiplyUvs(P,this.data),this._updateID++}},B}(),ft=new M.g,Dt=new M.h,At=function(B){function X(P,H,tt,G){G===void 0&&(G=I.f.TRIANGLES);var Ot=B.call(this)||this;return Ot.geometry=P,Ot.shader=H,Ot.state=tt||O.s.for2d(),Ot.drawMode=G,Ot.start=0,Ot.size=0,Ot.uvs=null,Ot.indices=null,Ot.vertexData=new Float32Array(1),Ot.vertexDirty=-1,Ot._transformID=-1,Ot._roundPixels=k.b.ROUND_PIXELS,Ot.batchUvs=null,Ot}return Y(X,B),Object.defineProperty(X.prototype,"geometry",{get:function(){return this._geometry},set:function(P){this._geometry!==P&&(this._geometry&&(this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose()),this._geometry=P,this._geometry&&this._geometry.refCount++,this.vertexDirty=-1)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"uvBuffer",{get:function(){return this.geometry.buffers[1]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"verticesBuffer",{get:function(){return this.geometry.buffers[0]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"material",{get:function(){return this.shader},set:function(P){this.shader=P},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(P){this.state.blendMode=P},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(P){this._roundPixels!==P&&(this._transformID=-1),this._roundPixels=P},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"tint",{get:function(){return"tint"in this.shader?this.shader.tint:null},set:function(P){this.shader.tint=P},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"texture",{get:function(){return"texture"in this.shader?this.shader.texture:null},set:function(P){this.shader.texture=P},enumerable:!1,configurable:!0}),X.prototype._render=function(P){var H=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===I.f.TRIANGLES&&H.length<2*X.BATCHABLE_SIZE?this._renderToBatch(P):this._renderDefault(P)},X.prototype._renderDefault=function(P){var H=this.shader;H.alpha=this.worldAlpha,H.update&&H.update(),P.batch.flush(),H.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0),P.shader.bind(H),P.state.set(this.state),P.geometry.bind(this.geometry,H),P.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)},X.prototype._renderToBatch=function(P){var H=this.geometry,tt=this.shader;tt.uvMatrix&&(tt.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=H.indexBuffer.data,this._tintRGB=tt._tintRGB,this._texture=tt.texture;var G=this.material.pluginName;P.batch.setObjectRenderer(P.plugins[G]),P.plugins[G].render(this)},X.prototype.calculateVertices=function(){var P=this.geometry.buffers[0],H=P.data,tt=P._updateID;if(tt!==this.vertexDirty||this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID,this.vertexData.length!==H.length&&(this.vertexData=new Float32Array(H.length));for(var G=this.transform.worldTransform,Ot=G.a,zt=G.b,st=G.c,V=G.d,U=G.tx,dt=G.ty,$=this.vertexData,vt=0;vt<$.length/2;vt++){var Lt=H[2*vt],K=H[2*vt+1];$[2*vt]=Ot*Lt+st*K+U,$[2*vt+1]=zt*Lt+V*K+dt}if(this._roundPixels){var ct=k.b.RESOLUTION;for(vt=0;vt<$.length;++vt)$[vt]=Math.round(($[vt]*ct|0)/ct)}this.vertexDirty=tt}},X.prototype.calculateUvs=function(){var P=this.geometry.buffers[1],H=this.shader;H.uvMatrix.isSimple?this.uvs=P.data:(this.batchUvs||(this.batchUvs=new et(P,H.uvMatrix)),this.batchUvs.update(),this.uvs=this.batchUvs.data)},X.prototype._calculateBounds=function(){this.calculateVertices(),this._bounds.addVertexData(this.vertexData,0,this.vertexData.length)},X.prototype.containsPoint=function(P){if(!this.getBounds().contains(P.x,P.y))return!1;this.worldTransform.applyInverse(P,ft);for(var H=this.geometry.getBuffer("aVertexPosition").data,tt=Dt.points,G=this.geometry.getIndex().data,Ot=G.length,zt=this.drawMode===4?3:1,st=0;st+2<Ot;st+=zt){var V=2*G[st],U=2*G[st+1],dt=2*G[st+2];if(tt[0]=H[V],tt[1]=H[V+1],tt[2]=H[U],tt[3]=H[U+1],tt[4]=H[dt],tt[5]=H[dt+1],Dt.contains(ft.x,ft.y))return!0}return!1},X.prototype.destroy=function(P){B.prototype.destroy.call(this,P),this._cachedTexture&&(this._cachedTexture.destroy(),this._cachedTexture=null),this.geometry=null,this.shader=null,this.state=null,this.uvs=null,this.indices=null,this.vertexData=null},X.BATCHABLE_SIZE=100,X}(D.b),L=function(B){function X(P,H){var tt=this,G={uSampler:P,alpha:1,uTextureMatrix:M.d.IDENTITY,uColor:new Float32Array([1,1,1,1])};return(H=Object.assign({tint:16777215,alpha:1,pluginName:"batch"},H)).uniforms&&Object.assign(G,H.uniforms),(tt=B.call(this,H.program||O.n.from(`attribute vec2 aVertexPosition;
|
|
534
|
+
*/M.b.TARGET_FPMS=.06,function(V){V[V.INTERACTION=50]="INTERACTION",V[V.HIGH=25]="HIGH",V[V.NORMAL=0]="NORMAL",V[V.LOW=-25]="LOW",V[V.UTILITY=-50]="UTILITY"}(O||(O={}));var I=function(){function V(W,X,et,ft){X===void 0&&(X=null),et===void 0&&(et=0),ft===void 0&&(ft=!1),this.next=null,this.previous=null,this._destroyed=!1,this.fn=W,this.context=X,this.priority=et,this.once=ft}return V.prototype.match=function(W,X){return X===void 0&&(X=null),this.fn===W&&this.context===X},V.prototype.emit=function(W){this.fn&&(this.context?this.fn.call(this.context,W):this.fn(W));var X=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),X},V.prototype.connect=function(W){this.previous=W,W.next&&(W.next.previous=this),this.next=W.next,W.next=this},V.prototype.destroy=function(W){W===void 0&&(W=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var X=this.next;return this.next=W?null:X,this.previous=null,X},V}(),D=function(){function V(){var W=this;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 I(null,null,1/0),this.deltaMS=1/M.b.TARGET_FPMS,this.elapsedMS=1/M.b.TARGET_FPMS,this._tick=function(X){W._requestId=null,W.started&&(W.update(X),W.started&&W._requestId===null&&W._head.next&&(W._requestId=requestAnimationFrame(W._tick)))}}return V.prototype._requestIfNeeded=function(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},V.prototype._cancelIfNeeded=function(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)},V.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},V.prototype.add=function(W,X,et){return et===void 0&&(et=O.NORMAL),this._addListener(new I(W,X,et))},V.prototype.addOnce=function(W,X,et){return et===void 0&&(et=O.NORMAL),this._addListener(new I(W,X,et,!0))},V.prototype._addListener=function(W){var X=this._head.next,et=this._head;if(X){for(;X;){if(W.priority>X.priority){W.connect(et);break}et=X,X=X.next}W.previous||W.connect(et)}else W.connect(et);return this._startIfPossible(),this},V.prototype.remove=function(W,X){for(var et=this._head.next;et;)et=et.match(W,X)?et.destroy():et.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(V.prototype,"count",{get:function(){if(!this._head)return 0;for(var W=0,X=this._head;X=X.next;)W++;return W},enumerable:!1,configurable:!0}),V.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},V.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},V.prototype.destroy=function(){if(!this._protected){this.stop();for(var W=this._head.next;W;)W=W.destroy(!0);this._head.destroy(),this._head=null}},V.prototype.update=function(W){var X;if(W===void 0&&(W=performance.now()),W>this.lastTime){if((X=this.elapsedMS=W-this.lastTime)>this._maxElapsedMS&&(X=this._maxElapsedMS),X*=this.speed,this._minElapsedMS){var et=W-this._lastFrame|0;if(et<this._minElapsedMS)return;this._lastFrame=W-et%this._minElapsedMS}this.deltaMS=X,this.deltaTime=this.deltaMS*M.b.TARGET_FPMS;for(var ft=this._head,Dt=ft.next;Dt;)Dt=Dt.emit(this.deltaTime);ft.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=W},Object.defineProperty(V.prototype,"FPS",{get:function(){return 1e3/this.elapsedMS},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"minFPS",{get:function(){return 1e3/this._maxElapsedMS},set:function(W){var X=Math.min(this.maxFPS,W),et=Math.min(Math.max(0,X)/1e3,M.b.TARGET_FPMS);this._maxElapsedMS=1/et},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"maxFPS",{get:function(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0},set:function(W){if(W===0)this._minElapsedMS=0;else{var X=Math.max(this.minFPS,W);this._minElapsedMS=1/(X/1e3)}},enumerable:!1,configurable:!0}),Object.defineProperty(V,"shared",{get:function(){if(!V._shared){var W=V._shared=new V;W.autoStart=!0,W._protected=!0}return V._shared},enumerable:!1,configurable:!0}),Object.defineProperty(V,"system",{get:function(){if(!V._system){var W=V._system=new V;W.autoStart=!0,W._protected=!0}return V._system},enumerable:!1,configurable:!0}),V}(),k=function(){function V(){}return V.init=function(W){var X=this;W=Object.assign({autoStart:!0,sharedTicker:!1},W),Object.defineProperty(this,"ticker",{set:function(et){this._ticker&&this._ticker.remove(this.render,this),this._ticker=et,et&&et.add(this.render,this,O.LOW)},get:function(){return this._ticker}}),this.stop=function(){X._ticker.stop()},this.start=function(){X._ticker.start()},this._ticker=null,this.ticker=W.sharedTicker?D.shared:new D,W.autoStart&&this.start()},V.destroy=function(){if(this._ticker){var W=this._ticker;this.ticker=null,W.destroy()}},V}()},function(b,w,v){v.d(w,"a",function(){return At}),v.d(w,"b",function(){return R}),v.d(w,"c",function(){return L});var O=v(2),M=v(1),I=v(0),D=v(5),k=v(4),V=v(3),W=function(B,Y){return(W=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(P,H){P.__proto__=H}||function(P,H){for(var tt in H)H.hasOwnProperty(tt)&&(P[tt]=H[tt])})(B,Y)};function X(B,Y){function P(){this.constructor=B}W(B,Y),B.prototype=Y===null?Object.create(Y):(P.prototype=Y.prototype,new P)}var et=function(){function B(Y,P){this.uvBuffer=Y,this.uvMatrix=P,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0}return B.prototype.update=function(Y){if(Y||this._bufferUpdateId!==this.uvBuffer._updateID||this._textureUpdateId!==this.uvMatrix._updateID){this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;var P=this.uvBuffer.data;this.data&&this.data.length===P.length||(this.data=new Float32Array(P.length)),this.uvMatrix.multiplyUvs(P,this.data),this._updateID++}},B}(),ft=new M.g,Dt=new M.h,At=function(B){function Y(P,H,tt,G){G===void 0&&(G=I.f.TRIANGLES);var Ot=B.call(this)||this;return Ot.geometry=P,Ot.shader=H,Ot.state=tt||O.s.for2d(),Ot.drawMode=G,Ot.start=0,Ot.size=0,Ot.uvs=null,Ot.indices=null,Ot.vertexData=new Float32Array(1),Ot.vertexDirty=-1,Ot._transformID=-1,Ot._roundPixels=k.b.ROUND_PIXELS,Ot.batchUvs=null,Ot}return X(Y,B),Object.defineProperty(Y.prototype,"geometry",{get:function(){return this._geometry},set:function(P){this._geometry!==P&&(this._geometry&&(this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose()),this._geometry=P,this._geometry&&this._geometry.refCount++,this.vertexDirty=-1)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"uvBuffer",{get:function(){return this.geometry.buffers[1]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"verticesBuffer",{get:function(){return this.geometry.buffers[0]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"material",{get:function(){return this.shader},set:function(P){this.shader=P},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(P){this.state.blendMode=P},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(P){this._roundPixels!==P&&(this._transformID=-1),this._roundPixels=P},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"tint",{get:function(){return"tint"in this.shader?this.shader.tint:null},set:function(P){this.shader.tint=P},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"texture",{get:function(){return"texture"in this.shader?this.shader.texture:null},set:function(P){this.shader.texture=P},enumerable:!1,configurable:!0}),Y.prototype._render=function(P){var H=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===I.f.TRIANGLES&&H.length<2*Y.BATCHABLE_SIZE?this._renderToBatch(P):this._renderDefault(P)},Y.prototype._renderDefault=function(P){var H=this.shader;H.alpha=this.worldAlpha,H.update&&H.update(),P.batch.flush(),H.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0),P.shader.bind(H),P.state.set(this.state),P.geometry.bind(this.geometry,H),P.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)},Y.prototype._renderToBatch=function(P){var H=this.geometry,tt=this.shader;tt.uvMatrix&&(tt.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=H.indexBuffer.data,this._tintRGB=tt._tintRGB,this._texture=tt.texture;var G=this.material.pluginName;P.batch.setObjectRenderer(P.plugins[G]),P.plugins[G].render(this)},Y.prototype.calculateVertices=function(){var P=this.geometry.buffers[0],H=P.data,tt=P._updateID;if(tt!==this.vertexDirty||this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID,this.vertexData.length!==H.length&&(this.vertexData=new Float32Array(H.length));for(var G=this.transform.worldTransform,Ot=G.a,zt=G.b,st=G.c,z=G.d,U=G.tx,dt=G.ty,$=this.vertexData,vt=0;vt<$.length/2;vt++){var Lt=H[2*vt],K=H[2*vt+1];$[2*vt]=Ot*Lt+st*K+U,$[2*vt+1]=zt*Lt+z*K+dt}if(this._roundPixels){var ct=k.b.RESOLUTION;for(vt=0;vt<$.length;++vt)$[vt]=Math.round(($[vt]*ct|0)/ct)}this.vertexDirty=tt}},Y.prototype.calculateUvs=function(){var P=this.geometry.buffers[1],H=this.shader;H.uvMatrix.isSimple?this.uvs=P.data:(this.batchUvs||(this.batchUvs=new et(P,H.uvMatrix)),this.batchUvs.update(),this.uvs=this.batchUvs.data)},Y.prototype._calculateBounds=function(){this.calculateVertices(),this._bounds.addVertexData(this.vertexData,0,this.vertexData.length)},Y.prototype.containsPoint=function(P){if(!this.getBounds().contains(P.x,P.y))return!1;this.worldTransform.applyInverse(P,ft);for(var H=this.geometry.getBuffer("aVertexPosition").data,tt=Dt.points,G=this.geometry.getIndex().data,Ot=G.length,zt=this.drawMode===4?3:1,st=0;st+2<Ot;st+=zt){var z=2*G[st],U=2*G[st+1],dt=2*G[st+2];if(tt[0]=H[z],tt[1]=H[z+1],tt[2]=H[U],tt[3]=H[U+1],tt[4]=H[dt],tt[5]=H[dt+1],Dt.contains(ft.x,ft.y))return!0}return!1},Y.prototype.destroy=function(P){B.prototype.destroy.call(this,P),this._cachedTexture&&(this._cachedTexture.destroy(),this._cachedTexture=null),this.geometry=null,this.shader=null,this.state=null,this.uvs=null,this.indices=null,this.vertexData=null},Y.BATCHABLE_SIZE=100,Y}(D.b),L=function(B){function Y(P,H){var tt=this,G={uSampler:P,alpha:1,uTextureMatrix:M.d.IDENTITY,uColor:new Float32Array([1,1,1,1])};return(H=Object.assign({tint:16777215,alpha:1,pluginName:"batch"},H)).uniforms&&Object.assign(G,H.uniforms),(tt=B.call(this,H.program||O.n.from(`attribute vec2 aVertexPosition;
|
|
535
535
|
attribute vec2 aTextureCoord;
|
|
536
536
|
|
|
537
537
|
uniform mat3 projectionMatrix;
|
|
@@ -555,7 +555,7 @@ void main(void)
|
|
|
555
555
|
{
|
|
556
556
|
gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;
|
|
557
557
|
}
|
|
558
|
-
`),G)||this)._colorDirty=!1,tt.uvMatrix=new O.u(P),tt.batchable=H.program===void 0,tt.pluginName=H.pluginName,tt.tint=H.tint,tt.alpha=H.alpha,tt}return Y
|
|
558
|
+
`),G)||this)._colorDirty=!1,tt.uvMatrix=new O.u(P),tt.batchable=H.program===void 0,tt.pluginName=H.pluginName,tt.tint=H.tint,tt.alpha=H.alpha,tt}return X(Y,B),Object.defineProperty(Y.prototype,"texture",{get:function(){return this.uniforms.uSampler},set:function(P){this.uniforms.uSampler!==P&&(!this.uniforms.uSampler.baseTexture.alphaMode!=!P.baseTexture.alphaMode&&(this._colorDirty=!0),this.uniforms.uSampler=P,this.uvMatrix.texture=P)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"alpha",{get:function(){return this._alpha},set:function(P){P!==this._alpha&&(this._alpha=P,this._colorDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"tint",{get:function(){return this._tint},set:function(P){P!==this._tint&&(this._tint=P,this._tintRGB=(P>>16)+(65280&P)+((255&P)<<16),this._colorDirty=!0)},enumerable:!1,configurable:!0}),Y.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var P=this.texture.baseTexture;Object(V.premultiplyTintToRgba)(this._tint,this._alpha,this.uniforms.uColor,P.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},Y}(O.r),R=function(B){function Y(P,H,tt){var G=B.call(this)||this,Ot=new O.h(P),zt=new O.h(H,!0),st=new O.h(tt,!0,!0);return G.addAttribute("aVertexPosition",Ot,2,!1,I.r.FLOAT).addAttribute("aTextureCoord",zt,2,!1,I.r.FLOAT).addIndex(st),G._updateId=-1,G}return X(Y,B),Object.defineProperty(Y.prototype,"vertexDirtyId",{get:function(){return this.buffers[0]._updateID},enumerable:!1,configurable:!0}),Y}(O.l)},function(b,w){b.exports=`precision mediump float;
|
|
559
559
|
attribute vec2 aVertexPosition;
|
|
560
560
|
uniform mat3 projectionMatrix;
|
|
561
561
|
varying vec2 vTextureCoord;
|
|
@@ -574,13 +574,13 @@ void main() {
|
|
|
574
574
|
vTextureCoord = filterTextureCoord();
|
|
575
575
|
filterCoord = aVertexPosition * outputFrame.zw;
|
|
576
576
|
}
|
|
577
|
-
`},function(b,w,v){v.d(w,"a",function(){return Dt}),v.d(w,"b",function(){return At});var O=v(2),M=v(3),I=v(1),D=v(0),k=v(4),z=function(R,B){return(z=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(X,P){X.__proto__=P}||function(X,P){for(var H in P)P.hasOwnProperty(H)&&(X[H]=P[H])})(R,B)},W=function(){function R(B){this._foundShapes=[],this.renderer=B}return R.prototype.pushMask=function(B){var X=this.renderer,P=B.maskObject||B;X.context.save();var H=this._foundShapes;if(this.recursiveFindShapes(P,H),H.length>0){var tt=X.context;tt.beginPath();for(var G=0;G<H.length;G++){var Ot=H[G],zt=Ot.transform.worldTransform;this.renderer.setContextTransform(zt),this.renderGraphicsShape(Ot)}H.length=0,tt.clip()}},R.prototype.recursiveFindShapes=function(B,X){B.geometry&&B.geometry.graphicsData&&X.push(B);var P=B.children;if(P)for(var H=0;H<P.length;H++)this.recursiveFindShapes(P[H],X)},R.prototype.renderGraphicsShape=function(B){B.finishPoly();var X=this.renderer.context,P=B.geometry.graphicsData,H=P.length;if(H!==0)for(var tt=0;tt<H;tt++){var G=P[tt],Ot=G.shape;if(Ot.type===I.l.POLY){var zt=Ot.points,st=G.holes,V=void 0,U=void 0,dt=void 0,$=void 0;X.moveTo(zt[0],zt[1]);for(var vt=1;vt<zt.length/2;vt++)X.lineTo(zt[2*vt],zt[2*vt+1]);if(st.length>0){for(V=0,dt=zt[0],$=zt[1],vt=2;vt+2<zt.length;vt+=2)V+=(zt[vt]-dt)*(zt[vt+3]-$)-(zt[vt+2]-dt)*(zt[vt+1]-$);for(var Lt=0;Lt<st.length;Lt++)if(zt=st[Lt].shape.points){for(U=0,dt=zt[0],$=zt[1],vt=2;vt+2<zt.length;vt+=2)U+=(zt[vt]-dt)*(zt[vt+3]-$)-(zt[vt+2]-dt)*(zt[vt+1]-$);if(U*V<0)for(X.moveTo(zt[0],zt[1]),vt=2;vt<zt.length;vt+=2)X.lineTo(zt[vt],zt[vt+1]);else for(X.moveTo(zt[zt.length-2],zt[zt.length-1]),vt=zt.length-4;vt>=0;vt-=2)X.lineTo(zt[vt],zt[vt+1]);st[Lt].shape.closeStroke&&X.closePath()}}zt[0]===zt[zt.length-2]&&zt[1]===zt[zt.length-1]&&X.closePath()}else if(Ot.type===I.l.RECT)X.rect(Ot.x,Ot.y,Ot.width,Ot.height),X.closePath();else if(Ot.type===I.l.CIRC)X.arc(Ot.x,Ot.y,Ot.radius,0,2*Math.PI),X.closePath();else if(Ot.type===I.l.ELIP){var K=2*Ot.width,ct=2*Ot.height,nt=Ot.x-K/2,_t=Ot.y-ct/2,St=K/2*.5522848,kt=ct/2*.5522848,Xt=nt+K,Jt=_t+ct,at=nt+K/2,_e=_t+ct/2;X.moveTo(nt,_e),X.bezierCurveTo(nt,_e-kt,at-St,_t,at,_t),X.bezierCurveTo(at+St,_t,Xt,_e-kt,Xt,_e),X.bezierCurveTo(Xt,_e+kt,at+St,Jt,at,Jt),X.bezierCurveTo(at-St,Jt,nt,_e+kt,nt,_e),X.closePath()}else if(Ot.type===I.l.RREC){var Ue=Ot.x,Oe=Ot.y,Ae=Ot.width,ze=Ot.height,$e=Ot.radius,cn=Math.min(Ae,ze)/2;$e=$e>cn?cn:$e,X.moveTo(Ue,Oe+$e),X.lineTo(Ue,Oe+ze-$e),X.quadraticCurveTo(Ue,Oe+ze,Ue+$e,Oe+ze),X.lineTo(Ue+Ae-$e,Oe+ze),X.quadraticCurveTo(Ue+Ae,Oe+ze,Ue+Ae,Oe+ze-$e),X.lineTo(Ue+Ae,Oe+$e),X.quadraticCurveTo(Ue+Ae,Oe,Ue+Ae-$e,Oe),X.lineTo(Ue+$e,Oe),X.quadraticCurveTo(Ue,Oe,Ue,Oe+$e),X.closePath()}}},R.prototype.popMask=function(B){B.context.restore(),B.invalidateBlendMode()},R.prototype.destroy=function(){},R}();function Y(R){var B=document.createElement("canvas");B.width=6,B.height=1;var X=B.getContext("2d");return X.fillStyle=R,X.fillRect(0,0,6,1),B}function et(){if(typeof document=="undefined")return!1;var R=Y("#ff00ff"),B=Y("#ffff00"),X=document.createElement("canvas");X.width=6,X.height=1;var P=X.getContext("2d");P.globalCompositeOperation="multiply",P.drawImage(R,0,0),P.drawImage(B,2,0);var H=P.getImageData(2,0,1,1);if(!H)return!1;var tt=H.data;return tt[0]===255&&tt[1]===0&&tt[2]===0}var ft=new I.d,Dt=function(R){function B(X){var P,H=R.call(this,D.n.CANVAS,X)||this;if(H.refresh=!0,H.maskManager=new W(H),H.smoothProperty="imageSmoothingEnabled",H.blendModes=(P===void 0&&(P=[]),et()?(P[D.b.NORMAL]="source-over",P[D.b.ADD]="lighter",P[D.b.MULTIPLY]="multiply",P[D.b.SCREEN]="screen",P[D.b.OVERLAY]="overlay",P[D.b.DARKEN]="darken",P[D.b.LIGHTEN]="lighten",P[D.b.COLOR_DODGE]="color-dodge",P[D.b.COLOR_BURN]="color-burn",P[D.b.HARD_LIGHT]="hard-light",P[D.b.SOFT_LIGHT]="soft-light",P[D.b.DIFFERENCE]="difference",P[D.b.EXCLUSION]="exclusion",P[D.b.HUE]="hue",P[D.b.SATURATION]="saturate",P[D.b.COLOR]="color",P[D.b.LUMINOSITY]="luminosity"):(P[D.b.NORMAL]="source-over",P[D.b.ADD]="lighter",P[D.b.MULTIPLY]="source-over",P[D.b.SCREEN]="source-over",P[D.b.OVERLAY]="source-over",P[D.b.DARKEN]="source-over",P[D.b.LIGHTEN]="source-over",P[D.b.COLOR_DODGE]="source-over",P[D.b.COLOR_BURN]="source-over",P[D.b.HARD_LIGHT]="source-over",P[D.b.SOFT_LIGHT]="source-over",P[D.b.DIFFERENCE]="source-over",P[D.b.EXCLUSION]="source-over",P[D.b.HUE]="source-over",P[D.b.SATURATION]="source-over",P[D.b.COLOR]="source-over",P[D.b.LUMINOSITY]="source-over"),P[D.b.NORMAL_NPM]=P[D.b.NORMAL],P[D.b.ADD_NPM]=P[D.b.ADD],P[D.b.SCREEN_NPM]=P[D.b.SCREEN],P[D.b.SRC_IN]="source-in",P[D.b.SRC_OUT]="source-out",P[D.b.SRC_ATOP]="source-atop",P[D.b.DST_OVER]="destination-over",P[D.b.DST_IN]="destination-in",P[D.b.DST_OUT]="destination-out",P[D.b.DST_ATOP]="destination-atop",P[D.b.XOR]="xor",P[D.b.SUBTRACT]="source-over",P),H.renderingToScreen=!1,H._activeBlendMode=null,H._projTransform=null,H._outerBlend=!1,H.rootContext=H.view.getContext("2d",{alpha:H.useContextAlpha}),H.context=H.rootContext,!H.rootContext.imageSmoothingEnabled){var tt=H.rootContext;tt.webkitImageSmoothingEnabled?H.smoothProperty="webkitImageSmoothingEnabled":tt.mozImageSmoothingEnabled?H.smoothProperty="mozImageSmoothingEnabled":tt.oImageSmoothingEnabled?H.smoothProperty="oImageSmoothingEnabled":tt.msImageSmoothingEnabled&&(H.smoothProperty="msImageSmoothingEnabled")}return H.initPlugins(B.__plugins),Object(M.sayHello)("Canvas"),H.resize(H.options.width,H.options.height),H}return function(X,P){function H(){this.constructor=X}z(X,P),X.prototype=P===null?Object.create(P):(H.prototype=P.prototype,new H)}(B,R),B.prototype.addSystem=function(){return this},B.prototype.render=function(X,P){if(this.view){var H,tt,G,Ot;P&&(P instanceof O.p||P instanceof O.b?(Object(M.deprecation)("6.0.0","CanvasRenderer#render arguments changed, use options instead."),H=P,tt=arguments[2],G=arguments[3],Ot=arguments[4]):(H=P.renderTexture,tt=P.clear,G=P.transform,Ot=P.skipUpdateTransform)),this.renderingToScreen=!H,this.emit("prerender");var zt=this.resolution;H?((H=H.castToBaseTexture())._canvasRenderTarget||(H._canvasRenderTarget=new M.CanvasRenderTarget(H.width,H.height,H.resolution),H.resource=new O.j(H._canvasRenderTarget.canvas),H.valid=!0),this.context=H._canvasRenderTarget.context,this.resolution=H._canvasRenderTarget.resolution):this.context=this.rootContext;var st=this.context;if(this._projTransform=G||null,H||(this._lastObjectRendered=X),!Ot){var V=X.enableTempParent();X.updateTransform(),X.disableTempParent(V)}if(st.save(),st.setTransform(1,0,0,1,0,0),st.globalAlpha=1,this._activeBlendMode=D.b.NORMAL,this._outerBlend=!1,st.globalCompositeOperation=this.blendModes[D.b.NORMAL],tt!==void 0?tt:this.clearBeforeRender)if(this.renderingToScreen)st.clearRect(0,0,this.width,this.height),this.backgroundAlpha>0&&(st.globalAlpha=this.useContextAlpha?this.backgroundAlpha:1,st.fillStyle=this._backgroundColorString,st.fillRect(0,0,this.width,this.height),st.globalAlpha=1);else{(H=H)._canvasRenderTarget.clear();var U=H.clearColor;U[3]>0&&(st.globalAlpha=this.useContextAlpha?U[3]:1,st.fillStyle=Object(M.hex2string)(Object(M.rgb2hex)(U)),st.fillRect(0,0,H.realWidth,H.realHeight),st.globalAlpha=1)}var dt=this.context;this.context=st,X.renderCanvas(this),this.context=dt,st.restore(),this.resolution=zt,this._projTransform=null,this.emit("postrender")}},B.prototype.setContextTransform=function(X,P,H){var tt=X,G=this._projTransform,Ot=this.resolution;H=H||Ot,G&&((tt=ft).copyFrom(X),tt.prepend(G)),P?this.context.setTransform(tt.a*H,tt.b*H,tt.c*H,tt.d*H,tt.tx*Ot|0,tt.ty*Ot|0):this.context.setTransform(tt.a*H,tt.b*H,tt.c*H,tt.d*H,tt.tx*Ot,tt.ty*Ot)},B.prototype.clear=function(X,P){X===void 0&&(X=this._backgroundColorString),P===void 0&&(P=this.backgroundAlpha);var H=this.context;H.clearRect(0,0,this.width,this.height),X&&(H.globalAlpha=this.useContextAlpha?P:1,H.fillStyle=X,H.fillRect(0,0,this.width,this.height),H.globalAlpha=1)},B.prototype.setBlendMode=function(X,P){var H=X===D.b.SRC_IN||X===D.b.SRC_OUT||X===D.b.DST_IN||X===D.b.DST_ATOP;!P&&H&&(X=D.b.NORMAL),this._activeBlendMode!==X&&(this._activeBlendMode=X,this._outerBlend=H,this.context.globalCompositeOperation=this.blendModes[X])},B.prototype.destroy=function(X){R.prototype.destroy.call(this,X),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},B.prototype.resize=function(X,P){R.prototype.resize.call(this,X,P),this.smoothProperty&&(this.rootContext[this.smoothProperty]=k.b.SCALE_MODE===D.p.LINEAR)},B.prototype.invalidateBlendMode=function(){this._activeBlendMode=this.blendModes.indexOf(this.context.globalCompositeOperation)},B.registerPlugin=function(X,P){B.__plugins=B.__plugins||{},B.__plugins[X]=P},B}(O.a),At={canvas:null,getTintedCanvas:function(R,B){var X=R.texture,P="#"+("00000"+(0|(B=At.roundColor(B))).toString(16)).slice(-6);X.tintCache=X.tintCache||{};var H,tt=X.tintCache[P];if(tt){if(tt.tintId===X._updateID)return X.tintCache[P];H=X.tintCache[P]}else H=document.createElement("canvas");if(At.tintMethod(X,B,H),H.tintId=X._updateID,At.convertTintToImage){var G=new Image;G.src=H.toDataURL(),X.tintCache[P]=G}else X.tintCache[P]=H;return H},getTintedPattern:function(R,B){var X="#"+("00000"+(0|(B=At.roundColor(B))).toString(16)).slice(-6);R.patternCache=R.patternCache||{};var P=R.patternCache[X];return P&&P.tintId===R._updateID||(At.canvas||(At.canvas=document.createElement("canvas")),At.tintMethod(R,B,At.canvas),(P=At.canvas.getContext("2d").createPattern(At.canvas,"repeat")).tintId=R._updateID,R.patternCache[X]=P),P},tintWithMultiply:function(R,B,X){var P=X.getContext("2d"),H=R._frame.clone(),tt=R.baseTexture.resolution;H.x*=tt,H.y*=tt,H.width*=tt,H.height*=tt,X.width=Math.ceil(H.width),X.height=Math.ceil(H.height),P.save(),P.fillStyle="#"+("00000"+(0|B).toString(16)).slice(-6),P.fillRect(0,0,H.width,H.height),P.globalCompositeOperation="multiply";var G=R.baseTexture.getDrawableSource();P.drawImage(G,H.x,H.y,H.width,H.height,0,0,H.width,H.height),P.globalCompositeOperation="destination-atop",P.drawImage(G,H.x,H.y,H.width,H.height,0,0,H.width,H.height),P.restore()},tintWithOverlay:function(R,B,X){var P=X.getContext("2d"),H=R._frame.clone(),tt=R.baseTexture.resolution;H.x*=tt,H.y*=tt,H.width*=tt,H.height*=tt,X.width=Math.ceil(H.width),X.height=Math.ceil(H.height),P.save(),P.globalCompositeOperation="copy",P.fillStyle="#"+("00000"+(0|B).toString(16)).slice(-6),P.fillRect(0,0,H.width,H.height),P.globalCompositeOperation="destination-atop",P.drawImage(R.baseTexture.getDrawableSource(),H.x,H.y,H.width,H.height,0,0,H.width,H.height),P.restore()},tintWithPerPixel:function(R,B,X){var P=X.getContext("2d"),H=R._frame.clone(),tt=R.baseTexture.resolution;H.x*=tt,H.y*=tt,H.width*=tt,H.height*=tt,X.width=Math.ceil(H.width),X.height=Math.ceil(H.height),P.save(),P.globalCompositeOperation="copy",P.drawImage(R.baseTexture.getDrawableSource(),H.x,H.y,H.width,H.height,0,0,H.width,H.height),P.restore();for(var G=Object(M.hex2rgb)(B),Ot=G[0],zt=G[1],st=G[2],V=P.getImageData(0,0,H.width,H.height),U=V.data,dt=0;dt<U.length;dt+=4)U[dt+0]*=Ot,U[dt+1]*=zt,U[dt+2]*=st;P.putImageData(V,0,0)},roundColor:function(R){var B=At.cacheStepsPerColorChannel,X=Object(M.hex2rgb)(R);return X[0]=Math.min(255,X[0]/B*B),X[1]=Math.min(255,X[1]/B*B),X[2]=Math.min(255,X[2]/B*B),Object(M.rgb2hex)(X)},cacheStepsPerColorChannel:8,convertTintToImage:!1,canUseMultiply:et(),tintMethod:null};At.tintMethod=At.canUseMultiply?At.tintWithMultiply:At.tintWithPerPixel;var L=O.q.create;O.q.create=function(R){if(!(R&&R.forceCanvas))try{return L(R)}catch{}return new Dt(R)},O.c.prototype.getDrawableSource=function(){var R=this.resource;return R?R.bitmap||R.source:null},O.b.prototype._canvasRenderTarget=null,O.t.prototype.patternCache=null,O.t.prototype.tintCache=null},function(b,w){b.exports=function(v){return v===void 0}},function(b,w,v){v.d(w,"a",function(){return O});/*!
|
|
577
|
+
`},function(b,w,v){v.d(w,"a",function(){return Dt}),v.d(w,"b",function(){return At});var O=v(2),M=v(3),I=v(1),D=v(0),k=v(4),V=function(R,B){return(V=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Y,P){Y.__proto__=P}||function(Y,P){for(var H in P)P.hasOwnProperty(H)&&(Y[H]=P[H])})(R,B)},W=function(){function R(B){this._foundShapes=[],this.renderer=B}return R.prototype.pushMask=function(B){var Y=this.renderer,P=B.maskObject||B;Y.context.save();var H=this._foundShapes;if(this.recursiveFindShapes(P,H),H.length>0){var tt=Y.context;tt.beginPath();for(var G=0;G<H.length;G++){var Ot=H[G],zt=Ot.transform.worldTransform;this.renderer.setContextTransform(zt),this.renderGraphicsShape(Ot)}H.length=0,tt.clip()}},R.prototype.recursiveFindShapes=function(B,Y){B.geometry&&B.geometry.graphicsData&&Y.push(B);var P=B.children;if(P)for(var H=0;H<P.length;H++)this.recursiveFindShapes(P[H],Y)},R.prototype.renderGraphicsShape=function(B){B.finishPoly();var Y=this.renderer.context,P=B.geometry.graphicsData,H=P.length;if(H!==0)for(var tt=0;tt<H;tt++){var G=P[tt],Ot=G.shape;if(Ot.type===I.l.POLY){var zt=Ot.points,st=G.holes,z=void 0,U=void 0,dt=void 0,$=void 0;Y.moveTo(zt[0],zt[1]);for(var vt=1;vt<zt.length/2;vt++)Y.lineTo(zt[2*vt],zt[2*vt+1]);if(st.length>0){for(z=0,dt=zt[0],$=zt[1],vt=2;vt+2<zt.length;vt+=2)z+=(zt[vt]-dt)*(zt[vt+3]-$)-(zt[vt+2]-dt)*(zt[vt+1]-$);for(var Lt=0;Lt<st.length;Lt++)if(zt=st[Lt].shape.points){for(U=0,dt=zt[0],$=zt[1],vt=2;vt+2<zt.length;vt+=2)U+=(zt[vt]-dt)*(zt[vt+3]-$)-(zt[vt+2]-dt)*(zt[vt+1]-$);if(U*z<0)for(Y.moveTo(zt[0],zt[1]),vt=2;vt<zt.length;vt+=2)Y.lineTo(zt[vt],zt[vt+1]);else for(Y.moveTo(zt[zt.length-2],zt[zt.length-1]),vt=zt.length-4;vt>=0;vt-=2)Y.lineTo(zt[vt],zt[vt+1]);st[Lt].shape.closeStroke&&Y.closePath()}}zt[0]===zt[zt.length-2]&&zt[1]===zt[zt.length-1]&&Y.closePath()}else if(Ot.type===I.l.RECT)Y.rect(Ot.x,Ot.y,Ot.width,Ot.height),Y.closePath();else if(Ot.type===I.l.CIRC)Y.arc(Ot.x,Ot.y,Ot.radius,0,2*Math.PI),Y.closePath();else if(Ot.type===I.l.ELIP){var K=2*Ot.width,ct=2*Ot.height,nt=Ot.x-K/2,_t=Ot.y-ct/2,St=K/2*.5522848,kt=ct/2*.5522848,Xt=nt+K,Jt=_t+ct,at=nt+K/2,_e=_t+ct/2;Y.moveTo(nt,_e),Y.bezierCurveTo(nt,_e-kt,at-St,_t,at,_t),Y.bezierCurveTo(at+St,_t,Xt,_e-kt,Xt,_e),Y.bezierCurveTo(Xt,_e+kt,at+St,Jt,at,Jt),Y.bezierCurveTo(at-St,Jt,nt,_e+kt,nt,_e),Y.closePath()}else if(Ot.type===I.l.RREC){var Ue=Ot.x,Oe=Ot.y,Ae=Ot.width,ze=Ot.height,$e=Ot.radius,cn=Math.min(Ae,ze)/2;$e=$e>cn?cn:$e,Y.moveTo(Ue,Oe+$e),Y.lineTo(Ue,Oe+ze-$e),Y.quadraticCurveTo(Ue,Oe+ze,Ue+$e,Oe+ze),Y.lineTo(Ue+Ae-$e,Oe+ze),Y.quadraticCurveTo(Ue+Ae,Oe+ze,Ue+Ae,Oe+ze-$e),Y.lineTo(Ue+Ae,Oe+$e),Y.quadraticCurveTo(Ue+Ae,Oe,Ue+Ae-$e,Oe),Y.lineTo(Ue+$e,Oe),Y.quadraticCurveTo(Ue,Oe,Ue,Oe+$e),Y.closePath()}}},R.prototype.popMask=function(B){B.context.restore(),B.invalidateBlendMode()},R.prototype.destroy=function(){},R}();function X(R){var B=document.createElement("canvas");B.width=6,B.height=1;var Y=B.getContext("2d");return Y.fillStyle=R,Y.fillRect(0,0,6,1),B}function et(){if(typeof document=="undefined")return!1;var R=X("#ff00ff"),B=X("#ffff00"),Y=document.createElement("canvas");Y.width=6,Y.height=1;var P=Y.getContext("2d");P.globalCompositeOperation="multiply",P.drawImage(R,0,0),P.drawImage(B,2,0);var H=P.getImageData(2,0,1,1);if(!H)return!1;var tt=H.data;return tt[0]===255&&tt[1]===0&&tt[2]===0}var ft=new I.d,Dt=function(R){function B(Y){var P,H=R.call(this,D.n.CANVAS,Y)||this;if(H.refresh=!0,H.maskManager=new W(H),H.smoothProperty="imageSmoothingEnabled",H.blendModes=(P===void 0&&(P=[]),et()?(P[D.b.NORMAL]="source-over",P[D.b.ADD]="lighter",P[D.b.MULTIPLY]="multiply",P[D.b.SCREEN]="screen",P[D.b.OVERLAY]="overlay",P[D.b.DARKEN]="darken",P[D.b.LIGHTEN]="lighten",P[D.b.COLOR_DODGE]="color-dodge",P[D.b.COLOR_BURN]="color-burn",P[D.b.HARD_LIGHT]="hard-light",P[D.b.SOFT_LIGHT]="soft-light",P[D.b.DIFFERENCE]="difference",P[D.b.EXCLUSION]="exclusion",P[D.b.HUE]="hue",P[D.b.SATURATION]="saturate",P[D.b.COLOR]="color",P[D.b.LUMINOSITY]="luminosity"):(P[D.b.NORMAL]="source-over",P[D.b.ADD]="lighter",P[D.b.MULTIPLY]="source-over",P[D.b.SCREEN]="source-over",P[D.b.OVERLAY]="source-over",P[D.b.DARKEN]="source-over",P[D.b.LIGHTEN]="source-over",P[D.b.COLOR_DODGE]="source-over",P[D.b.COLOR_BURN]="source-over",P[D.b.HARD_LIGHT]="source-over",P[D.b.SOFT_LIGHT]="source-over",P[D.b.DIFFERENCE]="source-over",P[D.b.EXCLUSION]="source-over",P[D.b.HUE]="source-over",P[D.b.SATURATION]="source-over",P[D.b.COLOR]="source-over",P[D.b.LUMINOSITY]="source-over"),P[D.b.NORMAL_NPM]=P[D.b.NORMAL],P[D.b.ADD_NPM]=P[D.b.ADD],P[D.b.SCREEN_NPM]=P[D.b.SCREEN],P[D.b.SRC_IN]="source-in",P[D.b.SRC_OUT]="source-out",P[D.b.SRC_ATOP]="source-atop",P[D.b.DST_OVER]="destination-over",P[D.b.DST_IN]="destination-in",P[D.b.DST_OUT]="destination-out",P[D.b.DST_ATOP]="destination-atop",P[D.b.XOR]="xor",P[D.b.SUBTRACT]="source-over",P),H.renderingToScreen=!1,H._activeBlendMode=null,H._projTransform=null,H._outerBlend=!1,H.rootContext=H.view.getContext("2d",{alpha:H.useContextAlpha}),H.context=H.rootContext,!H.rootContext.imageSmoothingEnabled){var tt=H.rootContext;tt.webkitImageSmoothingEnabled?H.smoothProperty="webkitImageSmoothingEnabled":tt.mozImageSmoothingEnabled?H.smoothProperty="mozImageSmoothingEnabled":tt.oImageSmoothingEnabled?H.smoothProperty="oImageSmoothingEnabled":tt.msImageSmoothingEnabled&&(H.smoothProperty="msImageSmoothingEnabled")}return H.initPlugins(B.__plugins),Object(M.sayHello)("Canvas"),H.resize(H.options.width,H.options.height),H}return function(Y,P){function H(){this.constructor=Y}V(Y,P),Y.prototype=P===null?Object.create(P):(H.prototype=P.prototype,new H)}(B,R),B.prototype.addSystem=function(){return this},B.prototype.render=function(Y,P){if(this.view){var H,tt,G,Ot;P&&(P instanceof O.p||P instanceof O.b?(Object(M.deprecation)("6.0.0","CanvasRenderer#render arguments changed, use options instead."),H=P,tt=arguments[2],G=arguments[3],Ot=arguments[4]):(H=P.renderTexture,tt=P.clear,G=P.transform,Ot=P.skipUpdateTransform)),this.renderingToScreen=!H,this.emit("prerender");var zt=this.resolution;H?((H=H.castToBaseTexture())._canvasRenderTarget||(H._canvasRenderTarget=new M.CanvasRenderTarget(H.width,H.height,H.resolution),H.resource=new O.j(H._canvasRenderTarget.canvas),H.valid=!0),this.context=H._canvasRenderTarget.context,this.resolution=H._canvasRenderTarget.resolution):this.context=this.rootContext;var st=this.context;if(this._projTransform=G||null,H||(this._lastObjectRendered=Y),!Ot){var z=Y.enableTempParent();Y.updateTransform(),Y.disableTempParent(z)}if(st.save(),st.setTransform(1,0,0,1,0,0),st.globalAlpha=1,this._activeBlendMode=D.b.NORMAL,this._outerBlend=!1,st.globalCompositeOperation=this.blendModes[D.b.NORMAL],tt!==void 0?tt:this.clearBeforeRender)if(this.renderingToScreen)st.clearRect(0,0,this.width,this.height),this.backgroundAlpha>0&&(st.globalAlpha=this.useContextAlpha?this.backgroundAlpha:1,st.fillStyle=this._backgroundColorString,st.fillRect(0,0,this.width,this.height),st.globalAlpha=1);else{(H=H)._canvasRenderTarget.clear();var U=H.clearColor;U[3]>0&&(st.globalAlpha=this.useContextAlpha?U[3]:1,st.fillStyle=Object(M.hex2string)(Object(M.rgb2hex)(U)),st.fillRect(0,0,H.realWidth,H.realHeight),st.globalAlpha=1)}var dt=this.context;this.context=st,Y.renderCanvas(this),this.context=dt,st.restore(),this.resolution=zt,this._projTransform=null,this.emit("postrender")}},B.prototype.setContextTransform=function(Y,P,H){var tt=Y,G=this._projTransform,Ot=this.resolution;H=H||Ot,G&&((tt=ft).copyFrom(Y),tt.prepend(G)),P?this.context.setTransform(tt.a*H,tt.b*H,tt.c*H,tt.d*H,tt.tx*Ot|0,tt.ty*Ot|0):this.context.setTransform(tt.a*H,tt.b*H,tt.c*H,tt.d*H,tt.tx*Ot,tt.ty*Ot)},B.prototype.clear=function(Y,P){Y===void 0&&(Y=this._backgroundColorString),P===void 0&&(P=this.backgroundAlpha);var H=this.context;H.clearRect(0,0,this.width,this.height),Y&&(H.globalAlpha=this.useContextAlpha?P:1,H.fillStyle=Y,H.fillRect(0,0,this.width,this.height),H.globalAlpha=1)},B.prototype.setBlendMode=function(Y,P){var H=Y===D.b.SRC_IN||Y===D.b.SRC_OUT||Y===D.b.DST_IN||Y===D.b.DST_ATOP;!P&&H&&(Y=D.b.NORMAL),this._activeBlendMode!==Y&&(this._activeBlendMode=Y,this._outerBlend=H,this.context.globalCompositeOperation=this.blendModes[Y])},B.prototype.destroy=function(Y){R.prototype.destroy.call(this,Y),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},B.prototype.resize=function(Y,P){R.prototype.resize.call(this,Y,P),this.smoothProperty&&(this.rootContext[this.smoothProperty]=k.b.SCALE_MODE===D.p.LINEAR)},B.prototype.invalidateBlendMode=function(){this._activeBlendMode=this.blendModes.indexOf(this.context.globalCompositeOperation)},B.registerPlugin=function(Y,P){B.__plugins=B.__plugins||{},B.__plugins[Y]=P},B}(O.a),At={canvas:null,getTintedCanvas:function(R,B){var Y=R.texture,P="#"+("00000"+(0|(B=At.roundColor(B))).toString(16)).slice(-6);Y.tintCache=Y.tintCache||{};var H,tt=Y.tintCache[P];if(tt){if(tt.tintId===Y._updateID)return Y.tintCache[P];H=Y.tintCache[P]}else H=document.createElement("canvas");if(At.tintMethod(Y,B,H),H.tintId=Y._updateID,At.convertTintToImage){var G=new Image;G.src=H.toDataURL(),Y.tintCache[P]=G}else Y.tintCache[P]=H;return H},getTintedPattern:function(R,B){var Y="#"+("00000"+(0|(B=At.roundColor(B))).toString(16)).slice(-6);R.patternCache=R.patternCache||{};var P=R.patternCache[Y];return P&&P.tintId===R._updateID||(At.canvas||(At.canvas=document.createElement("canvas")),At.tintMethod(R,B,At.canvas),(P=At.canvas.getContext("2d").createPattern(At.canvas,"repeat")).tintId=R._updateID,R.patternCache[Y]=P),P},tintWithMultiply:function(R,B,Y){var P=Y.getContext("2d"),H=R._frame.clone(),tt=R.baseTexture.resolution;H.x*=tt,H.y*=tt,H.width*=tt,H.height*=tt,Y.width=Math.ceil(H.width),Y.height=Math.ceil(H.height),P.save(),P.fillStyle="#"+("00000"+(0|B).toString(16)).slice(-6),P.fillRect(0,0,H.width,H.height),P.globalCompositeOperation="multiply";var G=R.baseTexture.getDrawableSource();P.drawImage(G,H.x,H.y,H.width,H.height,0,0,H.width,H.height),P.globalCompositeOperation="destination-atop",P.drawImage(G,H.x,H.y,H.width,H.height,0,0,H.width,H.height),P.restore()},tintWithOverlay:function(R,B,Y){var P=Y.getContext("2d"),H=R._frame.clone(),tt=R.baseTexture.resolution;H.x*=tt,H.y*=tt,H.width*=tt,H.height*=tt,Y.width=Math.ceil(H.width),Y.height=Math.ceil(H.height),P.save(),P.globalCompositeOperation="copy",P.fillStyle="#"+("00000"+(0|B).toString(16)).slice(-6),P.fillRect(0,0,H.width,H.height),P.globalCompositeOperation="destination-atop",P.drawImage(R.baseTexture.getDrawableSource(),H.x,H.y,H.width,H.height,0,0,H.width,H.height),P.restore()},tintWithPerPixel:function(R,B,Y){var P=Y.getContext("2d"),H=R._frame.clone(),tt=R.baseTexture.resolution;H.x*=tt,H.y*=tt,H.width*=tt,H.height*=tt,Y.width=Math.ceil(H.width),Y.height=Math.ceil(H.height),P.save(),P.globalCompositeOperation="copy",P.drawImage(R.baseTexture.getDrawableSource(),H.x,H.y,H.width,H.height,0,0,H.width,H.height),P.restore();for(var G=Object(M.hex2rgb)(B),Ot=G[0],zt=G[1],st=G[2],z=P.getImageData(0,0,H.width,H.height),U=z.data,dt=0;dt<U.length;dt+=4)U[dt+0]*=Ot,U[dt+1]*=zt,U[dt+2]*=st;P.putImageData(z,0,0)},roundColor:function(R){var B=At.cacheStepsPerColorChannel,Y=Object(M.hex2rgb)(R);return Y[0]=Math.min(255,Y[0]/B*B),Y[1]=Math.min(255,Y[1]/B*B),Y[2]=Math.min(255,Y[2]/B*B),Object(M.rgb2hex)(Y)},cacheStepsPerColorChannel:8,convertTintToImage:!1,canUseMultiply:et(),tintMethod:null};At.tintMethod=At.canUseMultiply?At.tintWithMultiply:At.tintWithPerPixel;var L=O.q.create;O.q.create=function(R){if(!(R&&R.forceCanvas))try{return L(R)}catch{}return new Dt(R)},O.c.prototype.getDrawableSource=function(){var R=this.resource;return R?R.bitmap||R.source:null},O.b.prototype._canvasRenderTarget=null,O.t.prototype.patternCache=null,O.t.prototype.tintCache=null},function(b,w){b.exports=function(v){return v===void 0}},function(b,w,v){v.d(w,"a",function(){return O});/*!
|
|
578
578
|
* @pixi/runner - v6.4.2
|
|
579
579
|
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
|
|
580
580
|
*
|
|
581
581
|
* @pixi/runner is licensed under the MIT License.
|
|
582
582
|
* http://www.opensource.org/licenses/mit-license
|
|
583
|
-
*/var O=function(){function M(I){this.items=[],this._name=I,this._aliasCount=0}return M.prototype.emit=function(I,D,k,z,W,Y,et,ft){if(arguments.length>8)throw new Error("max arguments reached");var Dt=this,At=Dt.name,L=Dt.items;this._aliasCount++;for(var R=0,B=L.length;R<B;R++)L[R][At](I,D,k,z,W,Y,et,ft);return L===this.items&&this._aliasCount--,this},M.prototype.ensureNonAliasedItems=function(){this._aliasCount>0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},M.prototype.add=function(I){return I[this._name]&&(this.ensureNonAliasedItems(),this.remove(I),this.items.push(I)),this},M.prototype.remove=function(I){var D=this.items.indexOf(I);return D!==-1&&(this.ensureNonAliasedItems(),this.items.splice(D,1)),this},M.prototype.contains=function(I){return this.items.indexOf(I)!==-1},M.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},M.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(M.prototype,"empty",{get:function(){return this.items.length===0},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),M}();Object.defineProperties(O.prototype,{dispatch:{value:O.prototype.emit},run:{value:O.prototype.emit}})},function(b,w,v){var O=v(20),M=v(15);b.exports=function(I){return typeof I=="number"||M(I)&&O(I)=="[object Number]"}},function(b,w,v){var O=v(51),M=typeof self=="object"&&self&&self.Object===Object&&self,I=O||M||Function("return this")();b.exports=I},function(b,w){b.exports=function(v){return v!=null&&typeof v=="object"}},function(b,w,v){v.d(w,"a",function(){return Dt}),v.d(w,"b",function(){return ft}),v.d(w,"c",function(){return Y});var O=v(8),M=v(0),I=v(2),D=function(At,L){return(D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(R,B){R.__proto__=B}||function(R,B){for(var X in B)B.hasOwnProperty(X)&&(R[X]=B[X])})(At,L)};function k(At,L){function R(){this.constructor=At}D(At,L),At.prototype=L===null?Object.create(L):(R.prototype=L.prototype,new R)}var z=function(At){function L(R,B,X,P){R===void 0&&(R=100),B===void 0&&(B=100),X===void 0&&(X=10),P===void 0&&(P=10);var H=At.call(this)||this;return H.segWidth=X,H.segHeight=P,H.width=R,H.height=B,H.build(),H}return k(L,At),L.prototype.build=function(){for(var R=this.segWidth*this.segHeight,B=[],X=[],P=[],H=this.segWidth-1,tt=this.segHeight-1,G=this.width/H,Ot=this.height/tt,zt=0;zt<R;zt++){var st=zt%this.segWidth,V=zt/this.segWidth|0;B.push(st*G,V*Ot),X.push(st/H,V/tt)}var U=H*tt;for(zt=0;zt<U;zt++){var dt=zt%H,$=zt/H|0,vt=$*this.segWidth+dt,Lt=$*this.segWidth+dt+1,K=($+1)*this.segWidth+dt,ct=($+1)*this.segWidth+dt+1;P.push(vt,Lt,K,Lt,ct,K)}this.buffers[0].data=new Float32Array(B),this.buffers[1].data=new Float32Array(X),this.indexBuffer.data=new Uint16Array(P),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update()},L}(O.b),W=function(At){function L(R,B,X){R===void 0&&(R=200),X===void 0&&(X=0);var P=At.call(this,new Float32Array(4*B.length),new Float32Array(4*B.length),new Uint16Array(6*(B.length-1)))||this;return P.points=B,P._width=R,P.textureScale=X,P.build(),P}return k(L,At),Object.defineProperty(L.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),L.prototype.build=function(){var R=this.points;if(R){var B=this.getBuffer("aVertexPosition"),X=this.getBuffer("aTextureCoord"),P=this.getIndex();if(!(R.length<1)){B.data.length/4!==R.length&&(B.data=new Float32Array(4*R.length),X.data=new Float32Array(4*R.length),P.data=new Uint16Array(6*(R.length-1)));var H=X.data,tt=P.data;H[0]=0,H[1]=0,H[2]=0,H[3]=1;for(var G=0,Ot=R[0],zt=this._width*this.textureScale,st=R.length,V=0;V<st;V++){var U=4*V;if(this.textureScale>0){var dt=Ot.x-R[V].x,$=Ot.y-R[V].y,vt=Math.sqrt(dt*dt+$*$);Ot=R[V],G+=vt/zt}else G=V/(st-1);H[U]=G,H[U+1]=0,H[U+2]=G,H[U+3]=1}var Lt=0;for(V=0;V<st-1;V++)U=2*V,tt[Lt++]=U,tt[Lt++]=U+1,tt[Lt++]=U+2,tt[Lt++]=U+2,tt[Lt++]=U+1,tt[Lt++]=U+3;X.update(),P.update(),this.updateVertices()}}},L.prototype.updateVertices=function(){var R=this.points;if(!(R.length<1)){for(var B,X=R[0],P=0,H=0,tt=this.buffers[0].data,G=R.length,Ot=0;Ot<G;Ot++){var zt=R[Ot],st=4*Ot;H=-((B=Ot<R.length-1?R[Ot+1]:zt).x-X.x),P=B.y-X.y;var V=Math.sqrt(P*P+H*H),U=this.textureScale>0?this.textureScale*this._width/2:this._width/2;P/=V,H/=V,P*=U,H*=U,tt[st]=zt.x+P,tt[st+1]=zt.y+H,tt[st+2]=zt.x-P,tt[st+3]=zt.y-H,X=zt}this.buffers[0].update()}},L.prototype.update=function(){this.textureScale>0?this.build():this.updateVertices()},L}(O.b),Y=function(At){function L(R,B,X){X===void 0&&(X=0);var P=this,H=new W(R.height,B,X),tt=new O.c(R);return X>0&&(R.baseTexture.wrapMode=M.s.REPEAT),(P=At.call(this,H,tt)||this).autoUpdate=!0,P}return k(L,At),L.prototype._render=function(R){var B=this.geometry;(this.autoUpdate||B._width!==this.shader.texture.height)&&(B._width=this.shader.texture.height,B.update()),At.prototype._render.call(this,R)},L}(O.a),et=function(At){function L(R,B,X){var P=this,H=new z(R.width,R.height,B,X),tt=new O.c(I.t.WHITE);return(P=At.call(this,H,tt)||this).texture=R,P.autoResize=!0,P}return k(L,At),L.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID;var R=this.geometry,B=this.shader.texture,X=B.width,P=B.height;!this.autoResize||R.width===X&&R.height===P||(R.width=this.shader.texture.width,R.height=this.shader.texture.height,R.build())},Object.defineProperty(L.prototype,"texture",{get:function(){return this.shader.texture},set:function(R){this.shader.texture!==R&&(this.shader.texture=R,this._textureID=-1,R.baseTexture.valid?this.textureUpdated():R.once("update",this.textureUpdated,this))},enumerable:!1,configurable:!0}),L.prototype._render=function(R){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),At.prototype._render.call(this,R)},L.prototype.destroy=function(R){this.shader.texture.off("update",this.textureUpdated,this),At.prototype.destroy.call(this,R)},L}(O.a),ft=function(At){function L(R,B,X,P,H){R===void 0&&(R=I.t.EMPTY);var tt=this,G=new O.b(B,X,P);G.getBuffer("aVertexPosition").static=!1;var Ot=new O.c(R);return(tt=At.call(this,G,Ot,null,H)||this).autoUpdate=!0,tt}return k(L,At),Object.defineProperty(L.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(R){this.geometry.getBuffer("aVertexPosition").data=R},enumerable:!1,configurable:!0}),L.prototype._render=function(R){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),At.prototype._render.call(this,R)},L}(O.a),Dt=function(At){function L(R,B,X,P,H){B===void 0&&(B=10),X===void 0&&(X=10),P===void 0&&(P=10),H===void 0&&(H=10);var tt=At.call(this,I.t.WHITE,4,4)||this;return tt._origWidth=R.orig.width,tt._origHeight=R.orig.height,tt._width=tt._origWidth,tt._height=tt._origHeight,tt._leftWidth=B,tt._rightWidth=P,tt._topHeight=X,tt._bottomHeight=H,tt.texture=R,tt}return k(L,At),L.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID,this._refresh()},Object.defineProperty(L.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(R){this.geometry.getBuffer("aVertexPosition").data=R},enumerable:!1,configurable:!0}),L.prototype.updateHorizontalVertices=function(){var R=this.vertices,B=this._getMinScale();R[9]=R[11]=R[13]=R[15]=this._topHeight*B,R[17]=R[19]=R[21]=R[23]=this._height-this._bottomHeight*B,R[25]=R[27]=R[29]=R[31]=this._height},L.prototype.updateVerticalVertices=function(){var R=this.vertices,B=this._getMinScale();R[2]=R[10]=R[18]=R[26]=this._leftWidth*B,R[4]=R[12]=R[20]=R[28]=this._width-this._rightWidth*B,R[6]=R[14]=R[22]=R[30]=this._width},L.prototype._getMinScale=function(){var R=this._leftWidth+this._rightWidth,B=this._width>R?1:this._width/R,X=this._topHeight+this._bottomHeight,P=this._height>X?1:this._height/X;return Math.min(B,P)},Object.defineProperty(L.prototype,"width",{get:function(){return this._width},set:function(R){this._width=R,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"height",{get:function(){return this._height},set:function(R){this._height=R,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"leftWidth",{get:function(){return this._leftWidth},set:function(R){this._leftWidth=R,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"rightWidth",{get:function(){return this._rightWidth},set:function(R){this._rightWidth=R,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"topHeight",{get:function(){return this._topHeight},set:function(R){this._topHeight=R,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"bottomHeight",{get:function(){return this._bottomHeight},set:function(R){this._bottomHeight=R,this._refresh()},enumerable:!1,configurable:!0}),L.prototype._refresh=function(){var R=this.texture,B=this.geometry.buffers[1].data;this._origWidth=R.orig.width,this._origHeight=R.orig.height;var X=1/this._origWidth,P=1/this._origHeight;B[0]=B[8]=B[16]=B[24]=0,B[1]=B[3]=B[5]=B[7]=0,B[6]=B[14]=B[22]=B[30]=1,B[25]=B[27]=B[29]=B[31]=1,B[2]=B[10]=B[18]=B[26]=X*this._leftWidth,B[4]=B[12]=B[20]=B[28]=1-X*this._rightWidth,B[9]=B[11]=B[13]=B[15]=P*this._topHeight,B[17]=B[19]=B[21]=B[23]=1-P*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},L}(et)},function(b,w){var v;v=function(){return this}();try{v=v||new Function("return this")()}catch{typeof window=="object"&&(v=window)}b.exports=v},function(b,w,v){var O;(function(M){function I(P,H){var tt=(65535&P)+(65535&H);return(P>>16)+(H>>16)+(tt>>16)<<16|65535&tt}function D(P,H,tt,G,Ot,zt){return I((st=I(I(H,P),I(G,zt)))<<(V=Ot)|st>>>32-V,tt);var st,V}function k(P,H,tt,G,Ot,zt,st){return D(H&tt|~H&G,P,H,Ot,zt,st)}function z(P,H,tt,G,Ot,zt,st){return D(H&G|tt&~G,P,H,Ot,zt,st)}function W(P,H,tt,G,Ot,zt,st){return D(H^tt^G,P,H,Ot,zt,st)}function Y(P,H,tt,G,Ot,zt,st){return D(tt^(H|~G),P,H,Ot,zt,st)}function et(P,H){var tt,G,Ot,zt,st;P[H>>5]|=128<<H%32,P[14+(H+64>>>9<<4)]=H;var V=1732584193,U=-271733879,dt=-1732584194,$=271733878;for(tt=0;tt<P.length;tt+=16)G=V,Ot=U,zt=dt,st=$,V=k(V,U,dt,$,P[tt],7,-680876936),$=k($,V,U,dt,P[tt+1],12,-389564586),dt=k(dt,$,V,U,P[tt+2],17,606105819),U=k(U,dt,$,V,P[tt+3],22,-1044525330),V=k(V,U,dt,$,P[tt+4],7,-176418897),$=k($,V,U,dt,P[tt+5],12,1200080426),dt=k(dt,$,V,U,P[tt+6],17,-1473231341),U=k(U,dt,$,V,P[tt+7],22,-45705983),V=k(V,U,dt,$,P[tt+8],7,1770035416),$=k($,V,U,dt,P[tt+9],12,-1958414417),dt=k(dt,$,V,U,P[tt+10],17,-42063),U=k(U,dt,$,V,P[tt+11],22,-1990404162),V=k(V,U,dt,$,P[tt+12],7,1804603682),$=k($,V,U,dt,P[tt+13],12,-40341101),dt=k(dt,$,V,U,P[tt+14],17,-1502002290),V=z(V,U=k(U,dt,$,V,P[tt+15],22,1236535329),dt,$,P[tt+1],5,-165796510),$=z($,V,U,dt,P[tt+6],9,-1069501632),dt=z(dt,$,V,U,P[tt+11],14,643717713),U=z(U,dt,$,V,P[tt],20,-373897302),V=z(V,U,dt,$,P[tt+5],5,-701558691),$=z($,V,U,dt,P[tt+10],9,38016083),dt=z(dt,$,V,U,P[tt+15],14,-660478335),U=z(U,dt,$,V,P[tt+4],20,-405537848),V=z(V,U,dt,$,P[tt+9],5,568446438),$=z($,V,U,dt,P[tt+14],9,-1019803690),dt=z(dt,$,V,U,P[tt+3],14,-187363961),U=z(U,dt,$,V,P[tt+8],20,1163531501),V=z(V,U,dt,$,P[tt+13],5,-1444681467),$=z($,V,U,dt,P[tt+2],9,-51403784),dt=z(dt,$,V,U,P[tt+7],14,1735328473),V=W(V,U=z(U,dt,$,V,P[tt+12],20,-1926607734),dt,$,P[tt+5],4,-378558),$=W($,V,U,dt,P[tt+8],11,-2022574463),dt=W(dt,$,V,U,P[tt+11],16,1839030562),U=W(U,dt,$,V,P[tt+14],23,-35309556),V=W(V,U,dt,$,P[tt+1],4,-1530992060),$=W($,V,U,dt,P[tt+4],11,1272893353),dt=W(dt,$,V,U,P[tt+7],16,-155497632),U=W(U,dt,$,V,P[tt+10],23,-1094730640),V=W(V,U,dt,$,P[tt+13],4,681279174),$=W($,V,U,dt,P[tt],11,-358537222),dt=W(dt,$,V,U,P[tt+3],16,-722521979),U=W(U,dt,$,V,P[tt+6],23,76029189),V=W(V,U,dt,$,P[tt+9],4,-640364487),$=W($,V,U,dt,P[tt+12],11,-421815835),dt=W(dt,$,V,U,P[tt+15],16,530742520),V=Y(V,U=W(U,dt,$,V,P[tt+2],23,-995338651),dt,$,P[tt],6,-198630844),$=Y($,V,U,dt,P[tt+7],10,1126891415),dt=Y(dt,$,V,U,P[tt+14],15,-1416354905),U=Y(U,dt,$,V,P[tt+5],21,-57434055),V=Y(V,U,dt,$,P[tt+12],6,1700485571),$=Y($,V,U,dt,P[tt+3],10,-1894986606),dt=Y(dt,$,V,U,P[tt+10],15,-1051523),U=Y(U,dt,$,V,P[tt+1],21,-2054922799),V=Y(V,U,dt,$,P[tt+8],6,1873313359),$=Y($,V,U,dt,P[tt+15],10,-30611744),dt=Y(dt,$,V,U,P[tt+6],15,-1560198380),U=Y(U,dt,$,V,P[tt+13],21,1309151649),V=Y(V,U,dt,$,P[tt+4],6,-145523070),$=Y($,V,U,dt,P[tt+11],10,-1120210379),dt=Y(dt,$,V,U,P[tt+2],15,718787259),U=Y(U,dt,$,V,P[tt+9],21,-343485551),V=I(V,G),U=I(U,Ot),dt=I(dt,zt),$=I($,st);return[V,U,dt,$]}function ft(P){var H,tt="",G=32*P.length;for(H=0;H<G;H+=8)tt+=String.fromCharCode(P[H>>5]>>>H%32&255);return tt}function Dt(P){var H,tt=[];for(tt[(P.length>>2)-1]=void 0,H=0;H<tt.length;H+=1)tt[H]=0;var G=8*P.length;for(H=0;H<G;H+=8)tt[H>>5]|=(255&P.charCodeAt(H/8))<<H%32;return tt}function At(P){var H,tt,G="";for(tt=0;tt<P.length;tt+=1)H=P.charCodeAt(tt),G+="0123456789abcdef".charAt(H>>>4&15)+"0123456789abcdef".charAt(15&H);return G}function L(P){return unescape(encodeURIComponent(P))}function R(P){return function(H){return ft(et(Dt(H),8*H.length))}(L(P))}function B(P,H){return function(tt,G){var Ot,zt,st=Dt(tt),V=[],U=[];for(V[15]=U[15]=void 0,st.length>16&&(st=et(st,8*tt.length)),Ot=0;Ot<16;Ot+=1)V[Ot]=909522486^st[Ot],U[Ot]=1549556828^st[Ot];return zt=et(V.concat(Dt(G)),512+8*G.length),ft(et(U.concat(zt),640))}(L(P),L(H))}function X(P,H,tt){return H?tt?B(H,P):At(B(H,P)):tt?R(P):At(R(P))}(O=function(){return X}.call(w,v,w,b))===void 0||(b.exports=O)})()},function(b,w){b.exports=`precision mediump float;
|
|
583
|
+
*/var O=function(){function M(I){this.items=[],this._name=I,this._aliasCount=0}return M.prototype.emit=function(I,D,k,V,W,X,et,ft){if(arguments.length>8)throw new Error("max arguments reached");var Dt=this,At=Dt.name,L=Dt.items;this._aliasCount++;for(var R=0,B=L.length;R<B;R++)L[R][At](I,D,k,V,W,X,et,ft);return L===this.items&&this._aliasCount--,this},M.prototype.ensureNonAliasedItems=function(){this._aliasCount>0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},M.prototype.add=function(I){return I[this._name]&&(this.ensureNonAliasedItems(),this.remove(I),this.items.push(I)),this},M.prototype.remove=function(I){var D=this.items.indexOf(I);return D!==-1&&(this.ensureNonAliasedItems(),this.items.splice(D,1)),this},M.prototype.contains=function(I){return this.items.indexOf(I)!==-1},M.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},M.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(M.prototype,"empty",{get:function(){return this.items.length===0},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),M}();Object.defineProperties(O.prototype,{dispatch:{value:O.prototype.emit},run:{value:O.prototype.emit}})},function(b,w,v){var O=v(20),M=v(15);b.exports=function(I){return typeof I=="number"||M(I)&&O(I)=="[object Number]"}},function(b,w,v){var O=v(51),M=typeof self=="object"&&self&&self.Object===Object&&self,I=O||M||Function("return this")();b.exports=I},function(b,w){b.exports=function(v){return v!=null&&typeof v=="object"}},function(b,w,v){v.d(w,"a",function(){return Dt}),v.d(w,"b",function(){return ft}),v.d(w,"c",function(){return X});var O=v(8),M=v(0),I=v(2),D=function(At,L){return(D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(R,B){R.__proto__=B}||function(R,B){for(var Y in B)B.hasOwnProperty(Y)&&(R[Y]=B[Y])})(At,L)};function k(At,L){function R(){this.constructor=At}D(At,L),At.prototype=L===null?Object.create(L):(R.prototype=L.prototype,new R)}var V=function(At){function L(R,B,Y,P){R===void 0&&(R=100),B===void 0&&(B=100),Y===void 0&&(Y=10),P===void 0&&(P=10);var H=At.call(this)||this;return H.segWidth=Y,H.segHeight=P,H.width=R,H.height=B,H.build(),H}return k(L,At),L.prototype.build=function(){for(var R=this.segWidth*this.segHeight,B=[],Y=[],P=[],H=this.segWidth-1,tt=this.segHeight-1,G=this.width/H,Ot=this.height/tt,zt=0;zt<R;zt++){var st=zt%this.segWidth,z=zt/this.segWidth|0;B.push(st*G,z*Ot),Y.push(st/H,z/tt)}var U=H*tt;for(zt=0;zt<U;zt++){var dt=zt%H,$=zt/H|0,vt=$*this.segWidth+dt,Lt=$*this.segWidth+dt+1,K=($+1)*this.segWidth+dt,ct=($+1)*this.segWidth+dt+1;P.push(vt,Lt,K,Lt,ct,K)}this.buffers[0].data=new Float32Array(B),this.buffers[1].data=new Float32Array(Y),this.indexBuffer.data=new Uint16Array(P),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update()},L}(O.b),W=function(At){function L(R,B,Y){R===void 0&&(R=200),Y===void 0&&(Y=0);var P=At.call(this,new Float32Array(4*B.length),new Float32Array(4*B.length),new Uint16Array(6*(B.length-1)))||this;return P.points=B,P._width=R,P.textureScale=Y,P.build(),P}return k(L,At),Object.defineProperty(L.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),L.prototype.build=function(){var R=this.points;if(R){var B=this.getBuffer("aVertexPosition"),Y=this.getBuffer("aTextureCoord"),P=this.getIndex();if(!(R.length<1)){B.data.length/4!==R.length&&(B.data=new Float32Array(4*R.length),Y.data=new Float32Array(4*R.length),P.data=new Uint16Array(6*(R.length-1)));var H=Y.data,tt=P.data;H[0]=0,H[1]=0,H[2]=0,H[3]=1;for(var G=0,Ot=R[0],zt=this._width*this.textureScale,st=R.length,z=0;z<st;z++){var U=4*z;if(this.textureScale>0){var dt=Ot.x-R[z].x,$=Ot.y-R[z].y,vt=Math.sqrt(dt*dt+$*$);Ot=R[z],G+=vt/zt}else G=z/(st-1);H[U]=G,H[U+1]=0,H[U+2]=G,H[U+3]=1}var Lt=0;for(z=0;z<st-1;z++)U=2*z,tt[Lt++]=U,tt[Lt++]=U+1,tt[Lt++]=U+2,tt[Lt++]=U+2,tt[Lt++]=U+1,tt[Lt++]=U+3;Y.update(),P.update(),this.updateVertices()}}},L.prototype.updateVertices=function(){var R=this.points;if(!(R.length<1)){for(var B,Y=R[0],P=0,H=0,tt=this.buffers[0].data,G=R.length,Ot=0;Ot<G;Ot++){var zt=R[Ot],st=4*Ot;H=-((B=Ot<R.length-1?R[Ot+1]:zt).x-Y.x),P=B.y-Y.y;var z=Math.sqrt(P*P+H*H),U=this.textureScale>0?this.textureScale*this._width/2:this._width/2;P/=z,H/=z,P*=U,H*=U,tt[st]=zt.x+P,tt[st+1]=zt.y+H,tt[st+2]=zt.x-P,tt[st+3]=zt.y-H,Y=zt}this.buffers[0].update()}},L.prototype.update=function(){this.textureScale>0?this.build():this.updateVertices()},L}(O.b),X=function(At){function L(R,B,Y){Y===void 0&&(Y=0);var P=this,H=new W(R.height,B,Y),tt=new O.c(R);return Y>0&&(R.baseTexture.wrapMode=M.s.REPEAT),(P=At.call(this,H,tt)||this).autoUpdate=!0,P}return k(L,At),L.prototype._render=function(R){var B=this.geometry;(this.autoUpdate||B._width!==this.shader.texture.height)&&(B._width=this.shader.texture.height,B.update()),At.prototype._render.call(this,R)},L}(O.a),et=function(At){function L(R,B,Y){var P=this,H=new V(R.width,R.height,B,Y),tt=new O.c(I.t.WHITE);return(P=At.call(this,H,tt)||this).texture=R,P.autoResize=!0,P}return k(L,At),L.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID;var R=this.geometry,B=this.shader.texture,Y=B.width,P=B.height;!this.autoResize||R.width===Y&&R.height===P||(R.width=this.shader.texture.width,R.height=this.shader.texture.height,R.build())},Object.defineProperty(L.prototype,"texture",{get:function(){return this.shader.texture},set:function(R){this.shader.texture!==R&&(this.shader.texture=R,this._textureID=-1,R.baseTexture.valid?this.textureUpdated():R.once("update",this.textureUpdated,this))},enumerable:!1,configurable:!0}),L.prototype._render=function(R){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),At.prototype._render.call(this,R)},L.prototype.destroy=function(R){this.shader.texture.off("update",this.textureUpdated,this),At.prototype.destroy.call(this,R)},L}(O.a),ft=function(At){function L(R,B,Y,P,H){R===void 0&&(R=I.t.EMPTY);var tt=this,G=new O.b(B,Y,P);G.getBuffer("aVertexPosition").static=!1;var Ot=new O.c(R);return(tt=At.call(this,G,Ot,null,H)||this).autoUpdate=!0,tt}return k(L,At),Object.defineProperty(L.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(R){this.geometry.getBuffer("aVertexPosition").data=R},enumerable:!1,configurable:!0}),L.prototype._render=function(R){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),At.prototype._render.call(this,R)},L}(O.a),Dt=function(At){function L(R,B,Y,P,H){B===void 0&&(B=10),Y===void 0&&(Y=10),P===void 0&&(P=10),H===void 0&&(H=10);var tt=At.call(this,I.t.WHITE,4,4)||this;return tt._origWidth=R.orig.width,tt._origHeight=R.orig.height,tt._width=tt._origWidth,tt._height=tt._origHeight,tt._leftWidth=B,tt._rightWidth=P,tt._topHeight=Y,tt._bottomHeight=H,tt.texture=R,tt}return k(L,At),L.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID,this._refresh()},Object.defineProperty(L.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(R){this.geometry.getBuffer("aVertexPosition").data=R},enumerable:!1,configurable:!0}),L.prototype.updateHorizontalVertices=function(){var R=this.vertices,B=this._getMinScale();R[9]=R[11]=R[13]=R[15]=this._topHeight*B,R[17]=R[19]=R[21]=R[23]=this._height-this._bottomHeight*B,R[25]=R[27]=R[29]=R[31]=this._height},L.prototype.updateVerticalVertices=function(){var R=this.vertices,B=this._getMinScale();R[2]=R[10]=R[18]=R[26]=this._leftWidth*B,R[4]=R[12]=R[20]=R[28]=this._width-this._rightWidth*B,R[6]=R[14]=R[22]=R[30]=this._width},L.prototype._getMinScale=function(){var R=this._leftWidth+this._rightWidth,B=this._width>R?1:this._width/R,Y=this._topHeight+this._bottomHeight,P=this._height>Y?1:this._height/Y;return Math.min(B,P)},Object.defineProperty(L.prototype,"width",{get:function(){return this._width},set:function(R){this._width=R,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"height",{get:function(){return this._height},set:function(R){this._height=R,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"leftWidth",{get:function(){return this._leftWidth},set:function(R){this._leftWidth=R,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"rightWidth",{get:function(){return this._rightWidth},set:function(R){this._rightWidth=R,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"topHeight",{get:function(){return this._topHeight},set:function(R){this._topHeight=R,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"bottomHeight",{get:function(){return this._bottomHeight},set:function(R){this._bottomHeight=R,this._refresh()},enumerable:!1,configurable:!0}),L.prototype._refresh=function(){var R=this.texture,B=this.geometry.buffers[1].data;this._origWidth=R.orig.width,this._origHeight=R.orig.height;var Y=1/this._origWidth,P=1/this._origHeight;B[0]=B[8]=B[16]=B[24]=0,B[1]=B[3]=B[5]=B[7]=0,B[6]=B[14]=B[22]=B[30]=1,B[25]=B[27]=B[29]=B[31]=1,B[2]=B[10]=B[18]=B[26]=Y*this._leftWidth,B[4]=B[12]=B[20]=B[28]=1-Y*this._rightWidth,B[9]=B[11]=B[13]=B[15]=P*this._topHeight,B[17]=B[19]=B[21]=B[23]=1-P*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},L}(et)},function(b,w){var v;v=function(){return this}();try{v=v||new Function("return this")()}catch{typeof window=="object"&&(v=window)}b.exports=v},function(b,w,v){var O;(function(M){function I(P,H){var tt=(65535&P)+(65535&H);return(P>>16)+(H>>16)+(tt>>16)<<16|65535&tt}function D(P,H,tt,G,Ot,zt){return I((st=I(I(H,P),I(G,zt)))<<(z=Ot)|st>>>32-z,tt);var st,z}function k(P,H,tt,G,Ot,zt,st){return D(H&tt|~H&G,P,H,Ot,zt,st)}function V(P,H,tt,G,Ot,zt,st){return D(H&G|tt&~G,P,H,Ot,zt,st)}function W(P,H,tt,G,Ot,zt,st){return D(H^tt^G,P,H,Ot,zt,st)}function X(P,H,tt,G,Ot,zt,st){return D(tt^(H|~G),P,H,Ot,zt,st)}function et(P,H){var tt,G,Ot,zt,st;P[H>>5]|=128<<H%32,P[14+(H+64>>>9<<4)]=H;var z=1732584193,U=-271733879,dt=-1732584194,$=271733878;for(tt=0;tt<P.length;tt+=16)G=z,Ot=U,zt=dt,st=$,z=k(z,U,dt,$,P[tt],7,-680876936),$=k($,z,U,dt,P[tt+1],12,-389564586),dt=k(dt,$,z,U,P[tt+2],17,606105819),U=k(U,dt,$,z,P[tt+3],22,-1044525330),z=k(z,U,dt,$,P[tt+4],7,-176418897),$=k($,z,U,dt,P[tt+5],12,1200080426),dt=k(dt,$,z,U,P[tt+6],17,-1473231341),U=k(U,dt,$,z,P[tt+7],22,-45705983),z=k(z,U,dt,$,P[tt+8],7,1770035416),$=k($,z,U,dt,P[tt+9],12,-1958414417),dt=k(dt,$,z,U,P[tt+10],17,-42063),U=k(U,dt,$,z,P[tt+11],22,-1990404162),z=k(z,U,dt,$,P[tt+12],7,1804603682),$=k($,z,U,dt,P[tt+13],12,-40341101),dt=k(dt,$,z,U,P[tt+14],17,-1502002290),z=V(z,U=k(U,dt,$,z,P[tt+15],22,1236535329),dt,$,P[tt+1],5,-165796510),$=V($,z,U,dt,P[tt+6],9,-1069501632),dt=V(dt,$,z,U,P[tt+11],14,643717713),U=V(U,dt,$,z,P[tt],20,-373897302),z=V(z,U,dt,$,P[tt+5],5,-701558691),$=V($,z,U,dt,P[tt+10],9,38016083),dt=V(dt,$,z,U,P[tt+15],14,-660478335),U=V(U,dt,$,z,P[tt+4],20,-405537848),z=V(z,U,dt,$,P[tt+9],5,568446438),$=V($,z,U,dt,P[tt+14],9,-1019803690),dt=V(dt,$,z,U,P[tt+3],14,-187363961),U=V(U,dt,$,z,P[tt+8],20,1163531501),z=V(z,U,dt,$,P[tt+13],5,-1444681467),$=V($,z,U,dt,P[tt+2],9,-51403784),dt=V(dt,$,z,U,P[tt+7],14,1735328473),z=W(z,U=V(U,dt,$,z,P[tt+12],20,-1926607734),dt,$,P[tt+5],4,-378558),$=W($,z,U,dt,P[tt+8],11,-2022574463),dt=W(dt,$,z,U,P[tt+11],16,1839030562),U=W(U,dt,$,z,P[tt+14],23,-35309556),z=W(z,U,dt,$,P[tt+1],4,-1530992060),$=W($,z,U,dt,P[tt+4],11,1272893353),dt=W(dt,$,z,U,P[tt+7],16,-155497632),U=W(U,dt,$,z,P[tt+10],23,-1094730640),z=W(z,U,dt,$,P[tt+13],4,681279174),$=W($,z,U,dt,P[tt],11,-358537222),dt=W(dt,$,z,U,P[tt+3],16,-722521979),U=W(U,dt,$,z,P[tt+6],23,76029189),z=W(z,U,dt,$,P[tt+9],4,-640364487),$=W($,z,U,dt,P[tt+12],11,-421815835),dt=W(dt,$,z,U,P[tt+15],16,530742520),z=X(z,U=W(U,dt,$,z,P[tt+2],23,-995338651),dt,$,P[tt],6,-198630844),$=X($,z,U,dt,P[tt+7],10,1126891415),dt=X(dt,$,z,U,P[tt+14],15,-1416354905),U=X(U,dt,$,z,P[tt+5],21,-57434055),z=X(z,U,dt,$,P[tt+12],6,1700485571),$=X($,z,U,dt,P[tt+3],10,-1894986606),dt=X(dt,$,z,U,P[tt+10],15,-1051523),U=X(U,dt,$,z,P[tt+1],21,-2054922799),z=X(z,U,dt,$,P[tt+8],6,1873313359),$=X($,z,U,dt,P[tt+15],10,-30611744),dt=X(dt,$,z,U,P[tt+6],15,-1560198380),U=X(U,dt,$,z,P[tt+13],21,1309151649),z=X(z,U,dt,$,P[tt+4],6,-145523070),$=X($,z,U,dt,P[tt+11],10,-1120210379),dt=X(dt,$,z,U,P[tt+2],15,718787259),U=X(U,dt,$,z,P[tt+9],21,-343485551),z=I(z,G),U=I(U,Ot),dt=I(dt,zt),$=I($,st);return[z,U,dt,$]}function ft(P){var H,tt="",G=32*P.length;for(H=0;H<G;H+=8)tt+=String.fromCharCode(P[H>>5]>>>H%32&255);return tt}function Dt(P){var H,tt=[];for(tt[(P.length>>2)-1]=void 0,H=0;H<tt.length;H+=1)tt[H]=0;var G=8*P.length;for(H=0;H<G;H+=8)tt[H>>5]|=(255&P.charCodeAt(H/8))<<H%32;return tt}function At(P){var H,tt,G="";for(tt=0;tt<P.length;tt+=1)H=P.charCodeAt(tt),G+="0123456789abcdef".charAt(H>>>4&15)+"0123456789abcdef".charAt(15&H);return G}function L(P){return unescape(encodeURIComponent(P))}function R(P){return function(H){return ft(et(Dt(H),8*H.length))}(L(P))}function B(P,H){return function(tt,G){var Ot,zt,st=Dt(tt),z=[],U=[];for(z[15]=U[15]=void 0,st.length>16&&(st=et(st,8*tt.length)),Ot=0;Ot<16;Ot+=1)z[Ot]=909522486^st[Ot],U[Ot]=1549556828^st[Ot];return zt=et(z.concat(Dt(G)),512+8*G.length),ft(et(U.concat(zt),640))}(L(P),L(H))}function Y(P,H,tt){return H?tt?B(H,P):At(B(H,P)):tt?R(P):At(R(P))}(O=function(){return Y}.call(w,v,w,b))===void 0||(b.exports=O)})()},function(b,w){b.exports=`precision mediump float;
|
|
584
584
|
attribute vec2 aVertexPosition;
|
|
585
585
|
uniform mat3 projectionMatrix;
|
|
586
586
|
varying vec2 vTextureCoord;
|
|
@@ -599,8 +599,8 @@ void main() {
|
|
|
599
599
|
vTextureCoord = filterTextureCoord();
|
|
600
600
|
filterCoord = aVertexPosition * outputFrame.zw;
|
|
601
601
|
}
|
|
602
|
-
`},function(b,w,v){var O=v(24),M=v(137),I=v(138),D=O?O.toStringTag:void 0;b.exports=function(k){return k==null?k===void 0?"[object Undefined]":"[object Null]":D&&D in Object(k)?M(k):I(k)}},function(b,w){b.exports=function(v){var O=typeof v;return v!=null&&(O=="object"||O=="function")}},function(b,w,v){var O=v(162),M=v(165);b.exports=function(I,D){var k=M(I,D);return O(k)?k:void 0}},function(b,w,v){(function(O){b.exports=function M(I,D,k){function z(et,ft){if(!D[et]){if(!I[et]){if(W)return W(et,!0);var Dt=new Error("Cannot find module '"+et+"'");throw Dt.code="MODULE_NOT_FOUND",Dt}var At=D[et]={exports:{}};I[et][0].call(At.exports,function(L){var R=I[et][1][L];return z(R||L)},At,At.exports,M,I,D,k)}return D[et].exports}for(var W=!1,Y=0;Y<k.length;Y++)z(k[Y]);return z}({1:[function(M,I,D){(function(k){var z,W,Y=k.MutationObserver||k.WebKitMutationObserver;if(Y){var et=0,ft=new Y(R),Dt=k.document.createTextNode("");ft.observe(Dt,{characterData:!0}),z=function(){Dt.data=et=++et%2}}else if(k.setImmediate||k.MessageChannel===void 0)z="document"in k&&"onreadystatechange"in k.document.createElement("script")?function(){var B=k.document.createElement("script");B.onreadystatechange=function(){R(),B.onreadystatechange=null,B.parentNode.removeChild(B),B=null},k.document.documentElement.appendChild(B)}:function(){setTimeout(R,0)};else{var At=new k.MessageChannel;At.port1.onmessage=R,z=function(){At.port2.postMessage(0)}}var L=[];function R(){var B,X;W=!0;for(var P=L.length;P;){for(X=L,L=[],B=-1;++B<P;)X[B]();P=L.length}W=!1}I.exports=function(B){L.push(B)!==1||W||z()}}).call(this,O!==void 0?O:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(M,I,D){var k=M(1);function z(){}var W={},Y=["REJECTED"],et=["FULFILLED"],ft=["PENDING"];function Dt(P){if(typeof P!="function")throw new TypeError("resolver must be a function");this.state=ft,this.queue=[],this.outcome=void 0,P!==z&&B(this,P)}function At(P,H,tt){this.promise=P,typeof H=="function"&&(this.onFulfilled=H,this.callFulfilled=this.otherCallFulfilled),typeof tt=="function"&&(this.onRejected=tt,this.callRejected=this.otherCallRejected)}function L(P,H,tt){k(function(){var G;try{G=H(tt)}catch(Ot){return W.reject(P,Ot)}G===P?W.reject(P,new TypeError("Cannot resolve promise with itself")):W.resolve(P,G)})}function R(P){var H=P&&P.then;if(P&&(typeof P=="object"||typeof P=="function")&&typeof H=="function")return function(){H.apply(P,arguments)}}function B(P,H){var tt=!1;function G(st){tt||(tt=!0,W.reject(P,st))}function Ot(st){tt||(tt=!0,W.resolve(P,st))}var zt=X(function(){H(Ot,G)});zt.status==="error"&&G(zt.value)}function X(P,H){var tt={};try{tt.value=P(H),tt.status="success"}catch(G){tt.status="error",tt.value=G}return tt}I.exports=Dt,Dt.prototype.catch=function(P){return this.then(null,P)},Dt.prototype.then=function(P,H){if(typeof P!="function"&&this.state===et||typeof H!="function"&&this.state===Y)return this;var tt=new this.constructor(z);return this.state!==ft?L(tt,this.state===et?P:H,this.outcome):this.queue.push(new At(tt,P,H)),tt},At.prototype.callFulfilled=function(P){W.resolve(this.promise,P)},At.prototype.otherCallFulfilled=function(P){L(this.promise,this.onFulfilled,P)},At.prototype.callRejected=function(P){W.reject(this.promise,P)},At.prototype.otherCallRejected=function(P){L(this.promise,this.onRejected,P)},W.resolve=function(P,H){var tt=X(R,H);if(tt.status==="error")return W.reject(P,tt.value);var G=tt.value;if(G)B(P,G);else{P.state=et,P.outcome=H;for(var Ot=-1,zt=P.queue.length;++Ot<zt;)P.queue[Ot].callFulfilled(H)}return P},W.reject=function(P,H){P.state=Y,P.outcome=H;for(var tt=-1,G=P.queue.length;++tt<G;)P.queue[tt].callRejected(H);return P},Dt.resolve=function(P){return P instanceof this?P:W.resolve(new this(z),P)},Dt.reject=function(P){var H=new this(z);return W.reject(H,P)},Dt.all=function(P){var H=this;if(Object.prototype.toString.call(P)!=="[object Array]")return this.reject(new TypeError("must be an array"));var tt=P.length,G=!1;if(!tt)return this.resolve([]);for(var Ot=new Array(tt),zt=0,st=-1,V=new this(z);++st<tt;)U(P[st],st);return V;function U(dt,$){H.resolve(dt).then(function(vt){Ot[$]=vt,++zt!==tt||G||(G=!0,W.resolve(V,Ot))},function(vt){G||(G=!0,W.reject(V,vt))})}},Dt.race=function(P){var H=this;if(Object.prototype.toString.call(P)!=="[object Array]")return this.reject(new TypeError("must be an array"));var tt=P.length,G=!1;if(!tt)return this.resolve([]);for(var Ot,zt=-1,st=new this(z);++zt<tt;)Ot=P[zt],H.resolve(Ot).then(function(V){G||(G=!0,W.resolve(st,V))},function(V){G||(G=!0,W.reject(st,V))});return st}},{1:1}],3:[function(M,I,D){(function(k){typeof k.Promise!="function"&&(k.Promise=M(2))}).call(this,O!==void 0?O:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{2:2}],4:[function(M,I,D){var k=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(yt){return typeof yt}:function(yt){return yt&&typeof Symbol=="function"&&yt.constructor===Symbol&&yt!==Symbol.prototype?"symbol":typeof yt},z=function(){try{if(typeof indexedDB!="undefined")return indexedDB;if(typeof webkitIndexedDB!="undefined")return webkitIndexedDB;if(typeof mozIndexedDB!="undefined")return mozIndexedDB;if(typeof OIndexedDB!="undefined")return OIndexedDB;if(typeof msIndexedDB!="undefined")return msIndexedDB}catch{return}}();function W(yt,Et){yt=yt||[],Et=Et||{};try{return new Blob(yt,Et)}catch(Wt){if(Wt.name!=="TypeError")throw Wt;for(var Rt=new(typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder),Qt=0;Qt<yt.length;Qt+=1)Rt.append(yt[Qt]);return Rt.getBlob(Et.type)}}typeof Promise=="undefined"&&M(3);var Y=Promise;function et(yt,Et){Et&&yt.then(function(Rt){Et(null,Rt)},function(Rt){Et(Rt)})}function ft(yt,Et,Rt){typeof Et=="function"&&yt.then(Et),typeof Rt=="function"&&yt.catch(Rt)}function Dt(yt){return typeof yt!="string"&&(console.warn(yt+" used as a key, but it is not a string."),yt=String(yt)),yt}function At(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var L=void 0,R={},B=Object.prototype.toString;function X(yt){return typeof L=="boolean"?Y.resolve(L):function(Et){return new Y(function(Rt){var Qt=Et.transaction("local-forage-detect-blob-support","readwrite"),Wt=W([""]);Qt.objectStore("local-forage-detect-blob-support").put(Wt,"key"),Qt.onabort=function(Kt){Kt.preventDefault(),Kt.stopPropagation(),Rt(!1)},Qt.oncomplete=function(){var Kt=navigator.userAgent.match(/Chrome\/(\d+)/),oe=navigator.userAgent.match(/Edge\//);Rt(oe||!Kt||parseInt(Kt[1],10)>=43)}}).catch(function(){return!1})}(yt).then(function(Et){return L=Et})}function P(yt){var Et=R[yt.name],Rt={};Rt.promise=new Y(function(Qt,Wt){Rt.resolve=Qt,Rt.reject=Wt}),Et.deferredOperations.push(Rt),Et.dbReady?Et.dbReady=Et.dbReady.then(function(){return Rt.promise}):Et.dbReady=Rt.promise}function H(yt){var Et=R[yt.name].deferredOperations.pop();if(Et)return Et.resolve(),Et.promise}function tt(yt,Et){var Rt=R[yt.name].deferredOperations.pop();if(Rt)return Rt.reject(Et),Rt.promise}function G(yt,Et){return new Y(function(Rt,Qt){if(R[yt.name]=R[yt.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},yt.db){if(!Et)return Rt(yt.db);P(yt),yt.db.close()}var Wt=[yt.name];Et&&Wt.push(yt.version);var Kt=z.open.apply(z,Wt);Et&&(Kt.onupgradeneeded=function(oe){var Me=Kt.result;try{Me.createObjectStore(yt.storeName),oe.oldVersion<=1&&Me.createObjectStore("local-forage-detect-blob-support")}catch(we){if(we.name!=="ConstraintError")throw we;console.warn('The database "'+yt.name+'" has been upgraded from version '+oe.oldVersion+" to version "+oe.newVersion+', but the storage "'+yt.storeName+'" already exists.')}}),Kt.onerror=function(oe){oe.preventDefault(),Qt(Kt.error)},Kt.onsuccess=function(){var oe=Kt.result;oe.onversionchange=function(Me){Me.target.close()},Rt(oe),H(yt)}})}function Ot(yt){return G(yt,!1)}function zt(yt){return G(yt,!0)}function st(yt,Et){if(!yt.db)return!0;var Rt=!yt.db.objectStoreNames.contains(yt.storeName),Qt=yt.version<yt.db.version,Wt=yt.version>yt.db.version;if(Qt&&(yt.version!==Et&&console.warn('The database "'+yt.name+`" can't be downgraded from version `+yt.db.version+" to version "+yt.version+"."),yt.version=yt.db.version),Wt||Rt){if(Rt){var Kt=yt.db.version+1;Kt>yt.version&&(yt.version=Kt)}return!0}return!1}function V(yt){return W([function(Et){for(var Rt=Et.length,Qt=new ArrayBuffer(Rt),Wt=new Uint8Array(Qt),Kt=0;Kt<Rt;Kt++)Wt[Kt]=Et.charCodeAt(Kt);return Qt}(atob(yt.data))],{type:yt.type})}function U(yt){return yt&&yt.__local_forage_encoded_blob}function dt(yt){var Et=this,Rt=Et._initReady().then(function(){var Qt=R[Et._dbInfo.name];if(Qt&&Qt.dbReady)return Qt.dbReady});return ft(Rt,yt,yt),Rt}function $(yt,Et,Rt,Qt){Qt===void 0&&(Qt=1);try{var Wt=yt.db.transaction(yt.storeName,Et);Rt(null,Wt)}catch(Kt){if(Qt>0&&(!yt.db||Kt.name==="InvalidStateError"||Kt.name==="NotFoundError"))return Y.resolve().then(function(){if(!yt.db||Kt.name==="NotFoundError"&&!yt.db.objectStoreNames.contains(yt.storeName)&&yt.version<=yt.db.version)return yt.db&&(yt.version=yt.db.version+1),zt(yt)}).then(function(){return function(oe){P(oe);for(var Me=R[oe.name],we=Me.forages,Se=0;Se<we.length;Se++){var Ve=we[Se];Ve._dbInfo.db&&(Ve._dbInfo.db.close(),Ve._dbInfo.db=null)}return oe.db=null,Ot(oe).then(function(en){return oe.db=en,st(oe)?zt(oe):en}).then(function(en){oe.db=Me.db=en;for(var dn=0;dn<we.length;dn++)we[dn]._dbInfo.db=en}).catch(function(en){throw tt(oe,en),en})}(yt).then(function(){$(yt,Et,Rt,Qt-1)})}).catch(Rt);Rt(Kt)}}var vt={_driver:"asyncStorage",_initStorage:function(yt){var Et=this,Rt={db:null};if(yt)for(var Qt in yt)Rt[Qt]=yt[Qt];var Wt=R[Rt.name];Wt||(Wt={forages:[],db:null,dbReady:null,deferredOperations:[]},R[Rt.name]=Wt),Wt.forages.push(Et),Et._initReady||(Et._initReady=Et.ready,Et.ready=dt);var Kt=[];function oe(){return Y.resolve()}for(var Me=0;Me<Wt.forages.length;Me++){var we=Wt.forages[Me];we!==Et&&Kt.push(we._initReady().catch(oe))}var Se=Wt.forages.slice(0);return Y.all(Kt).then(function(){return Rt.db=Wt.db,Ot(Rt)}).then(function(Ve){return Rt.db=Ve,st(Rt,Et._defaultConfig.version)?zt(Rt):Ve}).then(function(Ve){Rt.db=Wt.db=Ve,Et._dbInfo=Rt;for(var en=0;en<Se.length;en++){var dn=Se[en];dn!==Et&&(dn._dbInfo.db=Rt.db,dn._dbInfo.version=Rt.version)}})},_support:function(){try{if(!z||!z.open)return!1;var yt=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),Et=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!yt||Et)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch{return!1}}(),iterate:function(yt,Et){var Rt=this,Qt=new Y(function(Wt,Kt){Rt.ready().then(function(){$(Rt._dbInfo,"readonly",function(oe,Me){if(oe)return Kt(oe);try{var we=Me.objectStore(Rt._dbInfo.storeName).openCursor(),Se=1;we.onsuccess=function(){var Ve=we.result;if(Ve){var en=Ve.value;U(en)&&(en=V(en));var dn=yt(en,Ve.key,Se++);dn!==void 0?Wt(dn):Ve.continue()}else Wt()},we.onerror=function(){Kt(we.error)}}catch(Ve){Kt(Ve)}})}).catch(Kt)});return et(Qt,Et),Qt},getItem:function(yt,Et){var Rt=this;yt=Dt(yt);var Qt=new Y(function(Wt,Kt){Rt.ready().then(function(){$(Rt._dbInfo,"readonly",function(oe,Me){if(oe)return Kt(oe);try{var we=Me.objectStore(Rt._dbInfo.storeName).get(yt);we.onsuccess=function(){var Se=we.result;Se===void 0&&(Se=null),U(Se)&&(Se=V(Se)),Wt(Se)},we.onerror=function(){Kt(we.error)}}catch(Se){Kt(Se)}})}).catch(Kt)});return et(Qt,Et),Qt},setItem:function(yt,Et,Rt){var Qt=this;yt=Dt(yt);var Wt=new Y(function(Kt,oe){var Me;Qt.ready().then(function(){return Me=Qt._dbInfo,B.call(Et)==="[object Blob]"?X(Me.db).then(function(we){return we?Et:(Se=Et,new Y(function(Ve,en){var dn=new FileReader;dn.onerror=en,dn.onloadend=function(Tn){var yn=btoa(Tn.target.result||"");Ve({__local_forage_encoded_blob:!0,data:yn,type:Se.type})},dn.readAsBinaryString(Se)}));var Se}):Et}).then(function(we){$(Qt._dbInfo,"readwrite",function(Se,Ve){if(Se)return oe(Se);try{var en=Ve.objectStore(Qt._dbInfo.storeName);we===null&&(we=void 0);var dn=en.put(we,yt);Ve.oncomplete=function(){we===void 0&&(we=null),Kt(we)},Ve.onabort=Ve.onerror=function(){var Tn=dn.error?dn.error:dn.transaction.error;oe(Tn)}}catch(Tn){oe(Tn)}})}).catch(oe)});return et(Wt,Rt),Wt},removeItem:function(yt,Et){var Rt=this;yt=Dt(yt);var Qt=new Y(function(Wt,Kt){Rt.ready().then(function(){$(Rt._dbInfo,"readwrite",function(oe,Me){if(oe)return Kt(oe);try{var we=Me.objectStore(Rt._dbInfo.storeName).delete(yt);Me.oncomplete=function(){Wt()},Me.onerror=function(){Kt(we.error)},Me.onabort=function(){var Se=we.error?we.error:we.transaction.error;Kt(Se)}}catch(Se){Kt(Se)}})}).catch(Kt)});return et(Qt,Et),Qt},clear:function(yt){var Et=this,Rt=new Y(function(Qt,Wt){Et.ready().then(function(){$(Et._dbInfo,"readwrite",function(Kt,oe){if(Kt)return Wt(Kt);try{var Me=oe.objectStore(Et._dbInfo.storeName).clear();oe.oncomplete=function(){Qt()},oe.onabort=oe.onerror=function(){var we=Me.error?Me.error:Me.transaction.error;Wt(we)}}catch(we){Wt(we)}})}).catch(Wt)});return et(Rt,yt),Rt},length:function(yt){var Et=this,Rt=new Y(function(Qt,Wt){Et.ready().then(function(){$(Et._dbInfo,"readonly",function(Kt,oe){if(Kt)return Wt(Kt);try{var Me=oe.objectStore(Et._dbInfo.storeName).count();Me.onsuccess=function(){Qt(Me.result)},Me.onerror=function(){Wt(Me.error)}}catch(we){Wt(we)}})}).catch(Wt)});return et(Rt,yt),Rt},key:function(yt,Et){var Rt=this,Qt=new Y(function(Wt,Kt){yt<0?Wt(null):Rt.ready().then(function(){$(Rt._dbInfo,"readonly",function(oe,Me){if(oe)return Kt(oe);try{var we=Me.objectStore(Rt._dbInfo.storeName),Se=!1,Ve=we.openKeyCursor();Ve.onsuccess=function(){var en=Ve.result;en?yt===0||Se?Wt(en.key):(Se=!0,en.advance(yt)):Wt(null)},Ve.onerror=function(){Kt(Ve.error)}}catch(en){Kt(en)}})}).catch(Kt)});return et(Qt,Et),Qt},keys:function(yt){var Et=this,Rt=new Y(function(Qt,Wt){Et.ready().then(function(){$(Et._dbInfo,"readonly",function(Kt,oe){if(Kt)return Wt(Kt);try{var Me=oe.objectStore(Et._dbInfo.storeName).openKeyCursor(),we=[];Me.onsuccess=function(){var Se=Me.result;Se?(we.push(Se.key),Se.continue()):Qt(we)},Me.onerror=function(){Wt(Me.error)}}catch(Se){Wt(Se)}})}).catch(Wt)});return et(Rt,yt),Rt},dropInstance:function(yt,Et){Et=At.apply(this,arguments);var Rt=this.config();(yt=typeof yt!="function"&&yt||{}).name||(yt.name=yt.name||Rt.name,yt.storeName=yt.storeName||Rt.storeName);var Qt,Wt=this;if(yt.name){var Kt=yt.name===Rt.name&&Wt._dbInfo.db,oe=Kt?Y.resolve(Wt._dbInfo.db):Ot(yt).then(function(Me){var we=R[yt.name],Se=we.forages;we.db=Me;for(var Ve=0;Ve<Se.length;Ve++)Se[Ve]._dbInfo.db=Me;return Me});Qt=yt.storeName?oe.then(function(Me){if(Me.objectStoreNames.contains(yt.storeName)){var we=Me.version+1;P(yt);var Se=R[yt.name],Ve=Se.forages;Me.close();for(var en=0;en<Ve.length;en++){var dn=Ve[en];dn._dbInfo.db=null,dn._dbInfo.version=we}return new Y(function(Tn,yn){var Xn=z.open(yt.name,we);Xn.onerror=function(Pn){Xn.result.close(),yn(Pn)},Xn.onupgradeneeded=function(){Xn.result.deleteObjectStore(yt.storeName)},Xn.onsuccess=function(){var Pn=Xn.result;Pn.close(),Tn(Pn)}}).then(function(Tn){Se.db=Tn;for(var yn=0;yn<Ve.length;yn++){var Xn=Ve[yn];Xn._dbInfo.db=Tn,H(Xn._dbInfo)}}).catch(function(Tn){throw(tt(yt,Tn)||Y.resolve()).catch(function(){}),Tn})}}):oe.then(function(Me){P(yt);var we=R[yt.name],Se=we.forages;Me.close();for(var Ve=0;Ve<Se.length;Ve++)Se[Ve]._dbInfo.db=null;return new Y(function(en,dn){var Tn=z.deleteDatabase(yt.name);Tn.onerror=function(){var yn=Tn.result;yn&&yn.close(),dn(Tn.error)},Tn.onblocked=function(){console.warn('dropInstance blocked for database "'+yt.name+'" until all open connections are closed')},Tn.onsuccess=function(){var yn=Tn.result;yn&&yn.close(),en(yn)}}).then(function(en){we.db=en;for(var dn=0;dn<Se.length;dn++)H(Se[dn]._dbInfo)}).catch(function(en){throw(tt(yt,en)||Y.resolve()).catch(function(){}),en})})}else Qt=Y.reject("Invalid arguments");return et(Qt,Et),Qt}},Lt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",K=/^~~local_forage_type~([^~]+)~/,ct=9,nt=ct+4,_t=Object.prototype.toString;function St(yt){var Et,Rt,Qt,Wt,Kt,oe=.75*yt.length,Me=yt.length,we=0;yt[yt.length-1]==="="&&(oe--,yt[yt.length-2]==="="&&oe--);var Se=new ArrayBuffer(oe),Ve=new Uint8Array(Se);for(Et=0;Et<Me;Et+=4)Rt=Lt.indexOf(yt[Et]),Qt=Lt.indexOf(yt[Et+1]),Wt=Lt.indexOf(yt[Et+2]),Kt=Lt.indexOf(yt[Et+3]),Ve[we++]=Rt<<2|Qt>>4,Ve[we++]=(15&Qt)<<4|Wt>>2,Ve[we++]=(3&Wt)<<6|63&Kt;return Se}function kt(yt){var Et,Rt=new Uint8Array(yt),Qt="";for(Et=0;Et<Rt.length;Et+=3)Qt+=Lt[Rt[Et]>>2],Qt+=Lt[(3&Rt[Et])<<4|Rt[Et+1]>>4],Qt+=Lt[(15&Rt[Et+1])<<2|Rt[Et+2]>>6],Qt+=Lt[63&Rt[Et+2]];return Rt.length%3==2?Qt=Qt.substring(0,Qt.length-1)+"=":Rt.length%3==1&&(Qt=Qt.substring(0,Qt.length-2)+"=="),Qt}var Xt={serialize:function(yt,Et){var Rt="";if(yt&&(Rt=_t.call(yt)),yt&&(Rt==="[object ArrayBuffer]"||yt.buffer&&_t.call(yt.buffer)==="[object ArrayBuffer]")){var Qt,Wt="__lfsc__:";yt instanceof ArrayBuffer?(Qt=yt,Wt+="arbf"):(Qt=yt.buffer,Rt==="[object Int8Array]"?Wt+="si08":Rt==="[object Uint8Array]"?Wt+="ui08":Rt==="[object Uint8ClampedArray]"?Wt+="uic8":Rt==="[object Int16Array]"?Wt+="si16":Rt==="[object Uint16Array]"?Wt+="ur16":Rt==="[object Int32Array]"?Wt+="si32":Rt==="[object Uint32Array]"?Wt+="ui32":Rt==="[object Float32Array]"?Wt+="fl32":Rt==="[object Float64Array]"?Wt+="fl64":Et(new Error("Failed to get type for BinaryArray"))),Et(Wt+kt(Qt))}else if(Rt==="[object Blob]"){var Kt=new FileReader;Kt.onload=function(){var oe="~~local_forage_type~"+yt.type+"~"+kt(this.result);Et("__lfsc__:blob"+oe)},Kt.readAsArrayBuffer(yt)}else try{Et(JSON.stringify(yt))}catch(oe){console.error("Couldn't convert value into a JSON string: ",yt),Et(null,oe)}},deserialize:function(yt){if(yt.substring(0,ct)!=="__lfsc__:")return JSON.parse(yt);var Et,Rt=yt.substring(nt),Qt=yt.substring(ct,nt);if(Qt==="blob"&&K.test(Rt)){var Wt=Rt.match(K);Et=Wt[1],Rt=Rt.substring(Wt[0].length)}var Kt=St(Rt);switch(Qt){case"arbf":return Kt;case"blob":return W([Kt],{type:Et});case"si08":return new Int8Array(Kt);case"ui08":return new Uint8Array(Kt);case"uic8":return new Uint8ClampedArray(Kt);case"si16":return new Int16Array(Kt);case"ur16":return new Uint16Array(Kt);case"si32":return new Int32Array(Kt);case"ui32":return new Uint32Array(Kt);case"fl32":return new Float32Array(Kt);case"fl64":return new Float64Array(Kt);default:throw new Error("Unkown type: "+Qt)}},stringToBuffer:St,bufferToString:kt};function Jt(yt,Et,Rt,Qt){yt.executeSql("CREATE TABLE IF NOT EXISTS "+Et.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],Rt,Qt)}function at(yt,Et,Rt,Qt,Wt,Kt){yt.executeSql(Rt,Qt,Wt,function(oe,Me){Me.code===Me.SYNTAX_ERR?oe.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[Et.storeName],function(we,Se){Se.rows.length?Kt(we,Me):Jt(we,Et,function(){we.executeSql(Rt,Qt,Wt,Kt)},Kt)},Kt):Kt(oe,Me)},Kt)}function _e(yt,Et,Rt,Qt){var Wt=this;yt=Dt(yt);var Kt=new Y(function(oe,Me){Wt.ready().then(function(){Et===void 0&&(Et=null);var we=Et,Se=Wt._dbInfo;Se.serializer.serialize(Et,function(Ve,en){en?Me(en):Se.db.transaction(function(dn){at(dn,Se,"INSERT OR REPLACE INTO "+Se.storeName+" (key, value) VALUES (?, ?)",[yt,Ve],function(){oe(we)},function(Tn,yn){Me(yn)})},function(dn){if(dn.code===dn.QUOTA_ERR){if(Qt>0)return void oe(_e.apply(Wt,[yt,we,Rt,Qt-1]));Me(dn)}})})}).catch(Me)});return et(Kt,Rt),Kt}function Ue(yt){return new Y(function(Et,Rt){yt.transaction(function(Qt){Qt.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(Wt,Kt){for(var oe=[],Me=0;Me<Kt.rows.length;Me++)oe.push(Kt.rows.item(Me).name);Et({db:yt,storeNames:oe})},function(Wt,Kt){Rt(Kt)})},function(Qt){Rt(Qt)})})}var Oe={_driver:"webSQLStorage",_initStorage:function(yt){var Et=this,Rt={db:null};if(yt)for(var Qt in yt)Rt[Qt]=typeof yt[Qt]!="string"?yt[Qt].toString():yt[Qt];var Wt=new Y(function(Kt,oe){try{Rt.db=openDatabase(Rt.name,String(Rt.version),Rt.description,Rt.size)}catch(Me){return oe(Me)}Rt.db.transaction(function(Me){Jt(Me,Rt,function(){Et._dbInfo=Rt,Kt()},function(we,Se){oe(Se)})},oe)});return Rt.serializer=Xt,Wt},_support:typeof openDatabase=="function",iterate:function(yt,Et){var Rt=this,Qt=new Y(function(Wt,Kt){Rt.ready().then(function(){var oe=Rt._dbInfo;oe.db.transaction(function(Me){at(Me,oe,"SELECT * FROM "+oe.storeName,[],function(we,Se){for(var Ve=Se.rows,en=Ve.length,dn=0;dn<en;dn++){var Tn=Ve.item(dn),yn=Tn.value;if(yn&&(yn=oe.serializer.deserialize(yn)),(yn=yt(yn,Tn.key,dn+1))!==void 0)return void Wt(yn)}Wt()},function(we,Se){Kt(Se)})})}).catch(Kt)});return et(Qt,Et),Qt},getItem:function(yt,Et){var Rt=this;yt=Dt(yt);var Qt=new Y(function(Wt,Kt){Rt.ready().then(function(){var oe=Rt._dbInfo;oe.db.transaction(function(Me){at(Me,oe,"SELECT * FROM "+oe.storeName+" WHERE key = ? LIMIT 1",[yt],function(we,Se){var Ve=Se.rows.length?Se.rows.item(0).value:null;Ve&&(Ve=oe.serializer.deserialize(Ve)),Wt(Ve)},function(we,Se){Kt(Se)})})}).catch(Kt)});return et(Qt,Et),Qt},setItem:function(yt,Et,Rt){return _e.apply(this,[yt,Et,Rt,1])},removeItem:function(yt,Et){var Rt=this;yt=Dt(yt);var Qt=new Y(function(Wt,Kt){Rt.ready().then(function(){var oe=Rt._dbInfo;oe.db.transaction(function(Me){at(Me,oe,"DELETE FROM "+oe.storeName+" WHERE key = ?",[yt],function(){Wt()},function(we,Se){Kt(Se)})})}).catch(Kt)});return et(Qt,Et),Qt},clear:function(yt){var Et=this,Rt=new Y(function(Qt,Wt){Et.ready().then(function(){var Kt=Et._dbInfo;Kt.db.transaction(function(oe){at(oe,Kt,"DELETE FROM "+Kt.storeName,[],function(){Qt()},function(Me,we){Wt(we)})})}).catch(Wt)});return et(Rt,yt),Rt},length:function(yt){var Et=this,Rt=new Y(function(Qt,Wt){Et.ready().then(function(){var Kt=Et._dbInfo;Kt.db.transaction(function(oe){at(oe,Kt,"SELECT COUNT(key) as c FROM "+Kt.storeName,[],function(Me,we){var Se=we.rows.item(0).c;Qt(Se)},function(Me,we){Wt(we)})})}).catch(Wt)});return et(Rt,yt),Rt},key:function(yt,Et){var Rt=this,Qt=new Y(function(Wt,Kt){Rt.ready().then(function(){var oe=Rt._dbInfo;oe.db.transaction(function(Me){at(Me,oe,"SELECT key FROM "+oe.storeName+" WHERE id = ? LIMIT 1",[yt+1],function(we,Se){var Ve=Se.rows.length?Se.rows.item(0).key:null;Wt(Ve)},function(we,Se){Kt(Se)})})}).catch(Kt)});return et(Qt,Et),Qt},keys:function(yt){var Et=this,Rt=new Y(function(Qt,Wt){Et.ready().then(function(){var Kt=Et._dbInfo;Kt.db.transaction(function(oe){at(oe,Kt,"SELECT key FROM "+Kt.storeName,[],function(Me,we){for(var Se=[],Ve=0;Ve<we.rows.length;Ve++)Se.push(we.rows.item(Ve).key);Qt(Se)},function(Me,we){Wt(we)})})}).catch(Wt)});return et(Rt,yt),Rt},dropInstance:function(yt,Et){Et=At.apply(this,arguments);var Rt=this.config();(yt=typeof yt!="function"&&yt||{}).name||(yt.name=yt.name||Rt.name,yt.storeName=yt.storeName||Rt.storeName);var Qt,Wt=this;return et(Qt=yt.name?new Y(function(Kt){var oe;oe=yt.name===Rt.name?Wt._dbInfo.db:openDatabase(yt.name,"","",0),yt.storeName?Kt({db:oe,storeNames:[yt.storeName]}):Kt(Ue(oe))}).then(function(Kt){return new Y(function(oe,Me){Kt.db.transaction(function(we){function Se(Tn){return new Y(function(yn,Xn){we.executeSql("DROP TABLE IF EXISTS "+Tn,[],function(){yn()},function(Pn,zi){Xn(zi)})})}for(var Ve=[],en=0,dn=Kt.storeNames.length;en<dn;en++)Ve.push(Se(Kt.storeNames[en]));Y.all(Ve).then(function(){oe()}).catch(function(Tn){Me(Tn)})},function(we){Me(we)})})}):Y.reject("Invalid arguments"),Et),Qt}};function Ae(yt,Et){var Rt=yt.name+"/";return yt.storeName!==Et.storeName&&(Rt+=yt.storeName+"/"),Rt}function ze(){return!function(){try{return localStorage.setItem("_localforage_support_test",!0),localStorage.removeItem("_localforage_support_test"),!1}catch{return!0}}()||localStorage.length>0}var $e={_driver:"localStorageWrapper",_initStorage:function(yt){var Et={};if(yt)for(var Rt in yt)Et[Rt]=yt[Rt];return Et.keyPrefix=Ae(yt,this._defaultConfig),ze()?(this._dbInfo=Et,Et.serializer=Xt,Y.resolve()):Y.reject()},_support:function(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}(),iterate:function(yt,Et){var Rt=this,Qt=Rt.ready().then(function(){for(var Wt=Rt._dbInfo,Kt=Wt.keyPrefix,oe=Kt.length,Me=localStorage.length,we=1,Se=0;Se<Me;Se++){var Ve=localStorage.key(Se);if(Ve.indexOf(Kt)===0){var en=localStorage.getItem(Ve);if(en&&(en=Wt.serializer.deserialize(en)),(en=yt(en,Ve.substring(oe),we++))!==void 0)return en}}});return et(Qt,Et),Qt},getItem:function(yt,Et){var Rt=this;yt=Dt(yt);var Qt=Rt.ready().then(function(){var Wt=Rt._dbInfo,Kt=localStorage.getItem(Wt.keyPrefix+yt);return Kt&&(Kt=Wt.serializer.deserialize(Kt)),Kt});return et(Qt,Et),Qt},setItem:function(yt,Et,Rt){var Qt=this;yt=Dt(yt);var Wt=Qt.ready().then(function(){Et===void 0&&(Et=null);var Kt=Et;return new Y(function(oe,Me){var we=Qt._dbInfo;we.serializer.serialize(Et,function(Se,Ve){if(Ve)Me(Ve);else try{localStorage.setItem(we.keyPrefix+yt,Se),oe(Kt)}catch(en){en.name!=="QuotaExceededError"&&en.name!=="NS_ERROR_DOM_QUOTA_REACHED"||Me(en),Me(en)}})})});return et(Wt,Rt),Wt},removeItem:function(yt,Et){var Rt=this;yt=Dt(yt);var Qt=Rt.ready().then(function(){var Wt=Rt._dbInfo;localStorage.removeItem(Wt.keyPrefix+yt)});return et(Qt,Et),Qt},clear:function(yt){var Et=this,Rt=Et.ready().then(function(){for(var Qt=Et._dbInfo.keyPrefix,Wt=localStorage.length-1;Wt>=0;Wt--){var Kt=localStorage.key(Wt);Kt.indexOf(Qt)===0&&localStorage.removeItem(Kt)}});return et(Rt,yt),Rt},length:function(yt){var Et=this.keys().then(function(Rt){return Rt.length});return et(Et,yt),Et},key:function(yt,Et){var Rt=this,Qt=Rt.ready().then(function(){var Wt,Kt=Rt._dbInfo;try{Wt=localStorage.key(yt)}catch{Wt=null}return Wt&&(Wt=Wt.substring(Kt.keyPrefix.length)),Wt});return et(Qt,Et),Qt},keys:function(yt){var Et=this,Rt=Et.ready().then(function(){for(var Qt=Et._dbInfo,Wt=localStorage.length,Kt=[],oe=0;oe<Wt;oe++){var Me=localStorage.key(oe);Me.indexOf(Qt.keyPrefix)===0&&Kt.push(Me.substring(Qt.keyPrefix.length))}return Kt});return et(Rt,yt),Rt},dropInstance:function(yt,Et){if(Et=At.apply(this,arguments),!(yt=typeof yt!="function"&&yt||{}).name){var Rt=this.config();yt.name=yt.name||Rt.name,yt.storeName=yt.storeName||Rt.storeName}var Qt,Wt=this;return et(Qt=yt.name?new Y(function(Kt){yt.storeName?Kt(Ae(yt,Wt._defaultConfig)):Kt(yt.name+"/")}).then(function(Kt){for(var oe=localStorage.length-1;oe>=0;oe--){var Me=localStorage.key(oe);Me.indexOf(Kt)===0&&localStorage.removeItem(Me)}}):Y.reject("Invalid arguments"),Et),Qt}},cn=function(yt,Et){for(var Rt,Qt,Wt=yt.length,Kt=0;Kt<Wt;){if((Rt=yt[Kt])===(Qt=Et)||typeof Rt=="number"&&typeof Qt=="number"&&isNaN(Rt)&&isNaN(Qt))return!0;Kt++}return!1},ke=Array.isArray||function(yt){return Object.prototype.toString.call(yt)==="[object Array]"},Ge={},Rn={},re={INDEXEDDB:vt,WEBSQL:Oe,LOCALSTORAGE:$e},pe=[re.INDEXEDDB._driver,re.WEBSQL._driver,re.LOCALSTORAGE._driver],Ee=["dropInstance"],ln=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Ee),In={description:"",driver:pe.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Kn(yt,Et){yt[Et]=function(){var Rt=arguments;return yt.ready().then(function(){return yt[Et].apply(yt,Rt)})}}function pi(){for(var yt=1;yt<arguments.length;yt++){var Et=arguments[yt];if(Et)for(var Rt in Et)Et.hasOwnProperty(Rt)&&(ke(Et[Rt])?arguments[0][Rt]=Et[Rt].slice():arguments[0][Rt]=Et[Rt])}return arguments[0]}var tn=new(function(){function yt(Et){for(var Rt in function(Kt,oe){if(!(Kt instanceof oe))throw new TypeError("Cannot call a class as a function")}(this,yt),re)if(re.hasOwnProperty(Rt)){var Qt=re[Rt],Wt=Qt._driver;this[Rt]=Wt,Ge[Wt]||this.defineDriver(Qt)}this._defaultConfig=pi({},In),this._config=pi({},this._defaultConfig,Et),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return yt.prototype.config=function(Et){if((Et===void 0?"undefined":k(Et))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var Rt in Et){if(Rt==="storeName"&&(Et[Rt]=Et[Rt].replace(/\W/g,"_")),Rt==="version"&&typeof Et[Rt]!="number")return new Error("Database version must be a number.");this._config[Rt]=Et[Rt]}return!("driver"in Et)||!Et.driver||this.setDriver(this._config.driver)}return typeof Et=="string"?this._config[Et]:this._config},yt.prototype.defineDriver=function(Et,Rt,Qt){var Wt=new Y(function(Kt,oe){try{var Me=Et._driver,we=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!Et._driver)return void oe(we);for(var Se=ln.concat("_initStorage"),Ve=0,en=Se.length;Ve<en;Ve++){var dn=Se[Ve];if((!cn(Ee,dn)||Et[dn])&&typeof Et[dn]!="function")return void oe(we)}(function(){for(var yn=function(mo){return function(){var io=new Error("Method "+mo+" is not implemented by the current driver"),Fn=Y.reject(io);return et(Fn,arguments[arguments.length-1]),Fn}},Xn=0,Pn=Ee.length;Xn<Pn;Xn++){var zi=Ee[Xn];Et[zi]||(Et[zi]=yn(zi))}})();var Tn=function(yn){Ge[Me]&&console.info("Redefining LocalForage driver: "+Me),Ge[Me]=Et,Rn[Me]=yn,Kt()};"_support"in Et?Et._support&&typeof Et._support=="function"?Et._support().then(Tn,oe):Tn(!!Et._support):Tn(!0)}catch(yn){oe(yn)}});return ft(Wt,Rt,Qt),Wt},yt.prototype.driver=function(){return this._driver||null},yt.prototype.getDriver=function(Et,Rt,Qt){var Wt=Ge[Et]?Y.resolve(Ge[Et]):Y.reject(new Error("Driver not found."));return ft(Wt,Rt,Qt),Wt},yt.prototype.getSerializer=function(Et){var Rt=Y.resolve(Xt);return ft(Rt,Et),Rt},yt.prototype.ready=function(Et){var Rt=this,Qt=Rt._driverSet.then(function(){return Rt._ready===null&&(Rt._ready=Rt._initDriver()),Rt._ready});return ft(Qt,Et,Et),Qt},yt.prototype.setDriver=function(Et,Rt,Qt){var Wt=this;ke(Et)||(Et=[Et]);var Kt=this._getSupportedDrivers(Et);function oe(){Wt._config.driver=Wt.driver()}function Me(Se){return Wt._extend(Se),oe(),Wt._ready=Wt._initStorage(Wt._config),Wt._ready}var we=this._driverSet!==null?this._driverSet.catch(function(){return Y.resolve()}):Y.resolve();return this._driverSet=we.then(function(){var Se=Kt[0];return Wt._dbInfo=null,Wt._ready=null,Wt.getDriver(Se).then(function(Ve){Wt._driver=Ve._driver,oe(),Wt._wrapLibraryMethodsWithReady(),Wt._initDriver=function(en){return function(){var dn=0;return function Tn(){for(;dn<en.length;){var yn=en[dn];return dn++,Wt._dbInfo=null,Wt._ready=null,Wt.getDriver(yn).then(Me).catch(Tn)}oe();var Xn=new Error("No available storage method found.");return Wt._driverSet=Y.reject(Xn),Wt._driverSet}()}}(Kt)})}).catch(function(){oe();var Se=new Error("No available storage method found.");return Wt._driverSet=Y.reject(Se),Wt._driverSet}),ft(this._driverSet,Rt,Qt),this._driverSet},yt.prototype.supports=function(Et){return!!Rn[Et]},yt.prototype._extend=function(Et){pi(this,Et)},yt.prototype._getSupportedDrivers=function(Et){for(var Rt=[],Qt=0,Wt=Et.length;Qt<Wt;Qt++){var Kt=Et[Qt];this.supports(Kt)&&Rt.push(Kt)}return Rt},yt.prototype._wrapLibraryMethodsWithReady=function(){for(var Et=0,Rt=ln.length;Et<Rt;Et++)Kn(this,ln[Et])},yt.prototype.createInstance=function(Et){return new yt(Et)},yt}());I.exports=tn},{3:3}]},{},[4])(4)}).call(this,v(17))},function(b,w,v){var O=v(14).Symbol;b.exports=O},function(b,w){b.exports=function(v){return v.webpackPolyfill||(v.deprecate=function(){},v.paths=[],v.children||(v.children=[]),Object.defineProperty(v,"loaded",{enumerable:!0,get:function(){return v.l}}),Object.defineProperty(v,"id",{enumerable:!0,get:function(){return v.i}}),v.webpackPolyfill=1),v}},function(b,w,v){var O=v(152),M=v(153),I=v(154),D=v(155),k=v(156);function z(W){var Y=-1,et=W==null?0:W.length;for(this.clear();++Y<et;){var ft=W[Y];this.set(ft[0],ft[1])}}z.prototype.clear=O,z.prototype.delete=M,z.prototype.get=I,z.prototype.has=D,z.prototype.set=k,b.exports=z},function(b,w,v){var O=v(36);b.exports=function(M,I){for(var D=M.length;D--;)if(O(M[D][0],I))return D;return-1}},function(b,w,v){var O=v(22)(Object,"create");b.exports=O},function(b,w,v){var O=v(174);b.exports=function(M,I){var D=M.__data__;return O(I)?D[typeof I=="string"?"string":"hash"]:D.map}},function(b,w){var v=Array.isArray;b.exports=v},function(b,w,v){var O=v(196),M=v(37),I=v(197),D=v(198),k=v(199),z=v(20),W=v(55),Y=W(O),et=W(M),ft=W(I),Dt=W(D),At=W(k),L=z;(O&&L(new O(new ArrayBuffer(1)))!="[object DataView]"||M&&L(new M)!="[object Map]"||I&&L(I.resolve())!="[object Promise]"||D&&L(new D)!="[object Set]"||k&&L(new k)!="[object WeakMap]")&&(L=function(R){var B=z(R),X=B=="[object Object]"?R.constructor:void 0,P=X?W(X):"";if(P)switch(P){case Y:return"[object DataView]";case et:return"[object Map]";case ft:return"[object Promise]";case Dt:return"[object Set]";case At:return"[object WeakMap]"}return B}),b.exports=L},function(b,w,v){var O=v(68),M=v(69);b.exports=function(I,D,k,z){var W=!k;k||(k={});for(var Y=-1,et=D.length;++Y<et;){var ft=D[Y],Dt=z?z(k[ft],I[ft],ft,k,I):void 0;Dt===void 0&&(Dt=I[ft]),W?M(k,ft,Dt):O(k,ft,Dt)}return k}},function(b,w,v){var O=v(20),M=v(21);b.exports=function(I){if(!M(I))return!1;var D=O(I);return D=="[object Function]"||D=="[object GeneratorFunction]"||D=="[object AsyncFunction]"||D=="[object Proxy]"}},function(b,w,v){(function(O){v.d(w,"a",function(){return Uh});var M=v(4),I=v(0),D=v(10),k=v(8),z=v(16),W=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:O!==void 0?O:typeof self!="undefined"?self:{};function Y(T,d,c){return T(c={path:d,exports:{},require:function(f,S){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(S==null&&c.path)}},c.exports),c.exports}var et=Y(function(T){var d=Object.prototype.hasOwnProperty,c="~";function f(){}function S(ut,It,Ut){this.fn=ut,this.context=It,this.once=Ut||!1}function F(ut,It,Ut,he,te){if(typeof Ut!="function")throw new TypeError("The listener must be a function");var me=new S(Ut,he||ut,te),xe=c?c+It:It;return ut._events[xe]?ut._events[xe].fn?ut._events[xe]=[ut._events[xe],me]:ut._events[xe].push(me):(ut._events[xe]=me,ut._eventsCount++),ut}function Z(ut,It){--ut._eventsCount==0?ut._events=new f:delete ut._events[It]}function ot(){this._events=new f,this._eventsCount=0}Object.create&&(f.prototype=Object.create(null),new f().__proto__||(c=!1)),ot.prototype.eventNames=function(){var ut,It,Ut=[];if(this._eventsCount===0)return Ut;for(It in ut=this._events)d.call(ut,It)&&Ut.push(c?It.slice(1):It);return Object.getOwnPropertySymbols?Ut.concat(Object.getOwnPropertySymbols(ut)):Ut},ot.prototype.listeners=function(ut){var It=c?c+ut:ut,Ut=this._events[It];if(!Ut)return[];if(Ut.fn)return[Ut.fn];for(var he=0,te=Ut.length,me=new Array(te);he<te;he++)me[he]=Ut[he].fn;return me},ot.prototype.listenerCount=function(ut){var It=c?c+ut:ut,Ut=this._events[It];return Ut?Ut.fn?1:Ut.length:0},ot.prototype.emit=function(ut,It,Ut,he,te,me){var xe=arguments,Be=c?c+ut:ut;if(!this._events[Be])return!1;var qe,Ye,Je=this._events[Be],je=arguments.length;if(Je.fn){switch(Je.once&&this.removeListener(ut,Je.fn,void 0,!0),je){case 1:return Je.fn.call(Je.context),!0;case 2:return Je.fn.call(Je.context,It),!0;case 3:return Je.fn.call(Je.context,It,Ut),!0;case 4:return Je.fn.call(Je.context,It,Ut,he),!0;case 5:return Je.fn.call(Je.context,It,Ut,he,te),!0;case 6:return Je.fn.call(Je.context,It,Ut,he,te,me),!0}for(Ye=1,qe=new Array(je-1);Ye<je;Ye++)qe[Ye-1]=xe[Ye];Je.fn.apply(Je.context,qe)}else{var pn,_n=Je.length;for(Ye=0;Ye<_n;Ye++)switch(Je[Ye].once&&this.removeListener(ut,Je[Ye].fn,void 0,!0),je){case 1:Je[Ye].fn.call(Je[Ye].context);break;case 2:Je[Ye].fn.call(Je[Ye].context,It);break;case 3:Je[Ye].fn.call(Je[Ye].context,It,Ut);break;case 4:Je[Ye].fn.call(Je[Ye].context,It,Ut,he);break;default:if(!qe)for(pn=1,qe=new Array(je-1);pn<je;pn++)qe[pn-1]=xe[pn];Je[Ye].fn.apply(Je[Ye].context,qe)}}return!0},ot.prototype.on=function(ut,It,Ut){return F(this,ut,It,Ut,!1)},ot.prototype.once=function(ut,It,Ut){return F(this,ut,It,Ut,!0)},ot.prototype.removeListener=function(ut,It,Ut,he){var te=c?c+ut:ut;if(!this._events[te])return this;if(!It)return Z(this,te),this;var me=this._events[te];if(me.fn)me.fn!==It||he&&!me.once||Ut&&me.context!==Ut||Z(this,te);else{for(var xe=0,Be=[],qe=me.length;xe<qe;xe++)(me[xe].fn!==It||he&&!me[xe].once||Ut&&me[xe].context!==Ut)&&Be.push(me[xe]);Be.length?this._events[te]=Be.length===1?Be[0]:Be:Z(this,te)}return this},ot.prototype.removeAllListeners=function(ut){var It;return ut?(It=c?c+ut:ut,this._events[It]&&Z(this,It)):(this._events=new f,this._eventsCount=0),this},ot.prototype.off=ot.prototype.removeListener,ot.prototype.addListener=ot.prototype.on,ot.prefixed=c,ot.EventEmitter=ot,T.exports=ot}),ft=Y(function(T,d){(function(c){var f=d&&!d.nodeType&&d,S=T&&!T.nodeType&&T,F=typeof W=="object"&&W;F.global!==F&&F.window!==F&&F.self!==F||(c=F);var Z,ot,ut=2147483647,It=/^xn--/,Ut=/[^\x20-\x7E]/,he=/[\x2E\u3002\uFF0E\uFF61]/g,te={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},me=Math.floor,xe=String.fromCharCode;function Be(Xe){throw RangeError(te[Xe])}function qe(Xe,an){for(var bn=Xe.length,Gn=[];bn--;)Gn[bn]=an(Xe[bn]);return Gn}function Ye(Xe,an){var bn=Xe.split("@"),Gn="";return bn.length>1&&(Gn=bn[0]+"@",Xe=bn[1]),Gn+qe((Xe=Xe.replace(he,".")).split("."),an).join(".")}function Je(Xe){for(var an,bn,Gn=[],qn=0,Ti=Xe.length;qn<Ti;)(an=Xe.charCodeAt(qn++))>=55296&&an<=56319&&qn<Ti?(64512&(bn=Xe.charCodeAt(qn++)))==56320?Gn.push(((1023&an)<<10)+(1023&bn)+65536):(Gn.push(an),qn--):Gn.push(an);return Gn}function je(Xe){return qe(Xe,function(an){var bn="";return an>65535&&(bn+=xe((an-=65536)>>>10&1023|55296),an=56320|1023&an),bn+=xe(an)}).join("")}function pn(Xe,an){return Xe+22+75*(Xe<26)-((an!=0)<<5)}function _n(Xe,an,bn){var Gn=0;for(Xe=bn?me(Xe/700):Xe>>1,Xe+=me(Xe/an);Xe>455;Gn+=36)Xe=me(Xe/35);return me(Gn+36*Xe/(Xe+38))}function kn(Xe){var an,bn,Gn,qn,Ti,$n,vi,Ri,Xi,Bi,ni,Ei=[],Ui=Xe.length,ki=0,Qi=128,ii=72;for((bn=Xe.lastIndexOf("-"))<0&&(bn=0),Gn=0;Gn<bn;++Gn)Xe.charCodeAt(Gn)>=128&&Be("not-basic"),Ei.push(Xe.charCodeAt(Gn));for(qn=bn>0?bn+1:0;qn<Ui;){for(Ti=ki,$n=1,vi=36;qn>=Ui&&Be("invalid-input"),((Ri=(ni=Xe.charCodeAt(qn++))-48<10?ni-22:ni-65<26?ni-65:ni-97<26?ni-97:36)>=36||Ri>me((ut-ki)/$n))&&Be("overflow"),ki+=Ri*$n,!(Ri<(Xi=vi<=ii?1:vi>=ii+26?26:vi-ii));vi+=36)$n>me(ut/(Bi=36-Xi))&&Be("overflow"),$n*=Bi;ii=_n(ki-Ti,an=Ei.length+1,Ti==0),me(ki/an)>ut-Qi&&Be("overflow"),Qi+=me(ki/an),ki%=an,Ei.splice(ki++,0,Qi)}return je(Ei)}function Dn(Xe){var an,bn,Gn,qn,Ti,$n,vi,Ri,Xi,Bi,ni,Ei,Ui,ki,Qi,ii=[];for(Ei=(Xe=Je(Xe)).length,an=128,bn=0,Ti=72,$n=0;$n<Ei;++$n)(ni=Xe[$n])<128&&ii.push(xe(ni));for(Gn=qn=ii.length,qn&&ii.push("-");Gn<Ei;){for(vi=ut,$n=0;$n<Ei;++$n)(ni=Xe[$n])>=an&&ni<vi&&(vi=ni);for(vi-an>me((ut-bn)/(Ui=Gn+1))&&Be("overflow"),bn+=(vi-an)*Ui,an=vi,$n=0;$n<Ei;++$n)if((ni=Xe[$n])<an&&++bn>ut&&Be("overflow"),ni==an){for(Ri=bn,Xi=36;!(Ri<(Bi=Xi<=Ti?1:Xi>=Ti+26?26:Xi-Ti));Xi+=36)Qi=Ri-Bi,ki=36-Bi,ii.push(xe(pn(Bi+Qi%ki,0))),Ri=me(Qi/ki);ii.push(xe(pn(Ri,0))),Ti=_n(bn,Ui,Gn==qn),bn=0,++Gn}++bn,++an}return ii.join("")}if(Z={version:"1.3.2",ucs2:{decode:Je,encode:je},decode:kn,encode:Dn,toASCII:function(Xe){return Ye(Xe,function(an){return Ut.test(an)?"xn--"+Dn(an):an})},toUnicode:function(Xe){return Ye(Xe,function(an){return It.test(an)?kn(an.slice(4).toLowerCase()):an})}},f&&S)if(T.exports==f)S.exports=Z;else for(ot in Z)Z.hasOwnProperty(ot)&&(f[ot]=Z[ot]);else c.punycode=Z})(W)}),Dt=function(T){return typeof T=="string"},At=function(T){return typeof T=="object"&&T!==null},L=function(T){return T===null},R=function(T){return T==null};function B(T,d){return Object.prototype.hasOwnProperty.call(T,d)}var X=function(T,d,c,f){d=d||"&",c=c||"=";var S={};if(typeof T!="string"||T.length===0)return S;var F=/\+/g;T=T.split(d);var Z=1e3;f&&typeof f.maxKeys=="number"&&(Z=f.maxKeys);var ot=T.length;Z>0&&ot>Z&&(ot=Z);for(var ut=0;ut<ot;++ut){var It,Ut,he,te,me=T[ut].replace(F,"%20"),xe=me.indexOf(c);xe>=0?(It=me.substr(0,xe),Ut=me.substr(xe+1)):(It=me,Ut=""),he=decodeURIComponent(It),te=decodeURIComponent(Ut),B(S,he)?Array.isArray(S[he])?S[he].push(te):S[he]=[S[he],te]:S[he]=te}return S},P=function(T){switch(typeof T){case"string":return T;case"boolean":return T?"true":"false";case"number":return isFinite(T)?T:"";default:return""}},H=function(T,d,c,f){return d=d||"&",c=c||"=",T===null&&(T=void 0),typeof T=="object"?Object.keys(T).map(function(S){var F=encodeURIComponent(P(S))+c;return Array.isArray(T[S])?T[S].map(function(Z){return F+encodeURIComponent(P(Z))}).join(d):F+encodeURIComponent(P(T[S]))}).join(d):f?encodeURIComponent(P(f))+c+encodeURIComponent(P(T)):""},tt=Y(function(T,d){d.decode=d.parse=X,d.encode=d.stringify=H}),G=Xt,Ot=function(T,d){return Xt(T,!1,!0).resolve(d)},zt=function(T){return Dt(T)&&(T=Xt(T)),T instanceof st?T.format():st.prototype.format.call(T)};function st(){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 V=/^([a-z0-9.+-]+:)/i,U=/:[0-9]*$/,dt=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,$=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
|
|
603
|
-
`," "]),vt=["'"].concat($),Lt=["%","/","?",";","#"].concat(vt),K=["/","?","#"],ct=/^[+a-z0-9A-Z_-]{0,63}$/,nt=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,_t={javascript:!0,"javascript:":!0},St={javascript:!0,"javascript:":!0},kt={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Xt(T,d,c){if(T&&At(T)&&T instanceof st)return T;var f=new st;return f.parse(T,d,c),f}st.prototype.parse=function(T,d,c){if(!Dt(T))throw new TypeError("Parameter 'url' must be a string, not "+typeof T);var f=T.indexOf("?"),S=f!==-1&&f<T.indexOf("#")?"?":"#",F=T.split(S);F[0]=F[0].replace(/\\/g,"/");var Z=T=F.join(S);if(Z=Z.trim(),!c&&T.split("#").length===1){var ot=dt.exec(Z);if(ot)return this.path=Z,this.href=Z,this.pathname=ot[1],ot[2]?(this.search=ot[2],this.query=d?tt.parse(this.search.substr(1)):this.search.substr(1)):d&&(this.search="",this.query={}),this}var ut=
|
|
602
|
+
`},function(b,w,v){var O=v(24),M=v(137),I=v(138),D=O?O.toStringTag:void 0;b.exports=function(k){return k==null?k===void 0?"[object Undefined]":"[object Null]":D&&D in Object(k)?M(k):I(k)}},function(b,w){b.exports=function(v){var O=typeof v;return v!=null&&(O=="object"||O=="function")}},function(b,w,v){var O=v(162),M=v(165);b.exports=function(I,D){var k=M(I,D);return O(k)?k:void 0}},function(b,w,v){(function(O){b.exports=function M(I,D,k){function V(et,ft){if(!D[et]){if(!I[et]){if(W)return W(et,!0);var Dt=new Error("Cannot find module '"+et+"'");throw Dt.code="MODULE_NOT_FOUND",Dt}var At=D[et]={exports:{}};I[et][0].call(At.exports,function(L){var R=I[et][1][L];return V(R||L)},At,At.exports,M,I,D,k)}return D[et].exports}for(var W=!1,X=0;X<k.length;X++)V(k[X]);return V}({1:[function(M,I,D){(function(k){var V,W,X=k.MutationObserver||k.WebKitMutationObserver;if(X){var et=0,ft=new X(R),Dt=k.document.createTextNode("");ft.observe(Dt,{characterData:!0}),V=function(){Dt.data=et=++et%2}}else if(k.setImmediate||k.MessageChannel===void 0)V="document"in k&&"onreadystatechange"in k.document.createElement("script")?function(){var B=k.document.createElement("script");B.onreadystatechange=function(){R(),B.onreadystatechange=null,B.parentNode.removeChild(B),B=null},k.document.documentElement.appendChild(B)}:function(){setTimeout(R,0)};else{var At=new k.MessageChannel;At.port1.onmessage=R,V=function(){At.port2.postMessage(0)}}var L=[];function R(){var B,Y;W=!0;for(var P=L.length;P;){for(Y=L,L=[],B=-1;++B<P;)Y[B]();P=L.length}W=!1}I.exports=function(B){L.push(B)!==1||W||V()}}).call(this,O!==void 0?O:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(M,I,D){var k=M(1);function V(){}var W={},X=["REJECTED"],et=["FULFILLED"],ft=["PENDING"];function Dt(P){if(typeof P!="function")throw new TypeError("resolver must be a function");this.state=ft,this.queue=[],this.outcome=void 0,P!==V&&B(this,P)}function At(P,H,tt){this.promise=P,typeof H=="function"&&(this.onFulfilled=H,this.callFulfilled=this.otherCallFulfilled),typeof tt=="function"&&(this.onRejected=tt,this.callRejected=this.otherCallRejected)}function L(P,H,tt){k(function(){var G;try{G=H(tt)}catch(Ot){return W.reject(P,Ot)}G===P?W.reject(P,new TypeError("Cannot resolve promise with itself")):W.resolve(P,G)})}function R(P){var H=P&&P.then;if(P&&(typeof P=="object"||typeof P=="function")&&typeof H=="function")return function(){H.apply(P,arguments)}}function B(P,H){var tt=!1;function G(st){tt||(tt=!0,W.reject(P,st))}function Ot(st){tt||(tt=!0,W.resolve(P,st))}var zt=Y(function(){H(Ot,G)});zt.status==="error"&&G(zt.value)}function Y(P,H){var tt={};try{tt.value=P(H),tt.status="success"}catch(G){tt.status="error",tt.value=G}return tt}I.exports=Dt,Dt.prototype.catch=function(P){return this.then(null,P)},Dt.prototype.then=function(P,H){if(typeof P!="function"&&this.state===et||typeof H!="function"&&this.state===X)return this;var tt=new this.constructor(V);return this.state!==ft?L(tt,this.state===et?P:H,this.outcome):this.queue.push(new At(tt,P,H)),tt},At.prototype.callFulfilled=function(P){W.resolve(this.promise,P)},At.prototype.otherCallFulfilled=function(P){L(this.promise,this.onFulfilled,P)},At.prototype.callRejected=function(P){W.reject(this.promise,P)},At.prototype.otherCallRejected=function(P){L(this.promise,this.onRejected,P)},W.resolve=function(P,H){var tt=Y(R,H);if(tt.status==="error")return W.reject(P,tt.value);var G=tt.value;if(G)B(P,G);else{P.state=et,P.outcome=H;for(var Ot=-1,zt=P.queue.length;++Ot<zt;)P.queue[Ot].callFulfilled(H)}return P},W.reject=function(P,H){P.state=X,P.outcome=H;for(var tt=-1,G=P.queue.length;++tt<G;)P.queue[tt].callRejected(H);return P},Dt.resolve=function(P){return P instanceof this?P:W.resolve(new this(V),P)},Dt.reject=function(P){var H=new this(V);return W.reject(H,P)},Dt.all=function(P){var H=this;if(Object.prototype.toString.call(P)!=="[object Array]")return this.reject(new TypeError("must be an array"));var tt=P.length,G=!1;if(!tt)return this.resolve([]);for(var Ot=new Array(tt),zt=0,st=-1,z=new this(V);++st<tt;)U(P[st],st);return z;function U(dt,$){H.resolve(dt).then(function(vt){Ot[$]=vt,++zt!==tt||G||(G=!0,W.resolve(z,Ot))},function(vt){G||(G=!0,W.reject(z,vt))})}},Dt.race=function(P){var H=this;if(Object.prototype.toString.call(P)!=="[object Array]")return this.reject(new TypeError("must be an array"));var tt=P.length,G=!1;if(!tt)return this.resolve([]);for(var Ot,zt=-1,st=new this(V);++zt<tt;)Ot=P[zt],H.resolve(Ot).then(function(z){G||(G=!0,W.resolve(st,z))},function(z){G||(G=!0,W.reject(st,z))});return st}},{1:1}],3:[function(M,I,D){(function(k){typeof k.Promise!="function"&&(k.Promise=M(2))}).call(this,O!==void 0?O:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{2:2}],4:[function(M,I,D){var k=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(yt){return typeof yt}:function(yt){return yt&&typeof Symbol=="function"&&yt.constructor===Symbol&&yt!==Symbol.prototype?"symbol":typeof yt},V=function(){try{if(typeof indexedDB!="undefined")return indexedDB;if(typeof webkitIndexedDB!="undefined")return webkitIndexedDB;if(typeof mozIndexedDB!="undefined")return mozIndexedDB;if(typeof OIndexedDB!="undefined")return OIndexedDB;if(typeof msIndexedDB!="undefined")return msIndexedDB}catch{return}}();function W(yt,Et){yt=yt||[],Et=Et||{};try{return new Blob(yt,Et)}catch(Wt){if(Wt.name!=="TypeError")throw Wt;for(var Rt=new(typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder),Qt=0;Qt<yt.length;Qt+=1)Rt.append(yt[Qt]);return Rt.getBlob(Et.type)}}typeof Promise=="undefined"&&M(3);var X=Promise;function et(yt,Et){Et&&yt.then(function(Rt){Et(null,Rt)},function(Rt){Et(Rt)})}function ft(yt,Et,Rt){typeof Et=="function"&&yt.then(Et),typeof Rt=="function"&&yt.catch(Rt)}function Dt(yt){return typeof yt!="string"&&(console.warn(yt+" used as a key, but it is not a string."),yt=String(yt)),yt}function At(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var L=void 0,R={},B=Object.prototype.toString;function Y(yt){return typeof L=="boolean"?X.resolve(L):function(Et){return new X(function(Rt){var Qt=Et.transaction("local-forage-detect-blob-support","readwrite"),Wt=W([""]);Qt.objectStore("local-forage-detect-blob-support").put(Wt,"key"),Qt.onabort=function(Kt){Kt.preventDefault(),Kt.stopPropagation(),Rt(!1)},Qt.oncomplete=function(){var Kt=navigator.userAgent.match(/Chrome\/(\d+)/),oe=navigator.userAgent.match(/Edge\//);Rt(oe||!Kt||parseInt(Kt[1],10)>=43)}}).catch(function(){return!1})}(yt).then(function(Et){return L=Et})}function P(yt){var Et=R[yt.name],Rt={};Rt.promise=new X(function(Qt,Wt){Rt.resolve=Qt,Rt.reject=Wt}),Et.deferredOperations.push(Rt),Et.dbReady?Et.dbReady=Et.dbReady.then(function(){return Rt.promise}):Et.dbReady=Rt.promise}function H(yt){var Et=R[yt.name].deferredOperations.pop();if(Et)return Et.resolve(),Et.promise}function tt(yt,Et){var Rt=R[yt.name].deferredOperations.pop();if(Rt)return Rt.reject(Et),Rt.promise}function G(yt,Et){return new X(function(Rt,Qt){if(R[yt.name]=R[yt.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},yt.db){if(!Et)return Rt(yt.db);P(yt),yt.db.close()}var Wt=[yt.name];Et&&Wt.push(yt.version);var Kt=V.open.apply(V,Wt);Et&&(Kt.onupgradeneeded=function(oe){var Me=Kt.result;try{Me.createObjectStore(yt.storeName),oe.oldVersion<=1&&Me.createObjectStore("local-forage-detect-blob-support")}catch(we){if(we.name!=="ConstraintError")throw we;console.warn('The database "'+yt.name+'" has been upgraded from version '+oe.oldVersion+" to version "+oe.newVersion+', but the storage "'+yt.storeName+'" already exists.')}}),Kt.onerror=function(oe){oe.preventDefault(),Qt(Kt.error)},Kt.onsuccess=function(){var oe=Kt.result;oe.onversionchange=function(Me){Me.target.close()},Rt(oe),H(yt)}})}function Ot(yt){return G(yt,!1)}function zt(yt){return G(yt,!0)}function st(yt,Et){if(!yt.db)return!0;var Rt=!yt.db.objectStoreNames.contains(yt.storeName),Qt=yt.version<yt.db.version,Wt=yt.version>yt.db.version;if(Qt&&(yt.version!==Et&&console.warn('The database "'+yt.name+`" can't be downgraded from version `+yt.db.version+" to version "+yt.version+"."),yt.version=yt.db.version),Wt||Rt){if(Rt){var Kt=yt.db.version+1;Kt>yt.version&&(yt.version=Kt)}return!0}return!1}function z(yt){return W([function(Et){for(var Rt=Et.length,Qt=new ArrayBuffer(Rt),Wt=new Uint8Array(Qt),Kt=0;Kt<Rt;Kt++)Wt[Kt]=Et.charCodeAt(Kt);return Qt}(atob(yt.data))],{type:yt.type})}function U(yt){return yt&&yt.__local_forage_encoded_blob}function dt(yt){var Et=this,Rt=Et._initReady().then(function(){var Qt=R[Et._dbInfo.name];if(Qt&&Qt.dbReady)return Qt.dbReady});return ft(Rt,yt,yt),Rt}function $(yt,Et,Rt,Qt){Qt===void 0&&(Qt=1);try{var Wt=yt.db.transaction(yt.storeName,Et);Rt(null,Wt)}catch(Kt){if(Qt>0&&(!yt.db||Kt.name==="InvalidStateError"||Kt.name==="NotFoundError"))return X.resolve().then(function(){if(!yt.db||Kt.name==="NotFoundError"&&!yt.db.objectStoreNames.contains(yt.storeName)&&yt.version<=yt.db.version)return yt.db&&(yt.version=yt.db.version+1),zt(yt)}).then(function(){return function(oe){P(oe);for(var Me=R[oe.name],we=Me.forages,Se=0;Se<we.length;Se++){var Ve=we[Se];Ve._dbInfo.db&&(Ve._dbInfo.db.close(),Ve._dbInfo.db=null)}return oe.db=null,Ot(oe).then(function(en){return oe.db=en,st(oe)?zt(oe):en}).then(function(en){oe.db=Me.db=en;for(var dn=0;dn<we.length;dn++)we[dn]._dbInfo.db=en}).catch(function(en){throw tt(oe,en),en})}(yt).then(function(){$(yt,Et,Rt,Qt-1)})}).catch(Rt);Rt(Kt)}}var vt={_driver:"asyncStorage",_initStorage:function(yt){var Et=this,Rt={db:null};if(yt)for(var Qt in yt)Rt[Qt]=yt[Qt];var Wt=R[Rt.name];Wt||(Wt={forages:[],db:null,dbReady:null,deferredOperations:[]},R[Rt.name]=Wt),Wt.forages.push(Et),Et._initReady||(Et._initReady=Et.ready,Et.ready=dt);var Kt=[];function oe(){return X.resolve()}for(var Me=0;Me<Wt.forages.length;Me++){var we=Wt.forages[Me];we!==Et&&Kt.push(we._initReady().catch(oe))}var Se=Wt.forages.slice(0);return X.all(Kt).then(function(){return Rt.db=Wt.db,Ot(Rt)}).then(function(Ve){return Rt.db=Ve,st(Rt,Et._defaultConfig.version)?zt(Rt):Ve}).then(function(Ve){Rt.db=Wt.db=Ve,Et._dbInfo=Rt;for(var en=0;en<Se.length;en++){var dn=Se[en];dn!==Et&&(dn._dbInfo.db=Rt.db,dn._dbInfo.version=Rt.version)}})},_support:function(){try{if(!V||!V.open)return!1;var yt=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),Et=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!yt||Et)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch{return!1}}(),iterate:function(yt,Et){var Rt=this,Qt=new X(function(Wt,Kt){Rt.ready().then(function(){$(Rt._dbInfo,"readonly",function(oe,Me){if(oe)return Kt(oe);try{var we=Me.objectStore(Rt._dbInfo.storeName).openCursor(),Se=1;we.onsuccess=function(){var Ve=we.result;if(Ve){var en=Ve.value;U(en)&&(en=z(en));var dn=yt(en,Ve.key,Se++);dn!==void 0?Wt(dn):Ve.continue()}else Wt()},we.onerror=function(){Kt(we.error)}}catch(Ve){Kt(Ve)}})}).catch(Kt)});return et(Qt,Et),Qt},getItem:function(yt,Et){var Rt=this;yt=Dt(yt);var Qt=new X(function(Wt,Kt){Rt.ready().then(function(){$(Rt._dbInfo,"readonly",function(oe,Me){if(oe)return Kt(oe);try{var we=Me.objectStore(Rt._dbInfo.storeName).get(yt);we.onsuccess=function(){var Se=we.result;Se===void 0&&(Se=null),U(Se)&&(Se=z(Se)),Wt(Se)},we.onerror=function(){Kt(we.error)}}catch(Se){Kt(Se)}})}).catch(Kt)});return et(Qt,Et),Qt},setItem:function(yt,Et,Rt){var Qt=this;yt=Dt(yt);var Wt=new X(function(Kt,oe){var Me;Qt.ready().then(function(){return Me=Qt._dbInfo,B.call(Et)==="[object Blob]"?Y(Me.db).then(function(we){return we?Et:(Se=Et,new X(function(Ve,en){var dn=new FileReader;dn.onerror=en,dn.onloadend=function(Tn){var yn=btoa(Tn.target.result||"");Ve({__local_forage_encoded_blob:!0,data:yn,type:Se.type})},dn.readAsBinaryString(Se)}));var Se}):Et}).then(function(we){$(Qt._dbInfo,"readwrite",function(Se,Ve){if(Se)return oe(Se);try{var en=Ve.objectStore(Qt._dbInfo.storeName);we===null&&(we=void 0);var dn=en.put(we,yt);Ve.oncomplete=function(){we===void 0&&(we=null),Kt(we)},Ve.onabort=Ve.onerror=function(){var Tn=dn.error?dn.error:dn.transaction.error;oe(Tn)}}catch(Tn){oe(Tn)}})}).catch(oe)});return et(Wt,Rt),Wt},removeItem:function(yt,Et){var Rt=this;yt=Dt(yt);var Qt=new X(function(Wt,Kt){Rt.ready().then(function(){$(Rt._dbInfo,"readwrite",function(oe,Me){if(oe)return Kt(oe);try{var we=Me.objectStore(Rt._dbInfo.storeName).delete(yt);Me.oncomplete=function(){Wt()},Me.onerror=function(){Kt(we.error)},Me.onabort=function(){var Se=we.error?we.error:we.transaction.error;Kt(Se)}}catch(Se){Kt(Se)}})}).catch(Kt)});return et(Qt,Et),Qt},clear:function(yt){var Et=this,Rt=new X(function(Qt,Wt){Et.ready().then(function(){$(Et._dbInfo,"readwrite",function(Kt,oe){if(Kt)return Wt(Kt);try{var Me=oe.objectStore(Et._dbInfo.storeName).clear();oe.oncomplete=function(){Qt()},oe.onabort=oe.onerror=function(){var we=Me.error?Me.error:Me.transaction.error;Wt(we)}}catch(we){Wt(we)}})}).catch(Wt)});return et(Rt,yt),Rt},length:function(yt){var Et=this,Rt=new X(function(Qt,Wt){Et.ready().then(function(){$(Et._dbInfo,"readonly",function(Kt,oe){if(Kt)return Wt(Kt);try{var Me=oe.objectStore(Et._dbInfo.storeName).count();Me.onsuccess=function(){Qt(Me.result)},Me.onerror=function(){Wt(Me.error)}}catch(we){Wt(we)}})}).catch(Wt)});return et(Rt,yt),Rt},key:function(yt,Et){var Rt=this,Qt=new X(function(Wt,Kt){yt<0?Wt(null):Rt.ready().then(function(){$(Rt._dbInfo,"readonly",function(oe,Me){if(oe)return Kt(oe);try{var we=Me.objectStore(Rt._dbInfo.storeName),Se=!1,Ve=we.openKeyCursor();Ve.onsuccess=function(){var en=Ve.result;en?yt===0||Se?Wt(en.key):(Se=!0,en.advance(yt)):Wt(null)},Ve.onerror=function(){Kt(Ve.error)}}catch(en){Kt(en)}})}).catch(Kt)});return et(Qt,Et),Qt},keys:function(yt){var Et=this,Rt=new X(function(Qt,Wt){Et.ready().then(function(){$(Et._dbInfo,"readonly",function(Kt,oe){if(Kt)return Wt(Kt);try{var Me=oe.objectStore(Et._dbInfo.storeName).openKeyCursor(),we=[];Me.onsuccess=function(){var Se=Me.result;Se?(we.push(Se.key),Se.continue()):Qt(we)},Me.onerror=function(){Wt(Me.error)}}catch(Se){Wt(Se)}})}).catch(Wt)});return et(Rt,yt),Rt},dropInstance:function(yt,Et){Et=At.apply(this,arguments);var Rt=this.config();(yt=typeof yt!="function"&&yt||{}).name||(yt.name=yt.name||Rt.name,yt.storeName=yt.storeName||Rt.storeName);var Qt,Wt=this;if(yt.name){var Kt=yt.name===Rt.name&&Wt._dbInfo.db,oe=Kt?X.resolve(Wt._dbInfo.db):Ot(yt).then(function(Me){var we=R[yt.name],Se=we.forages;we.db=Me;for(var Ve=0;Ve<Se.length;Ve++)Se[Ve]._dbInfo.db=Me;return Me});Qt=yt.storeName?oe.then(function(Me){if(Me.objectStoreNames.contains(yt.storeName)){var we=Me.version+1;P(yt);var Se=R[yt.name],Ve=Se.forages;Me.close();for(var en=0;en<Ve.length;en++){var dn=Ve[en];dn._dbInfo.db=null,dn._dbInfo.version=we}return new X(function(Tn,yn){var Xn=V.open(yt.name,we);Xn.onerror=function(Pn){Xn.result.close(),yn(Pn)},Xn.onupgradeneeded=function(){Xn.result.deleteObjectStore(yt.storeName)},Xn.onsuccess=function(){var Pn=Xn.result;Pn.close(),Tn(Pn)}}).then(function(Tn){Se.db=Tn;for(var yn=0;yn<Ve.length;yn++){var Xn=Ve[yn];Xn._dbInfo.db=Tn,H(Xn._dbInfo)}}).catch(function(Tn){throw(tt(yt,Tn)||X.resolve()).catch(function(){}),Tn})}}):oe.then(function(Me){P(yt);var we=R[yt.name],Se=we.forages;Me.close();for(var Ve=0;Ve<Se.length;Ve++)Se[Ve]._dbInfo.db=null;return new X(function(en,dn){var Tn=V.deleteDatabase(yt.name);Tn.onerror=function(){var yn=Tn.result;yn&&yn.close(),dn(Tn.error)},Tn.onblocked=function(){console.warn('dropInstance blocked for database "'+yt.name+'" until all open connections are closed')},Tn.onsuccess=function(){var yn=Tn.result;yn&&yn.close(),en(yn)}}).then(function(en){we.db=en;for(var dn=0;dn<Se.length;dn++)H(Se[dn]._dbInfo)}).catch(function(en){throw(tt(yt,en)||X.resolve()).catch(function(){}),en})})}else Qt=X.reject("Invalid arguments");return et(Qt,Et),Qt}},Lt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",K=/^~~local_forage_type~([^~]+)~/,ct=9,nt=ct+4,_t=Object.prototype.toString;function St(yt){var Et,Rt,Qt,Wt,Kt,oe=.75*yt.length,Me=yt.length,we=0;yt[yt.length-1]==="="&&(oe--,yt[yt.length-2]==="="&&oe--);var Se=new ArrayBuffer(oe),Ve=new Uint8Array(Se);for(Et=0;Et<Me;Et+=4)Rt=Lt.indexOf(yt[Et]),Qt=Lt.indexOf(yt[Et+1]),Wt=Lt.indexOf(yt[Et+2]),Kt=Lt.indexOf(yt[Et+3]),Ve[we++]=Rt<<2|Qt>>4,Ve[we++]=(15&Qt)<<4|Wt>>2,Ve[we++]=(3&Wt)<<6|63&Kt;return Se}function kt(yt){var Et,Rt=new Uint8Array(yt),Qt="";for(Et=0;Et<Rt.length;Et+=3)Qt+=Lt[Rt[Et]>>2],Qt+=Lt[(3&Rt[Et])<<4|Rt[Et+1]>>4],Qt+=Lt[(15&Rt[Et+1])<<2|Rt[Et+2]>>6],Qt+=Lt[63&Rt[Et+2]];return Rt.length%3==2?Qt=Qt.substring(0,Qt.length-1)+"=":Rt.length%3==1&&(Qt=Qt.substring(0,Qt.length-2)+"=="),Qt}var Xt={serialize:function(yt,Et){var Rt="";if(yt&&(Rt=_t.call(yt)),yt&&(Rt==="[object ArrayBuffer]"||yt.buffer&&_t.call(yt.buffer)==="[object ArrayBuffer]")){var Qt,Wt="__lfsc__:";yt instanceof ArrayBuffer?(Qt=yt,Wt+="arbf"):(Qt=yt.buffer,Rt==="[object Int8Array]"?Wt+="si08":Rt==="[object Uint8Array]"?Wt+="ui08":Rt==="[object Uint8ClampedArray]"?Wt+="uic8":Rt==="[object Int16Array]"?Wt+="si16":Rt==="[object Uint16Array]"?Wt+="ur16":Rt==="[object Int32Array]"?Wt+="si32":Rt==="[object Uint32Array]"?Wt+="ui32":Rt==="[object Float32Array]"?Wt+="fl32":Rt==="[object Float64Array]"?Wt+="fl64":Et(new Error("Failed to get type for BinaryArray"))),Et(Wt+kt(Qt))}else if(Rt==="[object Blob]"){var Kt=new FileReader;Kt.onload=function(){var oe="~~local_forage_type~"+yt.type+"~"+kt(this.result);Et("__lfsc__:blob"+oe)},Kt.readAsArrayBuffer(yt)}else try{Et(JSON.stringify(yt))}catch(oe){console.error("Couldn't convert value into a JSON string: ",yt),Et(null,oe)}},deserialize:function(yt){if(yt.substring(0,ct)!=="__lfsc__:")return JSON.parse(yt);var Et,Rt=yt.substring(nt),Qt=yt.substring(ct,nt);if(Qt==="blob"&&K.test(Rt)){var Wt=Rt.match(K);Et=Wt[1],Rt=Rt.substring(Wt[0].length)}var Kt=St(Rt);switch(Qt){case"arbf":return Kt;case"blob":return W([Kt],{type:Et});case"si08":return new Int8Array(Kt);case"ui08":return new Uint8Array(Kt);case"uic8":return new Uint8ClampedArray(Kt);case"si16":return new Int16Array(Kt);case"ur16":return new Uint16Array(Kt);case"si32":return new Int32Array(Kt);case"ui32":return new Uint32Array(Kt);case"fl32":return new Float32Array(Kt);case"fl64":return new Float64Array(Kt);default:throw new Error("Unkown type: "+Qt)}},stringToBuffer:St,bufferToString:kt};function Jt(yt,Et,Rt,Qt){yt.executeSql("CREATE TABLE IF NOT EXISTS "+Et.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],Rt,Qt)}function at(yt,Et,Rt,Qt,Wt,Kt){yt.executeSql(Rt,Qt,Wt,function(oe,Me){Me.code===Me.SYNTAX_ERR?oe.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[Et.storeName],function(we,Se){Se.rows.length?Kt(we,Me):Jt(we,Et,function(){we.executeSql(Rt,Qt,Wt,Kt)},Kt)},Kt):Kt(oe,Me)},Kt)}function _e(yt,Et,Rt,Qt){var Wt=this;yt=Dt(yt);var Kt=new X(function(oe,Me){Wt.ready().then(function(){Et===void 0&&(Et=null);var we=Et,Se=Wt._dbInfo;Se.serializer.serialize(Et,function(Ve,en){en?Me(en):Se.db.transaction(function(dn){at(dn,Se,"INSERT OR REPLACE INTO "+Se.storeName+" (key, value) VALUES (?, ?)",[yt,Ve],function(){oe(we)},function(Tn,yn){Me(yn)})},function(dn){if(dn.code===dn.QUOTA_ERR){if(Qt>0)return void oe(_e.apply(Wt,[yt,we,Rt,Qt-1]));Me(dn)}})})}).catch(Me)});return et(Kt,Rt),Kt}function Ue(yt){return new X(function(Et,Rt){yt.transaction(function(Qt){Qt.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(Wt,Kt){for(var oe=[],Me=0;Me<Kt.rows.length;Me++)oe.push(Kt.rows.item(Me).name);Et({db:yt,storeNames:oe})},function(Wt,Kt){Rt(Kt)})},function(Qt){Rt(Qt)})})}var Oe={_driver:"webSQLStorage",_initStorage:function(yt){var Et=this,Rt={db:null};if(yt)for(var Qt in yt)Rt[Qt]=typeof yt[Qt]!="string"?yt[Qt].toString():yt[Qt];var Wt=new X(function(Kt,oe){try{Rt.db=openDatabase(Rt.name,String(Rt.version),Rt.description,Rt.size)}catch(Me){return oe(Me)}Rt.db.transaction(function(Me){Jt(Me,Rt,function(){Et._dbInfo=Rt,Kt()},function(we,Se){oe(Se)})},oe)});return Rt.serializer=Xt,Wt},_support:typeof openDatabase=="function",iterate:function(yt,Et){var Rt=this,Qt=new X(function(Wt,Kt){Rt.ready().then(function(){var oe=Rt._dbInfo;oe.db.transaction(function(Me){at(Me,oe,"SELECT * FROM "+oe.storeName,[],function(we,Se){for(var Ve=Se.rows,en=Ve.length,dn=0;dn<en;dn++){var Tn=Ve.item(dn),yn=Tn.value;if(yn&&(yn=oe.serializer.deserialize(yn)),(yn=yt(yn,Tn.key,dn+1))!==void 0)return void Wt(yn)}Wt()},function(we,Se){Kt(Se)})})}).catch(Kt)});return et(Qt,Et),Qt},getItem:function(yt,Et){var Rt=this;yt=Dt(yt);var Qt=new X(function(Wt,Kt){Rt.ready().then(function(){var oe=Rt._dbInfo;oe.db.transaction(function(Me){at(Me,oe,"SELECT * FROM "+oe.storeName+" WHERE key = ? LIMIT 1",[yt],function(we,Se){var Ve=Se.rows.length?Se.rows.item(0).value:null;Ve&&(Ve=oe.serializer.deserialize(Ve)),Wt(Ve)},function(we,Se){Kt(Se)})})}).catch(Kt)});return et(Qt,Et),Qt},setItem:function(yt,Et,Rt){return _e.apply(this,[yt,Et,Rt,1])},removeItem:function(yt,Et){var Rt=this;yt=Dt(yt);var Qt=new X(function(Wt,Kt){Rt.ready().then(function(){var oe=Rt._dbInfo;oe.db.transaction(function(Me){at(Me,oe,"DELETE FROM "+oe.storeName+" WHERE key = ?",[yt],function(){Wt()},function(we,Se){Kt(Se)})})}).catch(Kt)});return et(Qt,Et),Qt},clear:function(yt){var Et=this,Rt=new X(function(Qt,Wt){Et.ready().then(function(){var Kt=Et._dbInfo;Kt.db.transaction(function(oe){at(oe,Kt,"DELETE FROM "+Kt.storeName,[],function(){Qt()},function(Me,we){Wt(we)})})}).catch(Wt)});return et(Rt,yt),Rt},length:function(yt){var Et=this,Rt=new X(function(Qt,Wt){Et.ready().then(function(){var Kt=Et._dbInfo;Kt.db.transaction(function(oe){at(oe,Kt,"SELECT COUNT(key) as c FROM "+Kt.storeName,[],function(Me,we){var Se=we.rows.item(0).c;Qt(Se)},function(Me,we){Wt(we)})})}).catch(Wt)});return et(Rt,yt),Rt},key:function(yt,Et){var Rt=this,Qt=new X(function(Wt,Kt){Rt.ready().then(function(){var oe=Rt._dbInfo;oe.db.transaction(function(Me){at(Me,oe,"SELECT key FROM "+oe.storeName+" WHERE id = ? LIMIT 1",[yt+1],function(we,Se){var Ve=Se.rows.length?Se.rows.item(0).key:null;Wt(Ve)},function(we,Se){Kt(Se)})})}).catch(Kt)});return et(Qt,Et),Qt},keys:function(yt){var Et=this,Rt=new X(function(Qt,Wt){Et.ready().then(function(){var Kt=Et._dbInfo;Kt.db.transaction(function(oe){at(oe,Kt,"SELECT key FROM "+Kt.storeName,[],function(Me,we){for(var Se=[],Ve=0;Ve<we.rows.length;Ve++)Se.push(we.rows.item(Ve).key);Qt(Se)},function(Me,we){Wt(we)})})}).catch(Wt)});return et(Rt,yt),Rt},dropInstance:function(yt,Et){Et=At.apply(this,arguments);var Rt=this.config();(yt=typeof yt!="function"&&yt||{}).name||(yt.name=yt.name||Rt.name,yt.storeName=yt.storeName||Rt.storeName);var Qt,Wt=this;return et(Qt=yt.name?new X(function(Kt){var oe;oe=yt.name===Rt.name?Wt._dbInfo.db:openDatabase(yt.name,"","",0),yt.storeName?Kt({db:oe,storeNames:[yt.storeName]}):Kt(Ue(oe))}).then(function(Kt){return new X(function(oe,Me){Kt.db.transaction(function(we){function Se(Tn){return new X(function(yn,Xn){we.executeSql("DROP TABLE IF EXISTS "+Tn,[],function(){yn()},function(Pn,zi){Xn(zi)})})}for(var Ve=[],en=0,dn=Kt.storeNames.length;en<dn;en++)Ve.push(Se(Kt.storeNames[en]));X.all(Ve).then(function(){oe()}).catch(function(Tn){Me(Tn)})},function(we){Me(we)})})}):X.reject("Invalid arguments"),Et),Qt}};function Ae(yt,Et){var Rt=yt.name+"/";return yt.storeName!==Et.storeName&&(Rt+=yt.storeName+"/"),Rt}function ze(){return!function(){try{return localStorage.setItem("_localforage_support_test",!0),localStorage.removeItem("_localforage_support_test"),!1}catch{return!0}}()||localStorage.length>0}var $e={_driver:"localStorageWrapper",_initStorage:function(yt){var Et={};if(yt)for(var Rt in yt)Et[Rt]=yt[Rt];return Et.keyPrefix=Ae(yt,this._defaultConfig),ze()?(this._dbInfo=Et,Et.serializer=Xt,X.resolve()):X.reject()},_support:function(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}(),iterate:function(yt,Et){var Rt=this,Qt=Rt.ready().then(function(){for(var Wt=Rt._dbInfo,Kt=Wt.keyPrefix,oe=Kt.length,Me=localStorage.length,we=1,Se=0;Se<Me;Se++){var Ve=localStorage.key(Se);if(Ve.indexOf(Kt)===0){var en=localStorage.getItem(Ve);if(en&&(en=Wt.serializer.deserialize(en)),(en=yt(en,Ve.substring(oe),we++))!==void 0)return en}}});return et(Qt,Et),Qt},getItem:function(yt,Et){var Rt=this;yt=Dt(yt);var Qt=Rt.ready().then(function(){var Wt=Rt._dbInfo,Kt=localStorage.getItem(Wt.keyPrefix+yt);return Kt&&(Kt=Wt.serializer.deserialize(Kt)),Kt});return et(Qt,Et),Qt},setItem:function(yt,Et,Rt){var Qt=this;yt=Dt(yt);var Wt=Qt.ready().then(function(){Et===void 0&&(Et=null);var Kt=Et;return new X(function(oe,Me){var we=Qt._dbInfo;we.serializer.serialize(Et,function(Se,Ve){if(Ve)Me(Ve);else try{localStorage.setItem(we.keyPrefix+yt,Se),oe(Kt)}catch(en){en.name!=="QuotaExceededError"&&en.name!=="NS_ERROR_DOM_QUOTA_REACHED"||Me(en),Me(en)}})})});return et(Wt,Rt),Wt},removeItem:function(yt,Et){var Rt=this;yt=Dt(yt);var Qt=Rt.ready().then(function(){var Wt=Rt._dbInfo;localStorage.removeItem(Wt.keyPrefix+yt)});return et(Qt,Et),Qt},clear:function(yt){var Et=this,Rt=Et.ready().then(function(){for(var Qt=Et._dbInfo.keyPrefix,Wt=localStorage.length-1;Wt>=0;Wt--){var Kt=localStorage.key(Wt);Kt.indexOf(Qt)===0&&localStorage.removeItem(Kt)}});return et(Rt,yt),Rt},length:function(yt){var Et=this.keys().then(function(Rt){return Rt.length});return et(Et,yt),Et},key:function(yt,Et){var Rt=this,Qt=Rt.ready().then(function(){var Wt,Kt=Rt._dbInfo;try{Wt=localStorage.key(yt)}catch{Wt=null}return Wt&&(Wt=Wt.substring(Kt.keyPrefix.length)),Wt});return et(Qt,Et),Qt},keys:function(yt){var Et=this,Rt=Et.ready().then(function(){for(var Qt=Et._dbInfo,Wt=localStorage.length,Kt=[],oe=0;oe<Wt;oe++){var Me=localStorage.key(oe);Me.indexOf(Qt.keyPrefix)===0&&Kt.push(Me.substring(Qt.keyPrefix.length))}return Kt});return et(Rt,yt),Rt},dropInstance:function(yt,Et){if(Et=At.apply(this,arguments),!(yt=typeof yt!="function"&&yt||{}).name){var Rt=this.config();yt.name=yt.name||Rt.name,yt.storeName=yt.storeName||Rt.storeName}var Qt,Wt=this;return et(Qt=yt.name?new X(function(Kt){yt.storeName?Kt(Ae(yt,Wt._defaultConfig)):Kt(yt.name+"/")}).then(function(Kt){for(var oe=localStorage.length-1;oe>=0;oe--){var Me=localStorage.key(oe);Me.indexOf(Kt)===0&&localStorage.removeItem(Me)}}):X.reject("Invalid arguments"),Et),Qt}},cn=function(yt,Et){for(var Rt,Qt,Wt=yt.length,Kt=0;Kt<Wt;){if((Rt=yt[Kt])===(Qt=Et)||typeof Rt=="number"&&typeof Qt=="number"&&isNaN(Rt)&&isNaN(Qt))return!0;Kt++}return!1},ke=Array.isArray||function(yt){return Object.prototype.toString.call(yt)==="[object Array]"},Ge={},Rn={},re={INDEXEDDB:vt,WEBSQL:Oe,LOCALSTORAGE:$e},pe=[re.INDEXEDDB._driver,re.WEBSQL._driver,re.LOCALSTORAGE._driver],Ee=["dropInstance"],ln=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Ee),In={description:"",driver:pe.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Kn(yt,Et){yt[Et]=function(){var Rt=arguments;return yt.ready().then(function(){return yt[Et].apply(yt,Rt)})}}function pi(){for(var yt=1;yt<arguments.length;yt++){var Et=arguments[yt];if(Et)for(var Rt in Et)Et.hasOwnProperty(Rt)&&(ke(Et[Rt])?arguments[0][Rt]=Et[Rt].slice():arguments[0][Rt]=Et[Rt])}return arguments[0]}var tn=new(function(){function yt(Et){for(var Rt in function(Kt,oe){if(!(Kt instanceof oe))throw new TypeError("Cannot call a class as a function")}(this,yt),re)if(re.hasOwnProperty(Rt)){var Qt=re[Rt],Wt=Qt._driver;this[Rt]=Wt,Ge[Wt]||this.defineDriver(Qt)}this._defaultConfig=pi({},In),this._config=pi({},this._defaultConfig,Et),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return yt.prototype.config=function(Et){if((Et===void 0?"undefined":k(Et))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var Rt in Et){if(Rt==="storeName"&&(Et[Rt]=Et[Rt].replace(/\W/g,"_")),Rt==="version"&&typeof Et[Rt]!="number")return new Error("Database version must be a number.");this._config[Rt]=Et[Rt]}return!("driver"in Et)||!Et.driver||this.setDriver(this._config.driver)}return typeof Et=="string"?this._config[Et]:this._config},yt.prototype.defineDriver=function(Et,Rt,Qt){var Wt=new X(function(Kt,oe){try{var Me=Et._driver,we=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!Et._driver)return void oe(we);for(var Se=ln.concat("_initStorage"),Ve=0,en=Se.length;Ve<en;Ve++){var dn=Se[Ve];if((!cn(Ee,dn)||Et[dn])&&typeof Et[dn]!="function")return void oe(we)}(function(){for(var yn=function(mo){return function(){var io=new Error("Method "+mo+" is not implemented by the current driver"),Fn=X.reject(io);return et(Fn,arguments[arguments.length-1]),Fn}},Xn=0,Pn=Ee.length;Xn<Pn;Xn++){var zi=Ee[Xn];Et[zi]||(Et[zi]=yn(zi))}})();var Tn=function(yn){Ge[Me]&&console.info("Redefining LocalForage driver: "+Me),Ge[Me]=Et,Rn[Me]=yn,Kt()};"_support"in Et?Et._support&&typeof Et._support=="function"?Et._support().then(Tn,oe):Tn(!!Et._support):Tn(!0)}catch(yn){oe(yn)}});return ft(Wt,Rt,Qt),Wt},yt.prototype.driver=function(){return this._driver||null},yt.prototype.getDriver=function(Et,Rt,Qt){var Wt=Ge[Et]?X.resolve(Ge[Et]):X.reject(new Error("Driver not found."));return ft(Wt,Rt,Qt),Wt},yt.prototype.getSerializer=function(Et){var Rt=X.resolve(Xt);return ft(Rt,Et),Rt},yt.prototype.ready=function(Et){var Rt=this,Qt=Rt._driverSet.then(function(){return Rt._ready===null&&(Rt._ready=Rt._initDriver()),Rt._ready});return ft(Qt,Et,Et),Qt},yt.prototype.setDriver=function(Et,Rt,Qt){var Wt=this;ke(Et)||(Et=[Et]);var Kt=this._getSupportedDrivers(Et);function oe(){Wt._config.driver=Wt.driver()}function Me(Se){return Wt._extend(Se),oe(),Wt._ready=Wt._initStorage(Wt._config),Wt._ready}var we=this._driverSet!==null?this._driverSet.catch(function(){return X.resolve()}):X.resolve();return this._driverSet=we.then(function(){var Se=Kt[0];return Wt._dbInfo=null,Wt._ready=null,Wt.getDriver(Se).then(function(Ve){Wt._driver=Ve._driver,oe(),Wt._wrapLibraryMethodsWithReady(),Wt._initDriver=function(en){return function(){var dn=0;return function Tn(){for(;dn<en.length;){var yn=en[dn];return dn++,Wt._dbInfo=null,Wt._ready=null,Wt.getDriver(yn).then(Me).catch(Tn)}oe();var Xn=new Error("No available storage method found.");return Wt._driverSet=X.reject(Xn),Wt._driverSet}()}}(Kt)})}).catch(function(){oe();var Se=new Error("No available storage method found.");return Wt._driverSet=X.reject(Se),Wt._driverSet}),ft(this._driverSet,Rt,Qt),this._driverSet},yt.prototype.supports=function(Et){return!!Rn[Et]},yt.prototype._extend=function(Et){pi(this,Et)},yt.prototype._getSupportedDrivers=function(Et){for(var Rt=[],Qt=0,Wt=Et.length;Qt<Wt;Qt++){var Kt=Et[Qt];this.supports(Kt)&&Rt.push(Kt)}return Rt},yt.prototype._wrapLibraryMethodsWithReady=function(){for(var Et=0,Rt=ln.length;Et<Rt;Et++)Kn(this,ln[Et])},yt.prototype.createInstance=function(Et){return new yt(Et)},yt}());I.exports=tn},{3:3}]},{},[4])(4)}).call(this,v(17))},function(b,w,v){var O=v(14).Symbol;b.exports=O},function(b,w){b.exports=function(v){return v.webpackPolyfill||(v.deprecate=function(){},v.paths=[],v.children||(v.children=[]),Object.defineProperty(v,"loaded",{enumerable:!0,get:function(){return v.l}}),Object.defineProperty(v,"id",{enumerable:!0,get:function(){return v.i}}),v.webpackPolyfill=1),v}},function(b,w,v){var O=v(152),M=v(153),I=v(154),D=v(155),k=v(156);function V(W){var X=-1,et=W==null?0:W.length;for(this.clear();++X<et;){var ft=W[X];this.set(ft[0],ft[1])}}V.prototype.clear=O,V.prototype.delete=M,V.prototype.get=I,V.prototype.has=D,V.prototype.set=k,b.exports=V},function(b,w,v){var O=v(36);b.exports=function(M,I){for(var D=M.length;D--;)if(O(M[D][0],I))return D;return-1}},function(b,w,v){var O=v(22)(Object,"create");b.exports=O},function(b,w,v){var O=v(174);b.exports=function(M,I){var D=M.__data__;return O(I)?D[typeof I=="string"?"string":"hash"]:D.map}},function(b,w){var v=Array.isArray;b.exports=v},function(b,w,v){var O=v(196),M=v(37),I=v(197),D=v(198),k=v(199),V=v(20),W=v(55),X=W(O),et=W(M),ft=W(I),Dt=W(D),At=W(k),L=V;(O&&L(new O(new ArrayBuffer(1)))!="[object DataView]"||M&&L(new M)!="[object Map]"||I&&L(I.resolve())!="[object Promise]"||D&&L(new D)!="[object Set]"||k&&L(new k)!="[object WeakMap]")&&(L=function(R){var B=V(R),Y=B=="[object Object]"?R.constructor:void 0,P=Y?W(Y):"";if(P)switch(P){case X:return"[object DataView]";case et:return"[object Map]";case ft:return"[object Promise]";case Dt:return"[object Set]";case At:return"[object WeakMap]"}return B}),b.exports=L},function(b,w,v){var O=v(68),M=v(69);b.exports=function(I,D,k,V){var W=!k;k||(k={});for(var X=-1,et=D.length;++X<et;){var ft=D[X],Dt=V?V(k[ft],I[ft],ft,k,I):void 0;Dt===void 0&&(Dt=I[ft]),W?M(k,ft,Dt):O(k,ft,Dt)}return k}},function(b,w,v){var O=v(20),M=v(21);b.exports=function(I){if(!M(I))return!1;var D=O(I);return D=="[object Function]"||D=="[object GeneratorFunction]"||D=="[object AsyncFunction]"||D=="[object Proxy]"}},function(b,w,v){(function(O){v.d(w,"a",function(){return Uh});var M=v(4),I=v(0),D=v(10),k=v(8),V=v(16),W=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:O!==void 0?O:typeof self!="undefined"?self:{};function X(T,d,c){return T(c={path:d,exports:{},require:function(f,S){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(S==null&&c.path)}},c.exports),c.exports}var et=X(function(T){var d=Object.prototype.hasOwnProperty,c="~";function f(){}function S(ut,It,Ut){this.fn=ut,this.context=It,this.once=Ut||!1}function F(ut,It,Ut,he,te){if(typeof Ut!="function")throw new TypeError("The listener must be a function");var me=new S(Ut,he||ut,te),xe=c?c+It:It;return ut._events[xe]?ut._events[xe].fn?ut._events[xe]=[ut._events[xe],me]:ut._events[xe].push(me):(ut._events[xe]=me,ut._eventsCount++),ut}function Z(ut,It){--ut._eventsCount==0?ut._events=new f:delete ut._events[It]}function ot(){this._events=new f,this._eventsCount=0}Object.create&&(f.prototype=Object.create(null),new f().__proto__||(c=!1)),ot.prototype.eventNames=function(){var ut,It,Ut=[];if(this._eventsCount===0)return Ut;for(It in ut=this._events)d.call(ut,It)&&Ut.push(c?It.slice(1):It);return Object.getOwnPropertySymbols?Ut.concat(Object.getOwnPropertySymbols(ut)):Ut},ot.prototype.listeners=function(ut){var It=c?c+ut:ut,Ut=this._events[It];if(!Ut)return[];if(Ut.fn)return[Ut.fn];for(var he=0,te=Ut.length,me=new Array(te);he<te;he++)me[he]=Ut[he].fn;return me},ot.prototype.listenerCount=function(ut){var It=c?c+ut:ut,Ut=this._events[It];return Ut?Ut.fn?1:Ut.length:0},ot.prototype.emit=function(ut,It,Ut,he,te,me){var xe=arguments,Be=c?c+ut:ut;if(!this._events[Be])return!1;var qe,Ye,Je=this._events[Be],je=arguments.length;if(Je.fn){switch(Je.once&&this.removeListener(ut,Je.fn,void 0,!0),je){case 1:return Je.fn.call(Je.context),!0;case 2:return Je.fn.call(Je.context,It),!0;case 3:return Je.fn.call(Je.context,It,Ut),!0;case 4:return Je.fn.call(Je.context,It,Ut,he),!0;case 5:return Je.fn.call(Je.context,It,Ut,he,te),!0;case 6:return Je.fn.call(Je.context,It,Ut,he,te,me),!0}for(Ye=1,qe=new Array(je-1);Ye<je;Ye++)qe[Ye-1]=xe[Ye];Je.fn.apply(Je.context,qe)}else{var pn,_n=Je.length;for(Ye=0;Ye<_n;Ye++)switch(Je[Ye].once&&this.removeListener(ut,Je[Ye].fn,void 0,!0),je){case 1:Je[Ye].fn.call(Je[Ye].context);break;case 2:Je[Ye].fn.call(Je[Ye].context,It);break;case 3:Je[Ye].fn.call(Je[Ye].context,It,Ut);break;case 4:Je[Ye].fn.call(Je[Ye].context,It,Ut,he);break;default:if(!qe)for(pn=1,qe=new Array(je-1);pn<je;pn++)qe[pn-1]=xe[pn];Je[Ye].fn.apply(Je[Ye].context,qe)}}return!0},ot.prototype.on=function(ut,It,Ut){return F(this,ut,It,Ut,!1)},ot.prototype.once=function(ut,It,Ut){return F(this,ut,It,Ut,!0)},ot.prototype.removeListener=function(ut,It,Ut,he){var te=c?c+ut:ut;if(!this._events[te])return this;if(!It)return Z(this,te),this;var me=this._events[te];if(me.fn)me.fn!==It||he&&!me.once||Ut&&me.context!==Ut||Z(this,te);else{for(var xe=0,Be=[],qe=me.length;xe<qe;xe++)(me[xe].fn!==It||he&&!me[xe].once||Ut&&me[xe].context!==Ut)&&Be.push(me[xe]);Be.length?this._events[te]=Be.length===1?Be[0]:Be:Z(this,te)}return this},ot.prototype.removeAllListeners=function(ut){var It;return ut?(It=c?c+ut:ut,this._events[It]&&Z(this,It)):(this._events=new f,this._eventsCount=0),this},ot.prototype.off=ot.prototype.removeListener,ot.prototype.addListener=ot.prototype.on,ot.prefixed=c,ot.EventEmitter=ot,T.exports=ot}),ft=X(function(T,d){(function(c){var f=d&&!d.nodeType&&d,S=T&&!T.nodeType&&T,F=typeof W=="object"&&W;F.global!==F&&F.window!==F&&F.self!==F||(c=F);var Z,ot,ut=2147483647,It=/^xn--/,Ut=/[^\x20-\x7E]/,he=/[\x2E\u3002\uFF0E\uFF61]/g,te={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},me=Math.floor,xe=String.fromCharCode;function Be(Xe){throw RangeError(te[Xe])}function qe(Xe,an){for(var bn=Xe.length,Gn=[];bn--;)Gn[bn]=an(Xe[bn]);return Gn}function Ye(Xe,an){var bn=Xe.split("@"),Gn="";return bn.length>1&&(Gn=bn[0]+"@",Xe=bn[1]),Gn+qe((Xe=Xe.replace(he,".")).split("."),an).join(".")}function Je(Xe){for(var an,bn,Gn=[],qn=0,Ti=Xe.length;qn<Ti;)(an=Xe.charCodeAt(qn++))>=55296&&an<=56319&&qn<Ti?(64512&(bn=Xe.charCodeAt(qn++)))==56320?Gn.push(((1023&an)<<10)+(1023&bn)+65536):(Gn.push(an),qn--):Gn.push(an);return Gn}function je(Xe){return qe(Xe,function(an){var bn="";return an>65535&&(bn+=xe((an-=65536)>>>10&1023|55296),an=56320|1023&an),bn+=xe(an)}).join("")}function pn(Xe,an){return Xe+22+75*(Xe<26)-((an!=0)<<5)}function _n(Xe,an,bn){var Gn=0;for(Xe=bn?me(Xe/700):Xe>>1,Xe+=me(Xe/an);Xe>455;Gn+=36)Xe=me(Xe/35);return me(Gn+36*Xe/(Xe+38))}function kn(Xe){var an,bn,Gn,qn,Ti,$n,vi,Ri,Xi,Bi,ni,Ei=[],Ui=Xe.length,ki=0,Qi=128,ii=72;for((bn=Xe.lastIndexOf("-"))<0&&(bn=0),Gn=0;Gn<bn;++Gn)Xe.charCodeAt(Gn)>=128&&Be("not-basic"),Ei.push(Xe.charCodeAt(Gn));for(qn=bn>0?bn+1:0;qn<Ui;){for(Ti=ki,$n=1,vi=36;qn>=Ui&&Be("invalid-input"),((Ri=(ni=Xe.charCodeAt(qn++))-48<10?ni-22:ni-65<26?ni-65:ni-97<26?ni-97:36)>=36||Ri>me((ut-ki)/$n))&&Be("overflow"),ki+=Ri*$n,!(Ri<(Xi=vi<=ii?1:vi>=ii+26?26:vi-ii));vi+=36)$n>me(ut/(Bi=36-Xi))&&Be("overflow"),$n*=Bi;ii=_n(ki-Ti,an=Ei.length+1,Ti==0),me(ki/an)>ut-Qi&&Be("overflow"),Qi+=me(ki/an),ki%=an,Ei.splice(ki++,0,Qi)}return je(Ei)}function Dn(Xe){var an,bn,Gn,qn,Ti,$n,vi,Ri,Xi,Bi,ni,Ei,Ui,ki,Qi,ii=[];for(Ei=(Xe=Je(Xe)).length,an=128,bn=0,Ti=72,$n=0;$n<Ei;++$n)(ni=Xe[$n])<128&&ii.push(xe(ni));for(Gn=qn=ii.length,qn&&ii.push("-");Gn<Ei;){for(vi=ut,$n=0;$n<Ei;++$n)(ni=Xe[$n])>=an&&ni<vi&&(vi=ni);for(vi-an>me((ut-bn)/(Ui=Gn+1))&&Be("overflow"),bn+=(vi-an)*Ui,an=vi,$n=0;$n<Ei;++$n)if((ni=Xe[$n])<an&&++bn>ut&&Be("overflow"),ni==an){for(Ri=bn,Xi=36;!(Ri<(Bi=Xi<=Ti?1:Xi>=Ti+26?26:Xi-Ti));Xi+=36)Qi=Ri-Bi,ki=36-Bi,ii.push(xe(pn(Bi+Qi%ki,0))),Ri=me(Qi/ki);ii.push(xe(pn(Ri,0))),Ti=_n(bn,Ui,Gn==qn),bn=0,++Gn}++bn,++an}return ii.join("")}if(Z={version:"1.3.2",ucs2:{decode:Je,encode:je},decode:kn,encode:Dn,toASCII:function(Xe){return Ye(Xe,function(an){return Ut.test(an)?"xn--"+Dn(an):an})},toUnicode:function(Xe){return Ye(Xe,function(an){return It.test(an)?kn(an.slice(4).toLowerCase()):an})}},f&&S)if(T.exports==f)S.exports=Z;else for(ot in Z)Z.hasOwnProperty(ot)&&(f[ot]=Z[ot]);else c.punycode=Z})(W)}),Dt=function(T){return typeof T=="string"},At=function(T){return typeof T=="object"&&T!==null},L=function(T){return T===null},R=function(T){return T==null};function B(T,d){return Object.prototype.hasOwnProperty.call(T,d)}var Y=function(T,d,c,f){d=d||"&",c=c||"=";var S={};if(typeof T!="string"||T.length===0)return S;var F=/\+/g;T=T.split(d);var Z=1e3;f&&typeof f.maxKeys=="number"&&(Z=f.maxKeys);var ot=T.length;Z>0&&ot>Z&&(ot=Z);for(var ut=0;ut<ot;++ut){var It,Ut,he,te,me=T[ut].replace(F,"%20"),xe=me.indexOf(c);xe>=0?(It=me.substr(0,xe),Ut=me.substr(xe+1)):(It=me,Ut=""),he=decodeURIComponent(It),te=decodeURIComponent(Ut),B(S,he)?Array.isArray(S[he])?S[he].push(te):S[he]=[S[he],te]:S[he]=te}return S},P=function(T){switch(typeof T){case"string":return T;case"boolean":return T?"true":"false";case"number":return isFinite(T)?T:"";default:return""}},H=function(T,d,c,f){return d=d||"&",c=c||"=",T===null&&(T=void 0),typeof T=="object"?Object.keys(T).map(function(S){var F=encodeURIComponent(P(S))+c;return Array.isArray(T[S])?T[S].map(function(Z){return F+encodeURIComponent(P(Z))}).join(d):F+encodeURIComponent(P(T[S]))}).join(d):f?encodeURIComponent(P(f))+c+encodeURIComponent(P(T)):""},tt=X(function(T,d){d.decode=d.parse=Y,d.encode=d.stringify=H}),G=Xt,Ot=function(T,d){return Xt(T,!1,!0).resolve(d)},zt=function(T){return Dt(T)&&(T=Xt(T)),T instanceof st?T.format():st.prototype.format.call(T)};function st(){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 z=/^([a-z0-9.+-]+:)/i,U=/:[0-9]*$/,dt=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,$=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
|
|
603
|
+
`," "]),vt=["'"].concat($),Lt=["%","/","?",";","#"].concat(vt),K=["/","?","#"],ct=/^[+a-z0-9A-Z_-]{0,63}$/,nt=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,_t={javascript:!0,"javascript:":!0},St={javascript:!0,"javascript:":!0},kt={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Xt(T,d,c){if(T&&At(T)&&T instanceof st)return T;var f=new st;return f.parse(T,d,c),f}st.prototype.parse=function(T,d,c){if(!Dt(T))throw new TypeError("Parameter 'url' must be a string, not "+typeof T);var f=T.indexOf("?"),S=f!==-1&&f<T.indexOf("#")?"?":"#",F=T.split(S);F[0]=F[0].replace(/\\/g,"/");var Z=T=F.join(S);if(Z=Z.trim(),!c&&T.split("#").length===1){var ot=dt.exec(Z);if(ot)return this.path=Z,this.href=Z,this.pathname=ot[1],ot[2]?(this.search=ot[2],this.query=d?tt.parse(this.search.substr(1)):this.search.substr(1)):d&&(this.search="",this.query={}),this}var ut=z.exec(Z);if(ut){var It=(ut=ut[0]).toLowerCase();this.protocol=It,Z=Z.substr(ut.length)}if(c||ut||Z.match(/^\/\/[^@\/]+@[^@\/]+/)){var Ut=Z.substr(0,2)==="//";!Ut||ut&&St[ut]||(Z=Z.substr(2),this.slashes=!0)}if(!St[ut]&&(Ut||ut&&!kt[ut])){for(var he,te,me=-1,xe=0;xe<K.length;xe++)(Be=Z.indexOf(K[xe]))!==-1&&(me===-1||Be<me)&&(me=Be);for((te=me===-1?Z.lastIndexOf("@"):Z.lastIndexOf("@",me))!==-1&&(he=Z.slice(0,te),Z=Z.slice(te+1),this.auth=decodeURIComponent(he)),me=-1,xe=0;xe<Lt.length;xe++){var Be;(Be=Z.indexOf(Lt[xe]))!==-1&&(me===-1||Be<me)&&(me=Be)}me===-1&&(me=Z.length),this.host=Z.slice(0,me),Z=Z.slice(me),this.parseHost(),this.hostname=this.hostname||"";var qe=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!qe)for(var Ye=this.hostname.split(/\./),Je=(xe=0,Ye.length);xe<Je;xe++){var je=Ye[xe];if(je&&!je.match(ct)){for(var pn="",_n=0,kn=je.length;_n<kn;_n++)je.charCodeAt(_n)>127?pn+="x":pn+=je[_n];if(!pn.match(ct)){var Dn=Ye.slice(0,xe),Xe=Ye.slice(xe+1),an=je.match(nt);an&&(Dn.push(an[1]),Xe.unshift(an[2])),Xe.length&&(Z="/"+Xe.join(".")+Z),this.hostname=Dn.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),qe||(this.hostname=ft.toASCII(this.hostname));var bn=this.port?":"+this.port:"",Gn=this.hostname||"";this.host=Gn+bn,this.href+=this.host,qe&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),Z[0]!=="/"&&(Z="/"+Z))}if(!_t[It])for(xe=0,Je=vt.length;xe<Je;xe++){var qn=vt[xe];if(Z.indexOf(qn)!==-1){var Ti=encodeURIComponent(qn);Ti===qn&&(Ti=escape(qn)),Z=Z.split(qn).join(Ti)}}var $n=Z.indexOf("#");$n!==-1&&(this.hash=Z.substr($n),Z=Z.slice(0,$n));var vi=Z.indexOf("?");if(vi!==-1?(this.search=Z.substr(vi),this.query=Z.substr(vi+1),d&&(this.query=tt.parse(this.query)),Z=Z.slice(0,vi)):d&&(this.search="",this.query={}),Z&&(this.pathname=Z),kt[It]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){bn=this.pathname||"";var Ri=this.search||"";this.path=bn+Ri}return this.href=this.format(),this},st.prototype.format=function(){var T=this.auth||"";T&&(T=(T=encodeURIComponent(T)).replace(/%3A/i,":"),T+="@");var d=this.protocol||"",c=this.pathname||"",f=this.hash||"",S=!1,F="";this.host?S=T+this.host:this.hostname&&(S=T+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(S+=":"+this.port)),this.query&&At(this.query)&&Object.keys(this.query).length&&(F=tt.stringify(this.query));var Z=this.search||F&&"?"+F||"";return d&&d.substr(-1)!==":"&&(d+=":"),this.slashes||(!d||kt[d])&&S!==!1?(S="//"+(S||""),c&&c.charAt(0)!=="/"&&(c="/"+c)):S||(S=""),f&&f.charAt(0)!=="#"&&(f="#"+f),Z&&Z.charAt(0)!=="?"&&(Z="?"+Z),d+S+(c=c.replace(/[?#]/g,function(ot){return encodeURIComponent(ot)}))+(Z=Z.replace("#","%23"))+f},st.prototype.resolve=function(T){return this.resolveObject(Xt(T,!1,!0)).format()},st.prototype.resolveObject=function(T){if(Dt(T)){var d=new st;d.parse(T,!1,!0),T=d}for(var c=new st,f=Object.keys(this),S=0;S<f.length;S++){var F=f[S];c[F]=this[F]}if(c.hash=T.hash,T.href==="")return c.href=c.format(),c;if(T.slashes&&!T.protocol){for(var Z=Object.keys(T),ot=0;ot<Z.length;ot++){var ut=Z[ot];ut!=="protocol"&&(c[ut]=T[ut])}return kt[c.protocol]&&c.hostname&&!c.pathname&&(c.path=c.pathname="/"),c.href=c.format(),c}if(T.protocol&&T.protocol!==c.protocol){if(!kt[T.protocol]){for(var It=Object.keys(T),Ut=0;Ut<It.length;Ut++){var he=It[Ut];c[he]=T[he]}return c.href=c.format(),c}if(c.protocol=T.protocol,T.host||St[T.protocol])c.pathname=T.pathname;else{for(var te=(T.pathname||"").split("/");te.length&&!(T.host=te.shift()););T.host||(T.host=""),T.hostname||(T.hostname=""),te[0]!==""&&te.unshift(""),te.length<2&&te.unshift(""),c.pathname=te.join("/")}if(c.search=T.search,c.query=T.query,c.host=T.host||"",c.auth=T.auth,c.hostname=T.hostname||T.host,c.port=T.port,c.pathname||c.search){var me=c.pathname||"",xe=c.search||"";c.path=me+xe}return c.slashes=c.slashes||T.slashes,c.href=c.format(),c}var Be=c.pathname&&c.pathname.charAt(0)==="/",qe=T.host||T.pathname&&T.pathname.charAt(0)==="/",Ye=qe||Be||c.host&&T.pathname,Je=Ye,je=c.pathname&&c.pathname.split("/")||[],pn=(te=T.pathname&&T.pathname.split("/")||[],c.protocol&&!kt[c.protocol]);if(pn&&(c.hostname="",c.port=null,c.host&&(je[0]===""?je[0]=c.host:je.unshift(c.host)),c.host="",T.protocol&&(T.hostname=null,T.port=null,T.host&&(te[0]===""?te[0]=T.host:te.unshift(T.host)),T.host=null),Ye=Ye&&(te[0]===""||je[0]==="")),qe)c.host=T.host||T.host===""?T.host:c.host,c.hostname=T.hostname||T.hostname===""?T.hostname:c.hostname,c.search=T.search,c.query=T.query,je=te;else if(te.length)je||(je=[]),je.pop(),je=je.concat(te),c.search=T.search,c.query=T.query;else if(!R(T.search))return pn&&(c.hostname=c.host=je.shift(),(an=!!(c.host&&c.host.indexOf("@")>0)&&c.host.split("@"))&&(c.auth=an.shift(),c.host=c.hostname=an.shift())),c.search=T.search,c.query=T.query,L(c.pathname)&&L(c.search)||(c.path=(c.pathname?c.pathname:"")+(c.search?c.search:"")),c.href=c.format(),c;if(!je.length)return c.pathname=null,c.search?c.path="/"+c.search:c.path=null,c.href=c.format(),c;for(var _n=je.slice(-1)[0],kn=(c.host||T.host||je.length>1)&&(_n==="."||_n==="..")||_n==="",Dn=0,Xe=je.length;Xe>=0;Xe--)(_n=je[Xe])==="."?je.splice(Xe,1):_n===".."?(je.splice(Xe,1),Dn++):Dn&&(je.splice(Xe,1),Dn--);if(!Ye&&!Je)for(;Dn--;Dn)je.unshift("..");!Ye||je[0]===""||je[0]&&je[0].charAt(0)==="/"||je.unshift(""),kn&&je.join("/").substr(-1)!=="/"&&je.push("");var an,bn=je[0]===""||je[0]&&je[0].charAt(0)==="/";return pn&&(c.hostname=c.host=bn?"":je.length?je.shift():"",(an=!!(c.host&&c.host.indexOf("@")>0)&&c.host.split("@"))&&(c.auth=an.shift(),c.host=c.hostname=an.shift())),(Ye=Ye||c.host&&je.length)&&!bn&&je.unshift(""),je.length?c.pathname=je.join("/"):(c.pathname=null,c.path=null),L(c.pathname)&&L(c.search)||(c.path=(c.pathname?c.pathname:"")+(c.search?c.search:"")),c.auth=T.auth||c.auth,c.slashes=c.slashes||T.slashes,c.href=c.format(),c},st.prototype.parseHost=function(){var T=this.host,d=U.exec(T);d&&((d=d[0])!==":"&&(this.port=d.substr(1)),T=T.substr(0,T.length-d.length)),T&&(this.hostname=T)};/*!
|
|
604
604
|
* @pixi/utils - v6.4.2
|
|
605
605
|
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
|
|
606
606
|
*
|
|
@@ -1059,8 +1059,8 @@ void main(void){
|
|
|
1059
1059
|
%forloop%
|
|
1060
1060
|
gl_FragColor = color * vColor;
|
|
1061
1061
|
}
|
|
1062
|
-
`;(function(){function T(){}return T.create=function(d){var c=Object.assign({vertex:Fi,fragment:ia,geometryClass:Wi,vertexSize:6},d),f=c.vertex,S=c.fragment,F=c.vertexSize,Z=c.geometryClass;return function(ot){function ut(It){var Ut=ot.call(this,It)||this;return Ut.shaderGenerator=new Co(f,S),Ut.geometryClass=Z,Ut.vertexSize=F,Ut}return Fn(ut,ot),ut}(hl)},Object.defineProperty(T,"defaultVertexSrc",{get:function(){return Fi},enumerable:!1,configurable:!0}),Object.defineProperty(T,"defaultFragmentTemplate",{get:function(){return ia},enumerable:!1,configurable:!0}),T})().create();var Uh=function(){function T(d){this.renderer=d}return T.prototype.render=function(d){var c=this.renderer,f=d.worldTransform;c.context.globalAlpha=d.worldAlpha,c.setBlendMode(d.blendMode),c.setContextTransform(f,d.roundPixels),d.drawMode!==I.f.TRIANGLES?this._renderTriangleMesh(d):this._renderTriangles(d)},T.prototype._renderTriangleMesh=function(d){for(var c=d.geometry.buffers[0].data.length,f=0;f<c-2;f++){var S=2*f;this._renderDrawTriangle(d,S,S+2,S+4)}},T.prototype._renderTriangles=function(d){for(var c=d.geometry.getIndex().data,f=c.length,S=0;S<f;S+=3){var F=2*c[S],Z=2*c[S+1],ot=2*c[S+2];this._renderDrawTriangle(d,F,Z,ot)}},T.prototype._renderDrawTriangle=function(d,c,f,S){var F=this.renderer.context,Z=d.geometry.buffers[0].data,ot=d.uvs,ut=d.texture;if(ut.valid){var It=d.tint!==16777215,Ut=ut.baseTexture,he=Ut.width,te=Ut.height;It&&d._cachedTint!==d.tint&&(d._cachedTint=d.tint,d._cachedTexture=d._cachedTexture||new yo(Ut),d._tintedCanvas=D.b.getTintedCanvas({texture:d._cachedTexture},d.tint));var me=It?d._tintedCanvas:Ut.getDrawableSource(),xe=ot[c]*Ut.width,Be=ot[f]*Ut.width,qe=ot[S]*Ut.width,Ye=ot[c+1]*Ut.height,Je=ot[f+1]*Ut.height,je=ot[S+1]*Ut.height,pn=Z[c],_n=Z[f],kn=Z[S],Dn=Z[c+1],Xe=Z[f+1],an=Z[S+1],bn=d.canvasPadding/this.renderer.resolution;if(bn>0){var Gn=d.worldTransform,qn=Gn.a,Ti=Gn.b,$n=Gn.c,vi=Gn.d,Ri=(pn+_n+kn)/3,Xi=(Dn+Xe+an)/3,Bi=pn-Ri,ni=Dn-Xi,Ei=qn*Bi+$n*ni,Ui=Ti*Bi+vi*ni,ki=Math.sqrt(Ei*Ei+Ui*Ui),Qi=1+bn/ki;pn=Ri+Bi*Qi,Dn=Xi+ni*Qi,Ei=qn*(Bi=_n-Ri)+$n*(ni=Xe-Xi),Ui=Ti*Bi+vi*ni,_n=Ri+Bi*(Qi=1+bn/(ki=Math.sqrt(Ei*Ei+Ui*Ui))),Xe=Xi+ni*Qi,Ei=qn*(Bi=kn-Ri)+$n*(ni=an-Xi),Ui=Ti*Bi+vi*ni,kn=Ri+Bi*(Qi=1+bn/(ki=Math.sqrt(Ei*Ei+Ui*Ui))),an=Xi+ni*Qi}F.save(),F.beginPath(),F.moveTo(pn,Dn),F.lineTo(_n,Xe),F.lineTo(kn,an),F.closePath(),F.clip();var ii=xe*Je+Ye*qe+Be*je-Je*qe-Ye*Be-xe*je,cl=pn*Je+Ye*kn+_n*je-Je*kn-Ye*_n-pn*je,kh=xe*_n+pn*qe+Be*kn-_n*qe-pn*Be-xe*kn,dl=xe*Je*kn+Ye*_n*qe+pn*Be*je-pn*Je*qe-Ye*Be*kn-xe*_n*je,pl=Dn*Je+Ye*an+Xe*je-Je*an-Ye*Xe-Dn*je,ns=xe*Xe+Dn*qe+Be*an-Xe*qe-Dn*Be-xe*an,Gh=xe*Je*an+Ye*Xe*qe+Dn*Be*je-Dn*Je*qe-Ye*Be*an-xe*Xe*je;F.transform(cl/ii,pl/ii,kh/ii,ns/ii,dl/ii,Gh/ii),F.drawImage(me,0,0,he*Ut.resolution,te*Ut.resolution,0,0,he,te),F.restore(),this.renderer.invalidateBlendMode()}},T.prototype.renderMeshFlat=function(d){var c=this.renderer.context,f=d.geometry.getBuffer("aVertexPosition").data,S=f.length/2;c.beginPath();for(var F=1;F<S-2;++F){var Z=2*F,ot=f[Z],ut=f[Z+1],It=f[Z+2],Ut=f[Z+3],he=f[Z+4],te=f[Z+5];c.moveTo(ot,ut),c.lineTo(It,Ut),c.lineTo(he,te)}c.fillStyle="#FF0000",c.fill(),c.closePath()},T.prototype.destroy=function(){this.renderer=null},T}();M.b.MESH_CANVAS_PADDING=0,k.c.prototype._renderCanvas=function(T,d){T.plugins.mesh.render(d)},
|
|
1063
|
-
`," "]),
|
|
1062
|
+
`;(function(){function T(){}return T.create=function(d){var c=Object.assign({vertex:Fi,fragment:ia,geometryClass:Wi,vertexSize:6},d),f=c.vertex,S=c.fragment,F=c.vertexSize,Z=c.geometryClass;return function(ot){function ut(It){var Ut=ot.call(this,It)||this;return Ut.shaderGenerator=new Co(f,S),Ut.geometryClass=Z,Ut.vertexSize=F,Ut}return Fn(ut,ot),ut}(hl)},Object.defineProperty(T,"defaultVertexSrc",{get:function(){return Fi},enumerable:!1,configurable:!0}),Object.defineProperty(T,"defaultFragmentTemplate",{get:function(){return ia},enumerable:!1,configurable:!0}),T})().create();var Uh=function(){function T(d){this.renderer=d}return T.prototype.render=function(d){var c=this.renderer,f=d.worldTransform;c.context.globalAlpha=d.worldAlpha,c.setBlendMode(d.blendMode),c.setContextTransform(f,d.roundPixels),d.drawMode!==I.f.TRIANGLES?this._renderTriangleMesh(d):this._renderTriangles(d)},T.prototype._renderTriangleMesh=function(d){for(var c=d.geometry.buffers[0].data.length,f=0;f<c-2;f++){var S=2*f;this._renderDrawTriangle(d,S,S+2,S+4)}},T.prototype._renderTriangles=function(d){for(var c=d.geometry.getIndex().data,f=c.length,S=0;S<f;S+=3){var F=2*c[S],Z=2*c[S+1],ot=2*c[S+2];this._renderDrawTriangle(d,F,Z,ot)}},T.prototype._renderDrawTriangle=function(d,c,f,S){var F=this.renderer.context,Z=d.geometry.buffers[0].data,ot=d.uvs,ut=d.texture;if(ut.valid){var It=d.tint!==16777215,Ut=ut.baseTexture,he=Ut.width,te=Ut.height;It&&d._cachedTint!==d.tint&&(d._cachedTint=d.tint,d._cachedTexture=d._cachedTexture||new yo(Ut),d._tintedCanvas=D.b.getTintedCanvas({texture:d._cachedTexture},d.tint));var me=It?d._tintedCanvas:Ut.getDrawableSource(),xe=ot[c]*Ut.width,Be=ot[f]*Ut.width,qe=ot[S]*Ut.width,Ye=ot[c+1]*Ut.height,Je=ot[f+1]*Ut.height,je=ot[S+1]*Ut.height,pn=Z[c],_n=Z[f],kn=Z[S],Dn=Z[c+1],Xe=Z[f+1],an=Z[S+1],bn=d.canvasPadding/this.renderer.resolution;if(bn>0){var Gn=d.worldTransform,qn=Gn.a,Ti=Gn.b,$n=Gn.c,vi=Gn.d,Ri=(pn+_n+kn)/3,Xi=(Dn+Xe+an)/3,Bi=pn-Ri,ni=Dn-Xi,Ei=qn*Bi+$n*ni,Ui=Ti*Bi+vi*ni,ki=Math.sqrt(Ei*Ei+Ui*Ui),Qi=1+bn/ki;pn=Ri+Bi*Qi,Dn=Xi+ni*Qi,Ei=qn*(Bi=_n-Ri)+$n*(ni=Xe-Xi),Ui=Ti*Bi+vi*ni,_n=Ri+Bi*(Qi=1+bn/(ki=Math.sqrt(Ei*Ei+Ui*Ui))),Xe=Xi+ni*Qi,Ei=qn*(Bi=kn-Ri)+$n*(ni=an-Xi),Ui=Ti*Bi+vi*ni,kn=Ri+Bi*(Qi=1+bn/(ki=Math.sqrt(Ei*Ei+Ui*Ui))),an=Xi+ni*Qi}F.save(),F.beginPath(),F.moveTo(pn,Dn),F.lineTo(_n,Xe),F.lineTo(kn,an),F.closePath(),F.clip();var ii=xe*Je+Ye*qe+Be*je-Je*qe-Ye*Be-xe*je,cl=pn*Je+Ye*kn+_n*je-Je*kn-Ye*_n-pn*je,kh=xe*_n+pn*qe+Be*kn-_n*qe-pn*Be-xe*kn,dl=xe*Je*kn+Ye*_n*qe+pn*Be*je-pn*Je*qe-Ye*Be*kn-xe*_n*je,pl=Dn*Je+Ye*an+Xe*je-Je*an-Ye*Xe-Dn*je,ns=xe*Xe+Dn*qe+Be*an-Xe*qe-Dn*Be-xe*an,Gh=xe*Je*an+Ye*Xe*qe+Dn*Be*je-Dn*Je*qe-Ye*Be*an-xe*Xe*je;F.transform(cl/ii,pl/ii,kh/ii,ns/ii,dl/ii,Gh/ii),F.drawImage(me,0,0,he*Ut.resolution,te*Ut.resolution,0,0,he,te),F.restore(),this.renderer.invalidateBlendMode()}},T.prototype.renderMeshFlat=function(d){var c=this.renderer.context,f=d.geometry.getBuffer("aVertexPosition").data,S=f.length/2;c.beginPath();for(var F=1;F<S-2;++F){var Z=2*F,ot=f[Z],ut=f[Z+1],It=f[Z+2],Ut=f[Z+3],he=f[Z+4],te=f[Z+5];c.moveTo(ot,ut),c.lineTo(It,Ut),c.lineTo(he,te)}c.fillStyle="#FF0000",c.fill(),c.closePath()},T.prototype.destroy=function(){this.renderer=null},T}();M.b.MESH_CANVAS_PADDING=0,k.c.prototype._renderCanvas=function(T,d){T.plugins.mesh.render(d)},V.a.prototype._cachedTint=16777215,V.a.prototype._tintedCanvas=null,V.a.prototype._canvasUvs=null,V.a.prototype._renderCanvas=function(T){var d=T.context,c=this.worldTransform,f=this.tint!==16777215,S=this.texture;if(S.valid){f&&this._cachedTint!==this.tint&&(this._cachedTint=this.tint,this._tintedCanvas=D.b.getTintedCanvas(this,this.tint));var F=f?this._tintedCanvas:S.baseTexture.getDrawableSource();this._canvasUvs||(this._canvasUvs=[0,0,0,0,0,0,0,0]);var Z=this.vertices,ot=this._canvasUvs,ut=f?0:S.frame.x,It=f?0:S.frame.y,Ut=ut+S.frame.width,he=It+S.frame.height;ot[0]=ut,ot[1]=ut+this._leftWidth,ot[2]=Ut-this._rightWidth,ot[3]=Ut,ot[4]=It,ot[5]=It+this._topHeight,ot[6]=he-this._bottomHeight,ot[7]=he;for(var te=0;te<8;te++)ot[te]*=S.baseTexture.resolution;d.globalAlpha=this.worldAlpha,T.setBlendMode(this.blendMode),T.setContextTransform(c,this.roundPixels);for(var me=0;me<3;me++)for(var xe=0;xe<3;xe++){var Be=2*xe+8*me,qe=Math.max(1,ot[xe+1]-ot[xe]),Ye=Math.max(1,ot[me+5]-ot[me+4]),Je=Math.max(1,Z[Be+10]-Z[Be]),je=Math.max(1,Z[Be+11]-Z[Be+1]);d.drawImage(F,ot[xe],ot[me+4],qe,Ye,Z[Be],Z[Be+1],Je,je)}}};var ul=!1;k.a.prototype._cachedTint=16777215,k.a.prototype._tintedCanvas=null,k.a.prototype._cachedTexture=null,k.a.prototype._renderCanvas=function(T){this.shader.uvMatrix&&(this.shader.uvMatrix.update(),this.calculateUvs()),this.material._renderCanvas?this.material._renderCanvas(T,this):ul||(ul=!0,globalThis.console&&console.warn("Mesh with custom shaders are not supported in CanvasRenderer."))},k.a.prototype._canvasPadding=null,Object.defineProperty(k.a.prototype,"canvasPadding",{get:function(){return this._canvasPadding!==null?this._canvasPadding:M.b.MESH_CANVAS_PADDING},set:function(T){this._canvasPadding=T}}),V.b.prototype._renderCanvas=function(T){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),this.shader.update&&this.shader.update(),this.calculateUvs(),this.material._renderCanvas(T,this)},V.c.prototype._renderCanvas=function(T){(this.autoUpdate||this.geometry._width!==this.shader.texture.height)&&(this.geometry._width=this.shader.texture.height,this.geometry.update()),this.shader.update&&this.shader.update(),this.calculateUvs(),this.material._renderCanvas(T,this)}}).call(this,v(17))},function(b,w,v){var O=v(143),M=v(144);function I(){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}w.parse=P,w.resolve=function(H,tt){return P(H,!1,!0).resolve(tt)},w.resolveObject=function(H,tt){return H?P(H,!1,!0).resolveObject(tt):tt},w.format=function(H){return M.isString(H)&&(H=P(H)),H instanceof I?H.format():I.prototype.format.call(H)},w.Url=I;var D=/^([a-z0-9.+-]+:)/i,k=/:[0-9]*$/,V=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,W=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
|
|
1063
|
+
`," "]),X=["'"].concat(W),et=["%","/","?",";","#"].concat(X),ft=["/","?","#"],Dt=/^[+a-z0-9A-Z_-]{0,63}$/,At=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,L={javascript:!0,"javascript:":!0},R={javascript:!0,"javascript:":!0},B={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},Y=v(145);function P(H,tt,G){if(H&&M.isObject(H)&&H instanceof I)return H;var Ot=new I;return Ot.parse(H,tt,G),Ot}I.prototype.parse=function(H,tt,G){if(!M.isString(H))throw new TypeError("Parameter 'url' must be a string, not "+typeof H);var Ot=H.indexOf("?"),zt=Ot!==-1&&Ot<H.indexOf("#")?"?":"#",st=H.split(zt);st[0]=st[0].replace(/\\/g,"/");var z=H=st.join(zt);if(z=z.trim(),!G&&H.split("#").length===1){var U=V.exec(z);if(U)return this.path=z,this.href=z,this.pathname=U[1],U[2]?(this.search=U[2],this.query=tt?Y.parse(this.search.substr(1)):this.search.substr(1)):tt&&(this.search="",this.query={}),this}var dt=D.exec(z);if(dt){var $=(dt=dt[0]).toLowerCase();this.protocol=$,z=z.substr(dt.length)}if(G||dt||z.match(/^\/\/[^@\/]+@[^@\/]+/)){var vt=z.substr(0,2)==="//";!vt||dt&&R[dt]||(z=z.substr(2),this.slashes=!0)}if(!R[dt]&&(vt||dt&&!B[dt])){for(var Lt,K,ct=-1,nt=0;nt<ft.length;nt++)(_t=z.indexOf(ft[nt]))!==-1&&(ct===-1||_t<ct)&&(ct=_t);for((K=ct===-1?z.lastIndexOf("@"):z.lastIndexOf("@",ct))!==-1&&(Lt=z.slice(0,K),z=z.slice(K+1),this.auth=decodeURIComponent(Lt)),ct=-1,nt=0;nt<et.length;nt++){var _t;(_t=z.indexOf(et[nt]))!==-1&&(ct===-1||_t<ct)&&(ct=_t)}ct===-1&&(ct=z.length),this.host=z.slice(0,ct),z=z.slice(ct),this.parseHost(),this.hostname=this.hostname||"";var St=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!St)for(var kt=this.hostname.split(/\./),Xt=(nt=0,kt.length);nt<Xt;nt++){var Jt=kt[nt];if(Jt&&!Jt.match(Dt)){for(var at="",_e=0,Ue=Jt.length;_e<Ue;_e++)Jt.charCodeAt(_e)>127?at+="x":at+=Jt[_e];if(!at.match(Dt)){var Oe=kt.slice(0,nt),Ae=kt.slice(nt+1),ze=Jt.match(At);ze&&(Oe.push(ze[1]),Ae.unshift(ze[2])),Ae.length&&(z="/"+Ae.join(".")+z),this.hostname=Oe.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),St||(this.hostname=O.toASCII(this.hostname));var $e=this.port?":"+this.port:"",cn=this.hostname||"";this.host=cn+$e,this.href+=this.host,St&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),z[0]!=="/"&&(z="/"+z))}if(!L[$])for(nt=0,Xt=X.length;nt<Xt;nt++){var ke=X[nt];if(z.indexOf(ke)!==-1){var Ge=encodeURIComponent(ke);Ge===ke&&(Ge=escape(ke)),z=z.split(ke).join(Ge)}}var Rn=z.indexOf("#");Rn!==-1&&(this.hash=z.substr(Rn),z=z.slice(0,Rn));var re=z.indexOf("?");if(re!==-1?(this.search=z.substr(re),this.query=z.substr(re+1),tt&&(this.query=Y.parse(this.query)),z=z.slice(0,re)):tt&&(this.search="",this.query={}),z&&(this.pathname=z),B[$]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){$e=this.pathname||"";var pe=this.search||"";this.path=$e+pe}return this.href=this.format(),this},I.prototype.format=function(){var H=this.auth||"";H&&(H=(H=encodeURIComponent(H)).replace(/%3A/i,":"),H+="@");var tt=this.protocol||"",G=this.pathname||"",Ot=this.hash||"",zt=!1,st="";this.host?zt=H+this.host:this.hostname&&(zt=H+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(zt+=":"+this.port)),this.query&&M.isObject(this.query)&&Object.keys(this.query).length&&(st=Y.stringify(this.query));var z=this.search||st&&"?"+st||"";return tt&&tt.substr(-1)!==":"&&(tt+=":"),this.slashes||(!tt||B[tt])&&zt!==!1?(zt="//"+(zt||""),G&&G.charAt(0)!=="/"&&(G="/"+G)):zt||(zt=""),Ot&&Ot.charAt(0)!=="#"&&(Ot="#"+Ot),z&&z.charAt(0)!=="?"&&(z="?"+z),tt+zt+(G=G.replace(/[?#]/g,function(U){return encodeURIComponent(U)}))+(z=z.replace("#","%23"))+Ot},I.prototype.resolve=function(H){return this.resolveObject(P(H,!1,!0)).format()},I.prototype.resolveObject=function(H){if(M.isString(H)){var tt=new I;tt.parse(H,!1,!0),H=tt}for(var G=new I,Ot=Object.keys(this),zt=0;zt<Ot.length;zt++){var st=Ot[zt];G[st]=this[st]}if(G.hash=H.hash,H.href==="")return G.href=G.format(),G;if(H.slashes&&!H.protocol){for(var z=Object.keys(H),U=0;U<z.length;U++){var dt=z[U];dt!=="protocol"&&(G[dt]=H[dt])}return B[G.protocol]&&G.hostname&&!G.pathname&&(G.path=G.pathname="/"),G.href=G.format(),G}if(H.protocol&&H.protocol!==G.protocol){if(!B[H.protocol]){for(var $=Object.keys(H),vt=0;vt<$.length;vt++){var Lt=$[vt];G[Lt]=H[Lt]}return G.href=G.format(),G}if(G.protocol=H.protocol,H.host||R[H.protocol])G.pathname=H.pathname;else{for(var K=(H.pathname||"").split("/");K.length&&!(H.host=K.shift()););H.host||(H.host=""),H.hostname||(H.hostname=""),K[0]!==""&&K.unshift(""),K.length<2&&K.unshift(""),G.pathname=K.join("/")}if(G.search=H.search,G.query=H.query,G.host=H.host||"",G.auth=H.auth,G.hostname=H.hostname||H.host,G.port=H.port,G.pathname||G.search){var ct=G.pathname||"",nt=G.search||"";G.path=ct+nt}return G.slashes=G.slashes||H.slashes,G.href=G.format(),G}var _t=G.pathname&&G.pathname.charAt(0)==="/",St=H.host||H.pathname&&H.pathname.charAt(0)==="/",kt=St||_t||G.host&&H.pathname,Xt=kt,Jt=G.pathname&&G.pathname.split("/")||[],at=(K=H.pathname&&H.pathname.split("/")||[],G.protocol&&!B[G.protocol]);if(at&&(G.hostname="",G.port=null,G.host&&(Jt[0]===""?Jt[0]=G.host:Jt.unshift(G.host)),G.host="",H.protocol&&(H.hostname=null,H.port=null,H.host&&(K[0]===""?K[0]=H.host:K.unshift(H.host)),H.host=null),kt=kt&&(K[0]===""||Jt[0]==="")),St)G.host=H.host||H.host===""?H.host:G.host,G.hostname=H.hostname||H.hostname===""?H.hostname:G.hostname,G.search=H.search,G.query=H.query,Jt=K;else if(K.length)Jt||(Jt=[]),Jt.pop(),Jt=Jt.concat(K),G.search=H.search,G.query=H.query;else if(!M.isNullOrUndefined(H.search))return at&&(G.hostname=G.host=Jt.shift(),(ze=!!(G.host&&G.host.indexOf("@")>0)&&G.host.split("@"))&&(G.auth=ze.shift(),G.host=G.hostname=ze.shift())),G.search=H.search,G.query=H.query,M.isNull(G.pathname)&&M.isNull(G.search)||(G.path=(G.pathname?G.pathname:"")+(G.search?G.search:"")),G.href=G.format(),G;if(!Jt.length)return G.pathname=null,G.search?G.path="/"+G.search:G.path=null,G.href=G.format(),G;for(var _e=Jt.slice(-1)[0],Ue=(G.host||H.host||Jt.length>1)&&(_e==="."||_e==="..")||_e==="",Oe=0,Ae=Jt.length;Ae>=0;Ae--)(_e=Jt[Ae])==="."?Jt.splice(Ae,1):_e===".."?(Jt.splice(Ae,1),Oe++):Oe&&(Jt.splice(Ae,1),Oe--);if(!kt&&!Xt)for(;Oe--;Oe)Jt.unshift("..");!kt||Jt[0]===""||Jt[0]&&Jt[0].charAt(0)==="/"||Jt.unshift(""),Ue&&Jt.join("/").substr(-1)!=="/"&&Jt.push("");var ze,$e=Jt[0]===""||Jt[0]&&Jt[0].charAt(0)==="/";return at&&(G.hostname=G.host=$e?"":Jt.length?Jt.shift():"",(ze=!!(G.host&&G.host.indexOf("@")>0)&&G.host.split("@"))&&(G.auth=ze.shift(),G.host=G.hostname=ze.shift())),(kt=kt||G.host&&Jt.length)&&!$e&&Jt.unshift(""),Jt.length?G.pathname=Jt.join("/"):(G.pathname=null,G.path=null),M.isNull(G.pathname)&&M.isNull(G.search)||(G.path=(G.pathname?G.pathname:"")+(G.search?G.search:"")),G.auth=H.auth||G.auth,G.slashes=G.slashes||H.slashes,G.href=G.format(),G},I.prototype.parseHost=function(){var H=this.host,tt=k.exec(H);tt&&((tt=tt[0])!==":"&&(this.port=tt.substr(1)),H=H.substr(0,H.length-tt.length)),H&&(this.hostname=H)}},function(b,w){b.exports=function(v,O){return v===O||v!=v&&O!=O}},function(b,w,v){var O=v(22)(v(14),"Map");b.exports=O},function(b,w,v){var O=v(187),M=v(62),I=Object.prototype.propertyIsEnumerable,D=Object.getOwnPropertySymbols,k=D?function(V){return V==null?[]:(V=Object(V),O(D(V),function(W){return I.call(V,W)}))}:M;b.exports=k},function(b,w,v){var O=v(63),M=v(194),I=v(67);b.exports=function(D){return I(D)?O(D):M(D)}},function(b,w,v){(function(O){var M=v(14),I=v(191),D=w&&!w.nodeType&&w,k=D&&typeof O=="object"&&O&&!O.nodeType&&O,V=k&&k.exports===D?M.Buffer:void 0,W=(V?V.isBuffer:void 0)||I;O.exports=W}).call(this,v(25)(b))},function(b,w){b.exports=function(v){return function(O){return v(O)}}},function(b,w,v){(function(O){var M=v(51),I=w&&!w.nodeType&&w,D=I&&typeof O=="object"&&O&&!O.nodeType&&O,k=D&&D.exports===I&&M.process,V=function(){try{var W=D&&D.require&&D.require("util").types;return W||k&&k.binding&&k.binding("util")}catch{}}();O.exports=V}).call(this,v(25)(b))},function(b,w){var v=Object.prototype;b.exports=function(O){var M=O&&O.constructor;return O===(typeof M=="function"&&M.prototype||v)}},function(b,w,v){var O=v(63),M=v(210),I=v(67);b.exports=function(D){return I(D)?O(D,!0):M(D)}},function(b,w,v){var O=v(58);b.exports=function(M){var I=new M.constructor(M.byteLength);return new O(I).set(new O(M)),I}},function(b,w){b.exports=`#define PI 3.14159265
|
|
1064
1064
|
uniform float galleryHeight;
|
|
1065
1065
|
varying vec2 vUv;
|
|
1066
1066
|
varying float vPixelY;
|
|
@@ -1104,7 +1104,7 @@ void main() {
|
|
|
1104
1104
|
}
|
|
1105
1105
|
gl_FragColor = color;
|
|
1106
1106
|
}
|
|
1107
|
-
`},function(b,w,v){var O=v(148);b.exports=function(M,I){I=I||{};var D=new O,k=I.inPlace||!1,z=M.map(function(Y){return k?Y:{width:Y.width,height:Y.height,item:Y}});z=z.sort(function(Y,et){return et.width*et.height-Y.width*Y.height}),D.fit(z);var W={width:z.reduce(function(Y,et){return Math.max(Y,et.x+et.width)},0),height:z.reduce(function(Y,et){return Math.max(Y,et.y+et.height)},0)};return k||(W.items=z),W}},function(b,w,v){var O=v(21),M=v(200),I=v(201),D=Math.max,k=Math.min;b.exports=function(z,W,Y){var et,ft,Dt,At,L,R,B=0,X=!1,P=!1,H=!0;if(typeof z!="function")throw new TypeError("Expected a function");function tt(U){var dt=et,$=ft;return et=ft=void 0,B=U,At=z.apply($,dt)}function G(U){return B=U,L=setTimeout(zt,W),X?tt(U):At}function Ot(U){var dt=U-R;return R===void 0||dt>=W||dt<0||P&&U-B>=Dt}function zt(){var U=M();if(Ot(U))return st(U);L=setTimeout(zt,function(dt){var $=W-(dt-R);return P?k($,Dt-(dt-B)):$}(U))}function st(U){return L=void 0,H&&et?tt(U):(et=ft=void 0,At)}function V(){var U=M(),dt=Ot(U);if(et=arguments,ft=this,R=U,dt){if(L===void 0)return G(R);if(P)return clearTimeout(L),L=setTimeout(zt,W),tt(R)}return L===void 0&&(L=setTimeout(zt,W)),At}return W=I(W)||0,O(Y)&&(X=!!Y.leading,Dt=(P="maxWait"in Y)?D(I(Y.maxWait)||0,W):Dt,H="trailing"in Y?!!Y.trailing:H),V.cancel=function(){L!==void 0&&clearTimeout(L),B=0,et=R=ft=L=void 0},V.flush=function(){return L===void 0?At:st(M())},V}},function(b,w,v){var O=v(205);b.exports=function(M){return O(M,5)}},function(b,w,v){(function(O){var M=typeof O=="object"&&O&&O.Object===Object&&O;b.exports=M}).call(this,v(17))},function(b,w,v){var O=Object.prototype.hasOwnProperty,M="~";function I(){}function D(Y,et,ft){this.fn=Y,this.context=et,this.once=ft||!1}function k(Y,et,ft,Dt,At){if(typeof ft!="function")throw new TypeError("The listener must be a function");var L=new D(ft,Dt||Y,At),R=M?M+et:et;return Y._events[R]?Y._events[R].fn?Y._events[R]=[Y._events[R],L]:Y._events[R].push(L):(Y._events[R]=L,Y._eventsCount++),Y}function z(Y,et){--Y._eventsCount==0?Y._events=new I:delete Y._events[et]}function W(){this._events=new I,this._eventsCount=0}Object.create&&(I.prototype=Object.create(null),new I().__proto__||(M=!1)),W.prototype.eventNames=function(){var Y,et,ft=[];if(this._eventsCount===0)return ft;for(et in Y=this._events)O.call(Y,et)&&ft.push(M?et.slice(1):et);return Object.getOwnPropertySymbols?ft.concat(Object.getOwnPropertySymbols(Y)):ft},W.prototype.listeners=function(Y){var et=M?M+Y:Y,ft=this._events[et];if(!ft)return[];if(ft.fn)return[ft.fn];for(var Dt=0,At=ft.length,L=new Array(At);Dt<At;Dt++)L[Dt]=ft[Dt].fn;return L},W.prototype.listenerCount=function(Y){var et=M?M+Y:Y,ft=this._events[et];return ft?ft.fn?1:ft.length:0},W.prototype.emit=function(Y,et,ft,Dt,At,L){var R=M?M+Y:Y;if(!this._events[R])return!1;var B,X,P=this._events[R],H=arguments.length;if(P.fn){switch(P.once&&this.removeListener(Y,P.fn,void 0,!0),H){case 1:return P.fn.call(P.context),!0;case 2:return P.fn.call(P.context,et),!0;case 3:return P.fn.call(P.context,et,ft),!0;case 4:return P.fn.call(P.context,et,ft,Dt),!0;case 5:return P.fn.call(P.context,et,ft,Dt,At),!0;case 6:return P.fn.call(P.context,et,ft,Dt,At,L),!0}for(X=1,B=new Array(H-1);X<H;X++)B[X-1]=arguments[X];P.fn.apply(P.context,B)}else{var tt,G=P.length;for(X=0;X<G;X++)switch(P[X].once&&this.removeListener(Y,P[X].fn,void 0,!0),H){case 1:P[X].fn.call(P[X].context);break;case 2:P[X].fn.call(P[X].context,et);break;case 3:P[X].fn.call(P[X].context,et,ft);break;case 4:P[X].fn.call(P[X].context,et,ft,Dt);break;default:if(!B)for(tt=1,B=new Array(H-1);tt<H;tt++)B[tt-1]=arguments[tt];P[X].fn.apply(P[X].context,B)}}return!0},W.prototype.on=function(Y,et,ft){return k(this,Y,et,ft,!1)},W.prototype.once=function(Y,et,ft){return k(this,Y,et,ft,!0)},W.prototype.removeListener=function(Y,et,ft,Dt){var At=M?M+Y:Y;if(!this._events[At])return this;if(!et)return z(this,At),this;var L=this._events[At];if(L.fn)L.fn!==et||Dt&&!L.once||ft&&L.context!==ft||z(this,At);else{for(var R=0,B=[],X=L.length;R<X;R++)(L[R].fn!==et||Dt&&!L[R].once||ft&&L[R].context!==ft)&&B.push(L[R]);B.length?this._events[At]=B.length===1?B[0]:B:z(this,At)}return this},W.prototype.removeAllListeners=function(Y){var et;return Y?(et=M?M+Y:Y,this._events[et]&&z(this,et)):(this._events=new I,this._eventsCount=0),this},W.prototype.off=W.prototype.removeListener,W.prototype.addListener=W.prototype.on,W.prefixed=M,W.EventEmitter=W,b.exports=W},function(b,w,v){function O($,vt,Lt){Lt=Lt||2;var K,ct,nt,_t,St,kt,Xt,Jt=vt&&vt.length,at=Jt?vt[0]*Lt:$.length,_e=M($,0,at,Lt,!0),Ue=[];if(!_e||_e.next===_e.prev)return Ue;if(Jt&&(_e=function(Ae,ze,$e,cn){var ke,Ge,Rn,re,pe,Ee=[];for(ke=0,Ge=ze.length;ke<Ge;ke++)Rn=ze[ke]*cn,re=ke<Ge-1?ze[ke+1]*cn:Ae.length,(pe=M(Ae,Rn,re,cn,!1))===pe.next&&(pe.steiner=!0),Ee.push(L(pe));for(Ee.sort(et),ke=0;ke<Ee.length;ke++)$e=ft(Ee[ke],$e);return $e}($,vt,_e,Lt)),$.length>80*Lt){K=nt=$[0],ct=_t=$[1];for(var Oe=Lt;Oe<at;Oe+=Lt)(St=$[Oe])<K&&(K=St),(kt=$[Oe+1])<ct&&(ct=kt),St>nt&&(nt=St),kt>_t&&(_t=kt);Xt=(Xt=Math.max(nt-K,_t-ct))!==0?32767/Xt:0}return D(_e,Ue,Lt,K,ct,Xt,0),Ue}function M($,vt,Lt,K,ct){var nt,_t;if(ct===dt($,vt,Lt,K)>0)for(nt=vt;nt<Lt;nt+=K)_t=st(nt,$[nt],$[nt+1],_t);else for(nt=Lt-K;nt>=vt;nt-=K)_t=st(nt,$[nt],$[nt+1],_t);return _t&&P(_t,_t.next)&&(V(_t),_t=_t.next),_t}function I($,vt){if(!$)return $;vt||(vt=$);var Lt,K=$;do if(Lt=!1,K.steiner||!P(K,K.next)&&X(K.prev,K,K.next)!==0)K=K.next;else{if(V(K),(K=vt=K.prev)===K.next)break;Lt=!0}while(Lt||K!==vt);return vt}function D($,vt,Lt,K,ct,nt,_t){if($){!_t&&nt&&function(Jt,at,_e,Ue){var Oe=Jt;do Oe.z===0&&(Oe.z=At(Oe.x,Oe.y,at,_e,Ue)),Oe.prevZ=Oe.prev,Oe.nextZ=Oe.next,Oe=Oe.next;while(Oe!==Jt);Oe.prevZ.nextZ=null,Oe.prevZ=null,function(Ae){var ze,$e,cn,ke,Ge,Rn,re,pe,Ee=1;do{for($e=Ae,Ae=null,Ge=null,Rn=0;$e;){for(Rn++,cn=$e,re=0,ze=0;ze<Ee&&(re++,cn=cn.nextZ);ze++);for(pe=Ee;re>0||pe>0&&cn;)re!==0&&(pe===0||!cn||$e.z<=cn.z)?(ke=$e,$e=$e.nextZ,re--):(ke=cn,cn=cn.nextZ,pe--),Ge?Ge.nextZ=ke:Ae=ke,ke.prevZ=Ge,Ge=ke;$e=cn}Ge.nextZ=null,Ee*=2}while(Rn>1)}(Oe)}($,K,ct,nt);for(var St,kt,Xt=$;$.prev!==$.next;)if(St=$.prev,kt=$.next,nt?z($,K,ct,nt):k($))vt.push(St.i/Lt|0),vt.push($.i/Lt|0),vt.push(kt.i/Lt|0),V($),$=kt.next,Xt=kt.next;else if(($=kt)===Xt){_t?_t===1?D($=W(I($),vt,Lt),vt,Lt,K,ct,nt,2):_t===2&&Y($,vt,Lt,K,ct,nt):D(I($),vt,Lt,K,ct,nt,1);break}}}function k($){var vt=$.prev,Lt=$,K=$.next;if(X(vt,Lt,K)>=0)return!1;for(var ct=vt.x,nt=Lt.x,_t=K.x,St=vt.y,kt=Lt.y,Xt=K.y,Jt=ct<nt?ct<_t?ct:_t:nt<_t?nt:_t,at=St<kt?St<Xt?St:Xt:kt<Xt?kt:Xt,_e=ct>nt?ct>_t?ct:_t:nt>_t?nt:_t,Ue=St>kt?St>Xt?St:Xt:kt>Xt?kt:Xt,Oe=K.next;Oe!==vt;){if(Oe.x>=Jt&&Oe.x<=_e&&Oe.y>=at&&Oe.y<=Ue&&R(ct,St,nt,kt,_t,Xt,Oe.x,Oe.y)&&X(Oe.prev,Oe,Oe.next)>=0)return!1;Oe=Oe.next}return!0}function z($,vt,Lt,K){var ct=$.prev,nt=$,_t=$.next;if(X(ct,nt,_t)>=0)return!1;for(var St=ct.x,kt=nt.x,Xt=_t.x,Jt=ct.y,at=nt.y,_e=_t.y,Ue=St<kt?St<Xt?St:Xt:kt<Xt?kt:Xt,Oe=Jt<at?Jt<_e?Jt:_e:at<_e?at:_e,Ae=St>kt?St>Xt?St:Xt:kt>Xt?kt:Xt,ze=Jt>at?Jt>_e?Jt:_e:at>_e?at:_e,$e=At(Ue,Oe,vt,Lt,K),cn=At(Ae,ze,vt,Lt,K),ke=$.prevZ,Ge=$.nextZ;ke&&ke.z>=$e&&Ge&&Ge.z<=cn;){if(ke.x>=Ue&&ke.x<=Ae&&ke.y>=Oe&&ke.y<=ze&&ke!==ct&&ke!==_t&&R(St,Jt,kt,at,Xt,_e,ke.x,ke.y)&&X(ke.prev,ke,ke.next)>=0||(ke=ke.prevZ,Ge.x>=Ue&&Ge.x<=Ae&&Ge.y>=Oe&&Ge.y<=ze&&Ge!==ct&&Ge!==_t&&R(St,Jt,kt,at,Xt,_e,Ge.x,Ge.y)&&X(Ge.prev,Ge,Ge.next)>=0))return!1;Ge=Ge.nextZ}for(;ke&&ke.z>=$e;){if(ke.x>=Ue&&ke.x<=Ae&&ke.y>=Oe&&ke.y<=ze&&ke!==ct&&ke!==_t&&R(St,Jt,kt,at,Xt,_e,ke.x,ke.y)&&X(ke.prev,ke,ke.next)>=0)return!1;ke=ke.prevZ}for(;Ge&&Ge.z<=cn;){if(Ge.x>=Ue&&Ge.x<=Ae&&Ge.y>=Oe&&Ge.y<=ze&&Ge!==ct&&Ge!==_t&&R(St,Jt,kt,at,Xt,_e,Ge.x,Ge.y)&&X(Ge.prev,Ge,Ge.next)>=0)return!1;Ge=Ge.nextZ}return!0}function W($,vt,Lt){var K=$;do{var ct=K.prev,nt=K.next.next;!P(ct,nt)&&H(ct,K,K.next,nt)&&Ot(ct,nt)&&Ot(nt,ct)&&(vt.push(ct.i/Lt|0),vt.push(K.i/Lt|0),vt.push(nt.i/Lt|0),V(K),V(K.next),K=$=nt),K=K.next}while(K!==$);return I(K)}function Y($,vt,Lt,K,ct,nt){var _t=$;do{for(var St=_t.next.next;St!==_t.prev;){if(_t.i!==St.i&&B(_t,St)){var kt=zt(_t,St);return _t=I(_t,_t.next),kt=I(kt,kt.next),D(_t,vt,Lt,K,ct,nt,0),void D(kt,vt,Lt,K,ct,nt,0)}St=St.next}_t=_t.next}while(_t!==$)}function et($,vt){return $.x-vt.x}function ft($,vt){var Lt=function(ct,nt){var _t,St=nt,kt=ct.x,Xt=ct.y,Jt=-1/0;do{if(Xt<=St.y&&Xt>=St.next.y&&St.next.y!==St.y){var at=St.x+(Xt-St.y)*(St.next.x-St.x)/(St.next.y-St.y);if(at<=kt&&at>Jt&&(Jt=at,_t=St.x<St.next.x?St:St.next,at===kt))return _t}St=St.next}while(St!==nt);if(!_t)return null;var _e,Ue=_t,Oe=_t.x,Ae=_t.y,ze=1/0;St=_t;do kt>=St.x&&St.x>=Oe&&kt!==St.x&&R(Xt<Ae?kt:Jt,Xt,Oe,Ae,Xt<Ae?Jt:kt,Xt,St.x,St.y)&&(_e=Math.abs(Xt-St.y)/(kt-St.x),Ot(St,ct)&&(_e<ze||_e===ze&&(St.x>_t.x||St.x===_t.x&&Dt(_t,St)))&&(_t=St,ze=_e)),St=St.next;while(St!==Ue);return _t}($,vt);if(!Lt)return vt;var K=zt(Lt,$);return I(K,K.next),I(Lt,Lt.next)}function Dt($,vt){return X($.prev,$,vt.prev)<0&&X(vt.next,$,$.next)<0}function At($,vt,Lt,K,ct){return($=1431655765&(($=858993459&(($=252645135&(($=16711935&(($=($-Lt)*ct|0)|$<<8))|$<<4))|$<<2))|$<<1))|(vt=1431655765&((vt=858993459&((vt=252645135&((vt=16711935&((vt=(vt-K)*ct|0)|vt<<8))|vt<<4))|vt<<2))|vt<<1))<<1}function L($){var vt=$,Lt=$;do(vt.x<Lt.x||vt.x===Lt.x&&vt.y<Lt.y)&&(Lt=vt),vt=vt.next;while(vt!==$);return Lt}function R($,vt,Lt,K,ct,nt,_t,St){return(ct-_t)*(vt-St)>=($-_t)*(nt-St)&&($-_t)*(K-St)>=(Lt-_t)*(vt-St)&&(Lt-_t)*(nt-St)>=(ct-_t)*(K-St)}function B($,vt){return $.next.i!==vt.i&&$.prev.i!==vt.i&&!function(Lt,K){var ct=Lt;do{if(ct.i!==Lt.i&&ct.next.i!==Lt.i&&ct.i!==K.i&&ct.next.i!==K.i&&H(ct,ct.next,Lt,K))return!0;ct=ct.next}while(ct!==Lt);return!1}($,vt)&&(Ot($,vt)&&Ot(vt,$)&&function(Lt,K){var ct=Lt,nt=!1,_t=(Lt.x+K.x)/2,St=(Lt.y+K.y)/2;do ct.y>St!=ct.next.y>St&&ct.next.y!==ct.y&&_t<(ct.next.x-ct.x)*(St-ct.y)/(ct.next.y-ct.y)+ct.x&&(nt=!nt),ct=ct.next;while(ct!==Lt);return nt}($,vt)&&(X($.prev,$,vt.prev)||X($,vt.prev,vt))||P($,vt)&&X($.prev,$,$.next)>0&&X(vt.prev,vt,vt.next)>0)}function X($,vt,Lt){return(vt.y-$.y)*(Lt.x-vt.x)-(vt.x-$.x)*(Lt.y-vt.y)}function P($,vt){return $.x===vt.x&&$.y===vt.y}function H($,vt,Lt,K){var ct=G(X($,vt,Lt)),nt=G(X($,vt,K)),_t=G(X(Lt,K,$)),St=G(X(Lt,K,vt));return ct!==nt&&_t!==St||!(ct!==0||!tt($,Lt,vt))||!(nt!==0||!tt($,K,vt))||!(_t!==0||!tt(Lt,$,K))||!(St!==0||!tt(Lt,vt,K))}function tt($,vt,Lt){return vt.x<=Math.max($.x,Lt.x)&&vt.x>=Math.min($.x,Lt.x)&&vt.y<=Math.max($.y,Lt.y)&&vt.y>=Math.min($.y,Lt.y)}function G($){return $>0?1:$<0?-1:0}function Ot($,vt){return X($.prev,$,$.next)<0?X($,vt,$.next)>=0&&X($,$.prev,vt)>=0:X($,vt,$.prev)<0||X($,$.next,vt)<0}function zt($,vt){var Lt=new U($.i,$.x,$.y),K=new U(vt.i,vt.x,vt.y),ct=$.next,nt=vt.prev;return $.next=vt,vt.prev=$,Lt.next=ct,ct.prev=Lt,K.next=Lt,Lt.prev=K,nt.next=K,K.prev=nt,K}function st($,vt,Lt,K){var ct=new U($,vt,Lt);return K?(ct.next=K.next,ct.prev=K,K.next.prev=ct,K.next=ct):(ct.prev=ct,ct.next=ct),ct}function V($){$.next.prev=$.prev,$.prev.next=$.next,$.prevZ&&($.prevZ.nextZ=$.nextZ),$.nextZ&&($.nextZ.prevZ=$.prevZ)}function U($,vt,Lt){this.i=$,this.x=vt,this.y=Lt,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function dt($,vt,Lt,K){for(var ct=0,nt=vt,_t=Lt-K;nt<Lt;nt+=K)ct+=($[_t]-$[nt])*($[nt+1]+$[_t+1]),_t=nt;return ct}b.exports=O,b.exports.default=O,O.deviation=function($,vt,Lt,K){var ct=vt&&vt.length,nt=ct?vt[0]*Lt:$.length,_t=Math.abs(dt($,0,nt,Lt));if(ct)for(var St=0,kt=vt.length;St<kt;St++){var Xt=vt[St]*Lt,Jt=St<kt-1?vt[St+1]*Lt:$.length;_t-=Math.abs(dt($,Xt,Jt,Lt))}var at=0;for(St=0;St<K.length;St+=3){var _e=K[St]*Lt,Ue=K[St+1]*Lt,Oe=K[St+2]*Lt;at+=Math.abs(($[_e]-$[Oe])*($[Ue+1]-$[_e+1])-($[_e]-$[Ue])*($[Oe+1]-$[_e+1]))}return _t===0&&at===0?0:Math.abs((at-_t)/_t)},O.flatten=function($){for(var vt=$[0][0].length,Lt={vertices:[],holes:[],dimensions:vt},K=0,ct=0;ct<$.length;ct++){for(var nt=0;nt<$[ct].length;nt++)for(var _t=0;_t<vt;_t++)Lt.vertices.push($[ct][nt][_t]);ct>0&&(K+=$[ct-1].length,Lt.holes.push(K))}return Lt}},function(b,w,v){var O=v(26),M=v(157),I=v(158),D=v(159),k=v(160),z=v(161);function W(Y){var et=this.__data__=new O(Y);this.size=et.size}W.prototype.clear=M,W.prototype.delete=I,W.prototype.get=D,W.prototype.has=k,W.prototype.set=z,b.exports=W},function(b,w){var v=Function.prototype.toString;b.exports=function(O){if(O!=null){try{return v.call(O)}catch{}try{return O+""}catch{}}return""}},function(b,w,v){var O=v(166),M=v(173),I=v(175),D=v(176),k=v(177);function z(W){var Y=-1,et=W==null?0:W.length;for(this.clear();++Y<et;){var ft=W[Y];this.set(ft[0],ft[1])}}z.prototype.clear=O,z.prototype.delete=M,z.prototype.get=I,z.prototype.has=D,z.prototype.set=k,b.exports=z},function(b,w,v){var O=v(178),M=v(181),I=v(182);b.exports=function(D,k,z,W,Y,et){var ft=1&z,Dt=D.length,At=k.length;if(Dt!=At&&!(ft&&At>Dt))return!1;var L=et.get(D),R=et.get(k);if(L&&R)return L==k&&R==D;var B=-1,X=!0,P=2&z?new O:void 0;for(et.set(D,k),et.set(k,D);++B<Dt;){var H=D[B],tt=k[B];if(W)var G=ft?W(tt,H,B,k,D,et):W(H,tt,B,D,k,et);if(G!==void 0){if(G)continue;X=!1;break}if(P){if(!M(k,function(Ot,zt){if(!I(P,zt)&&(H===Ot||Y(H,Ot,z,W,et)))return P.push(zt)})){X=!1;break}}else if(H!==tt&&!Y(H,tt,z,W,et)){X=!1;break}}return et.delete(D),et.delete(k),X}},function(b,w,v){var O=v(14).Uint8Array;b.exports=O},function(b,w,v){var O=v(60),M=v(38),I=v(39);b.exports=function(D){return O(D,I,M)}},function(b,w,v){var O=v(61),M=v(30);b.exports=function(I,D,k){var z=D(I);return M(I)?z:O(z,k(I))}},function(b,w){b.exports=function(v,O){for(var M=-1,I=O.length,D=v.length;++M<I;)v[D+M]=O[M];return v}},function(b,w){b.exports=function(){return[]}},function(b,w,v){var O=v(188),M=v(189),I=v(30),D=v(40),k=v(192),z=v(64),W=Object.prototype.hasOwnProperty;b.exports=function(Y,et){var ft=I(Y),Dt=!ft&&M(Y),At=!ft&&!Dt&&D(Y),L=!ft&&!Dt&&!At&&z(Y),R=ft||Dt||At||L,B=R?O(Y.length,String):[],X=B.length;for(var P in Y)!et&&!W.call(Y,P)||R&&(P=="length"||At&&(P=="offset"||P=="parent")||L&&(P=="buffer"||P=="byteLength"||P=="byteOffset")||k(P,X))||B.push(P);return B}},function(b,w,v){var O=v(193),M=v(41),I=v(42),D=I&&I.isTypedArray,k=D?M(D):O;b.exports=k},function(b,w){b.exports=function(v){return typeof v=="number"&&v>-1&&v%1==0&&v<=9007199254740991}},function(b,w){b.exports=function(v,O){return function(M){return v(O(M))}}},function(b,w,v){var O=v(33),M=v(65);b.exports=function(I){return I!=null&&M(I.length)&&!O(I)}},function(b,w,v){var O=v(69),M=v(36),I=Object.prototype.hasOwnProperty;b.exports=function(D,k,z){var W=D[k];I.call(D,k)&&M(W,z)&&(z!==void 0||k in D)||O(D,k,z)}},function(b,w,v){var O=v(207);b.exports=function(M,I,D){I=="__proto__"&&O?O(M,I,{configurable:!0,enumerable:!0,value:D,writable:!0}):M[I]=D}},function(b,w,v){var O=v(61),M=v(71),I=v(38),D=v(62),k=Object.getOwnPropertySymbols?function(z){for(var W=[];z;)O(W,I(z)),z=M(z);return W}:D;b.exports=k},function(b,w,v){var O=v(66)(Object.getPrototypeOf,Object);b.exports=O},function(b,w){b.exports=`varying vec2 vUv;
|
|
1107
|
+
`},function(b,w,v){var O=v(148);b.exports=function(M,I){I=I||{};var D=new O,k=I.inPlace||!1,V=M.map(function(X){return k?X:{width:X.width,height:X.height,item:X}});V=V.sort(function(X,et){return et.width*et.height-X.width*X.height}),D.fit(V);var W={width:V.reduce(function(X,et){return Math.max(X,et.x+et.width)},0),height:V.reduce(function(X,et){return Math.max(X,et.y+et.height)},0)};return k||(W.items=V),W}},function(b,w,v){var O=v(21),M=v(200),I=v(201),D=Math.max,k=Math.min;b.exports=function(V,W,X){var et,ft,Dt,At,L,R,B=0,Y=!1,P=!1,H=!0;if(typeof V!="function")throw new TypeError("Expected a function");function tt(U){var dt=et,$=ft;return et=ft=void 0,B=U,At=V.apply($,dt)}function G(U){return B=U,L=setTimeout(zt,W),Y?tt(U):At}function Ot(U){var dt=U-R;return R===void 0||dt>=W||dt<0||P&&U-B>=Dt}function zt(){var U=M();if(Ot(U))return st(U);L=setTimeout(zt,function(dt){var $=W-(dt-R);return P?k($,Dt-(dt-B)):$}(U))}function st(U){return L=void 0,H&&et?tt(U):(et=ft=void 0,At)}function z(){var U=M(),dt=Ot(U);if(et=arguments,ft=this,R=U,dt){if(L===void 0)return G(R);if(P)return clearTimeout(L),L=setTimeout(zt,W),tt(R)}return L===void 0&&(L=setTimeout(zt,W)),At}return W=I(W)||0,O(X)&&(Y=!!X.leading,Dt=(P="maxWait"in X)?D(I(X.maxWait)||0,W):Dt,H="trailing"in X?!!X.trailing:H),z.cancel=function(){L!==void 0&&clearTimeout(L),B=0,et=R=ft=L=void 0},z.flush=function(){return L===void 0?At:st(M())},z}},function(b,w,v){var O=v(205);b.exports=function(M){return O(M,5)}},function(b,w,v){(function(O){var M=typeof O=="object"&&O&&O.Object===Object&&O;b.exports=M}).call(this,v(17))},function(b,w,v){var O=Object.prototype.hasOwnProperty,M="~";function I(){}function D(X,et,ft){this.fn=X,this.context=et,this.once=ft||!1}function k(X,et,ft,Dt,At){if(typeof ft!="function")throw new TypeError("The listener must be a function");var L=new D(ft,Dt||X,At),R=M?M+et:et;return X._events[R]?X._events[R].fn?X._events[R]=[X._events[R],L]:X._events[R].push(L):(X._events[R]=L,X._eventsCount++),X}function V(X,et){--X._eventsCount==0?X._events=new I:delete X._events[et]}function W(){this._events=new I,this._eventsCount=0}Object.create&&(I.prototype=Object.create(null),new I().__proto__||(M=!1)),W.prototype.eventNames=function(){var X,et,ft=[];if(this._eventsCount===0)return ft;for(et in X=this._events)O.call(X,et)&&ft.push(M?et.slice(1):et);return Object.getOwnPropertySymbols?ft.concat(Object.getOwnPropertySymbols(X)):ft},W.prototype.listeners=function(X){var et=M?M+X:X,ft=this._events[et];if(!ft)return[];if(ft.fn)return[ft.fn];for(var Dt=0,At=ft.length,L=new Array(At);Dt<At;Dt++)L[Dt]=ft[Dt].fn;return L},W.prototype.listenerCount=function(X){var et=M?M+X:X,ft=this._events[et];return ft?ft.fn?1:ft.length:0},W.prototype.emit=function(X,et,ft,Dt,At,L){var R=M?M+X:X;if(!this._events[R])return!1;var B,Y,P=this._events[R],H=arguments.length;if(P.fn){switch(P.once&&this.removeListener(X,P.fn,void 0,!0),H){case 1:return P.fn.call(P.context),!0;case 2:return P.fn.call(P.context,et),!0;case 3:return P.fn.call(P.context,et,ft),!0;case 4:return P.fn.call(P.context,et,ft,Dt),!0;case 5:return P.fn.call(P.context,et,ft,Dt,At),!0;case 6:return P.fn.call(P.context,et,ft,Dt,At,L),!0}for(Y=1,B=new Array(H-1);Y<H;Y++)B[Y-1]=arguments[Y];P.fn.apply(P.context,B)}else{var tt,G=P.length;for(Y=0;Y<G;Y++)switch(P[Y].once&&this.removeListener(X,P[Y].fn,void 0,!0),H){case 1:P[Y].fn.call(P[Y].context);break;case 2:P[Y].fn.call(P[Y].context,et);break;case 3:P[Y].fn.call(P[Y].context,et,ft);break;case 4:P[Y].fn.call(P[Y].context,et,ft,Dt);break;default:if(!B)for(tt=1,B=new Array(H-1);tt<H;tt++)B[tt-1]=arguments[tt];P[Y].fn.apply(P[Y].context,B)}}return!0},W.prototype.on=function(X,et,ft){return k(this,X,et,ft,!1)},W.prototype.once=function(X,et,ft){return k(this,X,et,ft,!0)},W.prototype.removeListener=function(X,et,ft,Dt){var At=M?M+X:X;if(!this._events[At])return this;if(!et)return V(this,At),this;var L=this._events[At];if(L.fn)L.fn!==et||Dt&&!L.once||ft&&L.context!==ft||V(this,At);else{for(var R=0,B=[],Y=L.length;R<Y;R++)(L[R].fn!==et||Dt&&!L[R].once||ft&&L[R].context!==ft)&&B.push(L[R]);B.length?this._events[At]=B.length===1?B[0]:B:V(this,At)}return this},W.prototype.removeAllListeners=function(X){var et;return X?(et=M?M+X:X,this._events[et]&&V(this,et)):(this._events=new I,this._eventsCount=0),this},W.prototype.off=W.prototype.removeListener,W.prototype.addListener=W.prototype.on,W.prefixed=M,W.EventEmitter=W,b.exports=W},function(b,w,v){function O($,vt,Lt){Lt=Lt||2;var K,ct,nt,_t,St,kt,Xt,Jt=vt&&vt.length,at=Jt?vt[0]*Lt:$.length,_e=M($,0,at,Lt,!0),Ue=[];if(!_e||_e.next===_e.prev)return Ue;if(Jt&&(_e=function(Ae,ze,$e,cn){var ke,Ge,Rn,re,pe,Ee=[];for(ke=0,Ge=ze.length;ke<Ge;ke++)Rn=ze[ke]*cn,re=ke<Ge-1?ze[ke+1]*cn:Ae.length,(pe=M(Ae,Rn,re,cn,!1))===pe.next&&(pe.steiner=!0),Ee.push(L(pe));for(Ee.sort(et),ke=0;ke<Ee.length;ke++)$e=ft(Ee[ke],$e);return $e}($,vt,_e,Lt)),$.length>80*Lt){K=nt=$[0],ct=_t=$[1];for(var Oe=Lt;Oe<at;Oe+=Lt)(St=$[Oe])<K&&(K=St),(kt=$[Oe+1])<ct&&(ct=kt),St>nt&&(nt=St),kt>_t&&(_t=kt);Xt=(Xt=Math.max(nt-K,_t-ct))!==0?32767/Xt:0}return D(_e,Ue,Lt,K,ct,Xt,0),Ue}function M($,vt,Lt,K,ct){var nt,_t;if(ct===dt($,vt,Lt,K)>0)for(nt=vt;nt<Lt;nt+=K)_t=st(nt,$[nt],$[nt+1],_t);else for(nt=Lt-K;nt>=vt;nt-=K)_t=st(nt,$[nt],$[nt+1],_t);return _t&&P(_t,_t.next)&&(z(_t),_t=_t.next),_t}function I($,vt){if(!$)return $;vt||(vt=$);var Lt,K=$;do if(Lt=!1,K.steiner||!P(K,K.next)&&Y(K.prev,K,K.next)!==0)K=K.next;else{if(z(K),(K=vt=K.prev)===K.next)break;Lt=!0}while(Lt||K!==vt);return vt}function D($,vt,Lt,K,ct,nt,_t){if($){!_t&&nt&&function(Jt,at,_e,Ue){var Oe=Jt;do Oe.z===0&&(Oe.z=At(Oe.x,Oe.y,at,_e,Ue)),Oe.prevZ=Oe.prev,Oe.nextZ=Oe.next,Oe=Oe.next;while(Oe!==Jt);Oe.prevZ.nextZ=null,Oe.prevZ=null,function(Ae){var ze,$e,cn,ke,Ge,Rn,re,pe,Ee=1;do{for($e=Ae,Ae=null,Ge=null,Rn=0;$e;){for(Rn++,cn=$e,re=0,ze=0;ze<Ee&&(re++,cn=cn.nextZ);ze++);for(pe=Ee;re>0||pe>0&&cn;)re!==0&&(pe===0||!cn||$e.z<=cn.z)?(ke=$e,$e=$e.nextZ,re--):(ke=cn,cn=cn.nextZ,pe--),Ge?Ge.nextZ=ke:Ae=ke,ke.prevZ=Ge,Ge=ke;$e=cn}Ge.nextZ=null,Ee*=2}while(Rn>1)}(Oe)}($,K,ct,nt);for(var St,kt,Xt=$;$.prev!==$.next;)if(St=$.prev,kt=$.next,nt?V($,K,ct,nt):k($))vt.push(St.i/Lt|0),vt.push($.i/Lt|0),vt.push(kt.i/Lt|0),z($),$=kt.next,Xt=kt.next;else if(($=kt)===Xt){_t?_t===1?D($=W(I($),vt,Lt),vt,Lt,K,ct,nt,2):_t===2&&X($,vt,Lt,K,ct,nt):D(I($),vt,Lt,K,ct,nt,1);break}}}function k($){var vt=$.prev,Lt=$,K=$.next;if(Y(vt,Lt,K)>=0)return!1;for(var ct=vt.x,nt=Lt.x,_t=K.x,St=vt.y,kt=Lt.y,Xt=K.y,Jt=ct<nt?ct<_t?ct:_t:nt<_t?nt:_t,at=St<kt?St<Xt?St:Xt:kt<Xt?kt:Xt,_e=ct>nt?ct>_t?ct:_t:nt>_t?nt:_t,Ue=St>kt?St>Xt?St:Xt:kt>Xt?kt:Xt,Oe=K.next;Oe!==vt;){if(Oe.x>=Jt&&Oe.x<=_e&&Oe.y>=at&&Oe.y<=Ue&&R(ct,St,nt,kt,_t,Xt,Oe.x,Oe.y)&&Y(Oe.prev,Oe,Oe.next)>=0)return!1;Oe=Oe.next}return!0}function V($,vt,Lt,K){var ct=$.prev,nt=$,_t=$.next;if(Y(ct,nt,_t)>=0)return!1;for(var St=ct.x,kt=nt.x,Xt=_t.x,Jt=ct.y,at=nt.y,_e=_t.y,Ue=St<kt?St<Xt?St:Xt:kt<Xt?kt:Xt,Oe=Jt<at?Jt<_e?Jt:_e:at<_e?at:_e,Ae=St>kt?St>Xt?St:Xt:kt>Xt?kt:Xt,ze=Jt>at?Jt>_e?Jt:_e:at>_e?at:_e,$e=At(Ue,Oe,vt,Lt,K),cn=At(Ae,ze,vt,Lt,K),ke=$.prevZ,Ge=$.nextZ;ke&&ke.z>=$e&&Ge&&Ge.z<=cn;){if(ke.x>=Ue&&ke.x<=Ae&&ke.y>=Oe&&ke.y<=ze&&ke!==ct&&ke!==_t&&R(St,Jt,kt,at,Xt,_e,ke.x,ke.y)&&Y(ke.prev,ke,ke.next)>=0||(ke=ke.prevZ,Ge.x>=Ue&&Ge.x<=Ae&&Ge.y>=Oe&&Ge.y<=ze&&Ge!==ct&&Ge!==_t&&R(St,Jt,kt,at,Xt,_e,Ge.x,Ge.y)&&Y(Ge.prev,Ge,Ge.next)>=0))return!1;Ge=Ge.nextZ}for(;ke&&ke.z>=$e;){if(ke.x>=Ue&&ke.x<=Ae&&ke.y>=Oe&&ke.y<=ze&&ke!==ct&&ke!==_t&&R(St,Jt,kt,at,Xt,_e,ke.x,ke.y)&&Y(ke.prev,ke,ke.next)>=0)return!1;ke=ke.prevZ}for(;Ge&&Ge.z<=cn;){if(Ge.x>=Ue&&Ge.x<=Ae&&Ge.y>=Oe&&Ge.y<=ze&&Ge!==ct&&Ge!==_t&&R(St,Jt,kt,at,Xt,_e,Ge.x,Ge.y)&&Y(Ge.prev,Ge,Ge.next)>=0)return!1;Ge=Ge.nextZ}return!0}function W($,vt,Lt){var K=$;do{var ct=K.prev,nt=K.next.next;!P(ct,nt)&&H(ct,K,K.next,nt)&&Ot(ct,nt)&&Ot(nt,ct)&&(vt.push(ct.i/Lt|0),vt.push(K.i/Lt|0),vt.push(nt.i/Lt|0),z(K),z(K.next),K=$=nt),K=K.next}while(K!==$);return I(K)}function X($,vt,Lt,K,ct,nt){var _t=$;do{for(var St=_t.next.next;St!==_t.prev;){if(_t.i!==St.i&&B(_t,St)){var kt=zt(_t,St);return _t=I(_t,_t.next),kt=I(kt,kt.next),D(_t,vt,Lt,K,ct,nt,0),void D(kt,vt,Lt,K,ct,nt,0)}St=St.next}_t=_t.next}while(_t!==$)}function et($,vt){return $.x-vt.x}function ft($,vt){var Lt=function(ct,nt){var _t,St=nt,kt=ct.x,Xt=ct.y,Jt=-1/0;do{if(Xt<=St.y&&Xt>=St.next.y&&St.next.y!==St.y){var at=St.x+(Xt-St.y)*(St.next.x-St.x)/(St.next.y-St.y);if(at<=kt&&at>Jt&&(Jt=at,_t=St.x<St.next.x?St:St.next,at===kt))return _t}St=St.next}while(St!==nt);if(!_t)return null;var _e,Ue=_t,Oe=_t.x,Ae=_t.y,ze=1/0;St=_t;do kt>=St.x&&St.x>=Oe&&kt!==St.x&&R(Xt<Ae?kt:Jt,Xt,Oe,Ae,Xt<Ae?Jt:kt,Xt,St.x,St.y)&&(_e=Math.abs(Xt-St.y)/(kt-St.x),Ot(St,ct)&&(_e<ze||_e===ze&&(St.x>_t.x||St.x===_t.x&&Dt(_t,St)))&&(_t=St,ze=_e)),St=St.next;while(St!==Ue);return _t}($,vt);if(!Lt)return vt;var K=zt(Lt,$);return I(K,K.next),I(Lt,Lt.next)}function Dt($,vt){return Y($.prev,$,vt.prev)<0&&Y(vt.next,$,$.next)<0}function At($,vt,Lt,K,ct){return($=1431655765&(($=858993459&(($=252645135&(($=16711935&(($=($-Lt)*ct|0)|$<<8))|$<<4))|$<<2))|$<<1))|(vt=1431655765&((vt=858993459&((vt=252645135&((vt=16711935&((vt=(vt-K)*ct|0)|vt<<8))|vt<<4))|vt<<2))|vt<<1))<<1}function L($){var vt=$,Lt=$;do(vt.x<Lt.x||vt.x===Lt.x&&vt.y<Lt.y)&&(Lt=vt),vt=vt.next;while(vt!==$);return Lt}function R($,vt,Lt,K,ct,nt,_t,St){return(ct-_t)*(vt-St)>=($-_t)*(nt-St)&&($-_t)*(K-St)>=(Lt-_t)*(vt-St)&&(Lt-_t)*(nt-St)>=(ct-_t)*(K-St)}function B($,vt){return $.next.i!==vt.i&&$.prev.i!==vt.i&&!function(Lt,K){var ct=Lt;do{if(ct.i!==Lt.i&&ct.next.i!==Lt.i&&ct.i!==K.i&&ct.next.i!==K.i&&H(ct,ct.next,Lt,K))return!0;ct=ct.next}while(ct!==Lt);return!1}($,vt)&&(Ot($,vt)&&Ot(vt,$)&&function(Lt,K){var ct=Lt,nt=!1,_t=(Lt.x+K.x)/2,St=(Lt.y+K.y)/2;do ct.y>St!=ct.next.y>St&&ct.next.y!==ct.y&&_t<(ct.next.x-ct.x)*(St-ct.y)/(ct.next.y-ct.y)+ct.x&&(nt=!nt),ct=ct.next;while(ct!==Lt);return nt}($,vt)&&(Y($.prev,$,vt.prev)||Y($,vt.prev,vt))||P($,vt)&&Y($.prev,$,$.next)>0&&Y(vt.prev,vt,vt.next)>0)}function Y($,vt,Lt){return(vt.y-$.y)*(Lt.x-vt.x)-(vt.x-$.x)*(Lt.y-vt.y)}function P($,vt){return $.x===vt.x&&$.y===vt.y}function H($,vt,Lt,K){var ct=G(Y($,vt,Lt)),nt=G(Y($,vt,K)),_t=G(Y(Lt,K,$)),St=G(Y(Lt,K,vt));return ct!==nt&&_t!==St||!(ct!==0||!tt($,Lt,vt))||!(nt!==0||!tt($,K,vt))||!(_t!==0||!tt(Lt,$,K))||!(St!==0||!tt(Lt,vt,K))}function tt($,vt,Lt){return vt.x<=Math.max($.x,Lt.x)&&vt.x>=Math.min($.x,Lt.x)&&vt.y<=Math.max($.y,Lt.y)&&vt.y>=Math.min($.y,Lt.y)}function G($){return $>0?1:$<0?-1:0}function Ot($,vt){return Y($.prev,$,$.next)<0?Y($,vt,$.next)>=0&&Y($,$.prev,vt)>=0:Y($,vt,$.prev)<0||Y($,$.next,vt)<0}function zt($,vt){var Lt=new U($.i,$.x,$.y),K=new U(vt.i,vt.x,vt.y),ct=$.next,nt=vt.prev;return $.next=vt,vt.prev=$,Lt.next=ct,ct.prev=Lt,K.next=Lt,Lt.prev=K,nt.next=K,K.prev=nt,K}function st($,vt,Lt,K){var ct=new U($,vt,Lt);return K?(ct.next=K.next,ct.prev=K,K.next.prev=ct,K.next=ct):(ct.prev=ct,ct.next=ct),ct}function z($){$.next.prev=$.prev,$.prev.next=$.next,$.prevZ&&($.prevZ.nextZ=$.nextZ),$.nextZ&&($.nextZ.prevZ=$.prevZ)}function U($,vt,Lt){this.i=$,this.x=vt,this.y=Lt,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function dt($,vt,Lt,K){for(var ct=0,nt=vt,_t=Lt-K;nt<Lt;nt+=K)ct+=($[_t]-$[nt])*($[nt+1]+$[_t+1]),_t=nt;return ct}b.exports=O,b.exports.default=O,O.deviation=function($,vt,Lt,K){var ct=vt&&vt.length,nt=ct?vt[0]*Lt:$.length,_t=Math.abs(dt($,0,nt,Lt));if(ct)for(var St=0,kt=vt.length;St<kt;St++){var Xt=vt[St]*Lt,Jt=St<kt-1?vt[St+1]*Lt:$.length;_t-=Math.abs(dt($,Xt,Jt,Lt))}var at=0;for(St=0;St<K.length;St+=3){var _e=K[St]*Lt,Ue=K[St+1]*Lt,Oe=K[St+2]*Lt;at+=Math.abs(($[_e]-$[Oe])*($[Ue+1]-$[_e+1])-($[_e]-$[Ue])*($[Oe+1]-$[_e+1]))}return _t===0&&at===0?0:Math.abs((at-_t)/_t)},O.flatten=function($){for(var vt=$[0][0].length,Lt={vertices:[],holes:[],dimensions:vt},K=0,ct=0;ct<$.length;ct++){for(var nt=0;nt<$[ct].length;nt++)for(var _t=0;_t<vt;_t++)Lt.vertices.push($[ct][nt][_t]);ct>0&&(K+=$[ct-1].length,Lt.holes.push(K))}return Lt}},function(b,w,v){var O=v(26),M=v(157),I=v(158),D=v(159),k=v(160),V=v(161);function W(X){var et=this.__data__=new O(X);this.size=et.size}W.prototype.clear=M,W.prototype.delete=I,W.prototype.get=D,W.prototype.has=k,W.prototype.set=V,b.exports=W},function(b,w){var v=Function.prototype.toString;b.exports=function(O){if(O!=null){try{return v.call(O)}catch{}try{return O+""}catch{}}return""}},function(b,w,v){var O=v(166),M=v(173),I=v(175),D=v(176),k=v(177);function V(W){var X=-1,et=W==null?0:W.length;for(this.clear();++X<et;){var ft=W[X];this.set(ft[0],ft[1])}}V.prototype.clear=O,V.prototype.delete=M,V.prototype.get=I,V.prototype.has=D,V.prototype.set=k,b.exports=V},function(b,w,v){var O=v(178),M=v(181),I=v(182);b.exports=function(D,k,V,W,X,et){var ft=1&V,Dt=D.length,At=k.length;if(Dt!=At&&!(ft&&At>Dt))return!1;var L=et.get(D),R=et.get(k);if(L&&R)return L==k&&R==D;var B=-1,Y=!0,P=2&V?new O:void 0;for(et.set(D,k),et.set(k,D);++B<Dt;){var H=D[B],tt=k[B];if(W)var G=ft?W(tt,H,B,k,D,et):W(H,tt,B,D,k,et);if(G!==void 0){if(G)continue;Y=!1;break}if(P){if(!M(k,function(Ot,zt){if(!I(P,zt)&&(H===Ot||X(H,Ot,V,W,et)))return P.push(zt)})){Y=!1;break}}else if(H!==tt&&!X(H,tt,V,W,et)){Y=!1;break}}return et.delete(D),et.delete(k),Y}},function(b,w,v){var O=v(14).Uint8Array;b.exports=O},function(b,w,v){var O=v(60),M=v(38),I=v(39);b.exports=function(D){return O(D,I,M)}},function(b,w,v){var O=v(61),M=v(30);b.exports=function(I,D,k){var V=D(I);return M(I)?V:O(V,k(I))}},function(b,w){b.exports=function(v,O){for(var M=-1,I=O.length,D=v.length;++M<I;)v[D+M]=O[M];return v}},function(b,w){b.exports=function(){return[]}},function(b,w,v){var O=v(188),M=v(189),I=v(30),D=v(40),k=v(192),V=v(64),W=Object.prototype.hasOwnProperty;b.exports=function(X,et){var ft=I(X),Dt=!ft&&M(X),At=!ft&&!Dt&&D(X),L=!ft&&!Dt&&!At&&V(X),R=ft||Dt||At||L,B=R?O(X.length,String):[],Y=B.length;for(var P in X)!et&&!W.call(X,P)||R&&(P=="length"||At&&(P=="offset"||P=="parent")||L&&(P=="buffer"||P=="byteLength"||P=="byteOffset")||k(P,Y))||B.push(P);return B}},function(b,w,v){var O=v(193),M=v(41),I=v(42),D=I&&I.isTypedArray,k=D?M(D):O;b.exports=k},function(b,w){b.exports=function(v){return typeof v=="number"&&v>-1&&v%1==0&&v<=9007199254740991}},function(b,w){b.exports=function(v,O){return function(M){return v(O(M))}}},function(b,w,v){var O=v(33),M=v(65);b.exports=function(I){return I!=null&&M(I.length)&&!O(I)}},function(b,w,v){var O=v(69),M=v(36),I=Object.prototype.hasOwnProperty;b.exports=function(D,k,V){var W=D[k];I.call(D,k)&&M(W,V)&&(V!==void 0||k in D)||O(D,k,V)}},function(b,w,v){var O=v(207);b.exports=function(M,I,D){I=="__proto__"&&O?O(M,I,{configurable:!0,enumerable:!0,value:D,writable:!0}):M[I]=D}},function(b,w,v){var O=v(61),M=v(71),I=v(38),D=v(62),k=Object.getOwnPropertySymbols?function(V){for(var W=[];V;)O(W,I(V)),V=M(V);return W}:D;b.exports=k},function(b,w,v){var O=v(66)(Object.getPrototypeOf,Object);b.exports=O},function(b,w){b.exports=`varying vec2 vUv;
|
|
1108
1108
|
void main() {
|
|
1109
1109
|
vUv = uv;
|
|
1110
1110
|
gl_Position = (projectionMatrix * modelViewMatrix) * vec4(position, 1.0);
|
|
@@ -3070,11 +3070,11 @@ void main() {
|
|
|
3070
3070
|
color.a = 1.0 - timePercent;
|
|
3071
3071
|
gl_FragColor = color;
|
|
3072
3072
|
}
|
|
3073
|
-
`},function(b,w,v){(function(O){var M=v(109),I=v(110),D=setTimeout;function k(R){return Boolean(R&&R.length!==void 0)}function
|
|
3073
|
+
`},function(b,w,v){(function(O){var M=v(109),I=v(110),D=setTimeout;function k(R){return Boolean(R&&R.length!==void 0)}function V(){}function W(R){if(!(this instanceof W))throw new TypeError("Promises must be constructed via new");if(typeof R!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],L(R,this)}function X(R,B){for(;R._state===3;)R=R._value;R._state!==0?(R._handled=!0,W._immediateFn(function(){var Y=R._state===1?B.onFulfilled:B.onRejected;if(Y!==null){var P;try{P=Y(R._value)}catch(H){return void ft(B.promise,H)}et(B.promise,P)}else(R._state===1?et:ft)(B.promise,R._value)})):R._deferreds.push(B)}function et(R,B){try{if(B===R)throw new TypeError("A promise cannot be resolved with itself.");if(B&&(typeof B=="object"||typeof B=="function")){var Y=B.then;if(B instanceof W)return R._state=3,R._value=B,void Dt(R);if(typeof Y=="function")return void L((P=Y,H=B,function(){P.apply(H,arguments)}),R)}R._state=1,R._value=B,Dt(R)}catch(tt){ft(R,tt)}var P,H}function ft(R,B){R._state=2,R._value=B,Dt(R)}function Dt(R){R._state===2&&R._deferreds.length===0&&W._immediateFn(function(){R._handled||W._unhandledRejectionFn(R._value)});for(var B=0,Y=R._deferreds.length;B<Y;B++)X(R,R._deferreds[B]);R._deferreds=null}function At(R,B,Y){this.onFulfilled=typeof R=="function"?R:null,this.onRejected=typeof B=="function"?B:null,this.promise=Y}function L(R,B){var Y=!1;try{R(function(P){Y||(Y=!0,et(B,P))},function(P){Y||(Y=!0,ft(B,P))})}catch(P){if(Y)return;Y=!0,ft(B,P)}}W.prototype.catch=function(R){return this.then(null,R)},W.prototype.then=function(R,B){var Y=new this.constructor(V);return X(this,new At(R,B,Y)),Y},W.prototype.finally=M.a,W.all=function(R){return new W(function(B,Y){if(!k(R))return Y(new TypeError("Promise.all accepts an array"));var P=Array.prototype.slice.call(R);if(P.length===0)return B([]);var H=P.length;function tt(Ot,zt){try{if(zt&&(typeof zt=="object"||typeof zt=="function")){var st=zt.then;if(typeof st=="function")return void st.call(zt,function(z){tt(Ot,z)},Y)}P[Ot]=zt,--H==0&&B(P)}catch(z){Y(z)}}for(var G=0;G<P.length;G++)tt(G,P[G])})},W.allSettled=I.a,W.resolve=function(R){return R&&typeof R=="object"&&R.constructor===W?R:new W(function(B){B(R)})},W.reject=function(R){return new W(function(B,Y){Y(R)})},W.race=function(R){return new W(function(B,Y){if(!k(R))return Y(new TypeError("Promise.race accepts an array"));for(var P=0,H=R.length;P<H;P++)W.resolve(R[P]).then(B,Y)})},W._immediateFn=typeof O=="function"&&function(R){O(R)}||function(R){D(R,0)},W._unhandledRejectionFn=function(R){typeof console!="undefined"&&console&&console.warn("Possible Unhandled Promise Rejection:",R)},w.a=W}).call(this,v(140).setImmediate)},function(b,w,v){w.a=function(O){var M=this.constructor;return this.then(function(I){return M.resolve(O()).then(function(){return I})},function(I){return M.resolve(O()).then(function(){return M.reject(I)})})}},function(b,w,v){w.a=function(O){return new this(function(M,I){if(!O||O.length===void 0)return I(new TypeError(typeof O+" "+O+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var D=Array.prototype.slice.call(O);if(D.length===0)return M([]);var k=D.length;function V(X,et){if(et&&(typeof et=="object"||typeof et=="function")){var ft=et.then;if(typeof ft=="function")return void ft.call(et,function(Dt){V(X,Dt)},function(Dt){D[X]={status:"rejected",reason:Dt},--k==0&&M(D)})}D[X]={status:"fulfilled",value:et},--k==0&&M(D)}for(var W=0;W<D.length;W++)V(W,D[W])})}},function(b,w,v){/*
|
|
3074
3074
|
object-assign
|
|
3075
3075
|
(c) Sindre Sorhus
|
|
3076
3076
|
@license MIT
|
|
3077
|
-
*/var O=Object.getOwnPropertySymbols,M=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;function D(k){if(k==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(k)}b.exports=function(){try{if(!Object.assign)return!1;var k=new String("abc");if(k[5]="de",Object.getOwnPropertyNames(k)[0]==="5")return!1;for(var
|
|
3077
|
+
*/var O=Object.getOwnPropertySymbols,M=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;function D(k){if(k==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(k)}b.exports=function(){try{if(!Object.assign)return!1;var k=new String("abc");if(k[5]="de",Object.getOwnPropertyNames(k)[0]==="5")return!1;for(var V={},W=0;W<10;W++)V["_"+String.fromCharCode(W)]=W;if(Object.getOwnPropertyNames(V).map(function(et){return V[et]}).join("")!=="0123456789")return!1;var X={};return"abcdefghijklmnopqrst".split("").forEach(function(et){X[et]=et}),Object.keys(Object.assign({},X)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}()?Object.assign:function(k,V){for(var W,X,et=D(k),ft=1;ft<arguments.length;ft++){for(var Dt in W=Object(arguments[ft]))M.call(W,Dt)&&(et[Dt]=W[Dt]);if(O){X=O(W);for(var At=0;At<X.length;At++)I.call(W,X[At])&&(et[X[At]]=W[X[At]])}}return et}},function(b,w,v){var O=v(20),M=v(15);b.exports=function(I){return I===!0||I===!1||M(I)&&O(I)=="[object Boolean]"}},function(b,w){b.exports=`precision mediump float;
|
|
3078
3078
|
attribute vec2 aVertexPosition;
|
|
3079
3079
|
uniform mat3 projectionMatrix;
|
|
3080
3080
|
varying vec2 vTextureCoord;
|
|
@@ -3228,7 +3228,7 @@ void main() {
|
|
|
3228
3228
|
gl_FragColor = texColor;
|
|
3229
3229
|
}
|
|
3230
3230
|
}
|
|
3231
|
-
`},function(b,w,v){var O;(function(M,I){var D="model",k="name",z="type",W="vendor",Y="version",et="mobile",ft="tablet",Dt="smarttv",At=function(st){for(var V={},U=0;U<st.length;U++)V[st[U].toUpperCase()]=st[U];return V},L=function(st,V){return typeof st=="string"&&R(V).indexOf(R(st))!==-1},R=function(st){return st.toLowerCase()},B=function(st,V){if(typeof st=="string")return st=st.replace(/^\s\s*/,"").replace(/\s\s*$/,""),V===void 0?st:st.substring(0,255)},X=function(st,V){for(var U,dt,$,vt,Lt,K,ct=0;ct<V.length&&!Lt;){var nt=V[ct],_t=V[ct+1];for(U=dt=0;U<nt.length&&!Lt;)if(Lt=nt[U++].exec(st))for($=0;$<_t.length;$++)K=Lt[++dt],typeof(vt=_t[$])=="object"&&vt.length>0?vt.length===2?typeof vt[1]=="function"?this[vt[0]]=vt[1].call(this,K):this[vt[0]]=vt[1]:vt.length===3?typeof vt[1]!="function"||vt[1].exec&&vt[1].test?this[vt[0]]=K?K.replace(vt[1],vt[2]):void 0:this[vt[0]]=K?vt[1].call(this,K,vt[2]):void 0:vt.length===4&&(this[vt[0]]=K?vt[3].call(this,K.replace(vt[1],vt[2])):void 0):this[vt]=K||void 0;ct+=2}},P=function(st,V){for(var U in V)if(typeof V[U]=="object"&&V[U].length>0){for(var dt=0;dt<V[U].length;dt++)if(L(V[U][dt],st))return U==="?"?void 0:U}else if(L(V[U],st))return U==="?"?void 0:U;return st},H={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},tt={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[Y,[k,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[Y,[k,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[k,Y],[/opios[\/ ]+([\w\.]+)/i],[Y,[k,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[Y,[k,"Opera"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[k,Y],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[Y,[k,"UCBrowser"]],[/\bqbcore\/([\w\.]+)/i],[Y,[k,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[Y,[k,"WeChat"]],[/konqueror\/([\w\.]+)/i],[Y,[k,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[Y,[k,"IE"]],[/yabrowser\/([\w\.]+)/i],[Y,[k,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[k,/(.+)/,"$1 Secure Browser"],Y],[/\bfocus\/([\w\.]+)/i],[Y,[k,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[Y,[k,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[Y,[k,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[Y,[k,"Dolphin"]],[/coast\/([\w\.]+)/i],[Y,[k,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[Y,[k,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[Y,[k,"Firefox"]],[/\bqihu|(qi?ho?o?|360)browser/i],[[k,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[k,/(.+)/,"$1 Browser"],Y],[/(comodo_dragon)\/([\w\.]+)/i],[[k,/_/g," "],Y],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[k,Y],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[k],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[k,"Facebook"],Y],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[k,Y],[/\bgsa\/([\w\.]+) .*safari\//i],[Y,[k,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[Y,[k,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[k,"Chrome WebView"],Y],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[Y,[k,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[k,Y],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[Y,[k,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[Y,k],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[k,[Y,P,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[k,Y],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[k,"Netscape"],Y],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[Y,[k,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[k,Y]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[["architecture","amd64"]],[/(ia32(?=;))/i],[["architecture",R]],[/((?:i[346]|x)86)[;\)]/i],[["architecture","ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[["architecture","arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[["architecture","armhf"]],[/windows (ce|mobile); ppc;/i],[["architecture","arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[["architecture",/ower/,"",R]],[/(sun4\w)[;\)]/i],[["architecture","sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[["architecture",R]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[D,[W,"Samsung"],[z,ft]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[D,[W,"Samsung"],[z,et]],[/\((ip(?:hone|od)[\w ]*);/i],[D,[W,"Apple"],[z,et]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[D,[W,"Apple"],[z,ft]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[D,[W,"Huawei"],[z,ft]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i],[D,[W,"Huawei"],[z,et]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[D,/_/g," "],[W,"Xiaomi"],[z,et]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[D,/_/g," "],[W,"Xiaomi"],[z,ft]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[D,[W,"OPPO"],[z,et]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[D,[W,"Vivo"],[z,et]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[D,[W,"Realme"],[z,et]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[D,[W,"Motorola"],[z,et]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[D,[W,"Motorola"],[z,ft]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[D,[W,"LG"],[z,ft]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[D,[W,"LG"],[z,et]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[D,[W,"Lenovo"],[z,ft]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[D,/_/g," "],[W,"Nokia"],[z,et]],[/(pixel c)\b/i],[D,[W,"Google"],[z,ft]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[D,[W,"Google"],[z,et]],[/droid.+ ([c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[D,[W,"Sony"],[z,et]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[D,"Xperia Tablet"],[W,"Sony"],[z,ft]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[D,[W,"OnePlus"],[z,et]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[D,[W,"Amazon"],[z,ft]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[D,/(.+)/g,"Fire Phone $1"],[W,"Amazon"],[z,et]],[/(playbook);[-\w\),; ]+(rim)/i],[D,W,[z,ft]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[D,[W,"BlackBerry"],[z,et]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[D,[W,"ASUS"],[z,ft]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[D,[W,"ASUS"],[z,et]],[/(nexus 9)/i],[D,[W,"HTC"],[z,ft]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i],[W,[D,/_/g," "],[z,et]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[D,[W,"Acer"],[z,ft]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[D,[W,"Meizu"],[z,et]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[D,[W,"Sharp"],[z,et]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[W,D,[z,et]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[W,D,[z,ft]],[/(surface duo)/i],[D,[W,"Microsoft"],[z,ft]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[D,[W,"Fairphone"],[z,et]],[/(u304aa)/i],[D,[W,"AT&T"],[z,et]],[/\bsie-(\w*)/i],[D,[W,"Siemens"],[z,et]],[/\b(rct\w+) b/i],[D,[W,"RCA"],[z,ft]],[/\b(venue[\d ]{2,7}) b/i],[D,[W,"Dell"],[z,ft]],[/\b(q(?:mv|ta)\w+) b/i],[D,[W,"Verizon"],[z,ft]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[D,[W,"Barnes & Noble"],[z,ft]],[/\b(tm\d{3}\w+) b/i],[D,[W,"NuVision"],[z,ft]],[/\b(k88) b/i],[D,[W,"ZTE"],[z,ft]],[/\b(nx\d{3}j) b/i],[D,[W,"ZTE"],[z,et]],[/\b(gen\d{3}) b.+49h/i],[D,[W,"Swiss"],[z,et]],[/\b(zur\d{3}) b/i],[D,[W,"Swiss"],[z,ft]],[/\b((zeki)?tb.*\b) b/i],[D,[W,"Zeki"],[z,ft]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[W,"Dragon Touch"],D,[z,ft]],[/\b(ns-?\w{0,9}) b/i],[D,[W,"Insignia"],[z,ft]],[/\b((nxa|next)-?\w{0,9}) b/i],[D,[W,"NextBook"],[z,ft]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[W,"Voice"],D,[z,et]],[/\b(lvtel\-)?(v1[12]) b/i],[[W,"LvTel"],D,[z,et]],[/\b(ph-1) /i],[D,[W,"Essential"],[z,et]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[D,[W,"Envizen"],[z,ft]],[/\b(trio[-\w\. ]+) b/i],[D,[W,"MachSpeed"],[z,ft]],[/\btu_(1491) b/i],[D,[W,"Rotor"],[z,ft]],[/(shield[\w ]+) b/i],[D,[W,"Nvidia"],[z,ft]],[/(sprint) (\w+)/i],[W,D,[z,et]],[/(kin\.[onetw]{3})/i],[[D,/\./g," "],[W,"Microsoft"],[z,et]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[D,[W,"Zebra"],[z,ft]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[D,[W,"Zebra"],[z,et]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[W,D,[z,"console"]],[/droid.+; (shield) bui/i],[D,[W,"Nvidia"],[z,"console"]],[/(playstation [345portablevi]+)/i],[D,[W,"Sony"],[z,"console"]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[D,[W,"Microsoft"],[z,"console"]],[/smart-tv.+(samsung)/i],[W,[z,Dt]],[/hbbtv.+maple;(\d+)/i],[[D,/^/,"SmartTV"],[W,"Samsung"],[z,Dt]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[W,"LG"],[z,Dt]],[/(apple) ?tv/i],[W,[D,"Apple TV"],[z,Dt]],[/crkey/i],[[D,"Chromecast"],[W,"Google"],[z,Dt]],[/droid.+aft(\w)( bui|\))/i],[D,[W,"Amazon"],[z,Dt]],[/\(dtv[\);].+(aquos)/i],[D,[W,"Sharp"],[z,Dt]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[W,B],[D,B],[z,Dt]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[z,Dt]],[/((pebble))app/i],[W,D,[z,"wearable"]],[/droid.+; (glass) \d/i],[D,[W,"Google"],[z,"wearable"]],[/droid.+; (wt63?0{2,3})\)/i],[D,[W,"Zebra"],[z,"wearable"]],[/(quest( 2)?)/i],[D,[W,"Facebook"],[z,"wearable"]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[W,[z,"embedded"]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[D,[z,et]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[D,[z,ft]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[z,ft]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[z,et]],[/(android[-\w\. ]{0,9});.+buil/i],[D,[W,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[Y,[k,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[Y,[k,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[k,Y],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[Y,k]],os:[[/microsoft (windows) (vista|xp)/i],[k,Y],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[k,[Y,P,H]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[k,"Windows"],[Y,P,H]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[Y,/_/g,"."],[k,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[k,"Mac OS"],[Y,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[Y,k],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[k,Y],[/\(bb(10);/i],[Y,[k,"BlackBerry"]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[Y,[k,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[Y,[k,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[Y,[k,"webOS"]],[/crkey\/([\d\.]+)/i],[Y,[k,"Chromecast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[k,"Chromium OS"],Y],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[k,Y],[/(sunos) ?([\w\.\d]*)/i],[[k,"Solaris"],Y],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[k,Y]]},G=function(st,V){if(typeof st=="object"&&(V=st,st=void 0),!(this instanceof G))return new G(st,V).getResult();var U=st||(M!==void 0&&M.navigator&&M.navigator.userAgent?M.navigator.userAgent:""),dt=V?function($,vt){var Lt={};for(var K in $)vt[K]&&vt[K].length%2==0?Lt[K]=vt[K].concat($[K]):Lt[K]=$[K];return Lt}(tt,V):tt;return this.getBrowser=function(){var $,vt={};return vt[k]=void 0,vt[Y]=void 0,X.call(vt,U,dt.browser),vt.major=typeof($=vt.version)=="string"?$.replace(/[^\d\.]/g,"").split(".")[0]:void 0,vt},this.getCPU=function(){var $={architecture:void 0};return X.call($,U,dt.cpu),$},this.getDevice=function(){var $={vendor:void 0,model:void 0,type:void 0};return X.call($,U,dt.device),$},this.getEngine=function(){var $={name:void 0,version:void 0};return X.call($,U,dt.engine),$},this.getOS=function(){var $={name:void 0,version:void 0};return X.call($,U,dt.os),$},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return U},this.setUA=function($){return U=typeof $=="string"&&$.length>255?B($,255):$,this},this.setUA(U),this};G.VERSION="1.0.2",G.BROWSER=At([k,Y,"major"]),G.CPU=At(["architecture"]),G.DEVICE=At([D,W,z,"console",et,Dt,ft,"wearable","embedded"]),G.ENGINE=G.OS=At([k,Y]),w!==void 0?(b!==void 0&&b.exports&&(w=b.exports=G),w.UAParser=G):v(149)?(O=function(){return G}.call(w,v,w,b))===void 0||(b.exports=O):M!==void 0&&(M.UAParser=G);var Ot=M!==void 0&&(M.jQuery||M.Zepto);if(Ot&&!Ot.ua){var zt=new G;Ot.ua=zt.getResult(),Ot.ua.get=function(){return zt.getUA()},Ot.ua.set=function(st){zt.setUA(st);var V=zt.getResult();for(var U in V)Ot.ua[U]=V[U]}}})(typeof window=="object"?window:this)},function(b,w,v){(function(O){var M;/*!
|
|
3231
|
+
`},function(b,w,v){var O;(function(M,I){var D="model",k="name",V="type",W="vendor",X="version",et="mobile",ft="tablet",Dt="smarttv",At=function(st){for(var z={},U=0;U<st.length;U++)z[st[U].toUpperCase()]=st[U];return z},L=function(st,z){return typeof st=="string"&&R(z).indexOf(R(st))!==-1},R=function(st){return st.toLowerCase()},B=function(st,z){if(typeof st=="string")return st=st.replace(/^\s\s*/,"").replace(/\s\s*$/,""),z===void 0?st:st.substring(0,255)},Y=function(st,z){for(var U,dt,$,vt,Lt,K,ct=0;ct<z.length&&!Lt;){var nt=z[ct],_t=z[ct+1];for(U=dt=0;U<nt.length&&!Lt;)if(Lt=nt[U++].exec(st))for($=0;$<_t.length;$++)K=Lt[++dt],typeof(vt=_t[$])=="object"&&vt.length>0?vt.length===2?typeof vt[1]=="function"?this[vt[0]]=vt[1].call(this,K):this[vt[0]]=vt[1]:vt.length===3?typeof vt[1]!="function"||vt[1].exec&&vt[1].test?this[vt[0]]=K?K.replace(vt[1],vt[2]):void 0:this[vt[0]]=K?vt[1].call(this,K,vt[2]):void 0:vt.length===4&&(this[vt[0]]=K?vt[3].call(this,K.replace(vt[1],vt[2])):void 0):this[vt]=K||void 0;ct+=2}},P=function(st,z){for(var U in z)if(typeof z[U]=="object"&&z[U].length>0){for(var dt=0;dt<z[U].length;dt++)if(L(z[U][dt],st))return U==="?"?void 0:U}else if(L(z[U],st))return U==="?"?void 0:U;return st},H={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},tt={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[X,[k,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[X,[k,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[k,X],[/opios[\/ ]+([\w\.]+)/i],[X,[k,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[X,[k,"Opera"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[k,X],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[X,[k,"UCBrowser"]],[/\bqbcore\/([\w\.]+)/i],[X,[k,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[X,[k,"WeChat"]],[/konqueror\/([\w\.]+)/i],[X,[k,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[X,[k,"IE"]],[/yabrowser\/([\w\.]+)/i],[X,[k,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[k,/(.+)/,"$1 Secure Browser"],X],[/\bfocus\/([\w\.]+)/i],[X,[k,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[X,[k,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[X,[k,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[X,[k,"Dolphin"]],[/coast\/([\w\.]+)/i],[X,[k,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[X,[k,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[X,[k,"Firefox"]],[/\bqihu|(qi?ho?o?|360)browser/i],[[k,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[k,/(.+)/,"$1 Browser"],X],[/(comodo_dragon)\/([\w\.]+)/i],[[k,/_/g," "],X],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[k,X],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[k],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[k,"Facebook"],X],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[k,X],[/\bgsa\/([\w\.]+) .*safari\//i],[X,[k,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[X,[k,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[k,"Chrome WebView"],X],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[X,[k,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[k,X],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[X,[k,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[X,k],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[k,[X,P,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[k,X],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[k,"Netscape"],X],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[X,[k,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[k,X]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[["architecture","amd64"]],[/(ia32(?=;))/i],[["architecture",R]],[/((?:i[346]|x)86)[;\)]/i],[["architecture","ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[["architecture","arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[["architecture","armhf"]],[/windows (ce|mobile); ppc;/i],[["architecture","arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[["architecture",/ower/,"",R]],[/(sun4\w)[;\)]/i],[["architecture","sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[["architecture",R]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[D,[W,"Samsung"],[V,ft]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[D,[W,"Samsung"],[V,et]],[/\((ip(?:hone|od)[\w ]*);/i],[D,[W,"Apple"],[V,et]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[D,[W,"Apple"],[V,ft]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[D,[W,"Huawei"],[V,ft]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i],[D,[W,"Huawei"],[V,et]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[D,/_/g," "],[W,"Xiaomi"],[V,et]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[D,/_/g," "],[W,"Xiaomi"],[V,ft]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[D,[W,"OPPO"],[V,et]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[D,[W,"Vivo"],[V,et]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[D,[W,"Realme"],[V,et]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[D,[W,"Motorola"],[V,et]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[D,[W,"Motorola"],[V,ft]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[D,[W,"LG"],[V,ft]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[D,[W,"LG"],[V,et]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[D,[W,"Lenovo"],[V,ft]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[D,/_/g," "],[W,"Nokia"],[V,et]],[/(pixel c)\b/i],[D,[W,"Google"],[V,ft]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[D,[W,"Google"],[V,et]],[/droid.+ ([c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[D,[W,"Sony"],[V,et]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[D,"Xperia Tablet"],[W,"Sony"],[V,ft]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[D,[W,"OnePlus"],[V,et]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[D,[W,"Amazon"],[V,ft]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[D,/(.+)/g,"Fire Phone $1"],[W,"Amazon"],[V,et]],[/(playbook);[-\w\),; ]+(rim)/i],[D,W,[V,ft]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[D,[W,"BlackBerry"],[V,et]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[D,[W,"ASUS"],[V,ft]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[D,[W,"ASUS"],[V,et]],[/(nexus 9)/i],[D,[W,"HTC"],[V,ft]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i],[W,[D,/_/g," "],[V,et]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[D,[W,"Acer"],[V,ft]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[D,[W,"Meizu"],[V,et]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[D,[W,"Sharp"],[V,et]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[W,D,[V,et]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[W,D,[V,ft]],[/(surface duo)/i],[D,[W,"Microsoft"],[V,ft]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[D,[W,"Fairphone"],[V,et]],[/(u304aa)/i],[D,[W,"AT&T"],[V,et]],[/\bsie-(\w*)/i],[D,[W,"Siemens"],[V,et]],[/\b(rct\w+) b/i],[D,[W,"RCA"],[V,ft]],[/\b(venue[\d ]{2,7}) b/i],[D,[W,"Dell"],[V,ft]],[/\b(q(?:mv|ta)\w+) b/i],[D,[W,"Verizon"],[V,ft]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[D,[W,"Barnes & Noble"],[V,ft]],[/\b(tm\d{3}\w+) b/i],[D,[W,"NuVision"],[V,ft]],[/\b(k88) b/i],[D,[W,"ZTE"],[V,ft]],[/\b(nx\d{3}j) b/i],[D,[W,"ZTE"],[V,et]],[/\b(gen\d{3}) b.+49h/i],[D,[W,"Swiss"],[V,et]],[/\b(zur\d{3}) b/i],[D,[W,"Swiss"],[V,ft]],[/\b((zeki)?tb.*\b) b/i],[D,[W,"Zeki"],[V,ft]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[W,"Dragon Touch"],D,[V,ft]],[/\b(ns-?\w{0,9}) b/i],[D,[W,"Insignia"],[V,ft]],[/\b((nxa|next)-?\w{0,9}) b/i],[D,[W,"NextBook"],[V,ft]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[W,"Voice"],D,[V,et]],[/\b(lvtel\-)?(v1[12]) b/i],[[W,"LvTel"],D,[V,et]],[/\b(ph-1) /i],[D,[W,"Essential"],[V,et]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[D,[W,"Envizen"],[V,ft]],[/\b(trio[-\w\. ]+) b/i],[D,[W,"MachSpeed"],[V,ft]],[/\btu_(1491) b/i],[D,[W,"Rotor"],[V,ft]],[/(shield[\w ]+) b/i],[D,[W,"Nvidia"],[V,ft]],[/(sprint) (\w+)/i],[W,D,[V,et]],[/(kin\.[onetw]{3})/i],[[D,/\./g," "],[W,"Microsoft"],[V,et]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[D,[W,"Zebra"],[V,ft]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[D,[W,"Zebra"],[V,et]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[W,D,[V,"console"]],[/droid.+; (shield) bui/i],[D,[W,"Nvidia"],[V,"console"]],[/(playstation [345portablevi]+)/i],[D,[W,"Sony"],[V,"console"]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[D,[W,"Microsoft"],[V,"console"]],[/smart-tv.+(samsung)/i],[W,[V,Dt]],[/hbbtv.+maple;(\d+)/i],[[D,/^/,"SmartTV"],[W,"Samsung"],[V,Dt]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[W,"LG"],[V,Dt]],[/(apple) ?tv/i],[W,[D,"Apple TV"],[V,Dt]],[/crkey/i],[[D,"Chromecast"],[W,"Google"],[V,Dt]],[/droid.+aft(\w)( bui|\))/i],[D,[W,"Amazon"],[V,Dt]],[/\(dtv[\);].+(aquos)/i],[D,[W,"Sharp"],[V,Dt]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[W,B],[D,B],[V,Dt]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[V,Dt]],[/((pebble))app/i],[W,D,[V,"wearable"]],[/droid.+; (glass) \d/i],[D,[W,"Google"],[V,"wearable"]],[/droid.+; (wt63?0{2,3})\)/i],[D,[W,"Zebra"],[V,"wearable"]],[/(quest( 2)?)/i],[D,[W,"Facebook"],[V,"wearable"]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[W,[V,"embedded"]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[D,[V,et]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[D,[V,ft]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[V,ft]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[V,et]],[/(android[-\w\. ]{0,9});.+buil/i],[D,[W,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[X,[k,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[X,[k,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[k,X],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[X,k]],os:[[/microsoft (windows) (vista|xp)/i],[k,X],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[k,[X,P,H]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[k,"Windows"],[X,P,H]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[X,/_/g,"."],[k,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[k,"Mac OS"],[X,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[X,k],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[k,X],[/\(bb(10);/i],[X,[k,"BlackBerry"]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[X,[k,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[X,[k,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[X,[k,"webOS"]],[/crkey\/([\d\.]+)/i],[X,[k,"Chromecast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[k,"Chromium OS"],X],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[k,X],[/(sunos) ?([\w\.\d]*)/i],[[k,"Solaris"],X],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[k,X]]},G=function(st,z){if(typeof st=="object"&&(z=st,st=void 0),!(this instanceof G))return new G(st,z).getResult();var U=st||(M!==void 0&&M.navigator&&M.navigator.userAgent?M.navigator.userAgent:""),dt=z?function($,vt){var Lt={};for(var K in $)vt[K]&&vt[K].length%2==0?Lt[K]=vt[K].concat($[K]):Lt[K]=$[K];return Lt}(tt,z):tt;return this.getBrowser=function(){var $,vt={};return vt[k]=void 0,vt[X]=void 0,Y.call(vt,U,dt.browser),vt.major=typeof($=vt.version)=="string"?$.replace(/[^\d\.]/g,"").split(".")[0]:void 0,vt},this.getCPU=function(){var $={architecture:void 0};return Y.call($,U,dt.cpu),$},this.getDevice=function(){var $={vendor:void 0,model:void 0,type:void 0};return Y.call($,U,dt.device),$},this.getEngine=function(){var $={name:void 0,version:void 0};return Y.call($,U,dt.engine),$},this.getOS=function(){var $={name:void 0,version:void 0};return Y.call($,U,dt.os),$},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return U},this.setUA=function($){return U=typeof $=="string"&&$.length>255?B($,255):$,this},this.setUA(U),this};G.VERSION="1.0.2",G.BROWSER=At([k,X,"major"]),G.CPU=At(["architecture"]),G.DEVICE=At([D,W,V,"console",et,Dt,ft,"wearable","embedded"]),G.ENGINE=G.OS=At([k,X]),w!==void 0?(b!==void 0&&b.exports&&(w=b.exports=G),w.UAParser=G):v(149)?(O=function(){return G}.call(w,v,w,b))===void 0||(b.exports=O):M!==void 0&&(M.UAParser=G);var Ot=M!==void 0&&(M.jQuery||M.Zepto);if(Ot&&!Ot.ua){var zt=new G;Ot.ua=zt.getResult(),Ot.ua.get=function(){return zt.getUA()},Ot.ua.set=function(st){zt.setUA(st);var z=zt.getResult();for(var U in z)Ot.ua[U]=z[U]}}})(typeof window=="object"?window:this)},function(b,w,v){(function(O){var M;/*!
|
|
3232
3232
|
* howler.js v2.2.3
|
|
3233
3233
|
* howlerjs.com
|
|
3234
3234
|
*
|
|
@@ -3236,7 +3236,7 @@ void main() {
|
|
|
3236
3236
|
* goldfirestudios.com
|
|
3237
3237
|
*
|
|
3238
3238
|
* MIT License
|
|
3239
|
-
*/(function(){var I=function(){this.init()};I.prototype={init:function(){var L=this||D;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!="undefined"&&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 R=this||D;if(L=parseFloat(L),R.ctx||At(),L!==void 0&&L>=0&&L<=1){if(R._volume=L,R._muted)return R;R.usingWebAudio&&R.masterGain.gain.setValueAtTime(L,D.ctx.currentTime);for(var B=0;B<R._howls.length;B++)if(!R._howls[B]._webAudio)for(var X=R._howls[B]._getSoundIds(),P=0;P<X.length;P++){var H=R._howls[B]._soundById(X[P]);H&&H._node&&(H._node.volume=H._volume*L)}return R}return R._volume},mute:function(L){var R=this||D;R.ctx||At(),R._muted=L,R.usingWebAudio&&R.masterGain.gain.setValueAtTime(L?0:R._volume,D.ctx.currentTime);for(var B=0;B<R._howls.length;B++)if(!R._howls[B]._webAudio)for(var X=R._howls[B]._getSoundIds(),P=0;P<X.length;P++){var H=R._howls[B]._soundById(X[P]);H&&H._node&&(H._node.muted=!!L||H._muted)}return R},stop:function(){for(var L=this||D,R=0;R<L._howls.length;R++)L._howls[R].stop();return L},unload:function(){for(var L=this||D,R=L._howls.length-1;R>=0;R--)L._howls[R].unload();return L.usingWebAudio&&L.ctx&&L.ctx.close!==void 0&&(L.ctx.close(),L.ctx=null,At()),L},codecs:function(L){return(this||D)._codecs[L.replace(/^x-/,"")]},_setup:function(){var L=this||D;if(L.state=L.ctx&&L.ctx.state||"suspended",L._autoSuspend(),!L.usingWebAudio)if(typeof Audio!="undefined")try{new Audio().oncanplaythrough===void 0&&(L._canPlayEvent="canplay")}catch{L.noAudio=!0}else L.noAudio=!0;try{new Audio().muted&&(L.noAudio=!0)}catch{}return L.noAudio||L._setupCodecs(),L},_setupCodecs:function(){var L=this||D,R=null;try{R=typeof Audio!="undefined"?new Audio:null}catch{return L}if(!R||typeof R.canPlayType!="function")return L;var B=R.canPlayType("audio/mpeg;").replace(/^no$/,""),X=L._navigator?L._navigator.userAgent:"",P=X.match(/OPR\/([0-6].)/g),H=P&&parseInt(P[0].split("/")[1],10)<33,tt=X.indexOf("Safari")!==-1&&X.indexOf("Chrome")===-1,G=X.match(/Version\/(.*?) /),Ot=tt&&G&&parseInt(G[1],10)<15;return L._codecs={mp3:!(H||!B&&!R.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!B,opus:!!R.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!R.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!R.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(R.canPlayType('audio/wav; codecs="1"')||R.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!R.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!R.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(R.canPlayType("audio/x-m4a;")||R.canPlayType("audio/m4a;")||R.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(R.canPlayType("audio/x-m4b;")||R.canPlayType("audio/m4b;")||R.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(R.canPlayType("audio/x-mp4;")||R.canPlayType("audio/mp4;")||R.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!(Ot||!R.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!(Ot||!R.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!R.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(R.canPlayType("audio/x-flac;")||R.canPlayType("audio/flac;")).replace(/^no$/,"")},L},_unlockAudio:function(){var L=this||D;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 R=function(B){for(;L._html5AudioPool.length<L.html5PoolSize;)try{var X=new Audio;X._unlocked=!0,L._releaseHtml5Audio(X)}catch{L.noAudio=!0;break}for(var P=0;P<L._howls.length;P++)if(!L._howls[P]._webAudio)for(var H=L._howls[P]._getSoundIds(),tt=0;tt<H.length;tt++){var G=L._howls[P]._soundById(H[tt]);G&&G._node&&!G._node._unlocked&&(G._node._unlocked=!0,G._node.load())}L._autoResume();var Ot=L.ctx.createBufferSource();Ot.buffer=L._scratchBuffer,Ot.connect(L.ctx.destination),Ot.start===void 0?Ot.noteOn(0):Ot.start(0),typeof L.ctx.resume=="function"&&L.ctx.resume(),Ot.onended=function(){Ot.disconnect(0),L._audioUnlocked=!0,document.removeEventListener("touchstart",R,!0),document.removeEventListener("touchend",R,!0),document.removeEventListener("click",R,!0),document.removeEventListener("keydown",R,!0);for(var zt=0;zt<L._howls.length;zt++)L._howls[zt]._emit("unlock")}};return document.addEventListener("touchstart",R,!0),document.addEventListener("touchend",R,!0),document.addEventListener("click",R,!0),document.addEventListener("keydown",R,!0),L}},_obtainHtml5Audio:function(){var L=this||D;if(L._html5AudioPool.length)return L._html5AudioPool.pop();var R=new Audio().play();return R&&typeof Promise!="undefined"&&(R instanceof Promise||typeof R.then=="function")&&R.catch(function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")}),new Audio},_releaseHtml5Audio:function(L){var R=this||D;return L._unlocked&&R._html5AudioPool.push(L),R},_autoSuspend:function(){var L=this;if(L.autoSuspend&&L.ctx&&L.ctx.suspend!==void 0&&D.usingWebAudio){for(var R=0;R<L._howls.length;R++)if(L._howls[R]._webAudio){for(var B=0;B<L._howls[R]._sounds.length;B++)if(!L._howls[R]._sounds[B]._paused)return L}return L._suspendTimer&&clearTimeout(L._suspendTimer),L._suspendTimer=setTimeout(function(){if(L.autoSuspend){L._suspendTimer=null,L.state="suspending";var X=function(){L.state="suspended",L._resumeAfterSuspend&&(delete L._resumeAfterSuspend,L._autoResume())};L.ctx.suspend().then(X,X)}},3e4),L}},_autoResume:function(){var L=this;if(L.ctx&&L.ctx.resume!==void 0&&D.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 R=0;R<L._howls.length;R++)L._howls[R]._emit("resume")}),L._suspendTimer&&(clearTimeout(L._suspendTimer),L._suspendTimer=null)):L.state==="suspending"&&(L._resumeAfterSuspend=!0),L}};var D=new I,k=function(L){L.src&&L.src.length!==0?this.init(L):console.error("An array of source files must be passed with any new Howl.")};k.prototype={init:function(L){var R=this;return D.ctx||At(),R._autoplay=L.autoplay||!1,R._format=typeof L.format!="string"?L.format:[L.format],R._html5=L.html5||!1,R._muted=L.mute||!1,R._loop=L.loop||!1,R._pool=L.pool||5,R._preload=typeof L.preload!="boolean"&&L.preload!=="metadata"||L.preload,R._rate=L.rate||1,R._sprite=L.sprite||{},R._src=typeof L.src!="string"?L.src:[L.src],R._volume=L.volume!==void 0?L.volume:1,R._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},R._duration=0,R._state="unloaded",R._sounds=[],R._endTimers={},R._queue=[],R._playLock=!1,R._onend=L.onend?[{fn:L.onend}]:[],R._onfade=L.onfade?[{fn:L.onfade}]:[],R._onload=L.onload?[{fn:L.onload}]:[],R._onloaderror=L.onloaderror?[{fn:L.onloaderror}]:[],R._onplayerror=L.onplayerror?[{fn:L.onplayerror}]:[],R._onpause=L.onpause?[{fn:L.onpause}]:[],R._onplay=L.onplay?[{fn:L.onplay}]:[],R._onstop=L.onstop?[{fn:L.onstop}]:[],R._onmute=L.onmute?[{fn:L.onmute}]:[],R._onvolume=L.onvolume?[{fn:L.onvolume}]:[],R._onrate=L.onrate?[{fn:L.onrate}]:[],R._onseek=L.onseek?[{fn:L.onseek}]:[],R._onunlock=L.onunlock?[{fn:L.onunlock}]:[],R._onresume=[],R._webAudio=D.usingWebAudio&&!R._html5,D.ctx!==void 0&&D.ctx&&D.autoUnlock&&D._unlockAudio(),D._howls.push(R),R._autoplay&&R._queue.push({event:"play",action:function(){R.play()}}),R._preload&&R._preload!=="none"&&R.load(),R},load:function(){var L=null;if(D.noAudio)this._emit("loaderror",null,"No audio support.");else{typeof this._src=="string"&&(this._src=[this._src]);for(var R=0;R<this._src.length;R++){var B,X;if(this._format&&this._format[R])B=this._format[R];else{if(typeof(X=this._src[R])!="string"){this._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}(B=/^data:audio\/([^;,]+);/i.exec(X))||(B=/\.([^.]+)$/.exec(X.split("?",1)[0])),B&&(B=B[1].toLowerCase())}if(B||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),B&&D.codecs(B)){L=this._src[R];break}}if(L)return this._src=L,this._state="loading",window.location.protocol==="https:"&&L.slice(0,5)==="http:"&&(this._html5=!0,this._webAudio=!1),new z(this),this._webAudio&&Y(this),this;this._emit("loaderror",null,"No codec support for selected audio sources.")}},play:function(L,R){var B=this,X=null;if(typeof L=="number")X=L,L=null;else{if(typeof L=="string"&&B._state==="loaded"&&!B._sprite[L])return null;if(L===void 0&&(L="__default",!B._playLock)){for(var P=0,H=0;H<B._sounds.length;H++)B._sounds[H]._paused&&!B._sounds[H]._ended&&(P++,X=B._sounds[H]._id);P===1?L=null:X=null}}var tt=X?B._soundById(X):B._inactiveSound();if(!tt)return null;if(X&&!L&&(L=tt._sprite||"__default"),B._state!=="loaded"){tt._sprite=L,tt._ended=!1;var G=tt._id;return B._queue.push({event:"play",action:function(){B.play(G)}}),G}if(X&&!tt._paused)return R||B._loadQueue("play"),tt._id;B._webAudio&&D._autoResume();var Ot=Math.max(0,tt._seek>0?tt._seek:B._sprite[L][0]/1e3),zt=Math.max(0,(B._sprite[L][0]+B._sprite[L][1])/1e3-Ot),st=1e3*zt/Math.abs(tt._rate),V=B._sprite[L][0]/1e3,U=(B._sprite[L][0]+B._sprite[L][1])/1e3;tt._sprite=L,tt._ended=!1;var dt=function(){tt._paused=!1,tt._seek=Ot,tt._start=V,tt._stop=U,tt._loop=!(!tt._loop&&!B._sprite[L][2])};if(!(Ot>=U)){var $=tt._node;if(B._webAudio){var vt=function(){B._playLock=!1,dt(),B._refreshBuffer(tt);var nt=tt._muted||B._muted?0:tt._volume;$.gain.setValueAtTime(nt,D.ctx.currentTime),tt._playStart=D.ctx.currentTime,$.bufferSource.start===void 0?tt._loop?$.bufferSource.noteGrainOn(0,Ot,86400):$.bufferSource.noteGrainOn(0,Ot,zt):tt._loop?$.bufferSource.start(0,Ot,86400):$.bufferSource.start(0,Ot,zt),st!==1/0&&(B._endTimers[tt._id]=setTimeout(B._ended.bind(B,tt),st)),R||setTimeout(function(){B._emit("play",tt._id),B._loadQueue()},0)};D.state==="running"&&D.ctx.state!=="interrupted"?vt():(B._playLock=!0,B.once("resume",vt),B._clearTimer(tt._id))}else{var Lt=function(){$.currentTime=Ot,$.muted=tt._muted||B._muted||D._muted||$.muted,$.volume=tt._volume*D.volume(),$.playbackRate=tt._rate;try{var nt=$.play();if(nt&&typeof Promise!="undefined"&&(nt instanceof Promise||typeof nt.then=="function")?(B._playLock=!0,dt(),nt.then(function(){B._playLock=!1,$._unlocked=!0,R?B._loadQueue():B._emit("play",tt._id)}).catch(function(){B._playLock=!1,B._emit("playerror",tt._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."),tt._ended=!0,tt._paused=!0})):R||(B._playLock=!1,dt(),B._emit("play",tt._id)),$.playbackRate=tt._rate,$.paused)return void B._emit("playerror",tt._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.");L!=="__default"||tt._loop?B._endTimers[tt._id]=setTimeout(B._ended.bind(B,tt),st):(B._endTimers[tt._id]=function(){B._ended(tt),$.removeEventListener("ended",B._endTimers[tt._id],!1)},$.addEventListener("ended",B._endTimers[tt._id],!1))}catch(_t){B._emit("playerror",tt._id,_t)}};$.src==="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"&&($.src=B._src,$.load());var K=window&&window.ejecta||!$.readyState&&D._navigator.isCocoonJS;if($.readyState>=3||K)Lt();else{B._playLock=!0,B._state="loading";var ct=function(){B._state="loaded",Lt(),$.removeEventListener(D._canPlayEvent,ct,!1)};$.addEventListener(D._canPlayEvent,ct,!1),B._clearTimer(tt._id)}}return tt._id}B._ended(tt)},pause:function(L){var R=this;if(R._state!=="loaded"||R._playLock)return R._queue.push({event:"pause",action:function(){R.pause(L)}}),R;for(var B=R._getSoundIds(L),X=0;X<B.length;X++){R._clearTimer(B[X]);var P=R._soundById(B[X]);if(P&&!P._paused&&(P._seek=R.seek(B[X]),P._rateSeek=0,P._paused=!0,R._stopFade(B[X]),P._node))if(R._webAudio){if(!P._node.bufferSource)continue;P._node.bufferSource.stop===void 0?P._node.bufferSource.noteOff(0):P._node.bufferSource.stop(0),R._cleanBuffer(P._node)}else isNaN(P._node.duration)&&P._node.duration!==1/0||P._node.pause();arguments[1]||R._emit("pause",P?P._id:null)}return R},stop:function(L,R){var B=this;if(B._state!=="loaded"||B._playLock)return B._queue.push({event:"stop",action:function(){B.stop(L)}}),B;for(var X=B._getSoundIds(L),P=0;P<X.length;P++){B._clearTimer(X[P]);var H=B._soundById(X[P]);H&&(H._seek=H._start||0,H._rateSeek=0,H._paused=!0,H._ended=!0,B._stopFade(X[P]),H._node&&(B._webAudio?H._node.bufferSource&&(H._node.bufferSource.stop===void 0?H._node.bufferSource.noteOff(0):H._node.bufferSource.stop(0),B._cleanBuffer(H._node)):isNaN(H._node.duration)&&H._node.duration!==1/0||(H._node.currentTime=H._start||0,H._node.pause(),H._node.duration===1/0&&B._clearSound(H._node))),R||B._emit("stop",H._id))}return B},mute:function(L,R){var B=this;if(B._state!=="loaded"||B._playLock)return B._queue.push({event:"mute",action:function(){B.mute(L,R)}}),B;if(R===void 0){if(typeof L!="boolean")return B._muted;B._muted=L}for(var X=B._getSoundIds(R),P=0;P<X.length;P++){var H=B._soundById(X[P]);H&&(H._muted=L,H._interval&&B._stopFade(H._id),B._webAudio&&H._node?H._node.gain.setValueAtTime(L?0:H._volume,D.ctx.currentTime):H._node&&(H._node.muted=!!D._muted||L),B._emit("mute",H._id))}return B},volume:function(){var L,R,B,X=this,P=arguments;if(P.length===0)return X._volume;if(P.length===1||P.length===2&&P[1]===void 0){var H=X._getSoundIds(),tt=H.indexOf(P[0]);tt>=0?R=parseInt(P[0],10):L=parseFloat(P[0])}else P.length>=2&&(L=parseFloat(P[0]),R=parseInt(P[1],10));if(!(L!==void 0&&L>=0&&L<=1))return(B=R?X._soundById(R):X._sounds[0])?B._volume:0;if(X._state!=="loaded"||X._playLock)return X._queue.push({event:"volume",action:function(){X.volume.apply(X,P)}}),X;R===void 0&&(X._volume=L),R=X._getSoundIds(R);for(var G=0;G<R.length;G++)(B=X._soundById(R[G]))&&(B._volume=L,P[2]||X._stopFade(R[G]),X._webAudio&&B._node&&!B._muted?B._node.gain.setValueAtTime(L,D.ctx.currentTime):B._node&&!B._muted&&(B._node.volume=L*D.volume()),X._emit("volume",B._id));return X},fade:function(L,R,B,X){var P=this;if(P._state!=="loaded"||P._playLock)return P._queue.push({event:"fade",action:function(){P.fade(L,R,B,X)}}),P;L=Math.min(Math.max(0,parseFloat(L)),1),R=Math.min(Math.max(0,parseFloat(R)),1),B=parseFloat(B),P.volume(L,X);for(var H=P._getSoundIds(X),tt=0;tt<H.length;tt++){var G=P._soundById(H[tt]);if(G){if(X||P._stopFade(H[tt]),P._webAudio&&!G._muted){var Ot=D.ctx.currentTime,zt=Ot+B/1e3;G._volume=L,G._node.gain.setValueAtTime(L,Ot),G._node.gain.linearRampToValueAtTime(R,zt)}P._startFadeInterval(G,L,R,B,H[tt],X===void 0)}}return P},_startFadeInterval:function(L,R,B,X,P,H){var tt=this,G=R,Ot=B-R,zt=Math.abs(Ot/.01),st=Math.max(4,zt>0?X/zt:X),V=Date.now();L._fadeTo=B,L._interval=setInterval(function(){var U=(Date.now()-V)/X;V=Date.now(),G+=Ot*U,G=Math.round(100*G)/100,G=Ot<0?Math.max(B,G):Math.min(B,G),tt._webAudio?L._volume=G:tt.volume(G,L._id,!0),H&&(tt._volume=G),(B<R&&G<=B||B>R&&G>=B)&&(clearInterval(L._interval),L._interval=null,L._fadeTo=null,tt.volume(B,L._id),tt._emit("fade",L._id))},st)},_stopFade:function(L){var R=this._soundById(L);return R&&R._interval&&(this._webAudio&&R._node.gain.cancelScheduledValues(D.ctx.currentTime),clearInterval(R._interval),R._interval=null,this.volume(R._fadeTo,L),R._fadeTo=null,this._emit("fade",L)),this},loop:function(){var L,R,B,X=this,P=arguments;if(P.length===0)return X._loop;if(P.length===1){if(typeof P[0]!="boolean")return!!(B=X._soundById(parseInt(P[0],10)))&&B._loop;L=P[0],X._loop=L}else P.length===2&&(L=P[0],R=parseInt(P[1],10));for(var H=X._getSoundIds(R),tt=0;tt<H.length;tt++)(B=X._soundById(H[tt]))&&(B._loop=L,X._webAudio&&B._node&&B._node.bufferSource&&(B._node.bufferSource.loop=L,L&&(B._node.bufferSource.loopStart=B._start||0,B._node.bufferSource.loopEnd=B._stop,X.playing(H[tt])&&(X.pause(H[tt],!0),X.play(H[tt],!0)))));return X},rate:function(){var L,R,B,X=this,P=arguments;if(P.length===0)R=X._sounds[0]._id;else if(P.length===1){var H=X._getSoundIds(),tt=H.indexOf(P[0]);tt>=0?R=parseInt(P[0],10):L=parseFloat(P[0])}else P.length===2&&(L=parseFloat(P[0]),R=parseInt(P[1],10));if(typeof L!="number")return(B=X._soundById(R))?B._rate:X._rate;if(X._state!=="loaded"||X._playLock)return X._queue.push({event:"rate",action:function(){X.rate.apply(X,P)}}),X;R===void 0&&(X._rate=L),R=X._getSoundIds(R);for(var G=0;G<R.length;G++)if(B=X._soundById(R[G])){X.playing(R[G])&&(B._rateSeek=X.seek(R[G]),B._playStart=X._webAudio?D.ctx.currentTime:B._playStart),B._rate=L,X._webAudio&&B._node&&B._node.bufferSource?B._node.bufferSource.playbackRate.setValueAtTime(L,D.ctx.currentTime):B._node&&(B._node.playbackRate=L);var Ot=X.seek(R[G]),zt=(X._sprite[B._sprite][0]+X._sprite[B._sprite][1])/1e3-Ot,st=1e3*zt/Math.abs(B._rate);!X._endTimers[R[G]]&&B._paused||(X._clearTimer(R[G]),X._endTimers[R[G]]=setTimeout(X._ended.bind(X,B),st)),X._emit("rate",B._id)}return X},seek:function(){var L,R,B=this,X=arguments;if(X.length===0)B._sounds.length&&(R=B._sounds[0]._id);else if(X.length===1){var P=B._getSoundIds(),H=P.indexOf(X[0]);H>=0?R=parseInt(X[0],10):B._sounds.length&&(R=B._sounds[0]._id,L=parseFloat(X[0]))}else X.length===2&&(L=parseFloat(X[0]),R=parseInt(X[1],10));if(R===void 0)return 0;if(typeof L=="number"&&(B._state!=="loaded"||B._playLock))return B._queue.push({event:"seek",action:function(){B.seek.apply(B,X)}}),B;var tt=B._soundById(R);if(tt){if(!(typeof L=="number"&&L>=0)){if(B._webAudio){var G=B.playing(R)?D.ctx.currentTime-tt._playStart:0,Ot=tt._rateSeek?tt._rateSeek-tt._seek:0;return tt._seek+(Ot+G*Math.abs(tt._rate))}return tt._node.currentTime}var zt=B.playing(R);zt&&B.pause(R,!0),tt._seek=L,tt._ended=!1,B._clearTimer(R),B._webAudio||!tt._node||isNaN(tt._node.duration)||(tt._node.currentTime=L);var st=function(){zt&&B.play(R,!0),B._emit("seek",R)};if(zt&&!B._webAudio){var V=function(){B._playLock?setTimeout(V,0):st()};setTimeout(V,0)}else st()}return B},playing:function(L){if(typeof L=="number"){var R=this._soundById(L);return!!R&&!R._paused}for(var B=0;B<this._sounds.length;B++)if(!this._sounds[B]._paused)return!0;return!1},duration:function(L){var R=this._duration,B=this._soundById(L);return B&&(R=this._sprite[B._sprite][1]/1e3),R},state:function(){return this._state},unload:function(){for(var L=this,R=L._sounds,B=0;B<R.length;B++)R[B]._paused||L.stop(R[B]._id),L._webAudio||(L._clearSound(R[B]._node),R[B]._node.removeEventListener("error",R[B]._errorFn,!1),R[B]._node.removeEventListener(D._canPlayEvent,R[B]._loadFn,!1),R[B]._node.removeEventListener("ended",R[B]._endFn,!1),D._releaseHtml5Audio(R[B]._node)),delete R[B]._node,L._clearTimer(R[B]._id);var X=D._howls.indexOf(L);X>=0&&D._howls.splice(X,1);var P=!0;for(B=0;B<D._howls.length;B++)if(D._howls[B]._src===L._src||L._src.indexOf(D._howls[B]._src)>=0){P=!1;break}return W&&P&&delete W[L._src],D.noAudio=!1,L._state="unloaded",L._sounds=[],L=null,null},on:function(L,R,B,X){var P=this["_on"+L];return typeof R=="function"&&P.push(X?{id:B,fn:R,once:X}:{id:B,fn:R}),this},off:function(L,R,B){var X=this["_on"+L],P=0;if(typeof R=="number"&&(B=R,R=null),R||B)for(P=0;P<X.length;P++){var H=B===X[P].id;if(R===X[P].fn&&H||!R&&H){X.splice(P,1);break}}else if(L)this["_on"+L]=[];else{var tt=Object.keys(this);for(P=0;P<tt.length;P++)tt[P].indexOf("_on")===0&&Array.isArray(this[tt[P]])&&(this[tt[P]]=[])}return this},once:function(L,R,B){return this.on(L,R,B,1),this},_emit:function(L,R,B){for(var X=this["_on"+L],P=X.length-1;P>=0;P--)X[P].id&&X[P].id!==R&&L!=="load"||(setTimeout(function(H){H.call(this,R,B)}.bind(this,X[P].fn),0),X[P].once&&this.off(L,X[P].fn,X[P].id));return this._loadQueue(L),this},_loadQueue:function(L){if(this._queue.length>0){var R=this._queue[0];R.event===L&&(this._queue.shift(),this._loadQueue()),L||R.action()}return this},_ended:function(L){var R=L._sprite;if(!this._webAudio&&L._node&&!L._node.paused&&!L._node.ended&&L._node.currentTime<L._stop)return setTimeout(this._ended.bind(this,L),100),this;var B=!(!L._loop&&!this._sprite[R][2]);if(this._emit("end",L._id),!this._webAudio&&B&&this.stop(L._id,!0).play(L._id),this._webAudio&&B){this._emit("play",L._id),L._seek=L._start||0,L._rateSeek=0,L._playStart=D.ctx.currentTime;var X=1e3*(L._stop-L._start)/Math.abs(L._rate);this._endTimers[L._id]=setTimeout(this._ended.bind(this,L),X)}return this._webAudio&&!B&&(L._paused=!0,L._ended=!0,L._seek=L._start||0,L._rateSeek=0,this._clearTimer(L._id),this._cleanBuffer(L._node),D._autoSuspend()),this._webAudio||B||this.stop(L._id,!0),this},_clearTimer:function(L){if(this._endTimers[L]){if(typeof this._endTimers[L]!="function")clearTimeout(this._endTimers[L]);else{var R=this._soundById(L);R&&R._node&&R._node.removeEventListener("ended",this._endTimers[L],!1)}delete this._endTimers[L]}return this},_soundById:function(L){for(var R=0;R<this._sounds.length;R++)if(L===this._sounds[R]._id)return this._sounds[R];return null},_inactiveSound:function(){this._drain();for(var L=0;L<this._sounds.length;L++)if(this._sounds[L]._ended)return this._sounds[L].reset();return new z(this)},_drain:function(){var L=this._pool,R=0,B=0;if(!(this._sounds.length<L)){for(B=0;B<this._sounds.length;B++)this._sounds[B]._ended&&R++;for(B=this._sounds.length-1;B>=0;B--){if(R<=L)return;this._sounds[B]._ended&&(this._webAudio&&this._sounds[B]._node&&this._sounds[B]._node.disconnect(0),this._sounds.splice(B,1),R--)}}},_getSoundIds:function(L){if(L===void 0){for(var R=[],B=0;B<this._sounds.length;B++)R.push(this._sounds[B]._id);return R}return[L]},_refreshBuffer:function(L){return L._node.bufferSource=D.ctx.createBufferSource(),L._node.bufferSource.buffer=W[this._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,D.ctx.currentTime),this},_cleanBuffer:function(L){var R=D._navigator&&D._navigator.vendor.indexOf("Apple")>=0;if(D._scratchBuffer&&L.bufferSource&&(L.bufferSource.onended=null,L.bufferSource.disconnect(0),R))try{L.bufferSource.buffer=D._scratchBuffer}catch{}return L.bufferSource=null,this},_clearSound:function(L){/MSIE |Trident\//.test(D._navigator&&D._navigator.userAgent)||(L.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var z=function(L){this._parent=L,this.init()};z.prototype={init:function(){var L=this._parent;return this._muted=L._muted,this._loop=L._loop,this._volume=L._volume,this._rate=L._rate,this._seek=0,this._paused=!0,this._ended=!0,this._sprite="__default",this._id=++D._counter,L._sounds.push(this),this.create(),this},create:function(){var L=this._parent,R=D._muted||this._muted||this._parent._muted?0:this._volume;return L._webAudio?(this._node=D.ctx.createGain===void 0?D.ctx.createGainNode():D.ctx.createGain(),this._node.gain.setValueAtTime(R,D.ctx.currentTime),this._node.paused=!0,this._node.connect(D.masterGain)):D.noAudio||(this._node=D._obtainHtml5Audio(),this._errorFn=this._errorListener.bind(this),this._node.addEventListener("error",this._errorFn,!1),this._loadFn=this._loadListener.bind(this),this._node.addEventListener(D._canPlayEvent,this._loadFn,!1),this._endFn=this._endListener.bind(this),this._node.addEventListener("ended",this._endFn,!1),this._node.src=L._src,this._node.preload=L._preload===!0?"auto":L._preload,this._node.volume=R*D.volume(),this._node.load()),this},reset:function(){var L=this._parent;return this._muted=L._muted,this._loop=L._loop,this._volume=L._volume,this._rate=L._rate,this._seek=0,this._rateSeek=0,this._paused=!0,this._ended=!0,this._sprite="__default",this._id=++D._counter,this},_errorListener:function(){this._parent._emit("loaderror",this._id,this._node.error?this._node.error.code:0),this._node.removeEventListener("error",this._errorFn,!1)},_loadListener:function(){var L=this._parent;L._duration=Math.ceil(10*this._node.duration)/10,Object.keys(L._sprite).length===0&&(L._sprite={__default:[0,1e3*L._duration]}),L._state!=="loaded"&&(L._state="loaded",L._emit("load"),L._loadQueue()),this._node.removeEventListener(D._canPlayEvent,this._loadFn,!1)},_endListener:function(){var L=this._parent;L._duration===1/0&&(L._duration=Math.ceil(10*this._node.duration)/10,L._sprite.__default[1]===1/0&&(L._sprite.__default[1]=1e3*L._duration),L._ended(this)),this._node.removeEventListener("ended",this._endFn,!1)}};var W={},Y=function(L){var R=L._src;if(W[R])return L._duration=W[R].duration,void Dt(L);if(/^data:[^;]+;base64,/.test(R)){for(var B=atob(R.split(",")[1]),X=new Uint8Array(B.length),P=0;P<B.length;++P)X[P]=B.charCodeAt(P);ft(X.buffer,L)}else{var H=new XMLHttpRequest;H.open(L._xhr.method,R,!0),H.withCredentials=L._xhr.withCredentials,H.responseType="arraybuffer",L._xhr.headers&&Object.keys(L._xhr.headers).forEach(function(tt){H.setRequestHeader(tt,L._xhr.headers[tt])}),H.onload=function(){var tt=(H.status+"")[0];tt==="0"||tt==="2"||tt==="3"?ft(H.response,L):L._emit("loaderror",null,"Failed loading audio file with status: "+H.status+".")},H.onerror=function(){L._webAudio&&(L._html5=!0,L._webAudio=!1,L._sounds=[],delete W[R],L.load())},et(H)}},et=function(L){try{L.send()}catch{L.onerror()}},ft=function(L,R){var B=function(){R._emit("loaderror",null,"Decoding audio data failed.")},X=function(P){P&&R._sounds.length>0?(W[R._src]=P,Dt(R,P)):B()};typeof Promise!="undefined"&&D.ctx.decodeAudioData.length===1?D.ctx.decodeAudioData(L).then(X).catch(B):D.ctx.decodeAudioData(L,X,B)},Dt=function(L,R){R&&!L._duration&&(L._duration=R.duration),Object.keys(L._sprite).length===0&&(L._sprite={__default:[0,1e3*L._duration]}),L._state!=="loaded"&&(L._state="loaded",L._emit("load"),L._loadQueue())},At=function(){if(D.usingWebAudio){try{typeof AudioContext!="undefined"?D.ctx=new AudioContext:typeof webkitAudioContext!="undefined"?D.ctx=new webkitAudioContext:D.usingWebAudio=!1}catch{D.usingWebAudio=!1}D.ctx||(D.usingWebAudio=!1);var L=/iP(hone|od|ad)/.test(D._navigator&&D._navigator.platform),R=D._navigator&&D._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),B=R?parseInt(R[1],10):null;if(L&&B&&B<9){var X=/safari/.test(D._navigator&&D._navigator.userAgent.toLowerCase());D._navigator&&!X&&(D.usingWebAudio=!1)}D.usingWebAudio&&(D.masterGain=D.ctx.createGain===void 0?D.ctx.createGainNode():D.ctx.createGain(),D.masterGain.gain.setValueAtTime(D._muted?0:D._volume,D.ctx.currentTime),D.masterGain.connect(D.ctx.destination)),D._setup()}};(M=function(){return{Howler:D,Howl:k}}.apply(w,[]))===void 0||(b.exports=M),w.Howler=D,w.Howl=k,O!==void 0?(O.HowlerGlobal=I,O.Howler=D,O.Howl=k,O.Sound=z):typeof window!="undefined"&&(window.HowlerGlobal=I,window.Howler=D,window.Howl=k,window.Sound=z)})(),function(){var I;HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(k){if(!this.ctx||!this.ctx.listener)return this;for(var z=this._howls.length-1;z>=0;z--)this._howls[z].stereo(k);return this},HowlerGlobal.prototype.pos=function(k,z,W){return this.ctx&&this.ctx.listener?(z=typeof z!="number"?this._pos[1]:z,W=typeof W!="number"?this._pos[2]:W,typeof k!="number"?this._pos:(this._pos=[k,z,W],this.ctx.listener.positionX!==void 0?(this.ctx.listener.positionX.setTargetAtTime(this._pos[0],Howler.ctx.currentTime,.1),this.ctx.listener.positionY.setTargetAtTime(this._pos[1],Howler.ctx.currentTime,.1),this.ctx.listener.positionZ.setTargetAtTime(this._pos[2],Howler.ctx.currentTime,.1)):this.ctx.listener.setPosition(this._pos[0],this._pos[1],this._pos[2]),this)):this},HowlerGlobal.prototype.orientation=function(k,z,W,Y,et,ft){if(!this.ctx||!this.ctx.listener)return this;var Dt=this._orientation;return z=typeof z!="number"?Dt[1]:z,W=typeof W!="number"?Dt[2]:W,Y=typeof Y!="number"?Dt[3]:Y,et=typeof et!="number"?Dt[4]:et,ft=typeof ft!="number"?Dt[5]:ft,typeof k!="number"?Dt:(this._orientation=[k,z,W,Y,et,ft],this.ctx.listener.forwardX!==void 0?(this.ctx.listener.forwardX.setTargetAtTime(k,Howler.ctx.currentTime,.1),this.ctx.listener.forwardY.setTargetAtTime(z,Howler.ctx.currentTime,.1),this.ctx.listener.forwardZ.setTargetAtTime(W,Howler.ctx.currentTime,.1),this.ctx.listener.upX.setTargetAtTime(Y,Howler.ctx.currentTime,.1),this.ctx.listener.upY.setTargetAtTime(et,Howler.ctx.currentTime,.1),this.ctx.listener.upZ.setTargetAtTime(ft,Howler.ctx.currentTime,.1)):this.ctx.listener.setOrientation(k,z,W,Y,et,ft),this)},Howl.prototype.init=(I=Howl.prototype.init,function(k){return this._orientation=k.orientation||[1,0,0],this._stereo=k.stereo||null,this._pos=k.pos||null,this._pannerAttr={coneInnerAngle:k.coneInnerAngle!==void 0?k.coneInnerAngle:360,coneOuterAngle:k.coneOuterAngle!==void 0?k.coneOuterAngle:360,coneOuterGain:k.coneOuterGain!==void 0?k.coneOuterGain:0,distanceModel:k.distanceModel!==void 0?k.distanceModel:"inverse",maxDistance:k.maxDistance!==void 0?k.maxDistance:1e4,panningModel:k.panningModel!==void 0?k.panningModel:"HRTF",refDistance:k.refDistance!==void 0?k.refDistance:1,rolloffFactor:k.rolloffFactor!==void 0?k.rolloffFactor:1},this._onstereo=k.onstereo?[{fn:k.onstereo}]:[],this._onpos=k.onpos?[{fn:k.onpos}]:[],this._onorientation=k.onorientation?[{fn:k.onorientation}]:[],I.call(this,k)}),Howl.prototype.stereo=function(k,z){var W=this;if(!W._webAudio)return W;if(W._state!=="loaded")return W._queue.push({event:"stereo",action:function(){W.stereo(k,z)}}),W;var Y=Howler.ctx.createStereoPanner===void 0?"spatial":"stereo";if(z===void 0){if(typeof k!="number")return W._stereo;W._stereo=k,W._pos=[k,0,0]}for(var et=W._getSoundIds(z),ft=0;ft<et.length;ft++){var Dt=W._soundById(et[ft]);if(Dt){if(typeof k!="number")return Dt._stereo;Dt._stereo=k,Dt._pos=[k,0,0],Dt._node&&(Dt._pannerAttr.panningModel="equalpower",Dt._panner&&Dt._panner.pan||D(Dt,Y),Y==="spatial"?Dt._panner.positionX!==void 0?(Dt._panner.positionX.setValueAtTime(k,Howler.ctx.currentTime),Dt._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),Dt._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):Dt._panner.setPosition(k,0,0):Dt._panner.pan.setValueAtTime(k,Howler.ctx.currentTime)),W._emit("stereo",Dt._id)}}return W},Howl.prototype.pos=function(k,z,W,Y){var et=this;if(!et._webAudio)return et;if(et._state!=="loaded")return et._queue.push({event:"pos",action:function(){et.pos(k,z,W,Y)}}),et;if(z=typeof z!="number"?0:z,W=typeof W!="number"?-.5:W,Y===void 0){if(typeof k!="number")return et._pos;et._pos=[k,z,W]}for(var ft=et._getSoundIds(Y),Dt=0;Dt<ft.length;Dt++){var At=et._soundById(ft[Dt]);if(At){if(typeof k!="number")return At._pos;At._pos=[k,z,W],At._node&&(At._panner&&!At._panner.pan||D(At,"spatial"),At._panner.positionX!==void 0?(At._panner.positionX.setValueAtTime(k,Howler.ctx.currentTime),At._panner.positionY.setValueAtTime(z,Howler.ctx.currentTime),At._panner.positionZ.setValueAtTime(W,Howler.ctx.currentTime)):At._panner.setPosition(k,z,W)),et._emit("pos",At._id)}}return et},Howl.prototype.orientation=function(k,z,W,Y){var et=this;if(!et._webAudio)return et;if(et._state!=="loaded")return et._queue.push({event:"orientation",action:function(){et.orientation(k,z,W,Y)}}),et;if(z=typeof z!="number"?et._orientation[1]:z,W=typeof W!="number"?et._orientation[2]:W,Y===void 0){if(typeof k!="number")return et._orientation;et._orientation=[k,z,W]}for(var ft=et._getSoundIds(Y),Dt=0;Dt<ft.length;Dt++){var At=et._soundById(ft[Dt]);if(At){if(typeof k!="number")return At._orientation;At._orientation=[k,z,W],At._node&&(At._panner||(At._pos||(At._pos=et._pos||[0,0,-.5]),D(At,"spatial")),At._panner.orientationX!==void 0?(At._panner.orientationX.setValueAtTime(k,Howler.ctx.currentTime),At._panner.orientationY.setValueAtTime(z,Howler.ctx.currentTime),At._panner.orientationZ.setValueAtTime(W,Howler.ctx.currentTime)):At._panner.setOrientation(k,z,W)),et._emit("orientation",At._id)}}return et},Howl.prototype.pannerAttr=function(){var k,z,W,Y=this,et=arguments;if(!Y._webAudio)return Y;if(et.length===0)return Y._pannerAttr;if(et.length===1){if(typeof et[0]!="object")return(W=Y._soundById(parseInt(et[0],10)))?W._pannerAttr:Y._pannerAttr;k=et[0],z===void 0&&(k.pannerAttr||(k.pannerAttr={coneInnerAngle:k.coneInnerAngle,coneOuterAngle:k.coneOuterAngle,coneOuterGain:k.coneOuterGain,distanceModel:k.distanceModel,maxDistance:k.maxDistance,refDistance:k.refDistance,rolloffFactor:k.rolloffFactor,panningModel:k.panningModel}),Y._pannerAttr={coneInnerAngle:k.pannerAttr.coneInnerAngle!==void 0?k.pannerAttr.coneInnerAngle:Y._coneInnerAngle,coneOuterAngle:k.pannerAttr.coneOuterAngle!==void 0?k.pannerAttr.coneOuterAngle:Y._coneOuterAngle,coneOuterGain:k.pannerAttr.coneOuterGain!==void 0?k.pannerAttr.coneOuterGain:Y._coneOuterGain,distanceModel:k.pannerAttr.distanceModel!==void 0?k.pannerAttr.distanceModel:Y._distanceModel,maxDistance:k.pannerAttr.maxDistance!==void 0?k.pannerAttr.maxDistance:Y._maxDistance,refDistance:k.pannerAttr.refDistance!==void 0?k.pannerAttr.refDistance:Y._refDistance,rolloffFactor:k.pannerAttr.rolloffFactor!==void 0?k.pannerAttr.rolloffFactor:Y._rolloffFactor,panningModel:k.pannerAttr.panningModel!==void 0?k.pannerAttr.panningModel:Y._panningModel})}else et.length===2&&(k=et[0],z=parseInt(et[1],10));for(var ft=Y._getSoundIds(z),Dt=0;Dt<ft.length;Dt++)if(W=Y._soundById(ft[Dt])){var At=W._pannerAttr;At={coneInnerAngle:k.coneInnerAngle!==void 0?k.coneInnerAngle:At.coneInnerAngle,coneOuterAngle:k.coneOuterAngle!==void 0?k.coneOuterAngle:At.coneOuterAngle,coneOuterGain:k.coneOuterGain!==void 0?k.coneOuterGain:At.coneOuterGain,distanceModel:k.distanceModel!==void 0?k.distanceModel:At.distanceModel,maxDistance:k.maxDistance!==void 0?k.maxDistance:At.maxDistance,refDistance:k.refDistance!==void 0?k.refDistance:At.refDistance,rolloffFactor:k.rolloffFactor!==void 0?k.rolloffFactor:At.rolloffFactor,panningModel:k.panningModel!==void 0?k.panningModel:At.panningModel};var L=W._panner;L?(L.coneInnerAngle=At.coneInnerAngle,L.coneOuterAngle=At.coneOuterAngle,L.coneOuterGain=At.coneOuterGain,L.distanceModel=At.distanceModel,L.maxDistance=At.maxDistance,L.refDistance=At.refDistance,L.rolloffFactor=At.rolloffFactor,L.panningModel=At.panningModel):(W._pos||(W._pos=Y._pos||[0,0,-.5]),D(W,"spatial"))}return Y},Sound.prototype.init=function(k){return function(){var z=this._parent;this._orientation=z._orientation,this._stereo=z._stereo,this._pos=z._pos,this._pannerAttr=z._pannerAttr,k.call(this),this._stereo?z.stereo(this._stereo):this._pos&&z.pos(this._pos[0],this._pos[1],this._pos[2],this._id)}}(Sound.prototype.init),Sound.prototype.reset=function(k){return function(){var z=this._parent;return this._orientation=z._orientation,this._stereo=z._stereo,this._pos=z._pos,this._pannerAttr=z._pannerAttr,this._stereo?z.stereo(this._stereo):this._pos?z.pos(this._pos[0],this._pos[1],this._pos[2],this._id):this._panner&&(this._panner.disconnect(0),this._panner=void 0,z._refreshBuffer(this)),k.call(this)}}(Sound.prototype.reset);var D=function(k,z){(z=z||"spatial")==="spatial"?(k._panner=Howler.ctx.createPanner(),k._panner.coneInnerAngle=k._pannerAttr.coneInnerAngle,k._panner.coneOuterAngle=k._pannerAttr.coneOuterAngle,k._panner.coneOuterGain=k._pannerAttr.coneOuterGain,k._panner.distanceModel=k._pannerAttr.distanceModel,k._panner.maxDistance=k._pannerAttr.maxDistance,k._panner.refDistance=k._pannerAttr.refDistance,k._panner.rolloffFactor=k._pannerAttr.rolloffFactor,k._panner.panningModel=k._pannerAttr.panningModel,k._panner.positionX!==void 0?(k._panner.positionX.setValueAtTime(k._pos[0],Howler.ctx.currentTime),k._panner.positionY.setValueAtTime(k._pos[1],Howler.ctx.currentTime),k._panner.positionZ.setValueAtTime(k._pos[2],Howler.ctx.currentTime)):k._panner.setPosition(k._pos[0],k._pos[1],k._pos[2]),k._panner.orientationX!==void 0?(k._panner.orientationX.setValueAtTime(k._orientation[0],Howler.ctx.currentTime),k._panner.orientationY.setValueAtTime(k._orientation[1],Howler.ctx.currentTime),k._panner.orientationZ.setValueAtTime(k._orientation[2],Howler.ctx.currentTime)):k._panner.setOrientation(k._orientation[0],k._orientation[1],k._orientation[2])):(k._panner=Howler.ctx.createStereoPanner(),k._panner.pan.setValueAtTime(k._stereo,Howler.ctx.currentTime)),k._panner.connect(k._node),k._paused||k._parent.pause(k._id,!0).play(k._id,!0)}}()}).call(this,v(17))},function(b,w){b.exports=`varying vec2 vTextureCoord;
|
|
3239
|
+
*/(function(){var I=function(){this.init()};I.prototype={init:function(){var L=this||D;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!="undefined"&&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 R=this||D;if(L=parseFloat(L),R.ctx||At(),L!==void 0&&L>=0&&L<=1){if(R._volume=L,R._muted)return R;R.usingWebAudio&&R.masterGain.gain.setValueAtTime(L,D.ctx.currentTime);for(var B=0;B<R._howls.length;B++)if(!R._howls[B]._webAudio)for(var Y=R._howls[B]._getSoundIds(),P=0;P<Y.length;P++){var H=R._howls[B]._soundById(Y[P]);H&&H._node&&(H._node.volume=H._volume*L)}return R}return R._volume},mute:function(L){var R=this||D;R.ctx||At(),R._muted=L,R.usingWebAudio&&R.masterGain.gain.setValueAtTime(L?0:R._volume,D.ctx.currentTime);for(var B=0;B<R._howls.length;B++)if(!R._howls[B]._webAudio)for(var Y=R._howls[B]._getSoundIds(),P=0;P<Y.length;P++){var H=R._howls[B]._soundById(Y[P]);H&&H._node&&(H._node.muted=!!L||H._muted)}return R},stop:function(){for(var L=this||D,R=0;R<L._howls.length;R++)L._howls[R].stop();return L},unload:function(){for(var L=this||D,R=L._howls.length-1;R>=0;R--)L._howls[R].unload();return L.usingWebAudio&&L.ctx&&L.ctx.close!==void 0&&(L.ctx.close(),L.ctx=null,At()),L},codecs:function(L){return(this||D)._codecs[L.replace(/^x-/,"")]},_setup:function(){var L=this||D;if(L.state=L.ctx&&L.ctx.state||"suspended",L._autoSuspend(),!L.usingWebAudio)if(typeof Audio!="undefined")try{new Audio().oncanplaythrough===void 0&&(L._canPlayEvent="canplay")}catch{L.noAudio=!0}else L.noAudio=!0;try{new Audio().muted&&(L.noAudio=!0)}catch{}return L.noAudio||L._setupCodecs(),L},_setupCodecs:function(){var L=this||D,R=null;try{R=typeof Audio!="undefined"?new Audio:null}catch{return L}if(!R||typeof R.canPlayType!="function")return L;var B=R.canPlayType("audio/mpeg;").replace(/^no$/,""),Y=L._navigator?L._navigator.userAgent:"",P=Y.match(/OPR\/([0-6].)/g),H=P&&parseInt(P[0].split("/")[1],10)<33,tt=Y.indexOf("Safari")!==-1&&Y.indexOf("Chrome")===-1,G=Y.match(/Version\/(.*?) /),Ot=tt&&G&&parseInt(G[1],10)<15;return L._codecs={mp3:!(H||!B&&!R.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!B,opus:!!R.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!R.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!R.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(R.canPlayType('audio/wav; codecs="1"')||R.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!R.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!R.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(R.canPlayType("audio/x-m4a;")||R.canPlayType("audio/m4a;")||R.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(R.canPlayType("audio/x-m4b;")||R.canPlayType("audio/m4b;")||R.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(R.canPlayType("audio/x-mp4;")||R.canPlayType("audio/mp4;")||R.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!(Ot||!R.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!(Ot||!R.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!R.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(R.canPlayType("audio/x-flac;")||R.canPlayType("audio/flac;")).replace(/^no$/,"")},L},_unlockAudio:function(){var L=this||D;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 R=function(B){for(;L._html5AudioPool.length<L.html5PoolSize;)try{var Y=new Audio;Y._unlocked=!0,L._releaseHtml5Audio(Y)}catch{L.noAudio=!0;break}for(var P=0;P<L._howls.length;P++)if(!L._howls[P]._webAudio)for(var H=L._howls[P]._getSoundIds(),tt=0;tt<H.length;tt++){var G=L._howls[P]._soundById(H[tt]);G&&G._node&&!G._node._unlocked&&(G._node._unlocked=!0,G._node.load())}L._autoResume();var Ot=L.ctx.createBufferSource();Ot.buffer=L._scratchBuffer,Ot.connect(L.ctx.destination),Ot.start===void 0?Ot.noteOn(0):Ot.start(0),typeof L.ctx.resume=="function"&&L.ctx.resume(),Ot.onended=function(){Ot.disconnect(0),L._audioUnlocked=!0,document.removeEventListener("touchstart",R,!0),document.removeEventListener("touchend",R,!0),document.removeEventListener("click",R,!0),document.removeEventListener("keydown",R,!0);for(var zt=0;zt<L._howls.length;zt++)L._howls[zt]._emit("unlock")}};return document.addEventListener("touchstart",R,!0),document.addEventListener("touchend",R,!0),document.addEventListener("click",R,!0),document.addEventListener("keydown",R,!0),L}},_obtainHtml5Audio:function(){var L=this||D;if(L._html5AudioPool.length)return L._html5AudioPool.pop();var R=new Audio().play();return R&&typeof Promise!="undefined"&&(R instanceof Promise||typeof R.then=="function")&&R.catch(function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")}),new Audio},_releaseHtml5Audio:function(L){var R=this||D;return L._unlocked&&R._html5AudioPool.push(L),R},_autoSuspend:function(){var L=this;if(L.autoSuspend&&L.ctx&&L.ctx.suspend!==void 0&&D.usingWebAudio){for(var R=0;R<L._howls.length;R++)if(L._howls[R]._webAudio){for(var B=0;B<L._howls[R]._sounds.length;B++)if(!L._howls[R]._sounds[B]._paused)return L}return L._suspendTimer&&clearTimeout(L._suspendTimer),L._suspendTimer=setTimeout(function(){if(L.autoSuspend){L._suspendTimer=null,L.state="suspending";var Y=function(){L.state="suspended",L._resumeAfterSuspend&&(delete L._resumeAfterSuspend,L._autoResume())};L.ctx.suspend().then(Y,Y)}},3e4),L}},_autoResume:function(){var L=this;if(L.ctx&&L.ctx.resume!==void 0&&D.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 R=0;R<L._howls.length;R++)L._howls[R]._emit("resume")}),L._suspendTimer&&(clearTimeout(L._suspendTimer),L._suspendTimer=null)):L.state==="suspending"&&(L._resumeAfterSuspend=!0),L}};var D=new I,k=function(L){L.src&&L.src.length!==0?this.init(L):console.error("An array of source files must be passed with any new Howl.")};k.prototype={init:function(L){var R=this;return D.ctx||At(),R._autoplay=L.autoplay||!1,R._format=typeof L.format!="string"?L.format:[L.format],R._html5=L.html5||!1,R._muted=L.mute||!1,R._loop=L.loop||!1,R._pool=L.pool||5,R._preload=typeof L.preload!="boolean"&&L.preload!=="metadata"||L.preload,R._rate=L.rate||1,R._sprite=L.sprite||{},R._src=typeof L.src!="string"?L.src:[L.src],R._volume=L.volume!==void 0?L.volume:1,R._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},R._duration=0,R._state="unloaded",R._sounds=[],R._endTimers={},R._queue=[],R._playLock=!1,R._onend=L.onend?[{fn:L.onend}]:[],R._onfade=L.onfade?[{fn:L.onfade}]:[],R._onload=L.onload?[{fn:L.onload}]:[],R._onloaderror=L.onloaderror?[{fn:L.onloaderror}]:[],R._onplayerror=L.onplayerror?[{fn:L.onplayerror}]:[],R._onpause=L.onpause?[{fn:L.onpause}]:[],R._onplay=L.onplay?[{fn:L.onplay}]:[],R._onstop=L.onstop?[{fn:L.onstop}]:[],R._onmute=L.onmute?[{fn:L.onmute}]:[],R._onvolume=L.onvolume?[{fn:L.onvolume}]:[],R._onrate=L.onrate?[{fn:L.onrate}]:[],R._onseek=L.onseek?[{fn:L.onseek}]:[],R._onunlock=L.onunlock?[{fn:L.onunlock}]:[],R._onresume=[],R._webAudio=D.usingWebAudio&&!R._html5,D.ctx!==void 0&&D.ctx&&D.autoUnlock&&D._unlockAudio(),D._howls.push(R),R._autoplay&&R._queue.push({event:"play",action:function(){R.play()}}),R._preload&&R._preload!=="none"&&R.load(),R},load:function(){var L=null;if(D.noAudio)this._emit("loaderror",null,"No audio support.");else{typeof this._src=="string"&&(this._src=[this._src]);for(var R=0;R<this._src.length;R++){var B,Y;if(this._format&&this._format[R])B=this._format[R];else{if(typeof(Y=this._src[R])!="string"){this._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}(B=/^data:audio\/([^;,]+);/i.exec(Y))||(B=/\.([^.]+)$/.exec(Y.split("?",1)[0])),B&&(B=B[1].toLowerCase())}if(B||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),B&&D.codecs(B)){L=this._src[R];break}}if(L)return this._src=L,this._state="loading",window.location.protocol==="https:"&&L.slice(0,5)==="http:"&&(this._html5=!0,this._webAudio=!1),new V(this),this._webAudio&&X(this),this;this._emit("loaderror",null,"No codec support for selected audio sources.")}},play:function(L,R){var B=this,Y=null;if(typeof L=="number")Y=L,L=null;else{if(typeof L=="string"&&B._state==="loaded"&&!B._sprite[L])return null;if(L===void 0&&(L="__default",!B._playLock)){for(var P=0,H=0;H<B._sounds.length;H++)B._sounds[H]._paused&&!B._sounds[H]._ended&&(P++,Y=B._sounds[H]._id);P===1?L=null:Y=null}}var tt=Y?B._soundById(Y):B._inactiveSound();if(!tt)return null;if(Y&&!L&&(L=tt._sprite||"__default"),B._state!=="loaded"){tt._sprite=L,tt._ended=!1;var G=tt._id;return B._queue.push({event:"play",action:function(){B.play(G)}}),G}if(Y&&!tt._paused)return R||B._loadQueue("play"),tt._id;B._webAudio&&D._autoResume();var Ot=Math.max(0,tt._seek>0?tt._seek:B._sprite[L][0]/1e3),zt=Math.max(0,(B._sprite[L][0]+B._sprite[L][1])/1e3-Ot),st=1e3*zt/Math.abs(tt._rate),z=B._sprite[L][0]/1e3,U=(B._sprite[L][0]+B._sprite[L][1])/1e3;tt._sprite=L,tt._ended=!1;var dt=function(){tt._paused=!1,tt._seek=Ot,tt._start=z,tt._stop=U,tt._loop=!(!tt._loop&&!B._sprite[L][2])};if(!(Ot>=U)){var $=tt._node;if(B._webAudio){var vt=function(){B._playLock=!1,dt(),B._refreshBuffer(tt);var nt=tt._muted||B._muted?0:tt._volume;$.gain.setValueAtTime(nt,D.ctx.currentTime),tt._playStart=D.ctx.currentTime,$.bufferSource.start===void 0?tt._loop?$.bufferSource.noteGrainOn(0,Ot,86400):$.bufferSource.noteGrainOn(0,Ot,zt):tt._loop?$.bufferSource.start(0,Ot,86400):$.bufferSource.start(0,Ot,zt),st!==1/0&&(B._endTimers[tt._id]=setTimeout(B._ended.bind(B,tt),st)),R||setTimeout(function(){B._emit("play",tt._id),B._loadQueue()},0)};D.state==="running"&&D.ctx.state!=="interrupted"?vt():(B._playLock=!0,B.once("resume",vt),B._clearTimer(tt._id))}else{var Lt=function(){$.currentTime=Ot,$.muted=tt._muted||B._muted||D._muted||$.muted,$.volume=tt._volume*D.volume(),$.playbackRate=tt._rate;try{var nt=$.play();if(nt&&typeof Promise!="undefined"&&(nt instanceof Promise||typeof nt.then=="function")?(B._playLock=!0,dt(),nt.then(function(){B._playLock=!1,$._unlocked=!0,R?B._loadQueue():B._emit("play",tt._id)}).catch(function(){B._playLock=!1,B._emit("playerror",tt._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."),tt._ended=!0,tt._paused=!0})):R||(B._playLock=!1,dt(),B._emit("play",tt._id)),$.playbackRate=tt._rate,$.paused)return void B._emit("playerror",tt._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.");L!=="__default"||tt._loop?B._endTimers[tt._id]=setTimeout(B._ended.bind(B,tt),st):(B._endTimers[tt._id]=function(){B._ended(tt),$.removeEventListener("ended",B._endTimers[tt._id],!1)},$.addEventListener("ended",B._endTimers[tt._id],!1))}catch(_t){B._emit("playerror",tt._id,_t)}};$.src==="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"&&($.src=B._src,$.load());var K=window&&window.ejecta||!$.readyState&&D._navigator.isCocoonJS;if($.readyState>=3||K)Lt();else{B._playLock=!0,B._state="loading";var ct=function(){B._state="loaded",Lt(),$.removeEventListener(D._canPlayEvent,ct,!1)};$.addEventListener(D._canPlayEvent,ct,!1),B._clearTimer(tt._id)}}return tt._id}B._ended(tt)},pause:function(L){var R=this;if(R._state!=="loaded"||R._playLock)return R._queue.push({event:"pause",action:function(){R.pause(L)}}),R;for(var B=R._getSoundIds(L),Y=0;Y<B.length;Y++){R._clearTimer(B[Y]);var P=R._soundById(B[Y]);if(P&&!P._paused&&(P._seek=R.seek(B[Y]),P._rateSeek=0,P._paused=!0,R._stopFade(B[Y]),P._node))if(R._webAudio){if(!P._node.bufferSource)continue;P._node.bufferSource.stop===void 0?P._node.bufferSource.noteOff(0):P._node.bufferSource.stop(0),R._cleanBuffer(P._node)}else isNaN(P._node.duration)&&P._node.duration!==1/0||P._node.pause();arguments[1]||R._emit("pause",P?P._id:null)}return R},stop:function(L,R){var B=this;if(B._state!=="loaded"||B._playLock)return B._queue.push({event:"stop",action:function(){B.stop(L)}}),B;for(var Y=B._getSoundIds(L),P=0;P<Y.length;P++){B._clearTimer(Y[P]);var H=B._soundById(Y[P]);H&&(H._seek=H._start||0,H._rateSeek=0,H._paused=!0,H._ended=!0,B._stopFade(Y[P]),H._node&&(B._webAudio?H._node.bufferSource&&(H._node.bufferSource.stop===void 0?H._node.bufferSource.noteOff(0):H._node.bufferSource.stop(0),B._cleanBuffer(H._node)):isNaN(H._node.duration)&&H._node.duration!==1/0||(H._node.currentTime=H._start||0,H._node.pause(),H._node.duration===1/0&&B._clearSound(H._node))),R||B._emit("stop",H._id))}return B},mute:function(L,R){var B=this;if(B._state!=="loaded"||B._playLock)return B._queue.push({event:"mute",action:function(){B.mute(L,R)}}),B;if(R===void 0){if(typeof L!="boolean")return B._muted;B._muted=L}for(var Y=B._getSoundIds(R),P=0;P<Y.length;P++){var H=B._soundById(Y[P]);H&&(H._muted=L,H._interval&&B._stopFade(H._id),B._webAudio&&H._node?H._node.gain.setValueAtTime(L?0:H._volume,D.ctx.currentTime):H._node&&(H._node.muted=!!D._muted||L),B._emit("mute",H._id))}return B},volume:function(){var L,R,B,Y=this,P=arguments;if(P.length===0)return Y._volume;if(P.length===1||P.length===2&&P[1]===void 0){var H=Y._getSoundIds(),tt=H.indexOf(P[0]);tt>=0?R=parseInt(P[0],10):L=parseFloat(P[0])}else P.length>=2&&(L=parseFloat(P[0]),R=parseInt(P[1],10));if(!(L!==void 0&&L>=0&&L<=1))return(B=R?Y._soundById(R):Y._sounds[0])?B._volume:0;if(Y._state!=="loaded"||Y._playLock)return Y._queue.push({event:"volume",action:function(){Y.volume.apply(Y,P)}}),Y;R===void 0&&(Y._volume=L),R=Y._getSoundIds(R);for(var G=0;G<R.length;G++)(B=Y._soundById(R[G]))&&(B._volume=L,P[2]||Y._stopFade(R[G]),Y._webAudio&&B._node&&!B._muted?B._node.gain.setValueAtTime(L,D.ctx.currentTime):B._node&&!B._muted&&(B._node.volume=L*D.volume()),Y._emit("volume",B._id));return Y},fade:function(L,R,B,Y){var P=this;if(P._state!=="loaded"||P._playLock)return P._queue.push({event:"fade",action:function(){P.fade(L,R,B,Y)}}),P;L=Math.min(Math.max(0,parseFloat(L)),1),R=Math.min(Math.max(0,parseFloat(R)),1),B=parseFloat(B),P.volume(L,Y);for(var H=P._getSoundIds(Y),tt=0;tt<H.length;tt++){var G=P._soundById(H[tt]);if(G){if(Y||P._stopFade(H[tt]),P._webAudio&&!G._muted){var Ot=D.ctx.currentTime,zt=Ot+B/1e3;G._volume=L,G._node.gain.setValueAtTime(L,Ot),G._node.gain.linearRampToValueAtTime(R,zt)}P._startFadeInterval(G,L,R,B,H[tt],Y===void 0)}}return P},_startFadeInterval:function(L,R,B,Y,P,H){var tt=this,G=R,Ot=B-R,zt=Math.abs(Ot/.01),st=Math.max(4,zt>0?Y/zt:Y),z=Date.now();L._fadeTo=B,L._interval=setInterval(function(){var U=(Date.now()-z)/Y;z=Date.now(),G+=Ot*U,G=Math.round(100*G)/100,G=Ot<0?Math.max(B,G):Math.min(B,G),tt._webAudio?L._volume=G:tt.volume(G,L._id,!0),H&&(tt._volume=G),(B<R&&G<=B||B>R&&G>=B)&&(clearInterval(L._interval),L._interval=null,L._fadeTo=null,tt.volume(B,L._id),tt._emit("fade",L._id))},st)},_stopFade:function(L){var R=this._soundById(L);return R&&R._interval&&(this._webAudio&&R._node.gain.cancelScheduledValues(D.ctx.currentTime),clearInterval(R._interval),R._interval=null,this.volume(R._fadeTo,L),R._fadeTo=null,this._emit("fade",L)),this},loop:function(){var L,R,B,Y=this,P=arguments;if(P.length===0)return Y._loop;if(P.length===1){if(typeof P[0]!="boolean")return!!(B=Y._soundById(parseInt(P[0],10)))&&B._loop;L=P[0],Y._loop=L}else P.length===2&&(L=P[0],R=parseInt(P[1],10));for(var H=Y._getSoundIds(R),tt=0;tt<H.length;tt++)(B=Y._soundById(H[tt]))&&(B._loop=L,Y._webAudio&&B._node&&B._node.bufferSource&&(B._node.bufferSource.loop=L,L&&(B._node.bufferSource.loopStart=B._start||0,B._node.bufferSource.loopEnd=B._stop,Y.playing(H[tt])&&(Y.pause(H[tt],!0),Y.play(H[tt],!0)))));return Y},rate:function(){var L,R,B,Y=this,P=arguments;if(P.length===0)R=Y._sounds[0]._id;else if(P.length===1){var H=Y._getSoundIds(),tt=H.indexOf(P[0]);tt>=0?R=parseInt(P[0],10):L=parseFloat(P[0])}else P.length===2&&(L=parseFloat(P[0]),R=parseInt(P[1],10));if(typeof L!="number")return(B=Y._soundById(R))?B._rate:Y._rate;if(Y._state!=="loaded"||Y._playLock)return Y._queue.push({event:"rate",action:function(){Y.rate.apply(Y,P)}}),Y;R===void 0&&(Y._rate=L),R=Y._getSoundIds(R);for(var G=0;G<R.length;G++)if(B=Y._soundById(R[G])){Y.playing(R[G])&&(B._rateSeek=Y.seek(R[G]),B._playStart=Y._webAudio?D.ctx.currentTime:B._playStart),B._rate=L,Y._webAudio&&B._node&&B._node.bufferSource?B._node.bufferSource.playbackRate.setValueAtTime(L,D.ctx.currentTime):B._node&&(B._node.playbackRate=L);var Ot=Y.seek(R[G]),zt=(Y._sprite[B._sprite][0]+Y._sprite[B._sprite][1])/1e3-Ot,st=1e3*zt/Math.abs(B._rate);!Y._endTimers[R[G]]&&B._paused||(Y._clearTimer(R[G]),Y._endTimers[R[G]]=setTimeout(Y._ended.bind(Y,B),st)),Y._emit("rate",B._id)}return Y},seek:function(){var L,R,B=this,Y=arguments;if(Y.length===0)B._sounds.length&&(R=B._sounds[0]._id);else if(Y.length===1){var P=B._getSoundIds(),H=P.indexOf(Y[0]);H>=0?R=parseInt(Y[0],10):B._sounds.length&&(R=B._sounds[0]._id,L=parseFloat(Y[0]))}else Y.length===2&&(L=parseFloat(Y[0]),R=parseInt(Y[1],10));if(R===void 0)return 0;if(typeof L=="number"&&(B._state!=="loaded"||B._playLock))return B._queue.push({event:"seek",action:function(){B.seek.apply(B,Y)}}),B;var tt=B._soundById(R);if(tt){if(!(typeof L=="number"&&L>=0)){if(B._webAudio){var G=B.playing(R)?D.ctx.currentTime-tt._playStart:0,Ot=tt._rateSeek?tt._rateSeek-tt._seek:0;return tt._seek+(Ot+G*Math.abs(tt._rate))}return tt._node.currentTime}var zt=B.playing(R);zt&&B.pause(R,!0),tt._seek=L,tt._ended=!1,B._clearTimer(R),B._webAudio||!tt._node||isNaN(tt._node.duration)||(tt._node.currentTime=L);var st=function(){zt&&B.play(R,!0),B._emit("seek",R)};if(zt&&!B._webAudio){var z=function(){B._playLock?setTimeout(z,0):st()};setTimeout(z,0)}else st()}return B},playing:function(L){if(typeof L=="number"){var R=this._soundById(L);return!!R&&!R._paused}for(var B=0;B<this._sounds.length;B++)if(!this._sounds[B]._paused)return!0;return!1},duration:function(L){var R=this._duration,B=this._soundById(L);return B&&(R=this._sprite[B._sprite][1]/1e3),R},state:function(){return this._state},unload:function(){for(var L=this,R=L._sounds,B=0;B<R.length;B++)R[B]._paused||L.stop(R[B]._id),L._webAudio||(L._clearSound(R[B]._node),R[B]._node.removeEventListener("error",R[B]._errorFn,!1),R[B]._node.removeEventListener(D._canPlayEvent,R[B]._loadFn,!1),R[B]._node.removeEventListener("ended",R[B]._endFn,!1),D._releaseHtml5Audio(R[B]._node)),delete R[B]._node,L._clearTimer(R[B]._id);var Y=D._howls.indexOf(L);Y>=0&&D._howls.splice(Y,1);var P=!0;for(B=0;B<D._howls.length;B++)if(D._howls[B]._src===L._src||L._src.indexOf(D._howls[B]._src)>=0){P=!1;break}return W&&P&&delete W[L._src],D.noAudio=!1,L._state="unloaded",L._sounds=[],L=null,null},on:function(L,R,B,Y){var P=this["_on"+L];return typeof R=="function"&&P.push(Y?{id:B,fn:R,once:Y}:{id:B,fn:R}),this},off:function(L,R,B){var Y=this["_on"+L],P=0;if(typeof R=="number"&&(B=R,R=null),R||B)for(P=0;P<Y.length;P++){var H=B===Y[P].id;if(R===Y[P].fn&&H||!R&&H){Y.splice(P,1);break}}else if(L)this["_on"+L]=[];else{var tt=Object.keys(this);for(P=0;P<tt.length;P++)tt[P].indexOf("_on")===0&&Array.isArray(this[tt[P]])&&(this[tt[P]]=[])}return this},once:function(L,R,B){return this.on(L,R,B,1),this},_emit:function(L,R,B){for(var Y=this["_on"+L],P=Y.length-1;P>=0;P--)Y[P].id&&Y[P].id!==R&&L!=="load"||(setTimeout(function(H){H.call(this,R,B)}.bind(this,Y[P].fn),0),Y[P].once&&this.off(L,Y[P].fn,Y[P].id));return this._loadQueue(L),this},_loadQueue:function(L){if(this._queue.length>0){var R=this._queue[0];R.event===L&&(this._queue.shift(),this._loadQueue()),L||R.action()}return this},_ended:function(L){var R=L._sprite;if(!this._webAudio&&L._node&&!L._node.paused&&!L._node.ended&&L._node.currentTime<L._stop)return setTimeout(this._ended.bind(this,L),100),this;var B=!(!L._loop&&!this._sprite[R][2]);if(this._emit("end",L._id),!this._webAudio&&B&&this.stop(L._id,!0).play(L._id),this._webAudio&&B){this._emit("play",L._id),L._seek=L._start||0,L._rateSeek=0,L._playStart=D.ctx.currentTime;var Y=1e3*(L._stop-L._start)/Math.abs(L._rate);this._endTimers[L._id]=setTimeout(this._ended.bind(this,L),Y)}return this._webAudio&&!B&&(L._paused=!0,L._ended=!0,L._seek=L._start||0,L._rateSeek=0,this._clearTimer(L._id),this._cleanBuffer(L._node),D._autoSuspend()),this._webAudio||B||this.stop(L._id,!0),this},_clearTimer:function(L){if(this._endTimers[L]){if(typeof this._endTimers[L]!="function")clearTimeout(this._endTimers[L]);else{var R=this._soundById(L);R&&R._node&&R._node.removeEventListener("ended",this._endTimers[L],!1)}delete this._endTimers[L]}return this},_soundById:function(L){for(var R=0;R<this._sounds.length;R++)if(L===this._sounds[R]._id)return this._sounds[R];return null},_inactiveSound:function(){this._drain();for(var L=0;L<this._sounds.length;L++)if(this._sounds[L]._ended)return this._sounds[L].reset();return new V(this)},_drain:function(){var L=this._pool,R=0,B=0;if(!(this._sounds.length<L)){for(B=0;B<this._sounds.length;B++)this._sounds[B]._ended&&R++;for(B=this._sounds.length-1;B>=0;B--){if(R<=L)return;this._sounds[B]._ended&&(this._webAudio&&this._sounds[B]._node&&this._sounds[B]._node.disconnect(0),this._sounds.splice(B,1),R--)}}},_getSoundIds:function(L){if(L===void 0){for(var R=[],B=0;B<this._sounds.length;B++)R.push(this._sounds[B]._id);return R}return[L]},_refreshBuffer:function(L){return L._node.bufferSource=D.ctx.createBufferSource(),L._node.bufferSource.buffer=W[this._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,D.ctx.currentTime),this},_cleanBuffer:function(L){var R=D._navigator&&D._navigator.vendor.indexOf("Apple")>=0;if(D._scratchBuffer&&L.bufferSource&&(L.bufferSource.onended=null,L.bufferSource.disconnect(0),R))try{L.bufferSource.buffer=D._scratchBuffer}catch{}return L.bufferSource=null,this},_clearSound:function(L){/MSIE |Trident\//.test(D._navigator&&D._navigator.userAgent)||(L.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var V=function(L){this._parent=L,this.init()};V.prototype={init:function(){var L=this._parent;return this._muted=L._muted,this._loop=L._loop,this._volume=L._volume,this._rate=L._rate,this._seek=0,this._paused=!0,this._ended=!0,this._sprite="__default",this._id=++D._counter,L._sounds.push(this),this.create(),this},create:function(){var L=this._parent,R=D._muted||this._muted||this._parent._muted?0:this._volume;return L._webAudio?(this._node=D.ctx.createGain===void 0?D.ctx.createGainNode():D.ctx.createGain(),this._node.gain.setValueAtTime(R,D.ctx.currentTime),this._node.paused=!0,this._node.connect(D.masterGain)):D.noAudio||(this._node=D._obtainHtml5Audio(),this._errorFn=this._errorListener.bind(this),this._node.addEventListener("error",this._errorFn,!1),this._loadFn=this._loadListener.bind(this),this._node.addEventListener(D._canPlayEvent,this._loadFn,!1),this._endFn=this._endListener.bind(this),this._node.addEventListener("ended",this._endFn,!1),this._node.src=L._src,this._node.preload=L._preload===!0?"auto":L._preload,this._node.volume=R*D.volume(),this._node.load()),this},reset:function(){var L=this._parent;return this._muted=L._muted,this._loop=L._loop,this._volume=L._volume,this._rate=L._rate,this._seek=0,this._rateSeek=0,this._paused=!0,this._ended=!0,this._sprite="__default",this._id=++D._counter,this},_errorListener:function(){this._parent._emit("loaderror",this._id,this._node.error?this._node.error.code:0),this._node.removeEventListener("error",this._errorFn,!1)},_loadListener:function(){var L=this._parent;L._duration=Math.ceil(10*this._node.duration)/10,Object.keys(L._sprite).length===0&&(L._sprite={__default:[0,1e3*L._duration]}),L._state!=="loaded"&&(L._state="loaded",L._emit("load"),L._loadQueue()),this._node.removeEventListener(D._canPlayEvent,this._loadFn,!1)},_endListener:function(){var L=this._parent;L._duration===1/0&&(L._duration=Math.ceil(10*this._node.duration)/10,L._sprite.__default[1]===1/0&&(L._sprite.__default[1]=1e3*L._duration),L._ended(this)),this._node.removeEventListener("ended",this._endFn,!1)}};var W={},X=function(L){var R=L._src;if(W[R])return L._duration=W[R].duration,void Dt(L);if(/^data:[^;]+;base64,/.test(R)){for(var B=atob(R.split(",")[1]),Y=new Uint8Array(B.length),P=0;P<B.length;++P)Y[P]=B.charCodeAt(P);ft(Y.buffer,L)}else{var H=new XMLHttpRequest;H.open(L._xhr.method,R,!0),H.withCredentials=L._xhr.withCredentials,H.responseType="arraybuffer",L._xhr.headers&&Object.keys(L._xhr.headers).forEach(function(tt){H.setRequestHeader(tt,L._xhr.headers[tt])}),H.onload=function(){var tt=(H.status+"")[0];tt==="0"||tt==="2"||tt==="3"?ft(H.response,L):L._emit("loaderror",null,"Failed loading audio file with status: "+H.status+".")},H.onerror=function(){L._webAudio&&(L._html5=!0,L._webAudio=!1,L._sounds=[],delete W[R],L.load())},et(H)}},et=function(L){try{L.send()}catch{L.onerror()}},ft=function(L,R){var B=function(){R._emit("loaderror",null,"Decoding audio data failed.")},Y=function(P){P&&R._sounds.length>0?(W[R._src]=P,Dt(R,P)):B()};typeof Promise!="undefined"&&D.ctx.decodeAudioData.length===1?D.ctx.decodeAudioData(L).then(Y).catch(B):D.ctx.decodeAudioData(L,Y,B)},Dt=function(L,R){R&&!L._duration&&(L._duration=R.duration),Object.keys(L._sprite).length===0&&(L._sprite={__default:[0,1e3*L._duration]}),L._state!=="loaded"&&(L._state="loaded",L._emit("load"),L._loadQueue())},At=function(){if(D.usingWebAudio){try{typeof AudioContext!="undefined"?D.ctx=new AudioContext:typeof webkitAudioContext!="undefined"?D.ctx=new webkitAudioContext:D.usingWebAudio=!1}catch{D.usingWebAudio=!1}D.ctx||(D.usingWebAudio=!1);var L=/iP(hone|od|ad)/.test(D._navigator&&D._navigator.platform),R=D._navigator&&D._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),B=R?parseInt(R[1],10):null;if(L&&B&&B<9){var Y=/safari/.test(D._navigator&&D._navigator.userAgent.toLowerCase());D._navigator&&!Y&&(D.usingWebAudio=!1)}D.usingWebAudio&&(D.masterGain=D.ctx.createGain===void 0?D.ctx.createGainNode():D.ctx.createGain(),D.masterGain.gain.setValueAtTime(D._muted?0:D._volume,D.ctx.currentTime),D.masterGain.connect(D.ctx.destination)),D._setup()}};(M=function(){return{Howler:D,Howl:k}}.apply(w,[]))===void 0||(b.exports=M),w.Howler=D,w.Howl=k,O!==void 0?(O.HowlerGlobal=I,O.Howler=D,O.Howl=k,O.Sound=V):typeof window!="undefined"&&(window.HowlerGlobal=I,window.Howler=D,window.Howl=k,window.Sound=V)})(),function(){var I;HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(k){if(!this.ctx||!this.ctx.listener)return this;for(var V=this._howls.length-1;V>=0;V--)this._howls[V].stereo(k);return this},HowlerGlobal.prototype.pos=function(k,V,W){return this.ctx&&this.ctx.listener?(V=typeof V!="number"?this._pos[1]:V,W=typeof W!="number"?this._pos[2]:W,typeof k!="number"?this._pos:(this._pos=[k,V,W],this.ctx.listener.positionX!==void 0?(this.ctx.listener.positionX.setTargetAtTime(this._pos[0],Howler.ctx.currentTime,.1),this.ctx.listener.positionY.setTargetAtTime(this._pos[1],Howler.ctx.currentTime,.1),this.ctx.listener.positionZ.setTargetAtTime(this._pos[2],Howler.ctx.currentTime,.1)):this.ctx.listener.setPosition(this._pos[0],this._pos[1],this._pos[2]),this)):this},HowlerGlobal.prototype.orientation=function(k,V,W,X,et,ft){if(!this.ctx||!this.ctx.listener)return this;var Dt=this._orientation;return V=typeof V!="number"?Dt[1]:V,W=typeof W!="number"?Dt[2]:W,X=typeof X!="number"?Dt[3]:X,et=typeof et!="number"?Dt[4]:et,ft=typeof ft!="number"?Dt[5]:ft,typeof k!="number"?Dt:(this._orientation=[k,V,W,X,et,ft],this.ctx.listener.forwardX!==void 0?(this.ctx.listener.forwardX.setTargetAtTime(k,Howler.ctx.currentTime,.1),this.ctx.listener.forwardY.setTargetAtTime(V,Howler.ctx.currentTime,.1),this.ctx.listener.forwardZ.setTargetAtTime(W,Howler.ctx.currentTime,.1),this.ctx.listener.upX.setTargetAtTime(X,Howler.ctx.currentTime,.1),this.ctx.listener.upY.setTargetAtTime(et,Howler.ctx.currentTime,.1),this.ctx.listener.upZ.setTargetAtTime(ft,Howler.ctx.currentTime,.1)):this.ctx.listener.setOrientation(k,V,W,X,et,ft),this)},Howl.prototype.init=(I=Howl.prototype.init,function(k){return this._orientation=k.orientation||[1,0,0],this._stereo=k.stereo||null,this._pos=k.pos||null,this._pannerAttr={coneInnerAngle:k.coneInnerAngle!==void 0?k.coneInnerAngle:360,coneOuterAngle:k.coneOuterAngle!==void 0?k.coneOuterAngle:360,coneOuterGain:k.coneOuterGain!==void 0?k.coneOuterGain:0,distanceModel:k.distanceModel!==void 0?k.distanceModel:"inverse",maxDistance:k.maxDistance!==void 0?k.maxDistance:1e4,panningModel:k.panningModel!==void 0?k.panningModel:"HRTF",refDistance:k.refDistance!==void 0?k.refDistance:1,rolloffFactor:k.rolloffFactor!==void 0?k.rolloffFactor:1},this._onstereo=k.onstereo?[{fn:k.onstereo}]:[],this._onpos=k.onpos?[{fn:k.onpos}]:[],this._onorientation=k.onorientation?[{fn:k.onorientation}]:[],I.call(this,k)}),Howl.prototype.stereo=function(k,V){var W=this;if(!W._webAudio)return W;if(W._state!=="loaded")return W._queue.push({event:"stereo",action:function(){W.stereo(k,V)}}),W;var X=Howler.ctx.createStereoPanner===void 0?"spatial":"stereo";if(V===void 0){if(typeof k!="number")return W._stereo;W._stereo=k,W._pos=[k,0,0]}for(var et=W._getSoundIds(V),ft=0;ft<et.length;ft++){var Dt=W._soundById(et[ft]);if(Dt){if(typeof k!="number")return Dt._stereo;Dt._stereo=k,Dt._pos=[k,0,0],Dt._node&&(Dt._pannerAttr.panningModel="equalpower",Dt._panner&&Dt._panner.pan||D(Dt,X),X==="spatial"?Dt._panner.positionX!==void 0?(Dt._panner.positionX.setValueAtTime(k,Howler.ctx.currentTime),Dt._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),Dt._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):Dt._panner.setPosition(k,0,0):Dt._panner.pan.setValueAtTime(k,Howler.ctx.currentTime)),W._emit("stereo",Dt._id)}}return W},Howl.prototype.pos=function(k,V,W,X){var et=this;if(!et._webAudio)return et;if(et._state!=="loaded")return et._queue.push({event:"pos",action:function(){et.pos(k,V,W,X)}}),et;if(V=typeof V!="number"?0:V,W=typeof W!="number"?-.5:W,X===void 0){if(typeof k!="number")return et._pos;et._pos=[k,V,W]}for(var ft=et._getSoundIds(X),Dt=0;Dt<ft.length;Dt++){var At=et._soundById(ft[Dt]);if(At){if(typeof k!="number")return At._pos;At._pos=[k,V,W],At._node&&(At._panner&&!At._panner.pan||D(At,"spatial"),At._panner.positionX!==void 0?(At._panner.positionX.setValueAtTime(k,Howler.ctx.currentTime),At._panner.positionY.setValueAtTime(V,Howler.ctx.currentTime),At._panner.positionZ.setValueAtTime(W,Howler.ctx.currentTime)):At._panner.setPosition(k,V,W)),et._emit("pos",At._id)}}return et},Howl.prototype.orientation=function(k,V,W,X){var et=this;if(!et._webAudio)return et;if(et._state!=="loaded")return et._queue.push({event:"orientation",action:function(){et.orientation(k,V,W,X)}}),et;if(V=typeof V!="number"?et._orientation[1]:V,W=typeof W!="number"?et._orientation[2]:W,X===void 0){if(typeof k!="number")return et._orientation;et._orientation=[k,V,W]}for(var ft=et._getSoundIds(X),Dt=0;Dt<ft.length;Dt++){var At=et._soundById(ft[Dt]);if(At){if(typeof k!="number")return At._orientation;At._orientation=[k,V,W],At._node&&(At._panner||(At._pos||(At._pos=et._pos||[0,0,-.5]),D(At,"spatial")),At._panner.orientationX!==void 0?(At._panner.orientationX.setValueAtTime(k,Howler.ctx.currentTime),At._panner.orientationY.setValueAtTime(V,Howler.ctx.currentTime),At._panner.orientationZ.setValueAtTime(W,Howler.ctx.currentTime)):At._panner.setOrientation(k,V,W)),et._emit("orientation",At._id)}}return et},Howl.prototype.pannerAttr=function(){var k,V,W,X=this,et=arguments;if(!X._webAudio)return X;if(et.length===0)return X._pannerAttr;if(et.length===1){if(typeof et[0]!="object")return(W=X._soundById(parseInt(et[0],10)))?W._pannerAttr:X._pannerAttr;k=et[0],V===void 0&&(k.pannerAttr||(k.pannerAttr={coneInnerAngle:k.coneInnerAngle,coneOuterAngle:k.coneOuterAngle,coneOuterGain:k.coneOuterGain,distanceModel:k.distanceModel,maxDistance:k.maxDistance,refDistance:k.refDistance,rolloffFactor:k.rolloffFactor,panningModel:k.panningModel}),X._pannerAttr={coneInnerAngle:k.pannerAttr.coneInnerAngle!==void 0?k.pannerAttr.coneInnerAngle:X._coneInnerAngle,coneOuterAngle:k.pannerAttr.coneOuterAngle!==void 0?k.pannerAttr.coneOuterAngle:X._coneOuterAngle,coneOuterGain:k.pannerAttr.coneOuterGain!==void 0?k.pannerAttr.coneOuterGain:X._coneOuterGain,distanceModel:k.pannerAttr.distanceModel!==void 0?k.pannerAttr.distanceModel:X._distanceModel,maxDistance:k.pannerAttr.maxDistance!==void 0?k.pannerAttr.maxDistance:X._maxDistance,refDistance:k.pannerAttr.refDistance!==void 0?k.pannerAttr.refDistance:X._refDistance,rolloffFactor:k.pannerAttr.rolloffFactor!==void 0?k.pannerAttr.rolloffFactor:X._rolloffFactor,panningModel:k.pannerAttr.panningModel!==void 0?k.pannerAttr.panningModel:X._panningModel})}else et.length===2&&(k=et[0],V=parseInt(et[1],10));for(var ft=X._getSoundIds(V),Dt=0;Dt<ft.length;Dt++)if(W=X._soundById(ft[Dt])){var At=W._pannerAttr;At={coneInnerAngle:k.coneInnerAngle!==void 0?k.coneInnerAngle:At.coneInnerAngle,coneOuterAngle:k.coneOuterAngle!==void 0?k.coneOuterAngle:At.coneOuterAngle,coneOuterGain:k.coneOuterGain!==void 0?k.coneOuterGain:At.coneOuterGain,distanceModel:k.distanceModel!==void 0?k.distanceModel:At.distanceModel,maxDistance:k.maxDistance!==void 0?k.maxDistance:At.maxDistance,refDistance:k.refDistance!==void 0?k.refDistance:At.refDistance,rolloffFactor:k.rolloffFactor!==void 0?k.rolloffFactor:At.rolloffFactor,panningModel:k.panningModel!==void 0?k.panningModel:At.panningModel};var L=W._panner;L?(L.coneInnerAngle=At.coneInnerAngle,L.coneOuterAngle=At.coneOuterAngle,L.coneOuterGain=At.coneOuterGain,L.distanceModel=At.distanceModel,L.maxDistance=At.maxDistance,L.refDistance=At.refDistance,L.rolloffFactor=At.rolloffFactor,L.panningModel=At.panningModel):(W._pos||(W._pos=X._pos||[0,0,-.5]),D(W,"spatial"))}return X},Sound.prototype.init=function(k){return function(){var V=this._parent;this._orientation=V._orientation,this._stereo=V._stereo,this._pos=V._pos,this._pannerAttr=V._pannerAttr,k.call(this),this._stereo?V.stereo(this._stereo):this._pos&&V.pos(this._pos[0],this._pos[1],this._pos[2],this._id)}}(Sound.prototype.init),Sound.prototype.reset=function(k){return function(){var V=this._parent;return this._orientation=V._orientation,this._stereo=V._stereo,this._pos=V._pos,this._pannerAttr=V._pannerAttr,this._stereo?V.stereo(this._stereo):this._pos?V.pos(this._pos[0],this._pos[1],this._pos[2],this._id):this._panner&&(this._panner.disconnect(0),this._panner=void 0,V._refreshBuffer(this)),k.call(this)}}(Sound.prototype.reset);var D=function(k,V){(V=V||"spatial")==="spatial"?(k._panner=Howler.ctx.createPanner(),k._panner.coneInnerAngle=k._pannerAttr.coneInnerAngle,k._panner.coneOuterAngle=k._pannerAttr.coneOuterAngle,k._panner.coneOuterGain=k._pannerAttr.coneOuterGain,k._panner.distanceModel=k._pannerAttr.distanceModel,k._panner.maxDistance=k._pannerAttr.maxDistance,k._panner.refDistance=k._pannerAttr.refDistance,k._panner.rolloffFactor=k._pannerAttr.rolloffFactor,k._panner.panningModel=k._pannerAttr.panningModel,k._panner.positionX!==void 0?(k._panner.positionX.setValueAtTime(k._pos[0],Howler.ctx.currentTime),k._panner.positionY.setValueAtTime(k._pos[1],Howler.ctx.currentTime),k._panner.positionZ.setValueAtTime(k._pos[2],Howler.ctx.currentTime)):k._panner.setPosition(k._pos[0],k._pos[1],k._pos[2]),k._panner.orientationX!==void 0?(k._panner.orientationX.setValueAtTime(k._orientation[0],Howler.ctx.currentTime),k._panner.orientationY.setValueAtTime(k._orientation[1],Howler.ctx.currentTime),k._panner.orientationZ.setValueAtTime(k._orientation[2],Howler.ctx.currentTime)):k._panner.setOrientation(k._orientation[0],k._orientation[1],k._orientation[2])):(k._panner=Howler.ctx.createStereoPanner(),k._panner.pan.setValueAtTime(k._stereo,Howler.ctx.currentTime)),k._panner.connect(k._node),k._paused||k._parent.pause(k._id,!0).play(k._id,!0)}}()}).call(this,v(17))},function(b,w){b.exports=`varying vec2 vTextureCoord;
|
|
3240
3240
|
varying vec2 vVertexPosition;
|
|
3241
3241
|
varying float vPercent;
|
|
3242
3242
|
varying float vDirection;
|
|
@@ -4057,21 +4057,21 @@ void main() {
|
|
|
4057
4057
|
gl_FragColor = outputColor * colorAlpha.z;
|
|
4058
4058
|
}
|
|
4059
4059
|
}
|
|
4060
|
-
`},function(b,w,v){var O=v(150);b.exports=function(M,I){return O(M,I)}},function(b,w,v){var O=v(24),M=Object.prototype,I=M.hasOwnProperty,D=M.toString,k=O?O.toStringTag:void 0;b.exports=function(
|
|
4060
|
+
`},function(b,w,v){var O=v(150);b.exports=function(M,I){return O(M,I)}},function(b,w,v){var O=v(24),M=Object.prototype,I=M.hasOwnProperty,D=M.toString,k=O?O.toStringTag:void 0;b.exports=function(V){var W=I.call(V,k),X=V[k];try{V[k]=void 0;var et=!0}catch{}var ft=D.call(V);return et&&(W?V[k]=X:delete V[k]),ft}},function(b,w){var v=Object.prototype.toString;b.exports=function(O){return v.call(O)}},function(b,w,v){(function(O){var M=v(108),I=v(111),D=v.n(I);/*!
|
|
4061
4061
|
* @pixi/polyfill - v6.4.2
|
|
4062
4062
|
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
|
|
4063
4063
|
*
|
|
4064
4064
|
* @pixi/polyfill is licensed under the MIT License.
|
|
4065
4065
|
* http://www.opensource.org/licenses/mit-license
|
|
4066
|
-
*/if(typeof globalThis=="undefined"&&(typeof self!="undefined"?self.globalThis=self:O!==void 0&&(O.globalThis=O)),globalThis.Promise||(globalThis.Promise=M.a),Object.assign||(Object.assign=D.a),Date.now&&Date.prototype.getTime||(Date.now=function(){return new Date().getTime()}),!globalThis.performance||!globalThis.performance.now){var k=Date.now();globalThis.performance||(globalThis.performance={}),globalThis.performance.now=function(){return Date.now()-k}}for(var z=Date.now(),W=["ms","moz","webkit","o"],Y=0;Y<W.length&&!globalThis.requestAnimationFrame;++Y){var et=W[Y];globalThis.requestAnimationFrame=globalThis[et+"RequestAnimationFrame"],globalThis.cancelAnimationFrame=globalThis[et+"CancelAnimationFrame"]||globalThis[et+"CancelRequestAnimationFrame"]}globalThis.requestAnimationFrame||(globalThis.requestAnimationFrame=function(ft){if(typeof ft!="function")throw new TypeError(ft+"is not a function");var Dt=Date.now(),At=16+z-Dt;return At<0&&(At=0),z=Dt,globalThis.self.setTimeout(function(){z=Date.now(),ft(performance.now())},At)}),globalThis.cancelAnimationFrame||(globalThis.cancelAnimationFrame=function(ft){return clearTimeout(ft)}),Math.sign||(Math.sign=function(ft){return(ft=Number(ft))===0||isNaN(ft)?ft:ft>0?1:-1}),Number.isInteger||(Number.isInteger=function(ft){return typeof ft=="number"&&isFinite(ft)&&Math.floor(ft)===ft}),globalThis.ArrayBuffer||(globalThis.ArrayBuffer=Array),globalThis.Float32Array||(globalThis.Float32Array=Array),globalThis.Uint32Array||(globalThis.Uint32Array=Array),globalThis.Uint16Array||(globalThis.Uint16Array=Array),globalThis.Uint8Array||(globalThis.Uint8Array=Array),globalThis.Int32Array||(globalThis.Int32Array=Array)}).call(this,v(17))},function(b,w,v){(function(O){var M=O!==void 0&&O||typeof self!="undefined"&&self||window,I=Function.prototype.apply;function D(k,z){this._id=k,this._clearFn=z}w.setTimeout=function(){return new D(I.call(setTimeout,M,arguments),clearTimeout)},w.setInterval=function(){return new D(I.call(setInterval,M,arguments),clearInterval)},w.clearTimeout=w.clearInterval=function(k){k&&k.close()},D.prototype.unref=D.prototype.ref=function(){},D.prototype.close=function(){this._clearFn.call(M,this._id)},w.enroll=function(k,z){clearTimeout(k._idleTimeoutId),k._idleTimeout=z},w.unenroll=function(k){clearTimeout(k._idleTimeoutId),k._idleTimeout=-1},w._unrefActive=w.active=function(k){clearTimeout(k._idleTimeoutId);var z=k._idleTimeout;z>=0&&(k._idleTimeoutId=setTimeout(function(){k._onTimeout&&k._onTimeout()},z))},v(141),w.setImmediate=typeof self!="undefined"&&self.setImmediate||O!==void 0&&O.setImmediate||this&&this.setImmediate,w.clearImmediate=typeof self!="undefined"&&self.clearImmediate||O!==void 0&&O.clearImmediate||this&&this.clearImmediate}).call(this,v(17))},function(b,w,v){(function(O,M){(function(I,D){if(!I.setImmediate){var k,z,W,Y,et,ft=1,Dt={},At=!1,L=I.document,R=Object.getPrototypeOf&&Object.getPrototypeOf(I);R=R&&R.setTimeout?R:I,{}.toString.call(I.process)==="[object process]"?k=function(P){M.nextTick(function(){X(P)})}:function(){if(I.postMessage&&!I.importScripts){var P=!0,H=I.onmessage;return I.onmessage=function(){P=!1},I.postMessage("","*"),I.onmessage=H,P}}()?(Y="setImmediate$"+Math.random()+"$",et=function(P){P.source===I&&typeof P.data=="string"&&P.data.indexOf(Y)===0&&X(+P.data.slice(Y.length))},I.addEventListener?I.addEventListener("message",et,!1):I.attachEvent("onmessage",et),k=function(P){I.postMessage(Y+P,"*")}):I.MessageChannel?((W=new MessageChannel).port1.onmessage=function(P){X(P.data)},k=function(P){W.port2.postMessage(P)}):L&&"onreadystatechange"in L.createElement("script")?(z=L.documentElement,k=function(P){var H=L.createElement("script");H.onreadystatechange=function(){X(P),H.onreadystatechange=null,z.removeChild(H),H=null},z.appendChild(H)}):k=function(P){setTimeout(X,0,P)},R.setImmediate=function(P){typeof P!="function"&&(P=new Function(""+P));for(var H=new Array(arguments.length-1),tt=0;tt<H.length;tt++)H[tt]=arguments[tt+1];var G={callback:P,args:H};return Dt[ft]=G,k(ft),ft++},R.clearImmediate=B}function B(P){delete Dt[P]}function X(P){if(At)setTimeout(X,0,P);else{var H=Dt[P];if(H){At=!0;try{(function(tt){var G=tt.callback,Ot=tt.args;switch(Ot.length){case 0:G();break;case 1:G(Ot[0]);break;case 2:G(Ot[0],Ot[1]);break;case 3:G(Ot[0],Ot[1],Ot[2]);break;default:G.apply(void 0,Ot)}})(H)}finally{B(P),At=!1}}}}})(typeof self=="undefined"?O===void 0?this:O:self)}).call(this,v(17),v(142))},function(b,w){var v,O,M=b.exports={};function I(){throw new Error("setTimeout has not been defined")}function D(){throw new Error("clearTimeout has not been defined")}function k(R){if(v===setTimeout)return setTimeout(R,0);if((v===I||!v)&&setTimeout)return v=setTimeout,setTimeout(R,0);try{return v(R,0)}catch{try{return v.call(null,R,0)}catch{return v.call(this,R,0)}}}(function(){try{v=typeof setTimeout=="function"?setTimeout:I}catch{v=I}try{O=typeof clearTimeout=="function"?clearTimeout:D}catch{O=D}})();var z,W=[],Y=!1,et=-1;function ft(){Y&&z&&(Y=!1,z.length?W=z.concat(W):et=-1,W.length&&Dt())}function Dt(){if(!Y){var R=k(ft);Y=!0;for(var B=W.length;B;){for(z=W,W=[];++et<B;)z&&z[et].run();et=-1,B=W.length}z=null,Y=!1,function(X){if(O===clearTimeout)return clearTimeout(X);if((O===D||!O)&&clearTimeout)return O=clearTimeout,clearTimeout(X);try{O(X)}catch{try{return O.call(null,X)}catch{return O.call(this,X)}}}(R)}}function At(R,B){this.fun=R,this.array=B}function L(){}M.nextTick=function(R){var B=new Array(arguments.length-1);if(arguments.length>1)for(var X=1;X<arguments.length;X++)B[X-1]=arguments[X];W.push(new At(R,B)),W.length!==1||Y||k(Dt)},At.prototype.run=function(){this.fun.apply(null,this.array)},M.title="browser",M.browser=!0,M.env={},M.argv=[],M.version="",M.versions={},M.on=L,M.addListener=L,M.once=L,M.off=L,M.removeListener=L,M.removeAllListeners=L,M.emit=L,M.prependListener=L,M.prependOnceListener=L,M.listeners=function(R){return[]},M.binding=function(R){throw new Error("process.binding is not supported")},M.cwd=function(){return"/"},M.chdir=function(R){throw new Error("process.chdir is not supported")},M.umask=function(){return 0}},function(b,w,v){(function(O,M){var I;/*! https://mths.be/punycode v1.4.1 by @mathias */(function(D){w&&w.nodeType,O&&O.nodeType;var k=typeof M=="object"&&M;k.global!==k&&k.window!==k&&k.self;var z,W=2147483647,Y=/^xn--/,et=/[^\x20-\x7E]/,ft=/[\x2E\u3002\uFF0E\uFF61]/g,Dt={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},At=Math.floor,L=String.fromCharCode;function R(st){throw new RangeError(Dt[st])}function B(st,V){for(var U=st.length,dt=[];U--;)dt[U]=V(st[U]);return dt}function X(st,V){var U=st.split("@"),dt="";return U.length>1&&(dt=U[0]+"@",st=U[1]),dt+B((st=st.replace(ft,".")).split("."),V).join(".")}function P(st){for(var V,U,dt=[],$=0,vt=st.length;$<vt;)(V=st.charCodeAt($++))>=55296&&V<=56319&&$<vt?(64512&(U=st.charCodeAt($++)))==56320?dt.push(((1023&V)<<10)+(1023&U)+65536):(dt.push(V),$--):dt.push(V);return dt}function H(st){return B(st,function(V){var U="";return V>65535&&(U+=L((V-=65536)>>>10&1023|55296),V=56320|1023&V),U+=L(V)}).join("")}function tt(st,V){return st+22+75*(st<26)-((V!=0)<<5)}function G(st,V,U){var dt=0;for(st=U?At(st/700):st>>1,st+=At(st/V);st>455;dt+=36)st=At(st/35);return At(dt+36*st/(st+38))}function Ot(st){var V,U,dt,$,vt,Lt,K,ct,nt,_t,St,kt=[],Xt=st.length,Jt=0,at=128,_e=72;for((U=st.lastIndexOf("-"))<0&&(U=0),dt=0;dt<U;++dt)st.charCodeAt(dt)>=128&&R("not-basic"),kt.push(st.charCodeAt(dt));for($=U>0?U+1:0;$<Xt;){for(vt=Jt,Lt=1,K=36;$>=Xt&&R("invalid-input"),((ct=(St=st.charCodeAt($++))-48<10?St-22:St-65<26?St-65:St-97<26?St-97:36)>=36||ct>At((W-Jt)/Lt))&&R("overflow"),Jt+=ct*Lt,!(ct<(nt=K<=_e?1:K>=_e+26?26:K-_e));K+=36)Lt>At(W/(_t=36-nt))&&R("overflow"),Lt*=_t;_e=G(Jt-vt,V=kt.length+1,vt==0),At(Jt/V)>W-at&&R("overflow"),at+=At(Jt/V),Jt%=V,kt.splice(Jt++,0,at)}return H(kt)}function zt(st){var V,U,dt,$,vt,Lt,K,ct,nt,_t,St,kt,Xt,Jt,at,_e=[];for(kt=(st=P(st)).length,V=128,U=0,vt=72,Lt=0;Lt<kt;++Lt)(St=st[Lt])<128&&_e.push(L(St));for(dt=$=_e.length,$&&_e.push("-");dt<kt;){for(K=W,Lt=0;Lt<kt;++Lt)(St=st[Lt])>=V&&St<K&&(K=St);for(K-V>At((W-U)/(Xt=dt+1))&&R("overflow"),U+=(K-V)*Xt,V=K,Lt=0;Lt<kt;++Lt)if((St=st[Lt])<V&&++U>W&&R("overflow"),St==V){for(ct=U,nt=36;!(ct<(_t=nt<=vt?1:nt>=vt+26?26:nt-vt));nt+=36)at=ct-_t,Jt=36-_t,_e.push(L(tt(_t+at%Jt,0))),ct=At(at/Jt);_e.push(L(tt(ct,0))),vt=G(U,Xt,dt==$),U=0,++dt}++U,++V}return _e.join("")}z={version:"1.4.1",ucs2:{decode:P,encode:H},decode:Ot,encode:zt,toASCII:function(st){return X(st,function(V){return et.test(V)?"xn--"+zt(V):V})},toUnicode:function(st){return X(st,function(V){return Y.test(V)?Ot(V.slice(4).toLowerCase()):V})}},(I=function(){return z}.call(w,v,w,O))===void 0||(O.exports=I)})()}).call(this,v(25)(b),v(17))},function(b,w,v){b.exports={isString:function(O){return typeof O=="string"},isObject:function(O){return typeof O=="object"&&O!==null},isNull:function(O){return O===null},isNullOrUndefined:function(O){return O==null}}},function(b,w,v){w.decode=w.parse=v(146),w.encode=w.stringify=v(147)},function(b,w,v){function O(I,D){return Object.prototype.hasOwnProperty.call(I,D)}b.exports=function(I,D,k,z){D=D||"&",k=k||"=";var W={};if(typeof I!="string"||I.length===0)return W;var Y=/\+/g;I=I.split(D);var et=1e3;z&&typeof z.maxKeys=="number"&&(et=z.maxKeys);var ft=I.length;et>0&&ft>et&&(ft=et);for(var Dt=0;Dt<ft;++Dt){var At,L,R,B,X=I[Dt].replace(Y,"%20"),P=X.indexOf(k);P>=0?(At=X.substr(0,P),L=X.substr(P+1)):(At=X,L=""),R=decodeURIComponent(At),B=decodeURIComponent(L),O(W,R)?M(W[R])?W[R].push(B):W[R]=[W[R],B]:W[R]=B}return W};var M=Array.isArray||function(I){return Object.prototype.toString.call(I)==="[object Array]"}},function(b,w,v){var O=function(k){switch(typeof k){case"string":return k;case"boolean":return k?"true":"false";case"number":return isFinite(k)?k:"";default:return""}};b.exports=function(k,z,W,Y){return z=z||"&",W=W||"=",k===null&&(k=void 0),typeof k=="object"?I(D(k),function(et){var ft=encodeURIComponent(O(et))+W;return M(k[et])?I(k[et],function(Dt){return ft+encodeURIComponent(O(Dt))}).join(z):ft+encodeURIComponent(O(k[et]))}).join(z):Y?encodeURIComponent(O(Y))+W+encodeURIComponent(O(k)):""};var M=Array.isArray||function(k){return Object.prototype.toString.call(k)==="[object Array]"};function I(k,z){if(k.map)return k.map(z);for(var W=[],Y=0;Y<k.length;Y++)W.push(z(k[Y],Y));return W}var D=Object.keys||function(k){var z=[];for(var W in k)Object.prototype.hasOwnProperty.call(k,W)&&z.push(W);return z}},function(b,w){var v=function(){};v.prototype={fit:function(O){var M,I,D,k,z=O.length,W=z>0?O[0].width:0,Y=z>0?O[0].height:0;for(this.root={x:0,y:0,width:W,height:Y},M=0;M<z;M++)D=O[M],(I=this.findNode(this.root,D.width,D.height))?(k=this.splitNode(I,D.width,D.height),D.x=k.x,D.y=k.y):(k=this.growNode(D.width,D.height),D.x=k.x,D.y=k.y)},findNode:function(O,M,I){return O.used?this.findNode(O.right,M,I)||this.findNode(O.down,M,I):M<=O.width&&I<=O.height?O:null},splitNode:function(O,M,I){return O.used=!0,O.down={x:O.x,y:O.y+I,width:O.width,height:O.height-I},O.right={x:O.x+M,y:O.y,width:O.width-M,height:I},O},growNode:function(O,M){var I=O<=this.root.width,D=M<=this.root.height,k=D&&this.root.height>=this.root.width+O,z=I&&this.root.width>=this.root.height+M;return k?this.growRight(O,M):z?this.growDown(O,M):D?this.growRight(O,M):I?this.growDown(O,M):null},growRight:function(O,M){var I;return this.root={used:!0,x:0,y:0,width:this.root.width+O,height:this.root.height,down:this.root,right:{x:this.root.width,y:0,width:O,height:this.root.height}},(I=this.findNode(this.root,O,M))?this.splitNode(I,O,M):null},growDown:function(O,M){var I;return this.root={used:!0,x:0,y:0,width:this.root.width,height:this.root.height+M,down:{x:0,y:this.root.height,width:this.root.width,height:M},right:this.root},(I=this.findNode(this.root,O,M))?this.splitNode(I,O,M):null}},b.exports=v},function(b,w){(function(v){b.exports=v}).call(this,{})},function(b,w,v){var O=v(151),M=v(15);b.exports=function I(D,k,z,W,Y){return D===k||(D==null||k==null||!M(D)&&!M(k)?D!=D&&k!=k:O(D,k,z,W,I,Y))}},function(b,w,v){var O=v(54),M=v(57),I=v(183),D=v(186),k=v(31),z=v(30),W=v(40),Y=v(64),et="[object Object]",ft=Object.prototype.hasOwnProperty;b.exports=function(Dt,At,L,R,B,X){var P=z(Dt),H=z(At),tt=P?"[object Array]":k(Dt),G=H?"[object Array]":k(At),Ot=(tt=tt=="[object Arguments]"?et:tt)==et,zt=(G=G=="[object Arguments]"?et:G)==et,st=tt==G;if(st&&W(Dt)){if(!W(At))return!1;P=!0,Ot=!1}if(st&&!Ot)return X||(X=new O),P||Y(Dt)?M(Dt,At,L,R,B,X):I(Dt,At,tt,L,R,B,X);if(!(1&L)){var V=Ot&&ft.call(Dt,"__wrapped__"),U=zt&&ft.call(At,"__wrapped__");if(V||U){var dt=V?Dt.value():Dt,$=U?At.value():At;return X||(X=new O),B(dt,$,L,R,X)}}return!!st&&(X||(X=new O),D(Dt,At,L,R,B,X))}},function(b,w){b.exports=function(){this.__data__=[],this.size=0}},function(b,w,v){var O=v(27),M=Array.prototype.splice;b.exports=function(I){var D=this.__data__,k=O(D,I);return!(k<0)&&(k==D.length-1?D.pop():M.call(D,k,1),--this.size,!0)}},function(b,w,v){var O=v(27);b.exports=function(M){var I=this.__data__,D=O(I,M);return D<0?void 0:I[D][1]}},function(b,w,v){var O=v(27);b.exports=function(M){return O(this.__data__,M)>-1}},function(b,w,v){var O=v(27);b.exports=function(M,I){var D=this.__data__,k=O(D,M);return k<0?(++this.size,D.push([M,I])):D[k][1]=I,this}},function(b,w,v){var O=v(26);b.exports=function(){this.__data__=new O,this.size=0}},function(b,w){b.exports=function(v){var O=this.__data__,M=O.delete(v);return this.size=O.size,M}},function(b,w){b.exports=function(v){return this.__data__.get(v)}},function(b,w){b.exports=function(v){return this.__data__.has(v)}},function(b,w,v){var O=v(26),M=v(37),I=v(56);b.exports=function(D,k){var z=this.__data__;if(z instanceof O){var W=z.__data__;if(!M||W.length<199)return W.push([D,k]),this.size=++z.size,this;z=this.__data__=new I(W)}return z.set(D,k),this.size=z.size,this}},function(b,w,v){var O=v(33),M=v(163),I=v(21),D=v(55),k=/^\[object .+?Constructor\]$/,z=Function.prototype,W=Object.prototype,Y=z.toString,et=W.hasOwnProperty,ft=RegExp("^"+Y.call(et).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");b.exports=function(Dt){return!(!I(Dt)||M(Dt))&&(O(Dt)?ft:k).test(D(Dt))}},function(b,w,v){var O,M=v(164),I=(O=/[^.]+$/.exec(M&&M.keys&&M.keys.IE_PROTO||""))?"Symbol(src)_1."+O:"";b.exports=function(D){return!!I&&I in D}},function(b,w,v){var O=v(14)["__core-js_shared__"];b.exports=O},function(b,w){b.exports=function(v,O){return v==null?void 0:v[O]}},function(b,w,v){var O=v(167),M=v(26),I=v(37);b.exports=function(){this.size=0,this.__data__={hash:new O,map:new(I||M),string:new O}}},function(b,w,v){var O=v(168),M=v(169),I=v(170),D=v(171),k=v(172);function z(W){var Y=-1,et=W==null?0:W.length;for(this.clear();++Y<et;){var ft=W[Y];this.set(ft[0],ft[1])}}z.prototype.clear=O,z.prototype.delete=M,z.prototype.get=I,z.prototype.has=D,z.prototype.set=k,b.exports=z},function(b,w,v){var O=v(28);b.exports=function(){this.__data__=O?O(null):{},this.size=0}},function(b,w){b.exports=function(v){var O=this.has(v)&&delete this.__data__[v];return this.size-=O?1:0,O}},function(b,w,v){var O=v(28),M=Object.prototype.hasOwnProperty;b.exports=function(I){var D=this.__data__;if(O){var k=D[I];return k==="__lodash_hash_undefined__"?void 0:k}return M.call(D,I)?D[I]:void 0}},function(b,w,v){var O=v(28),M=Object.prototype.hasOwnProperty;b.exports=function(I){var D=this.__data__;return O?D[I]!==void 0:M.call(D,I)}},function(b,w,v){var O=v(28);b.exports=function(M,I){var D=this.__data__;return this.size+=this.has(M)?0:1,D[M]=O&&I===void 0?"__lodash_hash_undefined__":I,this}},function(b,w,v){var O=v(29);b.exports=function(M){var I=O(this,M).delete(M);return this.size-=I?1:0,I}},function(b,w){b.exports=function(v){var O=typeof v;return O=="string"||O=="number"||O=="symbol"||O=="boolean"?v!=="__proto__":v===null}},function(b,w,v){var O=v(29);b.exports=function(M){return O(this,M).get(M)}},function(b,w,v){var O=v(29);b.exports=function(M){return O(this,M).has(M)}},function(b,w,v){var O=v(29);b.exports=function(M,I){var D=O(this,M),k=D.size;return D.set(M,I),this.size+=D.size==k?0:1,this}},function(b,w,v){var O=v(56),M=v(179),I=v(180);function D(k){var z=-1,W=k==null?0:k.length;for(this.__data__=new O;++z<W;)this.add(k[z])}D.prototype.add=D.prototype.push=M,D.prototype.has=I,b.exports=D},function(b,w){b.exports=function(v){return this.__data__.set(v,"__lodash_hash_undefined__"),this}},function(b,w){b.exports=function(v){return this.__data__.has(v)}},function(b,w){b.exports=function(v,O){for(var M=-1,I=v==null?0:v.length;++M<I;)if(O(v[M],M,v))return!0;return!1}},function(b,w){b.exports=function(v,O){return v.has(O)}},function(b,w,v){var O=v(24),M=v(58),I=v(36),D=v(57),k=v(184),z=v(185),W=O?O.prototype:void 0,Y=W?W.valueOf:void 0;b.exports=function(et,ft,Dt,At,L,R,B){switch(Dt){case"[object DataView]":if(et.byteLength!=ft.byteLength||et.byteOffset!=ft.byteOffset)return!1;et=et.buffer,ft=ft.buffer;case"[object ArrayBuffer]":return!(et.byteLength!=ft.byteLength||!R(new M(et),new M(ft)));case"[object Boolean]":case"[object Date]":case"[object Number]":return I(+et,+ft);case"[object Error]":return et.name==ft.name&&et.message==ft.message;case"[object RegExp]":case"[object String]":return et==ft+"";case"[object Map]":var X=k;case"[object Set]":var P=1&At;if(X||(X=z),et.size!=ft.size&&!P)return!1;var H=B.get(et);if(H)return H==ft;At|=2,B.set(et,ft);var tt=D(X(et),X(ft),At,L,R,B);return B.delete(et),tt;case"[object Symbol]":if(Y)return Y.call(et)==Y.call(ft)}return!1}},function(b,w){b.exports=function(v){var O=-1,M=Array(v.size);return v.forEach(function(I,D){M[++O]=[D,I]}),M}},function(b,w){b.exports=function(v){var O=-1,M=Array(v.size);return v.forEach(function(I){M[++O]=I}),M}},function(b,w,v){var O=v(59),M=Object.prototype.hasOwnProperty;b.exports=function(I,D,k,z,W,Y){var et=1&k,ft=O(I),Dt=ft.length;if(Dt!=O(D).length&&!et)return!1;for(var At=Dt;At--;){var L=ft[At];if(!(et?L in D:M.call(D,L)))return!1}var R=Y.get(I),B=Y.get(D);if(R&&B)return R==D&&B==I;var X=!0;Y.set(I,D),Y.set(D,I);for(var P=et;++At<Dt;){var H=I[L=ft[At]],tt=D[L];if(z)var G=et?z(tt,H,L,D,I,Y):z(H,tt,L,I,D,Y);if(!(G===void 0?H===tt||W(H,tt,k,z,Y):G)){X=!1;break}P||(P=L=="constructor")}if(X&&!P){var Ot=I.constructor,zt=D.constructor;Ot==zt||!("constructor"in I)||!("constructor"in D)||typeof Ot=="function"&&Ot instanceof Ot&&typeof zt=="function"&&zt instanceof zt||(X=!1)}return Y.delete(I),Y.delete(D),X}},function(b,w){b.exports=function(v,O){for(var M=-1,I=v==null?0:v.length,D=0,k=[];++M<I;){var z=v[M];O(z,M,v)&&(k[D++]=z)}return k}},function(b,w){b.exports=function(v,O){for(var M=-1,I=Array(v);++M<v;)I[M]=O(M);return I}},function(b,w,v){var O=v(190),M=v(15),I=Object.prototype,D=I.hasOwnProperty,k=I.propertyIsEnumerable,z=O(function(){return arguments}())?O:function(W){return M(W)&&D.call(W,"callee")&&!k.call(W,"callee")};b.exports=z},function(b,w,v){var O=v(20),M=v(15);b.exports=function(I){return M(I)&&O(I)=="[object Arguments]"}},function(b,w){b.exports=function(){return!1}},function(b,w){var v=/^(?:0|[1-9]\d*)$/;b.exports=function(O,M){var I=typeof O;return!!(M=M==null?9007199254740991:M)&&(I=="number"||I!="symbol"&&v.test(O))&&O>-1&&O%1==0&&O<M}},function(b,w,v){var O=v(20),M=v(65),I=v(15),D={};D["[object Float32Array]"]=D["[object Float64Array]"]=D["[object Int8Array]"]=D["[object Int16Array]"]=D["[object Int32Array]"]=D["[object Uint8Array]"]=D["[object Uint8ClampedArray]"]=D["[object Uint16Array]"]=D["[object Uint32Array]"]=!0,D["[object Arguments]"]=D["[object Array]"]=D["[object ArrayBuffer]"]=D["[object Boolean]"]=D["[object DataView]"]=D["[object Date]"]=D["[object Error]"]=D["[object Function]"]=D["[object Map]"]=D["[object Number]"]=D["[object Object]"]=D["[object RegExp]"]=D["[object Set]"]=D["[object String]"]=D["[object WeakMap]"]=!1,b.exports=function(k){return I(k)&&M(k.length)&&!!D[O(k)]}},function(b,w,v){var O=v(43),M=v(195),I=Object.prototype.hasOwnProperty;b.exports=function(D){if(!O(D))return M(D);var k=[];for(var z in Object(D))I.call(D,z)&&z!="constructor"&&k.push(z);return k}},function(b,w,v){var O=v(66)(Object.keys,Object);b.exports=O},function(b,w,v){var O=v(22)(v(14),"DataView");b.exports=O},function(b,w,v){var O=v(22)(v(14),"Promise");b.exports=O},function(b,w,v){var O=v(22)(v(14),"Set");b.exports=O},function(b,w,v){var O=v(22)(v(14),"WeakMap");b.exports=O},function(b,w,v){var O=v(14);b.exports=function(){return O.Date.now()}},function(b,w,v){var O=v(202),M=v(21),I=v(204),D=/^[-+]0x[0-9a-f]+$/i,k=/^0b[01]+$/i,z=/^0o[0-7]+$/i,W=parseInt;b.exports=function(Y){if(typeof Y=="number")return Y;if(I(Y))return NaN;if(M(Y)){var et=typeof Y.valueOf=="function"?Y.valueOf():Y;Y=M(et)?et+"":et}if(typeof Y!="string")return Y===0?Y:+Y;Y=O(Y);var ft=k.test(Y);return ft||z.test(Y)?W(Y.slice(2),ft?2:8):D.test(Y)?NaN:+Y}},function(b,w,v){var O=v(203),M=/^\s+/;b.exports=function(I){return I&&I.slice(0,O(I)+1).replace(M,"")}},function(b,w){var v=/\s/;b.exports=function(O){for(var M=O.length;M--&&v.test(O.charAt(M)););return M}},function(b,w,v){var O=v(20),M=v(15);b.exports=function(I){return typeof I=="symbol"||M(I)&&O(I)=="[object Symbol]"}},function(b,w,v){var O=v(54),M=v(206),I=v(68),D=v(208),k=v(209),z=v(212),W=v(213),Y=v(214),et=v(215),ft=v(59),Dt=v(216),At=v(31),L=v(217),R=v(218),B=v(223),X=v(30),P=v(40),H=v(225),tt=v(21),G=v(227),Ot=v(39),zt=v(44),st={};st["[object Arguments]"]=st["[object Array]"]=st["[object ArrayBuffer]"]=st["[object DataView]"]=st["[object Boolean]"]=st["[object Date]"]=st["[object Float32Array]"]=st["[object Float64Array]"]=st["[object Int8Array]"]=st["[object Int16Array]"]=st["[object Int32Array]"]=st["[object Map]"]=st["[object Number]"]=st["[object Object]"]=st["[object RegExp]"]=st["[object Set]"]=st["[object String]"]=st["[object Symbol]"]=st["[object Uint8Array]"]=st["[object Uint8ClampedArray]"]=st["[object Uint16Array]"]=st["[object Uint32Array]"]=!0,st["[object Error]"]=st["[object Function]"]=st["[object WeakMap]"]=!1,b.exports=function V(U,dt,$,vt,Lt,K){var ct,nt=1&dt,_t=2&dt,St=4&dt;if($&&(ct=Lt?$(U,vt,Lt,K):$(U)),ct!==void 0)return ct;if(!tt(U))return U;var kt=X(U);if(kt){if(ct=L(U),!nt)return W(U,ct)}else{var Xt=At(U),Jt=Xt=="[object Function]"||Xt=="[object GeneratorFunction]";if(P(U))return z(U,nt);if(Xt=="[object Object]"||Xt=="[object Arguments]"||Jt&&!Lt){if(ct=_t||Jt?{}:B(U),!nt)return _t?et(U,k(ct,U)):Y(U,D(ct,U))}else{if(!st[Xt])return Lt?U:{};ct=R(U,Xt,nt)}}K||(K=new O);var at=K.get(U);if(at)return at;K.set(U,ct),G(U)?U.forEach(function(Ue){ct.add(V(Ue,dt,$,Ue,U,K))}):H(U)&&U.forEach(function(Ue,Oe){ct.set(Oe,V(Ue,dt,$,Oe,U,K))});var _e=kt?void 0:(St?_t?Dt:ft:_t?zt:Ot)(U);return M(_e||U,function(Ue,Oe){_e&&(Ue=U[Oe=Ue]),I(ct,Oe,V(Ue,dt,$,Oe,U,K))}),ct}},function(b,w){b.exports=function(v,O){for(var M=-1,I=v==null?0:v.length;++M<I&&O(v[M],M,v)!==!1;);return v}},function(b,w,v){var O=v(22),M=function(){try{var I=O(Object,"defineProperty");return I({},"",{}),I}catch{}}();b.exports=M},function(b,w,v){var O=v(32),M=v(39);b.exports=function(I,D){return I&&O(D,M(D),I)}},function(b,w,v){var O=v(32),M=v(44);b.exports=function(I,D){return I&&O(D,M(D),I)}},function(b,w,v){var O=v(21),M=v(43),I=v(211),D=Object.prototype.hasOwnProperty;b.exports=function(k){if(!O(k))return I(k);var z=M(k),W=[];for(var Y in k)(Y!="constructor"||!z&&D.call(k,Y))&&W.push(Y);return W}},function(b,w){b.exports=function(v){var O=[];if(v!=null)for(var M in Object(v))O.push(M);return O}},function(b,w,v){(function(O){var M=v(14),I=w&&!w.nodeType&&w,D=I&&typeof O=="object"&&O&&!O.nodeType&&O,k=D&&D.exports===I?M.Buffer:void 0,z=k?k.allocUnsafe:void 0;O.exports=function(W,Y){if(Y)return W.slice();var et=W.length,ft=z?z(et):new W.constructor(et);return W.copy(ft),ft}}).call(this,v(25)(b))},function(b,w){b.exports=function(v,O){var M=-1,I=v.length;for(O||(O=Array(I));++M<I;)O[M]=v[M];return O}},function(b,w,v){var O=v(32),M=v(38);b.exports=function(I,D){return O(I,M(I),D)}},function(b,w,v){var O=v(32),M=v(70);b.exports=function(I,D){return O(I,M(I),D)}},function(b,w,v){var O=v(60),M=v(70),I=v(44);b.exports=function(D){return O(D,I,M)}},function(b,w){var v=Object.prototype.hasOwnProperty;b.exports=function(O){var M=O.length,I=new O.constructor(M);return M&&typeof O[0]=="string"&&v.call(O,"index")&&(I.index=O.index,I.input=O.input),I}},function(b,w,v){var O=v(45),M=v(219),I=v(220),D=v(221),k=v(222);b.exports=function(z,W,Y){var et=z.constructor;switch(W){case"[object ArrayBuffer]":return O(z);case"[object Boolean]":case"[object Date]":return new et(+z);case"[object DataView]":return M(z,Y);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return k(z,Y);case"[object Map]":return new et;case"[object Number]":case"[object String]":return new et(z);case"[object RegExp]":return I(z);case"[object Set]":return new et;case"[object Symbol]":return D(z)}}},function(b,w,v){var O=v(45);b.exports=function(M,I){var D=I?O(M.buffer):M.buffer;return new M.constructor(D,M.byteOffset,M.byteLength)}},function(b,w){var v=/\w*$/;b.exports=function(O){var M=new O.constructor(O.source,v.exec(O));return M.lastIndex=O.lastIndex,M}},function(b,w,v){var O=v(24),M=O?O.prototype:void 0,I=M?M.valueOf:void 0;b.exports=function(D){return I?Object(I.call(D)):{}}},function(b,w,v){var O=v(45);b.exports=function(M,I){var D=I?O(M.buffer):M.buffer;return new M.constructor(D,M.byteOffset,M.length)}},function(b,w,v){var O=v(224),M=v(71),I=v(43);b.exports=function(D){return typeof D.constructor!="function"||I(D)?{}:O(M(D))}},function(b,w,v){var O=v(21),M=Object.create,I=function(){function D(){}return function(k){if(!O(k))return{};if(M)return M(k);D.prototype=k;var z=new D;return D.prototype=void 0,z}}();b.exports=I},function(b,w,v){var O=v(226),M=v(41),I=v(42),D=I&&I.isMap,k=D?M(D):O;b.exports=k},function(b,w,v){var O=v(31),M=v(15);b.exports=function(I){return M(I)&&O(I)=="[object Map]"}},function(b,w,v){var O=v(228),M=v(41),I=v(42),D=I&&I.isSet,k=D?M(D):O;b.exports=k},function(b,w,v){var O=v(31),M=v(15);b.exports=function(I){return M(I)&&O(I)=="[object Set]"}},function(b,w,v){v.r(w),v.d(w,"delay",function(){return vh}),v.d(w,"waitUntil",function(){return YE}),v.d(w,"SLIDE_EVENTS",function(){return lr}),v.d(w,"Slide",function(){return to});const O=[];for(let i=0;i<256;i++)O[i]=(i<16?"0":"")+i.toString(16);function M(){const i=4294967295*Math.random()|0,t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(O[255&i]+O[i>>8&255]+O[i>>16&255]+O[i>>24&255]+"-"+O[255&t]+O[t>>8&255]+"-"+O[t>>16&15|64]+O[t>>24&255]+"-"+O[63&e|128]+O[e>>8&255]+"-"+O[e>>16&255]+O[e>>24&255]+O[255&n]+O[n>>8&255]+O[n>>16&255]+O[n>>24&255]).toUpperCase()}var I=v(23);/**
|
|
4066
|
+
*/if(typeof globalThis=="undefined"&&(typeof self!="undefined"?self.globalThis=self:O!==void 0&&(O.globalThis=O)),globalThis.Promise||(globalThis.Promise=M.a),Object.assign||(Object.assign=D.a),Date.now&&Date.prototype.getTime||(Date.now=function(){return new Date().getTime()}),!globalThis.performance||!globalThis.performance.now){var k=Date.now();globalThis.performance||(globalThis.performance={}),globalThis.performance.now=function(){return Date.now()-k}}for(var V=Date.now(),W=["ms","moz","webkit","o"],X=0;X<W.length&&!globalThis.requestAnimationFrame;++X){var et=W[X];globalThis.requestAnimationFrame=globalThis[et+"RequestAnimationFrame"],globalThis.cancelAnimationFrame=globalThis[et+"CancelAnimationFrame"]||globalThis[et+"CancelRequestAnimationFrame"]}globalThis.requestAnimationFrame||(globalThis.requestAnimationFrame=function(ft){if(typeof ft!="function")throw new TypeError(ft+"is not a function");var Dt=Date.now(),At=16+V-Dt;return At<0&&(At=0),V=Dt,globalThis.self.setTimeout(function(){V=Date.now(),ft(performance.now())},At)}),globalThis.cancelAnimationFrame||(globalThis.cancelAnimationFrame=function(ft){return clearTimeout(ft)}),Math.sign||(Math.sign=function(ft){return(ft=Number(ft))===0||isNaN(ft)?ft:ft>0?1:-1}),Number.isInteger||(Number.isInteger=function(ft){return typeof ft=="number"&&isFinite(ft)&&Math.floor(ft)===ft}),globalThis.ArrayBuffer||(globalThis.ArrayBuffer=Array),globalThis.Float32Array||(globalThis.Float32Array=Array),globalThis.Uint32Array||(globalThis.Uint32Array=Array),globalThis.Uint16Array||(globalThis.Uint16Array=Array),globalThis.Uint8Array||(globalThis.Uint8Array=Array),globalThis.Int32Array||(globalThis.Int32Array=Array)}).call(this,v(17))},function(b,w,v){(function(O){var M=O!==void 0&&O||typeof self!="undefined"&&self||window,I=Function.prototype.apply;function D(k,V){this._id=k,this._clearFn=V}w.setTimeout=function(){return new D(I.call(setTimeout,M,arguments),clearTimeout)},w.setInterval=function(){return new D(I.call(setInterval,M,arguments),clearInterval)},w.clearTimeout=w.clearInterval=function(k){k&&k.close()},D.prototype.unref=D.prototype.ref=function(){},D.prototype.close=function(){this._clearFn.call(M,this._id)},w.enroll=function(k,V){clearTimeout(k._idleTimeoutId),k._idleTimeout=V},w.unenroll=function(k){clearTimeout(k._idleTimeoutId),k._idleTimeout=-1},w._unrefActive=w.active=function(k){clearTimeout(k._idleTimeoutId);var V=k._idleTimeout;V>=0&&(k._idleTimeoutId=setTimeout(function(){k._onTimeout&&k._onTimeout()},V))},v(141),w.setImmediate=typeof self!="undefined"&&self.setImmediate||O!==void 0&&O.setImmediate||this&&this.setImmediate,w.clearImmediate=typeof self!="undefined"&&self.clearImmediate||O!==void 0&&O.clearImmediate||this&&this.clearImmediate}).call(this,v(17))},function(b,w,v){(function(O,M){(function(I,D){if(!I.setImmediate){var k,V,W,X,et,ft=1,Dt={},At=!1,L=I.document,R=Object.getPrototypeOf&&Object.getPrototypeOf(I);R=R&&R.setTimeout?R:I,{}.toString.call(I.process)==="[object process]"?k=function(P){M.nextTick(function(){Y(P)})}:function(){if(I.postMessage&&!I.importScripts){var P=!0,H=I.onmessage;return I.onmessage=function(){P=!1},I.postMessage("","*"),I.onmessage=H,P}}()?(X="setImmediate$"+Math.random()+"$",et=function(P){P.source===I&&typeof P.data=="string"&&P.data.indexOf(X)===0&&Y(+P.data.slice(X.length))},I.addEventListener?I.addEventListener("message",et,!1):I.attachEvent("onmessage",et),k=function(P){I.postMessage(X+P,"*")}):I.MessageChannel?((W=new MessageChannel).port1.onmessage=function(P){Y(P.data)},k=function(P){W.port2.postMessage(P)}):L&&"onreadystatechange"in L.createElement("script")?(V=L.documentElement,k=function(P){var H=L.createElement("script");H.onreadystatechange=function(){Y(P),H.onreadystatechange=null,V.removeChild(H),H=null},V.appendChild(H)}):k=function(P){setTimeout(Y,0,P)},R.setImmediate=function(P){typeof P!="function"&&(P=new Function(""+P));for(var H=new Array(arguments.length-1),tt=0;tt<H.length;tt++)H[tt]=arguments[tt+1];var G={callback:P,args:H};return Dt[ft]=G,k(ft),ft++},R.clearImmediate=B}function B(P){delete Dt[P]}function Y(P){if(At)setTimeout(Y,0,P);else{var H=Dt[P];if(H){At=!0;try{(function(tt){var G=tt.callback,Ot=tt.args;switch(Ot.length){case 0:G();break;case 1:G(Ot[0]);break;case 2:G(Ot[0],Ot[1]);break;case 3:G(Ot[0],Ot[1],Ot[2]);break;default:G.apply(void 0,Ot)}})(H)}finally{B(P),At=!1}}}}})(typeof self=="undefined"?O===void 0?this:O:self)}).call(this,v(17),v(142))},function(b,w){var v,O,M=b.exports={};function I(){throw new Error("setTimeout has not been defined")}function D(){throw new Error("clearTimeout has not been defined")}function k(R){if(v===setTimeout)return setTimeout(R,0);if((v===I||!v)&&setTimeout)return v=setTimeout,setTimeout(R,0);try{return v(R,0)}catch{try{return v.call(null,R,0)}catch{return v.call(this,R,0)}}}(function(){try{v=typeof setTimeout=="function"?setTimeout:I}catch{v=I}try{O=typeof clearTimeout=="function"?clearTimeout:D}catch{O=D}})();var V,W=[],X=!1,et=-1;function ft(){X&&V&&(X=!1,V.length?W=V.concat(W):et=-1,W.length&&Dt())}function Dt(){if(!X){var R=k(ft);X=!0;for(var B=W.length;B;){for(V=W,W=[];++et<B;)V&&V[et].run();et=-1,B=W.length}V=null,X=!1,function(Y){if(O===clearTimeout)return clearTimeout(Y);if((O===D||!O)&&clearTimeout)return O=clearTimeout,clearTimeout(Y);try{O(Y)}catch{try{return O.call(null,Y)}catch{return O.call(this,Y)}}}(R)}}function At(R,B){this.fun=R,this.array=B}function L(){}M.nextTick=function(R){var B=new Array(arguments.length-1);if(arguments.length>1)for(var Y=1;Y<arguments.length;Y++)B[Y-1]=arguments[Y];W.push(new At(R,B)),W.length!==1||X||k(Dt)},At.prototype.run=function(){this.fun.apply(null,this.array)},M.title="browser",M.browser=!0,M.env={},M.argv=[],M.version="",M.versions={},M.on=L,M.addListener=L,M.once=L,M.off=L,M.removeListener=L,M.removeAllListeners=L,M.emit=L,M.prependListener=L,M.prependOnceListener=L,M.listeners=function(R){return[]},M.binding=function(R){throw new Error("process.binding is not supported")},M.cwd=function(){return"/"},M.chdir=function(R){throw new Error("process.chdir is not supported")},M.umask=function(){return 0}},function(b,w,v){(function(O,M){var I;/*! https://mths.be/punycode v1.4.1 by @mathias */(function(D){w&&w.nodeType,O&&O.nodeType;var k=typeof M=="object"&&M;k.global!==k&&k.window!==k&&k.self;var V,W=2147483647,X=/^xn--/,et=/[^\x20-\x7E]/,ft=/[\x2E\u3002\uFF0E\uFF61]/g,Dt={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},At=Math.floor,L=String.fromCharCode;function R(st){throw new RangeError(Dt[st])}function B(st,z){for(var U=st.length,dt=[];U--;)dt[U]=z(st[U]);return dt}function Y(st,z){var U=st.split("@"),dt="";return U.length>1&&(dt=U[0]+"@",st=U[1]),dt+B((st=st.replace(ft,".")).split("."),z).join(".")}function P(st){for(var z,U,dt=[],$=0,vt=st.length;$<vt;)(z=st.charCodeAt($++))>=55296&&z<=56319&&$<vt?(64512&(U=st.charCodeAt($++)))==56320?dt.push(((1023&z)<<10)+(1023&U)+65536):(dt.push(z),$--):dt.push(z);return dt}function H(st){return B(st,function(z){var U="";return z>65535&&(U+=L((z-=65536)>>>10&1023|55296),z=56320|1023&z),U+=L(z)}).join("")}function tt(st,z){return st+22+75*(st<26)-((z!=0)<<5)}function G(st,z,U){var dt=0;for(st=U?At(st/700):st>>1,st+=At(st/z);st>455;dt+=36)st=At(st/35);return At(dt+36*st/(st+38))}function Ot(st){var z,U,dt,$,vt,Lt,K,ct,nt,_t,St,kt=[],Xt=st.length,Jt=0,at=128,_e=72;for((U=st.lastIndexOf("-"))<0&&(U=0),dt=0;dt<U;++dt)st.charCodeAt(dt)>=128&&R("not-basic"),kt.push(st.charCodeAt(dt));for($=U>0?U+1:0;$<Xt;){for(vt=Jt,Lt=1,K=36;$>=Xt&&R("invalid-input"),((ct=(St=st.charCodeAt($++))-48<10?St-22:St-65<26?St-65:St-97<26?St-97:36)>=36||ct>At((W-Jt)/Lt))&&R("overflow"),Jt+=ct*Lt,!(ct<(nt=K<=_e?1:K>=_e+26?26:K-_e));K+=36)Lt>At(W/(_t=36-nt))&&R("overflow"),Lt*=_t;_e=G(Jt-vt,z=kt.length+1,vt==0),At(Jt/z)>W-at&&R("overflow"),at+=At(Jt/z),Jt%=z,kt.splice(Jt++,0,at)}return H(kt)}function zt(st){var z,U,dt,$,vt,Lt,K,ct,nt,_t,St,kt,Xt,Jt,at,_e=[];for(kt=(st=P(st)).length,z=128,U=0,vt=72,Lt=0;Lt<kt;++Lt)(St=st[Lt])<128&&_e.push(L(St));for(dt=$=_e.length,$&&_e.push("-");dt<kt;){for(K=W,Lt=0;Lt<kt;++Lt)(St=st[Lt])>=z&&St<K&&(K=St);for(K-z>At((W-U)/(Xt=dt+1))&&R("overflow"),U+=(K-z)*Xt,z=K,Lt=0;Lt<kt;++Lt)if((St=st[Lt])<z&&++U>W&&R("overflow"),St==z){for(ct=U,nt=36;!(ct<(_t=nt<=vt?1:nt>=vt+26?26:nt-vt));nt+=36)at=ct-_t,Jt=36-_t,_e.push(L(tt(_t+at%Jt,0))),ct=At(at/Jt);_e.push(L(tt(ct,0))),vt=G(U,Xt,dt==$),U=0,++dt}++U,++z}return _e.join("")}V={version:"1.4.1",ucs2:{decode:P,encode:H},decode:Ot,encode:zt,toASCII:function(st){return Y(st,function(z){return et.test(z)?"xn--"+zt(z):z})},toUnicode:function(st){return Y(st,function(z){return X.test(z)?Ot(z.slice(4).toLowerCase()):z})}},(I=function(){return V}.call(w,v,w,O))===void 0||(O.exports=I)})()}).call(this,v(25)(b),v(17))},function(b,w,v){b.exports={isString:function(O){return typeof O=="string"},isObject:function(O){return typeof O=="object"&&O!==null},isNull:function(O){return O===null},isNullOrUndefined:function(O){return O==null}}},function(b,w,v){w.decode=w.parse=v(146),w.encode=w.stringify=v(147)},function(b,w,v){function O(I,D){return Object.prototype.hasOwnProperty.call(I,D)}b.exports=function(I,D,k,V){D=D||"&",k=k||"=";var W={};if(typeof I!="string"||I.length===0)return W;var X=/\+/g;I=I.split(D);var et=1e3;V&&typeof V.maxKeys=="number"&&(et=V.maxKeys);var ft=I.length;et>0&&ft>et&&(ft=et);for(var Dt=0;Dt<ft;++Dt){var At,L,R,B,Y=I[Dt].replace(X,"%20"),P=Y.indexOf(k);P>=0?(At=Y.substr(0,P),L=Y.substr(P+1)):(At=Y,L=""),R=decodeURIComponent(At),B=decodeURIComponent(L),O(W,R)?M(W[R])?W[R].push(B):W[R]=[W[R],B]:W[R]=B}return W};var M=Array.isArray||function(I){return Object.prototype.toString.call(I)==="[object Array]"}},function(b,w,v){var O=function(k){switch(typeof k){case"string":return k;case"boolean":return k?"true":"false";case"number":return isFinite(k)?k:"";default:return""}};b.exports=function(k,V,W,X){return V=V||"&",W=W||"=",k===null&&(k=void 0),typeof k=="object"?I(D(k),function(et){var ft=encodeURIComponent(O(et))+W;return M(k[et])?I(k[et],function(Dt){return ft+encodeURIComponent(O(Dt))}).join(V):ft+encodeURIComponent(O(k[et]))}).join(V):X?encodeURIComponent(O(X))+W+encodeURIComponent(O(k)):""};var M=Array.isArray||function(k){return Object.prototype.toString.call(k)==="[object Array]"};function I(k,V){if(k.map)return k.map(V);for(var W=[],X=0;X<k.length;X++)W.push(V(k[X],X));return W}var D=Object.keys||function(k){var V=[];for(var W in k)Object.prototype.hasOwnProperty.call(k,W)&&V.push(W);return V}},function(b,w){var v=function(){};v.prototype={fit:function(O){var M,I,D,k,V=O.length,W=V>0?O[0].width:0,X=V>0?O[0].height:0;for(this.root={x:0,y:0,width:W,height:X},M=0;M<V;M++)D=O[M],(I=this.findNode(this.root,D.width,D.height))?(k=this.splitNode(I,D.width,D.height),D.x=k.x,D.y=k.y):(k=this.growNode(D.width,D.height),D.x=k.x,D.y=k.y)},findNode:function(O,M,I){return O.used?this.findNode(O.right,M,I)||this.findNode(O.down,M,I):M<=O.width&&I<=O.height?O:null},splitNode:function(O,M,I){return O.used=!0,O.down={x:O.x,y:O.y+I,width:O.width,height:O.height-I},O.right={x:O.x+M,y:O.y,width:O.width-M,height:I},O},growNode:function(O,M){var I=O<=this.root.width,D=M<=this.root.height,k=D&&this.root.height>=this.root.width+O,V=I&&this.root.width>=this.root.height+M;return k?this.growRight(O,M):V?this.growDown(O,M):D?this.growRight(O,M):I?this.growDown(O,M):null},growRight:function(O,M){var I;return this.root={used:!0,x:0,y:0,width:this.root.width+O,height:this.root.height,down:this.root,right:{x:this.root.width,y:0,width:O,height:this.root.height}},(I=this.findNode(this.root,O,M))?this.splitNode(I,O,M):null},growDown:function(O,M){var I;return this.root={used:!0,x:0,y:0,width:this.root.width,height:this.root.height+M,down:{x:0,y:this.root.height,width:this.root.width,height:M},right:this.root},(I=this.findNode(this.root,O,M))?this.splitNode(I,O,M):null}},b.exports=v},function(b,w){(function(v){b.exports=v}).call(this,{})},function(b,w,v){var O=v(151),M=v(15);b.exports=function I(D,k,V,W,X){return D===k||(D==null||k==null||!M(D)&&!M(k)?D!=D&&k!=k:O(D,k,V,W,I,X))}},function(b,w,v){var O=v(54),M=v(57),I=v(183),D=v(186),k=v(31),V=v(30),W=v(40),X=v(64),et="[object Object]",ft=Object.prototype.hasOwnProperty;b.exports=function(Dt,At,L,R,B,Y){var P=V(Dt),H=V(At),tt=P?"[object Array]":k(Dt),G=H?"[object Array]":k(At),Ot=(tt=tt=="[object Arguments]"?et:tt)==et,zt=(G=G=="[object Arguments]"?et:G)==et,st=tt==G;if(st&&W(Dt)){if(!W(At))return!1;P=!0,Ot=!1}if(st&&!Ot)return Y||(Y=new O),P||X(Dt)?M(Dt,At,L,R,B,Y):I(Dt,At,tt,L,R,B,Y);if(!(1&L)){var z=Ot&&ft.call(Dt,"__wrapped__"),U=zt&&ft.call(At,"__wrapped__");if(z||U){var dt=z?Dt.value():Dt,$=U?At.value():At;return Y||(Y=new O),B(dt,$,L,R,Y)}}return!!st&&(Y||(Y=new O),D(Dt,At,L,R,B,Y))}},function(b,w){b.exports=function(){this.__data__=[],this.size=0}},function(b,w,v){var O=v(27),M=Array.prototype.splice;b.exports=function(I){var D=this.__data__,k=O(D,I);return!(k<0)&&(k==D.length-1?D.pop():M.call(D,k,1),--this.size,!0)}},function(b,w,v){var O=v(27);b.exports=function(M){var I=this.__data__,D=O(I,M);return D<0?void 0:I[D][1]}},function(b,w,v){var O=v(27);b.exports=function(M){return O(this.__data__,M)>-1}},function(b,w,v){var O=v(27);b.exports=function(M,I){var D=this.__data__,k=O(D,M);return k<0?(++this.size,D.push([M,I])):D[k][1]=I,this}},function(b,w,v){var O=v(26);b.exports=function(){this.__data__=new O,this.size=0}},function(b,w){b.exports=function(v){var O=this.__data__,M=O.delete(v);return this.size=O.size,M}},function(b,w){b.exports=function(v){return this.__data__.get(v)}},function(b,w){b.exports=function(v){return this.__data__.has(v)}},function(b,w,v){var O=v(26),M=v(37),I=v(56);b.exports=function(D,k){var V=this.__data__;if(V instanceof O){var W=V.__data__;if(!M||W.length<199)return W.push([D,k]),this.size=++V.size,this;V=this.__data__=new I(W)}return V.set(D,k),this.size=V.size,this}},function(b,w,v){var O=v(33),M=v(163),I=v(21),D=v(55),k=/^\[object .+?Constructor\]$/,V=Function.prototype,W=Object.prototype,X=V.toString,et=W.hasOwnProperty,ft=RegExp("^"+X.call(et).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");b.exports=function(Dt){return!(!I(Dt)||M(Dt))&&(O(Dt)?ft:k).test(D(Dt))}},function(b,w,v){var O,M=v(164),I=(O=/[^.]+$/.exec(M&&M.keys&&M.keys.IE_PROTO||""))?"Symbol(src)_1."+O:"";b.exports=function(D){return!!I&&I in D}},function(b,w,v){var O=v(14)["__core-js_shared__"];b.exports=O},function(b,w){b.exports=function(v,O){return v==null?void 0:v[O]}},function(b,w,v){var O=v(167),M=v(26),I=v(37);b.exports=function(){this.size=0,this.__data__={hash:new O,map:new(I||M),string:new O}}},function(b,w,v){var O=v(168),M=v(169),I=v(170),D=v(171),k=v(172);function V(W){var X=-1,et=W==null?0:W.length;for(this.clear();++X<et;){var ft=W[X];this.set(ft[0],ft[1])}}V.prototype.clear=O,V.prototype.delete=M,V.prototype.get=I,V.prototype.has=D,V.prototype.set=k,b.exports=V},function(b,w,v){var O=v(28);b.exports=function(){this.__data__=O?O(null):{},this.size=0}},function(b,w){b.exports=function(v){var O=this.has(v)&&delete this.__data__[v];return this.size-=O?1:0,O}},function(b,w,v){var O=v(28),M=Object.prototype.hasOwnProperty;b.exports=function(I){var D=this.__data__;if(O){var k=D[I];return k==="__lodash_hash_undefined__"?void 0:k}return M.call(D,I)?D[I]:void 0}},function(b,w,v){var O=v(28),M=Object.prototype.hasOwnProperty;b.exports=function(I){var D=this.__data__;return O?D[I]!==void 0:M.call(D,I)}},function(b,w,v){var O=v(28);b.exports=function(M,I){var D=this.__data__;return this.size+=this.has(M)?0:1,D[M]=O&&I===void 0?"__lodash_hash_undefined__":I,this}},function(b,w,v){var O=v(29);b.exports=function(M){var I=O(this,M).delete(M);return this.size-=I?1:0,I}},function(b,w){b.exports=function(v){var O=typeof v;return O=="string"||O=="number"||O=="symbol"||O=="boolean"?v!=="__proto__":v===null}},function(b,w,v){var O=v(29);b.exports=function(M){return O(this,M).get(M)}},function(b,w,v){var O=v(29);b.exports=function(M){return O(this,M).has(M)}},function(b,w,v){var O=v(29);b.exports=function(M,I){var D=O(this,M),k=D.size;return D.set(M,I),this.size+=D.size==k?0:1,this}},function(b,w,v){var O=v(56),M=v(179),I=v(180);function D(k){var V=-1,W=k==null?0:k.length;for(this.__data__=new O;++V<W;)this.add(k[V])}D.prototype.add=D.prototype.push=M,D.prototype.has=I,b.exports=D},function(b,w){b.exports=function(v){return this.__data__.set(v,"__lodash_hash_undefined__"),this}},function(b,w){b.exports=function(v){return this.__data__.has(v)}},function(b,w){b.exports=function(v,O){for(var M=-1,I=v==null?0:v.length;++M<I;)if(O(v[M],M,v))return!0;return!1}},function(b,w){b.exports=function(v,O){return v.has(O)}},function(b,w,v){var O=v(24),M=v(58),I=v(36),D=v(57),k=v(184),V=v(185),W=O?O.prototype:void 0,X=W?W.valueOf:void 0;b.exports=function(et,ft,Dt,At,L,R,B){switch(Dt){case"[object DataView]":if(et.byteLength!=ft.byteLength||et.byteOffset!=ft.byteOffset)return!1;et=et.buffer,ft=ft.buffer;case"[object ArrayBuffer]":return!(et.byteLength!=ft.byteLength||!R(new M(et),new M(ft)));case"[object Boolean]":case"[object Date]":case"[object Number]":return I(+et,+ft);case"[object Error]":return et.name==ft.name&&et.message==ft.message;case"[object RegExp]":case"[object String]":return et==ft+"";case"[object Map]":var Y=k;case"[object Set]":var P=1&At;if(Y||(Y=V),et.size!=ft.size&&!P)return!1;var H=B.get(et);if(H)return H==ft;At|=2,B.set(et,ft);var tt=D(Y(et),Y(ft),At,L,R,B);return B.delete(et),tt;case"[object Symbol]":if(X)return X.call(et)==X.call(ft)}return!1}},function(b,w){b.exports=function(v){var O=-1,M=Array(v.size);return v.forEach(function(I,D){M[++O]=[D,I]}),M}},function(b,w){b.exports=function(v){var O=-1,M=Array(v.size);return v.forEach(function(I){M[++O]=I}),M}},function(b,w,v){var O=v(59),M=Object.prototype.hasOwnProperty;b.exports=function(I,D,k,V,W,X){var et=1&k,ft=O(I),Dt=ft.length;if(Dt!=O(D).length&&!et)return!1;for(var At=Dt;At--;){var L=ft[At];if(!(et?L in D:M.call(D,L)))return!1}var R=X.get(I),B=X.get(D);if(R&&B)return R==D&&B==I;var Y=!0;X.set(I,D),X.set(D,I);for(var P=et;++At<Dt;){var H=I[L=ft[At]],tt=D[L];if(V)var G=et?V(tt,H,L,D,I,X):V(H,tt,L,I,D,X);if(!(G===void 0?H===tt||W(H,tt,k,V,X):G)){Y=!1;break}P||(P=L=="constructor")}if(Y&&!P){var Ot=I.constructor,zt=D.constructor;Ot==zt||!("constructor"in I)||!("constructor"in D)||typeof Ot=="function"&&Ot instanceof Ot&&typeof zt=="function"&&zt instanceof zt||(Y=!1)}return X.delete(I),X.delete(D),Y}},function(b,w){b.exports=function(v,O){for(var M=-1,I=v==null?0:v.length,D=0,k=[];++M<I;){var V=v[M];O(V,M,v)&&(k[D++]=V)}return k}},function(b,w){b.exports=function(v,O){for(var M=-1,I=Array(v);++M<v;)I[M]=O(M);return I}},function(b,w,v){var O=v(190),M=v(15),I=Object.prototype,D=I.hasOwnProperty,k=I.propertyIsEnumerable,V=O(function(){return arguments}())?O:function(W){return M(W)&&D.call(W,"callee")&&!k.call(W,"callee")};b.exports=V},function(b,w,v){var O=v(20),M=v(15);b.exports=function(I){return M(I)&&O(I)=="[object Arguments]"}},function(b,w){b.exports=function(){return!1}},function(b,w){var v=/^(?:0|[1-9]\d*)$/;b.exports=function(O,M){var I=typeof O;return!!(M=M==null?9007199254740991:M)&&(I=="number"||I!="symbol"&&v.test(O))&&O>-1&&O%1==0&&O<M}},function(b,w,v){var O=v(20),M=v(65),I=v(15),D={};D["[object Float32Array]"]=D["[object Float64Array]"]=D["[object Int8Array]"]=D["[object Int16Array]"]=D["[object Int32Array]"]=D["[object Uint8Array]"]=D["[object Uint8ClampedArray]"]=D["[object Uint16Array]"]=D["[object Uint32Array]"]=!0,D["[object Arguments]"]=D["[object Array]"]=D["[object ArrayBuffer]"]=D["[object Boolean]"]=D["[object DataView]"]=D["[object Date]"]=D["[object Error]"]=D["[object Function]"]=D["[object Map]"]=D["[object Number]"]=D["[object Object]"]=D["[object RegExp]"]=D["[object Set]"]=D["[object String]"]=D["[object WeakMap]"]=!1,b.exports=function(k){return I(k)&&M(k.length)&&!!D[O(k)]}},function(b,w,v){var O=v(43),M=v(195),I=Object.prototype.hasOwnProperty;b.exports=function(D){if(!O(D))return M(D);var k=[];for(var V in Object(D))I.call(D,V)&&V!="constructor"&&k.push(V);return k}},function(b,w,v){var O=v(66)(Object.keys,Object);b.exports=O},function(b,w,v){var O=v(22)(v(14),"DataView");b.exports=O},function(b,w,v){var O=v(22)(v(14),"Promise");b.exports=O},function(b,w,v){var O=v(22)(v(14),"Set");b.exports=O},function(b,w,v){var O=v(22)(v(14),"WeakMap");b.exports=O},function(b,w,v){var O=v(14);b.exports=function(){return O.Date.now()}},function(b,w,v){var O=v(202),M=v(21),I=v(204),D=/^[-+]0x[0-9a-f]+$/i,k=/^0b[01]+$/i,V=/^0o[0-7]+$/i,W=parseInt;b.exports=function(X){if(typeof X=="number")return X;if(I(X))return NaN;if(M(X)){var et=typeof X.valueOf=="function"?X.valueOf():X;X=M(et)?et+"":et}if(typeof X!="string")return X===0?X:+X;X=O(X);var ft=k.test(X);return ft||V.test(X)?W(X.slice(2),ft?2:8):D.test(X)?NaN:+X}},function(b,w,v){var O=v(203),M=/^\s+/;b.exports=function(I){return I&&I.slice(0,O(I)+1).replace(M,"")}},function(b,w){var v=/\s/;b.exports=function(O){for(var M=O.length;M--&&v.test(O.charAt(M)););return M}},function(b,w,v){var O=v(20),M=v(15);b.exports=function(I){return typeof I=="symbol"||M(I)&&O(I)=="[object Symbol]"}},function(b,w,v){var O=v(54),M=v(206),I=v(68),D=v(208),k=v(209),V=v(212),W=v(213),X=v(214),et=v(215),ft=v(59),Dt=v(216),At=v(31),L=v(217),R=v(218),B=v(223),Y=v(30),P=v(40),H=v(225),tt=v(21),G=v(227),Ot=v(39),zt=v(44),st={};st["[object Arguments]"]=st["[object Array]"]=st["[object ArrayBuffer]"]=st["[object DataView]"]=st["[object Boolean]"]=st["[object Date]"]=st["[object Float32Array]"]=st["[object Float64Array]"]=st["[object Int8Array]"]=st["[object Int16Array]"]=st["[object Int32Array]"]=st["[object Map]"]=st["[object Number]"]=st["[object Object]"]=st["[object RegExp]"]=st["[object Set]"]=st["[object String]"]=st["[object Symbol]"]=st["[object Uint8Array]"]=st["[object Uint8ClampedArray]"]=st["[object Uint16Array]"]=st["[object Uint32Array]"]=!0,st["[object Error]"]=st["[object Function]"]=st["[object WeakMap]"]=!1,b.exports=function z(U,dt,$,vt,Lt,K){var ct,nt=1&dt,_t=2&dt,St=4&dt;if($&&(ct=Lt?$(U,vt,Lt,K):$(U)),ct!==void 0)return ct;if(!tt(U))return U;var kt=Y(U);if(kt){if(ct=L(U),!nt)return W(U,ct)}else{var Xt=At(U),Jt=Xt=="[object Function]"||Xt=="[object GeneratorFunction]";if(P(U))return V(U,nt);if(Xt=="[object Object]"||Xt=="[object Arguments]"||Jt&&!Lt){if(ct=_t||Jt?{}:B(U),!nt)return _t?et(U,k(ct,U)):X(U,D(ct,U))}else{if(!st[Xt])return Lt?U:{};ct=R(U,Xt,nt)}}K||(K=new O);var at=K.get(U);if(at)return at;K.set(U,ct),G(U)?U.forEach(function(Ue){ct.add(z(Ue,dt,$,Ue,U,K))}):H(U)&&U.forEach(function(Ue,Oe){ct.set(Oe,z(Ue,dt,$,Oe,U,K))});var _e=kt?void 0:(St?_t?Dt:ft:_t?zt:Ot)(U);return M(_e||U,function(Ue,Oe){_e&&(Ue=U[Oe=Ue]),I(ct,Oe,z(Ue,dt,$,Oe,U,K))}),ct}},function(b,w){b.exports=function(v,O){for(var M=-1,I=v==null?0:v.length;++M<I&&O(v[M],M,v)!==!1;);return v}},function(b,w,v){var O=v(22),M=function(){try{var I=O(Object,"defineProperty");return I({},"",{}),I}catch{}}();b.exports=M},function(b,w,v){var O=v(32),M=v(39);b.exports=function(I,D){return I&&O(D,M(D),I)}},function(b,w,v){var O=v(32),M=v(44);b.exports=function(I,D){return I&&O(D,M(D),I)}},function(b,w,v){var O=v(21),M=v(43),I=v(211),D=Object.prototype.hasOwnProperty;b.exports=function(k){if(!O(k))return I(k);var V=M(k),W=[];for(var X in k)(X!="constructor"||!V&&D.call(k,X))&&W.push(X);return W}},function(b,w){b.exports=function(v){var O=[];if(v!=null)for(var M in Object(v))O.push(M);return O}},function(b,w,v){(function(O){var M=v(14),I=w&&!w.nodeType&&w,D=I&&typeof O=="object"&&O&&!O.nodeType&&O,k=D&&D.exports===I?M.Buffer:void 0,V=k?k.allocUnsafe:void 0;O.exports=function(W,X){if(X)return W.slice();var et=W.length,ft=V?V(et):new W.constructor(et);return W.copy(ft),ft}}).call(this,v(25)(b))},function(b,w){b.exports=function(v,O){var M=-1,I=v.length;for(O||(O=Array(I));++M<I;)O[M]=v[M];return O}},function(b,w,v){var O=v(32),M=v(38);b.exports=function(I,D){return O(I,M(I),D)}},function(b,w,v){var O=v(32),M=v(70);b.exports=function(I,D){return O(I,M(I),D)}},function(b,w,v){var O=v(60),M=v(70),I=v(44);b.exports=function(D){return O(D,I,M)}},function(b,w){var v=Object.prototype.hasOwnProperty;b.exports=function(O){var M=O.length,I=new O.constructor(M);return M&&typeof O[0]=="string"&&v.call(O,"index")&&(I.index=O.index,I.input=O.input),I}},function(b,w,v){var O=v(45),M=v(219),I=v(220),D=v(221),k=v(222);b.exports=function(V,W,X){var et=V.constructor;switch(W){case"[object ArrayBuffer]":return O(V);case"[object Boolean]":case"[object Date]":return new et(+V);case"[object DataView]":return M(V,X);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return k(V,X);case"[object Map]":return new et;case"[object Number]":case"[object String]":return new et(V);case"[object RegExp]":return I(V);case"[object Set]":return new et;case"[object Symbol]":return D(V)}}},function(b,w,v){var O=v(45);b.exports=function(M,I){var D=I?O(M.buffer):M.buffer;return new M.constructor(D,M.byteOffset,M.byteLength)}},function(b,w){var v=/\w*$/;b.exports=function(O){var M=new O.constructor(O.source,v.exec(O));return M.lastIndex=O.lastIndex,M}},function(b,w,v){var O=v(24),M=O?O.prototype:void 0,I=M?M.valueOf:void 0;b.exports=function(D){return I?Object(I.call(D)):{}}},function(b,w,v){var O=v(45);b.exports=function(M,I){var D=I?O(M.buffer):M.buffer;return new M.constructor(D,M.byteOffset,M.length)}},function(b,w,v){var O=v(224),M=v(71),I=v(43);b.exports=function(D){return typeof D.constructor!="function"||I(D)?{}:O(M(D))}},function(b,w,v){var O=v(21),M=Object.create,I=function(){function D(){}return function(k){if(!O(k))return{};if(M)return M(k);D.prototype=k;var V=new D;return D.prototype=void 0,V}}();b.exports=I},function(b,w,v){var O=v(226),M=v(41),I=v(42),D=I&&I.isMap,k=D?M(D):O;b.exports=k},function(b,w,v){var O=v(31),M=v(15);b.exports=function(I){return M(I)&&O(I)=="[object Map]"}},function(b,w,v){var O=v(228),M=v(41),I=v(42),D=I&&I.isSet,k=D?M(D):O;b.exports=k},function(b,w,v){var O=v(31),M=v(15);b.exports=function(I){return M(I)&&O(I)=="[object Set]"}},function(b,w,v){v.r(w),v.d(w,"delay",function(){return vh}),v.d(w,"waitUntil",function(){return YE}),v.d(w,"SLIDE_EVENTS",function(){return lr}),v.d(w,"Slide",function(){return to});const O=[];for(let i=0;i<256;i++)O[i]=(i<16?"0":"")+i.toString(16);function M(){const i=4294967295*Math.random()|0,t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(O[255&i]+O[i>>8&255]+O[i>>16&255]+O[i>>24&255]+"-"+O[255&t]+O[t>>8&255]+"-"+O[t>>16&15|64]+O[t>>24&255]+"-"+O[63&e|128]+O[e>>8&255]+"-"+O[e>>16&255]+O[e>>24&255]+O[255&n]+O[n>>8&255]+O[n>>16&255]+O[n>>24&255]).toUpperCase()}var I=v(23);/**
|
|
4067
4067
|
* @license
|
|
4068
4068
|
* Copyright 2010-2021 Three.js Authors
|
|
4069
4069
|
* SPDX-License-Identifier: MIT
|
|
4070
|
-
*/class D{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[t]===void 0&&(n[t]=[]),n[t].indexOf(e)===-1&&n[t].push(e)}hasEventListener(t,e){if(this._listeners===void 0)return!1;const n=this._listeners;return n[t]!==void 0&&n[t].indexOf(e)!==-1}removeEventListener(t,e){if(this._listeners===void 0)return;const n=this._listeners[t];if(n!==void 0){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}}dispatchEvent(t){if(this._listeners===void 0)return;const e=this._listeners[t.type];if(e!==void 0){t.target=this;const n=e.slice(0);for(let r=0,o=n.length;r<o;r++)n[r].call(this,t);t.target=null}}}const k=[];for(let i=0;i<256;i++)k[i]=(i<16?"0":"")+i.toString(16);const z=Math.PI/180,W=180/Math.PI;function Y(){const i=4294967295*Math.random()|0,t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(k[255&i]+k[i>>8&255]+k[i>>16&255]+k[i>>24&255]+"-"+k[255&t]+k[t>>8&255]+"-"+k[t>>16&15|64]+k[t>>24&255]+"-"+k[63&e|128]+k[e>>8&255]+"-"+k[e>>16&255]+k[e>>24&255]+k[255&n]+k[n>>8&255]+k[n>>16&255]+k[n>>24&255]).toUpperCase()}function et(i,t,e){return Math.max(t,Math.min(e,i))}function ft(i,t){return(i%t+t)%t}function Dt(i,t,e){return(1-e)*i+e*t}function At(i){return(i&i-1)==0&&i!==0}function L(i){return Math.pow(2,Math.floor(Math.log(i)/Math.LN2))}class R{constructor(t=0,e=0){this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t,e){return e!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t,e){return e!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6],this.y=r[1]*e+r[4]*n+r[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e,n){return n!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),r=Math.sin(e),o=this.x-t.x,s=this.y-t.y;return this.x=o*n-s*r+t.x,this.y=o*r+s*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}}R.prototype.isVector2=!0;class B{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(t,e,n,r,o,s,a,h,l){const u=this.elements;return u[0]=t,u[1]=r,u[2]=a,u[3]=e,u[4]=o,u[5]=h,u[6]=n,u[7]=s,u[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,r=e.elements,o=this.elements,s=n[0],a=n[3],h=n[6],l=n[1],u=n[4],p=n[7],y=n[2],x=n[5],E=n[8],A=r[0],C=r[3],j=r[6],Q=r[1],rt=r[4],pt=r[7],it=r[2],gt=r[5],ht=r[8];return o[0]=s*A+a*Q+h*it,o[3]=s*C+a*rt+h*gt,o[6]=s*j+a*pt+h*ht,o[1]=l*A+u*Q+p*it,o[4]=l*C+u*rt+p*gt,o[7]=l*j+u*pt+p*ht,o[2]=y*A+x*Q+E*it,o[5]=y*C+x*rt+E*gt,o[8]=y*j+x*pt+E*ht,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[1],r=t[2],o=t[3],s=t[4],a=t[5],h=t[6],l=t[7],u=t[8];return e*s*u-e*a*l-n*o*u+n*a*h+r*o*l-r*s*h}invert(){const t=this.elements,e=t[0],n=t[1],r=t[2],o=t[3],s=t[4],a=t[5],h=t[6],l=t[7],u=t[8],p=u*s-a*l,y=a*h-u*o,x=l*o-s*h,E=e*p+n*y+r*x;if(E===0)return this.set(0,0,0,0,0,0,0,0,0);const A=1/E;return t[0]=p*A,t[1]=(r*l-u*n)*A,t[2]=(a*n-r*s)*A,t[3]=y*A,t[4]=(u*e-r*h)*A,t[5]=(r*o-a*e)*A,t[6]=x*A,t[7]=(n*h-l*e)*A,t[8]=(s*e-n*o)*A,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,r,o,s,a){const h=Math.cos(o),l=Math.sin(o);return this.set(n*h,n*l,-n*(h*s+l*a)+s+t,-r*l,r*h,-r*(-l*s+h*a)+a+e,0,0,1),this}scale(t,e){const n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=e,n[4]*=e,n[7]*=e,this}rotate(t){const e=Math.cos(t),n=Math.sin(t),r=this.elements,o=r[0],s=r[3],a=r[6],h=r[1],l=r[4],u=r[7];return r[0]=e*o+n*h,r[3]=e*s+n*l,r[6]=e*a+n*u,r[1]=-n*o+e*h,r[4]=-n*s+e*l,r[7]=-n*a+e*u,this}translate(t,e){const n=this.elements;return n[0]+=t*n[2],n[3]+=t*n[5],n[6]+=t*n[8],n[1]+=e*n[2],n[4]+=e*n[5],n[7]+=e*n[8],this}equals(t){const e=this.elements,n=t.elements;for(let r=0;r<9;r++)if(e[r]!==n[r])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return new this.constructor().fromArray(this.elements)}}let X;B.prototype.isMatrix3=!0;class P{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement=="undefined")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{X===void 0&&(X=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),X.width=t.width,X.height=t.height;const n=X.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=X}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}}let H=0;class tt extends D{constructor(t=tt.DEFAULT_IMAGE,e=tt.DEFAULT_MAPPING,n=1001,r=1001,o=1006,s=1008,a=1023,h=1009,l=1,u=3e3){super(),Object.defineProperty(this,"id",{value:H++}),this.uuid=Y(),this.name="",this.image=t,this.mipmaps=[],this.mapping=e,this.wrapS=n,this.wrapT=r,this.magFilter=o,this.minFilter=s,this.anisotropy=l,this.format=a,this.internalFormat=null,this.type=h,this.offset=new R(0,0),this.repeat=new R(1,1),this.center=new R(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new B,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=u,this.version=0,this.onUpdate=null}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this}toJSON(t){const e=t===void 0||typeof t=="string";if(!e&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];const n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(this.image!==void 0){const r=this.image;if(r.uuid===void 0&&(r.uuid=Y()),!e&&t.images[r.uuid]===void 0){let o;if(Array.isArray(r)){o=[];for(let s=0,a=r.length;s<a;s++)r[s].isDataTexture?o.push(G(r[s].image)):o.push(G(r[s]))}else o=G(r);t.images[r.uuid]={uuid:r.uuid,url:o}}n.image=r.uuid}return e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==300)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case 1e3:t.x=t.x-Math.floor(t.x);break;case 1001:t.x=t.x<0?0:1;break;case 1002:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case 1e3:t.y=t.y-Math.floor(t.y);break;case 1001:t.y=t.y<0?0:1;break;case 1002:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&this.version++}}function G(i){return typeof HTMLImageElement!="undefined"&&i instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&i instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&i instanceof ImageBitmap?P.getDataURL(i):i.data?{data:Array.prototype.slice.call(i.data),width:i.width,height:i.height,type:i.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}tt.DEFAULT_IMAGE=void 0,tt.DEFAULT_MAPPING=300,tt.prototype.isTexture=!0;class Ot{constructor(t=0,e=0,n=0,r=1){this.x=t,this.y=e,this.z=n,this.w=r}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,r){return this.x=t,this.y=e,this.z=n,this.w=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t,e){return e!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t,e){return e!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,r=this.z,o=this.w,s=t.elements;return this.x=s[0]*e+s[4]*n+s[8]*r+s[12]*o,this.y=s[1]*e+s[5]*n+s[9]*r+s[13]*o,this.z=s[2]*e+s[6]*n+s[10]*r+s[14]*o,this.w=s[3]*e+s[7]*n+s[11]*r+s[15]*o,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,r,o;const s=t.elements,a=s[0],h=s[4],l=s[8],u=s[1],p=s[5],y=s[9],x=s[2],E=s[6],A=s[10];if(Math.abs(h-u)<.01&&Math.abs(l-x)<.01&&Math.abs(y-E)<.01){if(Math.abs(h+u)<.1&&Math.abs(l+x)<.1&&Math.abs(y+E)<.1&&Math.abs(a+p+A-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const j=(a+1)/2,Q=(p+1)/2,rt=(A+1)/2,pt=(h+u)/4,it=(l+x)/4,gt=(y+E)/4;return j>Q&&j>rt?j<.01?(n=0,r=.707106781,o=.707106781):(n=Math.sqrt(j),r=pt/n,o=it/n):Q>rt?Q<.01?(n=.707106781,r=0,o=.707106781):(r=Math.sqrt(Q),n=pt/r,o=gt/r):rt<.01?(n=.707106781,r=.707106781,o=0):(o=Math.sqrt(rt),n=it/o,r=gt/o),this.set(n,r,o,e),this}let C=Math.sqrt((E-y)*(E-y)+(l-x)*(l-x)+(u-h)*(u-h));return Math.abs(C)<.001&&(C=1),this.x=(E-y)/C,this.y=(l-x)/C,this.z=(u-h)/C,this.w=Math.acos((a+p+A-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e,n){return n!==void 0&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}}Ot.prototype.isVector4=!0;class zt extends D{constructor(t,e,n={}){super(),this.width=t,this.height=e,this.depth=1,this.scissor=new Ot(0,0,t,e),this.scissorTest=!1,this.viewport=new Ot(0,0,t,e),this.texture=new tt(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={width:t,height:e,depth:1},this.texture.generateMipmaps=n.generateMipmaps!==void 0&&n.generateMipmaps,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:1006,this.depthBuffer=n.depthBuffer===void 0||n.depthBuffer,this.stencilBuffer=n.stencilBuffer!==void 0&&n.stencilBuffer,this.depthTexture=n.depthTexture!==void 0?n.depthTexture:null}setTexture(t){t.image={width:this.width,height:this.height,depth:this.depth},this.texture=t}setSize(t,e,n=1){this.width===t&&this.height===e&&this.depth===n||(this.width=t,this.height=e,this.depth=n,this.texture.image.width=t,this.texture.image.height=e,this.texture.image.depth=n,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return new this.constructor().copy(this)}copy(t){return this.width=t.width,this.height=t.height,this.depth=t.depth,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.texture.image=Ac({},this.texture.image),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}zt.prototype.isWebGLRenderTarget=!0,class extends zt{constructor(i,t,e){super(i,t);const n=this.texture;this.texture=[];for(let r=0;r<e;r++)this.texture[r]=n.clone()}setSize(i,t,e=1){if(this.width!==i||this.height!==t||this.depth!==e){this.width=i,this.height=t,this.depth=e;for(let n=0,r=this.texture.length;n<r;n++)this.texture[n].image.width=i,this.texture[n].image.height=t,this.texture[n].image.depth=e;this.dispose()}return this.viewport.set(0,0,i,t),this.scissor.set(0,0,i,t),this}copy(i){this.dispose(),this.width=i.width,this.height=i.height,this.depth=i.depth,this.viewport.set(0,0,this.width,this.height),this.scissor.set(0,0,this.width,this.height),this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.depthTexture=i.depthTexture,this.texture.length=0;for(let t=0,e=i.texture.length;t<e;t++)this.texture[t]=i.texture[t].clone();return this}}.prototype.isWebGLMultipleRenderTargets=!0;class st extends zt{constructor(t,e,n){super(t,e,n),this.samples=4}copy(t){return super.copy.call(this,t),this.samples=t.samples,this}}st.prototype.isWebGLMultisampleRenderTarget=!0;class V{constructor(t=0,e=0,n=0,r=1){this._x=t,this._y=e,this._z=n,this._w=r}static slerp(t,e,n,r){return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."),n.slerpQuaternions(t,e,r)}static slerpFlat(t,e,n,r,o,s,a){let h=n[r+0],l=n[r+1],u=n[r+2],p=n[r+3];const y=o[s+0],x=o[s+1],E=o[s+2],A=o[s+3];if(a===0)return t[e+0]=h,t[e+1]=l,t[e+2]=u,void(t[e+3]=p);if(a===1)return t[e+0]=y,t[e+1]=x,t[e+2]=E,void(t[e+3]=A);if(p!==A||h!==y||l!==x||u!==E){let C=1-a;const j=h*y+l*x+u*E+p*A,Q=j>=0?1:-1,rt=1-j*j;if(rt>Number.EPSILON){const it=Math.sqrt(rt),gt=Math.atan2(it,j*Q);C=Math.sin(C*gt)/it,a=Math.sin(a*gt)/it}const pt=a*Q;if(h=h*C+y*pt,l=l*C+x*pt,u=u*C+E*pt,p=p*C+A*pt,C===1-a){const it=1/Math.sqrt(h*h+l*l+u*u+p*p);h*=it,l*=it,u*=it,p*=it}}t[e]=h,t[e+1]=l,t[e+2]=u,t[e+3]=p}static multiplyQuaternionsFlat(t,e,n,r,o,s){const a=n[r],h=n[r+1],l=n[r+2],u=n[r+3],p=o[s],y=o[s+1],x=o[s+2],E=o[s+3];return t[e]=a*E+u*p+h*x-l*y,t[e+1]=h*E+u*y+l*p-a*x,t[e+2]=l*E+u*x+a*y-h*p,t[e+3]=u*E-a*p-h*y-l*x,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const n=t._x,r=t._y,o=t._z,s=t._order,a=Math.cos,h=Math.sin,l=a(n/2),u=a(r/2),p=a(o/2),y=h(n/2),x=h(r/2),E=h(o/2);switch(s){case"XYZ":this._x=y*u*p+l*x*E,this._y=l*x*p-y*u*E,this._z=l*u*E+y*x*p,this._w=l*u*p-y*x*E;break;case"YXZ":this._x=y*u*p+l*x*E,this._y=l*x*p-y*u*E,this._z=l*u*E-y*x*p,this._w=l*u*p+y*x*E;break;case"ZXY":this._x=y*u*p-l*x*E,this._y=l*x*p+y*u*E,this._z=l*u*E+y*x*p,this._w=l*u*p-y*x*E;break;case"ZYX":this._x=y*u*p-l*x*E,this._y=l*x*p+y*u*E,this._z=l*u*E-y*x*p,this._w=l*u*p+y*x*E;break;case"YZX":this._x=y*u*p+l*x*E,this._y=l*x*p+y*u*E,this._z=l*u*E-y*x*p,this._w=l*u*p-y*x*E;break;case"XZY":this._x=y*u*p-l*x*E,this._y=l*x*p-y*u*E,this._z=l*u*E+y*x*p,this._w=l*u*p+y*x*E;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return e!==!1&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,r=Math.sin(n);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],r=e[4],o=e[8],s=e[1],a=e[5],h=e[9],l=e[2],u=e[6],p=e[10],y=n+a+p;if(y>0){const x=.5/Math.sqrt(y+1);this._w=.25/x,this._x=(u-h)*x,this._y=(o-l)*x,this._z=(s-r)*x}else if(n>a&&n>p){const x=2*Math.sqrt(1+n-a-p);this._w=(u-h)/x,this._x=.25*x,this._y=(r+s)/x,this._z=(o+l)/x}else if(a>p){const x=2*Math.sqrt(1+a-n-p);this._w=(o-l)/x,this._x=(r+s)/x,this._y=.25*x,this._z=(h+u)/x}else{const x=2*Math.sqrt(1+p-n-a);this._w=(s-r)/x,this._x=(o+l)/x,this._y=(h+u)/x,this._z=.25*x}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(et(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(n===0)return this;const r=Math.min(1,e/n);return this.slerp(t,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t,e){return e!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,r=t._y,o=t._z,s=t._w,a=e._x,h=e._y,l=e._z,u=e._w;return this._x=n*u+s*a+r*l-o*h,this._y=r*u+s*h+o*a-n*l,this._z=o*u+s*l+n*h-r*a,this._w=s*u-n*a-r*h-o*l,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const n=this._x,r=this._y,o=this._z,s=this._w;let a=s*t._w+n*t._x+r*t._y+o*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=s,this._x=n,this._y=r,this._z=o,this;const h=1-a*a;if(h<=Number.EPSILON){const x=1-e;return this._w=x*s+e*this._w,this._x=x*n+e*this._x,this._y=x*r+e*this._y,this._z=x*o+e*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(h),u=Math.atan2(l,a),p=Math.sin((1-e)*u)/l,y=Math.sin(e*u)/l;return this._w=s*p+this._w*y,this._x=n*p+this._x*y,this._y=r*p+this._y*y,this._z=o*p+this._z*y,this._onChangeCallback(),this}slerpQuaternions(t,e,n){this.copy(t).slerp(e,n)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}}V.prototype.isQuaternion=!0;class U{constructor(t=0,e=0,n=0){this.x=t,this.y=e,this.z=n}set(t,e,n){return n===void 0&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t,e){return e!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t,e){return e!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t,e){return e!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion($.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion($.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,r=this.z,o=t.elements;return this.x=o[0]*e+o[3]*n+o[6]*r,this.y=o[1]*e+o[4]*n+o[7]*r,this.z=o[2]*e+o[5]*n+o[8]*r,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,r=this.z,o=t.elements,s=1/(o[3]*e+o[7]*n+o[11]*r+o[15]);return this.x=(o[0]*e+o[4]*n+o[8]*r+o[12])*s,this.y=(o[1]*e+o[5]*n+o[9]*r+o[13])*s,this.z=(o[2]*e+o[6]*n+o[10]*r+o[14])*s,this}applyQuaternion(t){const e=this.x,n=this.y,r=this.z,o=t.x,s=t.y,a=t.z,h=t.w,l=h*e+s*r-a*n,u=h*n+a*e-o*r,p=h*r+o*n-s*e,y=-o*e-s*n-a*r;return this.x=l*h+y*-o+u*-a-p*-s,this.y=u*h+y*-s+p*-o-l*-a,this.z=p*h+y*-a+l*-s-u*-o,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,n=this.y,r=this.z,o=t.elements;return this.x=o[0]*e+o[4]*n+o[8]*r,this.y=o[1]*e+o[5]*n+o[9]*r,this.z=o[2]*e+o[6]*n+o[10]*r,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t,e){return e!==void 0?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,r=t.y,o=t.z,s=e.x,a=e.y,h=e.z;return this.x=r*h-o*a,this.y=o*s-n*h,this.z=n*a-r*s,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return dt.copy(this).projectOnVector(t),this.sub(dt)}reflect(t){return this.sub(dt.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(et(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return e*e+n*n+r*r}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const r=Math.sin(e)*t;return this.x=r*Math.sin(n),this.y=Math.cos(e)*t,this.z=r*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=r,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e,n){return n!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}}U.prototype.isVector3=!0;const dt=new U,$=new V;class vt{constructor(t=new U(1/0,1/0,1/0),e=new U(-1/0,-1/0,-1/0)){this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){let e=1/0,n=1/0,r=1/0,o=-1/0,s=-1/0,a=-1/0;for(let h=0,l=t.length;h<l;h+=3){const u=t[h],p=t[h+1],y=t[h+2];u<e&&(e=u),p<n&&(n=p),y<r&&(r=y),u>o&&(o=u),p>s&&(s=p),y>a&&(a=y)}return this.min.set(e,n,r),this.max.set(o,s,a),this}setFromBufferAttribute(t){let e=1/0,n=1/0,r=1/0,o=-1/0,s=-1/0,a=-1/0;for(let h=0,l=t.count;h<l;h++){const u=t.getX(h),p=t.getY(h),y=t.getZ(h);u<e&&(e=u),p<n&&(n=p),y<r&&(r=y),u>o&&(o=u),p>s&&(s=p),y>a&&(a=y)}return this.min.set(e,n,r),this.max.set(o,s,a),this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const n=K.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}setFromObject(t){return this.makeEmpty(),this.expandByObject(t)}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t){t.updateWorldMatrix(!1,!1);const e=t.geometry;e!==void 0&&(e.boundingBox===null&&e.computeBoundingBox(),ct.copy(e.boundingBox),ct.applyMatrix4(t.matrixWorld),this.union(ct));const n=t.children;for(let r=0,o=n.length;r<o;r++)this.expandByObject(n[r]);return this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)}intersectsSphere(t){return this.clampPoint(t.center,K),K.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(at),_e.subVectors(this.max,at),nt.subVectors(t.a,at),_t.subVectors(t.b,at),St.subVectors(t.c,at),kt.subVectors(_t,nt),Xt.subVectors(St,_t),Jt.subVectors(nt,St);let e=[0,-kt.z,kt.y,0,-Xt.z,Xt.y,0,-Jt.z,Jt.y,kt.z,0,-kt.x,Xt.z,0,-Xt.x,Jt.z,0,-Jt.x,-kt.y,kt.x,0,-Xt.y,Xt.x,0,-Jt.y,Jt.x,0];return!!Ae(e,nt,_t,St,_e)&&(e=[1,0,0,0,1,0,0,0,1],!!Ae(e,nt,_t,St,_e)&&(Ue.crossVectors(kt,Xt),e=[Ue.x,Ue.y,Ue.z],Ae(e,nt,_t,St,_e)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return K.copy(t).clamp(this.min,this.max).sub(t).length()}getBoundingSphere(t){return this.getCenter(t.center),t.radius=.5*this.getSize(K).length(),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(Lt[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Lt[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Lt[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Lt[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Lt[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Lt[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Lt[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Lt[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Lt)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}vt.prototype.isBox3=!0;const Lt=[new U,new U,new U,new U,new U,new U,new U,new U],K=new U,ct=new vt,nt=new U,_t=new U,St=new U,kt=new U,Xt=new U,Jt=new U,at=new U,_e=new U,Ue=new U,Oe=new U;function Ae(i,t,e,n,r){for(let o=0,s=i.length-3;o<=s;o+=3){Oe.fromArray(i,o);const a=r.x*Math.abs(Oe.x)+r.y*Math.abs(Oe.y)+r.z*Math.abs(Oe.z),h=t.dot(Oe),l=e.dot(Oe),u=n.dot(Oe);if(Math.max(-Math.max(h,l,u),Math.min(h,l,u))>a)return!1}return!0}const ze=new vt,$e=new U,cn=new U,ke=new U;class Ge{constructor(t=new U,e=-1){this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const n=this.center;e!==void 0?n.copy(e):ze.setFromPoints(t).getCenter(n);let r=0;for(let o=0,s=t.length;o<s;o++)r=Math.max(r,n.distanceToSquared(t[o]));return this.radius=Math.sqrt(r),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const n=this.center.distanceToSquared(t);return e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){ke.subVectors(t,this.center);const e=ke.lengthSq();if(e>this.radius*this.radius){const n=Math.sqrt(e),r=.5*(n-this.radius);this.center.add(ke.multiplyScalar(r/n)),this.radius+=r}return this}union(t){return cn.subVectors(t.center,this.center).normalize().multiplyScalar(t.radius),this.expandByPoint($e.copy(t.center).add(cn)),this.expandByPoint($e.copy(t.center).sub(cn)),this}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Rn=new U,re=new U,pe=new U,Ee=new U,ln=new U,In=new U,Kn=new U;class pi{constructor(t=new U,e=new U(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.direction).multiplyScalar(t).add(this.origin)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,Rn)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=Rn.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Rn.copy(this.direction).multiplyScalar(e).add(this.origin),Rn.distanceToSquared(t))}distanceSqToSegment(t,e,n,r){re.copy(t).add(e).multiplyScalar(.5),pe.copy(e).sub(t).normalize(),Ee.copy(this.origin).sub(re);const o=.5*t.distanceTo(e),s=-this.direction.dot(pe),a=Ee.dot(this.direction),h=-Ee.dot(pe),l=Ee.lengthSq(),u=Math.abs(1-s*s);let p,y,x,E;if(u>0)if(p=s*h-a,y=s*a-h,E=o*u,p>=0)if(y>=-E)if(y<=E){const A=1/u;p*=A,y*=A,x=p*(p+s*y+2*a)+y*(s*p+y+2*h)+l}else y=o,p=Math.max(0,-(s*y+a)),x=-p*p+y*(y+2*h)+l;else y=-o,p=Math.max(0,-(s*y+a)),x=-p*p+y*(y+2*h)+l;else y<=-E?(p=Math.max(0,-(-s*o+a)),y=p>0?-o:Math.min(Math.max(-o,-h),o),x=-p*p+y*(y+2*h)+l):y<=E?(p=0,y=Math.min(Math.max(-o,-h),o),x=y*(y+2*h)+l):(p=Math.max(0,-(s*o+a)),y=p>0?o:Math.min(Math.max(-o,-h),o),x=-p*p+y*(y+2*h)+l);else y=s>0?-o:o,p=Math.max(0,-(s*y+a)),x=-p*p+y*(y+2*h)+l;return n&&n.copy(this.direction).multiplyScalar(p).add(this.origin),r&&r.copy(pe).multiplyScalar(y).add(re),x}intersectSphere(t,e){Rn.subVectors(t.center,this.origin);const n=Rn.dot(this.direction),r=Rn.dot(Rn)-n*n,o=t.radius*t.radius;if(r>o)return null;const s=Math.sqrt(o-r),a=n-s,h=n+s;return a<0&&h<0?null:a<0?this.at(h,e):this.at(a,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);return n===null?null:this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return e===0?!0:t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,r,o,s,a,h;const l=1/this.direction.x,u=1/this.direction.y,p=1/this.direction.z,y=this.origin;return l>=0?(n=(t.min.x-y.x)*l,r=(t.max.x-y.x)*l):(n=(t.max.x-y.x)*l,r=(t.min.x-y.x)*l),u>=0?(o=(t.min.y-y.y)*u,s=(t.max.y-y.y)*u):(o=(t.max.y-y.y)*u,s=(t.min.y-y.y)*u),n>s||o>r?null:((o>n||n!=n)&&(n=o),(s<r||r!=r)&&(r=s),p>=0?(a=(t.min.z-y.z)*p,h=(t.max.z-y.z)*p):(a=(t.max.z-y.z)*p,h=(t.min.z-y.z)*p),n>h||a>r?null:((a>n||n!=n)&&(n=a),(h<r||r!=r)&&(r=h),r<0?null:this.at(n>=0?n:r,e)))}intersectsBox(t){return this.intersectBox(t,Rn)!==null}intersectTriangle(t,e,n,r,o){ln.subVectors(e,t),In.subVectors(n,t),Kn.crossVectors(ln,In);let s,a=this.direction.dot(Kn);if(a>0){if(r)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}Ee.subVectors(this.origin,t);const h=s*this.direction.dot(In.crossVectors(Ee,In));if(h<0)return null;const l=s*this.direction.dot(ln.cross(Ee));if(l<0||h+l>a)return null;const u=-s*Ee.dot(Kn);return u<0?null:this.at(u/a,o)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class tn{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(t,e,n,r,o,s,a,h,l,u,p,y,x,E,A,C){const j=this.elements;return j[0]=t,j[4]=e,j[8]=n,j[12]=r,j[1]=o,j[5]=s,j[9]=a,j[13]=h,j[2]=l,j[6]=u,j[10]=p,j[14]=y,j[3]=x,j[7]=E,j[11]=A,j[15]=C,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new tn().fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){const e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,n=t.elements,r=1/yt.setFromMatrixColumn(t,0).length(),o=1/yt.setFromMatrixColumn(t,1).length(),s=1/yt.setFromMatrixColumn(t,2).length();return e[0]=n[0]*r,e[1]=n[1]*r,e[2]=n[2]*r,e[3]=0,e[4]=n[4]*o,e[5]=n[5]*o,e[6]=n[6]*o,e[7]=0,e[8]=n[8]*s,e[9]=n[9]*s,e[10]=n[10]*s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const e=this.elements,n=t.x,r=t.y,o=t.z,s=Math.cos(n),a=Math.sin(n),h=Math.cos(r),l=Math.sin(r),u=Math.cos(o),p=Math.sin(o);if(t.order==="XYZ"){const y=s*u,x=s*p,E=a*u,A=a*p;e[0]=h*u,e[4]=-h*p,e[8]=l,e[1]=x+E*l,e[5]=y-A*l,e[9]=-a*h,e[2]=A-y*l,e[6]=E+x*l,e[10]=s*h}else if(t.order==="YXZ"){const y=h*u,x=h*p,E=l*u,A=l*p;e[0]=y+A*a,e[4]=E*a-x,e[8]=s*l,e[1]=s*p,e[5]=s*u,e[9]=-a,e[2]=x*a-E,e[6]=A+y*a,e[10]=s*h}else if(t.order==="ZXY"){const y=h*u,x=h*p,E=l*u,A=l*p;e[0]=y-A*a,e[4]=-s*p,e[8]=E+x*a,e[1]=x+E*a,e[5]=s*u,e[9]=A-y*a,e[2]=-s*l,e[6]=a,e[10]=s*h}else if(t.order==="ZYX"){const y=s*u,x=s*p,E=a*u,A=a*p;e[0]=h*u,e[4]=E*l-x,e[8]=y*l+A,e[1]=h*p,e[5]=A*l+y,e[9]=x*l-E,e[2]=-l,e[6]=a*h,e[10]=s*h}else if(t.order==="YZX"){const y=s*h,x=s*l,E=a*h,A=a*l;e[0]=h*u,e[4]=A-y*p,e[8]=E*p+x,e[1]=p,e[5]=s*u,e[9]=-a*u,e[2]=-l*u,e[6]=x*p+E,e[10]=y-A*p}else if(t.order==="XZY"){const y=s*h,x=s*l,E=a*h,A=a*l;e[0]=h*u,e[4]=-p,e[8]=l*u,e[1]=y*p+A,e[5]=s*u,e[9]=x*p-E,e[2]=E*p-x,e[6]=a*u,e[10]=A*p+y}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(Rt,t,Qt)}lookAt(t,e,n){const r=this.elements;return oe.subVectors(t,e),oe.lengthSq()===0&&(oe.z=1),oe.normalize(),Wt.crossVectors(n,oe),Wt.lengthSq()===0&&(Math.abs(n.z)===1?oe.x+=1e-4:oe.z+=1e-4,oe.normalize(),Wt.crossVectors(n,oe)),Wt.normalize(),Kt.crossVectors(oe,Wt),r[0]=Wt.x,r[4]=Kt.x,r[8]=oe.x,r[1]=Wt.y,r[5]=Kt.y,r[9]=oe.y,r[2]=Wt.z,r[6]=Kt.z,r[10]=oe.z,this}multiply(t,e){return e!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,r=e.elements,o=this.elements,s=n[0],a=n[4],h=n[8],l=n[12],u=n[1],p=n[5],y=n[9],x=n[13],E=n[2],A=n[6],C=n[10],j=n[14],Q=n[3],rt=n[7],pt=n[11],it=n[15],gt=r[0],ht=r[4],mt=r[8],jt=r[12],Ft=r[1],Mt=r[5],wt=r[9],Pt=r[13],Nt=r[2],ne=r[6],$t=r[10],Vt=r[14],Yt=r[3],ge=r[7],be=r[11],Pe=r[15];return o[0]=s*gt+a*Ft+h*Nt+l*Yt,o[4]=s*ht+a*Mt+h*ne+l*ge,o[8]=s*mt+a*wt+h*$t+l*be,o[12]=s*jt+a*Pt+h*Vt+l*Pe,o[1]=u*gt+p*Ft+y*Nt+x*Yt,o[5]=u*ht+p*Mt+y*ne+x*ge,o[9]=u*mt+p*wt+y*$t+x*be,o[13]=u*jt+p*Pt+y*Vt+x*Pe,o[2]=E*gt+A*Ft+C*Nt+j*Yt,o[6]=E*ht+A*Mt+C*ne+j*ge,o[10]=E*mt+A*wt+C*$t+j*be,o[14]=E*jt+A*Pt+C*Vt+j*Pe,o[3]=Q*gt+rt*Ft+pt*Nt+it*Yt,o[7]=Q*ht+rt*Mt+pt*ne+it*ge,o[11]=Q*mt+rt*wt+pt*$t+it*be,o[15]=Q*jt+rt*Pt+pt*Vt+it*Pe,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[4],r=t[8],o=t[12],s=t[1],a=t[5],h=t[9],l=t[13],u=t[2],p=t[6],y=t[10],x=t[14];return t[3]*(+o*h*p-r*l*p-o*a*y+n*l*y+r*a*x-n*h*x)+t[7]*(+e*h*x-e*l*y+o*s*y-r*s*x+r*l*u-o*h*u)+t[11]*(+e*l*p-e*a*x-o*s*p+n*s*x+o*a*u-n*l*u)+t[15]*(-r*a*u-e*h*p+e*a*y+r*s*p-n*s*y+n*h*u)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){const r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=n),this}invert(){const t=this.elements,e=t[0],n=t[1],r=t[2],o=t[3],s=t[4],a=t[5],h=t[6],l=t[7],u=t[8],p=t[9],y=t[10],x=t[11],E=t[12],A=t[13],C=t[14],j=t[15],Q=p*C*l-A*y*l+A*h*x-a*C*x-p*h*j+a*y*j,rt=E*y*l-u*C*l-E*h*x+s*C*x+u*h*j-s*y*j,pt=u*A*l-E*p*l+E*a*x-s*A*x-u*a*j+s*p*j,it=E*p*h-u*A*h-E*a*y+s*A*y+u*a*C-s*p*C,gt=e*Q+n*rt+r*pt+o*it;if(gt===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const ht=1/gt;return t[0]=Q*ht,t[1]=(A*y*o-p*C*o-A*r*x+n*C*x+p*r*j-n*y*j)*ht,t[2]=(a*C*o-A*h*o+A*r*l-n*C*l-a*r*j+n*h*j)*ht,t[3]=(p*h*o-a*y*o-p*r*l+n*y*l+a*r*x-n*h*x)*ht,t[4]=rt*ht,t[5]=(u*C*o-E*y*o+E*r*x-e*C*x-u*r*j+e*y*j)*ht,t[6]=(E*h*o-s*C*o-E*r*l+e*C*l+s*r*j-e*h*j)*ht,t[7]=(s*y*o-u*h*o+u*r*l-e*y*l-s*r*x+e*h*x)*ht,t[8]=pt*ht,t[9]=(E*p*o-u*A*o-E*n*x+e*A*x+u*n*j-e*p*j)*ht,t[10]=(s*A*o-E*a*o+E*n*l-e*A*l-s*n*j+e*a*j)*ht,t[11]=(u*a*o-s*p*o-u*n*l+e*p*l+s*n*x-e*a*x)*ht,t[12]=it*ht,t[13]=(u*A*r-E*p*r+E*n*y-e*A*y-u*n*C+e*p*C)*ht,t[14]=(E*a*r-s*A*r-E*n*h+e*A*h+s*n*C-e*a*C)*ht,t[15]=(s*p*r-u*a*r+u*n*h-e*p*h-s*n*y+e*a*y)*ht,this}scale(t){const e=this.elements,n=t.x,r=t.y,o=t.z;return e[0]*=n,e[4]*=r,e[8]*=o,e[1]*=n,e[5]*=r,e[9]*=o,e[2]*=n,e[6]*=r,e[10]*=o,e[3]*=n,e[7]*=r,e[11]*=o,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,r))}makeTranslation(t,e,n){return this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),r=Math.sin(e),o=1-n,s=t.x,a=t.y,h=t.z,l=o*s,u=o*a;return this.set(l*s+n,l*a-r*h,l*h+r*a,0,l*a+r*h,u*a+n,u*h-r*s,0,l*h-r*a,u*h+r*s,o*h*h+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,r,o,s){return this.set(1,n,o,0,t,1,s,0,e,r,1,0,0,0,0,1),this}compose(t,e,n){const r=this.elements,o=e._x,s=e._y,a=e._z,h=e._w,l=o+o,u=s+s,p=a+a,y=o*l,x=o*u,E=o*p,A=s*u,C=s*p,j=a*p,Q=h*l,rt=h*u,pt=h*p,it=n.x,gt=n.y,ht=n.z;return r[0]=(1-(A+j))*it,r[1]=(x+pt)*it,r[2]=(E-rt)*it,r[3]=0,r[4]=(x-pt)*gt,r[5]=(1-(y+j))*gt,r[6]=(C+Q)*gt,r[7]=0,r[8]=(E+rt)*ht,r[9]=(C-Q)*ht,r[10]=(1-(y+A))*ht,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this}decompose(t,e,n){const r=this.elements;let o=yt.set(r[0],r[1],r[2]).length();const s=yt.set(r[4],r[5],r[6]).length(),a=yt.set(r[8],r[9],r[10]).length();this.determinant()<0&&(o=-o),t.x=r[12],t.y=r[13],t.z=r[14],Et.copy(this);const h=1/o,l=1/s,u=1/a;return Et.elements[0]*=h,Et.elements[1]*=h,Et.elements[2]*=h,Et.elements[4]*=l,Et.elements[5]*=l,Et.elements[6]*=l,Et.elements[8]*=u,Et.elements[9]*=u,Et.elements[10]*=u,e.setFromRotationMatrix(Et),n.x=o,n.y=s,n.z=a,this}makePerspective(t,e,n,r,o,s){s===void 0&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const a=this.elements,h=2*o/(e-t),l=2*o/(n-r),u=(e+t)/(e-t),p=(n+r)/(n-r),y=-(s+o)/(s-o),x=-2*s*o/(s-o);return a[0]=h,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=l,a[9]=p,a[13]=0,a[2]=0,a[6]=0,a[10]=y,a[14]=x,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(t,e,n,r,o,s){const a=this.elements,h=1/(e-t),l=1/(n-r),u=1/(s-o),p=(e+t)*h,y=(n+r)*l,x=(s+o)*u;return a[0]=2*h,a[4]=0,a[8]=0,a[12]=-p,a[1]=0,a[5]=2*l,a[9]=0,a[13]=-y,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-x,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(t){const e=this.elements,n=t.elements;for(let r=0;r<16;r++)if(e[r]!==n[r])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}tn.prototype.isMatrix4=!0;const yt=new U,Et=new tn,Rt=new U(0,0,0),Qt=new U(1,1,1),Wt=new U,Kt=new U,oe=new U,Me=new tn,we=new V;class Se{constructor(t=0,e=0,n=0,r=Se.DefaultOrder){this._x=t,this._y=e,this._z=n,this._order=r}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,r=this._order){return this._x=t,this._y=e,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){const r=t.elements,o=r[0],s=r[4],a=r[8],h=r[1],l=r[5],u=r[9],p=r[2],y=r[6],x=r[10];switch(e){case"XYZ":this._y=Math.asin(et(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,x),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(y,l),this._z=0);break;case"YXZ":this._x=Math.asin(-et(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,x),this._z=Math.atan2(h,l)):(this._y=Math.atan2(-p,o),this._z=0);break;case"ZXY":this._x=Math.asin(et(y,-1,1)),Math.abs(y)<.9999999?(this._y=Math.atan2(-p,x),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(h,o));break;case"ZYX":this._y=Math.asin(-et(p,-1,1)),Math.abs(p)<.9999999?(this._x=Math.atan2(y,x),this._z=Math.atan2(h,o)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(et(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-p,o)):(this._x=0,this._y=Math.atan2(a,x));break;case"XZY":this._z=Math.asin(-et(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(y,l),this._y=Math.atan2(a,o)):(this._x=Math.atan2(-u,x),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,n===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return Me.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Me,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return we.setFromEuler(this),this.setFromQuaternion(we,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}toVector3(t){return t?t.set(this._x,this._y,this._z):new U(this._x,this._y,this._z)}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}}Se.prototype.isEuler=!0,Se.DefaultOrder="XYZ",Se.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class Ve{constructor(){this.mask=1}set(t){this.mask=1<<t|0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!=0}}let en=0;const dn=new U,Tn=new V,yn=new tn,Xn=new U,Pn=new U,zi=new U,mo=new V,io=new U(1,0,0),Fn=new U(0,1,0),Yo=new U(0,0,1),ro={type:"added"},go={type:"removed"};class Un extends D{constructor(){super(),Object.defineProperty(this,"id",{value:en++}),this.uuid=Y(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Un.DefaultUp.clone();const t=new U,e=new Se,n=new V,r=new U(1,1,1);e._onChange(function(){n.setFromEuler(e,!1)}),n._onChange(function(){e.setFromQuaternion(n,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new tn},normalMatrix:{value:new B}}),this.matrix=new tn,this.matrixWorld=new tn,this.matrixAutoUpdate=Un.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new Ve,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return Tn.setFromAxisAngle(t,e),this.quaternion.multiply(Tn),this}rotateOnWorldAxis(t,e){return Tn.setFromAxisAngle(t,e),this.quaternion.premultiply(Tn),this}rotateX(t){return this.rotateOnAxis(io,t)}rotateY(t){return this.rotateOnAxis(Fn,t)}rotateZ(t){return this.rotateOnAxis(Yo,t)}translateOnAxis(t,e){return dn.copy(t).applyQuaternion(this.quaternion),this.position.add(dn.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(io,t)}translateY(t){return this.translateOnAxis(Fn,t)}translateZ(t){return this.translateOnAxis(Yo,t)}localToWorld(t){return t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return t.applyMatrix4(yn.copy(this.matrixWorld).invert())}lookAt(t,e,n){t.isVector3?Xn.copy(t):Xn.set(t,e,n);const r=this.parent;this.updateWorldMatrix(!0,!1),Pn.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?yn.lookAt(Pn,Xn,this.up):yn.lookAt(Xn,Pn,this.up),this.quaternion.setFromRotationMatrix(yn),r&&(yn.extractRotation(r.matrixWorld),Tn.setFromRotationMatrix(yn),this.quaternion.premultiply(Tn.invert()))}add(t){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(t.parent!==null&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent(ro)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const e=this.children.indexOf(t);return e!==-1&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(go)),this}removeFromParent(){const t=this.parent;return t!==null&&t.remove(this),this}clear(){for(let t=0;t<this.children.length;t++){const e=this.children[t];e.parent=null,e.dispatchEvent(go)}return this.children.length=0,this}attach(t){return this.updateWorldMatrix(!0,!1),yn.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),yn.multiply(t.parent.matrixWorld)),t.applyMatrix4(yn),this.add(t),t.updateWorldMatrix(!1,!0),this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let n=0,r=this.children.length;n<r;n++){const o=this.children[n].getObjectByProperty(t,e);if(o!==void 0)return o}}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Pn,t,zi),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Pn,mo,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let n=0,r=e.length;n<r;n++)e[n].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);const e=this.children;for(let n=0,r=e.length;n<r;n++)e[n].traverseVisible(t)}traverseAncestors(t){const e=this.parent;e!==null&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let n=0,r=e.length;n<r;n++)e[n].updateMatrixWorld(t)}updateWorldMatrix(t,e){const n=this.parent;if(t===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),e===!0){const r=this.children;for(let o=0,s=r.length;o<s;o++)r[o].updateWorldMatrix(!1,!0)}}toJSON(t){const e=t===void 0||typeof t=="string",n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});const r={};function o(a,h){return a[h.uuid]===void 0&&(a[h.uuid]=h.toJSON(t)),h.uuid}if(r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),JSON.stringify(this.userData)!=="{}"&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&(r.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=o(t.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const h=a.shapes;if(Array.isArray(h))for(let l=0,u=h.length;l<u;l++){const p=h[l];o(t.shapes,p)}else o(t.shapes,h)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(o(t.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const a=[];for(let h=0,l=this.material.length;h<l;h++)a.push(o(t.materials,this.material[h]));r.material=a}else r.material=o(t.materials,this.material);if(this.children.length>0){r.children=[];for(let a=0;a<this.children.length;a++)r.children.push(this.children[a].toJSON(t).object)}if(this.animations.length>0){r.animations=[];for(let a=0;a<this.animations.length;a++){const h=this.animations[a];r.animations.push(o(t.animations,h))}}if(e){const a=s(t.geometries),h=s(t.materials),l=s(t.textures),u=s(t.images),p=s(t.shapes),y=s(t.skeletons),x=s(t.animations);a.length>0&&(n.geometries=a),h.length>0&&(n.materials=h),l.length>0&&(n.textures=l),u.length>0&&(n.images=u),p.length>0&&(n.shapes=p),y.length>0&&(n.skeletons=y),x.length>0&&(n.animations=x)}return n.object=r,n;function s(a){const h=[];for(const l in a){const u=a[l];delete u.metadata,h.push(u)}return h}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(let n=0;n<t.children.length;n++){const r=t.children[n];this.add(r.clone())}return this}}Un.DefaultUp=new U(0,1,0),Un.DefaultMatrixAutoUpdate=!0,Un.prototype.isObject3D=!0;const jn=new U,Ki=new U,Vr=new U,Mi=new U,wr=new U,Lr=new U,qo=new U,Jo=new U,vo=new U,_o=new U;class ui{constructor(t=new U,e=new U,n=new U){this.a=t,this.b=e,this.c=n}static getNormal(t,e,n,r){r.subVectors(n,e),jn.subVectors(t,e),r.cross(jn);const o=r.lengthSq();return o>0?r.multiplyScalar(1/Math.sqrt(o)):r.set(0,0,0)}static getBarycoord(t,e,n,r,o){jn.subVectors(r,e),Ki.subVectors(n,e),Vr.subVectors(t,e);const s=jn.dot(jn),a=jn.dot(Ki),h=jn.dot(Vr),l=Ki.dot(Ki),u=Ki.dot(Vr),p=s*l-a*a;if(p===0)return o.set(-2,-1,-1);const y=1/p,x=(l*h-a*u)*y,E=(s*u-a*h)*y;return o.set(1-x-E,E,x)}static containsPoint(t,e,n,r){return this.getBarycoord(t,e,n,r,Mi),Mi.x>=0&&Mi.y>=0&&Mi.x+Mi.y<=1}static getUV(t,e,n,r,o,s,a,h){return this.getBarycoord(t,e,n,r,Mi),h.set(0,0),h.addScaledVector(o,Mi.x),h.addScaledVector(s,Mi.y),h.addScaledVector(a,Mi.z),h}static isFrontFacing(t,e,n,r){return jn.subVectors(n,e),Ki.subVectors(t,e),jn.cross(Ki).dot(r)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,r){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[r]),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return jn.subVectors(this.c,this.b),Ki.subVectors(this.a,this.b),.5*jn.cross(Ki).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return ui.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return ui.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,n,r,o){return ui.getUV(t,this.a,this.b,this.c,e,n,r,o)}containsPoint(t){return ui.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return ui.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const n=this.a,r=this.b,o=this.c;let s,a;wr.subVectors(r,n),Lr.subVectors(o,n),Jo.subVectors(t,n);const h=wr.dot(Jo),l=Lr.dot(Jo);if(h<=0&&l<=0)return e.copy(n);vo.subVectors(t,r);const u=wr.dot(vo),p=Lr.dot(vo);if(u>=0&&p<=u)return e.copy(r);const y=h*p-u*l;if(y<=0&&h>=0&&u<=0)return s=h/(h-u),e.copy(n).addScaledVector(wr,s);_o.subVectors(t,o);const x=wr.dot(_o),E=Lr.dot(_o);if(E>=0&&x<=E)return e.copy(o);const A=x*l-h*E;if(A<=0&&l>=0&&E<=0)return a=l/(l-E),e.copy(n).addScaledVector(Lr,a);const C=u*E-x*p;if(C<=0&&p-u>=0&&x-E>=0)return qo.subVectors(o,r),a=(p-u)/(p-u+(x-E)),e.copy(r).addScaledVector(qo,a);const j=1/(C+A+y);return s=A*j,a=y*j,e.copy(n).addScaledVector(wr,s).addScaledVector(Lr,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}let Ko=0;class Ci extends D{constructor(){super(),Object.defineProperty(this,"id",{value:Ko++}),this.uuid=Y(),this.name="",this.type="Material",this.fog=!0,this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=7680,this.stencilZFail=7680,this.stencilZPass=7680,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}onBuild(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const e in t){const n=t[e];if(n===void 0){console.warn("THREE.Material: '"+e+"' parameter is undefined.");continue}if(e==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===1;continue}const r=this[e];r!==void 0?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[e]=n:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}}toJSON(t){const e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});const n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(o){const s=[];for(const a in o){const h=o[a];delete h.metadata,s.push(h)}return s}if(n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==1&&(n.blending=this.blending),this.side!==0&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(n.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.morphTargets===!0&&(n.morphTargets=!0),this.morphNormals===!0&&(n.morphNormals=!0),this.flatShading===!0&&(n.flatShading=this.flatShading),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData),e){const o=r(t.textures),s=r(t.images);o.length>0&&(n.textures=o),s.length>0&&(n.images=s)}return n}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let n=null;if(e!==null){const r=e.length;n=new Array(r);for(let o=0;o!==r;++o)n[o]=e[o].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}}Ci.prototype.isMaterial=!0;const mr={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Pi={h:0,s:0,l:0},Dr={h:0,s:0,l:0};function yo(i,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?i+6*(t-i)*e:e<.5?t:e<2/3?i+6*(t-i)*(2/3-e):i}function oo(i){return i<.04045?.0773993808*i:Math.pow(.9478672986*i+.0521327014,2.4)}function xo(i){return i<.0031308?12.92*i:1.055*Math.pow(i,.41666)-.055}class fn{constructor(t,e,n){return e===void 0&&n===void 0?this.set(t):this.setRGB(t,e,n)}set(t){return t&&t.isColor?this.copy(t):typeof t=="number"?this.setHex(t):typeof t=="string"&&this.setStyle(t),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this}setRGB(t,e,n){return this.r=t,this.g=e,this.b=n,this}setHSL(t,e,n){if(t=ft(t,1),e=et(e,0,1),n=et(n,0,1),e===0)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+e):n+e-n*e,o=2*n-r;this.r=yo(o,r,t+1/3),this.g=yo(o,r,t),this.b=yo(o,r,t-1/3)}return this}setStyle(t){function e(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let r;const o=n[1],s=n[2];switch(o){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,e(r[4]),this;if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,e(r[4]),this;break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s)){const a=parseFloat(r[1])/360,h=parseInt(r[2],10)/100,l=parseInt(r[3],10)/100;return e(r[4]),this.setHSL(a,h,l)}}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(t)){const r=n[1],o=r.length;if(o===3)return this.r=parseInt(r.charAt(0)+r.charAt(0),16)/255,this.g=parseInt(r.charAt(1)+r.charAt(1),16)/255,this.b=parseInt(r.charAt(2)+r.charAt(2),16)/255,this;if(o===6)return this.r=parseInt(r.charAt(0)+r.charAt(1),16)/255,this.g=parseInt(r.charAt(2)+r.charAt(3),16)/255,this.b=parseInt(r.charAt(4)+r.charAt(5),16)/255,this}return t&&t.length>0?this.setColorName(t):this}setColorName(t){const e=mr[t.toLowerCase()];return e!==void 0?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copyGammaToLinear(t,e=2){return this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this}copyLinearToGamma(t,e=2){const n=e>0?1/e:1;return this.r=Math.pow(t.r,n),this.g=Math.pow(t.g,n),this.b=Math.pow(t.b,n),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.r=oo(t.r),this.g=oo(t.g),this.b=oo(t.b),this}copyLinearToSRGB(t){return this.r=xo(t.r),this.g=xo(t.g),this.b=xo(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(t){const e=this.r,n=this.g,r=this.b,o=Math.max(e,n,r),s=Math.min(e,n,r);let a,h;const l=(s+o)/2;if(s===o)a=0,h=0;else{const u=o-s;switch(h=l<=.5?u/(o+s):u/(2-o-s),o){case e:a=(n-r)/u+(n<r?6:0);break;case n:a=(r-e)/u+2;break;case r:a=(e-n)/u+4}a/=6}return t.h=a,t.s=h,t.l=l,t}getStyle(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"}offsetHSL(t,e,n){return this.getHSL(Pi),Pi.h+=t,Pi.s+=e,Pi.l+=n,this.setHSL(Pi.h,Pi.s,Pi.l),this}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,n){return this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}lerpHSL(t,e){this.getHSL(Pi),t.getHSL(Dr);const n=Dt(Pi.h,Dr.h,e),r=Dt(Pi.s,Dr.s,e),o=Dt(Pi.l,Dr.l,e);return this.setHSL(n,r,o),this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),t.normalized===!0&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}}fn.NAMES=mr,fn.prototype.isColor=!0,fn.prototype.r=1,fn.prototype.g=1,fn.prototype.b=1;class Zi extends Ci{constructor(t){super(),this.type="MeshBasicMaterial",this.color=new fn(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.morphTargets=t.morphTargets,this}}Zi.prototype.isMeshBasicMaterial=!0;const Mn=new U,bo=new R;class Yn{constructor(t,e,n){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=n===!0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let r=0,o=this.itemSize;r<o;r++)this.array[t+r]=e.array[n+r];return this}copyArray(t){return this.array.set(t),this}copyColorsArray(t){const e=this.array;let n=0;for(let r=0,o=t.length;r<o;r++){let s=t[r];s===void 0&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),s=new fn),e[n++]=s.r,e[n++]=s.g,e[n++]=s.b}return this}copyVector2sArray(t){const e=this.array;let n=0;for(let r=0,o=t.length;r<o;r++){let s=t[r];s===void 0&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),s=new R),e[n++]=s.x,e[n++]=s.y}return this}copyVector3sArray(t){const e=this.array;let n=0;for(let r=0,o=t.length;r<o;r++){let s=t[r];s===void 0&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),s=new U),e[n++]=s.x,e[n++]=s.y,e[n++]=s.z}return this}copyVector4sArray(t){const e=this.array;let n=0;for(let r=0,o=t.length;r<o;r++){let s=t[r];s===void 0&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),s=new Ot),e[n++]=s.x,e[n++]=s.y,e[n++]=s.z,e[n++]=s.w}return this}applyMatrix3(t){if(this.itemSize===2)for(let e=0,n=this.count;e<n;e++)bo.fromBufferAttribute(this,e),bo.applyMatrix3(t),this.setXY(e,bo.x,bo.y);else if(this.itemSize===3)for(let e=0,n=this.count;e<n;e++)Mn.fromBufferAttribute(this,e),Mn.applyMatrix3(t),this.setXYZ(e,Mn.x,Mn.y,Mn.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)Mn.x=this.getX(e),Mn.y=this.getY(e),Mn.z=this.getZ(e),Mn.applyMatrix4(t),this.setXYZ(e,Mn.x,Mn.y,Mn.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)Mn.x=this.getX(e),Mn.y=this.getY(e),Mn.z=this.getZ(e),Mn.applyNormalMatrix(t),this.setXYZ(e,Mn.x,Mn.y,Mn.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)Mn.x=this.getX(e),Mn.y=this.getY(e),Mn.z=this.getZ(e),Mn.transformDirection(t),this.setXYZ(e,Mn.x,Mn.y,Mn.z);return this}set(t,e=0){return this.array.set(t,e),this}getX(t){return this.array[t*this.itemSize]}setX(t,e){return this.array[t*this.itemSize]=e,this}getY(t){return this.array[t*this.itemSize+1]}setY(t,e){return this.array[t*this.itemSize+1]=e,this}getZ(t){return this.array[t*this.itemSize+2]}setZ(t,e){return this.array[t*this.itemSize+2]=e,this}getW(t){return this.array[t*this.itemSize+3]}setW(t,e){return this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this}setXYZ(t,e,n,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this}setXYZW(t,e,n,r,o){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this.array[t+3]=o,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized};return this.name!==""&&(t.name=this.name),this.usage!==35044&&(t.usage=this.usage),this.updateRange.offset===0&&this.updateRange.count===-1||(t.updateRange=this.updateRange),t}}Yn.prototype.isBufferAttribute=!0;class vs extends Yn{constructor(t,e,n){super(new Uint16Array(t),e,n)}}class ea extends Yn{constructor(t,e,n){super(new Int32Array(t),e,n)}}class To extends Yn{constructor(t,e,n){super(new Uint32Array(t),e,n)}}(class extends Yn{constructor(i,t,e){super(new Uint16Array(i),t,e)}}).prototype.isFloat16BufferAttribute=!0;class An extends Yn{constructor(t,e,n){super(new Float32Array(t),e,n)}}function _s(i){if(i.length===0)return-1/0;let t=i[0];for(let e=1,n=i.length;e<n;++e)i[e]>t&&(t=i[e]);return t}let Zo=0;const xi=new tn,Qo=new Un,gr=new U,Oi=new vt,so=new vt,fi=new U;class Wn extends D{constructor(){super(),Object.defineProperty(this,"id",{value:Zo++}),this.uuid=Y(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(_s(t)>65535?To:vs)(t,1):this.index=t,this}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return this.attributes[t]!==void 0}addGroup(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){const e=this.attributes.position;e!==void 0&&(e.applyMatrix4(t),e.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const o=new B().getNormalMatrix(t);n.applyNormalMatrix(o),n.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(t),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(t){return xi.makeRotationFromQuaternion(t),this.applyMatrix4(xi),this}rotateX(t){return xi.makeRotationX(t),this.applyMatrix4(xi),this}rotateY(t){return xi.makeRotationY(t),this.applyMatrix4(xi),this}rotateZ(t){return xi.makeRotationZ(t),this.applyMatrix4(xi),this}translate(t,e,n){return xi.makeTranslation(t,e,n),this.applyMatrix4(xi),this}scale(t,e,n){return xi.makeScale(t,e,n),this.applyMatrix4(xi),this}lookAt(t){return Qo.lookAt(t),Qo.updateMatrix(),this.applyMatrix4(Qo.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(gr).negate(),this.translate(gr.x,gr.y,gr.z),this}setFromPoints(t){const e=[];for(let n=0,r=t.length;n<r;n++){const o=t[n];e.push(o.x,o.y,o.z||0)}return this.setAttribute("position",new An(e,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new vt);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingBox.set(new U(-1/0,-1/0,-1/0),new U(1/0,1/0,1/0));if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let n=0,r=e.length;n<r;n++){const o=e[n];Oi.setFromBufferAttribute(o),this.morphTargetsRelative?(fi.addVectors(this.boundingBox.min,Oi.min),this.boundingBox.expandByPoint(fi),fi.addVectors(this.boundingBox.max,Oi.max),this.boundingBox.expandByPoint(fi)):(this.boundingBox.expandByPoint(Oi.min),this.boundingBox.expandByPoint(Oi.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Ge);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingSphere.set(new U,1/0);if(t){const n=this.boundingSphere.center;if(Oi.setFromBufferAttribute(t),e)for(let o=0,s=e.length;o<s;o++){const a=e[o];so.setFromBufferAttribute(a),this.morphTargetsRelative?(fi.addVectors(Oi.min,so.min),Oi.expandByPoint(fi),fi.addVectors(Oi.max,so.max),Oi.expandByPoint(fi)):(Oi.expandByPoint(so.min),Oi.expandByPoint(so.max))}Oi.getCenter(n);let r=0;for(let o=0,s=t.count;o<s;o++)fi.fromBufferAttribute(t,o),r=Math.max(r,n.distanceToSquared(fi));if(e)for(let o=0,s=e.length;o<s;o++){const a=e[o],h=this.morphTargetsRelative;for(let l=0,u=a.count;l<u;l++)fi.fromBufferAttribute(a,l),h&&(gr.fromBufferAttribute(t,l),fi.add(gr)),r=Math.max(r,n.distanceToSquared(fi))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeFaceNormals(){}computeTangents(){const t=this.index,e=this.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const n=t.array,r=e.position.array,o=e.normal.array,s=e.uv.array,a=r.length/3;e.tangent===void 0&&this.setAttribute("tangent",new Yn(new Float32Array(4*a),4));const h=e.tangent.array,l=[],u=[];for(let Ft=0;Ft<a;Ft++)l[Ft]=new U,u[Ft]=new U;const p=new U,y=new U,x=new U,E=new R,A=new R,C=new R,j=new U,Q=new U;function rt(Ft,Mt,wt){p.fromArray(r,3*Ft),y.fromArray(r,3*Mt),x.fromArray(r,3*wt),E.fromArray(s,2*Ft),A.fromArray(s,2*Mt),C.fromArray(s,2*wt),y.sub(p),x.sub(p),A.sub(E),C.sub(E);const Pt=1/(A.x*C.y-C.x*A.y);isFinite(Pt)&&(j.copy(y).multiplyScalar(C.y).addScaledVector(x,-A.y).multiplyScalar(Pt),Q.copy(x).multiplyScalar(A.x).addScaledVector(y,-C.x).multiplyScalar(Pt),l[Ft].add(j),l[Mt].add(j),l[wt].add(j),u[Ft].add(Q),u[Mt].add(Q),u[wt].add(Q))}let pt=this.groups;pt.length===0&&(pt=[{start:0,count:n.length}]);for(let Ft=0,Mt=pt.length;Ft<Mt;++Ft){const wt=pt[Ft],Pt=wt.start;for(let Nt=Pt,ne=Pt+wt.count;Nt<ne;Nt+=3)rt(n[Nt+0],n[Nt+1],n[Nt+2])}const it=new U,gt=new U,ht=new U,mt=new U;function jt(Ft){ht.fromArray(o,3*Ft),mt.copy(ht);const Mt=l[Ft];it.copy(Mt),it.sub(ht.multiplyScalar(ht.dot(Mt))).normalize(),gt.crossVectors(mt,Mt);const wt=gt.dot(u[Ft])<0?-1:1;h[4*Ft]=it.x,h[4*Ft+1]=it.y,h[4*Ft+2]=it.z,h[4*Ft+3]=wt}for(let Ft=0,Mt=pt.length;Ft<Mt;++Ft){const wt=pt[Ft],Pt=wt.start;for(let Nt=Pt,ne=Pt+wt.count;Nt<ne;Nt+=3)jt(n[Nt+0]),jt(n[Nt+1]),jt(n[Nt+2])}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(e!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new Yn(new Float32Array(3*e.count),3),this.setAttribute("normal",n);else for(let y=0,x=n.count;y<x;y++)n.setXYZ(y,0,0,0);const r=new U,o=new U,s=new U,a=new U,h=new U,l=new U,u=new U,p=new U;if(t)for(let y=0,x=t.count;y<x;y+=3){const E=t.getX(y+0),A=t.getX(y+1),C=t.getX(y+2);r.fromBufferAttribute(e,E),o.fromBufferAttribute(e,A),s.fromBufferAttribute(e,C),u.subVectors(s,o),p.subVectors(r,o),u.cross(p),a.fromBufferAttribute(n,E),h.fromBufferAttribute(n,A),l.fromBufferAttribute(n,C),a.add(u),h.add(u),l.add(u),n.setXYZ(E,a.x,a.y,a.z),n.setXYZ(A,h.x,h.y,h.z),n.setXYZ(C,l.x,l.y,l.z)}else for(let y=0,x=e.count;y<x;y+=3)r.fromBufferAttribute(e,y+0),o.fromBufferAttribute(e,y+1),s.fromBufferAttribute(e,y+2),u.subVectors(s,o),p.subVectors(r,o),u.cross(p),n.setXYZ(y+0,u.x,u.y,u.z),n.setXYZ(y+1,u.x,u.y,u.z),n.setXYZ(y+2,u.x,u.y,u.z);this.normalizeNormals(),n.needsUpdate=!0}}merge(t,e){if(!t||!t.isBufferGeometry)return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t);e===void 0&&(e=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));const n=this.attributes;for(const r in n){if(t.attributes[r]===void 0)continue;const o=n[r].array,s=t.attributes[r],a=s.array,h=s.itemSize*e,l=Math.min(a.length,o.length-h);for(let u=0,p=h;u<l;u++,p++)o[p]=a[u]}return this}normalizeNormals(){const t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)fi.fromBufferAttribute(t,e),fi.normalize(),t.setXYZ(e,fi.x,fi.y,fi.z)}toNonIndexed(){function t(a,h){const l=a.array,u=a.itemSize,p=a.normalized,y=new l.constructor(h.length*u);let x=0,E=0;for(let A=0,C=h.length;A<C;A++){x=a.isInterleavedBufferAttribute?h[A]*a.data.stride+a.offset:h[A]*u;for(let j=0;j<u;j++)y[E++]=l[x++]}return new Yn(y,u,p)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new Wn,n=this.index.array,r=this.attributes;for(const a in r){const h=t(r[a],n);e.setAttribute(a,h)}const o=this.morphAttributes;for(const a in o){const h=[],l=o[a];for(let u=0,p=l.length;u<p;u++){const y=t(l[u],n);h.push(y)}e.morphAttributes[a]=h}e.morphTargetsRelative=this.morphTargetsRelative;const s=this.groups;for(let a=0,h=s.length;a<h;a++){const l=s[a];e.addGroup(l.start,l.count,l.materialIndex)}return e}toJSON(){const t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),this.parameters!==void 0){const h=this.parameters;for(const l in h)h[l]!==void 0&&(t[l]=h[l]);return t}t.data={attributes:{}};const e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const h in n){const l=n[h];t.data.attributes[h]=l.toJSON(t.data)}const r={};let o=!1;for(const h in this.morphAttributes){const l=this.morphAttributes[h],u=[];for(let p=0,y=l.length;p<y;p++){const x=l[p];u.push(x.toJSON(t.data))}u.length>0&&(r[h]=u,o=!0)}o&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));const a=this.boundingSphere;return a!==null&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),t}clone(){return new Wn().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;n!==null&&this.setIndex(n.clone(e));const r=t.attributes;for(const l in r){const u=r[l];this.setAttribute(l,u.clone(e))}const o=t.morphAttributes;for(const l in o){const u=[],p=o[l];for(let y=0,x=p.length;y<x;y++)u.push(p[y].clone(e));this.morphAttributes[l]=u}this.morphTargetsRelative=t.morphTargetsRelative;const s=t.groups;for(let l=0,u=s.length;l<u;l++){const p=s[l];this.addGroup(p.start,p.count,p.materialIndex)}const a=t.boundingBox;a!==null&&(this.boundingBox=a.clone());const h=t.boundingSphere;return h!==null&&(this.boundingSphere=h.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}Wn.prototype.isBufferGeometry=!0;const Eo=new tn,Fr=new pi,So=new Ge,Ar=new U,Mr=new U,or=new U,wo=new U,Ao=new U,Mo=new U,q=new U,g=new U,m=new U,_=new R,N=new R,J=new R,lt=new U,xt=new U;class Tt extends Un{constructor(t=new Wn,e=new Zi){super(),this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t){return super.copy(t),t.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),t.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=t.material,this.geometry=t.geometry,this}updateMorphTargets(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,n=Object.keys(e);if(n.length>0){const r=e[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=r.length;o<s;o++){const a=r[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=o}}}}else{const e=t.morphTargets;e!==void 0&&e.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(t,e){const n=this.geometry,r=this.material,o=this.matrixWorld;if(r===void 0||(n.boundingSphere===null&&n.computeBoundingSphere(),So.copy(n.boundingSphere),So.applyMatrix4(o),t.ray.intersectsSphere(So)===!1)||(Eo.copy(o).invert(),Fr.copy(t.ray).applyMatrix4(Eo),n.boundingBox!==null&&Fr.intersectsBox(n.boundingBox)===!1))return;let s;if(n.isBufferGeometry){const a=n.index,h=n.attributes.position,l=n.morphAttributes.position,u=n.morphTargetsRelative,p=n.attributes.uv,y=n.attributes.uv2,x=n.groups,E=n.drawRange;if(a!==null)if(Array.isArray(r))for(let A=0,C=x.length;A<C;A++){const j=x[A],Q=r[j.materialIndex];for(let rt=Math.max(j.start,E.start),pt=Math.min(j.start+j.count,E.start+E.count);rt<pt;rt+=3){const it=a.getX(rt),gt=a.getX(rt+1),ht=a.getX(rt+2);s=Zt(this,Q,t,Fr,h,l,u,p,y,it,gt,ht),s&&(s.faceIndex=Math.floor(rt/3),s.face.materialIndex=j.materialIndex,e.push(s))}}else for(let A=Math.max(0,E.start),C=Math.min(a.count,E.start+E.count);A<C;A+=3){const j=a.getX(A),Q=a.getX(A+1),rt=a.getX(A+2);s=Zt(this,r,t,Fr,h,l,u,p,y,j,Q,rt),s&&(s.faceIndex=Math.floor(A/3),e.push(s))}else if(h!==void 0)if(Array.isArray(r))for(let A=0,C=x.length;A<C;A++){const j=x[A],Q=r[j.materialIndex];for(let rt=Math.max(j.start,E.start),pt=Math.min(j.start+j.count,E.start+E.count);rt<pt;rt+=3)s=Zt(this,Q,t,Fr,h,l,u,p,y,rt,rt+1,rt+2),s&&(s.faceIndex=Math.floor(rt/3),s.face.materialIndex=j.materialIndex,e.push(s))}else for(let A=Math.max(0,E.start),C=Math.min(h.count,E.start+E.count);A<C;A+=3)s=Zt(this,r,t,Fr,h,l,u,p,y,A,A+1,A+2),s&&(s.faceIndex=Math.floor(A/3),e.push(s))}else n.isGeometry&&console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}function Zt(i,t,e,n,r,o,s,a,h,l,u,p){Ar.fromBufferAttribute(r,l),Mr.fromBufferAttribute(r,u),or.fromBufferAttribute(r,p);const y=i.morphTargetInfluences;if(t.morphTargets&&o&&y){q.set(0,0,0),g.set(0,0,0),m.set(0,0,0);for(let E=0,A=o.length;E<A;E++){const C=y[E],j=o[E];C!==0&&(wo.fromBufferAttribute(j,l),Ao.fromBufferAttribute(j,u),Mo.fromBufferAttribute(j,p),s?(q.addScaledVector(wo,C),g.addScaledVector(Ao,C),m.addScaledVector(Mo,C)):(q.addScaledVector(wo.sub(Ar),C),g.addScaledVector(Ao.sub(Mr),C),m.addScaledVector(Mo.sub(or),C)))}Ar.add(q),Mr.add(g),or.add(m)}i.isSkinnedMesh&&(i.boneTransform(l,Ar),i.boneTransform(u,Mr),i.boneTransform(p,or));const x=function(E,A,C,j,Q,rt,pt,it){let gt;if(gt=A.side===1?j.intersectTriangle(pt,rt,Q,!0,it):j.intersectTriangle(Q,rt,pt,A.side!==2,it),gt===null)return null;xt.copy(it),xt.applyMatrix4(E.matrixWorld);const ht=C.ray.origin.distanceTo(xt);return ht<C.near||ht>C.far?null:{distance:ht,point:xt.clone(),object:E}}(i,t,e,n,Ar,Mr,or,lt);if(x){a&&(_.fromBufferAttribute(a,l),N.fromBufferAttribute(a,u),J.fromBufferAttribute(a,p),x.uv=ui.getUV(lt,Ar,Mr,or,_,N,J,new R)),h&&(_.fromBufferAttribute(h,l),N.fromBufferAttribute(h,u),J.fromBufferAttribute(h,p),x.uv2=ui.getUV(lt,Ar,Mr,or,_,N,J,new R));const E={a:l,b:u,c:p,normal:new U,materialIndex:0};ui.getNormal(Ar,Mr,or,E.normal),x.face=E}return x}Tt.prototype.isMesh=!0;class ee extends Wn{constructor(t=1,e=1,n=1,r=1,o=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:r,heightSegments:o,depthSegments:s};const a=this;r=Math.floor(r),o=Math.floor(o),s=Math.floor(s);const h=[],l=[],u=[],p=[];let y=0,x=0;function E(A,C,j,Q,rt,pt,it,gt,ht,mt,jt){const Ft=pt/ht,Mt=it/mt,wt=pt/2,Pt=it/2,Nt=gt/2,ne=ht+1,$t=mt+1;let Vt=0,Yt=0;const ge=new U;for(let be=0;be<$t;be++){const Pe=be*Mt-Pt;for(let Ct=0;Ct<ne;Ct++){const Bt=Ct*Ft-wt;ge[A]=Bt*Q,ge[C]=Pe*rt,ge[j]=Nt,l.push(ge.x,ge.y,ge.z),ge[A]=0,ge[C]=0,ge[j]=gt>0?1:-1,u.push(ge.x,ge.y,ge.z),p.push(Ct/ht),p.push(1-be/mt),Vt+=1}}for(let be=0;be<mt;be++)for(let Pe=0;Pe<ht;Pe++){const Ct=y+Pe+ne*be,Bt=y+Pe+ne*(be+1),ve=y+(Pe+1)+ne*(be+1),le=y+(Pe+1)+ne*be;h.push(Ct,Bt,le),h.push(Bt,ve,le),Yt+=6}a.addGroup(x,Yt,jt),x+=Yt,y+=Vt}E("z","y","x",-1,-1,n,e,t,s,o,0),E("z","y","x",1,-1,n,e,-t,s,o,1),E("x","z","y",1,1,t,n,e,r,s,2),E("x","z","y",1,-1,t,n,-e,r,s,3),E("x","y","z",1,-1,t,e,n,r,o,4),E("x","y","z",-1,-1,t,e,-n,r,o,5),this.setIndex(h),this.setAttribute("position",new An(l,3)),this.setAttribute("normal",new An(u,3)),this.setAttribute("uv",new An(p,2))}static fromJSON(t){return new ee(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}function Fe(i){const t={};for(const e in i){t[e]={};for(const n in i[e]){const r=i[e][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?t[e][n]=r.clone():Array.isArray(r)?t[e][n]=r.slice():t[e][n]=r}}return t}function Te(i){const t={};for(let e=0;e<i.length;e++){const n=Fe(i[e]);for(const r in n)t[r]=n[r]}return t}const Qe={clone:Fe,merge:Te};class hn extends Ci{constructor(t){super(),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=`void main() {
|
|
4070
|
+
*/class D{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[t]===void 0&&(n[t]=[]),n[t].indexOf(e)===-1&&n[t].push(e)}hasEventListener(t,e){if(this._listeners===void 0)return!1;const n=this._listeners;return n[t]!==void 0&&n[t].indexOf(e)!==-1}removeEventListener(t,e){if(this._listeners===void 0)return;const n=this._listeners[t];if(n!==void 0){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}}dispatchEvent(t){if(this._listeners===void 0)return;const e=this._listeners[t.type];if(e!==void 0){t.target=this;const n=e.slice(0);for(let r=0,o=n.length;r<o;r++)n[r].call(this,t);t.target=null}}}const k=[];for(let i=0;i<256;i++)k[i]=(i<16?"0":"")+i.toString(16);const V=Math.PI/180,W=180/Math.PI;function X(){const i=4294967295*Math.random()|0,t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(k[255&i]+k[i>>8&255]+k[i>>16&255]+k[i>>24&255]+"-"+k[255&t]+k[t>>8&255]+"-"+k[t>>16&15|64]+k[t>>24&255]+"-"+k[63&e|128]+k[e>>8&255]+"-"+k[e>>16&255]+k[e>>24&255]+k[255&n]+k[n>>8&255]+k[n>>16&255]+k[n>>24&255]).toUpperCase()}function et(i,t,e){return Math.max(t,Math.min(e,i))}function ft(i,t){return(i%t+t)%t}function Dt(i,t,e){return(1-e)*i+e*t}function At(i){return(i&i-1)==0&&i!==0}function L(i){return Math.pow(2,Math.floor(Math.log(i)/Math.LN2))}class R{constructor(t=0,e=0){this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t,e){return e!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t,e){return e!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6],this.y=r[1]*e+r[4]*n+r[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e,n){return n!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),r=Math.sin(e),o=this.x-t.x,s=this.y-t.y;return this.x=o*n-s*r+t.x,this.y=o*r+s*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}}R.prototype.isVector2=!0;class B{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(t,e,n,r,o,s,a,h,l){const u=this.elements;return u[0]=t,u[1]=r,u[2]=a,u[3]=e,u[4]=o,u[5]=h,u[6]=n,u[7]=s,u[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,r=e.elements,o=this.elements,s=n[0],a=n[3],h=n[6],l=n[1],u=n[4],p=n[7],y=n[2],x=n[5],E=n[8],A=r[0],C=r[3],j=r[6],Q=r[1],rt=r[4],pt=r[7],it=r[2],gt=r[5],ht=r[8];return o[0]=s*A+a*Q+h*it,o[3]=s*C+a*rt+h*gt,o[6]=s*j+a*pt+h*ht,o[1]=l*A+u*Q+p*it,o[4]=l*C+u*rt+p*gt,o[7]=l*j+u*pt+p*ht,o[2]=y*A+x*Q+E*it,o[5]=y*C+x*rt+E*gt,o[8]=y*j+x*pt+E*ht,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[1],r=t[2],o=t[3],s=t[4],a=t[5],h=t[6],l=t[7],u=t[8];return e*s*u-e*a*l-n*o*u+n*a*h+r*o*l-r*s*h}invert(){const t=this.elements,e=t[0],n=t[1],r=t[2],o=t[3],s=t[4],a=t[5],h=t[6],l=t[7],u=t[8],p=u*s-a*l,y=a*h-u*o,x=l*o-s*h,E=e*p+n*y+r*x;if(E===0)return this.set(0,0,0,0,0,0,0,0,0);const A=1/E;return t[0]=p*A,t[1]=(r*l-u*n)*A,t[2]=(a*n-r*s)*A,t[3]=y*A,t[4]=(u*e-r*h)*A,t[5]=(r*o-a*e)*A,t[6]=x*A,t[7]=(n*h-l*e)*A,t[8]=(s*e-n*o)*A,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,r,o,s,a){const h=Math.cos(o),l=Math.sin(o);return this.set(n*h,n*l,-n*(h*s+l*a)+s+t,-r*l,r*h,-r*(-l*s+h*a)+a+e,0,0,1),this}scale(t,e){const n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=e,n[4]*=e,n[7]*=e,this}rotate(t){const e=Math.cos(t),n=Math.sin(t),r=this.elements,o=r[0],s=r[3],a=r[6],h=r[1],l=r[4],u=r[7];return r[0]=e*o+n*h,r[3]=e*s+n*l,r[6]=e*a+n*u,r[1]=-n*o+e*h,r[4]=-n*s+e*l,r[7]=-n*a+e*u,this}translate(t,e){const n=this.elements;return n[0]+=t*n[2],n[3]+=t*n[5],n[6]+=t*n[8],n[1]+=e*n[2],n[4]+=e*n[5],n[7]+=e*n[8],this}equals(t){const e=this.elements,n=t.elements;for(let r=0;r<9;r++)if(e[r]!==n[r])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return new this.constructor().fromArray(this.elements)}}let Y;B.prototype.isMatrix3=!0;class P{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement=="undefined")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{Y===void 0&&(Y=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Y.width=t.width,Y.height=t.height;const n=Y.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=Y}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}}let H=0;class tt extends D{constructor(t=tt.DEFAULT_IMAGE,e=tt.DEFAULT_MAPPING,n=1001,r=1001,o=1006,s=1008,a=1023,h=1009,l=1,u=3e3){super(),Object.defineProperty(this,"id",{value:H++}),this.uuid=X(),this.name="",this.image=t,this.mipmaps=[],this.mapping=e,this.wrapS=n,this.wrapT=r,this.magFilter=o,this.minFilter=s,this.anisotropy=l,this.format=a,this.internalFormat=null,this.type=h,this.offset=new R(0,0),this.repeat=new R(1,1),this.center=new R(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new B,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=u,this.version=0,this.onUpdate=null}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this}toJSON(t){const e=t===void 0||typeof t=="string";if(!e&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];const n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(this.image!==void 0){const r=this.image;if(r.uuid===void 0&&(r.uuid=X()),!e&&t.images[r.uuid]===void 0){let o;if(Array.isArray(r)){o=[];for(let s=0,a=r.length;s<a;s++)r[s].isDataTexture?o.push(G(r[s].image)):o.push(G(r[s]))}else o=G(r);t.images[r.uuid]={uuid:r.uuid,url:o}}n.image=r.uuid}return e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==300)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case 1e3:t.x=t.x-Math.floor(t.x);break;case 1001:t.x=t.x<0?0:1;break;case 1002:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case 1e3:t.y=t.y-Math.floor(t.y);break;case 1001:t.y=t.y<0?0:1;break;case 1002:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&this.version++}}function G(i){return typeof HTMLImageElement!="undefined"&&i instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&i instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&i instanceof ImageBitmap?P.getDataURL(i):i.data?{data:Array.prototype.slice.call(i.data),width:i.width,height:i.height,type:i.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}tt.DEFAULT_IMAGE=void 0,tt.DEFAULT_MAPPING=300,tt.prototype.isTexture=!0;class Ot{constructor(t=0,e=0,n=0,r=1){this.x=t,this.y=e,this.z=n,this.w=r}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,r){return this.x=t,this.y=e,this.z=n,this.w=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t,e){return e!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t,e){return e!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,r=this.z,o=this.w,s=t.elements;return this.x=s[0]*e+s[4]*n+s[8]*r+s[12]*o,this.y=s[1]*e+s[5]*n+s[9]*r+s[13]*o,this.z=s[2]*e+s[6]*n+s[10]*r+s[14]*o,this.w=s[3]*e+s[7]*n+s[11]*r+s[15]*o,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,r,o;const s=t.elements,a=s[0],h=s[4],l=s[8],u=s[1],p=s[5],y=s[9],x=s[2],E=s[6],A=s[10];if(Math.abs(h-u)<.01&&Math.abs(l-x)<.01&&Math.abs(y-E)<.01){if(Math.abs(h+u)<.1&&Math.abs(l+x)<.1&&Math.abs(y+E)<.1&&Math.abs(a+p+A-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const j=(a+1)/2,Q=(p+1)/2,rt=(A+1)/2,pt=(h+u)/4,it=(l+x)/4,gt=(y+E)/4;return j>Q&&j>rt?j<.01?(n=0,r=.707106781,o=.707106781):(n=Math.sqrt(j),r=pt/n,o=it/n):Q>rt?Q<.01?(n=.707106781,r=0,o=.707106781):(r=Math.sqrt(Q),n=pt/r,o=gt/r):rt<.01?(n=.707106781,r=.707106781,o=0):(o=Math.sqrt(rt),n=it/o,r=gt/o),this.set(n,r,o,e),this}let C=Math.sqrt((E-y)*(E-y)+(l-x)*(l-x)+(u-h)*(u-h));return Math.abs(C)<.001&&(C=1),this.x=(E-y)/C,this.y=(l-x)/C,this.z=(u-h)/C,this.w=Math.acos((a+p+A-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e,n){return n!==void 0&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}}Ot.prototype.isVector4=!0;class zt extends D{constructor(t,e,n={}){super(),this.width=t,this.height=e,this.depth=1,this.scissor=new Ot(0,0,t,e),this.scissorTest=!1,this.viewport=new Ot(0,0,t,e),this.texture=new tt(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={width:t,height:e,depth:1},this.texture.generateMipmaps=n.generateMipmaps!==void 0&&n.generateMipmaps,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:1006,this.depthBuffer=n.depthBuffer===void 0||n.depthBuffer,this.stencilBuffer=n.stencilBuffer!==void 0&&n.stencilBuffer,this.depthTexture=n.depthTexture!==void 0?n.depthTexture:null}setTexture(t){t.image={width:this.width,height:this.height,depth:this.depth},this.texture=t}setSize(t,e,n=1){this.width===t&&this.height===e&&this.depth===n||(this.width=t,this.height=e,this.depth=n,this.texture.image.width=t,this.texture.image.height=e,this.texture.image.depth=n,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return new this.constructor().copy(this)}copy(t){return this.width=t.width,this.height=t.height,this.depth=t.depth,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.texture.image=Ac({},this.texture.image),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}zt.prototype.isWebGLRenderTarget=!0,class extends zt{constructor(i,t,e){super(i,t);const n=this.texture;this.texture=[];for(let r=0;r<e;r++)this.texture[r]=n.clone()}setSize(i,t,e=1){if(this.width!==i||this.height!==t||this.depth!==e){this.width=i,this.height=t,this.depth=e;for(let n=0,r=this.texture.length;n<r;n++)this.texture[n].image.width=i,this.texture[n].image.height=t,this.texture[n].image.depth=e;this.dispose()}return this.viewport.set(0,0,i,t),this.scissor.set(0,0,i,t),this}copy(i){this.dispose(),this.width=i.width,this.height=i.height,this.depth=i.depth,this.viewport.set(0,0,this.width,this.height),this.scissor.set(0,0,this.width,this.height),this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.depthTexture=i.depthTexture,this.texture.length=0;for(let t=0,e=i.texture.length;t<e;t++)this.texture[t]=i.texture[t].clone();return this}}.prototype.isWebGLMultipleRenderTargets=!0;class st extends zt{constructor(t,e,n){super(t,e,n),this.samples=4}copy(t){return super.copy.call(this,t),this.samples=t.samples,this}}st.prototype.isWebGLMultisampleRenderTarget=!0;class z{constructor(t=0,e=0,n=0,r=1){this._x=t,this._y=e,this._z=n,this._w=r}static slerp(t,e,n,r){return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."),n.slerpQuaternions(t,e,r)}static slerpFlat(t,e,n,r,o,s,a){let h=n[r+0],l=n[r+1],u=n[r+2],p=n[r+3];const y=o[s+0],x=o[s+1],E=o[s+2],A=o[s+3];if(a===0)return t[e+0]=h,t[e+1]=l,t[e+2]=u,void(t[e+3]=p);if(a===1)return t[e+0]=y,t[e+1]=x,t[e+2]=E,void(t[e+3]=A);if(p!==A||h!==y||l!==x||u!==E){let C=1-a;const j=h*y+l*x+u*E+p*A,Q=j>=0?1:-1,rt=1-j*j;if(rt>Number.EPSILON){const it=Math.sqrt(rt),gt=Math.atan2(it,j*Q);C=Math.sin(C*gt)/it,a=Math.sin(a*gt)/it}const pt=a*Q;if(h=h*C+y*pt,l=l*C+x*pt,u=u*C+E*pt,p=p*C+A*pt,C===1-a){const it=1/Math.sqrt(h*h+l*l+u*u+p*p);h*=it,l*=it,u*=it,p*=it}}t[e]=h,t[e+1]=l,t[e+2]=u,t[e+3]=p}static multiplyQuaternionsFlat(t,e,n,r,o,s){const a=n[r],h=n[r+1],l=n[r+2],u=n[r+3],p=o[s],y=o[s+1],x=o[s+2],E=o[s+3];return t[e]=a*E+u*p+h*x-l*y,t[e+1]=h*E+u*y+l*p-a*x,t[e+2]=l*E+u*x+a*y-h*p,t[e+3]=u*E-a*p-h*y-l*x,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const n=t._x,r=t._y,o=t._z,s=t._order,a=Math.cos,h=Math.sin,l=a(n/2),u=a(r/2),p=a(o/2),y=h(n/2),x=h(r/2),E=h(o/2);switch(s){case"XYZ":this._x=y*u*p+l*x*E,this._y=l*x*p-y*u*E,this._z=l*u*E+y*x*p,this._w=l*u*p-y*x*E;break;case"YXZ":this._x=y*u*p+l*x*E,this._y=l*x*p-y*u*E,this._z=l*u*E-y*x*p,this._w=l*u*p+y*x*E;break;case"ZXY":this._x=y*u*p-l*x*E,this._y=l*x*p+y*u*E,this._z=l*u*E+y*x*p,this._w=l*u*p-y*x*E;break;case"ZYX":this._x=y*u*p-l*x*E,this._y=l*x*p+y*u*E,this._z=l*u*E-y*x*p,this._w=l*u*p+y*x*E;break;case"YZX":this._x=y*u*p+l*x*E,this._y=l*x*p+y*u*E,this._z=l*u*E-y*x*p,this._w=l*u*p-y*x*E;break;case"XZY":this._x=y*u*p-l*x*E,this._y=l*x*p-y*u*E,this._z=l*u*E+y*x*p,this._w=l*u*p+y*x*E;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return e!==!1&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,r=Math.sin(n);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],r=e[4],o=e[8],s=e[1],a=e[5],h=e[9],l=e[2],u=e[6],p=e[10],y=n+a+p;if(y>0){const x=.5/Math.sqrt(y+1);this._w=.25/x,this._x=(u-h)*x,this._y=(o-l)*x,this._z=(s-r)*x}else if(n>a&&n>p){const x=2*Math.sqrt(1+n-a-p);this._w=(u-h)/x,this._x=.25*x,this._y=(r+s)/x,this._z=(o+l)/x}else if(a>p){const x=2*Math.sqrt(1+a-n-p);this._w=(o-l)/x,this._x=(r+s)/x,this._y=.25*x,this._z=(h+u)/x}else{const x=2*Math.sqrt(1+p-n-a);this._w=(s-r)/x,this._x=(o+l)/x,this._y=(h+u)/x,this._z=.25*x}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(et(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(n===0)return this;const r=Math.min(1,e/n);return this.slerp(t,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t,e){return e!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,r=t._y,o=t._z,s=t._w,a=e._x,h=e._y,l=e._z,u=e._w;return this._x=n*u+s*a+r*l-o*h,this._y=r*u+s*h+o*a-n*l,this._z=o*u+s*l+n*h-r*a,this._w=s*u-n*a-r*h-o*l,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const n=this._x,r=this._y,o=this._z,s=this._w;let a=s*t._w+n*t._x+r*t._y+o*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=s,this._x=n,this._y=r,this._z=o,this;const h=1-a*a;if(h<=Number.EPSILON){const x=1-e;return this._w=x*s+e*this._w,this._x=x*n+e*this._x,this._y=x*r+e*this._y,this._z=x*o+e*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(h),u=Math.atan2(l,a),p=Math.sin((1-e)*u)/l,y=Math.sin(e*u)/l;return this._w=s*p+this._w*y,this._x=n*p+this._x*y,this._y=r*p+this._y*y,this._z=o*p+this._z*y,this._onChangeCallback(),this}slerpQuaternions(t,e,n){this.copy(t).slerp(e,n)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}}z.prototype.isQuaternion=!0;class U{constructor(t=0,e=0,n=0){this.x=t,this.y=e,this.z=n}set(t,e,n){return n===void 0&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t,e){return e!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t,e){return e!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t,e){return e!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion($.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion($.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,r=this.z,o=t.elements;return this.x=o[0]*e+o[3]*n+o[6]*r,this.y=o[1]*e+o[4]*n+o[7]*r,this.z=o[2]*e+o[5]*n+o[8]*r,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,r=this.z,o=t.elements,s=1/(o[3]*e+o[7]*n+o[11]*r+o[15]);return this.x=(o[0]*e+o[4]*n+o[8]*r+o[12])*s,this.y=(o[1]*e+o[5]*n+o[9]*r+o[13])*s,this.z=(o[2]*e+o[6]*n+o[10]*r+o[14])*s,this}applyQuaternion(t){const e=this.x,n=this.y,r=this.z,o=t.x,s=t.y,a=t.z,h=t.w,l=h*e+s*r-a*n,u=h*n+a*e-o*r,p=h*r+o*n-s*e,y=-o*e-s*n-a*r;return this.x=l*h+y*-o+u*-a-p*-s,this.y=u*h+y*-s+p*-o-l*-a,this.z=p*h+y*-a+l*-s-u*-o,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,n=this.y,r=this.z,o=t.elements;return this.x=o[0]*e+o[4]*n+o[8]*r,this.y=o[1]*e+o[5]*n+o[9]*r,this.z=o[2]*e+o[6]*n+o[10]*r,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t,e){return e!==void 0?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,r=t.y,o=t.z,s=e.x,a=e.y,h=e.z;return this.x=r*h-o*a,this.y=o*s-n*h,this.z=n*a-r*s,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return dt.copy(this).projectOnVector(t),this.sub(dt)}reflect(t){return this.sub(dt.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(et(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return e*e+n*n+r*r}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const r=Math.sin(e)*t;return this.x=r*Math.sin(n),this.y=Math.cos(e)*t,this.z=r*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=r,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e,n){return n!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}}U.prototype.isVector3=!0;const dt=new U,$=new z;class vt{constructor(t=new U(1/0,1/0,1/0),e=new U(-1/0,-1/0,-1/0)){this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){let e=1/0,n=1/0,r=1/0,o=-1/0,s=-1/0,a=-1/0;for(let h=0,l=t.length;h<l;h+=3){const u=t[h],p=t[h+1],y=t[h+2];u<e&&(e=u),p<n&&(n=p),y<r&&(r=y),u>o&&(o=u),p>s&&(s=p),y>a&&(a=y)}return this.min.set(e,n,r),this.max.set(o,s,a),this}setFromBufferAttribute(t){let e=1/0,n=1/0,r=1/0,o=-1/0,s=-1/0,a=-1/0;for(let h=0,l=t.count;h<l;h++){const u=t.getX(h),p=t.getY(h),y=t.getZ(h);u<e&&(e=u),p<n&&(n=p),y<r&&(r=y),u>o&&(o=u),p>s&&(s=p),y>a&&(a=y)}return this.min.set(e,n,r),this.max.set(o,s,a),this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const n=K.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}setFromObject(t){return this.makeEmpty(),this.expandByObject(t)}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t){t.updateWorldMatrix(!1,!1);const e=t.geometry;e!==void 0&&(e.boundingBox===null&&e.computeBoundingBox(),ct.copy(e.boundingBox),ct.applyMatrix4(t.matrixWorld),this.union(ct));const n=t.children;for(let r=0,o=n.length;r<o;r++)this.expandByObject(n[r]);return this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)}intersectsSphere(t){return this.clampPoint(t.center,K),K.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(at),_e.subVectors(this.max,at),nt.subVectors(t.a,at),_t.subVectors(t.b,at),St.subVectors(t.c,at),kt.subVectors(_t,nt),Xt.subVectors(St,_t),Jt.subVectors(nt,St);let e=[0,-kt.z,kt.y,0,-Xt.z,Xt.y,0,-Jt.z,Jt.y,kt.z,0,-kt.x,Xt.z,0,-Xt.x,Jt.z,0,-Jt.x,-kt.y,kt.x,0,-Xt.y,Xt.x,0,-Jt.y,Jt.x,0];return!!Ae(e,nt,_t,St,_e)&&(e=[1,0,0,0,1,0,0,0,1],!!Ae(e,nt,_t,St,_e)&&(Ue.crossVectors(kt,Xt),e=[Ue.x,Ue.y,Ue.z],Ae(e,nt,_t,St,_e)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return K.copy(t).clamp(this.min,this.max).sub(t).length()}getBoundingSphere(t){return this.getCenter(t.center),t.radius=.5*this.getSize(K).length(),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(Lt[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Lt[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Lt[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Lt[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Lt[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Lt[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Lt[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Lt[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Lt)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}vt.prototype.isBox3=!0;const Lt=[new U,new U,new U,new U,new U,new U,new U,new U],K=new U,ct=new vt,nt=new U,_t=new U,St=new U,kt=new U,Xt=new U,Jt=new U,at=new U,_e=new U,Ue=new U,Oe=new U;function Ae(i,t,e,n,r){for(let o=0,s=i.length-3;o<=s;o+=3){Oe.fromArray(i,o);const a=r.x*Math.abs(Oe.x)+r.y*Math.abs(Oe.y)+r.z*Math.abs(Oe.z),h=t.dot(Oe),l=e.dot(Oe),u=n.dot(Oe);if(Math.max(-Math.max(h,l,u),Math.min(h,l,u))>a)return!1}return!0}const ze=new vt,$e=new U,cn=new U,ke=new U;class Ge{constructor(t=new U,e=-1){this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const n=this.center;e!==void 0?n.copy(e):ze.setFromPoints(t).getCenter(n);let r=0;for(let o=0,s=t.length;o<s;o++)r=Math.max(r,n.distanceToSquared(t[o]));return this.radius=Math.sqrt(r),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const n=this.center.distanceToSquared(t);return e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){ke.subVectors(t,this.center);const e=ke.lengthSq();if(e>this.radius*this.radius){const n=Math.sqrt(e),r=.5*(n-this.radius);this.center.add(ke.multiplyScalar(r/n)),this.radius+=r}return this}union(t){return cn.subVectors(t.center,this.center).normalize().multiplyScalar(t.radius),this.expandByPoint($e.copy(t.center).add(cn)),this.expandByPoint($e.copy(t.center).sub(cn)),this}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Rn=new U,re=new U,pe=new U,Ee=new U,ln=new U,In=new U,Kn=new U;class pi{constructor(t=new U,e=new U(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.direction).multiplyScalar(t).add(this.origin)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,Rn)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=Rn.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Rn.copy(this.direction).multiplyScalar(e).add(this.origin),Rn.distanceToSquared(t))}distanceSqToSegment(t,e,n,r){re.copy(t).add(e).multiplyScalar(.5),pe.copy(e).sub(t).normalize(),Ee.copy(this.origin).sub(re);const o=.5*t.distanceTo(e),s=-this.direction.dot(pe),a=Ee.dot(this.direction),h=-Ee.dot(pe),l=Ee.lengthSq(),u=Math.abs(1-s*s);let p,y,x,E;if(u>0)if(p=s*h-a,y=s*a-h,E=o*u,p>=0)if(y>=-E)if(y<=E){const A=1/u;p*=A,y*=A,x=p*(p+s*y+2*a)+y*(s*p+y+2*h)+l}else y=o,p=Math.max(0,-(s*y+a)),x=-p*p+y*(y+2*h)+l;else y=-o,p=Math.max(0,-(s*y+a)),x=-p*p+y*(y+2*h)+l;else y<=-E?(p=Math.max(0,-(-s*o+a)),y=p>0?-o:Math.min(Math.max(-o,-h),o),x=-p*p+y*(y+2*h)+l):y<=E?(p=0,y=Math.min(Math.max(-o,-h),o),x=y*(y+2*h)+l):(p=Math.max(0,-(s*o+a)),y=p>0?o:Math.min(Math.max(-o,-h),o),x=-p*p+y*(y+2*h)+l);else y=s>0?-o:o,p=Math.max(0,-(s*y+a)),x=-p*p+y*(y+2*h)+l;return n&&n.copy(this.direction).multiplyScalar(p).add(this.origin),r&&r.copy(pe).multiplyScalar(y).add(re),x}intersectSphere(t,e){Rn.subVectors(t.center,this.origin);const n=Rn.dot(this.direction),r=Rn.dot(Rn)-n*n,o=t.radius*t.radius;if(r>o)return null;const s=Math.sqrt(o-r),a=n-s,h=n+s;return a<0&&h<0?null:a<0?this.at(h,e):this.at(a,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);return n===null?null:this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return e===0?!0:t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,r,o,s,a,h;const l=1/this.direction.x,u=1/this.direction.y,p=1/this.direction.z,y=this.origin;return l>=0?(n=(t.min.x-y.x)*l,r=(t.max.x-y.x)*l):(n=(t.max.x-y.x)*l,r=(t.min.x-y.x)*l),u>=0?(o=(t.min.y-y.y)*u,s=(t.max.y-y.y)*u):(o=(t.max.y-y.y)*u,s=(t.min.y-y.y)*u),n>s||o>r?null:((o>n||n!=n)&&(n=o),(s<r||r!=r)&&(r=s),p>=0?(a=(t.min.z-y.z)*p,h=(t.max.z-y.z)*p):(a=(t.max.z-y.z)*p,h=(t.min.z-y.z)*p),n>h||a>r?null:((a>n||n!=n)&&(n=a),(h<r||r!=r)&&(r=h),r<0?null:this.at(n>=0?n:r,e)))}intersectsBox(t){return this.intersectBox(t,Rn)!==null}intersectTriangle(t,e,n,r,o){ln.subVectors(e,t),In.subVectors(n,t),Kn.crossVectors(ln,In);let s,a=this.direction.dot(Kn);if(a>0){if(r)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}Ee.subVectors(this.origin,t);const h=s*this.direction.dot(In.crossVectors(Ee,In));if(h<0)return null;const l=s*this.direction.dot(ln.cross(Ee));if(l<0||h+l>a)return null;const u=-s*Ee.dot(Kn);return u<0?null:this.at(u/a,o)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class tn{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(t,e,n,r,o,s,a,h,l,u,p,y,x,E,A,C){const j=this.elements;return j[0]=t,j[4]=e,j[8]=n,j[12]=r,j[1]=o,j[5]=s,j[9]=a,j[13]=h,j[2]=l,j[6]=u,j[10]=p,j[14]=y,j[3]=x,j[7]=E,j[11]=A,j[15]=C,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new tn().fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){const e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,n=t.elements,r=1/yt.setFromMatrixColumn(t,0).length(),o=1/yt.setFromMatrixColumn(t,1).length(),s=1/yt.setFromMatrixColumn(t,2).length();return e[0]=n[0]*r,e[1]=n[1]*r,e[2]=n[2]*r,e[3]=0,e[4]=n[4]*o,e[5]=n[5]*o,e[6]=n[6]*o,e[7]=0,e[8]=n[8]*s,e[9]=n[9]*s,e[10]=n[10]*s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const e=this.elements,n=t.x,r=t.y,o=t.z,s=Math.cos(n),a=Math.sin(n),h=Math.cos(r),l=Math.sin(r),u=Math.cos(o),p=Math.sin(o);if(t.order==="XYZ"){const y=s*u,x=s*p,E=a*u,A=a*p;e[0]=h*u,e[4]=-h*p,e[8]=l,e[1]=x+E*l,e[5]=y-A*l,e[9]=-a*h,e[2]=A-y*l,e[6]=E+x*l,e[10]=s*h}else if(t.order==="YXZ"){const y=h*u,x=h*p,E=l*u,A=l*p;e[0]=y+A*a,e[4]=E*a-x,e[8]=s*l,e[1]=s*p,e[5]=s*u,e[9]=-a,e[2]=x*a-E,e[6]=A+y*a,e[10]=s*h}else if(t.order==="ZXY"){const y=h*u,x=h*p,E=l*u,A=l*p;e[0]=y-A*a,e[4]=-s*p,e[8]=E+x*a,e[1]=x+E*a,e[5]=s*u,e[9]=A-y*a,e[2]=-s*l,e[6]=a,e[10]=s*h}else if(t.order==="ZYX"){const y=s*u,x=s*p,E=a*u,A=a*p;e[0]=h*u,e[4]=E*l-x,e[8]=y*l+A,e[1]=h*p,e[5]=A*l+y,e[9]=x*l-E,e[2]=-l,e[6]=a*h,e[10]=s*h}else if(t.order==="YZX"){const y=s*h,x=s*l,E=a*h,A=a*l;e[0]=h*u,e[4]=A-y*p,e[8]=E*p+x,e[1]=p,e[5]=s*u,e[9]=-a*u,e[2]=-l*u,e[6]=x*p+E,e[10]=y-A*p}else if(t.order==="XZY"){const y=s*h,x=s*l,E=a*h,A=a*l;e[0]=h*u,e[4]=-p,e[8]=l*u,e[1]=y*p+A,e[5]=s*u,e[9]=x*p-E,e[2]=E*p-x,e[6]=a*u,e[10]=A*p+y}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(Rt,t,Qt)}lookAt(t,e,n){const r=this.elements;return oe.subVectors(t,e),oe.lengthSq()===0&&(oe.z=1),oe.normalize(),Wt.crossVectors(n,oe),Wt.lengthSq()===0&&(Math.abs(n.z)===1?oe.x+=1e-4:oe.z+=1e-4,oe.normalize(),Wt.crossVectors(n,oe)),Wt.normalize(),Kt.crossVectors(oe,Wt),r[0]=Wt.x,r[4]=Kt.x,r[8]=oe.x,r[1]=Wt.y,r[5]=Kt.y,r[9]=oe.y,r[2]=Wt.z,r[6]=Kt.z,r[10]=oe.z,this}multiply(t,e){return e!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,r=e.elements,o=this.elements,s=n[0],a=n[4],h=n[8],l=n[12],u=n[1],p=n[5],y=n[9],x=n[13],E=n[2],A=n[6],C=n[10],j=n[14],Q=n[3],rt=n[7],pt=n[11],it=n[15],gt=r[0],ht=r[4],mt=r[8],jt=r[12],Ft=r[1],Mt=r[5],wt=r[9],Pt=r[13],Nt=r[2],ne=r[6],$t=r[10],Vt=r[14],Yt=r[3],ge=r[7],be=r[11],Pe=r[15];return o[0]=s*gt+a*Ft+h*Nt+l*Yt,o[4]=s*ht+a*Mt+h*ne+l*ge,o[8]=s*mt+a*wt+h*$t+l*be,o[12]=s*jt+a*Pt+h*Vt+l*Pe,o[1]=u*gt+p*Ft+y*Nt+x*Yt,o[5]=u*ht+p*Mt+y*ne+x*ge,o[9]=u*mt+p*wt+y*$t+x*be,o[13]=u*jt+p*Pt+y*Vt+x*Pe,o[2]=E*gt+A*Ft+C*Nt+j*Yt,o[6]=E*ht+A*Mt+C*ne+j*ge,o[10]=E*mt+A*wt+C*$t+j*be,o[14]=E*jt+A*Pt+C*Vt+j*Pe,o[3]=Q*gt+rt*Ft+pt*Nt+it*Yt,o[7]=Q*ht+rt*Mt+pt*ne+it*ge,o[11]=Q*mt+rt*wt+pt*$t+it*be,o[15]=Q*jt+rt*Pt+pt*Vt+it*Pe,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[4],r=t[8],o=t[12],s=t[1],a=t[5],h=t[9],l=t[13],u=t[2],p=t[6],y=t[10],x=t[14];return t[3]*(+o*h*p-r*l*p-o*a*y+n*l*y+r*a*x-n*h*x)+t[7]*(+e*h*x-e*l*y+o*s*y-r*s*x+r*l*u-o*h*u)+t[11]*(+e*l*p-e*a*x-o*s*p+n*s*x+o*a*u-n*l*u)+t[15]*(-r*a*u-e*h*p+e*a*y+r*s*p-n*s*y+n*h*u)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){const r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=n),this}invert(){const t=this.elements,e=t[0],n=t[1],r=t[2],o=t[3],s=t[4],a=t[5],h=t[6],l=t[7],u=t[8],p=t[9],y=t[10],x=t[11],E=t[12],A=t[13],C=t[14],j=t[15],Q=p*C*l-A*y*l+A*h*x-a*C*x-p*h*j+a*y*j,rt=E*y*l-u*C*l-E*h*x+s*C*x+u*h*j-s*y*j,pt=u*A*l-E*p*l+E*a*x-s*A*x-u*a*j+s*p*j,it=E*p*h-u*A*h-E*a*y+s*A*y+u*a*C-s*p*C,gt=e*Q+n*rt+r*pt+o*it;if(gt===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const ht=1/gt;return t[0]=Q*ht,t[1]=(A*y*o-p*C*o-A*r*x+n*C*x+p*r*j-n*y*j)*ht,t[2]=(a*C*o-A*h*o+A*r*l-n*C*l-a*r*j+n*h*j)*ht,t[3]=(p*h*o-a*y*o-p*r*l+n*y*l+a*r*x-n*h*x)*ht,t[4]=rt*ht,t[5]=(u*C*o-E*y*o+E*r*x-e*C*x-u*r*j+e*y*j)*ht,t[6]=(E*h*o-s*C*o-E*r*l+e*C*l+s*r*j-e*h*j)*ht,t[7]=(s*y*o-u*h*o+u*r*l-e*y*l-s*r*x+e*h*x)*ht,t[8]=pt*ht,t[9]=(E*p*o-u*A*o-E*n*x+e*A*x+u*n*j-e*p*j)*ht,t[10]=(s*A*o-E*a*o+E*n*l-e*A*l-s*n*j+e*a*j)*ht,t[11]=(u*a*o-s*p*o-u*n*l+e*p*l+s*n*x-e*a*x)*ht,t[12]=it*ht,t[13]=(u*A*r-E*p*r+E*n*y-e*A*y-u*n*C+e*p*C)*ht,t[14]=(E*a*r-s*A*r-E*n*h+e*A*h+s*n*C-e*a*C)*ht,t[15]=(s*p*r-u*a*r+u*n*h-e*p*h-s*n*y+e*a*y)*ht,this}scale(t){const e=this.elements,n=t.x,r=t.y,o=t.z;return e[0]*=n,e[4]*=r,e[8]*=o,e[1]*=n,e[5]*=r,e[9]*=o,e[2]*=n,e[6]*=r,e[10]*=o,e[3]*=n,e[7]*=r,e[11]*=o,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,r))}makeTranslation(t,e,n){return this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),r=Math.sin(e),o=1-n,s=t.x,a=t.y,h=t.z,l=o*s,u=o*a;return this.set(l*s+n,l*a-r*h,l*h+r*a,0,l*a+r*h,u*a+n,u*h-r*s,0,l*h-r*a,u*h+r*s,o*h*h+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,r,o,s){return this.set(1,n,o,0,t,1,s,0,e,r,1,0,0,0,0,1),this}compose(t,e,n){const r=this.elements,o=e._x,s=e._y,a=e._z,h=e._w,l=o+o,u=s+s,p=a+a,y=o*l,x=o*u,E=o*p,A=s*u,C=s*p,j=a*p,Q=h*l,rt=h*u,pt=h*p,it=n.x,gt=n.y,ht=n.z;return r[0]=(1-(A+j))*it,r[1]=(x+pt)*it,r[2]=(E-rt)*it,r[3]=0,r[4]=(x-pt)*gt,r[5]=(1-(y+j))*gt,r[6]=(C+Q)*gt,r[7]=0,r[8]=(E+rt)*ht,r[9]=(C-Q)*ht,r[10]=(1-(y+A))*ht,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this}decompose(t,e,n){const r=this.elements;let o=yt.set(r[0],r[1],r[2]).length();const s=yt.set(r[4],r[5],r[6]).length(),a=yt.set(r[8],r[9],r[10]).length();this.determinant()<0&&(o=-o),t.x=r[12],t.y=r[13],t.z=r[14],Et.copy(this);const h=1/o,l=1/s,u=1/a;return Et.elements[0]*=h,Et.elements[1]*=h,Et.elements[2]*=h,Et.elements[4]*=l,Et.elements[5]*=l,Et.elements[6]*=l,Et.elements[8]*=u,Et.elements[9]*=u,Et.elements[10]*=u,e.setFromRotationMatrix(Et),n.x=o,n.y=s,n.z=a,this}makePerspective(t,e,n,r,o,s){s===void 0&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const a=this.elements,h=2*o/(e-t),l=2*o/(n-r),u=(e+t)/(e-t),p=(n+r)/(n-r),y=-(s+o)/(s-o),x=-2*s*o/(s-o);return a[0]=h,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=l,a[9]=p,a[13]=0,a[2]=0,a[6]=0,a[10]=y,a[14]=x,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(t,e,n,r,o,s){const a=this.elements,h=1/(e-t),l=1/(n-r),u=1/(s-o),p=(e+t)*h,y=(n+r)*l,x=(s+o)*u;return a[0]=2*h,a[4]=0,a[8]=0,a[12]=-p,a[1]=0,a[5]=2*l,a[9]=0,a[13]=-y,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-x,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(t){const e=this.elements,n=t.elements;for(let r=0;r<16;r++)if(e[r]!==n[r])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}tn.prototype.isMatrix4=!0;const yt=new U,Et=new tn,Rt=new U(0,0,0),Qt=new U(1,1,1),Wt=new U,Kt=new U,oe=new U,Me=new tn,we=new z;class Se{constructor(t=0,e=0,n=0,r=Se.DefaultOrder){this._x=t,this._y=e,this._z=n,this._order=r}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,r=this._order){return this._x=t,this._y=e,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){const r=t.elements,o=r[0],s=r[4],a=r[8],h=r[1],l=r[5],u=r[9],p=r[2],y=r[6],x=r[10];switch(e){case"XYZ":this._y=Math.asin(et(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,x),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(y,l),this._z=0);break;case"YXZ":this._x=Math.asin(-et(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,x),this._z=Math.atan2(h,l)):(this._y=Math.atan2(-p,o),this._z=0);break;case"ZXY":this._x=Math.asin(et(y,-1,1)),Math.abs(y)<.9999999?(this._y=Math.atan2(-p,x),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(h,o));break;case"ZYX":this._y=Math.asin(-et(p,-1,1)),Math.abs(p)<.9999999?(this._x=Math.atan2(y,x),this._z=Math.atan2(h,o)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(et(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-p,o)):(this._x=0,this._y=Math.atan2(a,x));break;case"XZY":this._z=Math.asin(-et(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(y,l),this._y=Math.atan2(a,o)):(this._x=Math.atan2(-u,x),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,n===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return Me.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Me,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return we.setFromEuler(this),this.setFromQuaternion(we,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}toVector3(t){return t?t.set(this._x,this._y,this._z):new U(this._x,this._y,this._z)}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}}Se.prototype.isEuler=!0,Se.DefaultOrder="XYZ",Se.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class Ve{constructor(){this.mask=1}set(t){this.mask=1<<t|0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!=0}}let en=0;const dn=new U,Tn=new z,yn=new tn,Xn=new U,Pn=new U,zi=new U,mo=new z,io=new U(1,0,0),Fn=new U(0,1,0),Yo=new U(0,0,1),ro={type:"added"},go={type:"removed"};class Un extends D{constructor(){super(),Object.defineProperty(this,"id",{value:en++}),this.uuid=X(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Un.DefaultUp.clone();const t=new U,e=new Se,n=new z,r=new U(1,1,1);e._onChange(function(){n.setFromEuler(e,!1)}),n._onChange(function(){e.setFromQuaternion(n,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new tn},normalMatrix:{value:new B}}),this.matrix=new tn,this.matrixWorld=new tn,this.matrixAutoUpdate=Un.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new Ve,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return Tn.setFromAxisAngle(t,e),this.quaternion.multiply(Tn),this}rotateOnWorldAxis(t,e){return Tn.setFromAxisAngle(t,e),this.quaternion.premultiply(Tn),this}rotateX(t){return this.rotateOnAxis(io,t)}rotateY(t){return this.rotateOnAxis(Fn,t)}rotateZ(t){return this.rotateOnAxis(Yo,t)}translateOnAxis(t,e){return dn.copy(t).applyQuaternion(this.quaternion),this.position.add(dn.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(io,t)}translateY(t){return this.translateOnAxis(Fn,t)}translateZ(t){return this.translateOnAxis(Yo,t)}localToWorld(t){return t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return t.applyMatrix4(yn.copy(this.matrixWorld).invert())}lookAt(t,e,n){t.isVector3?Xn.copy(t):Xn.set(t,e,n);const r=this.parent;this.updateWorldMatrix(!0,!1),Pn.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?yn.lookAt(Pn,Xn,this.up):yn.lookAt(Xn,Pn,this.up),this.quaternion.setFromRotationMatrix(yn),r&&(yn.extractRotation(r.matrixWorld),Tn.setFromRotationMatrix(yn),this.quaternion.premultiply(Tn.invert()))}add(t){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(t.parent!==null&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent(ro)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const e=this.children.indexOf(t);return e!==-1&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(go)),this}removeFromParent(){const t=this.parent;return t!==null&&t.remove(this),this}clear(){for(let t=0;t<this.children.length;t++){const e=this.children[t];e.parent=null,e.dispatchEvent(go)}return this.children.length=0,this}attach(t){return this.updateWorldMatrix(!0,!1),yn.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),yn.multiply(t.parent.matrixWorld)),t.applyMatrix4(yn),this.add(t),t.updateWorldMatrix(!1,!0),this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let n=0,r=this.children.length;n<r;n++){const o=this.children[n].getObjectByProperty(t,e);if(o!==void 0)return o}}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Pn,t,zi),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Pn,mo,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let n=0,r=e.length;n<r;n++)e[n].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);const e=this.children;for(let n=0,r=e.length;n<r;n++)e[n].traverseVisible(t)}traverseAncestors(t){const e=this.parent;e!==null&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let n=0,r=e.length;n<r;n++)e[n].updateMatrixWorld(t)}updateWorldMatrix(t,e){const n=this.parent;if(t===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),e===!0){const r=this.children;for(let o=0,s=r.length;o<s;o++)r[o].updateWorldMatrix(!1,!0)}}toJSON(t){const e=t===void 0||typeof t=="string",n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});const r={};function o(a,h){return a[h.uuid]===void 0&&(a[h.uuid]=h.toJSON(t)),h.uuid}if(r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),JSON.stringify(this.userData)!=="{}"&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&(r.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=o(t.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const h=a.shapes;if(Array.isArray(h))for(let l=0,u=h.length;l<u;l++){const p=h[l];o(t.shapes,p)}else o(t.shapes,h)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(o(t.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const a=[];for(let h=0,l=this.material.length;h<l;h++)a.push(o(t.materials,this.material[h]));r.material=a}else r.material=o(t.materials,this.material);if(this.children.length>0){r.children=[];for(let a=0;a<this.children.length;a++)r.children.push(this.children[a].toJSON(t).object)}if(this.animations.length>0){r.animations=[];for(let a=0;a<this.animations.length;a++){const h=this.animations[a];r.animations.push(o(t.animations,h))}}if(e){const a=s(t.geometries),h=s(t.materials),l=s(t.textures),u=s(t.images),p=s(t.shapes),y=s(t.skeletons),x=s(t.animations);a.length>0&&(n.geometries=a),h.length>0&&(n.materials=h),l.length>0&&(n.textures=l),u.length>0&&(n.images=u),p.length>0&&(n.shapes=p),y.length>0&&(n.skeletons=y),x.length>0&&(n.animations=x)}return n.object=r,n;function s(a){const h=[];for(const l in a){const u=a[l];delete u.metadata,h.push(u)}return h}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(let n=0;n<t.children.length;n++){const r=t.children[n];this.add(r.clone())}return this}}Un.DefaultUp=new U(0,1,0),Un.DefaultMatrixAutoUpdate=!0,Un.prototype.isObject3D=!0;const jn=new U,Ki=new U,Vr=new U,Mi=new U,wr=new U,Lr=new U,qo=new U,Jo=new U,vo=new U,_o=new U;class ui{constructor(t=new U,e=new U,n=new U){this.a=t,this.b=e,this.c=n}static getNormal(t,e,n,r){r.subVectors(n,e),jn.subVectors(t,e),r.cross(jn);const o=r.lengthSq();return o>0?r.multiplyScalar(1/Math.sqrt(o)):r.set(0,0,0)}static getBarycoord(t,e,n,r,o){jn.subVectors(r,e),Ki.subVectors(n,e),Vr.subVectors(t,e);const s=jn.dot(jn),a=jn.dot(Ki),h=jn.dot(Vr),l=Ki.dot(Ki),u=Ki.dot(Vr),p=s*l-a*a;if(p===0)return o.set(-2,-1,-1);const y=1/p,x=(l*h-a*u)*y,E=(s*u-a*h)*y;return o.set(1-x-E,E,x)}static containsPoint(t,e,n,r){return this.getBarycoord(t,e,n,r,Mi),Mi.x>=0&&Mi.y>=0&&Mi.x+Mi.y<=1}static getUV(t,e,n,r,o,s,a,h){return this.getBarycoord(t,e,n,r,Mi),h.set(0,0),h.addScaledVector(o,Mi.x),h.addScaledVector(s,Mi.y),h.addScaledVector(a,Mi.z),h}static isFrontFacing(t,e,n,r){return jn.subVectors(n,e),Ki.subVectors(t,e),jn.cross(Ki).dot(r)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,r){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[r]),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return jn.subVectors(this.c,this.b),Ki.subVectors(this.a,this.b),.5*jn.cross(Ki).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return ui.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return ui.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,n,r,o){return ui.getUV(t,this.a,this.b,this.c,e,n,r,o)}containsPoint(t){return ui.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return ui.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const n=this.a,r=this.b,o=this.c;let s,a;wr.subVectors(r,n),Lr.subVectors(o,n),Jo.subVectors(t,n);const h=wr.dot(Jo),l=Lr.dot(Jo);if(h<=0&&l<=0)return e.copy(n);vo.subVectors(t,r);const u=wr.dot(vo),p=Lr.dot(vo);if(u>=0&&p<=u)return e.copy(r);const y=h*p-u*l;if(y<=0&&h>=0&&u<=0)return s=h/(h-u),e.copy(n).addScaledVector(wr,s);_o.subVectors(t,o);const x=wr.dot(_o),E=Lr.dot(_o);if(E>=0&&x<=E)return e.copy(o);const A=x*l-h*E;if(A<=0&&l>=0&&E<=0)return a=l/(l-E),e.copy(n).addScaledVector(Lr,a);const C=u*E-x*p;if(C<=0&&p-u>=0&&x-E>=0)return qo.subVectors(o,r),a=(p-u)/(p-u+(x-E)),e.copy(r).addScaledVector(qo,a);const j=1/(C+A+y);return s=A*j,a=y*j,e.copy(n).addScaledVector(wr,s).addScaledVector(Lr,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}let Ko=0;class Ci extends D{constructor(){super(),Object.defineProperty(this,"id",{value:Ko++}),this.uuid=X(),this.name="",this.type="Material",this.fog=!0,this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=7680,this.stencilZFail=7680,this.stencilZPass=7680,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}onBuild(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const e in t){const n=t[e];if(n===void 0){console.warn("THREE.Material: '"+e+"' parameter is undefined.");continue}if(e==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===1;continue}const r=this[e];r!==void 0?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[e]=n:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}}toJSON(t){const e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});const n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(o){const s=[];for(const a in o){const h=o[a];delete h.metadata,s.push(h)}return s}if(n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==1&&(n.blending=this.blending),this.side!==0&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(n.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.morphTargets===!0&&(n.morphTargets=!0),this.morphNormals===!0&&(n.morphNormals=!0),this.flatShading===!0&&(n.flatShading=this.flatShading),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData),e){const o=r(t.textures),s=r(t.images);o.length>0&&(n.textures=o),s.length>0&&(n.images=s)}return n}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let n=null;if(e!==null){const r=e.length;n=new Array(r);for(let o=0;o!==r;++o)n[o]=e[o].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}}Ci.prototype.isMaterial=!0;const mr={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Pi={h:0,s:0,l:0},Dr={h:0,s:0,l:0};function yo(i,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?i+6*(t-i)*e:e<.5?t:e<2/3?i+6*(t-i)*(2/3-e):i}function oo(i){return i<.04045?.0773993808*i:Math.pow(.9478672986*i+.0521327014,2.4)}function xo(i){return i<.0031308?12.92*i:1.055*Math.pow(i,.41666)-.055}class fn{constructor(t,e,n){return e===void 0&&n===void 0?this.set(t):this.setRGB(t,e,n)}set(t){return t&&t.isColor?this.copy(t):typeof t=="number"?this.setHex(t):typeof t=="string"&&this.setStyle(t),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this}setRGB(t,e,n){return this.r=t,this.g=e,this.b=n,this}setHSL(t,e,n){if(t=ft(t,1),e=et(e,0,1),n=et(n,0,1),e===0)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+e):n+e-n*e,o=2*n-r;this.r=yo(o,r,t+1/3),this.g=yo(o,r,t),this.b=yo(o,r,t-1/3)}return this}setStyle(t){function e(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let r;const o=n[1],s=n[2];switch(o){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,e(r[4]),this;if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,e(r[4]),this;break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s)){const a=parseFloat(r[1])/360,h=parseInt(r[2],10)/100,l=parseInt(r[3],10)/100;return e(r[4]),this.setHSL(a,h,l)}}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(t)){const r=n[1],o=r.length;if(o===3)return this.r=parseInt(r.charAt(0)+r.charAt(0),16)/255,this.g=parseInt(r.charAt(1)+r.charAt(1),16)/255,this.b=parseInt(r.charAt(2)+r.charAt(2),16)/255,this;if(o===6)return this.r=parseInt(r.charAt(0)+r.charAt(1),16)/255,this.g=parseInt(r.charAt(2)+r.charAt(3),16)/255,this.b=parseInt(r.charAt(4)+r.charAt(5),16)/255,this}return t&&t.length>0?this.setColorName(t):this}setColorName(t){const e=mr[t.toLowerCase()];return e!==void 0?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copyGammaToLinear(t,e=2){return this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this}copyLinearToGamma(t,e=2){const n=e>0?1/e:1;return this.r=Math.pow(t.r,n),this.g=Math.pow(t.g,n),this.b=Math.pow(t.b,n),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.r=oo(t.r),this.g=oo(t.g),this.b=oo(t.b),this}copyLinearToSRGB(t){return this.r=xo(t.r),this.g=xo(t.g),this.b=xo(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(t){const e=this.r,n=this.g,r=this.b,o=Math.max(e,n,r),s=Math.min(e,n,r);let a,h;const l=(s+o)/2;if(s===o)a=0,h=0;else{const u=o-s;switch(h=l<=.5?u/(o+s):u/(2-o-s),o){case e:a=(n-r)/u+(n<r?6:0);break;case n:a=(r-e)/u+2;break;case r:a=(e-n)/u+4}a/=6}return t.h=a,t.s=h,t.l=l,t}getStyle(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"}offsetHSL(t,e,n){return this.getHSL(Pi),Pi.h+=t,Pi.s+=e,Pi.l+=n,this.setHSL(Pi.h,Pi.s,Pi.l),this}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,n){return this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}lerpHSL(t,e){this.getHSL(Pi),t.getHSL(Dr);const n=Dt(Pi.h,Dr.h,e),r=Dt(Pi.s,Dr.s,e),o=Dt(Pi.l,Dr.l,e);return this.setHSL(n,r,o),this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),t.normalized===!0&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}}fn.NAMES=mr,fn.prototype.isColor=!0,fn.prototype.r=1,fn.prototype.g=1,fn.prototype.b=1;class Zi extends Ci{constructor(t){super(),this.type="MeshBasicMaterial",this.color=new fn(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.morphTargets=t.morphTargets,this}}Zi.prototype.isMeshBasicMaterial=!0;const Mn=new U,bo=new R;class Yn{constructor(t,e,n){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=n===!0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let r=0,o=this.itemSize;r<o;r++)this.array[t+r]=e.array[n+r];return this}copyArray(t){return this.array.set(t),this}copyColorsArray(t){const e=this.array;let n=0;for(let r=0,o=t.length;r<o;r++){let s=t[r];s===void 0&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),s=new fn),e[n++]=s.r,e[n++]=s.g,e[n++]=s.b}return this}copyVector2sArray(t){const e=this.array;let n=0;for(let r=0,o=t.length;r<o;r++){let s=t[r];s===void 0&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),s=new R),e[n++]=s.x,e[n++]=s.y}return this}copyVector3sArray(t){const e=this.array;let n=0;for(let r=0,o=t.length;r<o;r++){let s=t[r];s===void 0&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),s=new U),e[n++]=s.x,e[n++]=s.y,e[n++]=s.z}return this}copyVector4sArray(t){const e=this.array;let n=0;for(let r=0,o=t.length;r<o;r++){let s=t[r];s===void 0&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),s=new Ot),e[n++]=s.x,e[n++]=s.y,e[n++]=s.z,e[n++]=s.w}return this}applyMatrix3(t){if(this.itemSize===2)for(let e=0,n=this.count;e<n;e++)bo.fromBufferAttribute(this,e),bo.applyMatrix3(t),this.setXY(e,bo.x,bo.y);else if(this.itemSize===3)for(let e=0,n=this.count;e<n;e++)Mn.fromBufferAttribute(this,e),Mn.applyMatrix3(t),this.setXYZ(e,Mn.x,Mn.y,Mn.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)Mn.x=this.getX(e),Mn.y=this.getY(e),Mn.z=this.getZ(e),Mn.applyMatrix4(t),this.setXYZ(e,Mn.x,Mn.y,Mn.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)Mn.x=this.getX(e),Mn.y=this.getY(e),Mn.z=this.getZ(e),Mn.applyNormalMatrix(t),this.setXYZ(e,Mn.x,Mn.y,Mn.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)Mn.x=this.getX(e),Mn.y=this.getY(e),Mn.z=this.getZ(e),Mn.transformDirection(t),this.setXYZ(e,Mn.x,Mn.y,Mn.z);return this}set(t,e=0){return this.array.set(t,e),this}getX(t){return this.array[t*this.itemSize]}setX(t,e){return this.array[t*this.itemSize]=e,this}getY(t){return this.array[t*this.itemSize+1]}setY(t,e){return this.array[t*this.itemSize+1]=e,this}getZ(t){return this.array[t*this.itemSize+2]}setZ(t,e){return this.array[t*this.itemSize+2]=e,this}getW(t){return this.array[t*this.itemSize+3]}setW(t,e){return this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this}setXYZ(t,e,n,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this}setXYZW(t,e,n,r,o){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this.array[t+3]=o,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized};return this.name!==""&&(t.name=this.name),this.usage!==35044&&(t.usage=this.usage),this.updateRange.offset===0&&this.updateRange.count===-1||(t.updateRange=this.updateRange),t}}Yn.prototype.isBufferAttribute=!0;class vs extends Yn{constructor(t,e,n){super(new Uint16Array(t),e,n)}}class ea extends Yn{constructor(t,e,n){super(new Int32Array(t),e,n)}}class To extends Yn{constructor(t,e,n){super(new Uint32Array(t),e,n)}}(class extends Yn{constructor(i,t,e){super(new Uint16Array(i),t,e)}}).prototype.isFloat16BufferAttribute=!0;class An extends Yn{constructor(t,e,n){super(new Float32Array(t),e,n)}}function _s(i){if(i.length===0)return-1/0;let t=i[0];for(let e=1,n=i.length;e<n;++e)i[e]>t&&(t=i[e]);return t}let Zo=0;const xi=new tn,Qo=new Un,gr=new U,Oi=new vt,so=new vt,fi=new U;class Wn extends D{constructor(){super(),Object.defineProperty(this,"id",{value:Zo++}),this.uuid=X(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(_s(t)>65535?To:vs)(t,1):this.index=t,this}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return this.attributes[t]!==void 0}addGroup(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){const e=this.attributes.position;e!==void 0&&(e.applyMatrix4(t),e.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const o=new B().getNormalMatrix(t);n.applyNormalMatrix(o),n.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(t),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(t){return xi.makeRotationFromQuaternion(t),this.applyMatrix4(xi),this}rotateX(t){return xi.makeRotationX(t),this.applyMatrix4(xi),this}rotateY(t){return xi.makeRotationY(t),this.applyMatrix4(xi),this}rotateZ(t){return xi.makeRotationZ(t),this.applyMatrix4(xi),this}translate(t,e,n){return xi.makeTranslation(t,e,n),this.applyMatrix4(xi),this}scale(t,e,n){return xi.makeScale(t,e,n),this.applyMatrix4(xi),this}lookAt(t){return Qo.lookAt(t),Qo.updateMatrix(),this.applyMatrix4(Qo.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(gr).negate(),this.translate(gr.x,gr.y,gr.z),this}setFromPoints(t){const e=[];for(let n=0,r=t.length;n<r;n++){const o=t[n];e.push(o.x,o.y,o.z||0)}return this.setAttribute("position",new An(e,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new vt);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingBox.set(new U(-1/0,-1/0,-1/0),new U(1/0,1/0,1/0));if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let n=0,r=e.length;n<r;n++){const o=e[n];Oi.setFromBufferAttribute(o),this.morphTargetsRelative?(fi.addVectors(this.boundingBox.min,Oi.min),this.boundingBox.expandByPoint(fi),fi.addVectors(this.boundingBox.max,Oi.max),this.boundingBox.expandByPoint(fi)):(this.boundingBox.expandByPoint(Oi.min),this.boundingBox.expandByPoint(Oi.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Ge);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingSphere.set(new U,1/0);if(t){const n=this.boundingSphere.center;if(Oi.setFromBufferAttribute(t),e)for(let o=0,s=e.length;o<s;o++){const a=e[o];so.setFromBufferAttribute(a),this.morphTargetsRelative?(fi.addVectors(Oi.min,so.min),Oi.expandByPoint(fi),fi.addVectors(Oi.max,so.max),Oi.expandByPoint(fi)):(Oi.expandByPoint(so.min),Oi.expandByPoint(so.max))}Oi.getCenter(n);let r=0;for(let o=0,s=t.count;o<s;o++)fi.fromBufferAttribute(t,o),r=Math.max(r,n.distanceToSquared(fi));if(e)for(let o=0,s=e.length;o<s;o++){const a=e[o],h=this.morphTargetsRelative;for(let l=0,u=a.count;l<u;l++)fi.fromBufferAttribute(a,l),h&&(gr.fromBufferAttribute(t,l),fi.add(gr)),r=Math.max(r,n.distanceToSquared(fi))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeFaceNormals(){}computeTangents(){const t=this.index,e=this.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const n=t.array,r=e.position.array,o=e.normal.array,s=e.uv.array,a=r.length/3;e.tangent===void 0&&this.setAttribute("tangent",new Yn(new Float32Array(4*a),4));const h=e.tangent.array,l=[],u=[];for(let Ft=0;Ft<a;Ft++)l[Ft]=new U,u[Ft]=new U;const p=new U,y=new U,x=new U,E=new R,A=new R,C=new R,j=new U,Q=new U;function rt(Ft,Mt,wt){p.fromArray(r,3*Ft),y.fromArray(r,3*Mt),x.fromArray(r,3*wt),E.fromArray(s,2*Ft),A.fromArray(s,2*Mt),C.fromArray(s,2*wt),y.sub(p),x.sub(p),A.sub(E),C.sub(E);const Pt=1/(A.x*C.y-C.x*A.y);isFinite(Pt)&&(j.copy(y).multiplyScalar(C.y).addScaledVector(x,-A.y).multiplyScalar(Pt),Q.copy(x).multiplyScalar(A.x).addScaledVector(y,-C.x).multiplyScalar(Pt),l[Ft].add(j),l[Mt].add(j),l[wt].add(j),u[Ft].add(Q),u[Mt].add(Q),u[wt].add(Q))}let pt=this.groups;pt.length===0&&(pt=[{start:0,count:n.length}]);for(let Ft=0,Mt=pt.length;Ft<Mt;++Ft){const wt=pt[Ft],Pt=wt.start;for(let Nt=Pt,ne=Pt+wt.count;Nt<ne;Nt+=3)rt(n[Nt+0],n[Nt+1],n[Nt+2])}const it=new U,gt=new U,ht=new U,mt=new U;function jt(Ft){ht.fromArray(o,3*Ft),mt.copy(ht);const Mt=l[Ft];it.copy(Mt),it.sub(ht.multiplyScalar(ht.dot(Mt))).normalize(),gt.crossVectors(mt,Mt);const wt=gt.dot(u[Ft])<0?-1:1;h[4*Ft]=it.x,h[4*Ft+1]=it.y,h[4*Ft+2]=it.z,h[4*Ft+3]=wt}for(let Ft=0,Mt=pt.length;Ft<Mt;++Ft){const wt=pt[Ft],Pt=wt.start;for(let Nt=Pt,ne=Pt+wt.count;Nt<ne;Nt+=3)jt(n[Nt+0]),jt(n[Nt+1]),jt(n[Nt+2])}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(e!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new Yn(new Float32Array(3*e.count),3),this.setAttribute("normal",n);else for(let y=0,x=n.count;y<x;y++)n.setXYZ(y,0,0,0);const r=new U,o=new U,s=new U,a=new U,h=new U,l=new U,u=new U,p=new U;if(t)for(let y=0,x=t.count;y<x;y+=3){const E=t.getX(y+0),A=t.getX(y+1),C=t.getX(y+2);r.fromBufferAttribute(e,E),o.fromBufferAttribute(e,A),s.fromBufferAttribute(e,C),u.subVectors(s,o),p.subVectors(r,o),u.cross(p),a.fromBufferAttribute(n,E),h.fromBufferAttribute(n,A),l.fromBufferAttribute(n,C),a.add(u),h.add(u),l.add(u),n.setXYZ(E,a.x,a.y,a.z),n.setXYZ(A,h.x,h.y,h.z),n.setXYZ(C,l.x,l.y,l.z)}else for(let y=0,x=e.count;y<x;y+=3)r.fromBufferAttribute(e,y+0),o.fromBufferAttribute(e,y+1),s.fromBufferAttribute(e,y+2),u.subVectors(s,o),p.subVectors(r,o),u.cross(p),n.setXYZ(y+0,u.x,u.y,u.z),n.setXYZ(y+1,u.x,u.y,u.z),n.setXYZ(y+2,u.x,u.y,u.z);this.normalizeNormals(),n.needsUpdate=!0}}merge(t,e){if(!t||!t.isBufferGeometry)return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t);e===void 0&&(e=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));const n=this.attributes;for(const r in n){if(t.attributes[r]===void 0)continue;const o=n[r].array,s=t.attributes[r],a=s.array,h=s.itemSize*e,l=Math.min(a.length,o.length-h);for(let u=0,p=h;u<l;u++,p++)o[p]=a[u]}return this}normalizeNormals(){const t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)fi.fromBufferAttribute(t,e),fi.normalize(),t.setXYZ(e,fi.x,fi.y,fi.z)}toNonIndexed(){function t(a,h){const l=a.array,u=a.itemSize,p=a.normalized,y=new l.constructor(h.length*u);let x=0,E=0;for(let A=0,C=h.length;A<C;A++){x=a.isInterleavedBufferAttribute?h[A]*a.data.stride+a.offset:h[A]*u;for(let j=0;j<u;j++)y[E++]=l[x++]}return new Yn(y,u,p)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new Wn,n=this.index.array,r=this.attributes;for(const a in r){const h=t(r[a],n);e.setAttribute(a,h)}const o=this.morphAttributes;for(const a in o){const h=[],l=o[a];for(let u=0,p=l.length;u<p;u++){const y=t(l[u],n);h.push(y)}e.morphAttributes[a]=h}e.morphTargetsRelative=this.morphTargetsRelative;const s=this.groups;for(let a=0,h=s.length;a<h;a++){const l=s[a];e.addGroup(l.start,l.count,l.materialIndex)}return e}toJSON(){const t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),this.parameters!==void 0){const h=this.parameters;for(const l in h)h[l]!==void 0&&(t[l]=h[l]);return t}t.data={attributes:{}};const e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const h in n){const l=n[h];t.data.attributes[h]=l.toJSON(t.data)}const r={};let o=!1;for(const h in this.morphAttributes){const l=this.morphAttributes[h],u=[];for(let p=0,y=l.length;p<y;p++){const x=l[p];u.push(x.toJSON(t.data))}u.length>0&&(r[h]=u,o=!0)}o&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));const a=this.boundingSphere;return a!==null&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),t}clone(){return new Wn().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;n!==null&&this.setIndex(n.clone(e));const r=t.attributes;for(const l in r){const u=r[l];this.setAttribute(l,u.clone(e))}const o=t.morphAttributes;for(const l in o){const u=[],p=o[l];for(let y=0,x=p.length;y<x;y++)u.push(p[y].clone(e));this.morphAttributes[l]=u}this.morphTargetsRelative=t.morphTargetsRelative;const s=t.groups;for(let l=0,u=s.length;l<u;l++){const p=s[l];this.addGroup(p.start,p.count,p.materialIndex)}const a=t.boundingBox;a!==null&&(this.boundingBox=a.clone());const h=t.boundingSphere;return h!==null&&(this.boundingSphere=h.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}Wn.prototype.isBufferGeometry=!0;const Eo=new tn,Fr=new pi,So=new Ge,Ar=new U,Mr=new U,or=new U,wo=new U,Ao=new U,Mo=new U,q=new U,g=new U,m=new U,_=new R,N=new R,J=new R,lt=new U,xt=new U;class Tt extends Un{constructor(t=new Wn,e=new Zi){super(),this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t){return super.copy(t),t.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),t.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=t.material,this.geometry=t.geometry,this}updateMorphTargets(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,n=Object.keys(e);if(n.length>0){const r=e[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=r.length;o<s;o++){const a=r[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=o}}}}else{const e=t.morphTargets;e!==void 0&&e.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(t,e){const n=this.geometry,r=this.material,o=this.matrixWorld;if(r===void 0||(n.boundingSphere===null&&n.computeBoundingSphere(),So.copy(n.boundingSphere),So.applyMatrix4(o),t.ray.intersectsSphere(So)===!1)||(Eo.copy(o).invert(),Fr.copy(t.ray).applyMatrix4(Eo),n.boundingBox!==null&&Fr.intersectsBox(n.boundingBox)===!1))return;let s;if(n.isBufferGeometry){const a=n.index,h=n.attributes.position,l=n.morphAttributes.position,u=n.morphTargetsRelative,p=n.attributes.uv,y=n.attributes.uv2,x=n.groups,E=n.drawRange;if(a!==null)if(Array.isArray(r))for(let A=0,C=x.length;A<C;A++){const j=x[A],Q=r[j.materialIndex];for(let rt=Math.max(j.start,E.start),pt=Math.min(j.start+j.count,E.start+E.count);rt<pt;rt+=3){const it=a.getX(rt),gt=a.getX(rt+1),ht=a.getX(rt+2);s=Zt(this,Q,t,Fr,h,l,u,p,y,it,gt,ht),s&&(s.faceIndex=Math.floor(rt/3),s.face.materialIndex=j.materialIndex,e.push(s))}}else for(let A=Math.max(0,E.start),C=Math.min(a.count,E.start+E.count);A<C;A+=3){const j=a.getX(A),Q=a.getX(A+1),rt=a.getX(A+2);s=Zt(this,r,t,Fr,h,l,u,p,y,j,Q,rt),s&&(s.faceIndex=Math.floor(A/3),e.push(s))}else if(h!==void 0)if(Array.isArray(r))for(let A=0,C=x.length;A<C;A++){const j=x[A],Q=r[j.materialIndex];for(let rt=Math.max(j.start,E.start),pt=Math.min(j.start+j.count,E.start+E.count);rt<pt;rt+=3)s=Zt(this,Q,t,Fr,h,l,u,p,y,rt,rt+1,rt+2),s&&(s.faceIndex=Math.floor(rt/3),s.face.materialIndex=j.materialIndex,e.push(s))}else for(let A=Math.max(0,E.start),C=Math.min(h.count,E.start+E.count);A<C;A+=3)s=Zt(this,r,t,Fr,h,l,u,p,y,A,A+1,A+2),s&&(s.faceIndex=Math.floor(A/3),e.push(s))}else n.isGeometry&&console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}function Zt(i,t,e,n,r,o,s,a,h,l,u,p){Ar.fromBufferAttribute(r,l),Mr.fromBufferAttribute(r,u),or.fromBufferAttribute(r,p);const y=i.morphTargetInfluences;if(t.morphTargets&&o&&y){q.set(0,0,0),g.set(0,0,0),m.set(0,0,0);for(let E=0,A=o.length;E<A;E++){const C=y[E],j=o[E];C!==0&&(wo.fromBufferAttribute(j,l),Ao.fromBufferAttribute(j,u),Mo.fromBufferAttribute(j,p),s?(q.addScaledVector(wo,C),g.addScaledVector(Ao,C),m.addScaledVector(Mo,C)):(q.addScaledVector(wo.sub(Ar),C),g.addScaledVector(Ao.sub(Mr),C),m.addScaledVector(Mo.sub(or),C)))}Ar.add(q),Mr.add(g),or.add(m)}i.isSkinnedMesh&&(i.boneTransform(l,Ar),i.boneTransform(u,Mr),i.boneTransform(p,or));const x=function(E,A,C,j,Q,rt,pt,it){let gt;if(gt=A.side===1?j.intersectTriangle(pt,rt,Q,!0,it):j.intersectTriangle(Q,rt,pt,A.side!==2,it),gt===null)return null;xt.copy(it),xt.applyMatrix4(E.matrixWorld);const ht=C.ray.origin.distanceTo(xt);return ht<C.near||ht>C.far?null:{distance:ht,point:xt.clone(),object:E}}(i,t,e,n,Ar,Mr,or,lt);if(x){a&&(_.fromBufferAttribute(a,l),N.fromBufferAttribute(a,u),J.fromBufferAttribute(a,p),x.uv=ui.getUV(lt,Ar,Mr,or,_,N,J,new R)),h&&(_.fromBufferAttribute(h,l),N.fromBufferAttribute(h,u),J.fromBufferAttribute(h,p),x.uv2=ui.getUV(lt,Ar,Mr,or,_,N,J,new R));const E={a:l,b:u,c:p,normal:new U,materialIndex:0};ui.getNormal(Ar,Mr,or,E.normal),x.face=E}return x}Tt.prototype.isMesh=!0;class ee extends Wn{constructor(t=1,e=1,n=1,r=1,o=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:r,heightSegments:o,depthSegments:s};const a=this;r=Math.floor(r),o=Math.floor(o),s=Math.floor(s);const h=[],l=[],u=[],p=[];let y=0,x=0;function E(A,C,j,Q,rt,pt,it,gt,ht,mt,jt){const Ft=pt/ht,Mt=it/mt,wt=pt/2,Pt=it/2,Nt=gt/2,ne=ht+1,$t=mt+1;let Vt=0,Yt=0;const ge=new U;for(let be=0;be<$t;be++){const Pe=be*Mt-Pt;for(let Ct=0;Ct<ne;Ct++){const Bt=Ct*Ft-wt;ge[A]=Bt*Q,ge[C]=Pe*rt,ge[j]=Nt,l.push(ge.x,ge.y,ge.z),ge[A]=0,ge[C]=0,ge[j]=gt>0?1:-1,u.push(ge.x,ge.y,ge.z),p.push(Ct/ht),p.push(1-be/mt),Vt+=1}}for(let be=0;be<mt;be++)for(let Pe=0;Pe<ht;Pe++){const Ct=y+Pe+ne*be,Bt=y+Pe+ne*(be+1),ve=y+(Pe+1)+ne*(be+1),le=y+(Pe+1)+ne*be;h.push(Ct,Bt,le),h.push(Bt,ve,le),Yt+=6}a.addGroup(x,Yt,jt),x+=Yt,y+=Vt}E("z","y","x",-1,-1,n,e,t,s,o,0),E("z","y","x",1,-1,n,e,-t,s,o,1),E("x","z","y",1,1,t,n,e,r,s,2),E("x","z","y",1,-1,t,n,-e,r,s,3),E("x","y","z",1,-1,t,e,n,r,o,4),E("x","y","z",-1,-1,t,e,-n,r,o,5),this.setIndex(h),this.setAttribute("position",new An(l,3)),this.setAttribute("normal",new An(u,3)),this.setAttribute("uv",new An(p,2))}static fromJSON(t){return new ee(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}function Fe(i){const t={};for(const e in i){t[e]={};for(const n in i[e]){const r=i[e][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?t[e][n]=r.clone():Array.isArray(r)?t[e][n]=r.slice():t[e][n]=r}}return t}function Te(i){const t={};for(let e=0;e<i.length;e++){const n=Fe(i[e]);for(const r in n)t[r]=n[r]}return t}const Qe={clone:Fe,merge:Te};class hn extends Ci{constructor(t){super(),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=`void main() {
|
|
4071
4071
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
4072
4072
|
}`,this.fragmentShader=`void main() {
|
|
4073
4073
|
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
|
|
4074
|
-
}`,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,t!==void 0&&(t.attributes!==void 0&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Fe(t.uniforms),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.lights=t.lights,this.clipping=t.clipping,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this}toJSON(t){const e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(const r in this.uniforms){const o=this.uniforms[r].value;o&&o.isTexture?e.uniforms[r]={type:"t",value:o.toJSON(t).uuid}:o&&o.isColor?e.uniforms[r]={type:"c",value:o.getHex()}:o&&o.isVector2?e.uniforms[r]={type:"v2",value:o.toArray()}:o&&o.isVector3?e.uniforms[r]={type:"v3",value:o.toArray()}:o&&o.isVector4?e.uniforms[r]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?e.uniforms[r]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?e.uniforms[r]={type:"m4",value:o.toArray()}:e.uniforms[r]={value:o}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;const n={};for(const r in this.extensions)this.extensions[r]===!0&&(n[r]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}}hn.prototype.isShaderMaterial=!0;class vn extends Un{constructor(){super(),this.type="Camera",this.matrixWorldInverse=new tn,this.projectionMatrix=new tn,this.projectionMatrixInverse=new tn}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}vn.prototype.isCamera=!0;class un extends vn{constructor(t=50,e=1,n=.1,r=2e3){super(),this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=2*W*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(.5*
|
|
4074
|
+
}`,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,t!==void 0&&(t.attributes!==void 0&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Fe(t.uniforms),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.lights=t.lights,this.clipping=t.clipping,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this}toJSON(t){const e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(const r in this.uniforms){const o=this.uniforms[r].value;o&&o.isTexture?e.uniforms[r]={type:"t",value:o.toJSON(t).uuid}:o&&o.isColor?e.uniforms[r]={type:"c",value:o.getHex()}:o&&o.isVector2?e.uniforms[r]={type:"v2",value:o.toArray()}:o&&o.isVector3?e.uniforms[r]={type:"v3",value:o.toArray()}:o&&o.isVector4?e.uniforms[r]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?e.uniforms[r]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?e.uniforms[r]={type:"m4",value:o.toArray()}:e.uniforms[r]={value:o}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;const n={};for(const r in this.extensions)this.extensions[r]===!0&&(n[r]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}}hn.prototype.isShaderMaterial=!0;class vn extends Un{constructor(){super(),this.type="Camera",this.matrixWorldInverse=new tn,this.projectionMatrix=new tn,this.projectionMatrixInverse=new tn}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}vn.prototype.isCamera=!0;class un extends vn{constructor(t=50,e=1,n=.1,r=2e3){super(),this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=2*W*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(.5*V*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*W*Math.atan(Math.tan(.5*V*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(t,e,n,r,o,s){this.aspect=t/e,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=o,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(.5*V*this.fov)/this.zoom,n=2*e,r=this.aspect*n,o=-.5*r;const s=this.view;if(this.view!==null&&this.view.enabled){const h=s.fullWidth,l=s.fullHeight;o+=s.offsetX*r/h,e-=s.offsetY*n/l,r*=s.width/h,n*=s.height/l}const a=this.filmOffset;a!==0&&(o+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+r,e,e-n,t,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,this.view!==null&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}un.prototype.isPerspectiveCamera=!0;class Zn extends Un{constructor(t,e,n){if(super(),this.type="CubeCamera",n.isWebGLCubeRenderTarget!==!0)return void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");this.renderTarget=n;const r=new un(90,1,t,e);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new U(1,0,0)),this.add(r);const o=new un(90,1,t,e);o.layers=this.layers,o.up.set(0,-1,0),o.lookAt(new U(-1,0,0)),this.add(o);const s=new un(90,1,t,e);s.layers=this.layers,s.up.set(0,0,1),s.lookAt(new U(0,1,0)),this.add(s);const a=new un(90,1,t,e);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new U(0,-1,0)),this.add(a);const h=new un(90,1,t,e);h.layers=this.layers,h.up.set(0,-1,0),h.lookAt(new U(0,0,1)),this.add(h);const l=new un(90,1,t,e);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new U(0,0,-1)),this.add(l)}update(t,e){this.parent===null&&this.updateMatrixWorld();const n=this.renderTarget,[r,o,s,a,h,l]=this.children,u=t.xr.enabled,p=t.getRenderTarget();t.xr.enabled=!1;const y=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0),t.render(e,r),t.setRenderTarget(n,1),t.render(e,o),t.setRenderTarget(n,2),t.render(e,s),t.setRenderTarget(n,3),t.render(e,a),t.setRenderTarget(n,4),t.render(e,h),n.texture.generateMipmaps=y,t.setRenderTarget(n,5),t.render(e,l),t.setRenderTarget(p),t.xr.enabled=u}}class mi extends tt{constructor(t,e,n,r,o,s,a,h,l,u){super(t=t!==void 0?t:[],e=e!==void 0?e:301,n,r,o,s,a=a!==void 0?a:1022,h,l,u),this._needsFlipEnvMap=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}mi.prototype.isCubeTexture=!0;class gi extends zt{constructor(t,e,n){Number.isInteger(e)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),e=n),super(t,t,e),e=e||{},this.texture=new mi(void 0,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.encoding),this.texture.generateMipmaps=e.generateMipmaps!==void 0&&e.generateMipmaps,this.texture.minFilter=e.minFilter!==void 0?e.minFilter:1006,this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.format=1023,this.texture.encoding=e.encoding,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:`
|
|
4075
4075
|
|
|
4076
4076
|
varying vec3 vWorldDirection;
|
|
4077
4077
|
|
|
@@ -6958,7 +6958,7 @@ void main() {
|
|
|
6958
6958
|
squared_mean = squared_mean * HALF_SAMPLE_RATE;
|
|
6959
6959
|
float std_dev = sqrt( squared_mean - mean * mean );
|
|
6960
6960
|
gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
|
|
6961
|
-
}`}),x=y.clone();x.defines.HORIZONTAL_PASS=1;const E=new Wn;E.setAttribute("position",new Yn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const A=new Tt(E,y),C=this;function j(gt,ht){const mt=t.update(A);y.uniforms.shadow_pass.value=gt.map.texture,y.uniforms.resolution.value=gt.mapSize,y.uniforms.radius.value=gt.radius,i.setRenderTarget(gt.mapPass),i.clear(),i.renderBufferDirect(ht,null,mt,y,A,null),x.uniforms.shadow_pass.value=gt.mapPass.texture,x.uniforms.resolution.value=gt.mapSize,x.uniforms.radius.value=gt.radius,i.setRenderTarget(gt.map),i.clear(),i.renderBufferDirect(ht,null,mt,x,A,null)}function Q(gt){const ht=gt<<0;let mt=a[ht];return mt===void 0&&(mt=new ed({depthPacking:3201,morphTargets:gt}),a[ht]=mt),mt}function rt(gt){const ht=gt<<0;let mt=h[ht];return mt===void 0&&(mt=new nd({morphTargets:gt}),h[ht]=mt),mt}function pt(gt,ht,mt,jt,Ft,Mt,wt){let Pt=null,Nt=Q,ne=gt.customDepthMaterial;if(jt.isPointLight===!0&&(Nt=rt,ne=gt.customDistanceMaterial),ne===void 0){let $t=!1;mt.morphTargets===!0&&($t=ht.morphAttributes&&ht.morphAttributes.position&&ht.morphAttributes.position.length>0),Pt=Nt($t)}else Pt=ne;if(i.localClippingEnabled&&mt.clipShadows===!0&&mt.clippingPlanes.length!==0){const $t=Pt.uuid,Vt=mt.uuid;let Yt=l[$t];Yt===void 0&&(Yt={},l[$t]=Yt);let ge=Yt[Vt];ge===void 0&&(ge=Pt.clone(),Yt[Vt]=ge),Pt=ge}return Pt.visible=mt.visible,Pt.wireframe=mt.wireframe,Pt.side=wt===3?mt.shadowSide!==null?mt.shadowSide:mt.side:mt.shadowSide!==null?mt.shadowSide:p[mt.side],Pt.clipShadows=mt.clipShadows,Pt.clippingPlanes=mt.clippingPlanes,Pt.clipIntersection=mt.clipIntersection,Pt.wireframeLinewidth=mt.wireframeLinewidth,Pt.linewidth=mt.linewidth,jt.isPointLight===!0&&Pt.isMeshDistanceMaterial===!0&&(Pt.referencePosition.setFromMatrixPosition(jt.matrixWorld),Pt.nearDistance=Ft,Pt.farDistance=Mt),Pt}function it(gt,ht,mt,jt,Ft){if(gt.visible===!1)return;if(gt.layers.test(ht.layers)&&(gt.isMesh||gt.isLine||gt.isPoints)&&(gt.castShadow||gt.receiveShadow&&Ft===3)&&(!gt.frustumCulled||n.intersectsObject(gt))){gt.modelViewMatrix.multiplyMatrices(mt.matrixWorldInverse,gt.matrixWorld);const wt=t.update(gt),Pt=gt.material;if(Array.isArray(Pt)){const Nt=wt.groups;for(let ne=0,$t=Nt.length;ne<$t;ne++){const Vt=Nt[ne],Yt=Pt[Vt.materialIndex];if(Yt&&Yt.visible){const ge=pt(gt,wt,Yt,jt,mt.near,mt.far,Ft);i.renderBufferDirect(mt,null,wt,ge,gt,Vt)}}}else if(Pt.visible){const Nt=pt(gt,wt,Pt,jt,mt.near,mt.far,Ft);i.renderBufferDirect(mt,null,wt,Nt,gt,null)}}const Mt=gt.children;for(let wt=0,Pt=Mt.length;wt<Pt;wt++)it(Mt[wt],ht,mt,jt,Ft)}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1,this.render=function(gt,ht,mt){if(C.enabled===!1||C.autoUpdate===!1&&C.needsUpdate===!1||gt.length===0)return;const jt=i.getRenderTarget(),Ft=i.getActiveCubeFace(),Mt=i.getActiveMipmapLevel(),wt=i.state;wt.setBlending(0),wt.buffers.color.setClear(1,1,1,1),wt.buffers.depth.setTest(!0),wt.setScissorTest(!1);for(let Pt=0,Nt=gt.length;Pt<Nt;Pt++){const ne=gt[Pt],$t=ne.shadow;if($t===void 0){console.warn("THREE.WebGLShadowMap:",ne,"has no shadow.");continue}if($t.autoUpdate===!1&&$t.needsUpdate===!1)continue;r.copy($t.mapSize);const Vt=$t.getFrameExtents();if(r.multiply(Vt),o.copy($t.mapSize),(r.x>u||r.y>u)&&(r.x>u&&(o.x=Math.floor(u/Vt.x),r.x=o.x*Vt.x,$t.mapSize.x=o.x),r.y>u&&(o.y=Math.floor(u/Vt.y),r.y=o.y*Vt.y,$t.mapSize.y=o.y)),$t.map===null&&!$t.isPointLightShadow&&this.type===3){const ge={minFilter:1006,magFilter:1006,format:1023};$t.map=new zt(r.x,r.y,ge),$t.map.texture.name=ne.name+".shadowMap",$t.mapPass=new zt(r.x,r.y,ge),$t.camera.updateProjectionMatrix()}if($t.map===null){const ge={minFilter:1003,magFilter:1003,format:1023};$t.map=new zt(r.x,r.y,ge),$t.map.texture.name=ne.name+".shadowMap",$t.camera.updateProjectionMatrix()}i.setRenderTarget($t.map),i.clear();const Yt=$t.getViewportCount();for(let ge=0;ge<Yt;ge++){const be=$t.getViewport(ge);s.set(o.x*be.x,o.y*be.y,o.x*be.z,o.y*be.w),wt.viewport(s),$t.updateMatrices(ne,ge),n=$t.getFrustum(),it(ht,mt,$t.camera,ne,this.type)}$t.isPointLightShadow||this.type!==3||j($t,mt),$t.needsUpdate=!1}C.needsUpdate=!1,i.setRenderTarget(jt,Ft,Mt)}}function f0(i,t,e){const n=e.isWebGL2,r=new function(){let bt=!1;const Ht=new Ot;let ie=null;const ae=new Ot(0,0,0,0);return{setMask:function(qt){ie===qt||bt||(i.colorMask(qt,qt,qt,qt),ie=qt)},setLocked:function(qt){bt=qt},setClear:function(qt,ye,nn,on,rn){rn===!0&&(qt*=on,ye*=on,nn*=on),Ht.set(qt,ye,nn,on),ae.equals(Ht)===!1&&(i.clearColor(qt,ye,nn,on),ae.copy(Ht))},reset:function(){bt=!1,ie=null,ae.set(-1,0,0,0)}}},o=new function(){let bt=!1,Ht=null,ie=null,ae=null;return{setTest:function(qt){qt?Pe(2929):Ct(2929)},setMask:function(qt){Ht===qt||bt||(i.depthMask(qt),Ht=qt)},setFunc:function(qt){if(ie!==qt){if(qt)switch(qt){case 0:i.depthFunc(512);break;case 1:i.depthFunc(519);break;case 2:i.depthFunc(513);break;case 3:i.depthFunc(515);break;case 4:i.depthFunc(514);break;case 5:i.depthFunc(518);break;case 6:i.depthFunc(516);break;case 7:i.depthFunc(517);break;default:i.depthFunc(515)}else i.depthFunc(515);ie=qt}},setLocked:function(qt){bt=qt},setClear:function(qt){ae!==qt&&(i.clearDepth(qt),ae=qt)},reset:function(){bt=!1,Ht=null,ie=null,ae=null}}},s=new function(){let bt=!1,Ht=null,ie=null,ae=null,qt=null,ye=null,nn=null,on=null,rn=null;return{setTest:function(Sn){bt||(Sn?Pe(2960):Ct(2960))},setMask:function(Sn){Ht===Sn||bt||(i.stencilMask(Sn),Ht=Sn)},setFunc:function(Sn,Ai,Jn){ie===Sn&&ae===Ai&&qt===Jn||(i.stencilFunc(Sn,Ai,Jn),ie=Sn,ae=Ai,qt=Jn)},setOp:function(Sn,Ai,Jn){ye===Sn&&nn===Ai&&on===Jn||(i.stencilOp(Sn,Ai,Jn),ye=Sn,nn=Ai,on=Jn)},setLocked:function(Sn){bt=Sn},setClear:function(Sn){rn!==Sn&&(i.clearStencil(Sn),rn=Sn)},reset:function(){bt=!1,Ht=null,ie=null,ae=null,qt=null,ye=null,nn=null,on=null,rn=null}}};let a={},h=null,l={},u=null,p=!1,y=null,x=null,E=null,A=null,C=null,j=null,Q=null,rt=!1,pt=null,it=null,gt=null,ht=null,mt=null;const jt=i.getParameter(35661);let Ft=!1,Mt=0;const wt=i.getParameter(7938);wt.indexOf("WebGL")!==-1?(Mt=parseFloat(/^WebGL (\d)/.exec(wt)[1]),Ft=Mt>=1):wt.indexOf("OpenGL ES")!==-1&&(Mt=parseFloat(/^OpenGL ES (\d)/.exec(wt)[1]),Ft=Mt>=2);let Pt=null,Nt={};const ne=i.getParameter(3088),$t=i.getParameter(2978),Vt=new Ot().fromArray(ne),Yt=new Ot().fromArray($t);function ge(bt,Ht,ie){const ae=new Uint8Array(4),qt=i.createTexture();i.bindTexture(bt,qt),i.texParameteri(bt,10241,9728),i.texParameteri(bt,10240,9728);for(let ye=0;ye<ie;ye++)i.texImage2D(Ht+ye,0,6408,1,1,0,6408,5121,ae);return qt}const be={};function Pe(bt){a[bt]!==!0&&(i.enable(bt),a[bt]=!0)}function Ct(bt){a[bt]!==!1&&(i.disable(bt),a[bt]=!1)}be[3553]=ge(3553,3553,1),be[34067]=ge(34067,34069,6),r.setClear(0,0,0,1),o.setClear(1),s.setClear(0),Pe(2929),o.setFunc(3),se(!1),Ie(1),Pe(2884),le(0);const Bt={100:32774,101:32778,102:32779};if(n)Bt[103]=32775,Bt[104]=32776;else{const bt=t.get("EXT_blend_minmax");bt!==null&&(Bt[103]=bt.MIN_EXT,Bt[104]=bt.MAX_EXT)}const ve={200:0,201:1,202:768,204:770,210:776,208:774,206:772,203:769,205:771,209:775,207:773};function le(bt,Ht,ie,ae,qt,ye,nn,on){if(bt!==0){if(p===!1&&(Pe(3042),p=!0),bt===5)qt=qt||Ht,ye=ye||ie,nn=nn||ae,Ht===x&&qt===C||(i.blendEquationSeparate(Bt[Ht],Bt[qt]),x=Ht,C=qt),ie===E&&ae===A&&ye===j&&nn===Q||(i.blendFuncSeparate(ve[ie],ve[ae],ve[ye],ve[nn]),E=ie,A=ae,j=ye,Q=nn),y=bt,rt=null;else if(bt!==y||on!==rt){if(x===100&&C===100||(i.blendEquation(32774),x=100,C=100),on)switch(bt){case 1:i.blendFuncSeparate(1,771,1,771);break;case 2:i.blendFunc(1,1);break;case 3:i.blendFuncSeparate(0,0,769,771);break;case 4:i.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",bt)}else switch(bt){case 1:i.blendFuncSeparate(770,771,1,771);break;case 2:i.blendFunc(770,1);break;case 3:i.blendFunc(0,769);break;case 4:i.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",bt)}E=null,A=null,j=null,Q=null,y=bt,rt=on}}else p===!0&&(Ct(3042),p=!1)}function se(bt){pt!==bt&&(bt?i.frontFace(2304):i.frontFace(2305),pt=bt)}function Ie(bt){bt!==0?(Pe(2884),bt!==it&&(bt===1?i.cullFace(1029):bt===2?i.cullFace(1028):i.cullFace(1032))):Ct(2884),it=bt}function Le(bt,Ht,ie){bt?(Pe(32823),ht===Ht&&mt===ie||(i.polygonOffset(Ht,ie),ht=Ht,mt=ie)):Ct(32823)}function ue(bt){bt===void 0&&(bt=33984+jt-1),Pt!==bt&&(i.activeTexture(bt),Pt=bt)}return{buffers:{color:r,depth:o,stencil:s},enable:Pe,disable:Ct,bindFramebuffer:function(bt,Ht){return Ht===null&&h!==null&&(Ht=h),l[bt]!==Ht&&(i.bindFramebuffer(bt,Ht),l[bt]=Ht,n&&(bt===36009&&(l[36160]=Ht),bt===36160&&(l[36009]=Ht)),!0)},bindXRFramebuffer:function(bt){bt!==h&&(i.bindFramebuffer(36160,bt),h=bt)},useProgram:function(bt){return u!==bt&&(i.useProgram(bt),u=bt,!0)},setBlending:le,setMaterial:function(bt,Ht){bt.side===2?Ct(2884):Pe(2884);let ie=bt.side===1;Ht&&(ie=!ie),se(ie),bt.blending===1&&bt.transparent===!1?le(0):le(bt.blending,bt.blendEquation,bt.blendSrc,bt.blendDst,bt.blendEquationAlpha,bt.blendSrcAlpha,bt.blendDstAlpha,bt.premultipliedAlpha),o.setFunc(bt.depthFunc),o.setTest(bt.depthTest),o.setMask(bt.depthWrite),r.setMask(bt.colorWrite);const ae=bt.stencilWrite;s.setTest(ae),ae&&(s.setMask(bt.stencilWriteMask),s.setFunc(bt.stencilFunc,bt.stencilRef,bt.stencilFuncMask),s.setOp(bt.stencilFail,bt.stencilZFail,bt.stencilZPass)),Le(bt.polygonOffset,bt.polygonOffsetFactor,bt.polygonOffsetUnits),bt.alphaToCoverage===!0?Pe(32926):Ct(32926)},setFlipSided:se,setCullFace:Ie,setLineWidth:function(bt){bt!==gt&&(Ft&&i.lineWidth(bt),gt=bt)},setPolygonOffset:Le,setScissorTest:function(bt){bt?Pe(3089):Ct(3089)},activeTexture:ue,bindTexture:function(bt,Ht){Pt===null&&ue();let ie=Nt[Pt];ie===void 0&&(ie={type:void 0,texture:void 0},Nt[Pt]=ie),ie.type===bt&&ie.texture===Ht||(i.bindTexture(bt,Ht||be[bt]),ie.type=bt,ie.texture=Ht)},unbindTexture:function(){const bt=Nt[Pt];bt!==void 0&&bt.type!==void 0&&(i.bindTexture(bt.type,null),bt.type=void 0,bt.texture=void 0)},compressedTexImage2D:function(){try{i.compressedTexImage2D.apply(i,arguments)}catch(bt){console.error("THREE.WebGLState:",bt)}},texImage2D:function(){try{i.texImage2D.apply(i,arguments)}catch(bt){console.error("THREE.WebGLState:",bt)}},texImage3D:function(){try{i.texImage3D.apply(i,arguments)}catch(bt){console.error("THREE.WebGLState:",bt)}},scissor:function(bt){Vt.equals(bt)===!1&&(i.scissor(bt.x,bt.y,bt.z,bt.w),Vt.copy(bt))},viewport:function(bt){Yt.equals(bt)===!1&&(i.viewport(bt.x,bt.y,bt.z,bt.w),Yt.copy(bt))},reset:function(){i.disable(3042),i.disable(2884),i.disable(2929),i.disable(32823),i.disable(3089),i.disable(2960),i.disable(32926),i.blendEquation(32774),i.blendFunc(1,0),i.blendFuncSeparate(1,0,1,0),i.colorMask(!0,!0,!0,!0),i.clearColor(0,0,0,0),i.depthMask(!0),i.depthFunc(513),i.clearDepth(1),i.stencilMask(4294967295),i.stencilFunc(519,0,4294967295),i.stencilOp(7680,7680,7680),i.clearStencil(0),i.cullFace(1029),i.frontFace(2305),i.polygonOffset(0,0),i.activeTexture(33984),i.bindFramebuffer(36160,null),n===!0&&(i.bindFramebuffer(36009,null),i.bindFramebuffer(36008,null)),i.useProgram(null),i.lineWidth(1),i.scissor(0,0,i.canvas.width,i.canvas.height),i.viewport(0,0,i.canvas.width,i.canvas.height),a={},Pt=null,Nt={},h=null,l={},u=null,p=!1,y=null,x=null,E=null,A=null,C=null,j=null,Q=null,rt=!1,pt=null,it=null,gt=null,ht=null,mt=null,Vt.set(0,0,i.canvas.width,i.canvas.height),Yt.set(0,0,i.canvas.width,i.canvas.height),r.reset(),o.reset(),s.reset()}}}function m0(i,t,e,n,r,o,s){const a=r.isWebGL2,h=r.maxTextures,l=r.maxCubemapSize,u=r.maxTextureSize,p=r.maxSamples,y=new WeakMap;let x,E=!1;try{E=typeof OffscreenCanvas!="undefined"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function A(Ct,Bt){return E?new OffscreenCanvas(Ct,Bt):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function C(Ct,Bt,ve,le){let se=1;if((Ct.width>le||Ct.height>le)&&(se=le/Math.max(Ct.width,Ct.height)),se<1||Bt===!0){if(typeof HTMLImageElement!="undefined"&&Ct instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&Ct instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&Ct instanceof ImageBitmap){const Ie=Bt?L:Math.floor,Le=Ie(se*Ct.width),ue=Ie(se*Ct.height);x===void 0&&(x=A(Le,ue));const bt=ve?A(Le,ue):x;return bt.width=Le,bt.height=ue,bt.getContext("2d").drawImage(Ct,0,0,Le,ue),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+Ct.width+"x"+Ct.height+") to ("+Le+"x"+ue+")."),bt}return"data"in Ct&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+Ct.width+"x"+Ct.height+")."),Ct}return Ct}function j(Ct){return At(Ct.width)&&At(Ct.height)}function Q(Ct,Bt){return Ct.generateMipmaps&&Bt&&Ct.minFilter!==1003&&Ct.minFilter!==1006}function rt(Ct,Bt,ve,le,se=1){i.generateMipmap(Ct),n.get(Bt).__maxMipLevel=Math.log2(Math.max(ve,le,se))}function pt(Ct,Bt,ve){if(a===!1)return Bt;if(Ct!==null){if(i[Ct]!==void 0)return i[Ct];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+Ct+"'")}let le=Bt;return Bt===6403&&(ve===5126&&(le=33326),ve===5131&&(le=33325),ve===5121&&(le=33321)),Bt===6407&&(ve===5126&&(le=34837),ve===5131&&(le=34843),ve===5121&&(le=32849)),Bt===6408&&(ve===5126&&(le=34836),ve===5131&&(le=34842),ve===5121&&(le=32856)),le!==33325&&le!==33326&&le!==34842&&le!==34836||t.get("EXT_color_buffer_float"),le}function it(Ct){return Ct===1003||Ct===1004||Ct===1005?9728:9729}function gt(Ct){const Bt=Ct.target;Bt.removeEventListener("dispose",gt),function(ve){const le=n.get(ve);le.__webglInit!==void 0&&(i.deleteTexture(le.__webglTexture),n.remove(ve))}(Bt),Bt.isVideoTexture&&y.delete(Bt),s.memory.textures--}function ht(Ct){const Bt=Ct.target;Bt.removeEventListener("dispose",ht),function(ve){const le=ve.texture,se=n.get(ve),Ie=n.get(le);if(!!ve){if(Ie.__webglTexture!==void 0&&(i.deleteTexture(Ie.__webglTexture),s.memory.textures--),ve.depthTexture&&ve.depthTexture.dispose(),ve.isWebGLCubeRenderTarget)for(let Le=0;Le<6;Le++)i.deleteFramebuffer(se.__webglFramebuffer[Le]),se.__webglDepthbuffer&&i.deleteRenderbuffer(se.__webglDepthbuffer[Le]);else i.deleteFramebuffer(se.__webglFramebuffer),se.__webglDepthbuffer&&i.deleteRenderbuffer(se.__webglDepthbuffer),se.__webglMultisampledFramebuffer&&i.deleteFramebuffer(se.__webglMultisampledFramebuffer),se.__webglColorRenderbuffer&&i.deleteRenderbuffer(se.__webglColorRenderbuffer),se.__webglDepthRenderbuffer&&i.deleteRenderbuffer(se.__webglDepthRenderbuffer);if(ve.isWebGLMultipleRenderTargets)for(let Le=0,ue=le.length;Le<ue;Le++){const bt=n.get(le[Le]);bt.__webglTexture&&(i.deleteTexture(bt.__webglTexture),s.memory.textures--),n.remove(le[Le])}n.remove(le),n.remove(ve)}}(Bt)}let mt=0;function jt(Ct,Bt){const ve=n.get(Ct);if(Ct.isVideoTexture&&function(le){const se=s.render.frame;y.get(le)!==se&&(y.set(le,se),le.update())}(Ct),Ct.version>0&&ve.__version!==Ct.version){const le=Ct.image;if(le===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(le.complete!==!1)return void ne(ve,Ct,Bt);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}e.activeTexture(33984+Bt),e.bindTexture(3553,ve.__webglTexture)}function Ft(Ct,Bt){const ve=n.get(Ct);Ct.version>0&&ve.__version!==Ct.version?function(le,se,Ie){if(se.image.length!==6)return;Nt(le,se),e.activeTexture(33984+Ie),e.bindTexture(34067,le.__webglTexture),i.pixelStorei(37440,se.flipY),i.pixelStorei(37441,se.premultiplyAlpha),i.pixelStorei(3317,se.unpackAlignment),i.pixelStorei(37443,0);const Le=se&&(se.isCompressedTexture||se.image[0].isCompressedTexture),ue=se.image[0]&&se.image[0].isDataTexture,bt=[];for(let on=0;on<6;on++)bt[on]=Le||ue?ue?se.image[on].image:se.image[on]:C(se.image[on],!1,!0,l);const Ht=bt[0],ie=j(Ht)||a,ae=o.convert(se.format),qt=o.convert(se.type),ye=pt(se.internalFormat,ae,qt);let nn;if(Pt(34067,se,ie),Le){for(let on=0;on<6;on++){nn=bt[on].mipmaps;for(let rn=0;rn<nn.length;rn++){const Sn=nn[rn];se.format!==1023&&se.format!==1022?ae!==null?e.compressedTexImage2D(34069+on,rn,ye,Sn.width,Sn.height,0,Sn.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):e.texImage2D(34069+on,rn,ye,Sn.width,Sn.height,0,ae,qt,Sn.data)}}le.__maxMipLevel=nn.length-1}else{nn=se.mipmaps;for(let on=0;on<6;on++)if(ue){e.texImage2D(34069+on,0,ye,bt[on].width,bt[on].height,0,ae,qt,bt[on].data);for(let rn=0;rn<nn.length;rn++){const Sn=nn[rn].image[on].image;e.texImage2D(34069+on,rn+1,ye,Sn.width,Sn.height,0,ae,qt,Sn.data)}}else{e.texImage2D(34069+on,0,ye,ae,qt,bt[on]);for(let rn=0;rn<nn.length;rn++){const Sn=nn[rn];e.texImage2D(34069+on,rn+1,ye,ae,qt,Sn.image[on])}}le.__maxMipLevel=nn.length}Q(se,ie)&&rt(34067,se,Ht.width,Ht.height),le.__version=se.version,se.onUpdate&&se.onUpdate(se)}(ve,Ct,Bt):(e.activeTexture(33984+Bt),e.bindTexture(34067,ve.__webglTexture))}const Mt={1e3:10497,1001:33071,1002:33648},wt={1003:9728,1004:9984,1005:9986,1006:9729,1007:9985,1008:9987};function Pt(Ct,Bt,ve){if(ve?(i.texParameteri(Ct,10242,Mt[Bt.wrapS]),i.texParameteri(Ct,10243,Mt[Bt.wrapT]),Ct!==32879&&Ct!==35866||i.texParameteri(Ct,32882,Mt[Bt.wrapR]),i.texParameteri(Ct,10240,wt[Bt.magFilter]),i.texParameteri(Ct,10241,wt[Bt.minFilter])):(i.texParameteri(Ct,10242,33071),i.texParameteri(Ct,10243,33071),Ct!==32879&&Ct!==35866||i.texParameteri(Ct,32882,33071),Bt.wrapS===1001&&Bt.wrapT===1001||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),i.texParameteri(Ct,10240,it(Bt.magFilter)),i.texParameteri(Ct,10241,it(Bt.minFilter)),Bt.minFilter!==1003&&Bt.minFilter!==1006&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),t.has("EXT_texture_filter_anisotropic")===!0){const le=t.get("EXT_texture_filter_anisotropic");if(Bt.type===1015&&t.has("OES_texture_float_linear")===!1||a===!1&&Bt.type===1016&&t.has("OES_texture_half_float_linear")===!1)return;(Bt.anisotropy>1||n.get(Bt).__currentAnisotropy)&&(i.texParameterf(Ct,le.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(Bt.anisotropy,r.getMaxAnisotropy())),n.get(Bt).__currentAnisotropy=Bt.anisotropy)}}function Nt(Ct,Bt){Ct.__webglInit===void 0&&(Ct.__webglInit=!0,Bt.addEventListener("dispose",gt),Ct.__webglTexture=i.createTexture(),s.memory.textures++)}function ne(Ct,Bt,ve){let le=3553;Bt.isDataTexture2DArray&&(le=35866),Bt.isDataTexture3D&&(le=32879),Nt(Ct,Bt),e.activeTexture(33984+ve),e.bindTexture(le,Ct.__webglTexture),i.pixelStorei(37440,Bt.flipY),i.pixelStorei(37441,Bt.premultiplyAlpha),i.pixelStorei(3317,Bt.unpackAlignment),i.pixelStorei(37443,0);const se=function(qt){return!a&&(qt.wrapS!==1001||qt.wrapT!==1001||qt.minFilter!==1003&&qt.minFilter!==1006)}(Bt)&&j(Bt.image)===!1,Ie=C(Bt.image,se,!1,u),Le=j(Ie)||a,ue=o.convert(Bt.format);let bt,Ht=o.convert(Bt.type),ie=pt(Bt.internalFormat,ue,Ht);Pt(le,Bt,Le);const ae=Bt.mipmaps;if(Bt.isDepthTexture)ie=6402,a?ie=Bt.type===1015?36012:Bt.type===1014?33190:Bt.type===1020?35056:33189:Bt.type===1015&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),Bt.format===1026&&ie===6402&&Bt.type!==1012&&Bt.type!==1014&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),Bt.type=1012,Ht=o.convert(Bt.type)),Bt.format===1027&&ie===6402&&(ie=34041,Bt.type!==1020&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),Bt.type=1020,Ht=o.convert(Bt.type))),e.texImage2D(3553,0,ie,Ie.width,Ie.height,0,ue,Ht,null);else if(Bt.isDataTexture)if(ae.length>0&&Le){for(let qt=0,ye=ae.length;qt<ye;qt++)bt=ae[qt],e.texImage2D(3553,qt,ie,bt.width,bt.height,0,ue,Ht,bt.data);Bt.generateMipmaps=!1,Ct.__maxMipLevel=ae.length-1}else e.texImage2D(3553,0,ie,Ie.width,Ie.height,0,ue,Ht,Ie.data),Ct.__maxMipLevel=0;else if(Bt.isCompressedTexture){for(let qt=0,ye=ae.length;qt<ye;qt++)bt=ae[qt],Bt.format!==1023&&Bt.format!==1022?ue!==null?e.compressedTexImage2D(3553,qt,ie,bt.width,bt.height,0,bt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):e.texImage2D(3553,qt,ie,bt.width,bt.height,0,ue,Ht,bt.data);Ct.__maxMipLevel=ae.length-1}else if(Bt.isDataTexture2DArray)e.texImage3D(35866,0,ie,Ie.width,Ie.height,Ie.depth,0,ue,Ht,Ie.data),Ct.__maxMipLevel=0;else if(Bt.isDataTexture3D)e.texImage3D(32879,0,ie,Ie.width,Ie.height,Ie.depth,0,ue,Ht,Ie.data),Ct.__maxMipLevel=0;else if(ae.length>0&&Le){for(let qt=0,ye=ae.length;qt<ye;qt++)bt=ae[qt],e.texImage2D(3553,qt,ie,ue,Ht,bt);Bt.generateMipmaps=!1,Ct.__maxMipLevel=ae.length-1}else e.texImage2D(3553,0,ie,ue,Ht,Ie),Ct.__maxMipLevel=0;Q(Bt,Le)&&rt(le,Bt,Ie.width,Ie.height),Ct.__version=Bt.version,Bt.onUpdate&&Bt.onUpdate(Bt)}function $t(Ct,Bt,ve,le,se){const Ie=o.convert(ve.format),Le=o.convert(ve.type),ue=pt(ve.internalFormat,Ie,Le);se===32879||se===35866?e.texImage3D(se,0,ue,Bt.width,Bt.height,Bt.depth,0,Ie,Le,null):e.texImage2D(se,0,ue,Bt.width,Bt.height,0,Ie,Le,null),e.bindFramebuffer(36160,Ct),i.framebufferTexture2D(36160,le,se,n.get(ve).__webglTexture,0),e.bindFramebuffer(36160,null)}function Vt(Ct,Bt,ve){if(i.bindRenderbuffer(36161,Ct),Bt.depthBuffer&&!Bt.stencilBuffer){let le=33189;if(ve){const se=Bt.depthTexture;se&&se.isDepthTexture&&(se.type===1015?le=36012:se.type===1014&&(le=33190));const Ie=ge(Bt);i.renderbufferStorageMultisample(36161,Ie,le,Bt.width,Bt.height)}else i.renderbufferStorage(36161,le,Bt.width,Bt.height);i.framebufferRenderbuffer(36160,36096,36161,Ct)}else if(Bt.depthBuffer&&Bt.stencilBuffer){if(ve){const le=ge(Bt);i.renderbufferStorageMultisample(36161,le,35056,Bt.width,Bt.height)}else i.renderbufferStorage(36161,34041,Bt.width,Bt.height);i.framebufferRenderbuffer(36160,33306,36161,Ct)}else{const le=Bt.isWebGLMultipleRenderTargets===!0?Bt.texture[0]:Bt.texture,se=o.convert(le.format),Ie=o.convert(le.type),Le=pt(le.internalFormat,se,Ie);if(ve){const ue=ge(Bt);i.renderbufferStorageMultisample(36161,ue,Le,Bt.width,Bt.height)}else i.renderbufferStorage(36161,Le,Bt.width,Bt.height)}i.bindRenderbuffer(36161,null)}function Yt(Ct){const Bt=n.get(Ct),ve=Ct.isWebGLCubeRenderTarget===!0;if(Ct.depthTexture){if(ve)throw new Error("target.depthTexture not supported in Cube render targets");(function(le,se){if(se&&se.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(36160,le),!se.depthTexture||!se.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");n.get(se.depthTexture).__webglTexture&&se.depthTexture.image.width===se.width&&se.depthTexture.image.height===se.height||(se.depthTexture.image.width=se.width,se.depthTexture.image.height=se.height,se.depthTexture.needsUpdate=!0),jt(se.depthTexture,0);const Ie=n.get(se.depthTexture).__webglTexture;if(se.depthTexture.format===1026)i.framebufferTexture2D(36160,36096,3553,Ie,0);else{if(se.depthTexture.format!==1027)throw new Error("Unknown depthTexture format");i.framebufferTexture2D(36160,33306,3553,Ie,0)}})(Bt.__webglFramebuffer,Ct)}else if(ve){Bt.__webglDepthbuffer=[];for(let le=0;le<6;le++)e.bindFramebuffer(36160,Bt.__webglFramebuffer[le]),Bt.__webglDepthbuffer[le]=i.createRenderbuffer(),Vt(Bt.__webglDepthbuffer[le],Ct,!1)}else e.bindFramebuffer(36160,Bt.__webglFramebuffer),Bt.__webglDepthbuffer=i.createRenderbuffer(),Vt(Bt.__webglDepthbuffer,Ct,!1);e.bindFramebuffer(36160,null)}function ge(Ct){return a&&Ct.isWebGLMultisampleRenderTarget?Math.min(p,Ct.samples):0}let be=!1,Pe=!1;this.allocateTextureUnit=function(){const Ct=mt;return Ct>=h&&console.warn("THREE.WebGLTextures: Trying to use "+Ct+" texture units while this GPU supports only "+h),mt+=1,Ct},this.resetTextureUnits=function(){mt=0},this.setTexture2D=jt,this.setTexture2DArray=function(Ct,Bt){const ve=n.get(Ct);Ct.version>0&&ve.__version!==Ct.version?ne(ve,Ct,Bt):(e.activeTexture(33984+Bt),e.bindTexture(35866,ve.__webglTexture))},this.setTexture3D=function(Ct,Bt){const ve=n.get(Ct);Ct.version>0&&ve.__version!==Ct.version?ne(ve,Ct,Bt):(e.activeTexture(33984+Bt),e.bindTexture(32879,ve.__webglTexture))},this.setTextureCube=Ft,this.setupRenderTarget=function(Ct){const Bt=Ct.texture,ve=n.get(Ct),le=n.get(Bt);Ct.addEventListener("dispose",ht),Ct.isWebGLMultipleRenderTargets!==!0&&(le.__webglTexture=i.createTexture(),le.__version=Bt.version,s.memory.textures++);const se=Ct.isWebGLCubeRenderTarget===!0,Ie=Ct.isWebGLMultipleRenderTargets===!0,Le=Ct.isWebGLMultisampleRenderTarget===!0,ue=Bt.isDataTexture3D||Bt.isDataTexture2DArray,bt=j(Ct)||a;if(!a||Bt.format!==1022||Bt.type!==1015&&Bt.type!==1016||(Bt.format=1023,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),se){ve.__webglFramebuffer=[];for(let Ht=0;Ht<6;Ht++)ve.__webglFramebuffer[Ht]=i.createFramebuffer()}else if(ve.__webglFramebuffer=i.createFramebuffer(),Ie)if(r.drawBuffers){const Ht=Ct.texture;for(let ie=0,ae=Ht.length;ie<ae;ie++){const qt=n.get(Ht[ie]);qt.__webglTexture===void 0&&(qt.__webglTexture=i.createTexture(),s.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(Le)if(a){ve.__webglMultisampledFramebuffer=i.createFramebuffer(),ve.__webglColorRenderbuffer=i.createRenderbuffer(),i.bindRenderbuffer(36161,ve.__webglColorRenderbuffer);const Ht=o.convert(Bt.format),ie=o.convert(Bt.type),ae=pt(Bt.internalFormat,Ht,ie),qt=ge(Ct);i.renderbufferStorageMultisample(36161,qt,ae,Ct.width,Ct.height),e.bindFramebuffer(36160,ve.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(36160,36064,36161,ve.__webglColorRenderbuffer),i.bindRenderbuffer(36161,null),Ct.depthBuffer&&(ve.__webglDepthRenderbuffer=i.createRenderbuffer(),Vt(ve.__webglDepthRenderbuffer,Ct,!0)),e.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(se){e.bindTexture(34067,le.__webglTexture),Pt(34067,Bt,bt);for(let Ht=0;Ht<6;Ht++)$t(ve.__webglFramebuffer[Ht],Ct,Bt,36064,34069+Ht);Q(Bt,bt)&&rt(34067,Bt,Ct.width,Ct.height),e.bindTexture(34067,null)}else if(Ie){const Ht=Ct.texture;for(let ie=0,ae=Ht.length;ie<ae;ie++){const qt=Ht[ie],ye=n.get(qt);e.bindTexture(3553,ye.__webglTexture),Pt(3553,qt,bt),$t(ve.__webglFramebuffer,Ct,qt,36064+ie,3553),Q(qt,bt)&&rt(3553,qt,Ct.width,Ct.height)}e.bindTexture(3553,null)}else{let Ht=3553;ue&&(a?Ht=Bt.isDataTexture3D?32879:35866:console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.")),e.bindTexture(Ht,le.__webglTexture),Pt(Ht,Bt,bt),$t(ve.__webglFramebuffer,Ct,Bt,36064,Ht),Q(Bt,bt)&&rt(Ht,Bt,Ct.width,Ct.height,Ct.depth),e.bindTexture(Ht,null)}Ct.depthBuffer&&Yt(Ct)},this.updateRenderTargetMipmap=function(Ct){const Bt=j(Ct)||a,ve=Ct.isWebGLMultipleRenderTargets===!0?Ct.texture:[Ct.texture];for(let le=0,se=ve.length;le<se;le++){const Ie=ve[le];if(Q(Ie,Bt)){const Le=Ct.isWebGLCubeRenderTarget?34067:3553,ue=n.get(Ie).__webglTexture;e.bindTexture(Le,ue),rt(Le,Ie,Ct.width,Ct.height),e.bindTexture(Le,null)}}},this.updateMultisampleRenderTarget=function(Ct){if(Ct.isWebGLMultisampleRenderTarget)if(a){const Bt=Ct.width,ve=Ct.height;let le=16384;Ct.depthBuffer&&(le|=256),Ct.stencilBuffer&&(le|=1024);const se=n.get(Ct);e.bindFramebuffer(36008,se.__webglMultisampledFramebuffer),e.bindFramebuffer(36009,se.__webglFramebuffer),i.blitFramebuffer(0,0,Bt,ve,0,0,Bt,ve,le,9728),e.bindFramebuffer(36008,null),e.bindFramebuffer(36009,se.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(Ct,Bt){Ct&&Ct.isWebGLRenderTarget&&(be===!1&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),be=!0),Ct=Ct.texture),jt(Ct,Bt)},this.safeSetTextureCube=function(Ct,Bt){Ct&&Ct.isWebGLCubeRenderTarget&&(Pe===!1&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),Pe=!0),Ct=Ct.texture),Ft(Ct,Bt)}}function g0(i,t,e){const n=e.isWebGL2;return{convert:function(r){let o;if(r===1009)return 5121;if(r===1017)return 32819;if(r===1018)return 32820;if(r===1019)return 33635;if(r===1010)return 5120;if(r===1011)return 5122;if(r===1012)return 5123;if(r===1013)return 5124;if(r===1014)return 5125;if(r===1015)return 5126;if(r===1016)return n?5131:(o=t.get("OES_texture_half_float"),o!==null?o.HALF_FLOAT_OES:null);if(r===1021)return 6406;if(r===1022)return 6407;if(r===1023)return 6408;if(r===1024)return 6409;if(r===1025)return 6410;if(r===1026)return 6402;if(r===1027)return 34041;if(r===1028)return 6403;if(r===1029)return 36244;if(r===1030)return 33319;if(r===1031)return 33320;if(r===1032)return 36248;if(r===1033)return 36249;if(r===33776||r===33777||r===33778||r===33779){if(o=t.get("WEBGL_compressed_texture_s3tc"),o===null)return null;if(r===33776)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===33777)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===33778)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===33779)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(r===35840||r===35841||r===35842||r===35843){if(o=t.get("WEBGL_compressed_texture_pvrtc"),o===null)return null;if(r===35840)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===35841)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===35842)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===35843)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(r===36196)return o=t.get("WEBGL_compressed_texture_etc1"),o!==null?o.COMPRESSED_RGB_ETC1_WEBGL:null;if((r===37492||r===37496)&&(o=t.get("WEBGL_compressed_texture_etc"),o!==null)){if(r===37492)return o.COMPRESSED_RGB8_ETC2;if(r===37496)return o.COMPRESSED_RGBA8_ETC2_EAC}return r===37808||r===37809||r===37810||r===37811||r===37812||r===37813||r===37814||r===37815||r===37816||r===37817||r===37818||r===37819||r===37820||r===37821||r===37840||r===37841||r===37842||r===37843||r===37844||r===37845||r===37846||r===37847||r===37848||r===37849||r===37850||r===37851||r===37852||r===37853?(o=t.get("WEBGL_compressed_texture_astc"),o!==null?r:null):r===36492?(o=t.get("EXT_texture_compression_bptc"),o!==null?r:null):r===1020?n?34042:(o=t.get("WEBGL_depth_texture"),o!==null?o.UNSIGNED_INT_24_8_WEBGL:null):void 0}}}class rd extends un{constructor(t=[]){super(),this.cameras=t}}rd.prototype.isArrayCamera=!0;class bs extends Un{constructor(){super(),this.type="Group"}}bs.prototype.isGroup=!0;const v0={type:"move"};class jh{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new bs,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new bs,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new U,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new U),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new bs,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new U,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new U),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,e,n){let r=null,o=null,s=null;const a=this._targetRay,h=this._grip,l=this._hand;if(t&&e.session.visibilityState!=="visible-blurred")if(a!==null&&(r=e.getPose(t.targetRaySpace,n),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(v0))),l&&t.hand){s=!0;for(const A of t.hand.values()){const C=e.getJointPose(A,n);if(l.joints[A.jointName]===void 0){const Q=new bs;Q.matrixAutoUpdate=!1,Q.visible=!1,l.joints[A.jointName]=Q,l.add(Q)}const j=l.joints[A.jointName];C!==null&&(j.matrix.fromArray(C.transform.matrix),j.matrix.decompose(j.position,j.rotation,j.scale),j.jointRadius=C.radius),j.visible=C!==null}const u=l.joints["index-finger-tip"],p=l.joints["thumb-tip"],y=u.position.distanceTo(p.position),x=.02,E=.005;l.inputState.pinching&&y>x+E?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&y<=x-E&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else h!==null&&t.gripSpace&&(o=e.getPose(t.gripSpace,n),o!==null&&(h.matrix.fromArray(o.transform.matrix),h.matrix.decompose(h.position,h.rotation,h.scale),o.linearVelocity?(h.hasLinearVelocity=!0,h.linearVelocity.copy(o.linearVelocity)):h.hasLinearVelocity=!1,o.angularVelocity?(h.hasAngularVelocity=!0,h.angularVelocity.copy(o.angularVelocity)):h.hasAngularVelocity=!1));return a!==null&&(a.visible=r!==null),h!==null&&(h.visible=o!==null),l!==null&&(l.visible=s!==null),this}}class _0 extends D{constructor(t,e){super();const n=this,r=t.state;let o=null,s=1,a=null,h="local-floor",l=null,u=null,p=null,y=null;const x=[],E=new Map,A=new un;A.layers.enable(1),A.viewport=new Ot;const C=new un;C.layers.enable(2),C.viewport=new Ot;const j=[A,C],Q=new rd;Q.layers.enable(1),Q.layers.enable(2);let rt=null,pt=null;function it(Pt){const Nt=E.get(Pt.inputSource);Nt&&Nt.dispatchEvent({type:Pt.type,data:Pt.inputSource})}function gt(){E.forEach(function(Pt,Nt){Pt.disconnect(Nt)}),E.clear(),rt=null,pt=null,r.bindXRFramebuffer(null),t.setRenderTarget(t.getRenderTarget()),wt.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function ht(Pt){const Nt=o.inputSources;for(let ne=0;ne<x.length;ne++)E.set(Nt[ne],x[ne]);for(let ne=0;ne<Pt.removed.length;ne++){const $t=Pt.removed[ne],Vt=E.get($t);Vt&&(Vt.dispatchEvent({type:"disconnected",data:$t}),E.delete($t))}for(let ne=0;ne<Pt.added.length;ne++){const $t=Pt.added[ne],Vt=E.get($t);Vt&&Vt.dispatchEvent({type:"connected",data:$t})}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Pt){let Nt=x[Pt];return Nt===void 0&&(Nt=new jh,x[Pt]=Nt),Nt.getTargetRaySpace()},this.getControllerGrip=function(Pt){let Nt=x[Pt];return Nt===void 0&&(Nt=new jh,x[Pt]=Nt),Nt.getGripSpace()},this.getHand=function(Pt){let Nt=x[Pt];return Nt===void 0&&(Nt=new jh,x[Pt]=Nt),Nt.getHandSpace()},this.setFramebufferScaleFactor=function(Pt){s=Pt,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(Pt){h=Pt,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return a},this.getSession=function(){return o},this.setSession=async function(Pt){if(o=Pt,o!==null){o.addEventListener("select",it),o.addEventListener("selectstart",it),o.addEventListener("selectend",it),o.addEventListener("squeeze",it),o.addEventListener("squeezestart",it),o.addEventListener("squeezeend",it),o.addEventListener("end",gt),o.addEventListener("inputsourceschange",ht);const Nt=e.getContextAttributes();if(Nt.xrCompatible!==!0&&await e.makeXRCompatible(),o.renderState.layers===void 0){const ne={antialias:Nt.antialias,alpha:Nt.alpha,depth:Nt.depth,stencil:Nt.stencil,framebufferScaleFactor:s},$t=new XRWebGLLayer(o,e,ne);o.updateRenderState({baseLayer:$t})}else{let ne=0;Nt.depth&&(ne=Nt.stencil?34041:6402);const $t={colorFormat:Nt.alpha?6408:6407,depthFormat:ne,scaleFactor:s};u=new XRWebGLBinding(o,e),y=u.createProjectionLayer($t),p=e.createFramebuffer(),o.updateRenderState({layers:[y]})}a=await o.requestReferenceSpace(h),wt.setContext(o),wt.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};const mt=new U,jt=new U;function Ft(Pt,Nt){Nt===null?Pt.matrixWorld.copy(Pt.matrix):Pt.matrixWorld.multiplyMatrices(Nt.matrixWorld,Pt.matrix),Pt.matrixWorldInverse.copy(Pt.matrixWorld).invert()}this.updateCamera=function(Pt){if(o===null)return;Q.near=C.near=A.near=Pt.near,Q.far=C.far=A.far=Pt.far,rt===Q.near&&pt===Q.far||(o.updateRenderState({depthNear:Q.near,depthFar:Q.far}),rt=Q.near,pt=Q.far);const Nt=Pt.parent,ne=Q.cameras;Ft(Q,Nt);for(let Vt=0;Vt<ne.length;Vt++)Ft(ne[Vt],Nt);Q.matrixWorld.decompose(Q.position,Q.quaternion,Q.scale),Pt.position.copy(Q.position),Pt.quaternion.copy(Q.quaternion),Pt.scale.copy(Q.scale),Pt.matrix.copy(Q.matrix),Pt.matrixWorld.copy(Q.matrixWorld);const $t=Pt.children;for(let Vt=0,Yt=$t.length;Vt<Yt;Vt++)$t[Vt].updateMatrixWorld(!0);ne.length===2?function(Vt,Yt,ge){mt.setFromMatrixPosition(Yt.matrixWorld),jt.setFromMatrixPosition(ge.matrixWorld);const be=mt.distanceTo(jt),Pe=Yt.projectionMatrix.elements,Ct=ge.projectionMatrix.elements,Bt=Pe[14]/(Pe[10]-1),ve=Pe[14]/(Pe[10]+1),le=(Pe[9]+1)/Pe[5],se=(Pe[9]-1)/Pe[5],Ie=(Pe[8]-1)/Pe[0],Le=(Ct[8]+1)/Ct[0],ue=Bt*Ie,bt=Bt*Le,Ht=be/(-Ie+Le),ie=Ht*-Ie;Yt.matrixWorld.decompose(Vt.position,Vt.quaternion,Vt.scale),Vt.translateX(ie),Vt.translateZ(Ht),Vt.matrixWorld.compose(Vt.position,Vt.quaternion,Vt.scale),Vt.matrixWorldInverse.copy(Vt.matrixWorld).invert();const ae=Bt+Ht,qt=ve+Ht,ye=ue-ie,nn=bt+(be-ie),on=le*ve/qt*ae,rn=se*ve/qt*ae;Vt.projectionMatrix.makePerspective(ye,nn,on,rn,ae,qt)}(Q,A,C):Q.projectionMatrix.copy(A.projectionMatrix)},this.getCamera=function(){return Q};let Mt=null;const wt=new $o;wt.setAnimationLoop(function(Pt,Nt){if(l=Nt.getViewerPose(a),l!==null){const $t=l.views,Vt=o.renderState.baseLayer;o.renderState.layers===void 0&&r.bindXRFramebuffer(Vt.framebuffer);let Yt=!1;$t.length!==Q.cameras.length&&(Q.cameras.length=0,Yt=!0);for(let ge=0;ge<$t.length;ge++){const be=$t[ge];let Pe=null;if(o.renderState.layers===void 0)Pe=Vt.getViewport(be);else{const Bt=u.getViewSubImage(y,be);r.bindXRFramebuffer(p),e.framebufferTexture2D(36160,36064,3553,Bt.colorTexture,0),Bt.depthStencilTexture!==void 0&&e.framebufferTexture2D(36160,36096,3553,Bt.depthStencilTexture,0),Pe=Bt.viewport}const Ct=j[ge];Ct.matrix.fromArray(be.transform.matrix),Ct.projectionMatrix.fromArray(be.projectionMatrix),Ct.viewport.set(Pe.x,Pe.y,Pe.width,Pe.height),ge===0&&Q.matrix.copy(Ct.matrix),Yt===!0&&Q.cameras.push(Ct)}}const ne=o.inputSources;for(let $t=0;$t<x.length;$t++){const Vt=x[$t],Yt=ne[$t];Vt.update(Yt,Nt,a)}Mt&&Mt(Pt,Nt)}),this.setAnimationLoop=function(Pt){Mt=Pt},this.dispose=function(){}}}function y0(i){function t(n,r){n.opacity.value=r.opacity,r.color&&n.diffuse.value.copy(r.color),r.emissive&&n.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity),r.map&&(n.map.value=r.map),r.alphaMap&&(n.alphaMap.value=r.alphaMap),r.specularMap&&(n.specularMap.value=r.specularMap);const o=i.get(r).envMap;if(o){n.envMap.value=o,n.flipEnvMap.value=o.isCubeTexture&&o._needsFlipEnvMap?-1:1,n.reflectivity.value=r.reflectivity,n.refractionRatio.value=r.refractionRatio;const h=i.get(o).__maxMipLevel;h!==void 0&&(n.maxMipLevel.value=h)}let s,a;r.lightMap&&(n.lightMap.value=r.lightMap,n.lightMapIntensity.value=r.lightMapIntensity),r.aoMap&&(n.aoMap.value=r.aoMap,n.aoMapIntensity.value=r.aoMapIntensity),r.map?s=r.map:r.specularMap?s=r.specularMap:r.displacementMap?s=r.displacementMap:r.normalMap?s=r.normalMap:r.bumpMap?s=r.bumpMap:r.roughnessMap?s=r.roughnessMap:r.metalnessMap?s=r.metalnessMap:r.alphaMap?s=r.alphaMap:r.emissiveMap?s=r.emissiveMap:r.clearcoatMap?s=r.clearcoatMap:r.clearcoatNormalMap?s=r.clearcoatNormalMap:r.clearcoatRoughnessMap&&(s=r.clearcoatRoughnessMap),s!==void 0&&(s.isWebGLRenderTarget&&(s=s.texture),s.matrixAutoUpdate===!0&&s.updateMatrix(),n.uvTransform.value.copy(s.matrix)),r.aoMap?a=r.aoMap:r.lightMap&&(a=r.lightMap),a!==void 0&&(a.isWebGLRenderTarget&&(a=a.texture),a.matrixAutoUpdate===!0&&a.updateMatrix(),n.uv2Transform.value.copy(a.matrix))}function e(n,r){n.roughness.value=r.roughness,n.metalness.value=r.metalness,r.roughnessMap&&(n.roughnessMap.value=r.roughnessMap),r.metalnessMap&&(n.metalnessMap.value=r.metalnessMap),r.emissiveMap&&(n.emissiveMap.value=r.emissiveMap),r.bumpMap&&(n.bumpMap.value=r.bumpMap,n.bumpScale.value=r.bumpScale,r.side===1&&(n.bumpScale.value*=-1)),r.normalMap&&(n.normalMap.value=r.normalMap,n.normalScale.value.copy(r.normalScale),r.side===1&&n.normalScale.value.negate()),r.displacementMap&&(n.displacementMap.value=r.displacementMap,n.displacementScale.value=r.displacementScale,n.displacementBias.value=r.displacementBias),i.get(r).envMap&&(n.envMapIntensity.value=r.envMapIntensity)}return{refreshFogUniforms:function(n,r){n.fogColor.value.copy(r.color),r.isFog?(n.fogNear.value=r.near,n.fogFar.value=r.far):r.isFogExp2&&(n.fogDensity.value=r.density)},refreshMaterialUniforms:function(n,r,o,s,a){r.isMeshBasicMaterial?t(n,r):r.isMeshLambertMaterial?(t(n,r),function(h,l){l.emissiveMap&&(h.emissiveMap.value=l.emissiveMap)}(n,r)):r.isMeshToonMaterial?(t(n,r),function(h,l){l.gradientMap&&(h.gradientMap.value=l.gradientMap),l.emissiveMap&&(h.emissiveMap.value=l.emissiveMap),l.bumpMap&&(h.bumpMap.value=l.bumpMap,h.bumpScale.value=l.bumpScale,l.side===1&&(h.bumpScale.value*=-1)),l.normalMap&&(h.normalMap.value=l.normalMap,h.normalScale.value.copy(l.normalScale),l.side===1&&h.normalScale.value.negate()),l.displacementMap&&(h.displacementMap.value=l.displacementMap,h.displacementScale.value=l.displacementScale,h.displacementBias.value=l.displacementBias)}(n,r)):r.isMeshPhongMaterial?(t(n,r),function(h,l){h.specular.value.copy(l.specular),h.shininess.value=Math.max(l.shininess,1e-4),l.emissiveMap&&(h.emissiveMap.value=l.emissiveMap),l.bumpMap&&(h.bumpMap.value=l.bumpMap,h.bumpScale.value=l.bumpScale,l.side===1&&(h.bumpScale.value*=-1)),l.normalMap&&(h.normalMap.value=l.normalMap,h.normalScale.value.copy(l.normalScale),l.side===1&&h.normalScale.value.negate()),l.displacementMap&&(h.displacementMap.value=l.displacementMap,h.displacementScale.value=l.displacementScale,h.displacementBias.value=l.displacementBias)}(n,r)):r.isMeshStandardMaterial?(t(n,r),r.isMeshPhysicalMaterial?function(h,l,u){e(h,l),h.reflectivity.value=l.reflectivity,h.clearcoat.value=l.clearcoat,h.clearcoatRoughness.value=l.clearcoatRoughness,l.sheen&&h.sheen.value.copy(l.sheen),l.clearcoatMap&&(h.clearcoatMap.value=l.clearcoatMap),l.clearcoatRoughnessMap&&(h.clearcoatRoughnessMap.value=l.clearcoatRoughnessMap),l.clearcoatNormalMap&&(h.clearcoatNormalScale.value.copy(l.clearcoatNormalScale),h.clearcoatNormalMap.value=l.clearcoatNormalMap,l.side===1&&h.clearcoatNormalScale.value.negate()),h.transmission.value=l.transmission,l.transmissionMap&&(h.transmissionMap.value=l.transmissionMap),l.transmission>0&&(h.transmissionSamplerMap.value=u.texture,h.transmissionSamplerSize.value.set(u.width,u.height)),h.thickness.value=l.thickness,l.thicknessMap&&(h.thicknessMap.value=l.thicknessMap),h.attenuationDistance.value=l.attenuationDistance,h.attenuationColor.value.copy(l.attenuationColor)}(n,r,a):e(n,r)):r.isMeshMatcapMaterial?(t(n,r),function(h,l){l.matcap&&(h.matcap.value=l.matcap),l.bumpMap&&(h.bumpMap.value=l.bumpMap,h.bumpScale.value=l.bumpScale,l.side===1&&(h.bumpScale.value*=-1)),l.normalMap&&(h.normalMap.value=l.normalMap,h.normalScale.value.copy(l.normalScale),l.side===1&&h.normalScale.value.negate()),l.displacementMap&&(h.displacementMap.value=l.displacementMap,h.displacementScale.value=l.displacementScale,h.displacementBias.value=l.displacementBias)}(n,r)):r.isMeshDepthMaterial?(t(n,r),function(h,l){l.displacementMap&&(h.displacementMap.value=l.displacementMap,h.displacementScale.value=l.displacementScale,h.displacementBias.value=l.displacementBias)}(n,r)):r.isMeshDistanceMaterial?(t(n,r),function(h,l){l.displacementMap&&(h.displacementMap.value=l.displacementMap,h.displacementScale.value=l.displacementScale,h.displacementBias.value=l.displacementBias),h.referencePosition.value.copy(l.referencePosition),h.nearDistance.value=l.nearDistance,h.farDistance.value=l.farDistance}(n,r)):r.isMeshNormalMaterial?(t(n,r),function(h,l){l.bumpMap&&(h.bumpMap.value=l.bumpMap,h.bumpScale.value=l.bumpScale,l.side===1&&(h.bumpScale.value*=-1)),l.normalMap&&(h.normalMap.value=l.normalMap,h.normalScale.value.copy(l.normalScale),l.side===1&&h.normalScale.value.negate()),l.displacementMap&&(h.displacementMap.value=l.displacementMap,h.displacementScale.value=l.displacementScale,h.displacementBias.value=l.displacementBias)}(n,r)):r.isLineBasicMaterial?(function(h,l){h.diffuse.value.copy(l.color),h.opacity.value=l.opacity}(n,r),r.isLineDashedMaterial&&function(h,l){h.dashSize.value=l.dashSize,h.totalSize.value=l.dashSize+l.gapSize,h.scale.value=l.scale}(n,r)):r.isPointsMaterial?function(h,l,u,p){h.diffuse.value.copy(l.color),h.opacity.value=l.opacity,h.size.value=l.size*u,h.scale.value=.5*p,l.map&&(h.map.value=l.map),l.alphaMap&&(h.alphaMap.value=l.alphaMap);let y;l.map?y=l.map:l.alphaMap&&(y=l.alphaMap),y!==void 0&&(y.matrixAutoUpdate===!0&&y.updateMatrix(),h.uvTransform.value.copy(y.matrix))}(n,r,o,s):r.isSpriteMaterial?function(h,l){h.diffuse.value.copy(l.color),h.opacity.value=l.opacity,h.rotation.value=l.rotation,l.map&&(h.map.value=l.map),l.alphaMap&&(h.alphaMap.value=l.alphaMap);let u;l.map?u=l.map:l.alphaMap&&(u=l.alphaMap),u!==void 0&&(u.matrixAutoUpdate===!0&&u.updateMatrix(),h.uvTransform.value.copy(u.matrix))}(n,r):r.isShadowMaterial?(n.color.value.copy(r.color),n.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function ti(i={}){const t=i.canvas!==void 0?i.canvas:function(){const Gt=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return Gt.style.display="block",Gt}(),e=i.context!==void 0?i.context:null,n=i.alpha!==void 0&&i.alpha,r=i.depth===void 0||i.depth,o=i.stencil===void 0||i.stencil,s=i.antialias!==void 0&&i.antialias,a=i.premultipliedAlpha===void 0||i.premultipliedAlpha,h=i.preserveDrawingBuffer!==void 0&&i.preserveDrawingBuffer,l=i.powerPreference!==void 0?i.powerPreference:"default",u=i.failIfMajorPerformanceCaveat!==void 0&&i.failIfMajorPerformanceCaveat;let p=null,y=null;const x=[],E=[];this.domElement=t,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=3e3,this.physicallyCorrectLights=!1,this.toneMapping=0,this.toneMappingExposure=1;const A=this;let C=!1,j=0,Q=0,rt=null,pt=-1,it=null;const gt=new Ot,ht=new Ot;let mt=null,jt=t.width,Ft=t.height,Mt=1,wt=null,Pt=null;const Nt=new Ot(0,0,jt,Ft),ne=new Ot(0,0,jt,Ft);let $t=!1;const Vt=[],Yt=new Br;let ge=!1,be=!1,Pe=null;const Ct=new tn,Bt=new U,ve={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function le(){return rt===null?Mt:1}let se,Ie,Le,ue,bt,Ht,ie,ae,qt,ye,nn,on,rn,Sn,Ai,Jn,dr,za,Va,Wa,hr,pr,He=e;function Wg(Gt,Ce){for(let fe=0;fe<Gt.length;fe++){const Re=Gt[fe],We=t.getContext(Re,Ce);if(We!==null)return We}return null}try{const Gt={alpha:n,depth:r,stencil:o,antialias:s,premultipliedAlpha:a,preserveDrawingBuffer:h,powerPreference:l,failIfMajorPerformanceCaveat:u};if(t.addEventListener("webglcontextlost",Yg,!1),t.addEventListener("webglcontextrestored",qg,!1),He===null){const Ce=["webgl2","webgl","experimental-webgl"];if(A.isWebGL1Renderer===!0&&Ce.shift(),He=Wg(Ce,Gt),He===null)throw Wg(Ce)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}He.getShaderPrecisionFormat===void 0&&(He.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(Gt){throw console.error("THREE.WebGLRenderer: "+Gt.message),Gt}function Xg(){se=new el(He),Ie=new Ch(He,se,i),se.init(Ie),hr=new g0(He,se,Ie),Le=new f0(He,se,Ie),Vt[0]=1029,ue=new Nh,bt=new s0,Ht=new m0(He,se,Le,bt,Ie,hr,ue),ie=new Ih(A),ae=new ts(He,Ie),pr=new ao(He,se,ae,Ie),qt=new Ph(He,ae,ue,pr),ye=new Fh(He,qt,ae,ue),za=new Dh(He),Ai=new Rh(bt),nn=new o0(A,ie,se,Ie,pr,Ai),on=new y0(bt),rn=new l0(bt),Sn=new p0(se,Ie),dr=new Mh(A,ie,Le,ye,a),Jn=new id(A,ye,Ie),Va=new es(He,se,ue,Ie),Wa=new Oh(He,se,ue,Ie),ue.programs=nn.programs,A.capabilities=Ie,A.extensions=se,A.properties=bt,A.renderLists=rn,A.shadowMap=Jn,A.state=Le,A.info=ue}Xg();const Tr=new _0(A,He);function Yg(Gt){Gt.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),C=!0}function qg(){console.log("THREE.WebGLRenderer: Context Restored."),C=!1;const Gt=ue.autoReset,Ce=Jn.enabled,fe=Jn.autoUpdate,Re=Jn.needsUpdate,We=Jn.type;Xg(),ue.autoReset=Gt,Jn.enabled=Ce,Jn.autoUpdate=fe,Jn.needsUpdate=Re,Jn.type=We}function Jg(Gt){const Ce=Gt.target;Ce.removeEventListener("dispose",Jg),function(fe){(function(Re){const We=bt.get(Re).programs;We!==void 0&&We.forEach(function(Vn){nn.releaseProgram(Vn)})})(fe),bt.remove(fe)}(Ce)}this.xr=Tr,this.getContext=function(){return He},this.getContextAttributes=function(){return He.getContextAttributes()},this.forceContextLoss=function(){const Gt=se.get("WEBGL_lose_context");Gt&&Gt.loseContext()},this.forceContextRestore=function(){const Gt=se.get("WEBGL_lose_context");Gt&&Gt.restoreContext()},this.getPixelRatio=function(){return Mt},this.setPixelRatio=function(Gt){Gt!==void 0&&(Mt=Gt,this.setSize(jt,Ft,!1))},this.getSize=function(Gt){return Gt.set(jt,Ft)},this.setSize=function(Gt,Ce,fe){Tr.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(jt=Gt,Ft=Ce,t.width=Math.floor(Gt*Mt),t.height=Math.floor(Ce*Mt),fe!==!1&&(t.style.width=Gt+"px",t.style.height=Ce+"px"),this.setViewport(0,0,Gt,Ce))},this.getDrawingBufferSize=function(Gt){return Gt.set(jt*Mt,Ft*Mt).floor()},this.setDrawingBufferSize=function(Gt,Ce,fe){jt=Gt,Ft=Ce,Mt=fe,t.width=Math.floor(Gt*fe),t.height=Math.floor(Ce*fe),this.setViewport(0,0,Gt,Ce)},this.getCurrentViewport=function(Gt){return Gt.copy(gt)},this.getViewport=function(Gt){return Gt.copy(Nt)},this.setViewport=function(Gt,Ce,fe,Re){Gt.isVector4?Nt.set(Gt.x,Gt.y,Gt.z,Gt.w):Nt.set(Gt,Ce,fe,Re),Le.viewport(gt.copy(Nt).multiplyScalar(Mt).floor())},this.getScissor=function(Gt){return Gt.copy(ne)},this.setScissor=function(Gt,Ce,fe,Re){Gt.isVector4?ne.set(Gt.x,Gt.y,Gt.z,Gt.w):ne.set(Gt,Ce,fe,Re),Le.scissor(ht.copy(ne).multiplyScalar(Mt).floor())},this.getScissorTest=function(){return $t},this.setScissorTest=function(Gt){Le.setScissorTest($t=Gt)},this.setOpaqueSort=function(Gt){wt=Gt},this.setTransparentSort=function(Gt){Pt=Gt},this.getClearColor=function(Gt){return Gt.copy(dr.getClearColor())},this.setClearColor=function(){dr.setClearColor.apply(dr,arguments)},this.getClearAlpha=function(){return dr.getClearAlpha()},this.setClearAlpha=function(){dr.setClearAlpha.apply(dr,arguments)},this.clear=function(Gt,Ce,fe){let Re=0;(Gt===void 0||Gt)&&(Re|=16384),(Ce===void 0||Ce)&&(Re|=256),(fe===void 0||fe)&&(Re|=1024),He.clear(Re)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",Yg,!1),t.removeEventListener("webglcontextrestored",qg,!1),rn.dispose(),Sn.dispose(),bt.dispose(),ie.dispose(),ye.dispose(),pr.dispose(),Tr.dispose(),Tr.removeEventListener("sessionstart",Kg),Tr.removeEventListener("sessionend",Zg),Pe&&(Pe.dispose(),Pe=null),fs.stop()},this.renderBufferImmediate=function(Gt,Ce){pr.initAttributes();const fe=bt.get(Gt);Gt.hasPositions&&!fe.position&&(fe.position=He.createBuffer()),Gt.hasNormals&&!fe.normal&&(fe.normal=He.createBuffer()),Gt.hasUvs&&!fe.uv&&(fe.uv=He.createBuffer()),Gt.hasColors&&!fe.color&&(fe.color=He.createBuffer());const Re=Ce.getAttributes();Gt.hasPositions&&(He.bindBuffer(34962,fe.position),He.bufferData(34962,Gt.positionArray,35048),pr.enableAttribute(Re.position),He.vertexAttribPointer(Re.position,3,5126,!1,0,0)),Gt.hasNormals&&(He.bindBuffer(34962,fe.normal),He.bufferData(34962,Gt.normalArray,35048),pr.enableAttribute(Re.normal),He.vertexAttribPointer(Re.normal,3,5126,!1,0,0)),Gt.hasUvs&&(He.bindBuffer(34962,fe.uv),He.bufferData(34962,Gt.uvArray,35048),pr.enableAttribute(Re.uv),He.vertexAttribPointer(Re.uv,2,5126,!1,0,0)),Gt.hasColors&&(He.bindBuffer(34962,fe.color),He.bufferData(34962,Gt.colorArray,35048),pr.enableAttribute(Re.color),He.vertexAttribPointer(Re.color,3,5126,!1,0,0)),pr.disableUnusedAttributes(),He.drawArrays(4,0,Gt.count),Gt.count=0},this.renderBufferDirect=function(Gt,Ce,fe,Re,We,Vn){Ce===null&&(Ce=ve);const wn=We.isMesh&&We.matrixWorld.determinant()<0,Ze=tv(Gt,Ce,Re,We);Le.setMaterial(Re,wn);let Ln=fe.index;const mn=fe.attributes.position;if(Ln===null){if(mn===void 0||mn.count===0)return}else if(Ln.count===0)return;let zn,En=1;Re.wireframe===!0&&(Ln=qt.getWireframeAttribute(fe),En=2),(Re.morphTargets||Re.morphNormals)&&za.update(We,fe,Re,Ze),pr.setup(We,Re,Ze,fe,Ln);let Hn=Va;Ln!==null&&(zn=ae.get(Ln),Hn=Wa,Hn.setIndex(zn));const Ni=Ln!==null?Ln.count:mn.count,ai=fe.drawRange.start*En,zr=fe.drawRange.count*En,oi=Vn!==null?Vn.start*En:0,eo=Vn!==null?Vn.count*En:1/0,Hi=Math.max(ai,oi),Er=Math.min(Ni,ai+zr,oi+eo)-1,rr=Math.max(0,Er-Hi+1);if(rr!==0){if(We.isMesh)Re.wireframe===!0?(Le.setLineWidth(Re.wireframeLinewidth*le()),Hn.setMode(1)):Hn.setMode(4);else if(We.isLine){let Xa=Re.linewidth;Xa===void 0&&(Xa=1),Le.setLineWidth(Xa*le()),We.isLineSegments?Hn.setMode(1):We.isLineLoop?Hn.setMode(2):Hn.setMode(3)}else We.isPoints?Hn.setMode(0):We.isSprite&&Hn.setMode(4);if(We.isInstancedMesh)Hn.renderInstances(Hi,rr,We.count);else if(fe.isInstancedBufferGeometry){const Xa=Math.min(fe.instanceCount,fe._maxInstanceCount);Hn.renderInstances(Hi,rr,Xa)}else Hn.render(Hi,rr)}},this.compile=function(Gt,Ce){y=Sn.get(Gt),y.init(),Gt.traverseVisible(function(fe){fe.isLight&&fe.layers.test(Ce.layers)&&(y.pushLight(fe),fe.castShadow&&y.pushShadow(fe))}),y.setupLights(),Gt.traverse(function(fe){const Re=fe.material;if(Re)if(Array.isArray(Re))for(let We=0;We<Re.length;We++)wc(Re[We],Gt,fe);else wc(Re,Gt,fe)})};let Sc=null;function Kg(){fs.stop()}function Zg(){fs.start()}const fs=new $o;function _h(Gt,Ce,fe){const Re=Ce.isScene===!0?Ce.overrideMaterial:null;for(let We=0,Vn=Gt.length;We<Vn;We++){const wn=Gt[We],Ze=wn.object,Ln=wn.geometry,mn=Re===null?wn.material:Re,zn=wn.group;if(fe.isArrayCamera){const En=fe.cameras;for(let Hn=0,Ni=En.length;Hn<Ni;Hn++){const ai=En[Hn];Ze.layers.test(ai.layers)&&(Le.viewport(gt.copy(ai.viewport)),y.setupLightsView(ai),Qg(Ze,Ce,ai,Ln,mn,zn))}}else Qg(Ze,Ce,fe,Ln,mn,zn)}}function Qg(Gt,Ce,fe,Re,We,Vn){if(Gt.onBeforeRender(A,Ce,fe,Re,We,Vn),Gt.modelViewMatrix.multiplyMatrices(fe.matrixWorldInverse,Gt.matrixWorld),Gt.normalMatrix.getNormalMatrix(Gt.modelViewMatrix),Gt.isImmediateRenderObject){const wn=tv(fe,Ce,We,Gt);Le.setMaterial(We),pr.reset(),function(Ze,Ln){Ze.render(function(mn){A.renderBufferImmediate(mn,Ln)})}(Gt,wn)}else We.transparent===!0&&We.side===2?(We.side=1,We.needsUpdate=!0,A.renderBufferDirect(fe,Ce,Re,We,Gt,Vn),We.side=0,We.needsUpdate=!0,A.renderBufferDirect(fe,Ce,Re,We,Gt,Vn),We.side=2):A.renderBufferDirect(fe,Ce,Re,We,Gt,Vn);Gt.onAfterRender(A,Ce,fe,Re,We,Vn)}function wc(Gt,Ce,fe){Ce.isScene!==!0&&(Ce=ve);const Re=bt.get(Gt),We=y.state.lights,Vn=y.state.shadowsArray,wn=We.state.version,Ze=nn.getParameters(Gt,We.state,Vn,Ce,fe),Ln=nn.getProgramCacheKey(Ze);let mn=Re.programs;Re.environment=Gt.isMeshStandardMaterial?Ce.environment:null,Re.fog=Ce.fog,Re.envMap=ie.get(Gt.envMap||Re.environment),mn===void 0&&(Gt.addEventListener("dispose",Jg),mn=new Map,Re.programs=mn);let zn=mn.get(Ln);if(zn!==void 0){if(Re.currentProgram===zn&&Re.lightsStateVersion===wn)return $g(Gt,Ze),zn}else Ze.uniforms=nn.getUniforms(Gt),Gt.onBuild(Ze,A),Gt.onBeforeCompile(Ze,A),zn=nn.acquireProgram(Ze,Ln),mn.set(Ln,zn),Re.uniforms=Ze.uniforms;const En=Re.uniforms;(Gt.isShaderMaterial||Gt.isRawShaderMaterial)&&Gt.clipping!==!0||(En.clippingPlanes=Ai.uniform),$g(Gt,Ze),Re.needsLights=function(ai){return ai.isMeshLambertMaterial||ai.isMeshToonMaterial||ai.isMeshPhongMaterial||ai.isMeshStandardMaterial||ai.isShadowMaterial||ai.isShaderMaterial&&ai.lights===!0}(Gt),Re.lightsStateVersion=wn,Re.needsLights&&(En.ambientLightColor.value=We.state.ambient,En.lightProbe.value=We.state.probe,En.directionalLights.value=We.state.directional,En.directionalLightShadows.value=We.state.directionalShadow,En.spotLights.value=We.state.spot,En.spotLightShadows.value=We.state.spotShadow,En.rectAreaLights.value=We.state.rectArea,En.ltc_1.value=We.state.rectAreaLTC1,En.ltc_2.value=We.state.rectAreaLTC2,En.pointLights.value=We.state.point,En.pointLightShadows.value=We.state.pointShadow,En.hemisphereLights.value=We.state.hemi,En.directionalShadowMap.value=We.state.directionalShadowMap,En.directionalShadowMatrix.value=We.state.directionalShadowMatrix,En.spotShadowMap.value=We.state.spotShadowMap,En.spotShadowMatrix.value=We.state.spotShadowMatrix,En.pointShadowMap.value=We.state.pointShadowMap,En.pointShadowMatrix.value=We.state.pointShadowMatrix);const Hn=zn.getUniforms(),Ni=ii.seqWithValue(Hn.seq,En);return Re.currentProgram=zn,Re.uniformsList=Ni,zn}function $g(Gt,Ce){const fe=bt.get(Gt);fe.outputEncoding=Ce.outputEncoding,fe.instancing=Ce.instancing,fe.skinning=Ce.skinning,fe.numClippingPlanes=Ce.numClippingPlanes,fe.numIntersection=Ce.numClipIntersection,fe.vertexAlphas=Ce.vertexAlphas}function tv(Gt,Ce,fe,Re){Ce.isScene!==!0&&(Ce=ve),Ht.resetTextureUnits();const We=Ce.fog,Vn=fe.isMeshStandardMaterial?Ce.environment:null,wn=rt===null?A.outputEncoding:rt.texture.encoding,Ze=ie.get(fe.envMap||Vn),Ln=fe.vertexColors===!0&&Re.geometry&&Re.geometry.attributes.color&&Re.geometry.attributes.color.itemSize===4,mn=bt.get(fe),zn=y.state.lights;if(ge===!0&&(be===!0||Gt!==it)){const rr=Gt===it&&fe.id===pt;Ai.setState(fe,Gt,rr)}let En=!1;fe.version===mn.__version?mn.needsLights&&mn.lightsStateVersion!==zn.state.version||mn.outputEncoding!==wn||Re.isInstancedMesh&&mn.instancing===!1?En=!0:Re.isInstancedMesh||mn.instancing!==!0?Re.isSkinnedMesh&&mn.skinning===!1?En=!0:Re.isSkinnedMesh||mn.skinning!==!0?mn.envMap!==Ze||fe.fog&&mn.fog!==We?En=!0:mn.numClippingPlanes===void 0||mn.numClippingPlanes===Ai.numPlanes&&mn.numIntersection===Ai.numIntersection?mn.vertexAlphas!==Ln&&(En=!0):En=!0:En=!0:En=!0:(En=!0,mn.__version=fe.version);let Hn=mn.currentProgram;En===!0&&(Hn=wc(fe,Ce,Re));let Ni=!1,ai=!1,zr=!1;const oi=Hn.getUniforms(),eo=mn.uniforms;if(Le.useProgram(Hn.program)&&(Ni=!0,ai=!0,zr=!0),fe.id!==pt&&(pt=fe.id,ai=!0),Ni||it!==Gt){if(oi.setValue(He,"projectionMatrix",Gt.projectionMatrix),Ie.logarithmicDepthBuffer&&oi.setValue(He,"logDepthBufFC",2/(Math.log(Gt.far+1)/Math.LN2)),it!==Gt&&(it=Gt,ai=!0,zr=!0),fe.isShaderMaterial||fe.isMeshPhongMaterial||fe.isMeshToonMaterial||fe.isMeshStandardMaterial||fe.envMap){const rr=oi.map.cameraPosition;rr!==void 0&&rr.setValue(He,Bt.setFromMatrixPosition(Gt.matrixWorld))}(fe.isMeshPhongMaterial||fe.isMeshToonMaterial||fe.isMeshLambertMaterial||fe.isMeshBasicMaterial||fe.isMeshStandardMaterial||fe.isShaderMaterial)&&oi.setValue(He,"isOrthographic",Gt.isOrthographicCamera===!0),(fe.isMeshPhongMaterial||fe.isMeshToonMaterial||fe.isMeshLambertMaterial||fe.isMeshBasicMaterial||fe.isMeshStandardMaterial||fe.isShaderMaterial||fe.isShadowMaterial||Re.isSkinnedMesh)&&oi.setValue(He,"viewMatrix",Gt.matrixWorldInverse)}if(Re.isSkinnedMesh){oi.setOptional(He,Re,"bindMatrix"),oi.setOptional(He,Re,"bindMatrixInverse");const rr=Re.skeleton;rr&&(Ie.floatVertexTextures?(rr.boneTexture===null&&rr.computeBoneTexture(),oi.setValue(He,"boneTexture",rr.boneTexture,Ht),oi.setValue(He,"boneTextureSize",rr.boneTextureSize)):oi.setOptional(He,rr,"boneMatrices"))}var Hi,Er;return(ai||mn.receiveShadow!==Re.receiveShadow)&&(mn.receiveShadow=Re.receiveShadow,oi.setValue(He,"receiveShadow",Re.receiveShadow)),ai&&(oi.setValue(He,"toneMappingExposure",A.toneMappingExposure),mn.needsLights&&(Er=zr,(Hi=eo).ambientLightColor.needsUpdate=Er,Hi.lightProbe.needsUpdate=Er,Hi.directionalLights.needsUpdate=Er,Hi.directionalLightShadows.needsUpdate=Er,Hi.pointLights.needsUpdate=Er,Hi.pointLightShadows.needsUpdate=Er,Hi.spotLights.needsUpdate=Er,Hi.spotLightShadows.needsUpdate=Er,Hi.rectAreaLights.needsUpdate=Er,Hi.hemisphereLights.needsUpdate=Er),We&&fe.fog&&on.refreshFogUniforms(eo,We),on.refreshMaterialUniforms(eo,fe,Mt,Ft,Pe),ii.upload(He,mn.uniformsList,eo,Ht)),fe.isShaderMaterial&&fe.uniformsNeedUpdate===!0&&(ii.upload(He,mn.uniformsList,eo,Ht),fe.uniformsNeedUpdate=!1),fe.isSpriteMaterial&&oi.setValue(He,"center",Re.center),oi.setValue(He,"modelViewMatrix",Re.modelViewMatrix),oi.setValue(He,"normalMatrix",Re.normalMatrix),oi.setValue(He,"modelMatrix",Re.matrixWorld),Hn}fs.setAnimationLoop(function(Gt){Sc&&Sc(Gt)}),typeof window!="undefined"&&fs.setContext(window),this.setAnimationLoop=function(Gt){Sc=Gt,Tr.setAnimationLoop(Gt),Gt===null?fs.stop():fs.start()},Tr.addEventListener("sessionstart",Kg),Tr.addEventListener("sessionend",Zg),this.render=function(Gt,Ce){if(Ce!==void 0&&Ce.isCamera!==!0)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(C===!0)return;Gt.autoUpdate===!0&&Gt.updateMatrixWorld(),Ce.parent===null&&Ce.updateMatrixWorld(),Tr.enabled===!0&&Tr.isPresenting===!0&&(Tr.cameraAutoUpdate===!0&&Tr.updateCamera(Ce),Ce=Tr.getCamera()),Gt.isScene===!0&&Gt.onBeforeRender(A,Gt,Ce,rt),y=Sn.get(Gt,E.length),y.init(),E.push(y),Ct.multiplyMatrices(Ce.projectionMatrix,Ce.matrixWorldInverse),Yt.setFromProjectionMatrix(Ct),be=this.localClippingEnabled,ge=Ai.init(this.clippingPlanes,be,Ce),p=rn.get(Gt,x.length),p.init(),x.push(p),function wn(Ze,Ln,mn,zn){if(Ze.visible===!1)return;if(Ze.layers.test(Ln.layers)){if(Ze.isGroup)mn=Ze.renderOrder;else if(Ze.isLOD)Ze.autoUpdate===!0&&Ze.update(Ln);else if(Ze.isLight)y.pushLight(Ze),Ze.castShadow&&y.pushShadow(Ze);else if(Ze.isSprite){if(!Ze.frustumCulled||Yt.intersectsSprite(Ze)){zn&&Bt.setFromMatrixPosition(Ze.matrixWorld).applyMatrix4(Ct);const Hn=ye.update(Ze),Ni=Ze.material;Ni.visible&&p.push(Ze,Hn,Ni,mn,Bt.z,null)}}else if(Ze.isImmediateRenderObject)zn&&Bt.setFromMatrixPosition(Ze.matrixWorld).applyMatrix4(Ct),p.push(Ze,null,Ze.material,mn,Bt.z,null);else if((Ze.isMesh||Ze.isLine||Ze.isPoints)&&(Ze.isSkinnedMesh&&Ze.skeleton.frame!==ue.render.frame&&(Ze.skeleton.update(),Ze.skeleton.frame=ue.render.frame),!Ze.frustumCulled||Yt.intersectsObject(Ze))){zn&&Bt.setFromMatrixPosition(Ze.matrixWorld).applyMatrix4(Ct);const Hn=ye.update(Ze),Ni=Ze.material;if(Array.isArray(Ni)){const ai=Hn.groups;for(let zr=0,oi=ai.length;zr<oi;zr++){const eo=ai[zr],Hi=Ni[eo.materialIndex];Hi&&Hi.visible&&p.push(Ze,Hn,Hi,mn,Bt.z,eo)}}else Ni.visible&&p.push(Ze,Hn,Ni,mn,Bt.z,null)}}const En=Ze.children;for(let Hn=0,Ni=En.length;Hn<Ni;Hn++)wn(En[Hn],Ln,mn,zn)}(Gt,Ce,0,A.sortObjects),p.finish(),A.sortObjects===!0&&p.sort(wt,Pt),ge===!0&&Ai.beginShadows();const fe=y.state.shadowsArray;Jn.render(fe,Gt,Ce),y.setupLights(),y.setupLightsView(Ce),ge===!0&&Ai.endShadows(),this.info.autoReset===!0&&this.info.reset(),dr.render(p,Gt);const Re=p.opaque,We=p.transmissive,Vn=p.transparent;Re.length>0&&_h(Re,Gt,Ce),We.length>0&&function(wn,Ze,Ln,mn){if(Pe===null){const Hn=s===!0&&Ie.isWebGL2===!0;Pe=new(Hn?st:zt)(1024,1024,{generateMipmaps:!0,type:hr.convert(1016)!==null?1016:1009,minFilter:1008,magFilter:1003,wrapS:1001,wrapT:1001})}const zn=A.getRenderTarget();A.setRenderTarget(Pe),A.clear();const En=A.toneMapping;A.toneMapping=0,_h(wn,Ln,mn),A.toneMapping=En,Ht.updateMultisampleRenderTarget(Pe),Ht.updateRenderTargetMipmap(Pe),A.setRenderTarget(zn),_h(Ze,Ln,mn)}(Re,We,Gt,Ce),Vn.length>0&&_h(Vn,Gt,Ce),rt!==null&&(Ht.updateMultisampleRenderTarget(rt),Ht.updateRenderTargetMipmap(rt)),Gt.isScene===!0&&Gt.onAfterRender(A,Gt,Ce),Le.buffers.depth.setTest(!0),Le.buffers.depth.setMask(!0),Le.buffers.color.setMask(!0),Le.setPolygonOffset(!1),pr.resetDefaultState(),pt=-1,it=null,E.pop(),y=E.length>0?E[E.length-1]:null,x.pop(),p=x.length>0?x[x.length-1]:null},this.getActiveCubeFace=function(){return j},this.getActiveMipmapLevel=function(){return Q},this.getRenderTarget=function(){return rt},this.setRenderTarget=function(Gt,Ce=0,fe=0){rt=Gt,j=Ce,Q=fe,Gt&&bt.get(Gt).__webglFramebuffer===void 0&&Ht.setupRenderTarget(Gt);let Re=null,We=!1,Vn=!1;if(Gt){const wn=Gt.texture;(wn.isDataTexture3D||wn.isDataTexture2DArray)&&(Vn=!0);const Ze=bt.get(Gt).__webglFramebuffer;Gt.isWebGLCubeRenderTarget?(Re=Ze[Ce],We=!0):Re=Gt.isWebGLMultisampleRenderTarget?bt.get(Gt).__webglMultisampledFramebuffer:Ze,gt.copy(Gt.viewport),ht.copy(Gt.scissor),mt=Gt.scissorTest}else gt.copy(Nt).multiplyScalar(Mt).floor(),ht.copy(ne).multiplyScalar(Mt).floor(),mt=$t;if(Le.bindFramebuffer(36160,Re)&&Ie.drawBuffers){let wn=!1;if(Gt)if(Gt.isWebGLMultipleRenderTargets){const Ze=Gt.texture;if(Vt.length!==Ze.length||Vt[0]!==36064){for(let Ln=0,mn=Ze.length;Ln<mn;Ln++)Vt[Ln]=36064+Ln;Vt.length=Ze.length,wn=!0}}else Vt.length===1&&Vt[0]===36064||(Vt[0]=36064,Vt.length=1,wn=!0);else Vt.length===1&&Vt[0]===1029||(Vt[0]=1029,Vt.length=1,wn=!0);wn&&(Ie.isWebGL2?He.drawBuffers(Vt):se.get("WEBGL_draw_buffers").drawBuffersWEBGL(Vt))}if(Le.viewport(gt),Le.scissor(ht),Le.setScissorTest(mt),We){const wn=bt.get(Gt.texture);He.framebufferTexture2D(36160,36064,34069+Ce,wn.__webglTexture,fe)}else if(Vn){const wn=bt.get(Gt.texture),Ze=Ce||0;He.framebufferTextureLayer(36160,36064,wn.__webglTexture,fe||0,Ze)}},this.readRenderTargetPixels=function(Gt,Ce,fe,Re,We,Vn,wn){if(!Gt||!Gt.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Ze=bt.get(Gt).__webglFramebuffer;if(Gt.isWebGLCubeRenderTarget&&wn!==void 0&&(Ze=Ze[wn]),Ze){Le.bindFramebuffer(36160,Ze);try{const Ln=Gt.texture,mn=Ln.format,zn=Ln.type;if(mn!==1023&&hr.convert(mn)!==He.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const En=zn===1016&&(se.has("EXT_color_buffer_half_float")||Ie.isWebGL2&&se.has("EXT_color_buffer_float"));if(!(zn===1009||hr.convert(zn)===He.getParameter(35738)||zn===1015&&(Ie.isWebGL2||se.has("OES_texture_float")||se.has("WEBGL_color_buffer_float"))||En))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");He.checkFramebufferStatus(36160)===36053?Ce>=0&&Ce<=Gt.width-Re&&fe>=0&&fe<=Gt.height-We&&He.readPixels(Ce,fe,Re,We,hr.convert(mn),hr.convert(zn),Vn):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{const Ln=rt!==null?bt.get(rt).__webglFramebuffer:null;Le.bindFramebuffer(36160,Ln)}}},this.copyFramebufferToTexture=function(Gt,Ce,fe=0){const Re=Math.pow(2,-fe),We=Math.floor(Ce.image.width*Re),Vn=Math.floor(Ce.image.height*Re);let wn=hr.convert(Ce.format);Ie.isWebGL2&&(wn===6407&&(wn=32849),wn===6408&&(wn=32856)),Ht.setTexture2D(Ce,0),He.copyTexImage2D(3553,fe,wn,Gt.x,Gt.y,We,Vn,0),Le.unbindTexture()},this.copyTextureToTexture=function(Gt,Ce,fe,Re=0){const We=Ce.image.width,Vn=Ce.image.height,wn=hr.convert(fe.format),Ze=hr.convert(fe.type);Ht.setTexture2D(fe,0),He.pixelStorei(37440,fe.flipY),He.pixelStorei(37441,fe.premultiplyAlpha),He.pixelStorei(3317,fe.unpackAlignment),Ce.isDataTexture?He.texSubImage2D(3553,Re,Gt.x,Gt.y,We,Vn,wn,Ze,Ce.image.data):Ce.isCompressedTexture?He.compressedTexSubImage2D(3553,Re,Gt.x,Gt.y,Ce.mipmaps[0].width,Ce.mipmaps[0].height,wn,Ce.mipmaps[0].data):He.texSubImage2D(3553,Re,Gt.x,Gt.y,wn,Ze,Ce.image),Re===0&&fe.generateMipmaps&&He.generateMipmap(3553),Le.unbindTexture()},this.copyTextureToTexture3D=function(Gt,Ce,fe,Re,We=0){if(A.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const Vn=Gt.max.x-Gt.min.x+1,wn=Gt.max.y-Gt.min.y+1,Ze=Gt.max.z-Gt.min.z+1,Ln=hr.convert(Re.format),mn=hr.convert(Re.type);let zn;if(Re.isDataTexture3D)Ht.setTexture3D(Re,0),zn=32879;else{if(!Re.isDataTexture2DArray)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");Ht.setTexture2DArray(Re,0),zn=35866}He.pixelStorei(37440,Re.flipY),He.pixelStorei(37441,Re.premultiplyAlpha),He.pixelStorei(3317,Re.unpackAlignment);const En=He.getParameter(3314),Hn=He.getParameter(32878),Ni=He.getParameter(3316),ai=He.getParameter(3315),zr=He.getParameter(32877),oi=fe.isCompressedTexture?fe.mipmaps[0]:fe.image;He.pixelStorei(3314,oi.width),He.pixelStorei(32878,oi.height),He.pixelStorei(3316,Gt.min.x),He.pixelStorei(3315,Gt.min.y),He.pixelStorei(32877,Gt.min.z),fe.isDataTexture||fe.isDataTexture3D?He.texSubImage3D(zn,We,Ce.x,Ce.y,Ce.z,Vn,wn,Ze,Ln,mn,oi.data):fe.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),He.compressedTexSubImage3D(zn,We,Ce.x,Ce.y,Ce.z,Vn,wn,Ze,Ln,oi.data)):He.texSubImage3D(zn,We,Ce.x,Ce.y,Ce.z,Vn,wn,Ze,Ln,mn,oi),He.pixelStorei(3314,En),He.pixelStorei(32878,Hn),He.pixelStorei(3316,Ni),He.pixelStorei(3315,ai),He.pixelStorei(32877,zr),We===0&&Re.generateMipmaps&&He.generateMipmap(zn),Le.unbindTexture()},this.initTexture=function(Gt){Ht.setTexture2D(Gt,0),Le.unbindTexture()},this.resetState=function(){j=0,Q=0,rt=null,Le.reset(),pr.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}(class extends ti{}).prototype.isWebGL1Renderer=!0;class zh extends Un{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return this.fog!==null&&(e.object.fog=this.fog.toJSON()),e}}zh.prototype.isScene=!0;class oa{constructor(t,e){this.array=t,this.stride=e,this.count=t!==void 0?t.length/e:0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Y()}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,n){t*=this.stride,n*=e.stride;for(let r=0,o=this.stride;r<o;r++)this.array[t+r]=e.array[n+r];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Y()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(e,this.stride);return n.setUsage(this.usage),n}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Y()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}oa.prototype.isInterleavedBuffer=!0;const Ii=new U;class sa{constructor(t,e,n,r=!1){this.name="",this.data=t,this.itemSize=e,this.offset=n,this.normalized=r===!0}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,n=this.data.count;e<n;e++)Ii.x=this.getX(e),Ii.y=this.getY(e),Ii.z=this.getZ(e),Ii.applyMatrix4(t),this.setXYZ(e,Ii.x,Ii.y,Ii.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)Ii.x=this.getX(e),Ii.y=this.getY(e),Ii.z=this.getZ(e),Ii.applyNormalMatrix(t),this.setXYZ(e,Ii.x,Ii.y,Ii.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)Ii.x=this.getX(e),Ii.y=this.getY(e),Ii.z=this.getZ(e),Ii.transformDirection(t),this.setXYZ(e,Ii.x,Ii.y,Ii.z);return this}setX(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){return this.data.array[t*this.data.stride+this.offset]}getY(t){return this.data.array[t*this.data.stride+this.offset+1]}getZ(t){return this.data.array[t*this.data.stride+this.offset+2]}getW(t){return this.data.array[t*this.data.stride+this.offset+3]}setXY(t,e,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this}setXYZ(t,e,n,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=r,this}setXYZW(t,e,n,r,o){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=r,this.data.array[t+3]=o,this}clone(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");const e=[];for(let n=0;n<this.count;n++){const r=n*this.data.stride+this.offset;for(let o=0;o<this.itemSize;o++)e.push(this.data.array[r+o])}return new Yn(new this.array.constructor(e),this.itemSize,this.normalized)}return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new sa(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");const e=[];for(let n=0;n<this.count;n++){const r=n*this.data.stride+this.offset;for(let o=0;o<this.itemSize;o++)e.push(this.data.array[r+o])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}sa.prototype.isInterleavedBufferAttribute=!0;class od extends Ci{constructor(t){super(),this.type="SpriteMaterial",this.color=new fn(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this}}let Ts;od.prototype.isSpriteMaterial=!0;const aa=new U,Es=new U,Ss=new U,ws=new R,la=new R,sd=new tn,fl=new U,ha=new U,ml=new U,ad=new R,Vh=new R,ld=new R;class x0 extends Un{constructor(t){if(super(),this.type="Sprite",Ts===void 0){Ts=new Wn;const e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),n=new oa(e,5);Ts.setIndex([0,1,2,0,2,3]),Ts.setAttribute("position",new sa(n,3,0,!1)),Ts.setAttribute("uv",new sa(n,2,3,!1))}this.geometry=Ts,this.material=t!==void 0?t:new od,this.center=new R(.5,.5)}raycast(t,e){t.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Es.setFromMatrixScale(this.matrixWorld),sd.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),Ss.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Es.multiplyScalar(-Ss.z);const n=this.material.rotation;let r,o;n!==0&&(o=Math.cos(n),r=Math.sin(n));const s=this.center;gl(fl.set(-.5,-.5,0),Ss,s,Es,r,o),gl(ha.set(.5,-.5,0),Ss,s,Es,r,o),gl(ml.set(.5,.5,0),Ss,s,Es,r,o),ad.set(0,0),Vh.set(1,0),ld.set(1,1);let a=t.ray.intersectTriangle(fl,ha,ml,!1,aa);if(a===null&&(gl(ha.set(-.5,.5,0),Ss,s,Es,r,o),Vh.set(0,1),a=t.ray.intersectTriangle(fl,ml,ha,!1,aa),a===null))return;const h=t.ray.origin.distanceTo(aa);h<t.near||h>t.far||e.push({distance:h,point:aa.clone(),uv:ui.getUV(aa,fl,ha,ml,ad,Vh,ld,new R),face:null,object:this})}copy(t){return super.copy(t),t.center!==void 0&&this.center.copy(t.center),this.material=t.material,this}}function gl(i,t,e,n,r,o){ws.subVectors(i,e).addScalar(.5).multiply(n),r!==void 0?(la.x=o*ws.x-r*ws.y,la.y=r*ws.x+o*ws.y):la.copy(ws),i.copy(t),i.x+=la.x,i.y+=la.y,i.applyMatrix4(sd)}x0.prototype.isSprite=!0;const hd=new U,ud=new Ot,cd=new Ot,b0=new U,dd=new tn;class pd extends Tt{constructor(t,e){super(t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new tn,this.bindMatrixInverse=new tn}copy(t){return super.copy(t),this.bindMode=t.bindMode,this.bindMatrix.copy(t.bindMatrix),this.bindMatrixInverse.copy(t.bindMatrixInverse),this.skeleton=t.skeleton,this}bind(t,e){this.skeleton=t,e===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.copy(e).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const t=new Ot,e=this.geometry.attributes.skinWeight;for(let n=0,r=e.count;n<r;n++){t.x=e.getX(n),t.y=e.getY(n),t.z=e.getZ(n),t.w=e.getW(n);const o=1/t.manhattanLength();o!==1/0?t.multiplyScalar(o):t.set(1,0,0,0),e.setXYZW(n,t.x,t.y,t.z,t.w)}}updateMatrixWorld(t){super.updateMatrixWorld(t),this.bindMode==="attached"?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode==="detached"?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(t,e){const n=this.skeleton,r=this.geometry;ud.fromBufferAttribute(r.attributes.skinIndex,t),cd.fromBufferAttribute(r.attributes.skinWeight,t),hd.fromBufferAttribute(r.attributes.position,t).applyMatrix4(this.bindMatrix),e.set(0,0,0);for(let o=0;o<4;o++){const s=cd.getComponent(o);if(s!==0){const a=ud.getComponent(o);dd.multiplyMatrices(n.bones[a].matrixWorld,n.boneInverses[a]),e.addScaledVector(b0.copy(hd).applyMatrix4(dd),s)}}return e.applyMatrix4(this.bindMatrixInverse)}}pd.prototype.isSkinnedMesh=!0;class T0 extends Un{constructor(){super(),this.type="Bone"}}T0.prototype.isBone=!0;class fd extends tt{constructor(t=null,e=1,n=1,r,o,s,a,h,l=1003,u=1003,p,y){super(null,s,a,h,l,u,r,o,p,y),this.image={data:t,width:e,height:n},this.magFilter=l,this.minFilter=u,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}fd.prototype.isDataTexture=!0;const md=new tn,gd=new tn,vl=[],ua=new Tt;class E0 extends Tt{constructor(t,e,n){super(t,e),this.instanceMatrix=new Yn(new Float32Array(16*n),16),this.instanceColor=null,this.count=n,this.frustumCulled=!1}copy(t){return super.copy(t),this.instanceMatrix.copy(t.instanceMatrix),t.instanceColor!==null&&(this.instanceColor=t.instanceColor.clone()),this.count=t.count,this}getColorAt(t,e){e.fromArray(this.instanceColor.array,3*t)}getMatrixAt(t,e){e.fromArray(this.instanceMatrix.array,16*t)}raycast(t,e){const n=this.matrixWorld,r=this.count;if(ua.geometry=this.geometry,ua.material=this.material,ua.material!==void 0)for(let o=0;o<r;o++){this.getMatrixAt(o,md),gd.multiplyMatrices(n,md),ua.matrixWorld=gd,ua.raycast(t,vl);for(let s=0,a=vl.length;s<a;s++){const h=vl[s];h.instanceId=o,h.object=this,e.push(h)}vl.length=0}}setColorAt(t,e){this.instanceColor===null&&(this.instanceColor=new Yn(new Float32Array(3*this.count),3)),e.toArray(this.instanceColor.array,3*t)}setMatrixAt(t,e){e.toArray(this.instanceMatrix.array,16*t)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}E0.prototype.isInstancedMesh=!0;class ca extends Ci{constructor(t){super(),this.type="LineBasicMaterial",this.color=new fn(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.morphTargets=!1,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.morphTargets=t.morphTargets,this}}ca.prototype.isLineBasicMaterial=!0;const vd=new U,_d=new U,yd=new tn,Wh=new pi,_l=new Ge;class Xh extends Un{constructor(t=new Wn,e=new ca){super(),this.type="Line",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t){return super.copy(t),this.material=t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(t.isBufferGeometry)if(t.index===null){const e=t.attributes.position,n=[0];for(let r=1,o=e.count;r<o;r++)vd.fromBufferAttribute(e,r-1),_d.fromBufferAttribute(e,r),n[r]=n[r-1],n[r]+=vd.distanceTo(_d);t.setAttribute("lineDistance",new An(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else t.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}raycast(t,e){const n=this.geometry,r=this.matrixWorld,o=t.params.Line.threshold,s=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),_l.copy(n.boundingSphere),_l.applyMatrix4(r),_l.radius+=o,t.ray.intersectsSphere(_l)===!1)return;yd.copy(r).invert(),Wh.copy(t.ray).applyMatrix4(yd);const a=o/((this.scale.x+this.scale.y+this.scale.z)/3),h=a*a,l=new U,u=new U,p=new U,y=new U,x=this.isLineSegments?2:1;if(n.isBufferGeometry){const E=n.index,A=n.attributes.position;if(E!==null)for(let C=Math.max(0,s.start),j=Math.min(E.count,s.start+s.count)-1;C<j;C+=x){const Q=E.getX(C),rt=E.getX(C+1);if(l.fromBufferAttribute(A,Q),u.fromBufferAttribute(A,rt),Wh.distanceSqToSegment(l,u,y,p)>h)continue;y.applyMatrix4(this.matrixWorld);const pt=t.ray.origin.distanceTo(y);pt<t.near||pt>t.far||e.push({distance:pt,point:p.clone().applyMatrix4(this.matrixWorld),index:C,face:null,faceIndex:null,object:this})}else for(let C=Math.max(0,s.start),j=Math.min(A.count,s.start+s.count)-1;C<j;C+=x){if(l.fromBufferAttribute(A,C),u.fromBufferAttribute(A,C+1),Wh.distanceSqToSegment(l,u,y,p)>h)continue;y.applyMatrix4(this.matrixWorld);const Q=t.ray.origin.distanceTo(y);Q<t.near||Q>t.far||e.push({distance:Q,point:p.clone().applyMatrix4(this.matrixWorld),index:C,face:null,faceIndex:null,object:this})}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,n=Object.keys(e);if(n.length>0){const r=e[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=r.length;o<s;o++){const a=r[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=o}}}}else{const e=t.morphTargets;e!==void 0&&e.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}Xh.prototype.isLine=!0;const xd=new U,bd=new U;class Yh extends Xh{constructor(t,e){super(t,e),this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(t.isBufferGeometry)if(t.index===null){const e=t.attributes.position,n=[];for(let r=0,o=e.count;r<o;r+=2)xd.fromBufferAttribute(e,r),bd.fromBufferAttribute(e,r+1),n[r]=r===0?0:n[r-1],n[r+1]=n[r]+xd.distanceTo(bd);t.setAttribute("lineDistance",new An(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else t.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}}Yh.prototype.isLineSegments=!0;class S0 extends Xh{constructor(t,e){super(t,e),this.type="LineLoop"}}S0.prototype.isLineLoop=!0;class Td extends Ci{constructor(t){super(),this.type="PointsMaterial",this.color=new fn(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.morphTargets=t.morphTargets,this}}Td.prototype.isPointsMaterial=!0;const Ed=new tn,qh=new pi,yl=new Ge,xl=new U;class w0 extends Un{constructor(t=new Wn,e=new Td){super(),this.type="Points",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t){return super.copy(t),this.material=t.material,this.geometry=t.geometry,this}raycast(t,e){const n=this.geometry,r=this.matrixWorld,o=t.params.Points.threshold,s=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),yl.copy(n.boundingSphere),yl.applyMatrix4(r),yl.radius+=o,t.ray.intersectsSphere(yl)===!1)return;Ed.copy(r).invert(),qh.copy(t.ray).applyMatrix4(Ed);const a=o/((this.scale.x+this.scale.y+this.scale.z)/3),h=a*a;if(n.isBufferGeometry){const l=n.index,u=n.attributes.position;if(l!==null)for(let p=Math.max(0,s.start),y=Math.min(l.count,s.start+s.count);p<y;p++){const x=l.getX(p);xl.fromBufferAttribute(u,x),Sd(xl,x,h,r,t,e,this)}else for(let p=Math.max(0,s.start),y=Math.min(u.count,s.start+s.count);p<y;p++)xl.fromBufferAttribute(u,p),Sd(xl,p,h,r,t,e,this)}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,n=Object.keys(e);if(n.length>0){const r=e[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=r.length;o<s;o++){const a=r[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=o}}}}else{const e=t.morphTargets;e!==void 0&&e.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function Sd(i,t,e,n,r,o,s){const a=qh.distanceSqToPoint(i);if(a<e){const h=new U;qh.closestPointToPoint(i,h),h.applyMatrix4(n);const l=r.ray.origin.distanceTo(h);if(l<r.near||l>r.far)return;o.push({distance:l,distanceToRay:Math.sqrt(a),point:h,index:t,face:null,object:s})}}w0.prototype.isPoints=!0,class extends tt{constructor(i,t,e,n,r,o,s,a,h){super(i,t,e,n,r,o,s,a,h),this.format=s!==void 0?s:1022,this.minFilter=o!==void 0?o:1006,this.magFilter=r!==void 0?r:1006,this.generateMipmaps=!1;const l=this;"requestVideoFrameCallback"in i&&i.requestVideoFrameCallback(function u(){l.needsUpdate=!0,i.requestVideoFrameCallback(u)})}clone(){return new this.constructor(this.image).copy(this)}update(){const i=this.image;!("requestVideoFrameCallback"in i)&&i.readyState>=i.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}.prototype.isVideoTexture=!0;class A0 extends tt{constructor(t,e,n,r,o,s,a,h,l,u,p,y){super(null,s,a,h,l,u,r,o,p,y),this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}A0.prototype.isCompressedTexture=!0,class extends tt{constructor(i,t,e,n,r,o,s,a,h){super(i,t,e,n,r,o,s,a,h),this.needsUpdate=!0}}.prototype.isCanvasTexture=!0,class extends tt{constructor(i,t,e,n,r,o,s,a,h,l){if((l=l!==void 0?l:1026)!==1026&&l!==1027)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");e===void 0&&l===1026&&(e=1012),e===void 0&&l===1027&&(e=1020),super(null,n,r,o,s,a,l,e,h),this.image={width:i,height:t},this.magFilter=s!==void 0?s:1003,this.minFilter=a!==void 0?a:1003,this.flipY=!1,this.generateMipmaps=!1}}.prototype.isDepthTexture=!0,new U,new U,new U,new ui;class Ir{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const n=this.getUtoTmapping(t);return this.getPoint(n,e)}getPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return e}getSpacedPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let n,r=this.getPoint(0),o=0;e.push(0);for(let s=1;s<=t;s++)n=this.getPoint(s/t),o+=n.distanceTo(r),e.push(o),r=n;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const n=this.getLengths();let r=0;const o=n.length;let s;s=e||t*n[o-1];let a,h=0,l=o-1;for(;h<=l;)if(r=Math.floor(h+(l-h)/2),a=n[r]-s,a<0)h=r+1;else{if(!(a>0)){l=r;break}l=r-1}if(r=l,n[r]===s)return r/(o-1);const u=n[r];return(r+(s-u)/(n[r+1]-u))/(o-1)}getTangent(t,e){let n=t-1e-4,r=t+1e-4;n<0&&(n=0),r>1&&(r=1);const o=this.getPoint(n),s=this.getPoint(r),a=e||(o.isVector2?new R:new U);return a.copy(s).sub(o).normalize(),a}getTangentAt(t,e){const n=this.getUtoTmapping(t);return this.getTangent(n,e)}computeFrenetFrames(t,e){const n=new U,r=[],o=[],s=[],a=new U,h=new tn;for(let x=0;x<=t;x++){const E=x/t;r[x]=this.getTangentAt(E,new U),r[x].normalize()}o[0]=new U,s[0]=new U;let l=Number.MAX_VALUE;const u=Math.abs(r[0].x),p=Math.abs(r[0].y),y=Math.abs(r[0].z);u<=l&&(l=u,n.set(1,0,0)),p<=l&&(l=p,n.set(0,1,0)),y<=l&&n.set(0,0,1),a.crossVectors(r[0],n).normalize(),o[0].crossVectors(r[0],a),s[0].crossVectors(r[0],o[0]);for(let x=1;x<=t;x++){if(o[x]=o[x-1].clone(),s[x]=s[x-1].clone(),a.crossVectors(r[x-1],r[x]),a.length()>Number.EPSILON){a.normalize();const E=Math.acos(et(r[x-1].dot(r[x]),-1,1));o[x].applyMatrix4(h.makeRotationAxis(a,E))}s[x].crossVectors(r[x],o[x])}if(e===!0){let x=Math.acos(et(o[0].dot(o[t]),-1,1));x/=t,r[0].dot(a.crossVectors(o[0],o[t]))>0&&(x=-x);for(let E=1;E<=t;E++)o[E].applyMatrix4(h.makeRotationAxis(r[E],x*E)),s[E].crossVectors(r[E],o[E])}return{tangents:r,normals:o,binormals:s}}clone(){return new this.constructor().copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class bl extends Ir{constructor(t=0,e=0,n=1,r=1,o=0,s=2*Math.PI,a=!1,h=0){super(),this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=n,this.yRadius=r,this.aStartAngle=o,this.aEndAngle=s,this.aClockwise=a,this.aRotation=h}getPoint(t,e){const n=e||new R,r=2*Math.PI;let o=this.aEndAngle-this.aStartAngle;const s=Math.abs(o)<Number.EPSILON;for(;o<0;)o+=r;for(;o>r;)o-=r;o<Number.EPSILON&&(o=s?0:r),this.aClockwise!==!0||s||(o===r?o=-r:o-=r);const a=this.aStartAngle+t*o;let h=this.aX+this.xRadius*Math.cos(a),l=this.aY+this.yRadius*Math.sin(a);if(this.aRotation!==0){const u=Math.cos(this.aRotation),p=Math.sin(this.aRotation),y=h-this.aX,x=l-this.aY;h=y*u-x*p+this.aX,l=y*p+x*u+this.aY}return n.set(h,l)}copy(t){return super.copy(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}toJSON(){const t=super.toJSON();return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t}fromJSON(t){return super.fromJSON(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}}bl.prototype.isEllipseCurve=!0;class wd extends bl{constructor(t,e,n,r,o,s){super(t,e,n,n,r,o,s),this.type="ArcCurve"}}function Jh(){let i=0,t=0,e=0,n=0;function r(o,s,a,h){i=o,t=a,e=-3*o+3*s-2*a-h,n=2*o-2*s+a+h}return{initCatmullRom:function(o,s,a,h,l){r(s,a,l*(a-o),l*(h-s))},initNonuniformCatmullRom:function(o,s,a,h,l,u,p){let y=(s-o)/l-(a-o)/(l+u)+(a-s)/u,x=(a-s)/u-(h-s)/(u+p)+(h-a)/p;y*=u,x*=u,r(s,a,y,x)},calc:function(o){const s=o*o;return i+t*o+e*s+n*(s*o)}}}wd.prototype.isArcCurve=!0;const Tl=new U,Kh=new Jh,Zh=new Jh,Qh=new Jh;class Ad extends Ir{constructor(t=[],e=!1,n="centripetal",r=.5){super(),this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=n,this.tension=r}getPoint(t,e=new U){const n=e,r=this.points,o=r.length,s=(o-(this.closed?0:1))*t;let a,h,l=Math.floor(s),u=s-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/o)+1)*o:u===0&&l===o-1&&(l=o-2,u=1),this.closed||l>0?a=r[(l-1)%o]:(Tl.subVectors(r[0],r[1]).add(r[0]),a=Tl);const p=r[l%o],y=r[(l+1)%o];if(this.closed||l+2<o?h=r[(l+2)%o]:(Tl.subVectors(r[o-1],r[o-2]).add(r[o-1]),h=Tl),this.curveType==="centripetal"||this.curveType==="chordal"){const x=this.curveType==="chordal"?.5:.25;let E=Math.pow(a.distanceToSquared(p),x),A=Math.pow(p.distanceToSquared(y),x),C=Math.pow(y.distanceToSquared(h),x);A<1e-4&&(A=1),E<1e-4&&(E=A),C<1e-4&&(C=A),Kh.initNonuniformCatmullRom(a.x,p.x,y.x,h.x,E,A,C),Zh.initNonuniformCatmullRom(a.y,p.y,y.y,h.y,E,A,C),Qh.initNonuniformCatmullRom(a.z,p.z,y.z,h.z,E,A,C)}else this.curveType==="catmullrom"&&(Kh.initCatmullRom(a.x,p.x,y.x,h.x,this.tension),Zh.initCatmullRom(a.y,p.y,y.y,h.y,this.tension),Qh.initCatmullRom(a.z,p.z,y.z,h.z,this.tension));return n.set(Kh.calc(u),Zh.calc(u),Qh.calc(u)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const r=t.points[e];this.points.push(r.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,n=this.points.length;e<n;e++){const r=this.points[e];t.points.push(r.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const r=t.points[e];this.points.push(new U().fromArray(r))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}}function Md(i,t,e,n,r){const o=.5*(n-t),s=.5*(r-e),a=i*i;return(2*e-2*n+o+s)*(i*a)+(-3*e+3*n-2*o-s)*a+o*i+e}function da(i,t,e,n){return function(r,o){const s=1-r;return s*s*o}(i,t)+function(r,o){return 2*(1-r)*r*o}(i,e)+function(r,o){return r*r*o}(i,n)}function pa(i,t,e,n,r){return function(o,s){const a=1-o;return a*a*a*s}(i,t)+function(o,s){const a=1-o;return 3*a*a*o*s}(i,e)+function(o,s){return 3*(1-o)*o*o*s}(i,n)+function(o,s){return o*o*o*s}(i,r)}Ad.prototype.isCatmullRomCurve3=!0;class $h extends Ir{constructor(t=new R,e=new R,n=new R,r=new R){super(),this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=n,this.v3=r}getPoint(t,e=new R){const n=e,r=this.v0,o=this.v1,s=this.v2,a=this.v3;return n.set(pa(t,r.x,o.x,s.x,a.x),pa(t,r.y,o.y,s.y,a.y)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}$h.prototype.isCubicBezierCurve=!0;class Cd extends Ir{constructor(t=new U,e=new U,n=new U,r=new U){super(),this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=n,this.v3=r}getPoint(t,e=new U){const n=e,r=this.v0,o=this.v1,s=this.v2,a=this.v3;return n.set(pa(t,r.x,o.x,s.x,a.x),pa(t,r.y,o.y,s.y,a.y),pa(t,r.z,o.z,s.z,a.z)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}Cd.prototype.isCubicBezierCurve3=!0;class El extends Ir{constructor(t=new R,e=new R){super(),this.type="LineCurve",this.v1=t,this.v2=e}getPoint(t,e=new R){const n=e;return t===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e){const n=e||new R;return n.copy(this.v2).sub(this.v1).normalize(),n}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}El.prototype.isLineCurve=!0;class tu extends Ir{constructor(t=new R,e=new R,n=new R){super(),this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=n}getPoint(t,e=new R){const n=e,r=this.v0,o=this.v1,s=this.v2;return n.set(da(t,r.x,o.x,s.x),da(t,r.y,o.y,s.y)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}tu.prototype.isQuadraticBezierCurve=!0;class Rd extends Ir{constructor(t=new U,e=new U,n=new U){super(),this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=n}getPoint(t,e=new U){const n=e,r=this.v0,o=this.v1,s=this.v2;return n.set(da(t,r.x,o.x,s.x),da(t,r.y,o.y,s.y),da(t,r.z,o.z,s.z)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}Rd.prototype.isQuadraticBezierCurve3=!0;class eu extends Ir{constructor(t=[]){super(),this.type="SplineCurve",this.points=t}getPoint(t,e=new R){const n=e,r=this.points,o=(r.length-1)*t,s=Math.floor(o),a=o-s,h=r[s===0?s:s-1],l=r[s],u=r[s>r.length-2?r.length-1:s+1],p=r[s>r.length-3?r.length-1:s+2];return n.set(Md(a,h.x,l.x,u.x,p.x),Md(a,h.y,l.y,u.y,p.y)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const r=t.points[e];this.points.push(r.clone())}return this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,n=this.points.length;e<n;e++){const r=this.points[e];t.points.push(r.toArray())}return t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const r=t.points[e];this.points.push(new R().fromArray(r))}return this}}eu.prototype.isSplineCurve=!0;var Id=Object.freeze({__proto__:null,ArcCurve:wd,CatmullRomCurve3:Ad,CubicBezierCurve:$h,CubicBezierCurve3:Cd,EllipseCurve:bl,LineCurve:El,LineCurve3:class extends Ir{constructor(i=new U,t=new U){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=i,this.v2=t}getPoint(i,t=new U){const e=t;return i===1?e.copy(this.v2):(e.copy(this.v2).sub(this.v1),e.multiplyScalar(i).add(this.v1)),e}getPointAt(i,t){return this.getPoint(i,t)}copy(i){return super.copy(i),this.v1.copy(i.v1),this.v2.copy(i.v2),this}toJSON(){const i=super.toJSON();return i.v1=this.v1.toArray(),i.v2=this.v2.toArray(),i}fromJSON(i){return super.fromJSON(i),this.v1.fromArray(i.v1),this.v2.fromArray(i.v2),this}},QuadraticBezierCurve:tu,QuadraticBezierCurve3:Rd,SplineCurve:eu});const M0=function(i,t,e=2){const n=t&&t.length,r=n?t[0]*e:i.length;let o=Pd(i,0,r,e,!0);const s=[];if(!o||o.next===o.prev)return s;let a,h,l,u,p,y,x;if(n&&(o=function(E,A,C,j){const Q=[];let rt,pt,it,gt,ht;for(rt=0,pt=A.length;rt<pt;rt++)it=A[rt]*j,gt=rt<pt-1?A[rt+1]*j:E.length,ht=Pd(E,it,gt,j,!1),ht===ht.next&&(ht.steiner=!0),Q.push(D0(ht));for(Q.sort(O0),rt=0;rt<Q.length;rt++)N0(Q[rt],C),C=Ro(C,C.next);return C}(i,t,o,e)),i.length>80*e){a=l=i[0],h=u=i[1];for(let E=e;E<r;E+=e)p=i[E],y=i[E+1],p<a&&(a=p),y<h&&(h=y),p>l&&(l=p),y>u&&(u=y);x=Math.max(l-a,u-h),x=x!==0?1/x:0}return fa(o,s,e,a,h,x),s};function Pd(i,t,e,n,r){let o,s;if(r===function(a,h,l,u){let p=0;for(let y=h,x=l-u;y<l;y+=u)p+=(a[x]-a[y])*(a[y+1]+a[x+1]),x=y;return p}(i,t,e,n)>0)for(o=t;o<e;o+=n)s=Ld(o,i[o],i[o+1],s);else for(o=e-n;o>=t;o-=n)s=Ld(o,i[o],i[o+1],s);return s&&Sl(s,s.next)&&(ga(s),s=s.next),s}function Ro(i,t){if(!i)return i;t||(t=i);let e,n=i;do if(e=!1,n.steiner||!Sl(n,n.next)&&_i(n.prev,n,n.next)!==0)n=n.next;else{if(ga(n),n=t=n.prev,n===n.next)break;e=!0}while(e||n!==t);return t}function fa(i,t,e,n,r,o,s){if(!i)return;!s&&o&&function(u,p,y,x){let E=u;do E.z===null&&(E.z=nu(E.x,E.y,p,y,x)),E.prevZ=E.prev,E.nextZ=E.next,E=E.next;while(E!==u);E.prevZ.nextZ=null,E.prevZ=null,function(A){let C,j,Q,rt,pt,it,gt,ht,mt=1;do{for(j=A,A=null,pt=null,it=0;j;){for(it++,Q=j,gt=0,C=0;C<mt&&(gt++,Q=Q.nextZ,Q);C++);for(ht=mt;gt>0||ht>0&&Q;)gt!==0&&(ht===0||!Q||j.z<=Q.z)?(rt=j,j=j.nextZ,gt--):(rt=Q,Q=Q.nextZ,ht--),pt?pt.nextZ=rt:A=rt,rt.prevZ=pt,pt=rt;j=Q}pt.nextZ=null,mt*=2}while(it>1)}(E)}(i,n,r,o);let a,h,l=i;for(;i.prev!==i.next;)if(a=i.prev,h=i.next,o?R0(i,n,r,o):C0(i))t.push(a.i/e),t.push(i.i/e),t.push(h.i/e),ga(i),i=h.next,l=h.next;else if((i=h)===l){s?s===1?fa(i=I0(Ro(i),t,e),t,e,n,r,o,2):s===2&&P0(i,t,e,n,r,o):fa(Ro(i),t,e,n,r,o,1);break}}function C0(i){const t=i.prev,e=i,n=i.next;if(_i(t,e,n)>=0)return!1;let r=i.next.next;for(;r!==i.prev;){if(As(t.x,t.y,e.x,e.y,n.x,n.y,r.x,r.y)&&_i(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function R0(i,t,e,n){const r=i.prev,o=i,s=i.next;if(_i(r,o,s)>=0)return!1;const a=r.x<o.x?r.x<s.x?r.x:s.x:o.x<s.x?o.x:s.x,h=r.y<o.y?r.y<s.y?r.y:s.y:o.y<s.y?o.y:s.y,l=r.x>o.x?r.x>s.x?r.x:s.x:o.x>s.x?o.x:s.x,u=r.y>o.y?r.y>s.y?r.y:s.y:o.y>s.y?o.y:s.y,p=nu(a,h,t,e,n),y=nu(l,u,t,e,n);let x=i.prevZ,E=i.nextZ;for(;x&&x.z>=p&&E&&E.z<=y;){if(x!==i.prev&&x!==i.next&&As(r.x,r.y,o.x,o.y,s.x,s.y,x.x,x.y)&&_i(x.prev,x,x.next)>=0||(x=x.prevZ,E!==i.prev&&E!==i.next&&As(r.x,r.y,o.x,o.y,s.x,s.y,E.x,E.y)&&_i(E.prev,E,E.next)>=0))return!1;E=E.nextZ}for(;x&&x.z>=p;){if(x!==i.prev&&x!==i.next&&As(r.x,r.y,o.x,o.y,s.x,s.y,x.x,x.y)&&_i(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;E&&E.z<=y;){if(E!==i.prev&&E!==i.next&&As(r.x,r.y,o.x,o.y,s.x,s.y,E.x,E.y)&&_i(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function I0(i,t,e){let n=i;do{const r=n.prev,o=n.next.next;!Sl(r,o)&&Od(r,n,n.next,o)&&ma(r,o)&&ma(o,r)&&(t.push(r.i/e),t.push(n.i/e),t.push(o.i/e),ga(n),ga(n.next),n=i=o),n=n.next}while(n!==i);return Ro(n)}function P0(i,t,e,n,r,o){let s=i;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&F0(s,a)){let h=Nd(s,a);return s=Ro(s,s.next),h=Ro(h,h.next),fa(s,t,e,n,r,o),void fa(h,t,e,n,r,o)}a=a.next}s=s.next}while(s!==i)}function O0(i,t){return i.x-t.x}function N0(i,t){if(t=function(e,n){let r=n;const o=e.x,s=e.y;let a,h=-1/0;do{if(s<=r.y&&s>=r.next.y&&r.next.y!==r.y){const E=r.x+(s-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(E<=o&&E>h){if(h=E,E===o){if(s===r.y)return r;if(s===r.next.y)return r.next}a=r.x<r.next.x?r:r.next}}r=r.next}while(r!==n);if(!a)return null;if(o===h)return a;const l=a,u=a.x,p=a.y;let y,x=1/0;r=a;do o>=r.x&&r.x>=u&&o!==r.x&&As(s<p?o:h,s,u,p,s<p?h:o,s,r.x,r.y)&&(y=Math.abs(s-r.y)/(o-r.x),ma(r,e)&&(y<x||y===x&&(r.x>a.x||r.x===a.x&&L0(a,r)))&&(a=r,x=y)),r=r.next;while(r!==l);return a}(i,t)){const e=Nd(t,i);Ro(t,t.next),Ro(e,e.next)}}function L0(i,t){return _i(i.prev,i,t.prev)<0&&_i(t.next,i,i.next)<0}function nu(i,t,e,n,r){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=32767*(i-e)*r)|i<<8))|i<<4))|i<<2))|i<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function D0(i){let t=i,e=i;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==i);return e}function As(i,t,e,n,r,o,s,a){return(r-s)*(t-a)-(i-s)*(o-a)>=0&&(i-s)*(n-a)-(e-s)*(t-a)>=0&&(e-s)*(o-a)-(r-s)*(n-a)>=0}function F0(i,t){return i.next.i!==t.i&&i.prev.i!==t.i&&!function(e,n){let r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==n.i&&r.next.i!==n.i&&Od(r,r.next,e,n))return!0;r=r.next}while(r!==e);return!1}(i,t)&&(ma(i,t)&&ma(t,i)&&function(e,n){let r=e,o=!1;const s=(e.x+n.x)/2,a=(e.y+n.y)/2;do r.y>a!=r.next.y>a&&r.next.y!==r.y&&s<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(o=!o),r=r.next;while(r!==e);return o}(i,t)&&(_i(i.prev,i,t.prev)||_i(i,t.prev,t))||Sl(i,t)&&_i(i.prev,i,i.next)>0&&_i(t.prev,t,t.next)>0)}function _i(i,t,e){return(t.y-i.y)*(e.x-t.x)-(t.x-i.x)*(e.y-t.y)}function Sl(i,t){return i.x===t.x&&i.y===t.y}function Od(i,t,e,n){const r=Al(_i(i,t,e)),o=Al(_i(i,t,n)),s=Al(_i(e,n,i)),a=Al(_i(e,n,t));return r!==o&&s!==a||!(r!==0||!wl(i,e,t))||!(o!==0||!wl(i,n,t))||!(s!==0||!wl(e,i,n))||!(a!==0||!wl(e,t,n))}function wl(i,t,e){return t.x<=Math.max(i.x,e.x)&&t.x>=Math.min(i.x,e.x)&&t.y<=Math.max(i.y,e.y)&&t.y>=Math.min(i.y,e.y)}function Al(i){return i>0?1:i<0?-1:0}function ma(i,t){return _i(i.prev,i,i.next)<0?_i(i,t,i.next)>=0&&_i(i,i.prev,t)>=0:_i(i,t,i.prev)<0||_i(i,i.next,t)<0}function Nd(i,t){const e=new iu(i.i,i.x,i.y),n=new iu(t.i,t.x,t.y),r=i.next,o=t.prev;return i.next=t,t.prev=i,e.next=r,r.prev=e,n.next=e,e.prev=n,o.next=n,n.prev=o,n}function Ld(i,t,e,n){const r=new iu(i,t,e);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function ga(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function iu(i,t,e){this.i=i,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}class Io{static area(t){const e=t.length;let n=0;for(let r=e-1,o=0;o<e;r=o++)n+=t[r].x*t[o].y-t[o].x*t[r].y;return .5*n}static isClockWise(t){return Io.area(t)<0}static triangulateShape(t,e){const n=[],r=[],o=[];Dd(t),Fd(n,t);let s=t.length;e.forEach(Dd);for(let h=0;h<e.length;h++)r.push(s),s+=e[h].length,Fd(n,e[h]);const a=M0(n,r);for(let h=0;h<a.length;h+=3)o.push(a.slice(h,h+3));return o}}function Dd(i){const t=i.length;t>2&&i[t-1].equals(i[0])&&i.pop()}function Fd(i,t){for(let e=0;e<t.length;e++)i.push(t[e].x),i.push(t[e].y)}class Ms extends Wn{constructor(t,e){super(),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];const n=this,r=[],o=[];for(let a=0,h=t.length;a<h;a++)s(t[a]);function s(a){const h=[],l=e.curveSegments!==void 0?e.curveSegments:12,u=e.steps!==void 0?e.steps:1;let p=e.depth!==void 0?e.depth:100,y=e.bevelEnabled===void 0||e.bevelEnabled,x=e.bevelThickness!==void 0?e.bevelThickness:6,E=e.bevelSize!==void 0?e.bevelSize:x-2,A=e.bevelOffset!==void 0?e.bevelOffset:0,C=e.bevelSegments!==void 0?e.bevelSegments:3;const j=e.extrudePath,Q=e.UVGenerator!==void 0?e.UVGenerator:B0;e.amount!==void 0&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),p=e.amount);let rt,pt,it,gt,ht,mt=!1;j&&(rt=j.getSpacedPoints(u),mt=!0,y=!1,pt=j.computeFrenetFrames(u,!1),it=new U,gt=new U,ht=new U),y||(C=0,x=0,E=0,A=0);const jt=a.extractPoints(l);let Ft=jt.shape;const Mt=jt.holes;if(!Io.isClockWise(Ft)){Ft=Ft.reverse();for(let ue=0,bt=Mt.length;ue<bt;ue++){const Ht=Mt[ue];Io.isClockWise(Ht)&&(Mt[ue]=Ht.reverse())}}const wt=Io.triangulateShape(Ft,Mt),Pt=Ft;for(let ue=0,bt=Mt.length;ue<bt;ue++){const Ht=Mt[ue];Ft=Ft.concat(Ht)}function Nt(ue,bt,Ht){return bt||console.error("THREE.ExtrudeGeometry: vec does not exist"),bt.clone().multiplyScalar(Ht).add(ue)}const ne=Ft.length,$t=wt.length;function Vt(ue,bt,Ht){let ie,ae,qt;const ye=ue.x-bt.x,nn=ue.y-bt.y,on=Ht.x-ue.x,rn=Ht.y-ue.y,Sn=ye*ye+nn*nn,Ai=ye*rn-nn*on;if(Math.abs(Ai)>Number.EPSILON){const Jn=Math.sqrt(Sn),dr=Math.sqrt(on*on+rn*rn),za=bt.x-nn/Jn,Va=bt.y+ye/Jn,Wa=((Ht.x-rn/dr-za)*rn-(Ht.y+on/dr-Va)*on)/(ye*rn-nn*on);ie=za+ye*Wa-ue.x,ae=Va+nn*Wa-ue.y;const hr=ie*ie+ae*ae;if(hr<=2)return new R(ie,ae);qt=Math.sqrt(hr/2)}else{let Jn=!1;ye>Number.EPSILON?on>Number.EPSILON&&(Jn=!0):ye<-Number.EPSILON?on<-Number.EPSILON&&(Jn=!0):Math.sign(nn)===Math.sign(rn)&&(Jn=!0),Jn?(ie=-nn,ae=ye,qt=Math.sqrt(Sn)):(ie=ye,ae=nn,qt=Math.sqrt(Sn/2))}return new R(ie/qt,ae/qt)}const Yt=[];for(let ue=0,bt=Pt.length,Ht=bt-1,ie=ue+1;ue<bt;ue++,Ht++,ie++)Ht===bt&&(Ht=0),ie===bt&&(ie=0),Yt[ue]=Vt(Pt[ue],Pt[Ht],Pt[ie]);const ge=[];let be,Pe=Yt.concat();for(let ue=0,bt=Mt.length;ue<bt;ue++){const Ht=Mt[ue];be=[];for(let ie=0,ae=Ht.length,qt=ae-1,ye=ie+1;ie<ae;ie++,qt++,ye++)qt===ae&&(qt=0),ye===ae&&(ye=0),be[ie]=Vt(Ht[ie],Ht[qt],Ht[ye]);ge.push(be),Pe=Pe.concat(be)}for(let ue=0;ue<C;ue++){const bt=ue/C,Ht=x*Math.cos(bt*Math.PI/2),ie=E*Math.sin(bt*Math.PI/2)+A;for(let ae=0,qt=Pt.length;ae<qt;ae++){const ye=Nt(Pt[ae],Yt[ae],ie);ve(ye.x,ye.y,-Ht)}for(let ae=0,qt=Mt.length;ae<qt;ae++){const ye=Mt[ae];be=ge[ae];for(let nn=0,on=ye.length;nn<on;nn++){const rn=Nt(ye[nn],be[nn],ie);ve(rn.x,rn.y,-Ht)}}}const Ct=E+A;for(let ue=0;ue<ne;ue++){const bt=y?Nt(Ft[ue],Pe[ue],Ct):Ft[ue];mt?(gt.copy(pt.normals[0]).multiplyScalar(bt.x),it.copy(pt.binormals[0]).multiplyScalar(bt.y),ht.copy(rt[0]).add(gt).add(it),ve(ht.x,ht.y,ht.z)):ve(bt.x,bt.y,0)}for(let ue=1;ue<=u;ue++)for(let bt=0;bt<ne;bt++){const Ht=y?Nt(Ft[bt],Pe[bt],Ct):Ft[bt];mt?(gt.copy(pt.normals[ue]).multiplyScalar(Ht.x),it.copy(pt.binormals[ue]).multiplyScalar(Ht.y),ht.copy(rt[ue]).add(gt).add(it),ve(ht.x,ht.y,ht.z)):ve(Ht.x,Ht.y,p/u*ue)}for(let ue=C-1;ue>=0;ue--){const bt=ue/C,Ht=x*Math.cos(bt*Math.PI/2),ie=E*Math.sin(bt*Math.PI/2)+A;for(let ae=0,qt=Pt.length;ae<qt;ae++){const ye=Nt(Pt[ae],Yt[ae],ie);ve(ye.x,ye.y,p+Ht)}for(let ae=0,qt=Mt.length;ae<qt;ae++){const ye=Mt[ae];be=ge[ae];for(let nn=0,on=ye.length;nn<on;nn++){const rn=Nt(ye[nn],be[nn],ie);mt?ve(rn.x,rn.y+rt[u-1].y,rt[u-1].x+Ht):ve(rn.x,rn.y,p+Ht)}}}function Bt(ue,bt){let Ht=ue.length;for(;--Ht>=0;){const ie=Ht;let ae=Ht-1;ae<0&&(ae=ue.length-1);for(let qt=0,ye=u+2*C;qt<ye;qt++){const nn=ne*qt,on=ne*(qt+1);se(bt+ie+nn,bt+ae+nn,bt+ae+on,bt+ie+on)}}}function ve(ue,bt,Ht){h.push(ue),h.push(bt),h.push(Ht)}function le(ue,bt,Ht){Ie(ue),Ie(bt),Ie(Ht);const ie=r.length/3,ae=Q.generateTopUV(n,r,ie-3,ie-2,ie-1);Le(ae[0]),Le(ae[1]),Le(ae[2])}function se(ue,bt,Ht,ie){Ie(ue),Ie(bt),Ie(ie),Ie(bt),Ie(Ht),Ie(ie);const ae=r.length/3,qt=Q.generateSideWallUV(n,r,ae-6,ae-3,ae-2,ae-1);Le(qt[0]),Le(qt[1]),Le(qt[3]),Le(qt[1]),Le(qt[2]),Le(qt[3])}function Ie(ue){r.push(h[3*ue+0]),r.push(h[3*ue+1]),r.push(h[3*ue+2])}function Le(ue){o.push(ue.x),o.push(ue.y)}(function(){const ue=r.length/3;if(y){let bt=0,Ht=ne*bt;for(let ie=0;ie<$t;ie++){const ae=wt[ie];le(ae[2]+Ht,ae[1]+Ht,ae[0]+Ht)}bt=u+2*C,Ht=ne*bt;for(let ie=0;ie<$t;ie++){const ae=wt[ie];le(ae[0]+Ht,ae[1]+Ht,ae[2]+Ht)}}else{for(let bt=0;bt<$t;bt++){const Ht=wt[bt];le(Ht[2],Ht[1],Ht[0])}for(let bt=0;bt<$t;bt++){const Ht=wt[bt];le(Ht[0]+ne*u,Ht[1]+ne*u,Ht[2]+ne*u)}}n.addGroup(ue,r.length/3-ue,0)})(),function(){const ue=r.length/3;let bt=0;Bt(Pt,bt),bt+=Pt.length;for(let Ht=0,ie=Mt.length;Ht<ie;Ht++){const ae=Mt[Ht];Bt(ae,bt),bt+=ae.length}n.addGroup(ue,r.length/3-ue,1)}()}this.setAttribute("position",new An(r,3)),this.setAttribute("uv",new An(o,2)),this.computeVertexNormals()}toJSON(){const t=super.toJSON();return function(e,n,r){if(r.shapes=[],Array.isArray(e))for(let o=0,s=e.length;o<s;o++){const a=e[o];r.shapes.push(a.uuid)}else r.shapes.push(e.uuid);return n.extrudePath!==void 0&&(r.options.extrudePath=n.extrudePath.toJSON()),r}(this.parameters.shapes,this.parameters.options,t)}static fromJSON(t,e){const n=[];for(let o=0,s=t.shapes.length;o<s;o++){const a=e[t.shapes[o]];n.push(a)}const r=t.options.extrudePath;return r!==void 0&&(t.options.extrudePath=new Id[r.type]().fromJSON(r)),new Ms(n,t.options)}}const B0={generateTopUV:function(i,t,e,n,r){const o=t[3*e],s=t[3*e+1],a=t[3*n],h=t[3*n+1],l=t[3*r],u=t[3*r+1];return[new R(o,s),new R(a,h),new R(l,u)]},generateSideWallUV:function(i,t,e,n,r,o){const s=t[3*e],a=t[3*e+1],h=t[3*e+2],l=t[3*n],u=t[3*n+1],p=t[3*n+2],y=t[3*r],x=t[3*r+1],E=t[3*r+2],A=t[3*o],C=t[3*o+1],j=t[3*o+2];return Math.abs(a-u)<Math.abs(s-l)?[new R(s,1-h),new R(l,1-p),new R(y,1-E),new R(A,1-j)]:[new R(a,1-h),new R(u,1-p),new R(x,1-E),new R(C,1-j)]}};class ru extends Wn{constructor(t,e=12){super(),this.type="ShapeGeometry",this.parameters={shapes:t,curveSegments:e};const n=[],r=[],o=[],s=[];let a=0,h=0;if(Array.isArray(t)===!1)l(t);else for(let u=0;u<t.length;u++)l(t[u]),this.addGroup(a,h,u),a+=h,h=0;function l(u){const p=r.length/3,y=u.extractPoints(e);let x=y.shape;const E=y.holes;Io.isClockWise(x)===!1&&(x=x.reverse());for(let C=0,j=E.length;C<j;C++){const Q=E[C];Io.isClockWise(Q)===!0&&(E[C]=Q.reverse())}const A=Io.triangulateShape(x,E);for(let C=0,j=E.length;C<j;C++){const Q=E[C];x=x.concat(Q)}for(let C=0,j=x.length;C<j;C++){const Q=x[C];r.push(Q.x,Q.y,0),o.push(0,0,1),s.push(Q.x,Q.y)}for(let C=0,j=A.length;C<j;C++){const Q=A[C],rt=Q[0]+p,pt=Q[1]+p,it=Q[2]+p;n.push(rt,pt,it),h+=3}}this.setIndex(n),this.setAttribute("position",new An(r,3)),this.setAttribute("normal",new An(o,3)),this.setAttribute("uv",new An(s,2))}toJSON(){const t=super.toJSON();return function(e,n){if(n.shapes=[],Array.isArray(e))for(let r=0,o=e.length;r<o;r++){const s=e[r];n.shapes.push(s.uuid)}else n.shapes.push(e.uuid);return n}(this.parameters.shapes,t)}static fromJSON(t,e){const n=[];for(let r=0,o=t.shapes.length;r<o;r++){const s=e[t.shapes[r]];n.push(s)}return new ru(n,t.curveSegments)}}class U0 extends Ci{constructor(t){super(),this.type="ShadowMaterial",this.color=new fn(0),this.transparent=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this}}U0.prototype.isShadowMaterial=!0;class k0 extends hn{constructor(t){super(t),this.type="RawShaderMaterial"}}k0.prototype.isRawShaderMaterial=!0;class Bd extends Ci{constructor(t){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new fn(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new fn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new R(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.vertexTangents=!1,this.setValues(t)}copy(t){return super.copy(t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.flatShading=t.flatShading,this.vertexTangents=t.vertexTangents,this}}Bd.prototype.isMeshStandardMaterial=!0;class G0 extends Bd{constructor(t){super(),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new R(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,Object.defineProperty(this,"ior",{get:function(){return(1+.4*this.reflectivity)/(1-.4*this.reflectivity)},set:function(e){this.reflectivity=et(2.5*(e-1)/(e+1),0,1)}}),this.sheen=null,this.transmission=0,this.transmissionMap=null,this.thickness=.01,this.thicknessMap=null,this.attenuationDistance=0,this.attenuationColor=new fn(1,1,1),this.setValues(t)}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.reflectivity=t.reflectivity,t.sheen?this.sheen=(this.sheen||new fn).copy(t.sheen):this.sheen=null,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this}}G0.prototype.isMeshPhysicalMaterial=!0;class Ud extends Ci{constructor(t){super(),this.type="MeshPhongMaterial",this.color=new fn(16777215),this.specular=new fn(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new fn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new R(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.flatShading=t.flatShading,this}}Ud.prototype.isMeshPhongMaterial=!0;class H0 extends Ci{constructor(t){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new fn(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new fn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new R(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this}}H0.prototype.isMeshToonMaterial=!0;class j0 extends Ci{constructor(t){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new R(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.flatShading=t.flatShading,this}}j0.prototype.isMeshNormalMaterial=!0;class z0 extends Ci{constructor(t){super(),this.type="MeshLambertMaterial",this.color=new fn(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new fn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this}}z0.prototype.isMeshLambertMaterial=!0;class V0 extends Ci{constructor(t){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new fn(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new R(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.flatShading=t.flatShading,this}}V0.prototype.isMeshMatcapMaterial=!0;class W0 extends ca{constructor(t){super(),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}W0.prototype.isLineDashedMaterial=!0;const ci={arraySlice:function(i,t,e){return ci.isTypedArray(i)?new i.constructor(i.subarray(t,e!==void 0?e:i.length)):i.slice(t,e)},convertArray:function(i,t,e){return!i||!e&&i.constructor===t?i:typeof t.BYTES_PER_ELEMENT=="number"?new t(i):Array.prototype.slice.call(i)},isTypedArray:function(i){return ArrayBuffer.isView(i)&&!(i instanceof DataView)},getKeyframeOrder:function(i){const t=i.length,e=new Array(t);for(let n=0;n!==t;++n)e[n]=n;return e.sort(function(n,r){return i[n]-i[r]}),e},sortedArray:function(i,t,e){const n=i.length,r=new i.constructor(n);for(let o=0,s=0;s!==n;++o){const a=e[o]*t;for(let h=0;h!==t;++h)r[s++]=i[a+h]}return r},flattenJSON:function(i,t,e,n){let r=1,o=i[0];for(;o!==void 0&&o[n]===void 0;)o=i[r++];if(o===void 0)return;let s=o[n];if(s!==void 0)if(Array.isArray(s))do s=o[n],s!==void 0&&(t.push(o.time),e.push.apply(e,s)),o=i[r++];while(o!==void 0);else if(s.toArray!==void 0)do s=o[n],s!==void 0&&(t.push(o.time),s.toArray(e,e.length)),o=i[r++];while(o!==void 0);else do s=o[n],s!==void 0&&(t.push(o.time),e.push(s)),o=i[r++];while(o!==void 0)},subclip:function(i,t,e,n,r=30){const o=i.clone();o.name=t;const s=[];for(let h=0;h<o.tracks.length;++h){const l=o.tracks[h],u=l.getValueSize(),p=[],y=[];for(let x=0;x<l.times.length;++x){const E=l.times[x]*r;if(!(E<e||E>=n)){p.push(l.times[x]);for(let A=0;A<u;++A)y.push(l.values[x*u+A])}}p.length!==0&&(l.times=ci.convertArray(p,l.times.constructor),l.values=ci.convertArray(y,l.values.constructor),s.push(l))}o.tracks=s;let a=1/0;for(let h=0;h<o.tracks.length;++h)a>o.tracks[h].times[0]&&(a=o.tracks[h].times[0]);for(let h=0;h<o.tracks.length;++h)o.tracks[h].shift(-1*a);return o.resetDuration(),o},makeClipAdditive:function(i,t=0,e=i,n=30){n<=0&&(n=30);const r=e.tracks.length,o=t/n;for(let s=0;s<r;++s){const a=e.tracks[s],h=a.ValueTypeName;if(h==="bool"||h==="string")continue;const l=i.tracks.find(function(j){return j.name===a.name&&j.ValueTypeName===h});if(l===void 0)continue;let u=0;const p=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(u=p/3);let y=0;const x=l.getValueSize();l.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(y=x/3);const E=a.times.length-1;let A;if(o<=a.times[0]){const j=u,Q=p-u;A=ci.arraySlice(a.values,j,Q)}else if(o>=a.times[E]){const j=E*p+u,Q=j+p-u;A=ci.arraySlice(a.values,j,Q)}else{const j=a.createInterpolant(),Q=u,rt=p-u;j.evaluate(o),A=ci.arraySlice(j.resultBuffer,Q,rt)}h==="quaternion"&&new V().fromArray(A).normalize().conjugate().toArray(A);const C=l.times.length;for(let j=0;j<C;++j){const Q=j*x+y;if(h==="quaternion")V.multiplyQuaternionsFlat(l.values,Q,A,0,l.values,Q);else{const rt=x-2*y;for(let pt=0;pt<rt;++pt)l.values[Q+pt]-=A[pt]}}}return i.blendMode=2501,i}};class Po{constructor(t,e,n,r){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=r!==void 0?r:new e.constructor(n),this.sampleValues=e,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(t){const e=this.parameterPositions;let n=this._cachedIndex,r=e[n],o=e[n-1];t:{e:{let s;n:{i:if(!(t<r)){for(let a=n+2;;){if(r===void 0){if(t<o)break i;return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,t,o)}if(n===a)break;if(o=r,r=e[++n],t<r)break e}s=e.length;break n}if(t>=o)break t;{const a=e[1];t<a&&(n=2,o=a);for(let h=n-2;;){if(o===void 0)return this._cachedIndex=0,this.beforeStart_(0,t,r);if(n===h)break;if(r=o,o=e[--n-1],t>=o)break e}s=n,n=0}}for(;n<s;){const a=n+s>>>1;t<e[a]?s=a:n=a+1}if(r=e[n],o=e[n-1],o===void 0)return this._cachedIndex=0,this.beforeStart_(0,t,r);if(r===void 0)return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,o,t)}this._cachedIndex=n,this.intervalChanged_(n,o,r)}return this.interpolate_(n,o,t,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){const e=this.resultBuffer,n=this.sampleValues,r=this.valueSize,o=t*r;for(let s=0;s!==r;++s)e[s]=n[o+s];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}Po.prototype.beforeStart_=Po.prototype.copySampleValue_,Po.prototype.afterEnd_=Po.prototype.copySampleValue_;class X0 extends Po{constructor(t,e,n,r){super(t,e,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:2400,endingEnd:2400}}intervalChanged_(t,e,n){const r=this.parameterPositions;let o=t-2,s=t+1,a=r[o],h=r[s];if(a===void 0)switch(this.getSettings_().endingStart){case 2401:o=t,a=2*e-n;break;case 2402:o=r.length-2,a=e+r[o]-r[o+1];break;default:o=t,a=n}if(h===void 0)switch(this.getSettings_().endingEnd){case 2401:s=t,h=2*n-e;break;case 2402:s=1,h=n+r[1]-r[0];break;default:s=t-1,h=e}const l=.5*(n-e),u=this.valueSize;this._weightPrev=l/(e-a),this._weightNext=l/(h-n),this._offsetPrev=o*u,this._offsetNext=s*u}interpolate_(t,e,n,r){const o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,h=t*a,l=h-a,u=this._offsetPrev,p=this._offsetNext,y=this._weightPrev,x=this._weightNext,E=(n-e)/(r-e),A=E*E,C=A*E,j=-y*C+2*y*A-y*E,Q=(1+y)*C+(-1.5-2*y)*A+(-.5+y)*E+1,rt=(-1-x)*C+(1.5+x)*A+.5*E,pt=x*C-x*A;for(let it=0;it!==a;++it)o[it]=j*s[u+it]+Q*s[l+it]+rt*s[h+it]+pt*s[p+it];return o}}class kd extends Po{constructor(t,e,n,r){super(t,e,n,r)}interpolate_(t,e,n,r){const o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,h=t*a,l=h-a,u=(n-e)/(r-e),p=1-u;for(let y=0;y!==a;++y)o[y]=s[l+y]*p+s[h+y]*u;return o}}class Y0 extends Po{constructor(t,e,n,r){super(t,e,n,r)}interpolate_(t){return this.copySampleValue_(t-1)}}class Wr{constructor(t,e,n,r){if(t===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(e===void 0||e.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=ci.convertArray(e,this.TimeBufferType),this.values=ci.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(t){const e=t.constructor;let n;if(e.toJSON!==this.toJSON)n=e.toJSON(t);else{n={name:t.name,times:ci.convertArray(t.times,Array),values:ci.convertArray(t.values,Array)};const r=t.getInterpolation();r!==t.DefaultInterpolation&&(n.interpolation=r)}return n.type=t.ValueTypeName,n}InterpolantFactoryMethodDiscrete(t){return new Y0(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new kd(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new X0(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case 2300:e=this.InterpolantFactoryMethodDiscrete;break;case 2301:e=this.InterpolantFactoryMethodLinear;break;case 2302:e=this.InterpolantFactoryMethodSmooth}if(e===void 0){const n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0){if(t===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}}getValueSize(){return this.values.length/this.times.length}shift(t){if(t!==0){const e=this.times;for(let n=0,r=e.length;n!==r;++n)e[n]+=t}return this}scale(t){if(t!==1){const e=this.times;for(let n=0,r=e.length;n!==r;++n)e[n]*=t}return this}trim(t,e){const n=this.times,r=n.length;let o=0,s=r-1;for(;o!==r&&n[o]<t;)++o;for(;s!==-1&&n[s]>e;)--s;if(++s,o!==0||s!==r){o>=s&&(s=Math.max(s,1),o=s-1);const a=this.getValueSize();this.times=ci.arraySlice(n,o,s),this.values=ci.arraySlice(this.values,o*a,s*a)}return this}validate(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const n=this.times,r=this.values,o=n.length;o===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let s=null;for(let a=0;a!==o;a++){const h=n[a];if(typeof h=="number"&&isNaN(h)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,h),t=!1;break}if(s!==null&&s>h){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,h,s),t=!1;break}s=h}if(r!==void 0&&ci.isTypedArray(r))for(let a=0,h=r.length;a!==h;++a){const l=r[a];if(isNaN(l)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,l),t=!1;break}}return t}optimize(){const t=ci.arraySlice(this.times),e=ci.arraySlice(this.values),n=this.getValueSize(),r=this.getInterpolation()===2302,o=t.length-1;let s=1;for(let a=1;a<o;++a){let h=!1;const l=t[a];if(l!==t[a+1]&&(a!==1||l!==t[0]))if(r)h=!0;else{const u=a*n,p=u-n,y=u+n;for(let x=0;x!==n;++x){const E=e[u+x];if(E!==e[p+x]||E!==e[y+x]){h=!0;break}}}if(h){if(a!==s){t[s]=t[a];const u=a*n,p=s*n;for(let y=0;y!==n;++y)e[p+y]=e[u+y]}++s}}if(o>0){t[s]=t[o];for(let a=o*n,h=s*n,l=0;l!==n;++l)e[h+l]=e[a+l];++s}return s!==t.length?(this.times=ci.arraySlice(t,0,s),this.values=ci.arraySlice(e,0,s*n)):(this.times=t,this.values=e),this}clone(){const t=ci.arraySlice(this.times,0),e=ci.arraySlice(this.values,0),n=new this.constructor(this.name,t,e);return n.createInterpolant=this.createInterpolant,n}}Wr.prototype.TimeBufferType=Float32Array,Wr.prototype.ValueBufferType=Float32Array,Wr.prototype.DefaultInterpolation=2301;class Cs extends Wr{}Cs.prototype.ValueTypeName="bool",Cs.prototype.ValueBufferType=Array,Cs.prototype.DefaultInterpolation=2300,Cs.prototype.InterpolantFactoryMethodLinear=void 0,Cs.prototype.InterpolantFactoryMethodSmooth=void 0;class Gd extends Wr{}Gd.prototype.ValueTypeName="color";class Ml extends Wr{}Ml.prototype.ValueTypeName="number";class q0 extends Po{constructor(t,e,n,r){super(t,e,n,r)}interpolate_(t,e,n,r){const o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,h=(n-e)/(r-e);let l=t*a;for(let u=l+a;l!==u;l+=4)V.slerpFlat(o,0,s,l-a,s,l,h);return o}}class va extends Wr{InterpolantFactoryMethodLinear(t){return new q0(this.times,this.values,this.getValueSize(),t)}}va.prototype.ValueTypeName="quaternion",va.prototype.DefaultInterpolation=2301,va.prototype.InterpolantFactoryMethodSmooth=void 0;class Rs extends Wr{}Rs.prototype.ValueTypeName="string",Rs.prototype.ValueBufferType=Array,Rs.prototype.DefaultInterpolation=2300,Rs.prototype.InterpolantFactoryMethodLinear=void 0,Rs.prototype.InterpolantFactoryMethodSmooth=void 0;class Cl extends Wr{}Cl.prototype.ValueTypeName="vector";class Hd{constructor(t,e=-1,n,r=2500){this.name=t,this.tracks=n,this.duration=e,this.blendMode=r,this.uuid=Y(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],n=t.tracks,r=1/(t.fps||1);for(let s=0,a=n.length;s!==a;++s)e.push(J0(n[s]).scale(r));const o=new this(t.name,t.duration,e,t.blendMode);return o.uuid=t.uuid,o}static toJSON(t){const e=[],n=t.tracks,r={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let o=0,s=n.length;o!==s;++o)e.push(Wr.toJSON(n[o]));return r}static CreateFromMorphTargetSequence(t,e,n,r){const o=e.length,s=[];for(let a=0;a<o;a++){let h=[],l=[];h.push((a+o-1)%o,a,(a+1)%o),l.push(0,1,0);const u=ci.getKeyframeOrder(h);h=ci.sortedArray(h,1,u),l=ci.sortedArray(l,1,u),r||h[0]!==0||(h.push(o),l.push(l[0])),s.push(new Ml(".morphTargetInfluences["+e[a].name+"]",h,l).scale(1/n))}return new this(t,-1,s)}static findByName(t,e){let n=t;if(!Array.isArray(t)){const r=t;n=r.geometry&&r.geometry.animations||r.animations}for(let r=0;r<n.length;r++)if(n[r].name===e)return n[r];return null}static CreateClipsFromMorphTargetSequences(t,e,n){const r={},o=/^([\w-]*?)([\d]+)$/;for(let a=0,h=t.length;a<h;a++){const l=t[a],u=l.name.match(o);if(u&&u.length>1){const p=u[1];let y=r[p];y||(r[p]=y=[]),y.push(l)}}const s=[];for(const a in r)s.push(this.CreateFromMorphTargetSequence(a,r[a],e,n));return s}static parseAnimation(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(u,p,y,x,E){if(y.length!==0){const A=[],C=[];ci.flattenJSON(y,A,C,x),A.length!==0&&E.push(new u(p,A,C))}},r=[],o=t.name||"default",s=t.fps||30,a=t.blendMode;let h=t.length||-1;const l=t.hierarchy||[];for(let u=0;u<l.length;u++){const p=l[u].keys;if(p&&p.length!==0)if(p[0].morphTargets){const y={};let x;for(x=0;x<p.length;x++)if(p[x].morphTargets)for(let E=0;E<p[x].morphTargets.length;E++)y[p[x].morphTargets[E]]=-1;for(const E in y){const A=[],C=[];for(let j=0;j!==p[x].morphTargets.length;++j){const Q=p[x];A.push(Q.time),C.push(Q.morphTarget===E?1:0)}r.push(new Ml(".morphTargetInfluence["+E+"]",A,C))}h=y.length*(s||1)}else{const y=".bones["+e[u].name+"]";n(Cl,y+".position",p,"pos",r),n(va,y+".quaternion",p,"rot",r),n(Cl,y+".scale",p,"scl",r)}}return r.length===0?null:new this(o,h,r,a)}resetDuration(){let t=0;for(let e=0,n=this.tracks.length;e!==n;++e){const r=this.tracks[e];t=Math.max(t,r.times[r.times.length-1])}return this.duration=t,this}trim(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this}validate(){let t=!0;for(let e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t}optimize(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}clone(){const t=[];for(let e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new this.constructor(this.name,this.duration,t,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function J0(i){if(i.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Ml;case"vector":case"vector2":case"vector3":case"vector4":return Cl;case"color":return Gd;case"quaternion":return va;case"bool":case"boolean":return Cs;case"string":return Rs}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(i.type);if(i.times===void 0){const e=[],n=[];ci.flattenJSON(i.keys,e,n,"value"),i.times=e,i.values=n}return t.parse!==void 0?t.parse(i):new t(i.name,i.times,i.values,i.interpolation)}const Is={enabled:!1,files:{},add:function(i,t){this.enabled!==!1&&(this.files[i]=t)},get:function(i){if(this.enabled!==!1)return this.files[i]},remove:function(i){delete this.files[i]},clear:function(){this.files={}}};class K0{constructor(t,e,n){const r=this;let o=!1,s=0,a=0,h;const l=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(u){a++,o===!1&&r.onStart!==void 0&&r.onStart(u,s,a),o=!0},this.itemEnd=function(u){s++,r.onProgress!==void 0&&r.onProgress(u,s,a),s===a&&(o=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(u){r.onError!==void 0&&r.onError(u)},this.resolveURL=function(u){return h?h(u):u},this.setURLModifier=function(u){return h=u,this},this.addHandler=function(u,p){return l.push(u,p),this},this.removeHandler=function(u){const p=l.indexOf(u);return p!==-1&&l.splice(p,2),this},this.getHandler=function(u){for(let p=0,y=l.length;p<y;p+=2){const x=l[p],E=l[p+1];if(x.global&&(x.lastIndex=0),x.test(u))return E}return null}}}const Z0=new K0;class Oo{constructor(t){this.manager=t!==void 0?t:Z0,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){const n=this;return new Promise(function(r,o){n.load(t,r,e,o)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}const Ur={};class Q0 extends Oo{constructor(t){super(t)}load(t,e,n,r){t===void 0&&(t=""),this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const o=this,s=Is.get(t);if(s!==void 0)return o.manager.itemStart(t),setTimeout(function(){e&&e(s),o.manager.itemEnd(t)},0),s;if(Ur[t]!==void 0)return void Ur[t].push({onLoad:e,onProgress:n,onError:r});const a=t.match(/^data:(.*?)(;base64)?,(.*)$/);let h;if(a){const l=a[1],u=!!a[2];let p=a[3];p=decodeURIComponent(p),u&&(p=atob(p));try{let y;const x=(this.responseType||"").toLowerCase();switch(x){case"arraybuffer":case"blob":const E=new Uint8Array(p.length);for(let C=0;C<p.length;C++)E[C]=p.charCodeAt(C);y=x==="blob"?new Blob([E.buffer],{type:l}):E.buffer;break;case"document":y=new DOMParser().parseFromString(p,l);break;case"json":y=JSON.parse(p);break;default:y=p}setTimeout(function(){e&&e(y),o.manager.itemEnd(t)},0)}catch(y){setTimeout(function(){r&&r(y),o.manager.itemError(t),o.manager.itemEnd(t)},0)}}else{Ur[t]=[],Ur[t].push({onLoad:e,onProgress:n,onError:r}),h=new XMLHttpRequest,h.open("GET",t,!0),h.addEventListener("load",function(l){const u=this.response,p=Ur[t];if(delete Ur[t],this.status===200||this.status===0){this.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),Is.add(t,u);for(let y=0,x=p.length;y<x;y++){const E=p[y];E.onLoad&&E.onLoad(u)}o.manager.itemEnd(t)}else{for(let y=0,x=p.length;y<x;y++){const E=p[y];E.onError&&E.onError(l)}o.manager.itemError(t),o.manager.itemEnd(t)}},!1),h.addEventListener("progress",function(l){const u=Ur[t];for(let p=0,y=u.length;p<y;p++){const x=u[p];x.onProgress&&x.onProgress(l)}},!1),h.addEventListener("error",function(l){const u=Ur[t];delete Ur[t];for(let p=0,y=u.length;p<y;p++){const x=u[p];x.onError&&x.onError(l)}o.manager.itemError(t),o.manager.itemEnd(t)},!1),h.addEventListener("abort",function(l){const u=Ur[t];delete Ur[t];for(let p=0,y=u.length;p<y;p++){const x=u[p];x.onError&&x.onError(l)}o.manager.itemError(t),o.manager.itemEnd(t)},!1),this.responseType!==void 0&&(h.responseType=this.responseType),this.withCredentials!==void 0&&(h.withCredentials=this.withCredentials),h.overrideMimeType&&h.overrideMimeType(this.mimeType!==void 0?this.mimeType:"text/plain");for(const l in this.requestHeader)h.setRequestHeader(l,this.requestHeader[l]);h.send(null)}return o.manager.itemStart(t),h}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class jd extends Oo{constructor(t){super(t)}load(t,e,n,r){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const o=this,s=Is.get(t);if(s!==void 0)return o.manager.itemStart(t),setTimeout(function(){e&&e(s),o.manager.itemEnd(t)},0),s;const a=document.createElementNS("http://www.w3.org/1999/xhtml","img");function h(){a.removeEventListener("load",h,!1),a.removeEventListener("error",l,!1),Is.add(t,this),e&&e(this),o.manager.itemEnd(t)}function l(u){a.removeEventListener("load",h,!1),a.removeEventListener("error",l,!1),r&&r(u),o.manager.itemError(t),o.manager.itemEnd(t)}return a.addEventListener("load",h,!1),a.addEventListener("error",l,!1),t.substr(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),o.manager.itemStart(t),a.src=t,a}}class $0 extends Oo{constructor(t){super(t)}load(t,e,n,r){const o=new mi,s=new jd(this.manager);s.setCrossOrigin(this.crossOrigin),s.setPath(this.path);let a=0;function h(l){s.load(t[l],function(u){o.images[l]=u,a++,a===6&&(o.needsUpdate=!0,e&&e(o))},void 0,r)}for(let l=0;l<t.length;++l)h(l);return o}}class t_ extends Oo{constructor(t){super(t)}load(t,e,n,r){const o=new tt,s=new jd(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(t,function(a){o.image=a;const h=t.search(/\.jpe?g($|\?)/i)>0||t.search(/^data\:image\/jpeg/)===0;o.format=h?1022:1023,o.needsUpdate=!0,e!==void 0&&e(o)},n,r),o}}class e_ extends Ir{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(t){this.curves.push(t)}closePath(){const t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new El(e,t))}getPoint(t){const e=t*this.getLength(),n=this.getCurveLengths();let r=0;for(;r<n.length;){if(n[r]>=e){const o=n[r]-e,s=this.curves[r],a=s.getLength(),h=a===0?0:1-o/a;return s.getPointAt(h)}r++}return null}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const t=[];let e=0;for(let n=0,r=this.curves.length;n<r;n++)e+=this.curves[n].getLength(),t.push(e);return this.cacheLengths=t,t}getSpacedPoints(t=40){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return this.autoClose&&e.push(e[0]),e}getPoints(t=12){const e=[];let n;for(let r=0,o=this.curves;r<o.length;r++){const s=o[r],a=s&&s.isEllipseCurve?2*t:s&&(s.isLineCurve||s.isLineCurve3)?1:s&&s.isSplineCurve?t*s.points.length:t,h=s.getPoints(a);for(let l=0;l<h.length;l++){const u=h[l];n&&n.equals(u)||(e.push(u),n=u)}}return this.autoClose&&e.length>1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const r=t.curves[e];this.curves.push(r.clone())}return this.autoClose=t.autoClose,this}toJSON(){const t=super.toJSON();t.autoClose=this.autoClose,t.curves=[];for(let e=0,n=this.curves.length;e<n;e++){const r=this.curves[e];t.curves.push(r.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.autoClose=t.autoClose,this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const r=t.curves[e];this.curves.push(new Id[r.type]().fromJSON(r))}return this}}class Ps extends e_{constructor(t){super(),this.type="Path",this.currentPoint=new R,t&&this.setFromPoints(t)}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,n=t.length;e<n;e++)this.lineTo(t[e].x,t[e].y);return this}moveTo(t,e){return this.currentPoint.set(t,e),this}lineTo(t,e){const n=new El(this.currentPoint.clone(),new R(t,e));return this.curves.push(n),this.currentPoint.set(t,e),this}quadraticCurveTo(t,e,n,r){const o=new tu(this.currentPoint.clone(),new R(t,e),new R(n,r));return this.curves.push(o),this.currentPoint.set(n,r),this}bezierCurveTo(t,e,n,r,o,s){const a=new $h(this.currentPoint.clone(),new R(t,e),new R(n,r),new R(o,s));return this.curves.push(a),this.currentPoint.set(o,s),this}splineThru(t){const e=[this.currentPoint.clone()].concat(t),n=new eu(e);return this.curves.push(n),this.currentPoint.copy(t[t.length-1]),this}arc(t,e,n,r,o,s){const a=this.currentPoint.x,h=this.currentPoint.y;return this.absarc(t+a,e+h,n,r,o,s),this}absarc(t,e,n,r,o,s){return this.absellipse(t,e,n,n,r,o,s),this}ellipse(t,e,n,r,o,s,a,h){const l=this.currentPoint.x,u=this.currentPoint.y;return this.absellipse(t+l,e+u,n,r,o,s,a,h),this}absellipse(t,e,n,r,o,s,a,h){const l=new bl(t,e,n,r,o,s,a,h);if(this.curves.length>0){const p=l.getPoint(0);p.equals(this.currentPoint)||this.lineTo(p.x,p.y)}this.curves.push(l);const u=l.getPoint(1);return this.currentPoint.copy(u),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}class ou extends Ps{constructor(t){super(t),this.uuid=Y(),this.type="Shape",this.holes=[]}getPointsHoles(t){const e=[];for(let n=0,r=this.holes.length;n<r;n++)e[n]=this.holes[n].getPoints(t);return e}extractPoints(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}}copy(t){super.copy(t),this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const r=t.holes[e];this.holes.push(r.clone())}return this}toJSON(){const t=super.toJSON();t.uuid=this.uuid,t.holes=[];for(let e=0,n=this.holes.length;e<n;e++){const r=this.holes[e];t.holes.push(r.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.uuid=t.uuid,this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const r=t.holes[e];this.holes.push(new Ps().fromJSON(r))}return this}}class Xr extends Un{constructor(t,e=1){super(),this.type="Light",this.color=new fn(t),this.intensity=e}dispose(){}copy(t){return super.copy(t),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){const e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,this.groundColor!==void 0&&(e.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(e.object.distance=this.distance),this.angle!==void 0&&(e.object.angle=this.angle),this.decay!==void 0&&(e.object.decay=this.decay),this.penumbra!==void 0&&(e.object.penumbra=this.penumbra),this.shadow!==void 0&&(e.object.shadow=this.shadow.toJSON()),e}}Xr.prototype.isLight=!0;class n_ extends Xr{constructor(t,e,n){super(t,n),this.type="HemisphereLight",this.position.copy(Un.DefaultUp),this.updateMatrix(),this.groundColor=new fn(e)}copy(t){return Xr.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}n_.prototype.isHemisphereLight=!0;const zd=new tn,Vd=new U,Wd=new U;class su{constructor(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.mapSize=new R(512,512),this.map=null,this.mapPass=null,this.matrix=new tn,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Br,this._frameExtents=new R(1,1),this._viewportCount=1,this._viewports=[new Ot(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const e=this.camera,n=this.matrix;Vd.setFromMatrixPosition(t.matrixWorld),e.position.copy(Vd),Wd.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(Wd),e.updateMatrixWorld(),zd.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(zd),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(e.projectionMatrix),n.multiply(e.matrixWorldInverse)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const t={};return this.bias!==0&&(t.bias=this.bias),this.normalBias!==0&&(t.normalBias=this.normalBias),this.radius!==1&&(t.radius=this.radius),this.mapSize.x===512&&this.mapSize.y===512||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}class Xd extends su{constructor(){super(new un(50,1,.5,500)),this.focus=1}updateMatrices(t){const e=this.camera,n=2*W*t.angle*this.focus,r=this.mapSize.width/this.mapSize.height,o=t.distance||e.far;n===e.fov&&r===e.aspect&&o===e.far||(e.fov=n,e.aspect=r,e.far=o,e.updateProjectionMatrix()),super.updateMatrices(t)}copy(t){return super.copy(t),this.focus=t.focus,this}}Xd.prototype.isSpotLightShadow=!0;class i_ extends Xr{constructor(t,e,n=0,r=Math.PI/3,o=0,s=1){super(t,e),this.type="SpotLight",this.position.copy(Un.DefaultUp),this.updateMatrix(),this.target=new Un,this.distance=n,this.angle=r,this.penumbra=o,this.decay=s,this.shadow=new Xd}get power(){return this.intensity*Math.PI}set power(t){this.intensity=t/Math.PI}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}i_.prototype.isSpotLight=!0;const Yd=new tn,_a=new U,au=new U;class qd extends su{constructor(){super(new un(90,1,.5,500)),this._frameExtents=new R(4,2),this._viewportCount=6,this._viewports=[new Ot(2,1,1,1),new Ot(0,1,1,1),new Ot(3,1,1,1),new Ot(1,1,1,1),new Ot(3,0,1,1),new Ot(1,0,1,1)],this._cubeDirections=[new U(1,0,0),new U(-1,0,0),new U(0,0,1),new U(0,0,-1),new U(0,1,0),new U(0,-1,0)],this._cubeUps=[new U(0,1,0),new U(0,1,0),new U(0,1,0),new U(0,1,0),new U(0,0,1),new U(0,0,-1)]}updateMatrices(t,e=0){const n=this.camera,r=this.matrix,o=t.distance||n.far;o!==n.far&&(n.far=o,n.updateProjectionMatrix()),_a.setFromMatrixPosition(t.matrixWorld),n.position.copy(_a),au.copy(n.position),au.add(this._cubeDirections[e]),n.up.copy(this._cubeUps[e]),n.lookAt(au),n.updateMatrixWorld(),r.makeTranslation(-_a.x,-_a.y,-_a.z),Yd.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Yd)}}qd.prototype.isPointLightShadow=!0;class r_ extends Xr{constructor(t,e,n=0,r=1){super(t,e),this.type="PointLight",this.distance=n,this.decay=r,this.shadow=new qd}get power(){return 4*this.intensity*Math.PI}set power(t){this.intensity=t/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}r_.prototype.isPointLight=!0;class lu extends vn{constructor(t=-1,e=1,n=1,r=-1,o=.1,s=2e3){super(),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=r,this.near=o,this.far=s,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,e,n,r,o,s){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=o,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let o=n-t,s=n+t,a=r+e,h=r-e;if(this.view!==null&&this.view.enabled){const l=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=l*this.view.offsetX,s=o+l*this.view.width,a-=u*this.view.offsetY,h=a-u*this.view.height}this.projectionMatrix.makeOrthographic(o,s,a,h,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,this.view!==null&&(e.object.view=Object.assign({},this.view)),e}}lu.prototype.isOrthographicCamera=!0;class Jd extends su{constructor(){super(new lu(-5,5,5,-5,.5,500))}}Jd.prototype.isDirectionalLightShadow=!0;class o_ extends Xr{constructor(t,e){super(t,e),this.type="DirectionalLight",this.position.copy(Un.DefaultUp),this.updateMatrix(),this.target=new Un,this.shadow=new Jd}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}o_.prototype.isDirectionalLight=!0;class s_ extends Xr{constructor(t,e){super(t,e),this.type="AmbientLight"}}s_.prototype.isAmbientLight=!0;class a_ extends Xr{constructor(t,e,n=10,r=10){super(t,e),this.type="RectAreaLight",this.width=n,this.height=r}copy(t){return super.copy(t),this.width=t.width,this.height=t.height,this}toJSON(t){const e=super.toJSON(t);return e.object.width=this.width,e.object.height=this.height,e}}a_.prototype.isRectAreaLight=!0;class Kd{constructor(){this.coefficients=[];for(let t=0;t<9;t++)this.coefficients.push(new U)}set(t){for(let e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this}zero(){for(let t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this}getAt(t,e){const n=t.x,r=t.y,o=t.z,s=this.coefficients;return e.copy(s[0]).multiplyScalar(.282095),e.addScaledVector(s[1],.488603*r),e.addScaledVector(s[2],.488603*o),e.addScaledVector(s[3],.488603*n),e.addScaledVector(s[4],n*r*1.092548),e.addScaledVector(s[5],r*o*1.092548),e.addScaledVector(s[6],.315392*(3*o*o-1)),e.addScaledVector(s[7],n*o*1.092548),e.addScaledVector(s[8],.546274*(n*n-r*r)),e}getIrradianceAt(t,e){const n=t.x,r=t.y,o=t.z,s=this.coefficients;return e.copy(s[0]).multiplyScalar(.886227),e.addScaledVector(s[1],1.023328*r),e.addScaledVector(s[2],1.023328*o),e.addScaledVector(s[3],1.023328*n),e.addScaledVector(s[4],.858086*n*r),e.addScaledVector(s[5],.858086*r*o),e.addScaledVector(s[6],.743125*o*o-.247708),e.addScaledVector(s[7],.858086*n*o),e.addScaledVector(s[8],.429043*(n*n-r*r)),e}add(t){for(let e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this}addScaledSH(t,e){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(t.coefficients[n],e);return this}scale(t){for(let e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this}lerp(t,e){for(let n=0;n<9;n++)this.coefficients[n].lerp(t.coefficients[n],e);return this}equals(t){for(let e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0}copy(t){return this.set(t.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(t,e=0){const n=this.coefficients;for(let r=0;r<9;r++)n[r].fromArray(t,e+3*r);return this}toArray(t=[],e=0){const n=this.coefficients;for(let r=0;r<9;r++)n[r].toArray(t,e+3*r);return t}static getBasisAt(t,e){const n=t.x,r=t.y,o=t.z;e[0]=.282095,e[1]=.488603*r,e[2]=.488603*o,e[3]=.488603*n,e[4]=1.092548*n*r,e[5]=1.092548*r*o,e[6]=.315392*(3*o*o-1),e[7]=1.092548*n*o,e[8]=.546274*(n*n-r*r)}}Kd.prototype.isSphericalHarmonics3=!0;class hu extends Xr{constructor(t=new Kd,e=1){super(void 0,e),this.sh=t}copy(t){return super.copy(t),this.sh.copy(t.sh),this}fromJSON(t){return this.intensity=t.intensity,this.sh.fromArray(t.sh),this}toJSON(t){const e=super.toJSON(t);return e.object.sh=this.sh.toArray(),e}}hu.prototype.isLightProbe=!0;class l_{static decodeText(t){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(t);let e="";for(let n=0,r=t.length;n<r;n++)e+=String.fromCharCode(t[n]);try{return decodeURIComponent(escape(e))}catch{return e}}static extractUrlBase(t){const e=t.lastIndexOf("/");return e===-1?"./":t.substr(0,e+1)}}class h_ extends Wn{constructor(){super(),this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(t){return super.copy(t),this.instanceCount=t.instanceCount,this}clone(){return new this.constructor().copy(this)}toJSON(){const t=super.toJSON(this);return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}}h_.prototype.isInstancedBufferGeometry=!0;class u_ extends Yn{constructor(t,e,n,r=1){typeof n=="number"&&(r=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(t,e,n),this.meshPerAttribute=r}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}toJSON(){const t=super.toJSON();return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}u_.prototype.isInstancedBufferAttribute=!0,class extends Oo{constructor(i){super(i),typeof createImageBitmap=="undefined"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch=="undefined"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(i){return this.options=i,this}load(i,t,e,n){i===void 0&&(i=""),this.path!==void 0&&(i=this.path+i),i=this.manager.resolveURL(i);const r=this,o=Is.get(i);if(o!==void 0)return r.manager.itemStart(i),setTimeout(function(){t&&t(o),r.manager.itemEnd(i)},0),o;const s={};s.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",s.headers=this.requestHeader,fetch(i,s).then(function(a){return a.blob()}).then(function(a){return createImageBitmap(a,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(a){Is.add(i,a),t&&t(a),r.manager.itemEnd(i)}).catch(function(a){n&&n(a),r.manager.itemError(i),r.manager.itemEnd(i)}),r.manager.itemStart(i)}}.prototype.isImageBitmapLoader=!0;let uu;const c_=function(){return uu===void 0&&(uu=new(window.AudioContext||window.webkitAudioContext)),uu};class d_ extends Oo{constructor(t){super(t)}load(t,e,n,r){const o=this,s=new Q0(this.manager);s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,function(a){try{const h=a.slice(0);c_().decodeAudioData(h,function(l){e(l)})}catch(h){r?r(h):console.error(h),o.manager.itemError(t)}},n,r)}}(class extends hu{constructor(i,t,e=1){super(void 0,e);const n=new fn().set(i),r=new fn().set(t),o=new U(n.r,n.g,n.b),s=new U(r.r,r.g,r.b),a=Math.sqrt(Math.PI),h=a*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(s).multiplyScalar(a),this.sh.coefficients[1].copy(o).sub(s).multiplyScalar(h)}}).prototype.isHemisphereLightProbe=!0,class extends hu{constructor(i,t=1){super(void 0,t);const e=new fn().set(i);this.sh.coefficients[0].set(e.r,e.g,e.b).multiplyScalar(2*Math.sqrt(Math.PI))}}.prototype.isAmbientLightProbe=!0;class p_ extends Un{constructor(t){super(),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this}setMediaElementSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this}setMediaStreamSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(t),this.connect(),this}setBuffer(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this}play(t=0){if(this.isPlaying===!0)return void console.warn("THREE.Audio: Audio is already playing.");if(this.hasPlaybackControl===!1)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+t;const e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.loopStart=this.loopStart,e.loopEnd=this.loopEnd,e.onended=this.onEnded.bind(this),e.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl!==!1)return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}stop(){if(this.hasPlaybackControl!==!1)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(t){return t||(t=[]),this._connected===!0?(this.disconnect(),this.filters=t.slice(),this.connect()):this.filters=t.slice(),this}setDetune(t){if(this.detune=t,this.source.detune!==void 0)return this.isPlaying===!0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(t){return this.setFilters(t?[t]:[])}setPlaybackRate(t){if(this.hasPlaybackControl!==!1)return this.playbackRate=t,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(t){if(this.hasPlaybackControl!==!1)return this.loop=t,this.isPlaying===!0&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")}setLoopStart(t){return this.loopStart=t,this}setLoopEnd(t){return this.loopEnd=t,this}getVolume(){return this.gain.gain.value}setVolume(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}}class f_{constructor(t,e,n){let r,o,s;switch(this.binding=t,this.valueSize=n,e){case"quaternion":r=this._slerp,o=this._slerpAdditive,s=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*n),this._workIndex=5;break;case"string":case"bool":r=this._select,o=this._select,s=this._setAdditiveIdentityOther,this.buffer=new Array(5*n);break;default:r=this._lerp,o=this._lerpAdditive,s=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*n)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=o,this._setIdentity=s,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(t,e){const n=this.buffer,r=this.valueSize,o=t*r+r;let s=this.cumulativeWeight;if(s===0){for(let a=0;a!==r;++a)n[o+a]=n[a];s=e}else{s+=e;const a=e/s;this._mixBufferRegion(n,o,0,a,r)}this.cumulativeWeight=s}accumulateAdditive(t){const e=this.buffer,n=this.valueSize,r=n*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(e,r,0,t,n),this.cumulativeWeightAdditive+=t}apply(t){const e=this.valueSize,n=this.buffer,r=t*e+e,o=this.cumulativeWeight,s=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,o<1){const h=e*this._origIndex;this._mixBufferRegion(n,r,h,1-o,e)}s>0&&this._mixBufferRegionAdditive(n,r,this._addIndex*e,1,e);for(let h=e,l=e+e;h!==l;++h)if(n[h]!==n[h+e]){a.setValue(n,r);break}}saveOriginalState(){const t=this.binding,e=this.buffer,n=this.valueSize,r=n*this._origIndex;t.getValue(e,r);for(let o=n,s=r;o!==s;++o)e[o]=e[r+o%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const t=3*this.valueSize;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let n=t;n<e;n++)this.buffer[n]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const t=this._origIndex*this.valueSize,e=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[e+n]=this.buffer[t+n]}_select(t,e,n,r,o){if(r>=.5)for(let s=0;s!==o;++s)t[e+s]=t[n+s]}_slerp(t,e,n,r){V.slerpFlat(t,e,t,e,t,n,r)}_slerpAdditive(t,e,n,r,o){const s=this._workIndex*o;V.multiplyQuaternionsFlat(t,s,t,e,t,n),V.slerpFlat(t,e,t,e,t,s,r)}_lerp(t,e,n,r,o){const s=1-r;for(let a=0;a!==o;++a){const h=e+a;t[h]=t[h]*s+t[n+a]*r}}_lerpAdditive(t,e,n,r,o){for(let s=0;s!==o;++s){const a=e+s;t[a]=t[a]+t[n+s]*r}}}const m_=new RegExp("[\\[\\]\\.:\\/]","g"),g_="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",v_=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),__=/(WCOD+)?/.source.replace("WCOD",g_),y_=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),x_=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),b_=new RegExp("^"+v_+__+y_+x_+"$"),T_=["material","materials","bones"];class Qn{constructor(t,e,n){this.path=e,this.parsedPath=n||Qn.parseTrackName(e),this.node=Qn.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,n){return t&&t.isAnimationObjectGroup?new Qn.Composite(t,e,n):new Qn(t,e,n)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(m_,"")}static parseTrackName(t){const e=b_.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const o=n.nodeName.substring(r+1);T_.indexOf(o)!==-1&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=o)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}static findNode(t,e){if(!e||e===""||e==="."||e===-1||e===t.name||e===t.uuid)return t;if(t.skeleton){const n=t.skeleton.getBoneByName(e);if(n!==void 0)return n}if(t.children){const n=function(o){for(let s=0;s<o.length;s++){const a=o[s];if(a.name===e||a.uuid===e)return a;const h=n(a.children);if(h)return h}return null},r=n(t.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.node[this.propertyName]}_getValue_array(t,e){const n=this.resolvedProperty;for(let r=0,o=n.length;r!==o;++r)t[e++]=n[r]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){const n=this.resolvedProperty;for(let r=0,o=n.length;r!==o;++r)n[r]=t[e++]}_setValue_array_setNeedsUpdate(t,e){const n=this.resolvedProperty;for(let r=0,o=n.length;r!==o;++r)n[r]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){const n=this.resolvedProperty;for(let r=0,o=n.length;r!==o;++r)n[r]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node;const e=this.parsedPath,n=e.objectName,r=e.propertyName;let o=e.propertyIndex;if(t||(t=Qn.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return void console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");if(n){let l=e.objectIndex;switch(n){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(let u=0;u<t.length;u++)if(t[u].name===l){l=u;break}break;default:if(t[n]===void 0)return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[n]}if(l!==void 0){if(t[l]===void 0)return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[l]}}const s=t[r];if(s===void 0){const l=e.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+l+"."+r+" but it wasn't found.",t)}let a=this.Versioning.None;this.targetObject=t,t.needsUpdate!==void 0?a=this.Versioning.NeedsUpdate:t.matrixWorldNeedsUpdate!==void 0&&(a=this.Versioning.MatrixWorldNeedsUpdate);let h=this.BindingType.Direct;if(o!==void 0){if(r==="morphTargetInfluences"){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!t.geometry.isBufferGeometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);t.morphTargetDictionary[o]!==void 0&&(o=t.morphTargetDictionary[o])}h=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=o}else s.fromArray!==void 0&&s.toArray!==void 0?(h=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(h=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[h],this.setValue=this.SetterByBindingTypeAndVersioning[h][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Qn.Composite=class{constructor(i,t,e){const n=e||Qn.parseTrackName(t);this._targetGroup=i,this._bindings=i.subscribe_(t,n)}getValue(i,t){this.bind();const e=this._targetGroup.nCachedObjects_,n=this._bindings[e];n!==void 0&&n.getValue(i,t)}setValue(i,t){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=e.length;n!==r;++n)e[n].setValue(i,t)}bind(){const i=this._bindings;for(let t=this._targetGroup.nCachedObjects_,e=i.length;t!==e;++t)i[t].bind()}unbind(){const i=this._bindings;for(let t=this._targetGroup.nCachedObjects_,e=i.length;t!==e;++t)i[t].unbind()}},Qn.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Qn.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},Qn.prototype.GetterByBindingType=[Qn.prototype._getValue_direct,Qn.prototype._getValue_array,Qn.prototype._getValue_arrayElement,Qn.prototype._getValue_toArray],Qn.prototype.SetterByBindingTypeAndVersioning=[[Qn.prototype._setValue_direct,Qn.prototype._setValue_direct_setNeedsUpdate,Qn.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Qn.prototype._setValue_array,Qn.prototype._setValue_array_setNeedsUpdate,Qn.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Qn.prototype._setValue_arrayElement,Qn.prototype._setValue_arrayElement_setNeedsUpdate,Qn.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Qn.prototype._setValue_fromArray,Qn.prototype._setValue_fromArray_setNeedsUpdate,Qn.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class E_{constructor(t,e,n=null,r=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=n,this.blendMode=r;const o=e.tracks,s=o.length,a=new Array(s),h={endingStart:2400,endingEnd:2400};for(let l=0;l!==s;++l){const u=o[l].createInterpolant(null);a[l]=u,u.settings=h}this._interpolantSettings=h,this._interpolants=a,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(t){return this._startTime=t,this}setLoop(t,e){return this.loop=t,this.repetitions=e,this}setEffectiveWeight(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(t){return this._scheduleFading(t,0,1)}fadeOut(t){return this._scheduleFading(t,1,0)}crossFadeFrom(t,e,n){if(t.fadeOut(e),this.fadeIn(e),n){const r=this._clip.duration,o=t._clip.duration,s=o/r,a=r/o;t.warp(1,s,e),this.warp(a,1,e)}return this}crossFadeTo(t,e,n){return t.crossFadeFrom(this,e,n)}stopFading(){const t=this._weightInterpolant;return t!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}setEffectiveTimeScale(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(t){return this.timeScale=this._clip.duration/t,this.stopWarping()}syncWith(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()}halt(t){return this.warp(this._effectiveTimeScale,0,t)}warp(t,e,n){const r=this._mixer,o=r.time,s=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);const h=a.parameterPositions,l=a.sampleValues;return h[0]=o,h[1]=o+n,l[0]=t/s,l[1]=e/s,this}stopWarping(){const t=this._timeScaleInterpolant;return t!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,e,n,r){if(!this.enabled)return void this._updateWeight(t);const o=this._startTime;if(o!==null){const h=(t-o)*n;if(h<0||n===0)return;this._startTime=null,e=n*h}e*=this._updateTimeScale(t);const s=this._updateTime(e),a=this._updateWeight(t);if(a>0){const h=this._interpolants,l=this._propertyBindings;switch(this.blendMode){case 2501:for(let u=0,p=h.length;u!==p;++u)h[u].evaluate(s),l[u].accumulateAdditive(a);break;case 2500:default:for(let u=0,p=h.length;u!==p;++u)h[u].evaluate(s),l[u].accumulate(r,a)}}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const n=this._weightInterpolant;if(n!==null){const r=n.evaluate(t)[0];e*=r,t>n.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const n=this._timeScaleInterpolant;n!==null&&(e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),e===0?this.paused=!0:this.timeScale=e))}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,n=this.loop;let r=this.time+t,o=this._loopCount;const s=n===2202;if(t===0)return o===-1?r:s&&(1&o)==1?e-r:r;if(n===2200){o===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(r>=e)r=e;else{if(!(r<0)){this.time=r;break t}r=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(o===-1&&(t>=0?(o=0,this._setEndings(!0,this.repetitions===0,s)):this._setEndings(this.repetitions===0,!0,s)),r>=e||r<0){const a=Math.floor(r/e);r-=e*a,o+=Math.abs(a);const h=this.repetitions-o;if(h<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=t>0?e:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(h===1){const l=t<0;this._setEndings(l,!l,s)}else this._setEndings(!1,!1,s);this._loopCount=o,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=r;if(s&&(1&o)==1)return e-r}return r}_setEndings(t,e,n){const r=this._interpolantSettings;n?(r.endingStart=2401,r.endingEnd=2401):(r.endingStart=t?this.zeroSlopeAtStart?2401:2400:2402,r.endingEnd=e?this.zeroSlopeAtEnd?2401:2400:2402)}_scheduleFading(t,e,n){const r=this._mixer,o=r.time;let s=this._weightInterpolant;s===null&&(s=r._lendControlInterpolant(),this._weightInterpolant=s);const a=s.parameterPositions,h=s.sampleValues;return a[0]=o,h[0]=e,a[1]=o+t,h[1]=n,this}}(class extends D{constructor(i){super(),this._root=i,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(i,t){const e=i._localRoot||this._root,n=i._clip.tracks,r=n.length,o=i._propertyBindings,s=i._interpolants,a=e.uuid,h=this._bindingsByRootAndName;let l=h[a];l===void 0&&(l={},h[a]=l);for(let u=0;u!==r;++u){const p=n[u],y=p.name;let x=l[y];if(x!==void 0)o[u]=x;else{if(x=o[u],x!==void 0){x._cacheIndex===null&&(++x.referenceCount,this._addInactiveBinding(x,a,y));continue}const E=t&&t._propertyBindings[u].binding.parsedPath;x=new f_(Qn.create(e,y,E),p.ValueTypeName,p.getValueSize()),++x.referenceCount,this._addInactiveBinding(x,a,y),o[u]=x}s[u].resultBuffer=x.buffer}}_activateAction(i){if(!this._isActiveAction(i)){if(i._cacheIndex===null){const e=(i._localRoot||this._root).uuid,n=i._clip.uuid,r=this._actionsByClip[n];this._bindAction(i,r&&r.knownActions[0]),this._addInactiveAction(i,n,e)}const t=i._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const r=t[e];r.useCount++==0&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(i)}}_deactivateAction(i){if(this._isActiveAction(i)){const t=i._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const r=t[e];--r.useCount==0&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(i)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const i=this;this.stats={actions:{get total(){return i._actions.length},get inUse(){return i._nActiveActions}},bindings:{get total(){return i._bindings.length},get inUse(){return i._nActiveBindings}},controlInterpolants:{get total(){return i._controlInterpolants.length},get inUse(){return i._nActiveControlInterpolants}}}}_isActiveAction(i){const t=i._cacheIndex;return t!==null&&t<this._nActiveActions}_addInactiveAction(i,t,e){const n=this._actions,r=this._actionsByClip;let o=r[t];if(o===void 0)o={knownActions:[i],actionByRoot:{}},i._byClipCacheIndex=0,r[t]=o;else{const s=o.knownActions;i._byClipCacheIndex=s.length,s.push(i)}i._cacheIndex=n.length,n.push(i),o.actionByRoot[e]=i}_removeInactiveAction(i){const t=this._actions,e=t[t.length-1],n=i._cacheIndex;e._cacheIndex=n,t[n]=e,t.pop(),i._cacheIndex=null;const r=i._clip.uuid,o=this._actionsByClip,s=o[r],a=s.knownActions,h=a[a.length-1],l=i._byClipCacheIndex;h._byClipCacheIndex=l,a[l]=h,a.pop(),i._byClipCacheIndex=null,delete s.actionByRoot[(i._localRoot||this._root).uuid],a.length===0&&delete o[r],this._removeInactiveBindingsForAction(i)}_removeInactiveBindingsForAction(i){const t=i._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const r=t[e];--r.referenceCount==0&&this._removeInactiveBinding(r)}}_lendAction(i){const t=this._actions,e=i._cacheIndex,n=this._nActiveActions++,r=t[n];i._cacheIndex=n,t[n]=i,r._cacheIndex=e,t[e]=r}_takeBackAction(i){const t=this._actions,e=i._cacheIndex,n=--this._nActiveActions,r=t[n];i._cacheIndex=n,t[n]=i,r._cacheIndex=e,t[e]=r}_addInactiveBinding(i,t,e){const n=this._bindingsByRootAndName,r=this._bindings;let o=n[t];o===void 0&&(o={},n[t]=o),o[e]=i,i._cacheIndex=r.length,r.push(i)}_removeInactiveBinding(i){const t=this._bindings,e=i.binding,n=e.rootNode.uuid,r=e.path,o=this._bindingsByRootAndName,s=o[n],a=t[t.length-1],h=i._cacheIndex;a._cacheIndex=h,t[h]=a,t.pop(),delete s[r],Object.keys(s).length===0&&delete o[n]}_lendBinding(i){const t=this._bindings,e=i._cacheIndex,n=this._nActiveBindings++,r=t[n];i._cacheIndex=n,t[n]=i,r._cacheIndex=e,t[e]=r}_takeBackBinding(i){const t=this._bindings,e=i._cacheIndex,n=--this._nActiveBindings,r=t[n];i._cacheIndex=n,t[n]=i,r._cacheIndex=e,t[e]=r}_lendControlInterpolant(){const i=this._controlInterpolants,t=this._nActiveControlInterpolants++;let e=i[t];return e===void 0&&(e=new kd(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),e.__cacheIndex=t,i[t]=e),e}_takeBackControlInterpolant(i){const t=this._controlInterpolants,e=i.__cacheIndex,n=--this._nActiveControlInterpolants,r=t[n];i.__cacheIndex=n,t[n]=i,r.__cacheIndex=e,t[e]=r}clipAction(i,t,e){const n=t||this._root,r=n.uuid;let o=typeof i=="string"?Hd.findByName(n,i):i;const s=o!==null?o.uuid:i,a=this._actionsByClip[s];let h=null;if(e===void 0&&(e=o!==null?o.blendMode:2500),a!==void 0){const u=a.actionByRoot[r];if(u!==void 0&&u.blendMode===e)return u;h=a.knownActions[0],o===null&&(o=h._clip)}if(o===null)return null;const l=new E_(this,o,t,e);return this._bindAction(l,h),this._addInactiveAction(l,s,r),l}existingAction(i,t){const e=t||this._root,n=e.uuid,r=typeof i=="string"?Hd.findByName(e,i):i,o=r?r.uuid:i,s=this._actionsByClip[o];return s!==void 0&&s.actionByRoot[n]||null}stopAllAction(){const i=this._actions;for(let t=this._nActiveActions-1;t>=0;--t)i[t].stop();return this}update(i){i*=this.timeScale;const t=this._actions,e=this._nActiveActions,n=this.time+=i,r=Math.sign(i),o=this._accuIndex^=1;for(let h=0;h!==e;++h)t[h]._update(n,i,r,o);const s=this._bindings,a=this._nActiveBindings;for(let h=0;h!==a;++h)s[h].apply(o);return this}setTime(i){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(i)}getRoot(){return this._root}uncacheClip(i){const t=this._actions,e=i.uuid,n=this._actionsByClip,r=n[e];if(r!==void 0){const o=r.knownActions;for(let s=0,a=o.length;s!==a;++s){const h=o[s];this._deactivateAction(h);const l=h._cacheIndex,u=t[t.length-1];h._cacheIndex=null,h._byClipCacheIndex=null,u._cacheIndex=l,t[l]=u,t.pop(),this._removeInactiveBindingsForAction(h)}delete n[e]}}uncacheRoot(i){const t=i.uuid,e=this._actionsByClip;for(const r in e){const o=e[r].actionByRoot[t];o!==void 0&&(this._deactivateAction(o),this._removeInactiveAction(o))}const n=this._bindingsByRootAndName[t];if(n!==void 0)for(const r in n){const o=n[r];o.restoreOriginalState(),this._removeInactiveBinding(o)}}uncacheAction(i,t){const e=this.existingAction(i,t);e!==null&&(this._deactivateAction(e),this._removeInactiveAction(e))}}).prototype._controlInterpolantsResultBuffer=new Float32Array(1),class extends oa{constructor(i,t,e=1){super(i,t),this.meshPerAttribute=e}copy(i){return super.copy(i),this.meshPerAttribute=i.meshPerAttribute,this}clone(i){const t=super.clone(i);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(i){const t=super.toJSON(i);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}.prototype.isInstancedInterleavedBuffer=!0,new R,new U,new U,class extends Un{constructor(i){super(),this.material=i,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}}.prototype.isImmediateRenderObject=!0;const No=new U,Rl=new tn,cu=new tn,S_=new Float32Array(1);new Int32Array(S_.buffer);const Zd=[.125,.215,.35,.446,.526,.582],w_=5+Zd.length,A_=new Zi({side:1,depthWrite:!1,depthTest:!1});new Tt(new ee,A_),M_();function M_(){const i=[],t=[],e=[];let n=8;for(let r=0;r<w_;r++){const o=Math.pow(2,n);t.push(o);let s=1/o;r>4?s=Zd[r-8+4-1]:r==0&&(s=0),e.push(s);const a=1/(o-1),h=-a/2,l=1+a/2,u=[h,h,l,h,l,l,h,h,l,l,h,l],p=6,y=6,x=3,E=2,A=1,C=new Float32Array(x*y*p),j=new Float32Array(E*y*p),Q=new Float32Array(A*y*p);for(let pt=0;pt<p;pt++){const it=pt%3*2/3-1,gt=pt>2?0:-1,ht=[it,gt,0,it+2/3,gt,0,it+2/3,gt+1,0,it,gt,0,it+2/3,gt+1,0,it,gt+1,0];C.set(ht,x*y*pt),j.set(u,E*y*pt);const mt=[pt,pt,pt,pt,pt,pt];Q.set(mt,A*y*pt)}const rt=new Wn;rt.setAttribute("position",new Yn(C,x)),rt.setAttribute("uv",new Yn(j,E)),rt.setAttribute("faceIndex",new Yn(Q,A)),i.push(rt),n>4&&n--}return{_lodPlanes:i,_sizeLods:t,_sigmas:e}}Ir.create=function(i,t){return console.log("THREE.Curve.create() has been deprecated"),i.prototype=Object.create(Ir.prototype),i.prototype.constructor=i,i.prototype.getPoint=t,i},Ps.prototype.fromPoints=function(i){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(i)},class extends Yh{constructor(i=10,t=10,e=4473924,n=8947848){e=new fn(e),n=new fn(n);const r=t/2,o=i/t,s=i/2,a=[],h=[];for(let u=0,p=0,y=-s;u<=t;u++,y+=o){a.push(-s,0,y,s,0,y),a.push(y,0,-s,y,0,s);const x=u===r?e:n;x.toArray(h,p),p+=3,x.toArray(h,p),p+=3,x.toArray(h,p),p+=3,x.toArray(h,p),p+=3}const l=new Wn;l.setAttribute("position",new An(a,3)),l.setAttribute("color",new An(h,3)),super(l,new ca({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}}.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},class extends Yh{constructor(i){const t=function a(h){const l=[];h&&h.isBone&&l.push(h);for(let u=0;u<h.children.length;u++)l.push.apply(l,a(h.children[u]));return l}(i),e=new Wn,n=[],r=[],o=new fn(0,0,1),s=new fn(0,1,0);for(let a=0;a<t.length;a++){const h=t[a];h.parent&&h.parent.isBone&&(n.push(0,0,0),n.push(0,0,0),r.push(o.r,o.g,o.b),r.push(s.r,s.g,s.b))}e.setAttribute("position",new An(n,3)),e.setAttribute("color",new An(r,3)),super(e,new ca({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.type="SkeletonHelper",this.isSkeletonHelper=!0,this.root=i,this.bones=t,this.matrix=i.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(i){const t=this.bones,e=this.geometry,n=e.getAttribute("position");cu.copy(this.root.matrixWorld).invert();for(let r=0,o=0;r<t.length;r++){const s=t[r];s.parent&&s.parent.isBone&&(Rl.multiplyMatrices(cu,s.matrixWorld),No.setFromMatrixPosition(Rl),n.setXYZ(o,No.x,No.y,No.z),Rl.multiplyMatrices(cu,s.parent.matrixWorld),No.setFromMatrixPosition(Rl),n.setXYZ(o+1,No.x,No.y,No.z),o+=2)}e.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(i)}}.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Oo.prototype.extractUrlBase=function(i){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),l_.extractUrlBase(i)},Oo.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},vt.prototype.center=function(i){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(i)},vt.prototype.empty=function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},vt.prototype.isIntersectionBox=function(i){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(i)},vt.prototype.isIntersectionSphere=function(i){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(i)},vt.prototype.size=function(i){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(i)},Ge.prototype.empty=function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()},Br.prototype.setFromMatrix=function(i){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(i)},B.prototype.flattenToArrayOffset=function(i,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(i,t)},B.prototype.multiplyVector3=function(i){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),i.applyMatrix3(this)},B.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},B.prototype.applyToBufferAttribute=function(i){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),i.applyMatrix3(this)},B.prototype.applyToVector3Array=function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},B.prototype.getInverse=function(i){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(i).invert()},tn.prototype.extractPosition=function(i){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(i)},tn.prototype.flattenToArrayOffset=function(i,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(i,t)},tn.prototype.getPosition=function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),new U().setFromMatrixColumn(this,3)},tn.prototype.setRotationFromQuaternion=function(i){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(i)},tn.prototype.multiplyToArray=function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},tn.prototype.multiplyVector3=function(i){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)},tn.prototype.multiplyVector4=function(i){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)},tn.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},tn.prototype.rotateAxis=function(i){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),i.transformDirection(this)},tn.prototype.crossVector=function(i){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)},tn.prototype.translate=function(){console.error("THREE.Matrix4: .translate() has been removed.")},tn.prototype.rotateX=function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},tn.prototype.rotateY=function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},tn.prototype.rotateZ=function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},tn.prototype.rotateByAxis=function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},tn.prototype.applyToBufferAttribute=function(i){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)},tn.prototype.applyToVector3Array=function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},tn.prototype.makeFrustum=function(i,t,e,n,r,o){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(i,t,n,e,r,o)},tn.prototype.getInverse=function(i){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(i).invert()},hi.prototype.isIntersectionLine=function(i){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(i)},V.prototype.multiplyVector3=function(i){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),i.applyQuaternion(this)},V.prototype.inverse=function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()},pi.prototype.isIntersectionBox=function(i){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(i)},pi.prototype.isIntersectionPlane=function(i){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(i)},pi.prototype.isIntersectionSphere=function(i){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(i)},ui.prototype.area=function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},ui.prototype.barycoordFromPoint=function(i,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(i,t)},ui.prototype.midpoint=function(i){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(i)},ui.prototypenormal=function(i){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(i)},ui.prototype.plane=function(i){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(i)},ui.barycoordFromPoint=function(i,t,e,n,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),ui.getBarycoord(i,t,e,n,r)},ui.normal=function(i,t,e,n){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),ui.getNormal(i,t,e,n)},ou.prototype.extractAllPoints=function(i){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(i)},ou.prototype.extrude=function(i){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Ms(this,i)},ou.prototype.makeGeometry=function(i){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new ru(this,i)},R.prototype.fromAttribute=function(i,t,e){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(i,t,e)},R.prototype.distanceToManhattan=function(i){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(i)},R.prototype.lengthManhattan=function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},U.prototype.setEulerFromRotationMatrix=function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},U.prototype.setEulerFromQuaternion=function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},U.prototype.getPositionFromMatrix=function(i){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(i)},U.prototype.getScaleFromMatrix=function(i){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(i)},U.prototype.getColumnFromMatrix=function(i,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,i)},U.prototype.applyProjection=function(i){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(i)},U.prototype.fromAttribute=function(i,t,e){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(i,t,e)},U.prototype.distanceToManhattan=function(i){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(i)},U.prototype.lengthManhattan=function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},Ot.prototype.fromAttribute=function(i,t,e){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(i,t,e)},Ot.prototype.lengthManhattan=function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},Un.prototype.getChildByName=function(i){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(i)},Un.prototype.renderDepth=function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},Un.prototype.translate=function(i,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,i)},Un.prototype.getWorldRotation=function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},Un.prototype.applyMatrix=function(i){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(i)},Object.defineProperties(Un.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(i){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=i}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Tt.prototype.setDrawMode=function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")},Object.defineProperties(Tt.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),pd.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},un.prototype.setLens=function(i,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),t!==void 0&&(this.filmGauge=t),this.setFocalLength(i)},Object.defineProperties(Xr.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(i){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=i}},shadowCameraLeft:{set:function(i){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=i}},shadowCameraRight:{set:function(i){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=i}},shadowCameraTop:{set:function(i){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=i}},shadowCameraBottom:{set:function(i){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=i}},shadowCameraNear:{set:function(i){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=i}},shadowCameraFar:{set:function(i){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=i}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(i){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=i}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(i){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=i}},shadowMapHeight:{set:function(i){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=i}}}),Object.defineProperties(Yn.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===35048},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(35048)}}}),Yn.prototype.setDynamic=function(i){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(i===!0?35048:35044),this},Yn.prototype.copyIndicesArray=function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},Yn.prototype.setArray=function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},Wn.prototype.addIndex=function(i){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(i)},Wn.prototype.addAttribute=function(i,t){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?i==="index"?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(i,t):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(i,new Yn(arguments[1],arguments[2])))},Wn.prototype.addDrawCall=function(i,t,e){e!==void 0&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(i,t)},Wn.prototype.clearDrawCalls=function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},Wn.prototype.computeOffsets=function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},Wn.prototype.removeAttribute=function(i){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(i)},Wn.prototype.applyMatrix=function(i){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(i)},Object.defineProperties(Wn.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),oa.prototype.setDynamic=function(i){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(i===!0?35048:35044),this},oa.prototype.setArray=function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},Ms.prototype.getArrays=function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},Ms.prototype.addShapeList=function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},Ms.prototype.addShape=function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")},zh.prototype.dispose=function(){console.error("THREE.Scene: .dispose() has been removed.")},Object.defineProperties(Ci.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new fn}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(i){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=i===1}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(i){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=i}}}),Object.defineProperties(hn.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(i){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=i}}}),ti.prototype.clearTarget=function(i,t,e,n){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(i),this.clear(t,e,n)},ti.prototype.animate=function(i){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(i)},ti.prototype.getCurrentRenderTarget=function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},ti.prototype.getMaxAnisotropy=function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},ti.prototype.getPrecision=function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},ti.prototype.resetGLState=function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},ti.prototype.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},ti.prototype.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},ti.prototype.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},ti.prototype.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},ti.prototype.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},ti.prototype.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},ti.prototype.supportsVertexTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},ti.prototype.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},ti.prototype.enableScissorTest=function(i){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(i)},ti.prototype.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},ti.prototype.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},ti.prototype.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},ti.prototype.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},ti.prototype.setFaceCulling=function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},ti.prototype.allocTextureUnit=function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},ti.prototype.setTexture=function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},ti.prototype.setTexture2D=function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},ti.prototype.setTextureCube=function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},ti.prototype.getActiveMipMapLevel=function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()},Object.defineProperties(ti.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(i){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=i}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(i){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=i}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(i){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=i===!0?3001:3e3}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}}}),Object.defineProperties(id.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(zt.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(i){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=i}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(i){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=i}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(i){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=i}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(i){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=i}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(i){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=i}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(i){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=i}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(i){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=i}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(i){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=i}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(i){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=i}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(i){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=i}}}),p_.prototype.load=function(i){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");const t=this;return new d_().load(i,function(e){t.setBuffer(e)}),this},Zn.prototype.updateCubeMap=function(i,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(i,t)},Zn.prototype.clear=function(i,t,e,n){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(i,t,e,n)},P.crossOrigin=void 0,P.loadTexture=function(i,t,e,n){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");const r=new t_;r.setCrossOrigin(this.crossOrigin);const o=r.load(i,e,void 0,n);return t&&(o.mapping=t),o},P.loadTextureCube=function(i,t,e,n){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");const r=new $0;r.setCrossOrigin(this.crossOrigin);const o=r.load(i,e,void 0,n);return t&&(o.mapping=t),o},P.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},P.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"130"}})),typeof window!="undefined"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="130");var C_=v(6),yi=v.n(C_),R_=v(33),I_=v.n(R_),P_=v(11),Gi=v.n(P_);class O_{constructor(){this.camera=new lu(10,10,10,10),this.camera.position.z=100,this.camera.position.x=0,this.camera.position.y=0}focus(t,e){t.position.z=50}updateAspect(t,e){this.camera.left=-1*t/2,this.camera.right=t/2,this.camera.top=e/2,this.camera.bottom=-1*e/2,this.camera.updateProjectionMatrix()}}const Qd={linear:(i,t,e,n)=>e*i/n+t,easeIn:(i,t,e,n)=>e*(i/=n)*i+t,strongEaseIn:(i,t,e,n)=>e*(i/=n)*i*i*i*i+t,strongEaseOut:(i,t,e,n)=>e*((i=i/n-1)*i*i*i*i+1)+t,sineaseIn:(i,t,e,n)=>e*(i/=n)*i*i+t,sineaseOut:(i,t,e,n)=>e*((i=i/n-1)*i*i+1)+t},_r=new tt;class Yi{constructor(){this.camera=new O_,this.mesh=new Tt,this.material=null,this.geometry=null}applyOptions(t){}addObjects(t){this.mesh.position.z=50,t.add(this.mesh)}setSize(t,e){this.camera.updateAspect(t,e),this.geometry=new Cr(t,e,1,1),this.material=new hn({fragmentShader:this.fragmentShader,vertexShader:`
|
|
6961
|
+
}`}),x=y.clone();x.defines.HORIZONTAL_PASS=1;const E=new Wn;E.setAttribute("position",new Yn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const A=new Tt(E,y),C=this;function j(gt,ht){const mt=t.update(A);y.uniforms.shadow_pass.value=gt.map.texture,y.uniforms.resolution.value=gt.mapSize,y.uniforms.radius.value=gt.radius,i.setRenderTarget(gt.mapPass),i.clear(),i.renderBufferDirect(ht,null,mt,y,A,null),x.uniforms.shadow_pass.value=gt.mapPass.texture,x.uniforms.resolution.value=gt.mapSize,x.uniforms.radius.value=gt.radius,i.setRenderTarget(gt.map),i.clear(),i.renderBufferDirect(ht,null,mt,x,A,null)}function Q(gt){const ht=gt<<0;let mt=a[ht];return mt===void 0&&(mt=new ed({depthPacking:3201,morphTargets:gt}),a[ht]=mt),mt}function rt(gt){const ht=gt<<0;let mt=h[ht];return mt===void 0&&(mt=new nd({morphTargets:gt}),h[ht]=mt),mt}function pt(gt,ht,mt,jt,Ft,Mt,wt){let Pt=null,Nt=Q,ne=gt.customDepthMaterial;if(jt.isPointLight===!0&&(Nt=rt,ne=gt.customDistanceMaterial),ne===void 0){let $t=!1;mt.morphTargets===!0&&($t=ht.morphAttributes&&ht.morphAttributes.position&&ht.morphAttributes.position.length>0),Pt=Nt($t)}else Pt=ne;if(i.localClippingEnabled&&mt.clipShadows===!0&&mt.clippingPlanes.length!==0){const $t=Pt.uuid,Vt=mt.uuid;let Yt=l[$t];Yt===void 0&&(Yt={},l[$t]=Yt);let ge=Yt[Vt];ge===void 0&&(ge=Pt.clone(),Yt[Vt]=ge),Pt=ge}return Pt.visible=mt.visible,Pt.wireframe=mt.wireframe,Pt.side=wt===3?mt.shadowSide!==null?mt.shadowSide:mt.side:mt.shadowSide!==null?mt.shadowSide:p[mt.side],Pt.clipShadows=mt.clipShadows,Pt.clippingPlanes=mt.clippingPlanes,Pt.clipIntersection=mt.clipIntersection,Pt.wireframeLinewidth=mt.wireframeLinewidth,Pt.linewidth=mt.linewidth,jt.isPointLight===!0&&Pt.isMeshDistanceMaterial===!0&&(Pt.referencePosition.setFromMatrixPosition(jt.matrixWorld),Pt.nearDistance=Ft,Pt.farDistance=Mt),Pt}function it(gt,ht,mt,jt,Ft){if(gt.visible===!1)return;if(gt.layers.test(ht.layers)&&(gt.isMesh||gt.isLine||gt.isPoints)&&(gt.castShadow||gt.receiveShadow&&Ft===3)&&(!gt.frustumCulled||n.intersectsObject(gt))){gt.modelViewMatrix.multiplyMatrices(mt.matrixWorldInverse,gt.matrixWorld);const wt=t.update(gt),Pt=gt.material;if(Array.isArray(Pt)){const Nt=wt.groups;for(let ne=0,$t=Nt.length;ne<$t;ne++){const Vt=Nt[ne],Yt=Pt[Vt.materialIndex];if(Yt&&Yt.visible){const ge=pt(gt,wt,Yt,jt,mt.near,mt.far,Ft);i.renderBufferDirect(mt,null,wt,ge,gt,Vt)}}}else if(Pt.visible){const Nt=pt(gt,wt,Pt,jt,mt.near,mt.far,Ft);i.renderBufferDirect(mt,null,wt,Nt,gt,null)}}const Mt=gt.children;for(let wt=0,Pt=Mt.length;wt<Pt;wt++)it(Mt[wt],ht,mt,jt,Ft)}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1,this.render=function(gt,ht,mt){if(C.enabled===!1||C.autoUpdate===!1&&C.needsUpdate===!1||gt.length===0)return;const jt=i.getRenderTarget(),Ft=i.getActiveCubeFace(),Mt=i.getActiveMipmapLevel(),wt=i.state;wt.setBlending(0),wt.buffers.color.setClear(1,1,1,1),wt.buffers.depth.setTest(!0),wt.setScissorTest(!1);for(let Pt=0,Nt=gt.length;Pt<Nt;Pt++){const ne=gt[Pt],$t=ne.shadow;if($t===void 0){console.warn("THREE.WebGLShadowMap:",ne,"has no shadow.");continue}if($t.autoUpdate===!1&&$t.needsUpdate===!1)continue;r.copy($t.mapSize);const Vt=$t.getFrameExtents();if(r.multiply(Vt),o.copy($t.mapSize),(r.x>u||r.y>u)&&(r.x>u&&(o.x=Math.floor(u/Vt.x),r.x=o.x*Vt.x,$t.mapSize.x=o.x),r.y>u&&(o.y=Math.floor(u/Vt.y),r.y=o.y*Vt.y,$t.mapSize.y=o.y)),$t.map===null&&!$t.isPointLightShadow&&this.type===3){const ge={minFilter:1006,magFilter:1006,format:1023};$t.map=new zt(r.x,r.y,ge),$t.map.texture.name=ne.name+".shadowMap",$t.mapPass=new zt(r.x,r.y,ge),$t.camera.updateProjectionMatrix()}if($t.map===null){const ge={minFilter:1003,magFilter:1003,format:1023};$t.map=new zt(r.x,r.y,ge),$t.map.texture.name=ne.name+".shadowMap",$t.camera.updateProjectionMatrix()}i.setRenderTarget($t.map),i.clear();const Yt=$t.getViewportCount();for(let ge=0;ge<Yt;ge++){const be=$t.getViewport(ge);s.set(o.x*be.x,o.y*be.y,o.x*be.z,o.y*be.w),wt.viewport(s),$t.updateMatrices(ne,ge),n=$t.getFrustum(),it(ht,mt,$t.camera,ne,this.type)}$t.isPointLightShadow||this.type!==3||j($t,mt),$t.needsUpdate=!1}C.needsUpdate=!1,i.setRenderTarget(jt,Ft,Mt)}}function f0(i,t,e){const n=e.isWebGL2,r=new function(){let bt=!1;const Ht=new Ot;let ie=null;const ae=new Ot(0,0,0,0);return{setMask:function(qt){ie===qt||bt||(i.colorMask(qt,qt,qt,qt),ie=qt)},setLocked:function(qt){bt=qt},setClear:function(qt,ye,nn,on,rn){rn===!0&&(qt*=on,ye*=on,nn*=on),Ht.set(qt,ye,nn,on),ae.equals(Ht)===!1&&(i.clearColor(qt,ye,nn,on),ae.copy(Ht))},reset:function(){bt=!1,ie=null,ae.set(-1,0,0,0)}}},o=new function(){let bt=!1,Ht=null,ie=null,ae=null;return{setTest:function(qt){qt?Pe(2929):Ct(2929)},setMask:function(qt){Ht===qt||bt||(i.depthMask(qt),Ht=qt)},setFunc:function(qt){if(ie!==qt){if(qt)switch(qt){case 0:i.depthFunc(512);break;case 1:i.depthFunc(519);break;case 2:i.depthFunc(513);break;case 3:i.depthFunc(515);break;case 4:i.depthFunc(514);break;case 5:i.depthFunc(518);break;case 6:i.depthFunc(516);break;case 7:i.depthFunc(517);break;default:i.depthFunc(515)}else i.depthFunc(515);ie=qt}},setLocked:function(qt){bt=qt},setClear:function(qt){ae!==qt&&(i.clearDepth(qt),ae=qt)},reset:function(){bt=!1,Ht=null,ie=null,ae=null}}},s=new function(){let bt=!1,Ht=null,ie=null,ae=null,qt=null,ye=null,nn=null,on=null,rn=null;return{setTest:function(Sn){bt||(Sn?Pe(2960):Ct(2960))},setMask:function(Sn){Ht===Sn||bt||(i.stencilMask(Sn),Ht=Sn)},setFunc:function(Sn,Ai,Jn){ie===Sn&&ae===Ai&&qt===Jn||(i.stencilFunc(Sn,Ai,Jn),ie=Sn,ae=Ai,qt=Jn)},setOp:function(Sn,Ai,Jn){ye===Sn&&nn===Ai&&on===Jn||(i.stencilOp(Sn,Ai,Jn),ye=Sn,nn=Ai,on=Jn)},setLocked:function(Sn){bt=Sn},setClear:function(Sn){rn!==Sn&&(i.clearStencil(Sn),rn=Sn)},reset:function(){bt=!1,Ht=null,ie=null,ae=null,qt=null,ye=null,nn=null,on=null,rn=null}}};let a={},h=null,l={},u=null,p=!1,y=null,x=null,E=null,A=null,C=null,j=null,Q=null,rt=!1,pt=null,it=null,gt=null,ht=null,mt=null;const jt=i.getParameter(35661);let Ft=!1,Mt=0;const wt=i.getParameter(7938);wt.indexOf("WebGL")!==-1?(Mt=parseFloat(/^WebGL (\d)/.exec(wt)[1]),Ft=Mt>=1):wt.indexOf("OpenGL ES")!==-1&&(Mt=parseFloat(/^OpenGL ES (\d)/.exec(wt)[1]),Ft=Mt>=2);let Pt=null,Nt={};const ne=i.getParameter(3088),$t=i.getParameter(2978),Vt=new Ot().fromArray(ne),Yt=new Ot().fromArray($t);function ge(bt,Ht,ie){const ae=new Uint8Array(4),qt=i.createTexture();i.bindTexture(bt,qt),i.texParameteri(bt,10241,9728),i.texParameteri(bt,10240,9728);for(let ye=0;ye<ie;ye++)i.texImage2D(Ht+ye,0,6408,1,1,0,6408,5121,ae);return qt}const be={};function Pe(bt){a[bt]!==!0&&(i.enable(bt),a[bt]=!0)}function Ct(bt){a[bt]!==!1&&(i.disable(bt),a[bt]=!1)}be[3553]=ge(3553,3553,1),be[34067]=ge(34067,34069,6),r.setClear(0,0,0,1),o.setClear(1),s.setClear(0),Pe(2929),o.setFunc(3),se(!1),Ie(1),Pe(2884),le(0);const Bt={100:32774,101:32778,102:32779};if(n)Bt[103]=32775,Bt[104]=32776;else{const bt=t.get("EXT_blend_minmax");bt!==null&&(Bt[103]=bt.MIN_EXT,Bt[104]=bt.MAX_EXT)}const ve={200:0,201:1,202:768,204:770,210:776,208:774,206:772,203:769,205:771,209:775,207:773};function le(bt,Ht,ie,ae,qt,ye,nn,on){if(bt!==0){if(p===!1&&(Pe(3042),p=!0),bt===5)qt=qt||Ht,ye=ye||ie,nn=nn||ae,Ht===x&&qt===C||(i.blendEquationSeparate(Bt[Ht],Bt[qt]),x=Ht,C=qt),ie===E&&ae===A&&ye===j&&nn===Q||(i.blendFuncSeparate(ve[ie],ve[ae],ve[ye],ve[nn]),E=ie,A=ae,j=ye,Q=nn),y=bt,rt=null;else if(bt!==y||on!==rt){if(x===100&&C===100||(i.blendEquation(32774),x=100,C=100),on)switch(bt){case 1:i.blendFuncSeparate(1,771,1,771);break;case 2:i.blendFunc(1,1);break;case 3:i.blendFuncSeparate(0,0,769,771);break;case 4:i.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",bt)}else switch(bt){case 1:i.blendFuncSeparate(770,771,1,771);break;case 2:i.blendFunc(770,1);break;case 3:i.blendFunc(0,769);break;case 4:i.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",bt)}E=null,A=null,j=null,Q=null,y=bt,rt=on}}else p===!0&&(Ct(3042),p=!1)}function se(bt){pt!==bt&&(bt?i.frontFace(2304):i.frontFace(2305),pt=bt)}function Ie(bt){bt!==0?(Pe(2884),bt!==it&&(bt===1?i.cullFace(1029):bt===2?i.cullFace(1028):i.cullFace(1032))):Ct(2884),it=bt}function Le(bt,Ht,ie){bt?(Pe(32823),ht===Ht&&mt===ie||(i.polygonOffset(Ht,ie),ht=Ht,mt=ie)):Ct(32823)}function ue(bt){bt===void 0&&(bt=33984+jt-1),Pt!==bt&&(i.activeTexture(bt),Pt=bt)}return{buffers:{color:r,depth:o,stencil:s},enable:Pe,disable:Ct,bindFramebuffer:function(bt,Ht){return Ht===null&&h!==null&&(Ht=h),l[bt]!==Ht&&(i.bindFramebuffer(bt,Ht),l[bt]=Ht,n&&(bt===36009&&(l[36160]=Ht),bt===36160&&(l[36009]=Ht)),!0)},bindXRFramebuffer:function(bt){bt!==h&&(i.bindFramebuffer(36160,bt),h=bt)},useProgram:function(bt){return u!==bt&&(i.useProgram(bt),u=bt,!0)},setBlending:le,setMaterial:function(bt,Ht){bt.side===2?Ct(2884):Pe(2884);let ie=bt.side===1;Ht&&(ie=!ie),se(ie),bt.blending===1&&bt.transparent===!1?le(0):le(bt.blending,bt.blendEquation,bt.blendSrc,bt.blendDst,bt.blendEquationAlpha,bt.blendSrcAlpha,bt.blendDstAlpha,bt.premultipliedAlpha),o.setFunc(bt.depthFunc),o.setTest(bt.depthTest),o.setMask(bt.depthWrite),r.setMask(bt.colorWrite);const ae=bt.stencilWrite;s.setTest(ae),ae&&(s.setMask(bt.stencilWriteMask),s.setFunc(bt.stencilFunc,bt.stencilRef,bt.stencilFuncMask),s.setOp(bt.stencilFail,bt.stencilZFail,bt.stencilZPass)),Le(bt.polygonOffset,bt.polygonOffsetFactor,bt.polygonOffsetUnits),bt.alphaToCoverage===!0?Pe(32926):Ct(32926)},setFlipSided:se,setCullFace:Ie,setLineWidth:function(bt){bt!==gt&&(Ft&&i.lineWidth(bt),gt=bt)},setPolygonOffset:Le,setScissorTest:function(bt){bt?Pe(3089):Ct(3089)},activeTexture:ue,bindTexture:function(bt,Ht){Pt===null&&ue();let ie=Nt[Pt];ie===void 0&&(ie={type:void 0,texture:void 0},Nt[Pt]=ie),ie.type===bt&&ie.texture===Ht||(i.bindTexture(bt,Ht||be[bt]),ie.type=bt,ie.texture=Ht)},unbindTexture:function(){const bt=Nt[Pt];bt!==void 0&&bt.type!==void 0&&(i.bindTexture(bt.type,null),bt.type=void 0,bt.texture=void 0)},compressedTexImage2D:function(){try{i.compressedTexImage2D.apply(i,arguments)}catch(bt){console.error("THREE.WebGLState:",bt)}},texImage2D:function(){try{i.texImage2D.apply(i,arguments)}catch(bt){console.error("THREE.WebGLState:",bt)}},texImage3D:function(){try{i.texImage3D.apply(i,arguments)}catch(bt){console.error("THREE.WebGLState:",bt)}},scissor:function(bt){Vt.equals(bt)===!1&&(i.scissor(bt.x,bt.y,bt.z,bt.w),Vt.copy(bt))},viewport:function(bt){Yt.equals(bt)===!1&&(i.viewport(bt.x,bt.y,bt.z,bt.w),Yt.copy(bt))},reset:function(){i.disable(3042),i.disable(2884),i.disable(2929),i.disable(32823),i.disable(3089),i.disable(2960),i.disable(32926),i.blendEquation(32774),i.blendFunc(1,0),i.blendFuncSeparate(1,0,1,0),i.colorMask(!0,!0,!0,!0),i.clearColor(0,0,0,0),i.depthMask(!0),i.depthFunc(513),i.clearDepth(1),i.stencilMask(4294967295),i.stencilFunc(519,0,4294967295),i.stencilOp(7680,7680,7680),i.clearStencil(0),i.cullFace(1029),i.frontFace(2305),i.polygonOffset(0,0),i.activeTexture(33984),i.bindFramebuffer(36160,null),n===!0&&(i.bindFramebuffer(36009,null),i.bindFramebuffer(36008,null)),i.useProgram(null),i.lineWidth(1),i.scissor(0,0,i.canvas.width,i.canvas.height),i.viewport(0,0,i.canvas.width,i.canvas.height),a={},Pt=null,Nt={},h=null,l={},u=null,p=!1,y=null,x=null,E=null,A=null,C=null,j=null,Q=null,rt=!1,pt=null,it=null,gt=null,ht=null,mt=null,Vt.set(0,0,i.canvas.width,i.canvas.height),Yt.set(0,0,i.canvas.width,i.canvas.height),r.reset(),o.reset(),s.reset()}}}function m0(i,t,e,n,r,o,s){const a=r.isWebGL2,h=r.maxTextures,l=r.maxCubemapSize,u=r.maxTextureSize,p=r.maxSamples,y=new WeakMap;let x,E=!1;try{E=typeof OffscreenCanvas!="undefined"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function A(Ct,Bt){return E?new OffscreenCanvas(Ct,Bt):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function C(Ct,Bt,ve,le){let se=1;if((Ct.width>le||Ct.height>le)&&(se=le/Math.max(Ct.width,Ct.height)),se<1||Bt===!0){if(typeof HTMLImageElement!="undefined"&&Ct instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&Ct instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&Ct instanceof ImageBitmap){const Ie=Bt?L:Math.floor,Le=Ie(se*Ct.width),ue=Ie(se*Ct.height);x===void 0&&(x=A(Le,ue));const bt=ve?A(Le,ue):x;return bt.width=Le,bt.height=ue,bt.getContext("2d").drawImage(Ct,0,0,Le,ue),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+Ct.width+"x"+Ct.height+") to ("+Le+"x"+ue+")."),bt}return"data"in Ct&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+Ct.width+"x"+Ct.height+")."),Ct}return Ct}function j(Ct){return At(Ct.width)&&At(Ct.height)}function Q(Ct,Bt){return Ct.generateMipmaps&&Bt&&Ct.minFilter!==1003&&Ct.minFilter!==1006}function rt(Ct,Bt,ve,le,se=1){i.generateMipmap(Ct),n.get(Bt).__maxMipLevel=Math.log2(Math.max(ve,le,se))}function pt(Ct,Bt,ve){if(a===!1)return Bt;if(Ct!==null){if(i[Ct]!==void 0)return i[Ct];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+Ct+"'")}let le=Bt;return Bt===6403&&(ve===5126&&(le=33326),ve===5131&&(le=33325),ve===5121&&(le=33321)),Bt===6407&&(ve===5126&&(le=34837),ve===5131&&(le=34843),ve===5121&&(le=32849)),Bt===6408&&(ve===5126&&(le=34836),ve===5131&&(le=34842),ve===5121&&(le=32856)),le!==33325&&le!==33326&&le!==34842&&le!==34836||t.get("EXT_color_buffer_float"),le}function it(Ct){return Ct===1003||Ct===1004||Ct===1005?9728:9729}function gt(Ct){const Bt=Ct.target;Bt.removeEventListener("dispose",gt),function(ve){const le=n.get(ve);le.__webglInit!==void 0&&(i.deleteTexture(le.__webglTexture),n.remove(ve))}(Bt),Bt.isVideoTexture&&y.delete(Bt),s.memory.textures--}function ht(Ct){const Bt=Ct.target;Bt.removeEventListener("dispose",ht),function(ve){const le=ve.texture,se=n.get(ve),Ie=n.get(le);if(!!ve){if(Ie.__webglTexture!==void 0&&(i.deleteTexture(Ie.__webglTexture),s.memory.textures--),ve.depthTexture&&ve.depthTexture.dispose(),ve.isWebGLCubeRenderTarget)for(let Le=0;Le<6;Le++)i.deleteFramebuffer(se.__webglFramebuffer[Le]),se.__webglDepthbuffer&&i.deleteRenderbuffer(se.__webglDepthbuffer[Le]);else i.deleteFramebuffer(se.__webglFramebuffer),se.__webglDepthbuffer&&i.deleteRenderbuffer(se.__webglDepthbuffer),se.__webglMultisampledFramebuffer&&i.deleteFramebuffer(se.__webglMultisampledFramebuffer),se.__webglColorRenderbuffer&&i.deleteRenderbuffer(se.__webglColorRenderbuffer),se.__webglDepthRenderbuffer&&i.deleteRenderbuffer(se.__webglDepthRenderbuffer);if(ve.isWebGLMultipleRenderTargets)for(let Le=0,ue=le.length;Le<ue;Le++){const bt=n.get(le[Le]);bt.__webglTexture&&(i.deleteTexture(bt.__webglTexture),s.memory.textures--),n.remove(le[Le])}n.remove(le),n.remove(ve)}}(Bt)}let mt=0;function jt(Ct,Bt){const ve=n.get(Ct);if(Ct.isVideoTexture&&function(le){const se=s.render.frame;y.get(le)!==se&&(y.set(le,se),le.update())}(Ct),Ct.version>0&&ve.__version!==Ct.version){const le=Ct.image;if(le===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(le.complete!==!1)return void ne(ve,Ct,Bt);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}e.activeTexture(33984+Bt),e.bindTexture(3553,ve.__webglTexture)}function Ft(Ct,Bt){const ve=n.get(Ct);Ct.version>0&&ve.__version!==Ct.version?function(le,se,Ie){if(se.image.length!==6)return;Nt(le,se),e.activeTexture(33984+Ie),e.bindTexture(34067,le.__webglTexture),i.pixelStorei(37440,se.flipY),i.pixelStorei(37441,se.premultiplyAlpha),i.pixelStorei(3317,se.unpackAlignment),i.pixelStorei(37443,0);const Le=se&&(se.isCompressedTexture||se.image[0].isCompressedTexture),ue=se.image[0]&&se.image[0].isDataTexture,bt=[];for(let on=0;on<6;on++)bt[on]=Le||ue?ue?se.image[on].image:se.image[on]:C(se.image[on],!1,!0,l);const Ht=bt[0],ie=j(Ht)||a,ae=o.convert(se.format),qt=o.convert(se.type),ye=pt(se.internalFormat,ae,qt);let nn;if(Pt(34067,se,ie),Le){for(let on=0;on<6;on++){nn=bt[on].mipmaps;for(let rn=0;rn<nn.length;rn++){const Sn=nn[rn];se.format!==1023&&se.format!==1022?ae!==null?e.compressedTexImage2D(34069+on,rn,ye,Sn.width,Sn.height,0,Sn.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):e.texImage2D(34069+on,rn,ye,Sn.width,Sn.height,0,ae,qt,Sn.data)}}le.__maxMipLevel=nn.length-1}else{nn=se.mipmaps;for(let on=0;on<6;on++)if(ue){e.texImage2D(34069+on,0,ye,bt[on].width,bt[on].height,0,ae,qt,bt[on].data);for(let rn=0;rn<nn.length;rn++){const Sn=nn[rn].image[on].image;e.texImage2D(34069+on,rn+1,ye,Sn.width,Sn.height,0,ae,qt,Sn.data)}}else{e.texImage2D(34069+on,0,ye,ae,qt,bt[on]);for(let rn=0;rn<nn.length;rn++){const Sn=nn[rn];e.texImage2D(34069+on,rn+1,ye,ae,qt,Sn.image[on])}}le.__maxMipLevel=nn.length}Q(se,ie)&&rt(34067,se,Ht.width,Ht.height),le.__version=se.version,se.onUpdate&&se.onUpdate(se)}(ve,Ct,Bt):(e.activeTexture(33984+Bt),e.bindTexture(34067,ve.__webglTexture))}const Mt={1e3:10497,1001:33071,1002:33648},wt={1003:9728,1004:9984,1005:9986,1006:9729,1007:9985,1008:9987};function Pt(Ct,Bt,ve){if(ve?(i.texParameteri(Ct,10242,Mt[Bt.wrapS]),i.texParameteri(Ct,10243,Mt[Bt.wrapT]),Ct!==32879&&Ct!==35866||i.texParameteri(Ct,32882,Mt[Bt.wrapR]),i.texParameteri(Ct,10240,wt[Bt.magFilter]),i.texParameteri(Ct,10241,wt[Bt.minFilter])):(i.texParameteri(Ct,10242,33071),i.texParameteri(Ct,10243,33071),Ct!==32879&&Ct!==35866||i.texParameteri(Ct,32882,33071),Bt.wrapS===1001&&Bt.wrapT===1001||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),i.texParameteri(Ct,10240,it(Bt.magFilter)),i.texParameteri(Ct,10241,it(Bt.minFilter)),Bt.minFilter!==1003&&Bt.minFilter!==1006&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),t.has("EXT_texture_filter_anisotropic")===!0){const le=t.get("EXT_texture_filter_anisotropic");if(Bt.type===1015&&t.has("OES_texture_float_linear")===!1||a===!1&&Bt.type===1016&&t.has("OES_texture_half_float_linear")===!1)return;(Bt.anisotropy>1||n.get(Bt).__currentAnisotropy)&&(i.texParameterf(Ct,le.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(Bt.anisotropy,r.getMaxAnisotropy())),n.get(Bt).__currentAnisotropy=Bt.anisotropy)}}function Nt(Ct,Bt){Ct.__webglInit===void 0&&(Ct.__webglInit=!0,Bt.addEventListener("dispose",gt),Ct.__webglTexture=i.createTexture(),s.memory.textures++)}function ne(Ct,Bt,ve){let le=3553;Bt.isDataTexture2DArray&&(le=35866),Bt.isDataTexture3D&&(le=32879),Nt(Ct,Bt),e.activeTexture(33984+ve),e.bindTexture(le,Ct.__webglTexture),i.pixelStorei(37440,Bt.flipY),i.pixelStorei(37441,Bt.premultiplyAlpha),i.pixelStorei(3317,Bt.unpackAlignment),i.pixelStorei(37443,0);const se=function(qt){return!a&&(qt.wrapS!==1001||qt.wrapT!==1001||qt.minFilter!==1003&&qt.minFilter!==1006)}(Bt)&&j(Bt.image)===!1,Ie=C(Bt.image,se,!1,u),Le=j(Ie)||a,ue=o.convert(Bt.format);let bt,Ht=o.convert(Bt.type),ie=pt(Bt.internalFormat,ue,Ht);Pt(le,Bt,Le);const ae=Bt.mipmaps;if(Bt.isDepthTexture)ie=6402,a?ie=Bt.type===1015?36012:Bt.type===1014?33190:Bt.type===1020?35056:33189:Bt.type===1015&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),Bt.format===1026&&ie===6402&&Bt.type!==1012&&Bt.type!==1014&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),Bt.type=1012,Ht=o.convert(Bt.type)),Bt.format===1027&&ie===6402&&(ie=34041,Bt.type!==1020&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),Bt.type=1020,Ht=o.convert(Bt.type))),e.texImage2D(3553,0,ie,Ie.width,Ie.height,0,ue,Ht,null);else if(Bt.isDataTexture)if(ae.length>0&&Le){for(let qt=0,ye=ae.length;qt<ye;qt++)bt=ae[qt],e.texImage2D(3553,qt,ie,bt.width,bt.height,0,ue,Ht,bt.data);Bt.generateMipmaps=!1,Ct.__maxMipLevel=ae.length-1}else e.texImage2D(3553,0,ie,Ie.width,Ie.height,0,ue,Ht,Ie.data),Ct.__maxMipLevel=0;else if(Bt.isCompressedTexture){for(let qt=0,ye=ae.length;qt<ye;qt++)bt=ae[qt],Bt.format!==1023&&Bt.format!==1022?ue!==null?e.compressedTexImage2D(3553,qt,ie,bt.width,bt.height,0,bt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):e.texImage2D(3553,qt,ie,bt.width,bt.height,0,ue,Ht,bt.data);Ct.__maxMipLevel=ae.length-1}else if(Bt.isDataTexture2DArray)e.texImage3D(35866,0,ie,Ie.width,Ie.height,Ie.depth,0,ue,Ht,Ie.data),Ct.__maxMipLevel=0;else if(Bt.isDataTexture3D)e.texImage3D(32879,0,ie,Ie.width,Ie.height,Ie.depth,0,ue,Ht,Ie.data),Ct.__maxMipLevel=0;else if(ae.length>0&&Le){for(let qt=0,ye=ae.length;qt<ye;qt++)bt=ae[qt],e.texImage2D(3553,qt,ie,ue,Ht,bt);Bt.generateMipmaps=!1,Ct.__maxMipLevel=ae.length-1}else e.texImage2D(3553,0,ie,ue,Ht,Ie),Ct.__maxMipLevel=0;Q(Bt,Le)&&rt(le,Bt,Ie.width,Ie.height),Ct.__version=Bt.version,Bt.onUpdate&&Bt.onUpdate(Bt)}function $t(Ct,Bt,ve,le,se){const Ie=o.convert(ve.format),Le=o.convert(ve.type),ue=pt(ve.internalFormat,Ie,Le);se===32879||se===35866?e.texImage3D(se,0,ue,Bt.width,Bt.height,Bt.depth,0,Ie,Le,null):e.texImage2D(se,0,ue,Bt.width,Bt.height,0,Ie,Le,null),e.bindFramebuffer(36160,Ct),i.framebufferTexture2D(36160,le,se,n.get(ve).__webglTexture,0),e.bindFramebuffer(36160,null)}function Vt(Ct,Bt,ve){if(i.bindRenderbuffer(36161,Ct),Bt.depthBuffer&&!Bt.stencilBuffer){let le=33189;if(ve){const se=Bt.depthTexture;se&&se.isDepthTexture&&(se.type===1015?le=36012:se.type===1014&&(le=33190));const Ie=ge(Bt);i.renderbufferStorageMultisample(36161,Ie,le,Bt.width,Bt.height)}else i.renderbufferStorage(36161,le,Bt.width,Bt.height);i.framebufferRenderbuffer(36160,36096,36161,Ct)}else if(Bt.depthBuffer&&Bt.stencilBuffer){if(ve){const le=ge(Bt);i.renderbufferStorageMultisample(36161,le,35056,Bt.width,Bt.height)}else i.renderbufferStorage(36161,34041,Bt.width,Bt.height);i.framebufferRenderbuffer(36160,33306,36161,Ct)}else{const le=Bt.isWebGLMultipleRenderTargets===!0?Bt.texture[0]:Bt.texture,se=o.convert(le.format),Ie=o.convert(le.type),Le=pt(le.internalFormat,se,Ie);if(ve){const ue=ge(Bt);i.renderbufferStorageMultisample(36161,ue,Le,Bt.width,Bt.height)}else i.renderbufferStorage(36161,Le,Bt.width,Bt.height)}i.bindRenderbuffer(36161,null)}function Yt(Ct){const Bt=n.get(Ct),ve=Ct.isWebGLCubeRenderTarget===!0;if(Ct.depthTexture){if(ve)throw new Error("target.depthTexture not supported in Cube render targets");(function(le,se){if(se&&se.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(36160,le),!se.depthTexture||!se.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");n.get(se.depthTexture).__webglTexture&&se.depthTexture.image.width===se.width&&se.depthTexture.image.height===se.height||(se.depthTexture.image.width=se.width,se.depthTexture.image.height=se.height,se.depthTexture.needsUpdate=!0),jt(se.depthTexture,0);const Ie=n.get(se.depthTexture).__webglTexture;if(se.depthTexture.format===1026)i.framebufferTexture2D(36160,36096,3553,Ie,0);else{if(se.depthTexture.format!==1027)throw new Error("Unknown depthTexture format");i.framebufferTexture2D(36160,33306,3553,Ie,0)}})(Bt.__webglFramebuffer,Ct)}else if(ve){Bt.__webglDepthbuffer=[];for(let le=0;le<6;le++)e.bindFramebuffer(36160,Bt.__webglFramebuffer[le]),Bt.__webglDepthbuffer[le]=i.createRenderbuffer(),Vt(Bt.__webglDepthbuffer[le],Ct,!1)}else e.bindFramebuffer(36160,Bt.__webglFramebuffer),Bt.__webglDepthbuffer=i.createRenderbuffer(),Vt(Bt.__webglDepthbuffer,Ct,!1);e.bindFramebuffer(36160,null)}function ge(Ct){return a&&Ct.isWebGLMultisampleRenderTarget?Math.min(p,Ct.samples):0}let be=!1,Pe=!1;this.allocateTextureUnit=function(){const Ct=mt;return Ct>=h&&console.warn("THREE.WebGLTextures: Trying to use "+Ct+" texture units while this GPU supports only "+h),mt+=1,Ct},this.resetTextureUnits=function(){mt=0},this.setTexture2D=jt,this.setTexture2DArray=function(Ct,Bt){const ve=n.get(Ct);Ct.version>0&&ve.__version!==Ct.version?ne(ve,Ct,Bt):(e.activeTexture(33984+Bt),e.bindTexture(35866,ve.__webglTexture))},this.setTexture3D=function(Ct,Bt){const ve=n.get(Ct);Ct.version>0&&ve.__version!==Ct.version?ne(ve,Ct,Bt):(e.activeTexture(33984+Bt),e.bindTexture(32879,ve.__webglTexture))},this.setTextureCube=Ft,this.setupRenderTarget=function(Ct){const Bt=Ct.texture,ve=n.get(Ct),le=n.get(Bt);Ct.addEventListener("dispose",ht),Ct.isWebGLMultipleRenderTargets!==!0&&(le.__webglTexture=i.createTexture(),le.__version=Bt.version,s.memory.textures++);const se=Ct.isWebGLCubeRenderTarget===!0,Ie=Ct.isWebGLMultipleRenderTargets===!0,Le=Ct.isWebGLMultisampleRenderTarget===!0,ue=Bt.isDataTexture3D||Bt.isDataTexture2DArray,bt=j(Ct)||a;if(!a||Bt.format!==1022||Bt.type!==1015&&Bt.type!==1016||(Bt.format=1023,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),se){ve.__webglFramebuffer=[];for(let Ht=0;Ht<6;Ht++)ve.__webglFramebuffer[Ht]=i.createFramebuffer()}else if(ve.__webglFramebuffer=i.createFramebuffer(),Ie)if(r.drawBuffers){const Ht=Ct.texture;for(let ie=0,ae=Ht.length;ie<ae;ie++){const qt=n.get(Ht[ie]);qt.__webglTexture===void 0&&(qt.__webglTexture=i.createTexture(),s.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(Le)if(a){ve.__webglMultisampledFramebuffer=i.createFramebuffer(),ve.__webglColorRenderbuffer=i.createRenderbuffer(),i.bindRenderbuffer(36161,ve.__webglColorRenderbuffer);const Ht=o.convert(Bt.format),ie=o.convert(Bt.type),ae=pt(Bt.internalFormat,Ht,ie),qt=ge(Ct);i.renderbufferStorageMultisample(36161,qt,ae,Ct.width,Ct.height),e.bindFramebuffer(36160,ve.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(36160,36064,36161,ve.__webglColorRenderbuffer),i.bindRenderbuffer(36161,null),Ct.depthBuffer&&(ve.__webglDepthRenderbuffer=i.createRenderbuffer(),Vt(ve.__webglDepthRenderbuffer,Ct,!0)),e.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(se){e.bindTexture(34067,le.__webglTexture),Pt(34067,Bt,bt);for(let Ht=0;Ht<6;Ht++)$t(ve.__webglFramebuffer[Ht],Ct,Bt,36064,34069+Ht);Q(Bt,bt)&&rt(34067,Bt,Ct.width,Ct.height),e.bindTexture(34067,null)}else if(Ie){const Ht=Ct.texture;for(let ie=0,ae=Ht.length;ie<ae;ie++){const qt=Ht[ie],ye=n.get(qt);e.bindTexture(3553,ye.__webglTexture),Pt(3553,qt,bt),$t(ve.__webglFramebuffer,Ct,qt,36064+ie,3553),Q(qt,bt)&&rt(3553,qt,Ct.width,Ct.height)}e.bindTexture(3553,null)}else{let Ht=3553;ue&&(a?Ht=Bt.isDataTexture3D?32879:35866:console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.")),e.bindTexture(Ht,le.__webglTexture),Pt(Ht,Bt,bt),$t(ve.__webglFramebuffer,Ct,Bt,36064,Ht),Q(Bt,bt)&&rt(Ht,Bt,Ct.width,Ct.height,Ct.depth),e.bindTexture(Ht,null)}Ct.depthBuffer&&Yt(Ct)},this.updateRenderTargetMipmap=function(Ct){const Bt=j(Ct)||a,ve=Ct.isWebGLMultipleRenderTargets===!0?Ct.texture:[Ct.texture];for(let le=0,se=ve.length;le<se;le++){const Ie=ve[le];if(Q(Ie,Bt)){const Le=Ct.isWebGLCubeRenderTarget?34067:3553,ue=n.get(Ie).__webglTexture;e.bindTexture(Le,ue),rt(Le,Ie,Ct.width,Ct.height),e.bindTexture(Le,null)}}},this.updateMultisampleRenderTarget=function(Ct){if(Ct.isWebGLMultisampleRenderTarget)if(a){const Bt=Ct.width,ve=Ct.height;let le=16384;Ct.depthBuffer&&(le|=256),Ct.stencilBuffer&&(le|=1024);const se=n.get(Ct);e.bindFramebuffer(36008,se.__webglMultisampledFramebuffer),e.bindFramebuffer(36009,se.__webglFramebuffer),i.blitFramebuffer(0,0,Bt,ve,0,0,Bt,ve,le,9728),e.bindFramebuffer(36008,null),e.bindFramebuffer(36009,se.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(Ct,Bt){Ct&&Ct.isWebGLRenderTarget&&(be===!1&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),be=!0),Ct=Ct.texture),jt(Ct,Bt)},this.safeSetTextureCube=function(Ct,Bt){Ct&&Ct.isWebGLCubeRenderTarget&&(Pe===!1&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),Pe=!0),Ct=Ct.texture),Ft(Ct,Bt)}}function g0(i,t,e){const n=e.isWebGL2;return{convert:function(r){let o;if(r===1009)return 5121;if(r===1017)return 32819;if(r===1018)return 32820;if(r===1019)return 33635;if(r===1010)return 5120;if(r===1011)return 5122;if(r===1012)return 5123;if(r===1013)return 5124;if(r===1014)return 5125;if(r===1015)return 5126;if(r===1016)return n?5131:(o=t.get("OES_texture_half_float"),o!==null?o.HALF_FLOAT_OES:null);if(r===1021)return 6406;if(r===1022)return 6407;if(r===1023)return 6408;if(r===1024)return 6409;if(r===1025)return 6410;if(r===1026)return 6402;if(r===1027)return 34041;if(r===1028)return 6403;if(r===1029)return 36244;if(r===1030)return 33319;if(r===1031)return 33320;if(r===1032)return 36248;if(r===1033)return 36249;if(r===33776||r===33777||r===33778||r===33779){if(o=t.get("WEBGL_compressed_texture_s3tc"),o===null)return null;if(r===33776)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===33777)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===33778)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===33779)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(r===35840||r===35841||r===35842||r===35843){if(o=t.get("WEBGL_compressed_texture_pvrtc"),o===null)return null;if(r===35840)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===35841)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===35842)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===35843)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(r===36196)return o=t.get("WEBGL_compressed_texture_etc1"),o!==null?o.COMPRESSED_RGB_ETC1_WEBGL:null;if((r===37492||r===37496)&&(o=t.get("WEBGL_compressed_texture_etc"),o!==null)){if(r===37492)return o.COMPRESSED_RGB8_ETC2;if(r===37496)return o.COMPRESSED_RGBA8_ETC2_EAC}return r===37808||r===37809||r===37810||r===37811||r===37812||r===37813||r===37814||r===37815||r===37816||r===37817||r===37818||r===37819||r===37820||r===37821||r===37840||r===37841||r===37842||r===37843||r===37844||r===37845||r===37846||r===37847||r===37848||r===37849||r===37850||r===37851||r===37852||r===37853?(o=t.get("WEBGL_compressed_texture_astc"),o!==null?r:null):r===36492?(o=t.get("EXT_texture_compression_bptc"),o!==null?r:null):r===1020?n?34042:(o=t.get("WEBGL_depth_texture"),o!==null?o.UNSIGNED_INT_24_8_WEBGL:null):void 0}}}class rd extends un{constructor(t=[]){super(),this.cameras=t}}rd.prototype.isArrayCamera=!0;class bs extends Un{constructor(){super(),this.type="Group"}}bs.prototype.isGroup=!0;const v0={type:"move"};class jh{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new bs,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new bs,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new U,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new U),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new bs,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new U,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new U),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,e,n){let r=null,o=null,s=null;const a=this._targetRay,h=this._grip,l=this._hand;if(t&&e.session.visibilityState!=="visible-blurred")if(a!==null&&(r=e.getPose(t.targetRaySpace,n),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(v0))),l&&t.hand){s=!0;for(const A of t.hand.values()){const C=e.getJointPose(A,n);if(l.joints[A.jointName]===void 0){const Q=new bs;Q.matrixAutoUpdate=!1,Q.visible=!1,l.joints[A.jointName]=Q,l.add(Q)}const j=l.joints[A.jointName];C!==null&&(j.matrix.fromArray(C.transform.matrix),j.matrix.decompose(j.position,j.rotation,j.scale),j.jointRadius=C.radius),j.visible=C!==null}const u=l.joints["index-finger-tip"],p=l.joints["thumb-tip"],y=u.position.distanceTo(p.position),x=.02,E=.005;l.inputState.pinching&&y>x+E?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&y<=x-E&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else h!==null&&t.gripSpace&&(o=e.getPose(t.gripSpace,n),o!==null&&(h.matrix.fromArray(o.transform.matrix),h.matrix.decompose(h.position,h.rotation,h.scale),o.linearVelocity?(h.hasLinearVelocity=!0,h.linearVelocity.copy(o.linearVelocity)):h.hasLinearVelocity=!1,o.angularVelocity?(h.hasAngularVelocity=!0,h.angularVelocity.copy(o.angularVelocity)):h.hasAngularVelocity=!1));return a!==null&&(a.visible=r!==null),h!==null&&(h.visible=o!==null),l!==null&&(l.visible=s!==null),this}}class _0 extends D{constructor(t,e){super();const n=this,r=t.state;let o=null,s=1,a=null,h="local-floor",l=null,u=null,p=null,y=null;const x=[],E=new Map,A=new un;A.layers.enable(1),A.viewport=new Ot;const C=new un;C.layers.enable(2),C.viewport=new Ot;const j=[A,C],Q=new rd;Q.layers.enable(1),Q.layers.enable(2);let rt=null,pt=null;function it(Pt){const Nt=E.get(Pt.inputSource);Nt&&Nt.dispatchEvent({type:Pt.type,data:Pt.inputSource})}function gt(){E.forEach(function(Pt,Nt){Pt.disconnect(Nt)}),E.clear(),rt=null,pt=null,r.bindXRFramebuffer(null),t.setRenderTarget(t.getRenderTarget()),wt.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function ht(Pt){const Nt=o.inputSources;for(let ne=0;ne<x.length;ne++)E.set(Nt[ne],x[ne]);for(let ne=0;ne<Pt.removed.length;ne++){const $t=Pt.removed[ne],Vt=E.get($t);Vt&&(Vt.dispatchEvent({type:"disconnected",data:$t}),E.delete($t))}for(let ne=0;ne<Pt.added.length;ne++){const $t=Pt.added[ne],Vt=E.get($t);Vt&&Vt.dispatchEvent({type:"connected",data:$t})}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Pt){let Nt=x[Pt];return Nt===void 0&&(Nt=new jh,x[Pt]=Nt),Nt.getTargetRaySpace()},this.getControllerGrip=function(Pt){let Nt=x[Pt];return Nt===void 0&&(Nt=new jh,x[Pt]=Nt),Nt.getGripSpace()},this.getHand=function(Pt){let Nt=x[Pt];return Nt===void 0&&(Nt=new jh,x[Pt]=Nt),Nt.getHandSpace()},this.setFramebufferScaleFactor=function(Pt){s=Pt,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(Pt){h=Pt,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return a},this.getSession=function(){return o},this.setSession=async function(Pt){if(o=Pt,o!==null){o.addEventListener("select",it),o.addEventListener("selectstart",it),o.addEventListener("selectend",it),o.addEventListener("squeeze",it),o.addEventListener("squeezestart",it),o.addEventListener("squeezeend",it),o.addEventListener("end",gt),o.addEventListener("inputsourceschange",ht);const Nt=e.getContextAttributes();if(Nt.xrCompatible!==!0&&await e.makeXRCompatible(),o.renderState.layers===void 0){const ne={antialias:Nt.antialias,alpha:Nt.alpha,depth:Nt.depth,stencil:Nt.stencil,framebufferScaleFactor:s},$t=new XRWebGLLayer(o,e,ne);o.updateRenderState({baseLayer:$t})}else{let ne=0;Nt.depth&&(ne=Nt.stencil?34041:6402);const $t={colorFormat:Nt.alpha?6408:6407,depthFormat:ne,scaleFactor:s};u=new XRWebGLBinding(o,e),y=u.createProjectionLayer($t),p=e.createFramebuffer(),o.updateRenderState({layers:[y]})}a=await o.requestReferenceSpace(h),wt.setContext(o),wt.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};const mt=new U,jt=new U;function Ft(Pt,Nt){Nt===null?Pt.matrixWorld.copy(Pt.matrix):Pt.matrixWorld.multiplyMatrices(Nt.matrixWorld,Pt.matrix),Pt.matrixWorldInverse.copy(Pt.matrixWorld).invert()}this.updateCamera=function(Pt){if(o===null)return;Q.near=C.near=A.near=Pt.near,Q.far=C.far=A.far=Pt.far,rt===Q.near&&pt===Q.far||(o.updateRenderState({depthNear:Q.near,depthFar:Q.far}),rt=Q.near,pt=Q.far);const Nt=Pt.parent,ne=Q.cameras;Ft(Q,Nt);for(let Vt=0;Vt<ne.length;Vt++)Ft(ne[Vt],Nt);Q.matrixWorld.decompose(Q.position,Q.quaternion,Q.scale),Pt.position.copy(Q.position),Pt.quaternion.copy(Q.quaternion),Pt.scale.copy(Q.scale),Pt.matrix.copy(Q.matrix),Pt.matrixWorld.copy(Q.matrixWorld);const $t=Pt.children;for(let Vt=0,Yt=$t.length;Vt<Yt;Vt++)$t[Vt].updateMatrixWorld(!0);ne.length===2?function(Vt,Yt,ge){mt.setFromMatrixPosition(Yt.matrixWorld),jt.setFromMatrixPosition(ge.matrixWorld);const be=mt.distanceTo(jt),Pe=Yt.projectionMatrix.elements,Ct=ge.projectionMatrix.elements,Bt=Pe[14]/(Pe[10]-1),ve=Pe[14]/(Pe[10]+1),le=(Pe[9]+1)/Pe[5],se=(Pe[9]-1)/Pe[5],Ie=(Pe[8]-1)/Pe[0],Le=(Ct[8]+1)/Ct[0],ue=Bt*Ie,bt=Bt*Le,Ht=be/(-Ie+Le),ie=Ht*-Ie;Yt.matrixWorld.decompose(Vt.position,Vt.quaternion,Vt.scale),Vt.translateX(ie),Vt.translateZ(Ht),Vt.matrixWorld.compose(Vt.position,Vt.quaternion,Vt.scale),Vt.matrixWorldInverse.copy(Vt.matrixWorld).invert();const ae=Bt+Ht,qt=ve+Ht,ye=ue-ie,nn=bt+(be-ie),on=le*ve/qt*ae,rn=se*ve/qt*ae;Vt.projectionMatrix.makePerspective(ye,nn,on,rn,ae,qt)}(Q,A,C):Q.projectionMatrix.copy(A.projectionMatrix)},this.getCamera=function(){return Q};let Mt=null;const wt=new $o;wt.setAnimationLoop(function(Pt,Nt){if(l=Nt.getViewerPose(a),l!==null){const $t=l.views,Vt=o.renderState.baseLayer;o.renderState.layers===void 0&&r.bindXRFramebuffer(Vt.framebuffer);let Yt=!1;$t.length!==Q.cameras.length&&(Q.cameras.length=0,Yt=!0);for(let ge=0;ge<$t.length;ge++){const be=$t[ge];let Pe=null;if(o.renderState.layers===void 0)Pe=Vt.getViewport(be);else{const Bt=u.getViewSubImage(y,be);r.bindXRFramebuffer(p),e.framebufferTexture2D(36160,36064,3553,Bt.colorTexture,0),Bt.depthStencilTexture!==void 0&&e.framebufferTexture2D(36160,36096,3553,Bt.depthStencilTexture,0),Pe=Bt.viewport}const Ct=j[ge];Ct.matrix.fromArray(be.transform.matrix),Ct.projectionMatrix.fromArray(be.projectionMatrix),Ct.viewport.set(Pe.x,Pe.y,Pe.width,Pe.height),ge===0&&Q.matrix.copy(Ct.matrix),Yt===!0&&Q.cameras.push(Ct)}}const ne=o.inputSources;for(let $t=0;$t<x.length;$t++){const Vt=x[$t],Yt=ne[$t];Vt.update(Yt,Nt,a)}Mt&&Mt(Pt,Nt)}),this.setAnimationLoop=function(Pt){Mt=Pt},this.dispose=function(){}}}function y0(i){function t(n,r){n.opacity.value=r.opacity,r.color&&n.diffuse.value.copy(r.color),r.emissive&&n.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity),r.map&&(n.map.value=r.map),r.alphaMap&&(n.alphaMap.value=r.alphaMap),r.specularMap&&(n.specularMap.value=r.specularMap);const o=i.get(r).envMap;if(o){n.envMap.value=o,n.flipEnvMap.value=o.isCubeTexture&&o._needsFlipEnvMap?-1:1,n.reflectivity.value=r.reflectivity,n.refractionRatio.value=r.refractionRatio;const h=i.get(o).__maxMipLevel;h!==void 0&&(n.maxMipLevel.value=h)}let s,a;r.lightMap&&(n.lightMap.value=r.lightMap,n.lightMapIntensity.value=r.lightMapIntensity),r.aoMap&&(n.aoMap.value=r.aoMap,n.aoMapIntensity.value=r.aoMapIntensity),r.map?s=r.map:r.specularMap?s=r.specularMap:r.displacementMap?s=r.displacementMap:r.normalMap?s=r.normalMap:r.bumpMap?s=r.bumpMap:r.roughnessMap?s=r.roughnessMap:r.metalnessMap?s=r.metalnessMap:r.alphaMap?s=r.alphaMap:r.emissiveMap?s=r.emissiveMap:r.clearcoatMap?s=r.clearcoatMap:r.clearcoatNormalMap?s=r.clearcoatNormalMap:r.clearcoatRoughnessMap&&(s=r.clearcoatRoughnessMap),s!==void 0&&(s.isWebGLRenderTarget&&(s=s.texture),s.matrixAutoUpdate===!0&&s.updateMatrix(),n.uvTransform.value.copy(s.matrix)),r.aoMap?a=r.aoMap:r.lightMap&&(a=r.lightMap),a!==void 0&&(a.isWebGLRenderTarget&&(a=a.texture),a.matrixAutoUpdate===!0&&a.updateMatrix(),n.uv2Transform.value.copy(a.matrix))}function e(n,r){n.roughness.value=r.roughness,n.metalness.value=r.metalness,r.roughnessMap&&(n.roughnessMap.value=r.roughnessMap),r.metalnessMap&&(n.metalnessMap.value=r.metalnessMap),r.emissiveMap&&(n.emissiveMap.value=r.emissiveMap),r.bumpMap&&(n.bumpMap.value=r.bumpMap,n.bumpScale.value=r.bumpScale,r.side===1&&(n.bumpScale.value*=-1)),r.normalMap&&(n.normalMap.value=r.normalMap,n.normalScale.value.copy(r.normalScale),r.side===1&&n.normalScale.value.negate()),r.displacementMap&&(n.displacementMap.value=r.displacementMap,n.displacementScale.value=r.displacementScale,n.displacementBias.value=r.displacementBias),i.get(r).envMap&&(n.envMapIntensity.value=r.envMapIntensity)}return{refreshFogUniforms:function(n,r){n.fogColor.value.copy(r.color),r.isFog?(n.fogNear.value=r.near,n.fogFar.value=r.far):r.isFogExp2&&(n.fogDensity.value=r.density)},refreshMaterialUniforms:function(n,r,o,s,a){r.isMeshBasicMaterial?t(n,r):r.isMeshLambertMaterial?(t(n,r),function(h,l){l.emissiveMap&&(h.emissiveMap.value=l.emissiveMap)}(n,r)):r.isMeshToonMaterial?(t(n,r),function(h,l){l.gradientMap&&(h.gradientMap.value=l.gradientMap),l.emissiveMap&&(h.emissiveMap.value=l.emissiveMap),l.bumpMap&&(h.bumpMap.value=l.bumpMap,h.bumpScale.value=l.bumpScale,l.side===1&&(h.bumpScale.value*=-1)),l.normalMap&&(h.normalMap.value=l.normalMap,h.normalScale.value.copy(l.normalScale),l.side===1&&h.normalScale.value.negate()),l.displacementMap&&(h.displacementMap.value=l.displacementMap,h.displacementScale.value=l.displacementScale,h.displacementBias.value=l.displacementBias)}(n,r)):r.isMeshPhongMaterial?(t(n,r),function(h,l){h.specular.value.copy(l.specular),h.shininess.value=Math.max(l.shininess,1e-4),l.emissiveMap&&(h.emissiveMap.value=l.emissiveMap),l.bumpMap&&(h.bumpMap.value=l.bumpMap,h.bumpScale.value=l.bumpScale,l.side===1&&(h.bumpScale.value*=-1)),l.normalMap&&(h.normalMap.value=l.normalMap,h.normalScale.value.copy(l.normalScale),l.side===1&&h.normalScale.value.negate()),l.displacementMap&&(h.displacementMap.value=l.displacementMap,h.displacementScale.value=l.displacementScale,h.displacementBias.value=l.displacementBias)}(n,r)):r.isMeshStandardMaterial?(t(n,r),r.isMeshPhysicalMaterial?function(h,l,u){e(h,l),h.reflectivity.value=l.reflectivity,h.clearcoat.value=l.clearcoat,h.clearcoatRoughness.value=l.clearcoatRoughness,l.sheen&&h.sheen.value.copy(l.sheen),l.clearcoatMap&&(h.clearcoatMap.value=l.clearcoatMap),l.clearcoatRoughnessMap&&(h.clearcoatRoughnessMap.value=l.clearcoatRoughnessMap),l.clearcoatNormalMap&&(h.clearcoatNormalScale.value.copy(l.clearcoatNormalScale),h.clearcoatNormalMap.value=l.clearcoatNormalMap,l.side===1&&h.clearcoatNormalScale.value.negate()),h.transmission.value=l.transmission,l.transmissionMap&&(h.transmissionMap.value=l.transmissionMap),l.transmission>0&&(h.transmissionSamplerMap.value=u.texture,h.transmissionSamplerSize.value.set(u.width,u.height)),h.thickness.value=l.thickness,l.thicknessMap&&(h.thicknessMap.value=l.thicknessMap),h.attenuationDistance.value=l.attenuationDistance,h.attenuationColor.value.copy(l.attenuationColor)}(n,r,a):e(n,r)):r.isMeshMatcapMaterial?(t(n,r),function(h,l){l.matcap&&(h.matcap.value=l.matcap),l.bumpMap&&(h.bumpMap.value=l.bumpMap,h.bumpScale.value=l.bumpScale,l.side===1&&(h.bumpScale.value*=-1)),l.normalMap&&(h.normalMap.value=l.normalMap,h.normalScale.value.copy(l.normalScale),l.side===1&&h.normalScale.value.negate()),l.displacementMap&&(h.displacementMap.value=l.displacementMap,h.displacementScale.value=l.displacementScale,h.displacementBias.value=l.displacementBias)}(n,r)):r.isMeshDepthMaterial?(t(n,r),function(h,l){l.displacementMap&&(h.displacementMap.value=l.displacementMap,h.displacementScale.value=l.displacementScale,h.displacementBias.value=l.displacementBias)}(n,r)):r.isMeshDistanceMaterial?(t(n,r),function(h,l){l.displacementMap&&(h.displacementMap.value=l.displacementMap,h.displacementScale.value=l.displacementScale,h.displacementBias.value=l.displacementBias),h.referencePosition.value.copy(l.referencePosition),h.nearDistance.value=l.nearDistance,h.farDistance.value=l.farDistance}(n,r)):r.isMeshNormalMaterial?(t(n,r),function(h,l){l.bumpMap&&(h.bumpMap.value=l.bumpMap,h.bumpScale.value=l.bumpScale,l.side===1&&(h.bumpScale.value*=-1)),l.normalMap&&(h.normalMap.value=l.normalMap,h.normalScale.value.copy(l.normalScale),l.side===1&&h.normalScale.value.negate()),l.displacementMap&&(h.displacementMap.value=l.displacementMap,h.displacementScale.value=l.displacementScale,h.displacementBias.value=l.displacementBias)}(n,r)):r.isLineBasicMaterial?(function(h,l){h.diffuse.value.copy(l.color),h.opacity.value=l.opacity}(n,r),r.isLineDashedMaterial&&function(h,l){h.dashSize.value=l.dashSize,h.totalSize.value=l.dashSize+l.gapSize,h.scale.value=l.scale}(n,r)):r.isPointsMaterial?function(h,l,u,p){h.diffuse.value.copy(l.color),h.opacity.value=l.opacity,h.size.value=l.size*u,h.scale.value=.5*p,l.map&&(h.map.value=l.map),l.alphaMap&&(h.alphaMap.value=l.alphaMap);let y;l.map?y=l.map:l.alphaMap&&(y=l.alphaMap),y!==void 0&&(y.matrixAutoUpdate===!0&&y.updateMatrix(),h.uvTransform.value.copy(y.matrix))}(n,r,o,s):r.isSpriteMaterial?function(h,l){h.diffuse.value.copy(l.color),h.opacity.value=l.opacity,h.rotation.value=l.rotation,l.map&&(h.map.value=l.map),l.alphaMap&&(h.alphaMap.value=l.alphaMap);let u;l.map?u=l.map:l.alphaMap&&(u=l.alphaMap),u!==void 0&&(u.matrixAutoUpdate===!0&&u.updateMatrix(),h.uvTransform.value.copy(u.matrix))}(n,r):r.isShadowMaterial?(n.color.value.copy(r.color),n.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function ti(i={}){const t=i.canvas!==void 0?i.canvas:function(){const Gt=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return Gt.style.display="block",Gt}(),e=i.context!==void 0?i.context:null,n=i.alpha!==void 0&&i.alpha,r=i.depth===void 0||i.depth,o=i.stencil===void 0||i.stencil,s=i.antialias!==void 0&&i.antialias,a=i.premultipliedAlpha===void 0||i.premultipliedAlpha,h=i.preserveDrawingBuffer!==void 0&&i.preserveDrawingBuffer,l=i.powerPreference!==void 0?i.powerPreference:"default",u=i.failIfMajorPerformanceCaveat!==void 0&&i.failIfMajorPerformanceCaveat;let p=null,y=null;const x=[],E=[];this.domElement=t,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=3e3,this.physicallyCorrectLights=!1,this.toneMapping=0,this.toneMappingExposure=1;const A=this;let C=!1,j=0,Q=0,rt=null,pt=-1,it=null;const gt=new Ot,ht=new Ot;let mt=null,jt=t.width,Ft=t.height,Mt=1,wt=null,Pt=null;const Nt=new Ot(0,0,jt,Ft),ne=new Ot(0,0,jt,Ft);let $t=!1;const Vt=[],Yt=new Br;let ge=!1,be=!1,Pe=null;const Ct=new tn,Bt=new U,ve={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function le(){return rt===null?Mt:1}let se,Ie,Le,ue,bt,Ht,ie,ae,qt,ye,nn,on,rn,Sn,Ai,Jn,dr,za,Va,Wa,hr,pr,He=e;function Wg(Gt,Ce){for(let fe=0;fe<Gt.length;fe++){const Re=Gt[fe],We=t.getContext(Re,Ce);if(We!==null)return We}return null}try{const Gt={alpha:n,depth:r,stencil:o,antialias:s,premultipliedAlpha:a,preserveDrawingBuffer:h,powerPreference:l,failIfMajorPerformanceCaveat:u};if(t.addEventListener("webglcontextlost",Yg,!1),t.addEventListener("webglcontextrestored",qg,!1),He===null){const Ce=["webgl2","webgl","experimental-webgl"];if(A.isWebGL1Renderer===!0&&Ce.shift(),He=Wg(Ce,Gt),He===null)throw Wg(Ce)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}He.getShaderPrecisionFormat===void 0&&(He.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(Gt){throw console.error("THREE.WebGLRenderer: "+Gt.message),Gt}function Xg(){se=new el(He),Ie=new Ch(He,se,i),se.init(Ie),hr=new g0(He,se,Ie),Le=new f0(He,se,Ie),Vt[0]=1029,ue=new Nh,bt=new s0,Ht=new m0(He,se,Le,bt,Ie,hr,ue),ie=new Ih(A),ae=new ts(He,Ie),pr=new ao(He,se,ae,Ie),qt=new Ph(He,ae,ue,pr),ye=new Fh(He,qt,ae,ue),za=new Dh(He),Ai=new Rh(bt),nn=new o0(A,ie,se,Ie,pr,Ai),on=new y0(bt),rn=new l0(bt),Sn=new p0(se,Ie),dr=new Mh(A,ie,Le,ye,a),Jn=new id(A,ye,Ie),Va=new es(He,se,ue,Ie),Wa=new Oh(He,se,ue,Ie),ue.programs=nn.programs,A.capabilities=Ie,A.extensions=se,A.properties=bt,A.renderLists=rn,A.shadowMap=Jn,A.state=Le,A.info=ue}Xg();const Tr=new _0(A,He);function Yg(Gt){Gt.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),C=!0}function qg(){console.log("THREE.WebGLRenderer: Context Restored."),C=!1;const Gt=ue.autoReset,Ce=Jn.enabled,fe=Jn.autoUpdate,Re=Jn.needsUpdate,We=Jn.type;Xg(),ue.autoReset=Gt,Jn.enabled=Ce,Jn.autoUpdate=fe,Jn.needsUpdate=Re,Jn.type=We}function Jg(Gt){const Ce=Gt.target;Ce.removeEventListener("dispose",Jg),function(fe){(function(Re){const We=bt.get(Re).programs;We!==void 0&&We.forEach(function(Vn){nn.releaseProgram(Vn)})})(fe),bt.remove(fe)}(Ce)}this.xr=Tr,this.getContext=function(){return He},this.getContextAttributes=function(){return He.getContextAttributes()},this.forceContextLoss=function(){const Gt=se.get("WEBGL_lose_context");Gt&&Gt.loseContext()},this.forceContextRestore=function(){const Gt=se.get("WEBGL_lose_context");Gt&&Gt.restoreContext()},this.getPixelRatio=function(){return Mt},this.setPixelRatio=function(Gt){Gt!==void 0&&(Mt=Gt,this.setSize(jt,Ft,!1))},this.getSize=function(Gt){return Gt.set(jt,Ft)},this.setSize=function(Gt,Ce,fe){Tr.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(jt=Gt,Ft=Ce,t.width=Math.floor(Gt*Mt),t.height=Math.floor(Ce*Mt),fe!==!1&&(t.style.width=Gt+"px",t.style.height=Ce+"px"),this.setViewport(0,0,Gt,Ce))},this.getDrawingBufferSize=function(Gt){return Gt.set(jt*Mt,Ft*Mt).floor()},this.setDrawingBufferSize=function(Gt,Ce,fe){jt=Gt,Ft=Ce,Mt=fe,t.width=Math.floor(Gt*fe),t.height=Math.floor(Ce*fe),this.setViewport(0,0,Gt,Ce)},this.getCurrentViewport=function(Gt){return Gt.copy(gt)},this.getViewport=function(Gt){return Gt.copy(Nt)},this.setViewport=function(Gt,Ce,fe,Re){Gt.isVector4?Nt.set(Gt.x,Gt.y,Gt.z,Gt.w):Nt.set(Gt,Ce,fe,Re),Le.viewport(gt.copy(Nt).multiplyScalar(Mt).floor())},this.getScissor=function(Gt){return Gt.copy(ne)},this.setScissor=function(Gt,Ce,fe,Re){Gt.isVector4?ne.set(Gt.x,Gt.y,Gt.z,Gt.w):ne.set(Gt,Ce,fe,Re),Le.scissor(ht.copy(ne).multiplyScalar(Mt).floor())},this.getScissorTest=function(){return $t},this.setScissorTest=function(Gt){Le.setScissorTest($t=Gt)},this.setOpaqueSort=function(Gt){wt=Gt},this.setTransparentSort=function(Gt){Pt=Gt},this.getClearColor=function(Gt){return Gt.copy(dr.getClearColor())},this.setClearColor=function(){dr.setClearColor.apply(dr,arguments)},this.getClearAlpha=function(){return dr.getClearAlpha()},this.setClearAlpha=function(){dr.setClearAlpha.apply(dr,arguments)},this.clear=function(Gt,Ce,fe){let Re=0;(Gt===void 0||Gt)&&(Re|=16384),(Ce===void 0||Ce)&&(Re|=256),(fe===void 0||fe)&&(Re|=1024),He.clear(Re)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",Yg,!1),t.removeEventListener("webglcontextrestored",qg,!1),rn.dispose(),Sn.dispose(),bt.dispose(),ie.dispose(),ye.dispose(),pr.dispose(),Tr.dispose(),Tr.removeEventListener("sessionstart",Kg),Tr.removeEventListener("sessionend",Zg),Pe&&(Pe.dispose(),Pe=null),fs.stop()},this.renderBufferImmediate=function(Gt,Ce){pr.initAttributes();const fe=bt.get(Gt);Gt.hasPositions&&!fe.position&&(fe.position=He.createBuffer()),Gt.hasNormals&&!fe.normal&&(fe.normal=He.createBuffer()),Gt.hasUvs&&!fe.uv&&(fe.uv=He.createBuffer()),Gt.hasColors&&!fe.color&&(fe.color=He.createBuffer());const Re=Ce.getAttributes();Gt.hasPositions&&(He.bindBuffer(34962,fe.position),He.bufferData(34962,Gt.positionArray,35048),pr.enableAttribute(Re.position),He.vertexAttribPointer(Re.position,3,5126,!1,0,0)),Gt.hasNormals&&(He.bindBuffer(34962,fe.normal),He.bufferData(34962,Gt.normalArray,35048),pr.enableAttribute(Re.normal),He.vertexAttribPointer(Re.normal,3,5126,!1,0,0)),Gt.hasUvs&&(He.bindBuffer(34962,fe.uv),He.bufferData(34962,Gt.uvArray,35048),pr.enableAttribute(Re.uv),He.vertexAttribPointer(Re.uv,2,5126,!1,0,0)),Gt.hasColors&&(He.bindBuffer(34962,fe.color),He.bufferData(34962,Gt.colorArray,35048),pr.enableAttribute(Re.color),He.vertexAttribPointer(Re.color,3,5126,!1,0,0)),pr.disableUnusedAttributes(),He.drawArrays(4,0,Gt.count),Gt.count=0},this.renderBufferDirect=function(Gt,Ce,fe,Re,We,Vn){Ce===null&&(Ce=ve);const wn=We.isMesh&&We.matrixWorld.determinant()<0,Ze=tv(Gt,Ce,Re,We);Le.setMaterial(Re,wn);let Ln=fe.index;const mn=fe.attributes.position;if(Ln===null){if(mn===void 0||mn.count===0)return}else if(Ln.count===0)return;let zn,En=1;Re.wireframe===!0&&(Ln=qt.getWireframeAttribute(fe),En=2),(Re.morphTargets||Re.morphNormals)&&za.update(We,fe,Re,Ze),pr.setup(We,Re,Ze,fe,Ln);let Hn=Va;Ln!==null&&(zn=ae.get(Ln),Hn=Wa,Hn.setIndex(zn));const Ni=Ln!==null?Ln.count:mn.count,ai=fe.drawRange.start*En,zr=fe.drawRange.count*En,oi=Vn!==null?Vn.start*En:0,eo=Vn!==null?Vn.count*En:1/0,Hi=Math.max(ai,oi),Er=Math.min(Ni,ai+zr,oi+eo)-1,rr=Math.max(0,Er-Hi+1);if(rr!==0){if(We.isMesh)Re.wireframe===!0?(Le.setLineWidth(Re.wireframeLinewidth*le()),Hn.setMode(1)):Hn.setMode(4);else if(We.isLine){let Xa=Re.linewidth;Xa===void 0&&(Xa=1),Le.setLineWidth(Xa*le()),We.isLineSegments?Hn.setMode(1):We.isLineLoop?Hn.setMode(2):Hn.setMode(3)}else We.isPoints?Hn.setMode(0):We.isSprite&&Hn.setMode(4);if(We.isInstancedMesh)Hn.renderInstances(Hi,rr,We.count);else if(fe.isInstancedBufferGeometry){const Xa=Math.min(fe.instanceCount,fe._maxInstanceCount);Hn.renderInstances(Hi,rr,Xa)}else Hn.render(Hi,rr)}},this.compile=function(Gt,Ce){y=Sn.get(Gt),y.init(),Gt.traverseVisible(function(fe){fe.isLight&&fe.layers.test(Ce.layers)&&(y.pushLight(fe),fe.castShadow&&y.pushShadow(fe))}),y.setupLights(),Gt.traverse(function(fe){const Re=fe.material;if(Re)if(Array.isArray(Re))for(let We=0;We<Re.length;We++)wc(Re[We],Gt,fe);else wc(Re,Gt,fe)})};let Sc=null;function Kg(){fs.stop()}function Zg(){fs.start()}const fs=new $o;function _h(Gt,Ce,fe){const Re=Ce.isScene===!0?Ce.overrideMaterial:null;for(let We=0,Vn=Gt.length;We<Vn;We++){const wn=Gt[We],Ze=wn.object,Ln=wn.geometry,mn=Re===null?wn.material:Re,zn=wn.group;if(fe.isArrayCamera){const En=fe.cameras;for(let Hn=0,Ni=En.length;Hn<Ni;Hn++){const ai=En[Hn];Ze.layers.test(ai.layers)&&(Le.viewport(gt.copy(ai.viewport)),y.setupLightsView(ai),Qg(Ze,Ce,ai,Ln,mn,zn))}}else Qg(Ze,Ce,fe,Ln,mn,zn)}}function Qg(Gt,Ce,fe,Re,We,Vn){if(Gt.onBeforeRender(A,Ce,fe,Re,We,Vn),Gt.modelViewMatrix.multiplyMatrices(fe.matrixWorldInverse,Gt.matrixWorld),Gt.normalMatrix.getNormalMatrix(Gt.modelViewMatrix),Gt.isImmediateRenderObject){const wn=tv(fe,Ce,We,Gt);Le.setMaterial(We),pr.reset(),function(Ze,Ln){Ze.render(function(mn){A.renderBufferImmediate(mn,Ln)})}(Gt,wn)}else We.transparent===!0&&We.side===2?(We.side=1,We.needsUpdate=!0,A.renderBufferDirect(fe,Ce,Re,We,Gt,Vn),We.side=0,We.needsUpdate=!0,A.renderBufferDirect(fe,Ce,Re,We,Gt,Vn),We.side=2):A.renderBufferDirect(fe,Ce,Re,We,Gt,Vn);Gt.onAfterRender(A,Ce,fe,Re,We,Vn)}function wc(Gt,Ce,fe){Ce.isScene!==!0&&(Ce=ve);const Re=bt.get(Gt),We=y.state.lights,Vn=y.state.shadowsArray,wn=We.state.version,Ze=nn.getParameters(Gt,We.state,Vn,Ce,fe),Ln=nn.getProgramCacheKey(Ze);let mn=Re.programs;Re.environment=Gt.isMeshStandardMaterial?Ce.environment:null,Re.fog=Ce.fog,Re.envMap=ie.get(Gt.envMap||Re.environment),mn===void 0&&(Gt.addEventListener("dispose",Jg),mn=new Map,Re.programs=mn);let zn=mn.get(Ln);if(zn!==void 0){if(Re.currentProgram===zn&&Re.lightsStateVersion===wn)return $g(Gt,Ze),zn}else Ze.uniforms=nn.getUniforms(Gt),Gt.onBuild(Ze,A),Gt.onBeforeCompile(Ze,A),zn=nn.acquireProgram(Ze,Ln),mn.set(Ln,zn),Re.uniforms=Ze.uniforms;const En=Re.uniforms;(Gt.isShaderMaterial||Gt.isRawShaderMaterial)&&Gt.clipping!==!0||(En.clippingPlanes=Ai.uniform),$g(Gt,Ze),Re.needsLights=function(ai){return ai.isMeshLambertMaterial||ai.isMeshToonMaterial||ai.isMeshPhongMaterial||ai.isMeshStandardMaterial||ai.isShadowMaterial||ai.isShaderMaterial&&ai.lights===!0}(Gt),Re.lightsStateVersion=wn,Re.needsLights&&(En.ambientLightColor.value=We.state.ambient,En.lightProbe.value=We.state.probe,En.directionalLights.value=We.state.directional,En.directionalLightShadows.value=We.state.directionalShadow,En.spotLights.value=We.state.spot,En.spotLightShadows.value=We.state.spotShadow,En.rectAreaLights.value=We.state.rectArea,En.ltc_1.value=We.state.rectAreaLTC1,En.ltc_2.value=We.state.rectAreaLTC2,En.pointLights.value=We.state.point,En.pointLightShadows.value=We.state.pointShadow,En.hemisphereLights.value=We.state.hemi,En.directionalShadowMap.value=We.state.directionalShadowMap,En.directionalShadowMatrix.value=We.state.directionalShadowMatrix,En.spotShadowMap.value=We.state.spotShadowMap,En.spotShadowMatrix.value=We.state.spotShadowMatrix,En.pointShadowMap.value=We.state.pointShadowMap,En.pointShadowMatrix.value=We.state.pointShadowMatrix);const Hn=zn.getUniforms(),Ni=ii.seqWithValue(Hn.seq,En);return Re.currentProgram=zn,Re.uniformsList=Ni,zn}function $g(Gt,Ce){const fe=bt.get(Gt);fe.outputEncoding=Ce.outputEncoding,fe.instancing=Ce.instancing,fe.skinning=Ce.skinning,fe.numClippingPlanes=Ce.numClippingPlanes,fe.numIntersection=Ce.numClipIntersection,fe.vertexAlphas=Ce.vertexAlphas}function tv(Gt,Ce,fe,Re){Ce.isScene!==!0&&(Ce=ve),Ht.resetTextureUnits();const We=Ce.fog,Vn=fe.isMeshStandardMaterial?Ce.environment:null,wn=rt===null?A.outputEncoding:rt.texture.encoding,Ze=ie.get(fe.envMap||Vn),Ln=fe.vertexColors===!0&&Re.geometry&&Re.geometry.attributes.color&&Re.geometry.attributes.color.itemSize===4,mn=bt.get(fe),zn=y.state.lights;if(ge===!0&&(be===!0||Gt!==it)){const rr=Gt===it&&fe.id===pt;Ai.setState(fe,Gt,rr)}let En=!1;fe.version===mn.__version?mn.needsLights&&mn.lightsStateVersion!==zn.state.version||mn.outputEncoding!==wn||Re.isInstancedMesh&&mn.instancing===!1?En=!0:Re.isInstancedMesh||mn.instancing!==!0?Re.isSkinnedMesh&&mn.skinning===!1?En=!0:Re.isSkinnedMesh||mn.skinning!==!0?mn.envMap!==Ze||fe.fog&&mn.fog!==We?En=!0:mn.numClippingPlanes===void 0||mn.numClippingPlanes===Ai.numPlanes&&mn.numIntersection===Ai.numIntersection?mn.vertexAlphas!==Ln&&(En=!0):En=!0:En=!0:En=!0:(En=!0,mn.__version=fe.version);let Hn=mn.currentProgram;En===!0&&(Hn=wc(fe,Ce,Re));let Ni=!1,ai=!1,zr=!1;const oi=Hn.getUniforms(),eo=mn.uniforms;if(Le.useProgram(Hn.program)&&(Ni=!0,ai=!0,zr=!0),fe.id!==pt&&(pt=fe.id,ai=!0),Ni||it!==Gt){if(oi.setValue(He,"projectionMatrix",Gt.projectionMatrix),Ie.logarithmicDepthBuffer&&oi.setValue(He,"logDepthBufFC",2/(Math.log(Gt.far+1)/Math.LN2)),it!==Gt&&(it=Gt,ai=!0,zr=!0),fe.isShaderMaterial||fe.isMeshPhongMaterial||fe.isMeshToonMaterial||fe.isMeshStandardMaterial||fe.envMap){const rr=oi.map.cameraPosition;rr!==void 0&&rr.setValue(He,Bt.setFromMatrixPosition(Gt.matrixWorld))}(fe.isMeshPhongMaterial||fe.isMeshToonMaterial||fe.isMeshLambertMaterial||fe.isMeshBasicMaterial||fe.isMeshStandardMaterial||fe.isShaderMaterial)&&oi.setValue(He,"isOrthographic",Gt.isOrthographicCamera===!0),(fe.isMeshPhongMaterial||fe.isMeshToonMaterial||fe.isMeshLambertMaterial||fe.isMeshBasicMaterial||fe.isMeshStandardMaterial||fe.isShaderMaterial||fe.isShadowMaterial||Re.isSkinnedMesh)&&oi.setValue(He,"viewMatrix",Gt.matrixWorldInverse)}if(Re.isSkinnedMesh){oi.setOptional(He,Re,"bindMatrix"),oi.setOptional(He,Re,"bindMatrixInverse");const rr=Re.skeleton;rr&&(Ie.floatVertexTextures?(rr.boneTexture===null&&rr.computeBoneTexture(),oi.setValue(He,"boneTexture",rr.boneTexture,Ht),oi.setValue(He,"boneTextureSize",rr.boneTextureSize)):oi.setOptional(He,rr,"boneMatrices"))}var Hi,Er;return(ai||mn.receiveShadow!==Re.receiveShadow)&&(mn.receiveShadow=Re.receiveShadow,oi.setValue(He,"receiveShadow",Re.receiveShadow)),ai&&(oi.setValue(He,"toneMappingExposure",A.toneMappingExposure),mn.needsLights&&(Er=zr,(Hi=eo).ambientLightColor.needsUpdate=Er,Hi.lightProbe.needsUpdate=Er,Hi.directionalLights.needsUpdate=Er,Hi.directionalLightShadows.needsUpdate=Er,Hi.pointLights.needsUpdate=Er,Hi.pointLightShadows.needsUpdate=Er,Hi.spotLights.needsUpdate=Er,Hi.spotLightShadows.needsUpdate=Er,Hi.rectAreaLights.needsUpdate=Er,Hi.hemisphereLights.needsUpdate=Er),We&&fe.fog&&on.refreshFogUniforms(eo,We),on.refreshMaterialUniforms(eo,fe,Mt,Ft,Pe),ii.upload(He,mn.uniformsList,eo,Ht)),fe.isShaderMaterial&&fe.uniformsNeedUpdate===!0&&(ii.upload(He,mn.uniformsList,eo,Ht),fe.uniformsNeedUpdate=!1),fe.isSpriteMaterial&&oi.setValue(He,"center",Re.center),oi.setValue(He,"modelViewMatrix",Re.modelViewMatrix),oi.setValue(He,"normalMatrix",Re.normalMatrix),oi.setValue(He,"modelMatrix",Re.matrixWorld),Hn}fs.setAnimationLoop(function(Gt){Sc&&Sc(Gt)}),typeof window!="undefined"&&fs.setContext(window),this.setAnimationLoop=function(Gt){Sc=Gt,Tr.setAnimationLoop(Gt),Gt===null?fs.stop():fs.start()},Tr.addEventListener("sessionstart",Kg),Tr.addEventListener("sessionend",Zg),this.render=function(Gt,Ce){if(Ce!==void 0&&Ce.isCamera!==!0)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(C===!0)return;Gt.autoUpdate===!0&&Gt.updateMatrixWorld(),Ce.parent===null&&Ce.updateMatrixWorld(),Tr.enabled===!0&&Tr.isPresenting===!0&&(Tr.cameraAutoUpdate===!0&&Tr.updateCamera(Ce),Ce=Tr.getCamera()),Gt.isScene===!0&&Gt.onBeforeRender(A,Gt,Ce,rt),y=Sn.get(Gt,E.length),y.init(),E.push(y),Ct.multiplyMatrices(Ce.projectionMatrix,Ce.matrixWorldInverse),Yt.setFromProjectionMatrix(Ct),be=this.localClippingEnabled,ge=Ai.init(this.clippingPlanes,be,Ce),p=rn.get(Gt,x.length),p.init(),x.push(p),function wn(Ze,Ln,mn,zn){if(Ze.visible===!1)return;if(Ze.layers.test(Ln.layers)){if(Ze.isGroup)mn=Ze.renderOrder;else if(Ze.isLOD)Ze.autoUpdate===!0&&Ze.update(Ln);else if(Ze.isLight)y.pushLight(Ze),Ze.castShadow&&y.pushShadow(Ze);else if(Ze.isSprite){if(!Ze.frustumCulled||Yt.intersectsSprite(Ze)){zn&&Bt.setFromMatrixPosition(Ze.matrixWorld).applyMatrix4(Ct);const Hn=ye.update(Ze),Ni=Ze.material;Ni.visible&&p.push(Ze,Hn,Ni,mn,Bt.z,null)}}else if(Ze.isImmediateRenderObject)zn&&Bt.setFromMatrixPosition(Ze.matrixWorld).applyMatrix4(Ct),p.push(Ze,null,Ze.material,mn,Bt.z,null);else if((Ze.isMesh||Ze.isLine||Ze.isPoints)&&(Ze.isSkinnedMesh&&Ze.skeleton.frame!==ue.render.frame&&(Ze.skeleton.update(),Ze.skeleton.frame=ue.render.frame),!Ze.frustumCulled||Yt.intersectsObject(Ze))){zn&&Bt.setFromMatrixPosition(Ze.matrixWorld).applyMatrix4(Ct);const Hn=ye.update(Ze),Ni=Ze.material;if(Array.isArray(Ni)){const ai=Hn.groups;for(let zr=0,oi=ai.length;zr<oi;zr++){const eo=ai[zr],Hi=Ni[eo.materialIndex];Hi&&Hi.visible&&p.push(Ze,Hn,Hi,mn,Bt.z,eo)}}else Ni.visible&&p.push(Ze,Hn,Ni,mn,Bt.z,null)}}const En=Ze.children;for(let Hn=0,Ni=En.length;Hn<Ni;Hn++)wn(En[Hn],Ln,mn,zn)}(Gt,Ce,0,A.sortObjects),p.finish(),A.sortObjects===!0&&p.sort(wt,Pt),ge===!0&&Ai.beginShadows();const fe=y.state.shadowsArray;Jn.render(fe,Gt,Ce),y.setupLights(),y.setupLightsView(Ce),ge===!0&&Ai.endShadows(),this.info.autoReset===!0&&this.info.reset(),dr.render(p,Gt);const Re=p.opaque,We=p.transmissive,Vn=p.transparent;Re.length>0&&_h(Re,Gt,Ce),We.length>0&&function(wn,Ze,Ln,mn){if(Pe===null){const Hn=s===!0&&Ie.isWebGL2===!0;Pe=new(Hn?st:zt)(1024,1024,{generateMipmaps:!0,type:hr.convert(1016)!==null?1016:1009,minFilter:1008,magFilter:1003,wrapS:1001,wrapT:1001})}const zn=A.getRenderTarget();A.setRenderTarget(Pe),A.clear();const En=A.toneMapping;A.toneMapping=0,_h(wn,Ln,mn),A.toneMapping=En,Ht.updateMultisampleRenderTarget(Pe),Ht.updateRenderTargetMipmap(Pe),A.setRenderTarget(zn),_h(Ze,Ln,mn)}(Re,We,Gt,Ce),Vn.length>0&&_h(Vn,Gt,Ce),rt!==null&&(Ht.updateMultisampleRenderTarget(rt),Ht.updateRenderTargetMipmap(rt)),Gt.isScene===!0&&Gt.onAfterRender(A,Gt,Ce),Le.buffers.depth.setTest(!0),Le.buffers.depth.setMask(!0),Le.buffers.color.setMask(!0),Le.setPolygonOffset(!1),pr.resetDefaultState(),pt=-1,it=null,E.pop(),y=E.length>0?E[E.length-1]:null,x.pop(),p=x.length>0?x[x.length-1]:null},this.getActiveCubeFace=function(){return j},this.getActiveMipmapLevel=function(){return Q},this.getRenderTarget=function(){return rt},this.setRenderTarget=function(Gt,Ce=0,fe=0){rt=Gt,j=Ce,Q=fe,Gt&&bt.get(Gt).__webglFramebuffer===void 0&&Ht.setupRenderTarget(Gt);let Re=null,We=!1,Vn=!1;if(Gt){const wn=Gt.texture;(wn.isDataTexture3D||wn.isDataTexture2DArray)&&(Vn=!0);const Ze=bt.get(Gt).__webglFramebuffer;Gt.isWebGLCubeRenderTarget?(Re=Ze[Ce],We=!0):Re=Gt.isWebGLMultisampleRenderTarget?bt.get(Gt).__webglMultisampledFramebuffer:Ze,gt.copy(Gt.viewport),ht.copy(Gt.scissor),mt=Gt.scissorTest}else gt.copy(Nt).multiplyScalar(Mt).floor(),ht.copy(ne).multiplyScalar(Mt).floor(),mt=$t;if(Le.bindFramebuffer(36160,Re)&&Ie.drawBuffers){let wn=!1;if(Gt)if(Gt.isWebGLMultipleRenderTargets){const Ze=Gt.texture;if(Vt.length!==Ze.length||Vt[0]!==36064){for(let Ln=0,mn=Ze.length;Ln<mn;Ln++)Vt[Ln]=36064+Ln;Vt.length=Ze.length,wn=!0}}else Vt.length===1&&Vt[0]===36064||(Vt[0]=36064,Vt.length=1,wn=!0);else Vt.length===1&&Vt[0]===1029||(Vt[0]=1029,Vt.length=1,wn=!0);wn&&(Ie.isWebGL2?He.drawBuffers(Vt):se.get("WEBGL_draw_buffers").drawBuffersWEBGL(Vt))}if(Le.viewport(gt),Le.scissor(ht),Le.setScissorTest(mt),We){const wn=bt.get(Gt.texture);He.framebufferTexture2D(36160,36064,34069+Ce,wn.__webglTexture,fe)}else if(Vn){const wn=bt.get(Gt.texture),Ze=Ce||0;He.framebufferTextureLayer(36160,36064,wn.__webglTexture,fe||0,Ze)}},this.readRenderTargetPixels=function(Gt,Ce,fe,Re,We,Vn,wn){if(!Gt||!Gt.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Ze=bt.get(Gt).__webglFramebuffer;if(Gt.isWebGLCubeRenderTarget&&wn!==void 0&&(Ze=Ze[wn]),Ze){Le.bindFramebuffer(36160,Ze);try{const Ln=Gt.texture,mn=Ln.format,zn=Ln.type;if(mn!==1023&&hr.convert(mn)!==He.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const En=zn===1016&&(se.has("EXT_color_buffer_half_float")||Ie.isWebGL2&&se.has("EXT_color_buffer_float"));if(!(zn===1009||hr.convert(zn)===He.getParameter(35738)||zn===1015&&(Ie.isWebGL2||se.has("OES_texture_float")||se.has("WEBGL_color_buffer_float"))||En))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");He.checkFramebufferStatus(36160)===36053?Ce>=0&&Ce<=Gt.width-Re&&fe>=0&&fe<=Gt.height-We&&He.readPixels(Ce,fe,Re,We,hr.convert(mn),hr.convert(zn),Vn):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{const Ln=rt!==null?bt.get(rt).__webglFramebuffer:null;Le.bindFramebuffer(36160,Ln)}}},this.copyFramebufferToTexture=function(Gt,Ce,fe=0){const Re=Math.pow(2,-fe),We=Math.floor(Ce.image.width*Re),Vn=Math.floor(Ce.image.height*Re);let wn=hr.convert(Ce.format);Ie.isWebGL2&&(wn===6407&&(wn=32849),wn===6408&&(wn=32856)),Ht.setTexture2D(Ce,0),He.copyTexImage2D(3553,fe,wn,Gt.x,Gt.y,We,Vn,0),Le.unbindTexture()},this.copyTextureToTexture=function(Gt,Ce,fe,Re=0){const We=Ce.image.width,Vn=Ce.image.height,wn=hr.convert(fe.format),Ze=hr.convert(fe.type);Ht.setTexture2D(fe,0),He.pixelStorei(37440,fe.flipY),He.pixelStorei(37441,fe.premultiplyAlpha),He.pixelStorei(3317,fe.unpackAlignment),Ce.isDataTexture?He.texSubImage2D(3553,Re,Gt.x,Gt.y,We,Vn,wn,Ze,Ce.image.data):Ce.isCompressedTexture?He.compressedTexSubImage2D(3553,Re,Gt.x,Gt.y,Ce.mipmaps[0].width,Ce.mipmaps[0].height,wn,Ce.mipmaps[0].data):He.texSubImage2D(3553,Re,Gt.x,Gt.y,wn,Ze,Ce.image),Re===0&&fe.generateMipmaps&&He.generateMipmap(3553),Le.unbindTexture()},this.copyTextureToTexture3D=function(Gt,Ce,fe,Re,We=0){if(A.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const Vn=Gt.max.x-Gt.min.x+1,wn=Gt.max.y-Gt.min.y+1,Ze=Gt.max.z-Gt.min.z+1,Ln=hr.convert(Re.format),mn=hr.convert(Re.type);let zn;if(Re.isDataTexture3D)Ht.setTexture3D(Re,0),zn=32879;else{if(!Re.isDataTexture2DArray)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");Ht.setTexture2DArray(Re,0),zn=35866}He.pixelStorei(37440,Re.flipY),He.pixelStorei(37441,Re.premultiplyAlpha),He.pixelStorei(3317,Re.unpackAlignment);const En=He.getParameter(3314),Hn=He.getParameter(32878),Ni=He.getParameter(3316),ai=He.getParameter(3315),zr=He.getParameter(32877),oi=fe.isCompressedTexture?fe.mipmaps[0]:fe.image;He.pixelStorei(3314,oi.width),He.pixelStorei(32878,oi.height),He.pixelStorei(3316,Gt.min.x),He.pixelStorei(3315,Gt.min.y),He.pixelStorei(32877,Gt.min.z),fe.isDataTexture||fe.isDataTexture3D?He.texSubImage3D(zn,We,Ce.x,Ce.y,Ce.z,Vn,wn,Ze,Ln,mn,oi.data):fe.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),He.compressedTexSubImage3D(zn,We,Ce.x,Ce.y,Ce.z,Vn,wn,Ze,Ln,oi.data)):He.texSubImage3D(zn,We,Ce.x,Ce.y,Ce.z,Vn,wn,Ze,Ln,mn,oi),He.pixelStorei(3314,En),He.pixelStorei(32878,Hn),He.pixelStorei(3316,Ni),He.pixelStorei(3315,ai),He.pixelStorei(32877,zr),We===0&&Re.generateMipmaps&&He.generateMipmap(zn),Le.unbindTexture()},this.initTexture=function(Gt){Ht.setTexture2D(Gt,0),Le.unbindTexture()},this.resetState=function(){j=0,Q=0,rt=null,Le.reset(),pr.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}(class extends ti{}).prototype.isWebGL1Renderer=!0;class zh extends Un{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return this.fog!==null&&(e.object.fog=this.fog.toJSON()),e}}zh.prototype.isScene=!0;class oa{constructor(t,e){this.array=t,this.stride=e,this.count=t!==void 0?t.length/e:0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=X()}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,n){t*=this.stride,n*=e.stride;for(let r=0,o=this.stride;r<o;r++)this.array[t+r]=e.array[n+r];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=X()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(e,this.stride);return n.setUsage(this.usage),n}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=X()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}oa.prototype.isInterleavedBuffer=!0;const Ii=new U;class sa{constructor(t,e,n,r=!1){this.name="",this.data=t,this.itemSize=e,this.offset=n,this.normalized=r===!0}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,n=this.data.count;e<n;e++)Ii.x=this.getX(e),Ii.y=this.getY(e),Ii.z=this.getZ(e),Ii.applyMatrix4(t),this.setXYZ(e,Ii.x,Ii.y,Ii.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)Ii.x=this.getX(e),Ii.y=this.getY(e),Ii.z=this.getZ(e),Ii.applyNormalMatrix(t),this.setXYZ(e,Ii.x,Ii.y,Ii.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)Ii.x=this.getX(e),Ii.y=this.getY(e),Ii.z=this.getZ(e),Ii.transformDirection(t),this.setXYZ(e,Ii.x,Ii.y,Ii.z);return this}setX(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){return this.data.array[t*this.data.stride+this.offset]}getY(t){return this.data.array[t*this.data.stride+this.offset+1]}getZ(t){return this.data.array[t*this.data.stride+this.offset+2]}getW(t){return this.data.array[t*this.data.stride+this.offset+3]}setXY(t,e,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this}setXYZ(t,e,n,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=r,this}setXYZW(t,e,n,r,o){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=r,this.data.array[t+3]=o,this}clone(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");const e=[];for(let n=0;n<this.count;n++){const r=n*this.data.stride+this.offset;for(let o=0;o<this.itemSize;o++)e.push(this.data.array[r+o])}return new Yn(new this.array.constructor(e),this.itemSize,this.normalized)}return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new sa(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");const e=[];for(let n=0;n<this.count;n++){const r=n*this.data.stride+this.offset;for(let o=0;o<this.itemSize;o++)e.push(this.data.array[r+o])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}sa.prototype.isInterleavedBufferAttribute=!0;class od extends Ci{constructor(t){super(),this.type="SpriteMaterial",this.color=new fn(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this}}let Ts;od.prototype.isSpriteMaterial=!0;const aa=new U,Es=new U,Ss=new U,ws=new R,la=new R,sd=new tn,fl=new U,ha=new U,ml=new U,ad=new R,Vh=new R,ld=new R;class x0 extends Un{constructor(t){if(super(),this.type="Sprite",Ts===void 0){Ts=new Wn;const e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),n=new oa(e,5);Ts.setIndex([0,1,2,0,2,3]),Ts.setAttribute("position",new sa(n,3,0,!1)),Ts.setAttribute("uv",new sa(n,2,3,!1))}this.geometry=Ts,this.material=t!==void 0?t:new od,this.center=new R(.5,.5)}raycast(t,e){t.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Es.setFromMatrixScale(this.matrixWorld),sd.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),Ss.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Es.multiplyScalar(-Ss.z);const n=this.material.rotation;let r,o;n!==0&&(o=Math.cos(n),r=Math.sin(n));const s=this.center;gl(fl.set(-.5,-.5,0),Ss,s,Es,r,o),gl(ha.set(.5,-.5,0),Ss,s,Es,r,o),gl(ml.set(.5,.5,0),Ss,s,Es,r,o),ad.set(0,0),Vh.set(1,0),ld.set(1,1);let a=t.ray.intersectTriangle(fl,ha,ml,!1,aa);if(a===null&&(gl(ha.set(-.5,.5,0),Ss,s,Es,r,o),Vh.set(0,1),a=t.ray.intersectTriangle(fl,ml,ha,!1,aa),a===null))return;const h=t.ray.origin.distanceTo(aa);h<t.near||h>t.far||e.push({distance:h,point:aa.clone(),uv:ui.getUV(aa,fl,ha,ml,ad,Vh,ld,new R),face:null,object:this})}copy(t){return super.copy(t),t.center!==void 0&&this.center.copy(t.center),this.material=t.material,this}}function gl(i,t,e,n,r,o){ws.subVectors(i,e).addScalar(.5).multiply(n),r!==void 0?(la.x=o*ws.x-r*ws.y,la.y=r*ws.x+o*ws.y):la.copy(ws),i.copy(t),i.x+=la.x,i.y+=la.y,i.applyMatrix4(sd)}x0.prototype.isSprite=!0;const hd=new U,ud=new Ot,cd=new Ot,b0=new U,dd=new tn;class pd extends Tt{constructor(t,e){super(t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new tn,this.bindMatrixInverse=new tn}copy(t){return super.copy(t),this.bindMode=t.bindMode,this.bindMatrix.copy(t.bindMatrix),this.bindMatrixInverse.copy(t.bindMatrixInverse),this.skeleton=t.skeleton,this}bind(t,e){this.skeleton=t,e===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.copy(e).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const t=new Ot,e=this.geometry.attributes.skinWeight;for(let n=0,r=e.count;n<r;n++){t.x=e.getX(n),t.y=e.getY(n),t.z=e.getZ(n),t.w=e.getW(n);const o=1/t.manhattanLength();o!==1/0?t.multiplyScalar(o):t.set(1,0,0,0),e.setXYZW(n,t.x,t.y,t.z,t.w)}}updateMatrixWorld(t){super.updateMatrixWorld(t),this.bindMode==="attached"?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode==="detached"?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(t,e){const n=this.skeleton,r=this.geometry;ud.fromBufferAttribute(r.attributes.skinIndex,t),cd.fromBufferAttribute(r.attributes.skinWeight,t),hd.fromBufferAttribute(r.attributes.position,t).applyMatrix4(this.bindMatrix),e.set(0,0,0);for(let o=0;o<4;o++){const s=cd.getComponent(o);if(s!==0){const a=ud.getComponent(o);dd.multiplyMatrices(n.bones[a].matrixWorld,n.boneInverses[a]),e.addScaledVector(b0.copy(hd).applyMatrix4(dd),s)}}return e.applyMatrix4(this.bindMatrixInverse)}}pd.prototype.isSkinnedMesh=!0;class T0 extends Un{constructor(){super(),this.type="Bone"}}T0.prototype.isBone=!0;class fd extends tt{constructor(t=null,e=1,n=1,r,o,s,a,h,l=1003,u=1003,p,y){super(null,s,a,h,l,u,r,o,p,y),this.image={data:t,width:e,height:n},this.magFilter=l,this.minFilter=u,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}fd.prototype.isDataTexture=!0;const md=new tn,gd=new tn,vl=[],ua=new Tt;class E0 extends Tt{constructor(t,e,n){super(t,e),this.instanceMatrix=new Yn(new Float32Array(16*n),16),this.instanceColor=null,this.count=n,this.frustumCulled=!1}copy(t){return super.copy(t),this.instanceMatrix.copy(t.instanceMatrix),t.instanceColor!==null&&(this.instanceColor=t.instanceColor.clone()),this.count=t.count,this}getColorAt(t,e){e.fromArray(this.instanceColor.array,3*t)}getMatrixAt(t,e){e.fromArray(this.instanceMatrix.array,16*t)}raycast(t,e){const n=this.matrixWorld,r=this.count;if(ua.geometry=this.geometry,ua.material=this.material,ua.material!==void 0)for(let o=0;o<r;o++){this.getMatrixAt(o,md),gd.multiplyMatrices(n,md),ua.matrixWorld=gd,ua.raycast(t,vl);for(let s=0,a=vl.length;s<a;s++){const h=vl[s];h.instanceId=o,h.object=this,e.push(h)}vl.length=0}}setColorAt(t,e){this.instanceColor===null&&(this.instanceColor=new Yn(new Float32Array(3*this.count),3)),e.toArray(this.instanceColor.array,3*t)}setMatrixAt(t,e){e.toArray(this.instanceMatrix.array,16*t)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}E0.prototype.isInstancedMesh=!0;class ca extends Ci{constructor(t){super(),this.type="LineBasicMaterial",this.color=new fn(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.morphTargets=!1,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.morphTargets=t.morphTargets,this}}ca.prototype.isLineBasicMaterial=!0;const vd=new U,_d=new U,yd=new tn,Wh=new pi,_l=new Ge;class Xh extends Un{constructor(t=new Wn,e=new ca){super(),this.type="Line",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t){return super.copy(t),this.material=t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(t.isBufferGeometry)if(t.index===null){const e=t.attributes.position,n=[0];for(let r=1,o=e.count;r<o;r++)vd.fromBufferAttribute(e,r-1),_d.fromBufferAttribute(e,r),n[r]=n[r-1],n[r]+=vd.distanceTo(_d);t.setAttribute("lineDistance",new An(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else t.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}raycast(t,e){const n=this.geometry,r=this.matrixWorld,o=t.params.Line.threshold,s=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),_l.copy(n.boundingSphere),_l.applyMatrix4(r),_l.radius+=o,t.ray.intersectsSphere(_l)===!1)return;yd.copy(r).invert(),Wh.copy(t.ray).applyMatrix4(yd);const a=o/((this.scale.x+this.scale.y+this.scale.z)/3),h=a*a,l=new U,u=new U,p=new U,y=new U,x=this.isLineSegments?2:1;if(n.isBufferGeometry){const E=n.index,A=n.attributes.position;if(E!==null)for(let C=Math.max(0,s.start),j=Math.min(E.count,s.start+s.count)-1;C<j;C+=x){const Q=E.getX(C),rt=E.getX(C+1);if(l.fromBufferAttribute(A,Q),u.fromBufferAttribute(A,rt),Wh.distanceSqToSegment(l,u,y,p)>h)continue;y.applyMatrix4(this.matrixWorld);const pt=t.ray.origin.distanceTo(y);pt<t.near||pt>t.far||e.push({distance:pt,point:p.clone().applyMatrix4(this.matrixWorld),index:C,face:null,faceIndex:null,object:this})}else for(let C=Math.max(0,s.start),j=Math.min(A.count,s.start+s.count)-1;C<j;C+=x){if(l.fromBufferAttribute(A,C),u.fromBufferAttribute(A,C+1),Wh.distanceSqToSegment(l,u,y,p)>h)continue;y.applyMatrix4(this.matrixWorld);const Q=t.ray.origin.distanceTo(y);Q<t.near||Q>t.far||e.push({distance:Q,point:p.clone().applyMatrix4(this.matrixWorld),index:C,face:null,faceIndex:null,object:this})}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,n=Object.keys(e);if(n.length>0){const r=e[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=r.length;o<s;o++){const a=r[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=o}}}}else{const e=t.morphTargets;e!==void 0&&e.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}Xh.prototype.isLine=!0;const xd=new U,bd=new U;class Yh extends Xh{constructor(t,e){super(t,e),this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(t.isBufferGeometry)if(t.index===null){const e=t.attributes.position,n=[];for(let r=0,o=e.count;r<o;r+=2)xd.fromBufferAttribute(e,r),bd.fromBufferAttribute(e,r+1),n[r]=r===0?0:n[r-1],n[r+1]=n[r]+xd.distanceTo(bd);t.setAttribute("lineDistance",new An(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else t.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}}Yh.prototype.isLineSegments=!0;class S0 extends Xh{constructor(t,e){super(t,e),this.type="LineLoop"}}S0.prototype.isLineLoop=!0;class Td extends Ci{constructor(t){super(),this.type="PointsMaterial",this.color=new fn(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.morphTargets=t.morphTargets,this}}Td.prototype.isPointsMaterial=!0;const Ed=new tn,qh=new pi,yl=new Ge,xl=new U;class w0 extends Un{constructor(t=new Wn,e=new Td){super(),this.type="Points",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t){return super.copy(t),this.material=t.material,this.geometry=t.geometry,this}raycast(t,e){const n=this.geometry,r=this.matrixWorld,o=t.params.Points.threshold,s=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),yl.copy(n.boundingSphere),yl.applyMatrix4(r),yl.radius+=o,t.ray.intersectsSphere(yl)===!1)return;Ed.copy(r).invert(),qh.copy(t.ray).applyMatrix4(Ed);const a=o/((this.scale.x+this.scale.y+this.scale.z)/3),h=a*a;if(n.isBufferGeometry){const l=n.index,u=n.attributes.position;if(l!==null)for(let p=Math.max(0,s.start),y=Math.min(l.count,s.start+s.count);p<y;p++){const x=l.getX(p);xl.fromBufferAttribute(u,x),Sd(xl,x,h,r,t,e,this)}else for(let p=Math.max(0,s.start),y=Math.min(u.count,s.start+s.count);p<y;p++)xl.fromBufferAttribute(u,p),Sd(xl,p,h,r,t,e,this)}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,n=Object.keys(e);if(n.length>0){const r=e[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=r.length;o<s;o++){const a=r[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=o}}}}else{const e=t.morphTargets;e!==void 0&&e.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function Sd(i,t,e,n,r,o,s){const a=qh.distanceSqToPoint(i);if(a<e){const h=new U;qh.closestPointToPoint(i,h),h.applyMatrix4(n);const l=r.ray.origin.distanceTo(h);if(l<r.near||l>r.far)return;o.push({distance:l,distanceToRay:Math.sqrt(a),point:h,index:t,face:null,object:s})}}w0.prototype.isPoints=!0,class extends tt{constructor(i,t,e,n,r,o,s,a,h){super(i,t,e,n,r,o,s,a,h),this.format=s!==void 0?s:1022,this.minFilter=o!==void 0?o:1006,this.magFilter=r!==void 0?r:1006,this.generateMipmaps=!1;const l=this;"requestVideoFrameCallback"in i&&i.requestVideoFrameCallback(function u(){l.needsUpdate=!0,i.requestVideoFrameCallback(u)})}clone(){return new this.constructor(this.image).copy(this)}update(){const i=this.image;!("requestVideoFrameCallback"in i)&&i.readyState>=i.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}.prototype.isVideoTexture=!0;class A0 extends tt{constructor(t,e,n,r,o,s,a,h,l,u,p,y){super(null,s,a,h,l,u,r,o,p,y),this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}A0.prototype.isCompressedTexture=!0,class extends tt{constructor(i,t,e,n,r,o,s,a,h){super(i,t,e,n,r,o,s,a,h),this.needsUpdate=!0}}.prototype.isCanvasTexture=!0,class extends tt{constructor(i,t,e,n,r,o,s,a,h,l){if((l=l!==void 0?l:1026)!==1026&&l!==1027)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");e===void 0&&l===1026&&(e=1012),e===void 0&&l===1027&&(e=1020),super(null,n,r,o,s,a,l,e,h),this.image={width:i,height:t},this.magFilter=s!==void 0?s:1003,this.minFilter=a!==void 0?a:1003,this.flipY=!1,this.generateMipmaps=!1}}.prototype.isDepthTexture=!0,new U,new U,new U,new ui;class Ir{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const n=this.getUtoTmapping(t);return this.getPoint(n,e)}getPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return e}getSpacedPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let n,r=this.getPoint(0),o=0;e.push(0);for(let s=1;s<=t;s++)n=this.getPoint(s/t),o+=n.distanceTo(r),e.push(o),r=n;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const n=this.getLengths();let r=0;const o=n.length;let s;s=e||t*n[o-1];let a,h=0,l=o-1;for(;h<=l;)if(r=Math.floor(h+(l-h)/2),a=n[r]-s,a<0)h=r+1;else{if(!(a>0)){l=r;break}l=r-1}if(r=l,n[r]===s)return r/(o-1);const u=n[r];return(r+(s-u)/(n[r+1]-u))/(o-1)}getTangent(t,e){let n=t-1e-4,r=t+1e-4;n<0&&(n=0),r>1&&(r=1);const o=this.getPoint(n),s=this.getPoint(r),a=e||(o.isVector2?new R:new U);return a.copy(s).sub(o).normalize(),a}getTangentAt(t,e){const n=this.getUtoTmapping(t);return this.getTangent(n,e)}computeFrenetFrames(t,e){const n=new U,r=[],o=[],s=[],a=new U,h=new tn;for(let x=0;x<=t;x++){const E=x/t;r[x]=this.getTangentAt(E,new U),r[x].normalize()}o[0]=new U,s[0]=new U;let l=Number.MAX_VALUE;const u=Math.abs(r[0].x),p=Math.abs(r[0].y),y=Math.abs(r[0].z);u<=l&&(l=u,n.set(1,0,0)),p<=l&&(l=p,n.set(0,1,0)),y<=l&&n.set(0,0,1),a.crossVectors(r[0],n).normalize(),o[0].crossVectors(r[0],a),s[0].crossVectors(r[0],o[0]);for(let x=1;x<=t;x++){if(o[x]=o[x-1].clone(),s[x]=s[x-1].clone(),a.crossVectors(r[x-1],r[x]),a.length()>Number.EPSILON){a.normalize();const E=Math.acos(et(r[x-1].dot(r[x]),-1,1));o[x].applyMatrix4(h.makeRotationAxis(a,E))}s[x].crossVectors(r[x],o[x])}if(e===!0){let x=Math.acos(et(o[0].dot(o[t]),-1,1));x/=t,r[0].dot(a.crossVectors(o[0],o[t]))>0&&(x=-x);for(let E=1;E<=t;E++)o[E].applyMatrix4(h.makeRotationAxis(r[E],x*E)),s[E].crossVectors(r[E],o[E])}return{tangents:r,normals:o,binormals:s}}clone(){return new this.constructor().copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class bl extends Ir{constructor(t=0,e=0,n=1,r=1,o=0,s=2*Math.PI,a=!1,h=0){super(),this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=n,this.yRadius=r,this.aStartAngle=o,this.aEndAngle=s,this.aClockwise=a,this.aRotation=h}getPoint(t,e){const n=e||new R,r=2*Math.PI;let o=this.aEndAngle-this.aStartAngle;const s=Math.abs(o)<Number.EPSILON;for(;o<0;)o+=r;for(;o>r;)o-=r;o<Number.EPSILON&&(o=s?0:r),this.aClockwise!==!0||s||(o===r?o=-r:o-=r);const a=this.aStartAngle+t*o;let h=this.aX+this.xRadius*Math.cos(a),l=this.aY+this.yRadius*Math.sin(a);if(this.aRotation!==0){const u=Math.cos(this.aRotation),p=Math.sin(this.aRotation),y=h-this.aX,x=l-this.aY;h=y*u-x*p+this.aX,l=y*p+x*u+this.aY}return n.set(h,l)}copy(t){return super.copy(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}toJSON(){const t=super.toJSON();return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t}fromJSON(t){return super.fromJSON(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}}bl.prototype.isEllipseCurve=!0;class wd extends bl{constructor(t,e,n,r,o,s){super(t,e,n,n,r,o,s),this.type="ArcCurve"}}function Jh(){let i=0,t=0,e=0,n=0;function r(o,s,a,h){i=o,t=a,e=-3*o+3*s-2*a-h,n=2*o-2*s+a+h}return{initCatmullRom:function(o,s,a,h,l){r(s,a,l*(a-o),l*(h-s))},initNonuniformCatmullRom:function(o,s,a,h,l,u,p){let y=(s-o)/l-(a-o)/(l+u)+(a-s)/u,x=(a-s)/u-(h-s)/(u+p)+(h-a)/p;y*=u,x*=u,r(s,a,y,x)},calc:function(o){const s=o*o;return i+t*o+e*s+n*(s*o)}}}wd.prototype.isArcCurve=!0;const Tl=new U,Kh=new Jh,Zh=new Jh,Qh=new Jh;class Ad extends Ir{constructor(t=[],e=!1,n="centripetal",r=.5){super(),this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=n,this.tension=r}getPoint(t,e=new U){const n=e,r=this.points,o=r.length,s=(o-(this.closed?0:1))*t;let a,h,l=Math.floor(s),u=s-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/o)+1)*o:u===0&&l===o-1&&(l=o-2,u=1),this.closed||l>0?a=r[(l-1)%o]:(Tl.subVectors(r[0],r[1]).add(r[0]),a=Tl);const p=r[l%o],y=r[(l+1)%o];if(this.closed||l+2<o?h=r[(l+2)%o]:(Tl.subVectors(r[o-1],r[o-2]).add(r[o-1]),h=Tl),this.curveType==="centripetal"||this.curveType==="chordal"){const x=this.curveType==="chordal"?.5:.25;let E=Math.pow(a.distanceToSquared(p),x),A=Math.pow(p.distanceToSquared(y),x),C=Math.pow(y.distanceToSquared(h),x);A<1e-4&&(A=1),E<1e-4&&(E=A),C<1e-4&&(C=A),Kh.initNonuniformCatmullRom(a.x,p.x,y.x,h.x,E,A,C),Zh.initNonuniformCatmullRom(a.y,p.y,y.y,h.y,E,A,C),Qh.initNonuniformCatmullRom(a.z,p.z,y.z,h.z,E,A,C)}else this.curveType==="catmullrom"&&(Kh.initCatmullRom(a.x,p.x,y.x,h.x,this.tension),Zh.initCatmullRom(a.y,p.y,y.y,h.y,this.tension),Qh.initCatmullRom(a.z,p.z,y.z,h.z,this.tension));return n.set(Kh.calc(u),Zh.calc(u),Qh.calc(u)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const r=t.points[e];this.points.push(r.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,n=this.points.length;e<n;e++){const r=this.points[e];t.points.push(r.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const r=t.points[e];this.points.push(new U().fromArray(r))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}}function Md(i,t,e,n,r){const o=.5*(n-t),s=.5*(r-e),a=i*i;return(2*e-2*n+o+s)*(i*a)+(-3*e+3*n-2*o-s)*a+o*i+e}function da(i,t,e,n){return function(r,o){const s=1-r;return s*s*o}(i,t)+function(r,o){return 2*(1-r)*r*o}(i,e)+function(r,o){return r*r*o}(i,n)}function pa(i,t,e,n,r){return function(o,s){const a=1-o;return a*a*a*s}(i,t)+function(o,s){const a=1-o;return 3*a*a*o*s}(i,e)+function(o,s){return 3*(1-o)*o*o*s}(i,n)+function(o,s){return o*o*o*s}(i,r)}Ad.prototype.isCatmullRomCurve3=!0;class $h extends Ir{constructor(t=new R,e=new R,n=new R,r=new R){super(),this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=n,this.v3=r}getPoint(t,e=new R){const n=e,r=this.v0,o=this.v1,s=this.v2,a=this.v3;return n.set(pa(t,r.x,o.x,s.x,a.x),pa(t,r.y,o.y,s.y,a.y)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}$h.prototype.isCubicBezierCurve=!0;class Cd extends Ir{constructor(t=new U,e=new U,n=new U,r=new U){super(),this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=n,this.v3=r}getPoint(t,e=new U){const n=e,r=this.v0,o=this.v1,s=this.v2,a=this.v3;return n.set(pa(t,r.x,o.x,s.x,a.x),pa(t,r.y,o.y,s.y,a.y),pa(t,r.z,o.z,s.z,a.z)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}Cd.prototype.isCubicBezierCurve3=!0;class El extends Ir{constructor(t=new R,e=new R){super(),this.type="LineCurve",this.v1=t,this.v2=e}getPoint(t,e=new R){const n=e;return t===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e){const n=e||new R;return n.copy(this.v2).sub(this.v1).normalize(),n}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}El.prototype.isLineCurve=!0;class tu extends Ir{constructor(t=new R,e=new R,n=new R){super(),this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=n}getPoint(t,e=new R){const n=e,r=this.v0,o=this.v1,s=this.v2;return n.set(da(t,r.x,o.x,s.x),da(t,r.y,o.y,s.y)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}tu.prototype.isQuadraticBezierCurve=!0;class Rd extends Ir{constructor(t=new U,e=new U,n=new U){super(),this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=n}getPoint(t,e=new U){const n=e,r=this.v0,o=this.v1,s=this.v2;return n.set(da(t,r.x,o.x,s.x),da(t,r.y,o.y,s.y),da(t,r.z,o.z,s.z)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}Rd.prototype.isQuadraticBezierCurve3=!0;class eu extends Ir{constructor(t=[]){super(),this.type="SplineCurve",this.points=t}getPoint(t,e=new R){const n=e,r=this.points,o=(r.length-1)*t,s=Math.floor(o),a=o-s,h=r[s===0?s:s-1],l=r[s],u=r[s>r.length-2?r.length-1:s+1],p=r[s>r.length-3?r.length-1:s+2];return n.set(Md(a,h.x,l.x,u.x,p.x),Md(a,h.y,l.y,u.y,p.y)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const r=t.points[e];this.points.push(r.clone())}return this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,n=this.points.length;e<n;e++){const r=this.points[e];t.points.push(r.toArray())}return t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const r=t.points[e];this.points.push(new R().fromArray(r))}return this}}eu.prototype.isSplineCurve=!0;var Id=Object.freeze({__proto__:null,ArcCurve:wd,CatmullRomCurve3:Ad,CubicBezierCurve:$h,CubicBezierCurve3:Cd,EllipseCurve:bl,LineCurve:El,LineCurve3:class extends Ir{constructor(i=new U,t=new U){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=i,this.v2=t}getPoint(i,t=new U){const e=t;return i===1?e.copy(this.v2):(e.copy(this.v2).sub(this.v1),e.multiplyScalar(i).add(this.v1)),e}getPointAt(i,t){return this.getPoint(i,t)}copy(i){return super.copy(i),this.v1.copy(i.v1),this.v2.copy(i.v2),this}toJSON(){const i=super.toJSON();return i.v1=this.v1.toArray(),i.v2=this.v2.toArray(),i}fromJSON(i){return super.fromJSON(i),this.v1.fromArray(i.v1),this.v2.fromArray(i.v2),this}},QuadraticBezierCurve:tu,QuadraticBezierCurve3:Rd,SplineCurve:eu});const M0=function(i,t,e=2){const n=t&&t.length,r=n?t[0]*e:i.length;let o=Pd(i,0,r,e,!0);const s=[];if(!o||o.next===o.prev)return s;let a,h,l,u,p,y,x;if(n&&(o=function(E,A,C,j){const Q=[];let rt,pt,it,gt,ht;for(rt=0,pt=A.length;rt<pt;rt++)it=A[rt]*j,gt=rt<pt-1?A[rt+1]*j:E.length,ht=Pd(E,it,gt,j,!1),ht===ht.next&&(ht.steiner=!0),Q.push(D0(ht));for(Q.sort(O0),rt=0;rt<Q.length;rt++)N0(Q[rt],C),C=Ro(C,C.next);return C}(i,t,o,e)),i.length>80*e){a=l=i[0],h=u=i[1];for(let E=e;E<r;E+=e)p=i[E],y=i[E+1],p<a&&(a=p),y<h&&(h=y),p>l&&(l=p),y>u&&(u=y);x=Math.max(l-a,u-h),x=x!==0?1/x:0}return fa(o,s,e,a,h,x),s};function Pd(i,t,e,n,r){let o,s;if(r===function(a,h,l,u){let p=0;for(let y=h,x=l-u;y<l;y+=u)p+=(a[x]-a[y])*(a[y+1]+a[x+1]),x=y;return p}(i,t,e,n)>0)for(o=t;o<e;o+=n)s=Ld(o,i[o],i[o+1],s);else for(o=e-n;o>=t;o-=n)s=Ld(o,i[o],i[o+1],s);return s&&Sl(s,s.next)&&(ga(s),s=s.next),s}function Ro(i,t){if(!i)return i;t||(t=i);let e,n=i;do if(e=!1,n.steiner||!Sl(n,n.next)&&_i(n.prev,n,n.next)!==0)n=n.next;else{if(ga(n),n=t=n.prev,n===n.next)break;e=!0}while(e||n!==t);return t}function fa(i,t,e,n,r,o,s){if(!i)return;!s&&o&&function(u,p,y,x){let E=u;do E.z===null&&(E.z=nu(E.x,E.y,p,y,x)),E.prevZ=E.prev,E.nextZ=E.next,E=E.next;while(E!==u);E.prevZ.nextZ=null,E.prevZ=null,function(A){let C,j,Q,rt,pt,it,gt,ht,mt=1;do{for(j=A,A=null,pt=null,it=0;j;){for(it++,Q=j,gt=0,C=0;C<mt&&(gt++,Q=Q.nextZ,Q);C++);for(ht=mt;gt>0||ht>0&&Q;)gt!==0&&(ht===0||!Q||j.z<=Q.z)?(rt=j,j=j.nextZ,gt--):(rt=Q,Q=Q.nextZ,ht--),pt?pt.nextZ=rt:A=rt,rt.prevZ=pt,pt=rt;j=Q}pt.nextZ=null,mt*=2}while(it>1)}(E)}(i,n,r,o);let a,h,l=i;for(;i.prev!==i.next;)if(a=i.prev,h=i.next,o?R0(i,n,r,o):C0(i))t.push(a.i/e),t.push(i.i/e),t.push(h.i/e),ga(i),i=h.next,l=h.next;else if((i=h)===l){s?s===1?fa(i=I0(Ro(i),t,e),t,e,n,r,o,2):s===2&&P0(i,t,e,n,r,o):fa(Ro(i),t,e,n,r,o,1);break}}function C0(i){const t=i.prev,e=i,n=i.next;if(_i(t,e,n)>=0)return!1;let r=i.next.next;for(;r!==i.prev;){if(As(t.x,t.y,e.x,e.y,n.x,n.y,r.x,r.y)&&_i(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function R0(i,t,e,n){const r=i.prev,o=i,s=i.next;if(_i(r,o,s)>=0)return!1;const a=r.x<o.x?r.x<s.x?r.x:s.x:o.x<s.x?o.x:s.x,h=r.y<o.y?r.y<s.y?r.y:s.y:o.y<s.y?o.y:s.y,l=r.x>o.x?r.x>s.x?r.x:s.x:o.x>s.x?o.x:s.x,u=r.y>o.y?r.y>s.y?r.y:s.y:o.y>s.y?o.y:s.y,p=nu(a,h,t,e,n),y=nu(l,u,t,e,n);let x=i.prevZ,E=i.nextZ;for(;x&&x.z>=p&&E&&E.z<=y;){if(x!==i.prev&&x!==i.next&&As(r.x,r.y,o.x,o.y,s.x,s.y,x.x,x.y)&&_i(x.prev,x,x.next)>=0||(x=x.prevZ,E!==i.prev&&E!==i.next&&As(r.x,r.y,o.x,o.y,s.x,s.y,E.x,E.y)&&_i(E.prev,E,E.next)>=0))return!1;E=E.nextZ}for(;x&&x.z>=p;){if(x!==i.prev&&x!==i.next&&As(r.x,r.y,o.x,o.y,s.x,s.y,x.x,x.y)&&_i(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;E&&E.z<=y;){if(E!==i.prev&&E!==i.next&&As(r.x,r.y,o.x,o.y,s.x,s.y,E.x,E.y)&&_i(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function I0(i,t,e){let n=i;do{const r=n.prev,o=n.next.next;!Sl(r,o)&&Od(r,n,n.next,o)&&ma(r,o)&&ma(o,r)&&(t.push(r.i/e),t.push(n.i/e),t.push(o.i/e),ga(n),ga(n.next),n=i=o),n=n.next}while(n!==i);return Ro(n)}function P0(i,t,e,n,r,o){let s=i;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&F0(s,a)){let h=Nd(s,a);return s=Ro(s,s.next),h=Ro(h,h.next),fa(s,t,e,n,r,o),void fa(h,t,e,n,r,o)}a=a.next}s=s.next}while(s!==i)}function O0(i,t){return i.x-t.x}function N0(i,t){if(t=function(e,n){let r=n;const o=e.x,s=e.y;let a,h=-1/0;do{if(s<=r.y&&s>=r.next.y&&r.next.y!==r.y){const E=r.x+(s-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(E<=o&&E>h){if(h=E,E===o){if(s===r.y)return r;if(s===r.next.y)return r.next}a=r.x<r.next.x?r:r.next}}r=r.next}while(r!==n);if(!a)return null;if(o===h)return a;const l=a,u=a.x,p=a.y;let y,x=1/0;r=a;do o>=r.x&&r.x>=u&&o!==r.x&&As(s<p?o:h,s,u,p,s<p?h:o,s,r.x,r.y)&&(y=Math.abs(s-r.y)/(o-r.x),ma(r,e)&&(y<x||y===x&&(r.x>a.x||r.x===a.x&&L0(a,r)))&&(a=r,x=y)),r=r.next;while(r!==l);return a}(i,t)){const e=Nd(t,i);Ro(t,t.next),Ro(e,e.next)}}function L0(i,t){return _i(i.prev,i,t.prev)<0&&_i(t.next,i,i.next)<0}function nu(i,t,e,n,r){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=32767*(i-e)*r)|i<<8))|i<<4))|i<<2))|i<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function D0(i){let t=i,e=i;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==i);return e}function As(i,t,e,n,r,o,s,a){return(r-s)*(t-a)-(i-s)*(o-a)>=0&&(i-s)*(n-a)-(e-s)*(t-a)>=0&&(e-s)*(o-a)-(r-s)*(n-a)>=0}function F0(i,t){return i.next.i!==t.i&&i.prev.i!==t.i&&!function(e,n){let r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==n.i&&r.next.i!==n.i&&Od(r,r.next,e,n))return!0;r=r.next}while(r!==e);return!1}(i,t)&&(ma(i,t)&&ma(t,i)&&function(e,n){let r=e,o=!1;const s=(e.x+n.x)/2,a=(e.y+n.y)/2;do r.y>a!=r.next.y>a&&r.next.y!==r.y&&s<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(o=!o),r=r.next;while(r!==e);return o}(i,t)&&(_i(i.prev,i,t.prev)||_i(i,t.prev,t))||Sl(i,t)&&_i(i.prev,i,i.next)>0&&_i(t.prev,t,t.next)>0)}function _i(i,t,e){return(t.y-i.y)*(e.x-t.x)-(t.x-i.x)*(e.y-t.y)}function Sl(i,t){return i.x===t.x&&i.y===t.y}function Od(i,t,e,n){const r=Al(_i(i,t,e)),o=Al(_i(i,t,n)),s=Al(_i(e,n,i)),a=Al(_i(e,n,t));return r!==o&&s!==a||!(r!==0||!wl(i,e,t))||!(o!==0||!wl(i,n,t))||!(s!==0||!wl(e,i,n))||!(a!==0||!wl(e,t,n))}function wl(i,t,e){return t.x<=Math.max(i.x,e.x)&&t.x>=Math.min(i.x,e.x)&&t.y<=Math.max(i.y,e.y)&&t.y>=Math.min(i.y,e.y)}function Al(i){return i>0?1:i<0?-1:0}function ma(i,t){return _i(i.prev,i,i.next)<0?_i(i,t,i.next)>=0&&_i(i,i.prev,t)>=0:_i(i,t,i.prev)<0||_i(i,i.next,t)<0}function Nd(i,t){const e=new iu(i.i,i.x,i.y),n=new iu(t.i,t.x,t.y),r=i.next,o=t.prev;return i.next=t,t.prev=i,e.next=r,r.prev=e,n.next=e,e.prev=n,o.next=n,n.prev=o,n}function Ld(i,t,e,n){const r=new iu(i,t,e);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function ga(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function iu(i,t,e){this.i=i,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}class Io{static area(t){const e=t.length;let n=0;for(let r=e-1,o=0;o<e;r=o++)n+=t[r].x*t[o].y-t[o].x*t[r].y;return .5*n}static isClockWise(t){return Io.area(t)<0}static triangulateShape(t,e){const n=[],r=[],o=[];Dd(t),Fd(n,t);let s=t.length;e.forEach(Dd);for(let h=0;h<e.length;h++)r.push(s),s+=e[h].length,Fd(n,e[h]);const a=M0(n,r);for(let h=0;h<a.length;h+=3)o.push(a.slice(h,h+3));return o}}function Dd(i){const t=i.length;t>2&&i[t-1].equals(i[0])&&i.pop()}function Fd(i,t){for(let e=0;e<t.length;e++)i.push(t[e].x),i.push(t[e].y)}class Ms extends Wn{constructor(t,e){super(),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];const n=this,r=[],o=[];for(let a=0,h=t.length;a<h;a++)s(t[a]);function s(a){const h=[],l=e.curveSegments!==void 0?e.curveSegments:12,u=e.steps!==void 0?e.steps:1;let p=e.depth!==void 0?e.depth:100,y=e.bevelEnabled===void 0||e.bevelEnabled,x=e.bevelThickness!==void 0?e.bevelThickness:6,E=e.bevelSize!==void 0?e.bevelSize:x-2,A=e.bevelOffset!==void 0?e.bevelOffset:0,C=e.bevelSegments!==void 0?e.bevelSegments:3;const j=e.extrudePath,Q=e.UVGenerator!==void 0?e.UVGenerator:B0;e.amount!==void 0&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),p=e.amount);let rt,pt,it,gt,ht,mt=!1;j&&(rt=j.getSpacedPoints(u),mt=!0,y=!1,pt=j.computeFrenetFrames(u,!1),it=new U,gt=new U,ht=new U),y||(C=0,x=0,E=0,A=0);const jt=a.extractPoints(l);let Ft=jt.shape;const Mt=jt.holes;if(!Io.isClockWise(Ft)){Ft=Ft.reverse();for(let ue=0,bt=Mt.length;ue<bt;ue++){const Ht=Mt[ue];Io.isClockWise(Ht)&&(Mt[ue]=Ht.reverse())}}const wt=Io.triangulateShape(Ft,Mt),Pt=Ft;for(let ue=0,bt=Mt.length;ue<bt;ue++){const Ht=Mt[ue];Ft=Ft.concat(Ht)}function Nt(ue,bt,Ht){return bt||console.error("THREE.ExtrudeGeometry: vec does not exist"),bt.clone().multiplyScalar(Ht).add(ue)}const ne=Ft.length,$t=wt.length;function Vt(ue,bt,Ht){let ie,ae,qt;const ye=ue.x-bt.x,nn=ue.y-bt.y,on=Ht.x-ue.x,rn=Ht.y-ue.y,Sn=ye*ye+nn*nn,Ai=ye*rn-nn*on;if(Math.abs(Ai)>Number.EPSILON){const Jn=Math.sqrt(Sn),dr=Math.sqrt(on*on+rn*rn),za=bt.x-nn/Jn,Va=bt.y+ye/Jn,Wa=((Ht.x-rn/dr-za)*rn-(Ht.y+on/dr-Va)*on)/(ye*rn-nn*on);ie=za+ye*Wa-ue.x,ae=Va+nn*Wa-ue.y;const hr=ie*ie+ae*ae;if(hr<=2)return new R(ie,ae);qt=Math.sqrt(hr/2)}else{let Jn=!1;ye>Number.EPSILON?on>Number.EPSILON&&(Jn=!0):ye<-Number.EPSILON?on<-Number.EPSILON&&(Jn=!0):Math.sign(nn)===Math.sign(rn)&&(Jn=!0),Jn?(ie=-nn,ae=ye,qt=Math.sqrt(Sn)):(ie=ye,ae=nn,qt=Math.sqrt(Sn/2))}return new R(ie/qt,ae/qt)}const Yt=[];for(let ue=0,bt=Pt.length,Ht=bt-1,ie=ue+1;ue<bt;ue++,Ht++,ie++)Ht===bt&&(Ht=0),ie===bt&&(ie=0),Yt[ue]=Vt(Pt[ue],Pt[Ht],Pt[ie]);const ge=[];let be,Pe=Yt.concat();for(let ue=0,bt=Mt.length;ue<bt;ue++){const Ht=Mt[ue];be=[];for(let ie=0,ae=Ht.length,qt=ae-1,ye=ie+1;ie<ae;ie++,qt++,ye++)qt===ae&&(qt=0),ye===ae&&(ye=0),be[ie]=Vt(Ht[ie],Ht[qt],Ht[ye]);ge.push(be),Pe=Pe.concat(be)}for(let ue=0;ue<C;ue++){const bt=ue/C,Ht=x*Math.cos(bt*Math.PI/2),ie=E*Math.sin(bt*Math.PI/2)+A;for(let ae=0,qt=Pt.length;ae<qt;ae++){const ye=Nt(Pt[ae],Yt[ae],ie);ve(ye.x,ye.y,-Ht)}for(let ae=0,qt=Mt.length;ae<qt;ae++){const ye=Mt[ae];be=ge[ae];for(let nn=0,on=ye.length;nn<on;nn++){const rn=Nt(ye[nn],be[nn],ie);ve(rn.x,rn.y,-Ht)}}}const Ct=E+A;for(let ue=0;ue<ne;ue++){const bt=y?Nt(Ft[ue],Pe[ue],Ct):Ft[ue];mt?(gt.copy(pt.normals[0]).multiplyScalar(bt.x),it.copy(pt.binormals[0]).multiplyScalar(bt.y),ht.copy(rt[0]).add(gt).add(it),ve(ht.x,ht.y,ht.z)):ve(bt.x,bt.y,0)}for(let ue=1;ue<=u;ue++)for(let bt=0;bt<ne;bt++){const Ht=y?Nt(Ft[bt],Pe[bt],Ct):Ft[bt];mt?(gt.copy(pt.normals[ue]).multiplyScalar(Ht.x),it.copy(pt.binormals[ue]).multiplyScalar(Ht.y),ht.copy(rt[ue]).add(gt).add(it),ve(ht.x,ht.y,ht.z)):ve(Ht.x,Ht.y,p/u*ue)}for(let ue=C-1;ue>=0;ue--){const bt=ue/C,Ht=x*Math.cos(bt*Math.PI/2),ie=E*Math.sin(bt*Math.PI/2)+A;for(let ae=0,qt=Pt.length;ae<qt;ae++){const ye=Nt(Pt[ae],Yt[ae],ie);ve(ye.x,ye.y,p+Ht)}for(let ae=0,qt=Mt.length;ae<qt;ae++){const ye=Mt[ae];be=ge[ae];for(let nn=0,on=ye.length;nn<on;nn++){const rn=Nt(ye[nn],be[nn],ie);mt?ve(rn.x,rn.y+rt[u-1].y,rt[u-1].x+Ht):ve(rn.x,rn.y,p+Ht)}}}function Bt(ue,bt){let Ht=ue.length;for(;--Ht>=0;){const ie=Ht;let ae=Ht-1;ae<0&&(ae=ue.length-1);for(let qt=0,ye=u+2*C;qt<ye;qt++){const nn=ne*qt,on=ne*(qt+1);se(bt+ie+nn,bt+ae+nn,bt+ae+on,bt+ie+on)}}}function ve(ue,bt,Ht){h.push(ue),h.push(bt),h.push(Ht)}function le(ue,bt,Ht){Ie(ue),Ie(bt),Ie(Ht);const ie=r.length/3,ae=Q.generateTopUV(n,r,ie-3,ie-2,ie-1);Le(ae[0]),Le(ae[1]),Le(ae[2])}function se(ue,bt,Ht,ie){Ie(ue),Ie(bt),Ie(ie),Ie(bt),Ie(Ht),Ie(ie);const ae=r.length/3,qt=Q.generateSideWallUV(n,r,ae-6,ae-3,ae-2,ae-1);Le(qt[0]),Le(qt[1]),Le(qt[3]),Le(qt[1]),Le(qt[2]),Le(qt[3])}function Ie(ue){r.push(h[3*ue+0]),r.push(h[3*ue+1]),r.push(h[3*ue+2])}function Le(ue){o.push(ue.x),o.push(ue.y)}(function(){const ue=r.length/3;if(y){let bt=0,Ht=ne*bt;for(let ie=0;ie<$t;ie++){const ae=wt[ie];le(ae[2]+Ht,ae[1]+Ht,ae[0]+Ht)}bt=u+2*C,Ht=ne*bt;for(let ie=0;ie<$t;ie++){const ae=wt[ie];le(ae[0]+Ht,ae[1]+Ht,ae[2]+Ht)}}else{for(let bt=0;bt<$t;bt++){const Ht=wt[bt];le(Ht[2],Ht[1],Ht[0])}for(let bt=0;bt<$t;bt++){const Ht=wt[bt];le(Ht[0]+ne*u,Ht[1]+ne*u,Ht[2]+ne*u)}}n.addGroup(ue,r.length/3-ue,0)})(),function(){const ue=r.length/3;let bt=0;Bt(Pt,bt),bt+=Pt.length;for(let Ht=0,ie=Mt.length;Ht<ie;Ht++){const ae=Mt[Ht];Bt(ae,bt),bt+=ae.length}n.addGroup(ue,r.length/3-ue,1)}()}this.setAttribute("position",new An(r,3)),this.setAttribute("uv",new An(o,2)),this.computeVertexNormals()}toJSON(){const t=super.toJSON();return function(e,n,r){if(r.shapes=[],Array.isArray(e))for(let o=0,s=e.length;o<s;o++){const a=e[o];r.shapes.push(a.uuid)}else r.shapes.push(e.uuid);return n.extrudePath!==void 0&&(r.options.extrudePath=n.extrudePath.toJSON()),r}(this.parameters.shapes,this.parameters.options,t)}static fromJSON(t,e){const n=[];for(let o=0,s=t.shapes.length;o<s;o++){const a=e[t.shapes[o]];n.push(a)}const r=t.options.extrudePath;return r!==void 0&&(t.options.extrudePath=new Id[r.type]().fromJSON(r)),new Ms(n,t.options)}}const B0={generateTopUV:function(i,t,e,n,r){const o=t[3*e],s=t[3*e+1],a=t[3*n],h=t[3*n+1],l=t[3*r],u=t[3*r+1];return[new R(o,s),new R(a,h),new R(l,u)]},generateSideWallUV:function(i,t,e,n,r,o){const s=t[3*e],a=t[3*e+1],h=t[3*e+2],l=t[3*n],u=t[3*n+1],p=t[3*n+2],y=t[3*r],x=t[3*r+1],E=t[3*r+2],A=t[3*o],C=t[3*o+1],j=t[3*o+2];return Math.abs(a-u)<Math.abs(s-l)?[new R(s,1-h),new R(l,1-p),new R(y,1-E),new R(A,1-j)]:[new R(a,1-h),new R(u,1-p),new R(x,1-E),new R(C,1-j)]}};class ru extends Wn{constructor(t,e=12){super(),this.type="ShapeGeometry",this.parameters={shapes:t,curveSegments:e};const n=[],r=[],o=[],s=[];let a=0,h=0;if(Array.isArray(t)===!1)l(t);else for(let u=0;u<t.length;u++)l(t[u]),this.addGroup(a,h,u),a+=h,h=0;function l(u){const p=r.length/3,y=u.extractPoints(e);let x=y.shape;const E=y.holes;Io.isClockWise(x)===!1&&(x=x.reverse());for(let C=0,j=E.length;C<j;C++){const Q=E[C];Io.isClockWise(Q)===!0&&(E[C]=Q.reverse())}const A=Io.triangulateShape(x,E);for(let C=0,j=E.length;C<j;C++){const Q=E[C];x=x.concat(Q)}for(let C=0,j=x.length;C<j;C++){const Q=x[C];r.push(Q.x,Q.y,0),o.push(0,0,1),s.push(Q.x,Q.y)}for(let C=0,j=A.length;C<j;C++){const Q=A[C],rt=Q[0]+p,pt=Q[1]+p,it=Q[2]+p;n.push(rt,pt,it),h+=3}}this.setIndex(n),this.setAttribute("position",new An(r,3)),this.setAttribute("normal",new An(o,3)),this.setAttribute("uv",new An(s,2))}toJSON(){const t=super.toJSON();return function(e,n){if(n.shapes=[],Array.isArray(e))for(let r=0,o=e.length;r<o;r++){const s=e[r];n.shapes.push(s.uuid)}else n.shapes.push(e.uuid);return n}(this.parameters.shapes,t)}static fromJSON(t,e){const n=[];for(let r=0,o=t.shapes.length;r<o;r++){const s=e[t.shapes[r]];n.push(s)}return new ru(n,t.curveSegments)}}class U0 extends Ci{constructor(t){super(),this.type="ShadowMaterial",this.color=new fn(0),this.transparent=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this}}U0.prototype.isShadowMaterial=!0;class k0 extends hn{constructor(t){super(t),this.type="RawShaderMaterial"}}k0.prototype.isRawShaderMaterial=!0;class Bd extends Ci{constructor(t){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new fn(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new fn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new R(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.vertexTangents=!1,this.setValues(t)}copy(t){return super.copy(t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.flatShading=t.flatShading,this.vertexTangents=t.vertexTangents,this}}Bd.prototype.isMeshStandardMaterial=!0;class G0 extends Bd{constructor(t){super(),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new R(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,Object.defineProperty(this,"ior",{get:function(){return(1+.4*this.reflectivity)/(1-.4*this.reflectivity)},set:function(e){this.reflectivity=et(2.5*(e-1)/(e+1),0,1)}}),this.sheen=null,this.transmission=0,this.transmissionMap=null,this.thickness=.01,this.thicknessMap=null,this.attenuationDistance=0,this.attenuationColor=new fn(1,1,1),this.setValues(t)}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.reflectivity=t.reflectivity,t.sheen?this.sheen=(this.sheen||new fn).copy(t.sheen):this.sheen=null,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this}}G0.prototype.isMeshPhysicalMaterial=!0;class Ud extends Ci{constructor(t){super(),this.type="MeshPhongMaterial",this.color=new fn(16777215),this.specular=new fn(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new fn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new R(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.flatShading=t.flatShading,this}}Ud.prototype.isMeshPhongMaterial=!0;class H0 extends Ci{constructor(t){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new fn(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new fn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new R(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this}}H0.prototype.isMeshToonMaterial=!0;class j0 extends Ci{constructor(t){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new R(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.flatShading=t.flatShading,this}}j0.prototype.isMeshNormalMaterial=!0;class z0 extends Ci{constructor(t){super(),this.type="MeshLambertMaterial",this.color=new fn(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new fn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this}}z0.prototype.isMeshLambertMaterial=!0;class V0 extends Ci{constructor(t){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new fn(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new R(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.flatShading=t.flatShading,this}}V0.prototype.isMeshMatcapMaterial=!0;class W0 extends ca{constructor(t){super(),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}W0.prototype.isLineDashedMaterial=!0;const ci={arraySlice:function(i,t,e){return ci.isTypedArray(i)?new i.constructor(i.subarray(t,e!==void 0?e:i.length)):i.slice(t,e)},convertArray:function(i,t,e){return!i||!e&&i.constructor===t?i:typeof t.BYTES_PER_ELEMENT=="number"?new t(i):Array.prototype.slice.call(i)},isTypedArray:function(i){return ArrayBuffer.isView(i)&&!(i instanceof DataView)},getKeyframeOrder:function(i){const t=i.length,e=new Array(t);for(let n=0;n!==t;++n)e[n]=n;return e.sort(function(n,r){return i[n]-i[r]}),e},sortedArray:function(i,t,e){const n=i.length,r=new i.constructor(n);for(let o=0,s=0;s!==n;++o){const a=e[o]*t;for(let h=0;h!==t;++h)r[s++]=i[a+h]}return r},flattenJSON:function(i,t,e,n){let r=1,o=i[0];for(;o!==void 0&&o[n]===void 0;)o=i[r++];if(o===void 0)return;let s=o[n];if(s!==void 0)if(Array.isArray(s))do s=o[n],s!==void 0&&(t.push(o.time),e.push.apply(e,s)),o=i[r++];while(o!==void 0);else if(s.toArray!==void 0)do s=o[n],s!==void 0&&(t.push(o.time),s.toArray(e,e.length)),o=i[r++];while(o!==void 0);else do s=o[n],s!==void 0&&(t.push(o.time),e.push(s)),o=i[r++];while(o!==void 0)},subclip:function(i,t,e,n,r=30){const o=i.clone();o.name=t;const s=[];for(let h=0;h<o.tracks.length;++h){const l=o.tracks[h],u=l.getValueSize(),p=[],y=[];for(let x=0;x<l.times.length;++x){const E=l.times[x]*r;if(!(E<e||E>=n)){p.push(l.times[x]);for(let A=0;A<u;++A)y.push(l.values[x*u+A])}}p.length!==0&&(l.times=ci.convertArray(p,l.times.constructor),l.values=ci.convertArray(y,l.values.constructor),s.push(l))}o.tracks=s;let a=1/0;for(let h=0;h<o.tracks.length;++h)a>o.tracks[h].times[0]&&(a=o.tracks[h].times[0]);for(let h=0;h<o.tracks.length;++h)o.tracks[h].shift(-1*a);return o.resetDuration(),o},makeClipAdditive:function(i,t=0,e=i,n=30){n<=0&&(n=30);const r=e.tracks.length,o=t/n;for(let s=0;s<r;++s){const a=e.tracks[s],h=a.ValueTypeName;if(h==="bool"||h==="string")continue;const l=i.tracks.find(function(j){return j.name===a.name&&j.ValueTypeName===h});if(l===void 0)continue;let u=0;const p=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(u=p/3);let y=0;const x=l.getValueSize();l.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(y=x/3);const E=a.times.length-1;let A;if(o<=a.times[0]){const j=u,Q=p-u;A=ci.arraySlice(a.values,j,Q)}else if(o>=a.times[E]){const j=E*p+u,Q=j+p-u;A=ci.arraySlice(a.values,j,Q)}else{const j=a.createInterpolant(),Q=u,rt=p-u;j.evaluate(o),A=ci.arraySlice(j.resultBuffer,Q,rt)}h==="quaternion"&&new z().fromArray(A).normalize().conjugate().toArray(A);const C=l.times.length;for(let j=0;j<C;++j){const Q=j*x+y;if(h==="quaternion")z.multiplyQuaternionsFlat(l.values,Q,A,0,l.values,Q);else{const rt=x-2*y;for(let pt=0;pt<rt;++pt)l.values[Q+pt]-=A[pt]}}}return i.blendMode=2501,i}};class Po{constructor(t,e,n,r){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=r!==void 0?r:new e.constructor(n),this.sampleValues=e,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(t){const e=this.parameterPositions;let n=this._cachedIndex,r=e[n],o=e[n-1];t:{e:{let s;n:{i:if(!(t<r)){for(let a=n+2;;){if(r===void 0){if(t<o)break i;return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,t,o)}if(n===a)break;if(o=r,r=e[++n],t<r)break e}s=e.length;break n}if(t>=o)break t;{const a=e[1];t<a&&(n=2,o=a);for(let h=n-2;;){if(o===void 0)return this._cachedIndex=0,this.beforeStart_(0,t,r);if(n===h)break;if(r=o,o=e[--n-1],t>=o)break e}s=n,n=0}}for(;n<s;){const a=n+s>>>1;t<e[a]?s=a:n=a+1}if(r=e[n],o=e[n-1],o===void 0)return this._cachedIndex=0,this.beforeStart_(0,t,r);if(r===void 0)return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,o,t)}this._cachedIndex=n,this.intervalChanged_(n,o,r)}return this.interpolate_(n,o,t,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){const e=this.resultBuffer,n=this.sampleValues,r=this.valueSize,o=t*r;for(let s=0;s!==r;++s)e[s]=n[o+s];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}Po.prototype.beforeStart_=Po.prototype.copySampleValue_,Po.prototype.afterEnd_=Po.prototype.copySampleValue_;class X0 extends Po{constructor(t,e,n,r){super(t,e,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:2400,endingEnd:2400}}intervalChanged_(t,e,n){const r=this.parameterPositions;let o=t-2,s=t+1,a=r[o],h=r[s];if(a===void 0)switch(this.getSettings_().endingStart){case 2401:o=t,a=2*e-n;break;case 2402:o=r.length-2,a=e+r[o]-r[o+1];break;default:o=t,a=n}if(h===void 0)switch(this.getSettings_().endingEnd){case 2401:s=t,h=2*n-e;break;case 2402:s=1,h=n+r[1]-r[0];break;default:s=t-1,h=e}const l=.5*(n-e),u=this.valueSize;this._weightPrev=l/(e-a),this._weightNext=l/(h-n),this._offsetPrev=o*u,this._offsetNext=s*u}interpolate_(t,e,n,r){const o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,h=t*a,l=h-a,u=this._offsetPrev,p=this._offsetNext,y=this._weightPrev,x=this._weightNext,E=(n-e)/(r-e),A=E*E,C=A*E,j=-y*C+2*y*A-y*E,Q=(1+y)*C+(-1.5-2*y)*A+(-.5+y)*E+1,rt=(-1-x)*C+(1.5+x)*A+.5*E,pt=x*C-x*A;for(let it=0;it!==a;++it)o[it]=j*s[u+it]+Q*s[l+it]+rt*s[h+it]+pt*s[p+it];return o}}class kd extends Po{constructor(t,e,n,r){super(t,e,n,r)}interpolate_(t,e,n,r){const o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,h=t*a,l=h-a,u=(n-e)/(r-e),p=1-u;for(let y=0;y!==a;++y)o[y]=s[l+y]*p+s[h+y]*u;return o}}class Y0 extends Po{constructor(t,e,n,r){super(t,e,n,r)}interpolate_(t){return this.copySampleValue_(t-1)}}class Wr{constructor(t,e,n,r){if(t===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(e===void 0||e.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=ci.convertArray(e,this.TimeBufferType),this.values=ci.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(t){const e=t.constructor;let n;if(e.toJSON!==this.toJSON)n=e.toJSON(t);else{n={name:t.name,times:ci.convertArray(t.times,Array),values:ci.convertArray(t.values,Array)};const r=t.getInterpolation();r!==t.DefaultInterpolation&&(n.interpolation=r)}return n.type=t.ValueTypeName,n}InterpolantFactoryMethodDiscrete(t){return new Y0(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new kd(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new X0(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case 2300:e=this.InterpolantFactoryMethodDiscrete;break;case 2301:e=this.InterpolantFactoryMethodLinear;break;case 2302:e=this.InterpolantFactoryMethodSmooth}if(e===void 0){const n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0){if(t===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}}getValueSize(){return this.values.length/this.times.length}shift(t){if(t!==0){const e=this.times;for(let n=0,r=e.length;n!==r;++n)e[n]+=t}return this}scale(t){if(t!==1){const e=this.times;for(let n=0,r=e.length;n!==r;++n)e[n]*=t}return this}trim(t,e){const n=this.times,r=n.length;let o=0,s=r-1;for(;o!==r&&n[o]<t;)++o;for(;s!==-1&&n[s]>e;)--s;if(++s,o!==0||s!==r){o>=s&&(s=Math.max(s,1),o=s-1);const a=this.getValueSize();this.times=ci.arraySlice(n,o,s),this.values=ci.arraySlice(this.values,o*a,s*a)}return this}validate(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const n=this.times,r=this.values,o=n.length;o===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let s=null;for(let a=0;a!==o;a++){const h=n[a];if(typeof h=="number"&&isNaN(h)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,h),t=!1;break}if(s!==null&&s>h){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,h,s),t=!1;break}s=h}if(r!==void 0&&ci.isTypedArray(r))for(let a=0,h=r.length;a!==h;++a){const l=r[a];if(isNaN(l)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,l),t=!1;break}}return t}optimize(){const t=ci.arraySlice(this.times),e=ci.arraySlice(this.values),n=this.getValueSize(),r=this.getInterpolation()===2302,o=t.length-1;let s=1;for(let a=1;a<o;++a){let h=!1;const l=t[a];if(l!==t[a+1]&&(a!==1||l!==t[0]))if(r)h=!0;else{const u=a*n,p=u-n,y=u+n;for(let x=0;x!==n;++x){const E=e[u+x];if(E!==e[p+x]||E!==e[y+x]){h=!0;break}}}if(h){if(a!==s){t[s]=t[a];const u=a*n,p=s*n;for(let y=0;y!==n;++y)e[p+y]=e[u+y]}++s}}if(o>0){t[s]=t[o];for(let a=o*n,h=s*n,l=0;l!==n;++l)e[h+l]=e[a+l];++s}return s!==t.length?(this.times=ci.arraySlice(t,0,s),this.values=ci.arraySlice(e,0,s*n)):(this.times=t,this.values=e),this}clone(){const t=ci.arraySlice(this.times,0),e=ci.arraySlice(this.values,0),n=new this.constructor(this.name,t,e);return n.createInterpolant=this.createInterpolant,n}}Wr.prototype.TimeBufferType=Float32Array,Wr.prototype.ValueBufferType=Float32Array,Wr.prototype.DefaultInterpolation=2301;class Cs extends Wr{}Cs.prototype.ValueTypeName="bool",Cs.prototype.ValueBufferType=Array,Cs.prototype.DefaultInterpolation=2300,Cs.prototype.InterpolantFactoryMethodLinear=void 0,Cs.prototype.InterpolantFactoryMethodSmooth=void 0;class Gd extends Wr{}Gd.prototype.ValueTypeName="color";class Ml extends Wr{}Ml.prototype.ValueTypeName="number";class q0 extends Po{constructor(t,e,n,r){super(t,e,n,r)}interpolate_(t,e,n,r){const o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,h=(n-e)/(r-e);let l=t*a;for(let u=l+a;l!==u;l+=4)z.slerpFlat(o,0,s,l-a,s,l,h);return o}}class va extends Wr{InterpolantFactoryMethodLinear(t){return new q0(this.times,this.values,this.getValueSize(),t)}}va.prototype.ValueTypeName="quaternion",va.prototype.DefaultInterpolation=2301,va.prototype.InterpolantFactoryMethodSmooth=void 0;class Rs extends Wr{}Rs.prototype.ValueTypeName="string",Rs.prototype.ValueBufferType=Array,Rs.prototype.DefaultInterpolation=2300,Rs.prototype.InterpolantFactoryMethodLinear=void 0,Rs.prototype.InterpolantFactoryMethodSmooth=void 0;class Cl extends Wr{}Cl.prototype.ValueTypeName="vector";class Hd{constructor(t,e=-1,n,r=2500){this.name=t,this.tracks=n,this.duration=e,this.blendMode=r,this.uuid=X(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],n=t.tracks,r=1/(t.fps||1);for(let s=0,a=n.length;s!==a;++s)e.push(J0(n[s]).scale(r));const o=new this(t.name,t.duration,e,t.blendMode);return o.uuid=t.uuid,o}static toJSON(t){const e=[],n=t.tracks,r={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let o=0,s=n.length;o!==s;++o)e.push(Wr.toJSON(n[o]));return r}static CreateFromMorphTargetSequence(t,e,n,r){const o=e.length,s=[];for(let a=0;a<o;a++){let h=[],l=[];h.push((a+o-1)%o,a,(a+1)%o),l.push(0,1,0);const u=ci.getKeyframeOrder(h);h=ci.sortedArray(h,1,u),l=ci.sortedArray(l,1,u),r||h[0]!==0||(h.push(o),l.push(l[0])),s.push(new Ml(".morphTargetInfluences["+e[a].name+"]",h,l).scale(1/n))}return new this(t,-1,s)}static findByName(t,e){let n=t;if(!Array.isArray(t)){const r=t;n=r.geometry&&r.geometry.animations||r.animations}for(let r=0;r<n.length;r++)if(n[r].name===e)return n[r];return null}static CreateClipsFromMorphTargetSequences(t,e,n){const r={},o=/^([\w-]*?)([\d]+)$/;for(let a=0,h=t.length;a<h;a++){const l=t[a],u=l.name.match(o);if(u&&u.length>1){const p=u[1];let y=r[p];y||(r[p]=y=[]),y.push(l)}}const s=[];for(const a in r)s.push(this.CreateFromMorphTargetSequence(a,r[a],e,n));return s}static parseAnimation(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(u,p,y,x,E){if(y.length!==0){const A=[],C=[];ci.flattenJSON(y,A,C,x),A.length!==0&&E.push(new u(p,A,C))}},r=[],o=t.name||"default",s=t.fps||30,a=t.blendMode;let h=t.length||-1;const l=t.hierarchy||[];for(let u=0;u<l.length;u++){const p=l[u].keys;if(p&&p.length!==0)if(p[0].morphTargets){const y={};let x;for(x=0;x<p.length;x++)if(p[x].morphTargets)for(let E=0;E<p[x].morphTargets.length;E++)y[p[x].morphTargets[E]]=-1;for(const E in y){const A=[],C=[];for(let j=0;j!==p[x].morphTargets.length;++j){const Q=p[x];A.push(Q.time),C.push(Q.morphTarget===E?1:0)}r.push(new Ml(".morphTargetInfluence["+E+"]",A,C))}h=y.length*(s||1)}else{const y=".bones["+e[u].name+"]";n(Cl,y+".position",p,"pos",r),n(va,y+".quaternion",p,"rot",r),n(Cl,y+".scale",p,"scl",r)}}return r.length===0?null:new this(o,h,r,a)}resetDuration(){let t=0;for(let e=0,n=this.tracks.length;e!==n;++e){const r=this.tracks[e];t=Math.max(t,r.times[r.times.length-1])}return this.duration=t,this}trim(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this}validate(){let t=!0;for(let e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t}optimize(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}clone(){const t=[];for(let e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new this.constructor(this.name,this.duration,t,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function J0(i){if(i.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Ml;case"vector":case"vector2":case"vector3":case"vector4":return Cl;case"color":return Gd;case"quaternion":return va;case"bool":case"boolean":return Cs;case"string":return Rs}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(i.type);if(i.times===void 0){const e=[],n=[];ci.flattenJSON(i.keys,e,n,"value"),i.times=e,i.values=n}return t.parse!==void 0?t.parse(i):new t(i.name,i.times,i.values,i.interpolation)}const Is={enabled:!1,files:{},add:function(i,t){this.enabled!==!1&&(this.files[i]=t)},get:function(i){if(this.enabled!==!1)return this.files[i]},remove:function(i){delete this.files[i]},clear:function(){this.files={}}};class K0{constructor(t,e,n){const r=this;let o=!1,s=0,a=0,h;const l=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(u){a++,o===!1&&r.onStart!==void 0&&r.onStart(u,s,a),o=!0},this.itemEnd=function(u){s++,r.onProgress!==void 0&&r.onProgress(u,s,a),s===a&&(o=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(u){r.onError!==void 0&&r.onError(u)},this.resolveURL=function(u){return h?h(u):u},this.setURLModifier=function(u){return h=u,this},this.addHandler=function(u,p){return l.push(u,p),this},this.removeHandler=function(u){const p=l.indexOf(u);return p!==-1&&l.splice(p,2),this},this.getHandler=function(u){for(let p=0,y=l.length;p<y;p+=2){const x=l[p],E=l[p+1];if(x.global&&(x.lastIndex=0),x.test(u))return E}return null}}}const Z0=new K0;class Oo{constructor(t){this.manager=t!==void 0?t:Z0,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){const n=this;return new Promise(function(r,o){n.load(t,r,e,o)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}const Ur={};class Q0 extends Oo{constructor(t){super(t)}load(t,e,n,r){t===void 0&&(t=""),this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const o=this,s=Is.get(t);if(s!==void 0)return o.manager.itemStart(t),setTimeout(function(){e&&e(s),o.manager.itemEnd(t)},0),s;if(Ur[t]!==void 0)return void Ur[t].push({onLoad:e,onProgress:n,onError:r});const a=t.match(/^data:(.*?)(;base64)?,(.*)$/);let h;if(a){const l=a[1],u=!!a[2];let p=a[3];p=decodeURIComponent(p),u&&(p=atob(p));try{let y;const x=(this.responseType||"").toLowerCase();switch(x){case"arraybuffer":case"blob":const E=new Uint8Array(p.length);for(let C=0;C<p.length;C++)E[C]=p.charCodeAt(C);y=x==="blob"?new Blob([E.buffer],{type:l}):E.buffer;break;case"document":y=new DOMParser().parseFromString(p,l);break;case"json":y=JSON.parse(p);break;default:y=p}setTimeout(function(){e&&e(y),o.manager.itemEnd(t)},0)}catch(y){setTimeout(function(){r&&r(y),o.manager.itemError(t),o.manager.itemEnd(t)},0)}}else{Ur[t]=[],Ur[t].push({onLoad:e,onProgress:n,onError:r}),h=new XMLHttpRequest,h.open("GET",t,!0),h.addEventListener("load",function(l){const u=this.response,p=Ur[t];if(delete Ur[t],this.status===200||this.status===0){this.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),Is.add(t,u);for(let y=0,x=p.length;y<x;y++){const E=p[y];E.onLoad&&E.onLoad(u)}o.manager.itemEnd(t)}else{for(let y=0,x=p.length;y<x;y++){const E=p[y];E.onError&&E.onError(l)}o.manager.itemError(t),o.manager.itemEnd(t)}},!1),h.addEventListener("progress",function(l){const u=Ur[t];for(let p=0,y=u.length;p<y;p++){const x=u[p];x.onProgress&&x.onProgress(l)}},!1),h.addEventListener("error",function(l){const u=Ur[t];delete Ur[t];for(let p=0,y=u.length;p<y;p++){const x=u[p];x.onError&&x.onError(l)}o.manager.itemError(t),o.manager.itemEnd(t)},!1),h.addEventListener("abort",function(l){const u=Ur[t];delete Ur[t];for(let p=0,y=u.length;p<y;p++){const x=u[p];x.onError&&x.onError(l)}o.manager.itemError(t),o.manager.itemEnd(t)},!1),this.responseType!==void 0&&(h.responseType=this.responseType),this.withCredentials!==void 0&&(h.withCredentials=this.withCredentials),h.overrideMimeType&&h.overrideMimeType(this.mimeType!==void 0?this.mimeType:"text/plain");for(const l in this.requestHeader)h.setRequestHeader(l,this.requestHeader[l]);h.send(null)}return o.manager.itemStart(t),h}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class jd extends Oo{constructor(t){super(t)}load(t,e,n,r){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const o=this,s=Is.get(t);if(s!==void 0)return o.manager.itemStart(t),setTimeout(function(){e&&e(s),o.manager.itemEnd(t)},0),s;const a=document.createElementNS("http://www.w3.org/1999/xhtml","img");function h(){a.removeEventListener("load",h,!1),a.removeEventListener("error",l,!1),Is.add(t,this),e&&e(this),o.manager.itemEnd(t)}function l(u){a.removeEventListener("load",h,!1),a.removeEventListener("error",l,!1),r&&r(u),o.manager.itemError(t),o.manager.itemEnd(t)}return a.addEventListener("load",h,!1),a.addEventListener("error",l,!1),t.substr(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),o.manager.itemStart(t),a.src=t,a}}class $0 extends Oo{constructor(t){super(t)}load(t,e,n,r){const o=new mi,s=new jd(this.manager);s.setCrossOrigin(this.crossOrigin),s.setPath(this.path);let a=0;function h(l){s.load(t[l],function(u){o.images[l]=u,a++,a===6&&(o.needsUpdate=!0,e&&e(o))},void 0,r)}for(let l=0;l<t.length;++l)h(l);return o}}class t_ extends Oo{constructor(t){super(t)}load(t,e,n,r){const o=new tt,s=new jd(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(t,function(a){o.image=a;const h=t.search(/\.jpe?g($|\?)/i)>0||t.search(/^data\:image\/jpeg/)===0;o.format=h?1022:1023,o.needsUpdate=!0,e!==void 0&&e(o)},n,r),o}}class e_ extends Ir{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(t){this.curves.push(t)}closePath(){const t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new El(e,t))}getPoint(t){const e=t*this.getLength(),n=this.getCurveLengths();let r=0;for(;r<n.length;){if(n[r]>=e){const o=n[r]-e,s=this.curves[r],a=s.getLength(),h=a===0?0:1-o/a;return s.getPointAt(h)}r++}return null}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const t=[];let e=0;for(let n=0,r=this.curves.length;n<r;n++)e+=this.curves[n].getLength(),t.push(e);return this.cacheLengths=t,t}getSpacedPoints(t=40){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return this.autoClose&&e.push(e[0]),e}getPoints(t=12){const e=[];let n;for(let r=0,o=this.curves;r<o.length;r++){const s=o[r],a=s&&s.isEllipseCurve?2*t:s&&(s.isLineCurve||s.isLineCurve3)?1:s&&s.isSplineCurve?t*s.points.length:t,h=s.getPoints(a);for(let l=0;l<h.length;l++){const u=h[l];n&&n.equals(u)||(e.push(u),n=u)}}return this.autoClose&&e.length>1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const r=t.curves[e];this.curves.push(r.clone())}return this.autoClose=t.autoClose,this}toJSON(){const t=super.toJSON();t.autoClose=this.autoClose,t.curves=[];for(let e=0,n=this.curves.length;e<n;e++){const r=this.curves[e];t.curves.push(r.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.autoClose=t.autoClose,this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const r=t.curves[e];this.curves.push(new Id[r.type]().fromJSON(r))}return this}}class Ps extends e_{constructor(t){super(),this.type="Path",this.currentPoint=new R,t&&this.setFromPoints(t)}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,n=t.length;e<n;e++)this.lineTo(t[e].x,t[e].y);return this}moveTo(t,e){return this.currentPoint.set(t,e),this}lineTo(t,e){const n=new El(this.currentPoint.clone(),new R(t,e));return this.curves.push(n),this.currentPoint.set(t,e),this}quadraticCurveTo(t,e,n,r){const o=new tu(this.currentPoint.clone(),new R(t,e),new R(n,r));return this.curves.push(o),this.currentPoint.set(n,r),this}bezierCurveTo(t,e,n,r,o,s){const a=new $h(this.currentPoint.clone(),new R(t,e),new R(n,r),new R(o,s));return this.curves.push(a),this.currentPoint.set(o,s),this}splineThru(t){const e=[this.currentPoint.clone()].concat(t),n=new eu(e);return this.curves.push(n),this.currentPoint.copy(t[t.length-1]),this}arc(t,e,n,r,o,s){const a=this.currentPoint.x,h=this.currentPoint.y;return this.absarc(t+a,e+h,n,r,o,s),this}absarc(t,e,n,r,o,s){return this.absellipse(t,e,n,n,r,o,s),this}ellipse(t,e,n,r,o,s,a,h){const l=this.currentPoint.x,u=this.currentPoint.y;return this.absellipse(t+l,e+u,n,r,o,s,a,h),this}absellipse(t,e,n,r,o,s,a,h){const l=new bl(t,e,n,r,o,s,a,h);if(this.curves.length>0){const p=l.getPoint(0);p.equals(this.currentPoint)||this.lineTo(p.x,p.y)}this.curves.push(l);const u=l.getPoint(1);return this.currentPoint.copy(u),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}class ou extends Ps{constructor(t){super(t),this.uuid=X(),this.type="Shape",this.holes=[]}getPointsHoles(t){const e=[];for(let n=0,r=this.holes.length;n<r;n++)e[n]=this.holes[n].getPoints(t);return e}extractPoints(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}}copy(t){super.copy(t),this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const r=t.holes[e];this.holes.push(r.clone())}return this}toJSON(){const t=super.toJSON();t.uuid=this.uuid,t.holes=[];for(let e=0,n=this.holes.length;e<n;e++){const r=this.holes[e];t.holes.push(r.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.uuid=t.uuid,this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const r=t.holes[e];this.holes.push(new Ps().fromJSON(r))}return this}}class Xr extends Un{constructor(t,e=1){super(),this.type="Light",this.color=new fn(t),this.intensity=e}dispose(){}copy(t){return super.copy(t),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){const e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,this.groundColor!==void 0&&(e.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(e.object.distance=this.distance),this.angle!==void 0&&(e.object.angle=this.angle),this.decay!==void 0&&(e.object.decay=this.decay),this.penumbra!==void 0&&(e.object.penumbra=this.penumbra),this.shadow!==void 0&&(e.object.shadow=this.shadow.toJSON()),e}}Xr.prototype.isLight=!0;class n_ extends Xr{constructor(t,e,n){super(t,n),this.type="HemisphereLight",this.position.copy(Un.DefaultUp),this.updateMatrix(),this.groundColor=new fn(e)}copy(t){return Xr.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}n_.prototype.isHemisphereLight=!0;const zd=new tn,Vd=new U,Wd=new U;class su{constructor(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.mapSize=new R(512,512),this.map=null,this.mapPass=null,this.matrix=new tn,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Br,this._frameExtents=new R(1,1),this._viewportCount=1,this._viewports=[new Ot(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const e=this.camera,n=this.matrix;Vd.setFromMatrixPosition(t.matrixWorld),e.position.copy(Vd),Wd.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(Wd),e.updateMatrixWorld(),zd.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(zd),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(e.projectionMatrix),n.multiply(e.matrixWorldInverse)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const t={};return this.bias!==0&&(t.bias=this.bias),this.normalBias!==0&&(t.normalBias=this.normalBias),this.radius!==1&&(t.radius=this.radius),this.mapSize.x===512&&this.mapSize.y===512||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}class Xd extends su{constructor(){super(new un(50,1,.5,500)),this.focus=1}updateMatrices(t){const e=this.camera,n=2*W*t.angle*this.focus,r=this.mapSize.width/this.mapSize.height,o=t.distance||e.far;n===e.fov&&r===e.aspect&&o===e.far||(e.fov=n,e.aspect=r,e.far=o,e.updateProjectionMatrix()),super.updateMatrices(t)}copy(t){return super.copy(t),this.focus=t.focus,this}}Xd.prototype.isSpotLightShadow=!0;class i_ extends Xr{constructor(t,e,n=0,r=Math.PI/3,o=0,s=1){super(t,e),this.type="SpotLight",this.position.copy(Un.DefaultUp),this.updateMatrix(),this.target=new Un,this.distance=n,this.angle=r,this.penumbra=o,this.decay=s,this.shadow=new Xd}get power(){return this.intensity*Math.PI}set power(t){this.intensity=t/Math.PI}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}i_.prototype.isSpotLight=!0;const Yd=new tn,_a=new U,au=new U;class qd extends su{constructor(){super(new un(90,1,.5,500)),this._frameExtents=new R(4,2),this._viewportCount=6,this._viewports=[new Ot(2,1,1,1),new Ot(0,1,1,1),new Ot(3,1,1,1),new Ot(1,1,1,1),new Ot(3,0,1,1),new Ot(1,0,1,1)],this._cubeDirections=[new U(1,0,0),new U(-1,0,0),new U(0,0,1),new U(0,0,-1),new U(0,1,0),new U(0,-1,0)],this._cubeUps=[new U(0,1,0),new U(0,1,0),new U(0,1,0),new U(0,1,0),new U(0,0,1),new U(0,0,-1)]}updateMatrices(t,e=0){const n=this.camera,r=this.matrix,o=t.distance||n.far;o!==n.far&&(n.far=o,n.updateProjectionMatrix()),_a.setFromMatrixPosition(t.matrixWorld),n.position.copy(_a),au.copy(n.position),au.add(this._cubeDirections[e]),n.up.copy(this._cubeUps[e]),n.lookAt(au),n.updateMatrixWorld(),r.makeTranslation(-_a.x,-_a.y,-_a.z),Yd.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Yd)}}qd.prototype.isPointLightShadow=!0;class r_ extends Xr{constructor(t,e,n=0,r=1){super(t,e),this.type="PointLight",this.distance=n,this.decay=r,this.shadow=new qd}get power(){return 4*this.intensity*Math.PI}set power(t){this.intensity=t/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}r_.prototype.isPointLight=!0;class lu extends vn{constructor(t=-1,e=1,n=1,r=-1,o=.1,s=2e3){super(),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=r,this.near=o,this.far=s,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,e,n,r,o,s){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=o,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let o=n-t,s=n+t,a=r+e,h=r-e;if(this.view!==null&&this.view.enabled){const l=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=l*this.view.offsetX,s=o+l*this.view.width,a-=u*this.view.offsetY,h=a-u*this.view.height}this.projectionMatrix.makeOrthographic(o,s,a,h,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,this.view!==null&&(e.object.view=Object.assign({},this.view)),e}}lu.prototype.isOrthographicCamera=!0;class Jd extends su{constructor(){super(new lu(-5,5,5,-5,.5,500))}}Jd.prototype.isDirectionalLightShadow=!0;class o_ extends Xr{constructor(t,e){super(t,e),this.type="DirectionalLight",this.position.copy(Un.DefaultUp),this.updateMatrix(),this.target=new Un,this.shadow=new Jd}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}o_.prototype.isDirectionalLight=!0;class s_ extends Xr{constructor(t,e){super(t,e),this.type="AmbientLight"}}s_.prototype.isAmbientLight=!0;class a_ extends Xr{constructor(t,e,n=10,r=10){super(t,e),this.type="RectAreaLight",this.width=n,this.height=r}copy(t){return super.copy(t),this.width=t.width,this.height=t.height,this}toJSON(t){const e=super.toJSON(t);return e.object.width=this.width,e.object.height=this.height,e}}a_.prototype.isRectAreaLight=!0;class Kd{constructor(){this.coefficients=[];for(let t=0;t<9;t++)this.coefficients.push(new U)}set(t){for(let e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this}zero(){for(let t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this}getAt(t,e){const n=t.x,r=t.y,o=t.z,s=this.coefficients;return e.copy(s[0]).multiplyScalar(.282095),e.addScaledVector(s[1],.488603*r),e.addScaledVector(s[2],.488603*o),e.addScaledVector(s[3],.488603*n),e.addScaledVector(s[4],n*r*1.092548),e.addScaledVector(s[5],r*o*1.092548),e.addScaledVector(s[6],.315392*(3*o*o-1)),e.addScaledVector(s[7],n*o*1.092548),e.addScaledVector(s[8],.546274*(n*n-r*r)),e}getIrradianceAt(t,e){const n=t.x,r=t.y,o=t.z,s=this.coefficients;return e.copy(s[0]).multiplyScalar(.886227),e.addScaledVector(s[1],1.023328*r),e.addScaledVector(s[2],1.023328*o),e.addScaledVector(s[3],1.023328*n),e.addScaledVector(s[4],.858086*n*r),e.addScaledVector(s[5],.858086*r*o),e.addScaledVector(s[6],.743125*o*o-.247708),e.addScaledVector(s[7],.858086*n*o),e.addScaledVector(s[8],.429043*(n*n-r*r)),e}add(t){for(let e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this}addScaledSH(t,e){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(t.coefficients[n],e);return this}scale(t){for(let e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this}lerp(t,e){for(let n=0;n<9;n++)this.coefficients[n].lerp(t.coefficients[n],e);return this}equals(t){for(let e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0}copy(t){return this.set(t.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(t,e=0){const n=this.coefficients;for(let r=0;r<9;r++)n[r].fromArray(t,e+3*r);return this}toArray(t=[],e=0){const n=this.coefficients;for(let r=0;r<9;r++)n[r].toArray(t,e+3*r);return t}static getBasisAt(t,e){const n=t.x,r=t.y,o=t.z;e[0]=.282095,e[1]=.488603*r,e[2]=.488603*o,e[3]=.488603*n,e[4]=1.092548*n*r,e[5]=1.092548*r*o,e[6]=.315392*(3*o*o-1),e[7]=1.092548*n*o,e[8]=.546274*(n*n-r*r)}}Kd.prototype.isSphericalHarmonics3=!0;class hu extends Xr{constructor(t=new Kd,e=1){super(void 0,e),this.sh=t}copy(t){return super.copy(t),this.sh.copy(t.sh),this}fromJSON(t){return this.intensity=t.intensity,this.sh.fromArray(t.sh),this}toJSON(t){const e=super.toJSON(t);return e.object.sh=this.sh.toArray(),e}}hu.prototype.isLightProbe=!0;class l_{static decodeText(t){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(t);let e="";for(let n=0,r=t.length;n<r;n++)e+=String.fromCharCode(t[n]);try{return decodeURIComponent(escape(e))}catch{return e}}static extractUrlBase(t){const e=t.lastIndexOf("/");return e===-1?"./":t.substr(0,e+1)}}class h_ extends Wn{constructor(){super(),this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(t){return super.copy(t),this.instanceCount=t.instanceCount,this}clone(){return new this.constructor().copy(this)}toJSON(){const t=super.toJSON(this);return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}}h_.prototype.isInstancedBufferGeometry=!0;class u_ extends Yn{constructor(t,e,n,r=1){typeof n=="number"&&(r=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(t,e,n),this.meshPerAttribute=r}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}toJSON(){const t=super.toJSON();return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}u_.prototype.isInstancedBufferAttribute=!0,class extends Oo{constructor(i){super(i),typeof createImageBitmap=="undefined"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch=="undefined"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(i){return this.options=i,this}load(i,t,e,n){i===void 0&&(i=""),this.path!==void 0&&(i=this.path+i),i=this.manager.resolveURL(i);const r=this,o=Is.get(i);if(o!==void 0)return r.manager.itemStart(i),setTimeout(function(){t&&t(o),r.manager.itemEnd(i)},0),o;const s={};s.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",s.headers=this.requestHeader,fetch(i,s).then(function(a){return a.blob()}).then(function(a){return createImageBitmap(a,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(a){Is.add(i,a),t&&t(a),r.manager.itemEnd(i)}).catch(function(a){n&&n(a),r.manager.itemError(i),r.manager.itemEnd(i)}),r.manager.itemStart(i)}}.prototype.isImageBitmapLoader=!0;let uu;const c_=function(){return uu===void 0&&(uu=new(window.AudioContext||window.webkitAudioContext)),uu};class d_ extends Oo{constructor(t){super(t)}load(t,e,n,r){const o=this,s=new Q0(this.manager);s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,function(a){try{const h=a.slice(0);c_().decodeAudioData(h,function(l){e(l)})}catch(h){r?r(h):console.error(h),o.manager.itemError(t)}},n,r)}}(class extends hu{constructor(i,t,e=1){super(void 0,e);const n=new fn().set(i),r=new fn().set(t),o=new U(n.r,n.g,n.b),s=new U(r.r,r.g,r.b),a=Math.sqrt(Math.PI),h=a*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(s).multiplyScalar(a),this.sh.coefficients[1].copy(o).sub(s).multiplyScalar(h)}}).prototype.isHemisphereLightProbe=!0,class extends hu{constructor(i,t=1){super(void 0,t);const e=new fn().set(i);this.sh.coefficients[0].set(e.r,e.g,e.b).multiplyScalar(2*Math.sqrt(Math.PI))}}.prototype.isAmbientLightProbe=!0;class p_ extends Un{constructor(t){super(),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this}setMediaElementSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this}setMediaStreamSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(t),this.connect(),this}setBuffer(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this}play(t=0){if(this.isPlaying===!0)return void console.warn("THREE.Audio: Audio is already playing.");if(this.hasPlaybackControl===!1)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+t;const e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.loopStart=this.loopStart,e.loopEnd=this.loopEnd,e.onended=this.onEnded.bind(this),e.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl!==!1)return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}stop(){if(this.hasPlaybackControl!==!1)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(t){return t||(t=[]),this._connected===!0?(this.disconnect(),this.filters=t.slice(),this.connect()):this.filters=t.slice(),this}setDetune(t){if(this.detune=t,this.source.detune!==void 0)return this.isPlaying===!0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(t){return this.setFilters(t?[t]:[])}setPlaybackRate(t){if(this.hasPlaybackControl!==!1)return this.playbackRate=t,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(t){if(this.hasPlaybackControl!==!1)return this.loop=t,this.isPlaying===!0&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")}setLoopStart(t){return this.loopStart=t,this}setLoopEnd(t){return this.loopEnd=t,this}getVolume(){return this.gain.gain.value}setVolume(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}}class f_{constructor(t,e,n){let r,o,s;switch(this.binding=t,this.valueSize=n,e){case"quaternion":r=this._slerp,o=this._slerpAdditive,s=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*n),this._workIndex=5;break;case"string":case"bool":r=this._select,o=this._select,s=this._setAdditiveIdentityOther,this.buffer=new Array(5*n);break;default:r=this._lerp,o=this._lerpAdditive,s=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*n)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=o,this._setIdentity=s,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(t,e){const n=this.buffer,r=this.valueSize,o=t*r+r;let s=this.cumulativeWeight;if(s===0){for(let a=0;a!==r;++a)n[o+a]=n[a];s=e}else{s+=e;const a=e/s;this._mixBufferRegion(n,o,0,a,r)}this.cumulativeWeight=s}accumulateAdditive(t){const e=this.buffer,n=this.valueSize,r=n*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(e,r,0,t,n),this.cumulativeWeightAdditive+=t}apply(t){const e=this.valueSize,n=this.buffer,r=t*e+e,o=this.cumulativeWeight,s=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,o<1){const h=e*this._origIndex;this._mixBufferRegion(n,r,h,1-o,e)}s>0&&this._mixBufferRegionAdditive(n,r,this._addIndex*e,1,e);for(let h=e,l=e+e;h!==l;++h)if(n[h]!==n[h+e]){a.setValue(n,r);break}}saveOriginalState(){const t=this.binding,e=this.buffer,n=this.valueSize,r=n*this._origIndex;t.getValue(e,r);for(let o=n,s=r;o!==s;++o)e[o]=e[r+o%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const t=3*this.valueSize;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let n=t;n<e;n++)this.buffer[n]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const t=this._origIndex*this.valueSize,e=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[e+n]=this.buffer[t+n]}_select(t,e,n,r,o){if(r>=.5)for(let s=0;s!==o;++s)t[e+s]=t[n+s]}_slerp(t,e,n,r){z.slerpFlat(t,e,t,e,t,n,r)}_slerpAdditive(t,e,n,r,o){const s=this._workIndex*o;z.multiplyQuaternionsFlat(t,s,t,e,t,n),z.slerpFlat(t,e,t,e,t,s,r)}_lerp(t,e,n,r,o){const s=1-r;for(let a=0;a!==o;++a){const h=e+a;t[h]=t[h]*s+t[n+a]*r}}_lerpAdditive(t,e,n,r,o){for(let s=0;s!==o;++s){const a=e+s;t[a]=t[a]+t[n+s]*r}}}const m_=new RegExp("[\\[\\]\\.:\\/]","g"),g_="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",v_=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),__=/(WCOD+)?/.source.replace("WCOD",g_),y_=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),x_=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),b_=new RegExp("^"+v_+__+y_+x_+"$"),T_=["material","materials","bones"];class Qn{constructor(t,e,n){this.path=e,this.parsedPath=n||Qn.parseTrackName(e),this.node=Qn.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,n){return t&&t.isAnimationObjectGroup?new Qn.Composite(t,e,n):new Qn(t,e,n)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(m_,"")}static parseTrackName(t){const e=b_.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const o=n.nodeName.substring(r+1);T_.indexOf(o)!==-1&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=o)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}static findNode(t,e){if(!e||e===""||e==="."||e===-1||e===t.name||e===t.uuid)return t;if(t.skeleton){const n=t.skeleton.getBoneByName(e);if(n!==void 0)return n}if(t.children){const n=function(o){for(let s=0;s<o.length;s++){const a=o[s];if(a.name===e||a.uuid===e)return a;const h=n(a.children);if(h)return h}return null},r=n(t.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.node[this.propertyName]}_getValue_array(t,e){const n=this.resolvedProperty;for(let r=0,o=n.length;r!==o;++r)t[e++]=n[r]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){const n=this.resolvedProperty;for(let r=0,o=n.length;r!==o;++r)n[r]=t[e++]}_setValue_array_setNeedsUpdate(t,e){const n=this.resolvedProperty;for(let r=0,o=n.length;r!==o;++r)n[r]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){const n=this.resolvedProperty;for(let r=0,o=n.length;r!==o;++r)n[r]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node;const e=this.parsedPath,n=e.objectName,r=e.propertyName;let o=e.propertyIndex;if(t||(t=Qn.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return void console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");if(n){let l=e.objectIndex;switch(n){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(let u=0;u<t.length;u++)if(t[u].name===l){l=u;break}break;default:if(t[n]===void 0)return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[n]}if(l!==void 0){if(t[l]===void 0)return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[l]}}const s=t[r];if(s===void 0){const l=e.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+l+"."+r+" but it wasn't found.",t)}let a=this.Versioning.None;this.targetObject=t,t.needsUpdate!==void 0?a=this.Versioning.NeedsUpdate:t.matrixWorldNeedsUpdate!==void 0&&(a=this.Versioning.MatrixWorldNeedsUpdate);let h=this.BindingType.Direct;if(o!==void 0){if(r==="morphTargetInfluences"){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!t.geometry.isBufferGeometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);t.morphTargetDictionary[o]!==void 0&&(o=t.morphTargetDictionary[o])}h=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=o}else s.fromArray!==void 0&&s.toArray!==void 0?(h=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(h=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[h],this.setValue=this.SetterByBindingTypeAndVersioning[h][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Qn.Composite=class{constructor(i,t,e){const n=e||Qn.parseTrackName(t);this._targetGroup=i,this._bindings=i.subscribe_(t,n)}getValue(i,t){this.bind();const e=this._targetGroup.nCachedObjects_,n=this._bindings[e];n!==void 0&&n.getValue(i,t)}setValue(i,t){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=e.length;n!==r;++n)e[n].setValue(i,t)}bind(){const i=this._bindings;for(let t=this._targetGroup.nCachedObjects_,e=i.length;t!==e;++t)i[t].bind()}unbind(){const i=this._bindings;for(let t=this._targetGroup.nCachedObjects_,e=i.length;t!==e;++t)i[t].unbind()}},Qn.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Qn.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},Qn.prototype.GetterByBindingType=[Qn.prototype._getValue_direct,Qn.prototype._getValue_array,Qn.prototype._getValue_arrayElement,Qn.prototype._getValue_toArray],Qn.prototype.SetterByBindingTypeAndVersioning=[[Qn.prototype._setValue_direct,Qn.prototype._setValue_direct_setNeedsUpdate,Qn.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Qn.prototype._setValue_array,Qn.prototype._setValue_array_setNeedsUpdate,Qn.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Qn.prototype._setValue_arrayElement,Qn.prototype._setValue_arrayElement_setNeedsUpdate,Qn.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Qn.prototype._setValue_fromArray,Qn.prototype._setValue_fromArray_setNeedsUpdate,Qn.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class E_{constructor(t,e,n=null,r=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=n,this.blendMode=r;const o=e.tracks,s=o.length,a=new Array(s),h={endingStart:2400,endingEnd:2400};for(let l=0;l!==s;++l){const u=o[l].createInterpolant(null);a[l]=u,u.settings=h}this._interpolantSettings=h,this._interpolants=a,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(t){return this._startTime=t,this}setLoop(t,e){return this.loop=t,this.repetitions=e,this}setEffectiveWeight(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(t){return this._scheduleFading(t,0,1)}fadeOut(t){return this._scheduleFading(t,1,0)}crossFadeFrom(t,e,n){if(t.fadeOut(e),this.fadeIn(e),n){const r=this._clip.duration,o=t._clip.duration,s=o/r,a=r/o;t.warp(1,s,e),this.warp(a,1,e)}return this}crossFadeTo(t,e,n){return t.crossFadeFrom(this,e,n)}stopFading(){const t=this._weightInterpolant;return t!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}setEffectiveTimeScale(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(t){return this.timeScale=this._clip.duration/t,this.stopWarping()}syncWith(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()}halt(t){return this.warp(this._effectiveTimeScale,0,t)}warp(t,e,n){const r=this._mixer,o=r.time,s=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);const h=a.parameterPositions,l=a.sampleValues;return h[0]=o,h[1]=o+n,l[0]=t/s,l[1]=e/s,this}stopWarping(){const t=this._timeScaleInterpolant;return t!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,e,n,r){if(!this.enabled)return void this._updateWeight(t);const o=this._startTime;if(o!==null){const h=(t-o)*n;if(h<0||n===0)return;this._startTime=null,e=n*h}e*=this._updateTimeScale(t);const s=this._updateTime(e),a=this._updateWeight(t);if(a>0){const h=this._interpolants,l=this._propertyBindings;switch(this.blendMode){case 2501:for(let u=0,p=h.length;u!==p;++u)h[u].evaluate(s),l[u].accumulateAdditive(a);break;case 2500:default:for(let u=0,p=h.length;u!==p;++u)h[u].evaluate(s),l[u].accumulate(r,a)}}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const n=this._weightInterpolant;if(n!==null){const r=n.evaluate(t)[0];e*=r,t>n.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const n=this._timeScaleInterpolant;n!==null&&(e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),e===0?this.paused=!0:this.timeScale=e))}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,n=this.loop;let r=this.time+t,o=this._loopCount;const s=n===2202;if(t===0)return o===-1?r:s&&(1&o)==1?e-r:r;if(n===2200){o===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(r>=e)r=e;else{if(!(r<0)){this.time=r;break t}r=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(o===-1&&(t>=0?(o=0,this._setEndings(!0,this.repetitions===0,s)):this._setEndings(this.repetitions===0,!0,s)),r>=e||r<0){const a=Math.floor(r/e);r-=e*a,o+=Math.abs(a);const h=this.repetitions-o;if(h<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=t>0?e:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(h===1){const l=t<0;this._setEndings(l,!l,s)}else this._setEndings(!1,!1,s);this._loopCount=o,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=r;if(s&&(1&o)==1)return e-r}return r}_setEndings(t,e,n){const r=this._interpolantSettings;n?(r.endingStart=2401,r.endingEnd=2401):(r.endingStart=t?this.zeroSlopeAtStart?2401:2400:2402,r.endingEnd=e?this.zeroSlopeAtEnd?2401:2400:2402)}_scheduleFading(t,e,n){const r=this._mixer,o=r.time;let s=this._weightInterpolant;s===null&&(s=r._lendControlInterpolant(),this._weightInterpolant=s);const a=s.parameterPositions,h=s.sampleValues;return a[0]=o,h[0]=e,a[1]=o+t,h[1]=n,this}}(class extends D{constructor(i){super(),this._root=i,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(i,t){const e=i._localRoot||this._root,n=i._clip.tracks,r=n.length,o=i._propertyBindings,s=i._interpolants,a=e.uuid,h=this._bindingsByRootAndName;let l=h[a];l===void 0&&(l={},h[a]=l);for(let u=0;u!==r;++u){const p=n[u],y=p.name;let x=l[y];if(x!==void 0)o[u]=x;else{if(x=o[u],x!==void 0){x._cacheIndex===null&&(++x.referenceCount,this._addInactiveBinding(x,a,y));continue}const E=t&&t._propertyBindings[u].binding.parsedPath;x=new f_(Qn.create(e,y,E),p.ValueTypeName,p.getValueSize()),++x.referenceCount,this._addInactiveBinding(x,a,y),o[u]=x}s[u].resultBuffer=x.buffer}}_activateAction(i){if(!this._isActiveAction(i)){if(i._cacheIndex===null){const e=(i._localRoot||this._root).uuid,n=i._clip.uuid,r=this._actionsByClip[n];this._bindAction(i,r&&r.knownActions[0]),this._addInactiveAction(i,n,e)}const t=i._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const r=t[e];r.useCount++==0&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(i)}}_deactivateAction(i){if(this._isActiveAction(i)){const t=i._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const r=t[e];--r.useCount==0&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(i)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const i=this;this.stats={actions:{get total(){return i._actions.length},get inUse(){return i._nActiveActions}},bindings:{get total(){return i._bindings.length},get inUse(){return i._nActiveBindings}},controlInterpolants:{get total(){return i._controlInterpolants.length},get inUse(){return i._nActiveControlInterpolants}}}}_isActiveAction(i){const t=i._cacheIndex;return t!==null&&t<this._nActiveActions}_addInactiveAction(i,t,e){const n=this._actions,r=this._actionsByClip;let o=r[t];if(o===void 0)o={knownActions:[i],actionByRoot:{}},i._byClipCacheIndex=0,r[t]=o;else{const s=o.knownActions;i._byClipCacheIndex=s.length,s.push(i)}i._cacheIndex=n.length,n.push(i),o.actionByRoot[e]=i}_removeInactiveAction(i){const t=this._actions,e=t[t.length-1],n=i._cacheIndex;e._cacheIndex=n,t[n]=e,t.pop(),i._cacheIndex=null;const r=i._clip.uuid,o=this._actionsByClip,s=o[r],a=s.knownActions,h=a[a.length-1],l=i._byClipCacheIndex;h._byClipCacheIndex=l,a[l]=h,a.pop(),i._byClipCacheIndex=null,delete s.actionByRoot[(i._localRoot||this._root).uuid],a.length===0&&delete o[r],this._removeInactiveBindingsForAction(i)}_removeInactiveBindingsForAction(i){const t=i._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const r=t[e];--r.referenceCount==0&&this._removeInactiveBinding(r)}}_lendAction(i){const t=this._actions,e=i._cacheIndex,n=this._nActiveActions++,r=t[n];i._cacheIndex=n,t[n]=i,r._cacheIndex=e,t[e]=r}_takeBackAction(i){const t=this._actions,e=i._cacheIndex,n=--this._nActiveActions,r=t[n];i._cacheIndex=n,t[n]=i,r._cacheIndex=e,t[e]=r}_addInactiveBinding(i,t,e){const n=this._bindingsByRootAndName,r=this._bindings;let o=n[t];o===void 0&&(o={},n[t]=o),o[e]=i,i._cacheIndex=r.length,r.push(i)}_removeInactiveBinding(i){const t=this._bindings,e=i.binding,n=e.rootNode.uuid,r=e.path,o=this._bindingsByRootAndName,s=o[n],a=t[t.length-1],h=i._cacheIndex;a._cacheIndex=h,t[h]=a,t.pop(),delete s[r],Object.keys(s).length===0&&delete o[n]}_lendBinding(i){const t=this._bindings,e=i._cacheIndex,n=this._nActiveBindings++,r=t[n];i._cacheIndex=n,t[n]=i,r._cacheIndex=e,t[e]=r}_takeBackBinding(i){const t=this._bindings,e=i._cacheIndex,n=--this._nActiveBindings,r=t[n];i._cacheIndex=n,t[n]=i,r._cacheIndex=e,t[e]=r}_lendControlInterpolant(){const i=this._controlInterpolants,t=this._nActiveControlInterpolants++;let e=i[t];return e===void 0&&(e=new kd(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),e.__cacheIndex=t,i[t]=e),e}_takeBackControlInterpolant(i){const t=this._controlInterpolants,e=i.__cacheIndex,n=--this._nActiveControlInterpolants,r=t[n];i.__cacheIndex=n,t[n]=i,r.__cacheIndex=e,t[e]=r}clipAction(i,t,e){const n=t||this._root,r=n.uuid;let o=typeof i=="string"?Hd.findByName(n,i):i;const s=o!==null?o.uuid:i,a=this._actionsByClip[s];let h=null;if(e===void 0&&(e=o!==null?o.blendMode:2500),a!==void 0){const u=a.actionByRoot[r];if(u!==void 0&&u.blendMode===e)return u;h=a.knownActions[0],o===null&&(o=h._clip)}if(o===null)return null;const l=new E_(this,o,t,e);return this._bindAction(l,h),this._addInactiveAction(l,s,r),l}existingAction(i,t){const e=t||this._root,n=e.uuid,r=typeof i=="string"?Hd.findByName(e,i):i,o=r?r.uuid:i,s=this._actionsByClip[o];return s!==void 0&&s.actionByRoot[n]||null}stopAllAction(){const i=this._actions;for(let t=this._nActiveActions-1;t>=0;--t)i[t].stop();return this}update(i){i*=this.timeScale;const t=this._actions,e=this._nActiveActions,n=this.time+=i,r=Math.sign(i),o=this._accuIndex^=1;for(let h=0;h!==e;++h)t[h]._update(n,i,r,o);const s=this._bindings,a=this._nActiveBindings;for(let h=0;h!==a;++h)s[h].apply(o);return this}setTime(i){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(i)}getRoot(){return this._root}uncacheClip(i){const t=this._actions,e=i.uuid,n=this._actionsByClip,r=n[e];if(r!==void 0){const o=r.knownActions;for(let s=0,a=o.length;s!==a;++s){const h=o[s];this._deactivateAction(h);const l=h._cacheIndex,u=t[t.length-1];h._cacheIndex=null,h._byClipCacheIndex=null,u._cacheIndex=l,t[l]=u,t.pop(),this._removeInactiveBindingsForAction(h)}delete n[e]}}uncacheRoot(i){const t=i.uuid,e=this._actionsByClip;for(const r in e){const o=e[r].actionByRoot[t];o!==void 0&&(this._deactivateAction(o),this._removeInactiveAction(o))}const n=this._bindingsByRootAndName[t];if(n!==void 0)for(const r in n){const o=n[r];o.restoreOriginalState(),this._removeInactiveBinding(o)}}uncacheAction(i,t){const e=this.existingAction(i,t);e!==null&&(this._deactivateAction(e),this._removeInactiveAction(e))}}).prototype._controlInterpolantsResultBuffer=new Float32Array(1),class extends oa{constructor(i,t,e=1){super(i,t),this.meshPerAttribute=e}copy(i){return super.copy(i),this.meshPerAttribute=i.meshPerAttribute,this}clone(i){const t=super.clone(i);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(i){const t=super.toJSON(i);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}.prototype.isInstancedInterleavedBuffer=!0,new R,new U,new U,class extends Un{constructor(i){super(),this.material=i,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}}.prototype.isImmediateRenderObject=!0;const No=new U,Rl=new tn,cu=new tn,S_=new Float32Array(1);new Int32Array(S_.buffer);const Zd=[.125,.215,.35,.446,.526,.582],w_=5+Zd.length,A_=new Zi({side:1,depthWrite:!1,depthTest:!1});new Tt(new ee,A_),M_();function M_(){const i=[],t=[],e=[];let n=8;for(let r=0;r<w_;r++){const o=Math.pow(2,n);t.push(o);let s=1/o;r>4?s=Zd[r-8+4-1]:r==0&&(s=0),e.push(s);const a=1/(o-1),h=-a/2,l=1+a/2,u=[h,h,l,h,l,l,h,h,l,l,h,l],p=6,y=6,x=3,E=2,A=1,C=new Float32Array(x*y*p),j=new Float32Array(E*y*p),Q=new Float32Array(A*y*p);for(let pt=0;pt<p;pt++){const it=pt%3*2/3-1,gt=pt>2?0:-1,ht=[it,gt,0,it+2/3,gt,0,it+2/3,gt+1,0,it,gt,0,it+2/3,gt+1,0,it,gt+1,0];C.set(ht,x*y*pt),j.set(u,E*y*pt);const mt=[pt,pt,pt,pt,pt,pt];Q.set(mt,A*y*pt)}const rt=new Wn;rt.setAttribute("position",new Yn(C,x)),rt.setAttribute("uv",new Yn(j,E)),rt.setAttribute("faceIndex",new Yn(Q,A)),i.push(rt),n>4&&n--}return{_lodPlanes:i,_sizeLods:t,_sigmas:e}}Ir.create=function(i,t){return console.log("THREE.Curve.create() has been deprecated"),i.prototype=Object.create(Ir.prototype),i.prototype.constructor=i,i.prototype.getPoint=t,i},Ps.prototype.fromPoints=function(i){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(i)},class extends Yh{constructor(i=10,t=10,e=4473924,n=8947848){e=new fn(e),n=new fn(n);const r=t/2,o=i/t,s=i/2,a=[],h=[];for(let u=0,p=0,y=-s;u<=t;u++,y+=o){a.push(-s,0,y,s,0,y),a.push(y,0,-s,y,0,s);const x=u===r?e:n;x.toArray(h,p),p+=3,x.toArray(h,p),p+=3,x.toArray(h,p),p+=3,x.toArray(h,p),p+=3}const l=new Wn;l.setAttribute("position",new An(a,3)),l.setAttribute("color",new An(h,3)),super(l,new ca({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}}.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},class extends Yh{constructor(i){const t=function a(h){const l=[];h&&h.isBone&&l.push(h);for(let u=0;u<h.children.length;u++)l.push.apply(l,a(h.children[u]));return l}(i),e=new Wn,n=[],r=[],o=new fn(0,0,1),s=new fn(0,1,0);for(let a=0;a<t.length;a++){const h=t[a];h.parent&&h.parent.isBone&&(n.push(0,0,0),n.push(0,0,0),r.push(o.r,o.g,o.b),r.push(s.r,s.g,s.b))}e.setAttribute("position",new An(n,3)),e.setAttribute("color",new An(r,3)),super(e,new ca({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.type="SkeletonHelper",this.isSkeletonHelper=!0,this.root=i,this.bones=t,this.matrix=i.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(i){const t=this.bones,e=this.geometry,n=e.getAttribute("position");cu.copy(this.root.matrixWorld).invert();for(let r=0,o=0;r<t.length;r++){const s=t[r];s.parent&&s.parent.isBone&&(Rl.multiplyMatrices(cu,s.matrixWorld),No.setFromMatrixPosition(Rl),n.setXYZ(o,No.x,No.y,No.z),Rl.multiplyMatrices(cu,s.parent.matrixWorld),No.setFromMatrixPosition(Rl),n.setXYZ(o+1,No.x,No.y,No.z),o+=2)}e.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(i)}}.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Oo.prototype.extractUrlBase=function(i){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),l_.extractUrlBase(i)},Oo.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},vt.prototype.center=function(i){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(i)},vt.prototype.empty=function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},vt.prototype.isIntersectionBox=function(i){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(i)},vt.prototype.isIntersectionSphere=function(i){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(i)},vt.prototype.size=function(i){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(i)},Ge.prototype.empty=function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()},Br.prototype.setFromMatrix=function(i){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(i)},B.prototype.flattenToArrayOffset=function(i,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(i,t)},B.prototype.multiplyVector3=function(i){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),i.applyMatrix3(this)},B.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},B.prototype.applyToBufferAttribute=function(i){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),i.applyMatrix3(this)},B.prototype.applyToVector3Array=function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},B.prototype.getInverse=function(i){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(i).invert()},tn.prototype.extractPosition=function(i){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(i)},tn.prototype.flattenToArrayOffset=function(i,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(i,t)},tn.prototype.getPosition=function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),new U().setFromMatrixColumn(this,3)},tn.prototype.setRotationFromQuaternion=function(i){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(i)},tn.prototype.multiplyToArray=function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},tn.prototype.multiplyVector3=function(i){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)},tn.prototype.multiplyVector4=function(i){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)},tn.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},tn.prototype.rotateAxis=function(i){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),i.transformDirection(this)},tn.prototype.crossVector=function(i){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)},tn.prototype.translate=function(){console.error("THREE.Matrix4: .translate() has been removed.")},tn.prototype.rotateX=function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},tn.prototype.rotateY=function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},tn.prototype.rotateZ=function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},tn.prototype.rotateByAxis=function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},tn.prototype.applyToBufferAttribute=function(i){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)},tn.prototype.applyToVector3Array=function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},tn.prototype.makeFrustum=function(i,t,e,n,r,o){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(i,t,n,e,r,o)},tn.prototype.getInverse=function(i){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(i).invert()},hi.prototype.isIntersectionLine=function(i){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(i)},z.prototype.multiplyVector3=function(i){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),i.applyQuaternion(this)},z.prototype.inverse=function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()},pi.prototype.isIntersectionBox=function(i){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(i)},pi.prototype.isIntersectionPlane=function(i){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(i)},pi.prototype.isIntersectionSphere=function(i){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(i)},ui.prototype.area=function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},ui.prototype.barycoordFromPoint=function(i,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(i,t)},ui.prototype.midpoint=function(i){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(i)},ui.prototypenormal=function(i){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(i)},ui.prototype.plane=function(i){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(i)},ui.barycoordFromPoint=function(i,t,e,n,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),ui.getBarycoord(i,t,e,n,r)},ui.normal=function(i,t,e,n){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),ui.getNormal(i,t,e,n)},ou.prototype.extractAllPoints=function(i){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(i)},ou.prototype.extrude=function(i){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Ms(this,i)},ou.prototype.makeGeometry=function(i){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new ru(this,i)},R.prototype.fromAttribute=function(i,t,e){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(i,t,e)},R.prototype.distanceToManhattan=function(i){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(i)},R.prototype.lengthManhattan=function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},U.prototype.setEulerFromRotationMatrix=function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},U.prototype.setEulerFromQuaternion=function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},U.prototype.getPositionFromMatrix=function(i){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(i)},U.prototype.getScaleFromMatrix=function(i){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(i)},U.prototype.getColumnFromMatrix=function(i,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,i)},U.prototype.applyProjection=function(i){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(i)},U.prototype.fromAttribute=function(i,t,e){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(i,t,e)},U.prototype.distanceToManhattan=function(i){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(i)},U.prototype.lengthManhattan=function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},Ot.prototype.fromAttribute=function(i,t,e){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(i,t,e)},Ot.prototype.lengthManhattan=function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},Un.prototype.getChildByName=function(i){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(i)},Un.prototype.renderDepth=function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},Un.prototype.translate=function(i,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,i)},Un.prototype.getWorldRotation=function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},Un.prototype.applyMatrix=function(i){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(i)},Object.defineProperties(Un.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(i){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=i}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Tt.prototype.setDrawMode=function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")},Object.defineProperties(Tt.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),pd.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},un.prototype.setLens=function(i,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),t!==void 0&&(this.filmGauge=t),this.setFocalLength(i)},Object.defineProperties(Xr.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(i){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=i}},shadowCameraLeft:{set:function(i){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=i}},shadowCameraRight:{set:function(i){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=i}},shadowCameraTop:{set:function(i){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=i}},shadowCameraBottom:{set:function(i){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=i}},shadowCameraNear:{set:function(i){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=i}},shadowCameraFar:{set:function(i){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=i}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(i){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=i}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(i){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=i}},shadowMapHeight:{set:function(i){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=i}}}),Object.defineProperties(Yn.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===35048},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(35048)}}}),Yn.prototype.setDynamic=function(i){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(i===!0?35048:35044),this},Yn.prototype.copyIndicesArray=function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},Yn.prototype.setArray=function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},Wn.prototype.addIndex=function(i){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(i)},Wn.prototype.addAttribute=function(i,t){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?i==="index"?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(i,t):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(i,new Yn(arguments[1],arguments[2])))},Wn.prototype.addDrawCall=function(i,t,e){e!==void 0&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(i,t)},Wn.prototype.clearDrawCalls=function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},Wn.prototype.computeOffsets=function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},Wn.prototype.removeAttribute=function(i){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(i)},Wn.prototype.applyMatrix=function(i){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(i)},Object.defineProperties(Wn.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),oa.prototype.setDynamic=function(i){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(i===!0?35048:35044),this},oa.prototype.setArray=function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},Ms.prototype.getArrays=function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},Ms.prototype.addShapeList=function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},Ms.prototype.addShape=function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")},zh.prototype.dispose=function(){console.error("THREE.Scene: .dispose() has been removed.")},Object.defineProperties(Ci.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new fn}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(i){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=i===1}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(i){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=i}}}),Object.defineProperties(hn.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(i){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=i}}}),ti.prototype.clearTarget=function(i,t,e,n){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(i),this.clear(t,e,n)},ti.prototype.animate=function(i){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(i)},ti.prototype.getCurrentRenderTarget=function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},ti.prototype.getMaxAnisotropy=function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},ti.prototype.getPrecision=function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},ti.prototype.resetGLState=function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},ti.prototype.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},ti.prototype.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},ti.prototype.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},ti.prototype.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},ti.prototype.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},ti.prototype.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},ti.prototype.supportsVertexTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},ti.prototype.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},ti.prototype.enableScissorTest=function(i){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(i)},ti.prototype.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},ti.prototype.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},ti.prototype.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},ti.prototype.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},ti.prototype.setFaceCulling=function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},ti.prototype.allocTextureUnit=function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},ti.prototype.setTexture=function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},ti.prototype.setTexture2D=function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},ti.prototype.setTextureCube=function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},ti.prototype.getActiveMipMapLevel=function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()},Object.defineProperties(ti.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(i){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=i}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(i){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=i}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(i){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=i===!0?3001:3e3}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}}}),Object.defineProperties(id.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(zt.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(i){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=i}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(i){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=i}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(i){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=i}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(i){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=i}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(i){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=i}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(i){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=i}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(i){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=i}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(i){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=i}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(i){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=i}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(i){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=i}}}),p_.prototype.load=function(i){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");const t=this;return new d_().load(i,function(e){t.setBuffer(e)}),this},Zn.prototype.updateCubeMap=function(i,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(i,t)},Zn.prototype.clear=function(i,t,e,n){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(i,t,e,n)},P.crossOrigin=void 0,P.loadTexture=function(i,t,e,n){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");const r=new t_;r.setCrossOrigin(this.crossOrigin);const o=r.load(i,e,void 0,n);return t&&(o.mapping=t),o},P.loadTextureCube=function(i,t,e,n){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");const r=new $0;r.setCrossOrigin(this.crossOrigin);const o=r.load(i,e,void 0,n);return t&&(o.mapping=t),o},P.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},P.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"130"}})),typeof window!="undefined"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="130");var C_=v(6),yi=v.n(C_),R_=v(33),I_=v.n(R_),P_=v(11),Gi=v.n(P_);class O_{constructor(){this.camera=new lu(10,10,10,10),this.camera.position.z=100,this.camera.position.x=0,this.camera.position.y=0}focus(t,e){t.position.z=50}updateAspect(t,e){this.camera.left=-1*t/2,this.camera.right=t/2,this.camera.top=e/2,this.camera.bottom=-1*e/2,this.camera.updateProjectionMatrix()}}const Qd={linear:(i,t,e,n)=>e*i/n+t,easeIn:(i,t,e,n)=>e*(i/=n)*i+t,strongEaseIn:(i,t,e,n)=>e*(i/=n)*i*i*i*i+t,strongEaseOut:(i,t,e,n)=>e*((i=i/n-1)*i*i*i*i+1)+t,sineaseIn:(i,t,e,n)=>e*(i/=n)*i*i+t,sineaseOut:(i,t,e,n)=>e*((i=i/n-1)*i*i+1)+t},_r=new tt;class Yi{constructor(){this.camera=new O_,this.mesh=new Tt,this.material=null,this.geometry=null}applyOptions(t){}addObjects(t){this.mesh.position.z=50,t.add(this.mesh)}setSize(t,e){this.camera.updateAspect(t,e),this.geometry=new Cr(t,e,1,1),this.material=new hn({fragmentShader:this.fragmentShader,vertexShader:`
|
|
6962
6962
|
varying vec2 vUv;
|
|
6963
6963
|
void main(){
|
|
6964
6964
|
vUv = uv;
|
|
@@ -7951,6 +7951,6 @@ self.onmessage = function(e) {
|
|
|
7951
7951
|
`),t.trackLogger.addLog(s,"error",a,o.randomId);var l=(h=o.config.logger)===null||h===void 0?void 0:h.error;l&&l("["+a+"] "+s)}},o.logger.info("new slide with clientId: "+o.config.clientId+", version: "+o.version,o.taskId),o.anchor=o.config.anchor,o.syncQueue=new BE(o.receiveSyncHandler),o.lock=new UE(o.mode==="interactive"),o.cacheImage.style.position="absolute",o.cacheImage.style.zIndex="100",o.setMedianControllerAttribute(),o.canvasContainer.style.position="relative",o.canvasContainer.style.fontSize="0",o.canvasContainer.appendChild(o.medianController),o.frame.appendChild(o.canvasContainer),o.frameResizeObserver.observe(o.frame),o.on(lr.syncReceive,function(s){o.lock.unlock(s.type,s.uuid),o.syncQueue.addTask(s)}),o.renderingTaskManager.eventHub.on("task-error",function(s){var a=s.error,h=s.task,l=wi.transform(a);l.errorType===er.RuntimeWarn?o.logger.warn(l.message,o.taskId):o.logger.error(l.message,o.taskId),o.isLoading=!1,o.reportError(l,h.slideIndex)}),window.addEventListener("__slide_ref__",o.handleSlideRef),o.resizeView=pg()(o.resizeView.bind(o),50),o.player=o.initPlayer(o.config),o.config.controller&&o.createController(),o.player.view&&o.canvasContainer.appendChild(o.player.view),o.handleViewClick=pg()(o.handleViewClick,300),o.player.errorChannel.on("error",function(s,a){var h=wi.transform(s);h.errorType===er.RuntimeWarn?o.logger.warn(h.message,o.taskId):o.logger.error(h.message,o.taskId),o.isLoading=!1,o.reportError(s,a)}),window.addEventListener("message",o.recoverHandler),t.volumeAdjuster.on("update",o._updateVolumeByStaticAdjuster),o}var e,n;return VE(t,i),t.flushLog=function(r){return r===void 0&&(r=!1),qi(this,void 0,void 0,function(){return Ji(this,function(o){switch(o.label){case 0:if(!(t._tempLog.length>131072||r&&t._tempLog.length>0))return[3,5];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,cr==null?void 0:cr.setItem("run_time_log_"+t._tempLogIndex,t._tempLog)];case 2:return o.sent(),[3,4];case 3:return o.sent(),[3,4];case 4:t._tempLog="",t._tempLogIndex+=1,o.label=5;case 5:return[2]}})})},t.stopRemoteLog=function(){t.remoteLogAddress=null},t.startRemoteLog=function(r){return qi(this,void 0,void 0,function(){var o,s,a,h,l;return Ji(this,function(u){switch(u.label){case 0:return t.remoteLogAddress=r,[4,t.flushLog(!0)];case 1:if(u.sent(),!cr)return[3,13];o=[],u.label=2;case 2:return u.trys.push([2,4,,5]),[4,cr.keys()];case 3:return o=(u.sent()||[]).sort(function(p,y){return parseInt(p.replace("run_time_log_",""))-parseInt(y.replace("run_time_log_",""))}),[3,5];case 4:return u.sent(),[3,5];case 5:s=0,a=o,u.label=6;case 6:if(!(s<a.length))return[3,13];h=a[s],h.replace("run_time_log_",""),l="",u.label=7;case 7:return u.trys.push([7,9,,10]),[4,cr.getItem(h)];case 8:return l=u.sent()||"",[3,10];case 9:return u.sent(),[3,10];case 10:return[4,fetch(t.remoteLogAddress+"/logs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({log:l})})];case 11:u.sent(),u.label=12;case 12:return s++,[3,6];case 13:return[2]}})})},t.appendLogString=function(r){t._tempLog+=r,t.remoteLogAddress&&fetch(t.remoteLogAddress+"/logs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({log:r})}).catch(function(){})},Object.defineProperty(t.prototype,"dispatchIncrId",{get:function(){return this._dispatchIncrId++},enumerable:!1,configurable:!0}),t.prototype.reportError=function(r,o){this.emit(lr.renderError,{error:r,index:o}),window.postMessage({type:"@slide/_error_",errorType:r.errorType,errorMsg:r.errorMsg,slideId:this.randomId,slideIndex:o,customMessage:"@slide/_error_"},"*"),t.trackLogger.uploadLog(!0)},t.prototype.initSlideConfig=function(r){return r.timestamp&&(this.timestamp=r.timestamp),r.rtcAudio&&(ar.RtcAudioClazz=r.rtcAudio),this.mode=r.mode,this.anchor=r.anchor,this.anchor.appendChild(this.frame),this.enableGlobalClick=!Gi()(r.enableGlobalClick)&&r.enableGlobalClick,this.resize=r.resize||!1,this.interactive=r.interactive,this.frame.style.cssText=r.fixedFrameSize?"width:"+r.fixedFrameSize.width+"px;height:"+r.fixedFrameSize.height+"px;":"width:100%;height:100%",this.frame.style.cssText+="display:flex;justify-content:center;align-items:center;visibility:hidden;position:relative;z-index:1;",r.fixedFrameSize&&(this.frameWidth=r.fixedFrameSize.width,this.frameHeight=r.fixedFrameSize.height),r},t.prototype.initPlayer=function(r){var o,s,a,h=this,l=new ar({mode:this.mode,useLocalCache:!!Gi()(this.config.useLocalCache)||this.config.useLocalCache,logger:this.logger,resourceTimeout:Gi()(this.config.resourceTimeout)?15e3:this.config.resourceTimeout,loadDelegate:this.config.loaderDelegate,volumeAdjuster:this.volumeAdjuster,urlInterrupter:this.config.urlInterrupter},r.renderOptions);return l.setInteractive(this.interactive),l.updateConfig(r.renderOptions||{}),l.on(Ke.renderStart,function(u){h.isLoading=!0,h.emit(lr.renderStart,u),window.postMessage({type:"@slide/_render_start_",taskId:h.taskId,index:u},"*")}),l.on(Ke.renderEnd,function(u){h.isLoading=!1,h.player&&(h.designHeight=h.player.designHeight,h.designWidth=h.player.designWidth,h.cacheImage.style.width=h.player.designWidth+"px",h.cacheImage.style.height=h.player.designHeight+"px",h._slideCount=h.player.slideCount),h.emit(lr.renderEnd,u),window.postMessage({type:"@slide/_render_end_",taskId:h.taskId,index:u},"*")}),l.on(Ke.slideChange,function(u){h.__slideState.currentSlideIndex=u,h.emitStateChange(),h.emit(lr.slideChange,u)}),l.on(Ke.mainSeqStateChange,function(u){h.__slideState.mainSeqState=u,h.emitStateChange()}),l.on(Ke.mainSeqStepChange,function(u){h.__slideState.mainSeqStep=u,h.emitStateChange()}),l.on(Ke.interactiveSeqStateChange,function(u){var p=u.id,y=u.state;h.__slideState.interactiveSeqState[p]=y,h.emitStateChange()}),l.on(Ke.animateStart,function(){h.isAnimating!==!0&&(h.isAnimating=!0,h.emit(lr.animateStart))}),l.on(Ke.animateEnd,function(){h.isAnimating!==!1&&(h.isAnimating=!1,h.emit(lr.animateEnd))}),l.on(Ke.interactiveSeqAction,function(u){var p=u.action,y=u.seqId;h.emitSyncDispatch({slideIndex:h.__slideState.currentSlideIndex,type:"interactiveAnim",action:p,seqId:y}),h.emitStateChange()}),l.on(Ke.mainSeqStepStart,function(u){h.emit(lr.mainSeqStepStart,u)}),l.on(Ke.mainSeqStepEnd,function(u){h.emit(lr.mainSeqStepEnd,u)}),l.on(Ke.mediaPlay,function(u){var p,y=(p=h.__slideState.mediaState[u.id])!==null&&p!==void 0?p:{};y.type="play",y.time=h.timestamp()-1e3*u.time,h.__slideState.mediaState[u.id]=y,u._stateOnly?h.config.mode==="interactive"&&h.receiveSyncHandler({slideIndex:h.__slideState.currentSlideIndex,type:"mediaPlay",id:u.id,state:y}).catch(function(x){h.logger.error(x==null?void 0:x.message,h.taskId)}):h.emitSyncDispatch({slideIndex:h.__slideState.currentSlideIndex,type:"mediaPlay",id:u.id,state:y}),h.emitStateChange()}),l.on(Ke.mediaStop,function(u){delete h.__slideState.mediaState[u.id],h.emitStateChange()}),l.on(Ke.mediaPause,function(u){var p,y=(p=h.__slideState.mediaState[u.id])!==null&&p!==void 0?p:{};y.type="pause",y.time=u.time,h.__slideState.mediaState[u.id]=y,u._stateOnly?h.config.mode==="interactive"&&h.receiveSyncHandler({slideIndex:h.__slideState.currentSlideIndex,type:"mediaPause",id:u.id,state:y}).catch(function(x){h.logger.error(x==null?void 0:x.message,h.taskId)}):h.emitSyncDispatch({slideIndex:h.__slideState.currentSlideIndex,type:"mediaPause",id:u.id,state:y}),h.emitStateChange()}),l.on(Ke.mediaSeek,function(u){var p,y=(p=h.__slideState.mediaState[u.id])!==null&&p!==void 0?p:{};u.isPlaying?(y.type="play",y.time=h.timestamp()-1e3*u.time):(y.type="pause",y.time=u.time),h.__slideState.mediaState[u.id]=y,h.emitSyncDispatch({slideIndex:h.__slideState.currentSlideIndex,type:"mediaSeek",id:u.id,time:u.time,state:y}),h.emitStateChange()}),l.on(Ke.requestPrevSlide,function(u){h.handlePrevSlide(u)}),l.on(Ke.requestNextSlide,function(u){h.handleNextSlide(u)}),l.on(Ke.requestGotoSlide,function(u){var p;!((p=h.config.navigatorDelegate)===null||p===void 0)&&p.gotoPage?h.config.navigatorDelegate.gotoPage(u):h.handleGotoSlide(u)}),l.on(Ke.requestOpenUrl,function(u){var p;console.log(h.config.navigatorDelegate),!((p=h.config.navigatorDelegate)===null||p===void 0)&&p.openUrl&&h.config.navigatorDelegate.openUrl(u)}),l.on(Ke.fullscreenChange,function(u){var p,y=u.targetId,x=u.state;h.emitSyncDispatch({slideIndex:h.__slideState.currentSlideIndex,type:"mediaFullscreen",targetId:y,state:x});var E=(p=h.__slideState.mediaState[y])!==null&&p!==void 0?p:{};E.fullscreen=x,h.__slideState.mediaState[y]=E,h.emitStateChange()}),l.on(Ke.changeLocalFullscreenState,function(u){u.slideIndex===h.__slideState.currentSlideIndex?(u.targetId&&h.__slideState.mediaState[u.targetId]&&(h.__slideState.mediaState[u.targetId].fullscreen=u.status),h.emitStateChange()):h.logger.info("event slideIndex: "+u.slideIndex+", current slideIndex: "+h.__slideState.currentSlideIndex,h.taskId)}),(o=l.view)===null||o===void 0||o.addEventListener("touchend",this.handleViewTouchEnd),(s=l.view)===null||s===void 0||s.addEventListener("touchstart",this.handleViewTouchStart),(a=l.view)===null||a===void 0||a.addEventListener("click",this.handleViewClick),l.on(Ke.userInput,this.userInputHandle),l},t.prototype.createController=function(){this.player&&(this.playerController=new FE(this.player,this.frame))},t.prototype.setMedianControllerAttribute=function(){this.medianController.className="median-container",this.medianController.style.position="absolute",this.medianController.style.left="0",this.medianController.style.top="0",this.medianController.style.zIndex="2",this.medianController.style.fontSize="16px"},t.prototype.frameResizeHandler=function(){if(!this.config.fixedFrameSize){var r=this.frame.getBoundingClientRect(),o=r.width,s=r.height;this.frameWidth=o,this.frameHeight=s,this.resizeView()}},t.prototype.updateFixedFrameSize=function(r,o,s){this.config.fixedFrameSize&&(this.frameWidth=r,this.frameHeight=o,this.frame.style.width=r+"px",this.frame.style.height=o+"px",this.resizeView(s))},t.prototype.resizeView=function(r){var o,s,a=this,h=this.width,l=this.height;if(h>0&&l>0){var u=this.frameWidth/h,p=u*l;p>this.frameHeight&&(u*=this.frameHeight/p),(o=this.player)===null||o===void 0||o.scaleView(u,this.resize,r),this.cacheImage.style.transform="scale("+u+")",this.medianController.style.transform="scale("+u+")",this.medianController.setAttribute("data-scale",u.toString()),this.isInitResized||(this.isInitResized=!0,(s=this.player)===null||s===void 0||s.clock.setTimeout(function(){a.frame.style.visibility="visible"},32))}},t.prototype.setSlideState=function(r){var o,s,a;return qi(this,void 0,void 0,function(){var h,l=this;return Ji(this,function(u){switch(u.label){case 0:return this.isSyncingSlideState=!0,this.logger.info("stateChange receive "+JSON.stringify(r),this.taskId),r.taskId&&r.taskId!==this.__slideState.taskId&&(this.__slideState.taskId=r.taskId,(o=this.player)===null||o===void 0||o.setResourceData(r.taskId,this.__slideState.url)),r.url&&r.url!==this.__slideState.url&&(this.__slideState.url=r.url,(s=this.player)===null||s===void 0||s.setResourceData(this.__slideState.taskId,r.url)),Number.isInteger(r.currentSlideIndex)&&r.currentSlideIndex!==this.__slideState.currentSlideIndex?(this.__slideState.currentSlideIndex=r.currentSlideIndex,[4,this.doRenderSlide(r.currentSlideIndex)]):[3,2];case 1:u.sent(),u.label=2;case 2:return[4,(a=this.player)===null||a===void 0?void 0:a.clock.waitUntil(function(){var p,y;return((p=l.player)===null||p===void 0?void 0:p.currentIndex)===r.currentSlideIndex&&((y=l.player)===null||y===void 0?void 0:y.currentStage)},3e3)];case 3:return u.sent(),h=!1,Number.isInteger(r.mainSeqStep)&&r.mainSeqStep!==this.__slideState.mainSeqStep&&(h=!0,this.__slideState.mainSeqStep=r.mainSeqStep),r.mainSeqState&&r.mainSeqState!==this.__slideState.mainSeqState&&(h=!0,this.__slideState.mainSeqState=r.mainSeqState),h&&this.setMainSeqStep(this.__slideState.mainSeqStep,this.__slideState.mainSeqState==="idle"?"start":"end"),r.interactiveSeqState&&(this.initInteractiveSeq(r),this.__slideState.interactiveSeqState=r.interactiveSeqState),[4,vh(1500)];case 4:return u.sent(),r.mediaState&&(this.initMedia(r),this.__slideState.mediaState=r.mediaState),this.isSyncingSlideState=!1,[2]}})})},t.prototype.initInteractiveSeq=function(r){var o;for(var s in r.interactiveSeqState){var a=r.interactiveSeqState[s];(o=this.player)===null||o===void 0||o.setInteractiveSeqState(s,a.step,a.state==="idle"?"start":"end")}},t.prototype.initMedia=function(r){var o,s,a;for(var h in r.mediaState){var l=r.mediaState[h],u=this.__slideState.mediaState[h];if((o=this.player)===null||o===void 0||o.syncFullscreenVideoState({targetId:h,state:!!l.fullscreen,slideIndex:this.slideState.currentSlideIndex}),!u||l.type!==u.type||l.time!==u.time)if(l.type==="play"){var p=(this.timestamp()-l.time)/1e3;(s=this.player)===null||s===void 0||s.setMediaState(h,!0,p)}else(a=this.player)===null||a===void 0||a.setMediaState(h,!1,l.time)}},Object.defineProperty(t.prototype,"slideCount",{get:function(){return this._slideCount},enumerable:!1,configurable:!0}),t.prototype.getSizeAsync=function(){return qi(this,void 0,void 0,function(){var r;return Ji(this,function(o){switch(o.label){case 0:if(this.width>0&&this.height>0)return[2,[this.width,this.height]];o.label=1;case 1:return o.trys.push([1,4,,5]),[4,fetch(this.__slideState.url+"/"+this.__slideState.taskId+"/jsonOutput/slide-1.json")];case 2:return[4,o.sent().json()];case 3:return[2,[(r=o.sent()).width,r.height]];case 4:return o.sent(),[2,[0,0]];case 5:return[2]}})})},t.prototype.getSlideCountAsync=function(){return qi(this,void 0,void 0,function(){return Ji(this,function(r){switch(r.label){case 0:if(this._slideCount>0)return[2,this._slideCount];r.label=1;case 1:return r.trys.push([1,4,,5]),[4,fetch(this.__slideState.url+"/"+this.__slideState.taskId+"/jsonOutput/slide-1.json")];case 2:return[4,r.sent().json()];case 3:return[2,r.sent().slideCount];case 4:return r.sent(),[2,0];case 5:return[2]}})})},Object.defineProperty(t.prototype,"slideState",{get:function(){return this.__slideState.mainSeqState=this.mainSeqState,this.__slideState.mainSeqStep=this.mainSeqStep,JSON.parse(JSON.stringify(this.__slideState))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mainSeqLength",{get:function(){var r;return((r=this.player)===null||r===void 0?void 0:r.mainSeqLength())||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mainSeqStep",{get:function(){var r;return((r=this.player)===null||r===void 0?void 0:r.mainSeqStep())||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mainSeqState",{get:function(){var r;return((r=this.player)===null||r===void 0?void 0:r.mainSeqState())||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderOptions",{get:function(){var r;return((r=this.player)===null||r===void 0?void 0:r.config)||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"drawCall",{get:function(){var r;return((r=this.player)===null||r===void 0?void 0:r.runtime.drawCall)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderFps",{get:function(){var r;return((r=this.player)===null||r===void 0?void 0:r.runtime.fps)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"runtimeFps",{get:function(){var r;return((r=this.player)===null||r===void 0?void 0:r.fps.value)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"view",{get:function(){var r;return((r=this.player)===null||r===void 0?void 0:r.view)||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.designWidth},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.designHeight},enumerable:!1,configurable:!0}),t.prototype.updateRenderOption=function(r){this.player&&(this.player.updateConfig(r),this.renderOptions&&(this.config.renderOptions=this.renderOptions))},t.prototype.setResource=function(r,o){var s;this.taskId=r,(s=this.player)===null||s===void 0||s.setResourceData(r,o),this.__slideState.taskId=r,this.__slideState.url=o,this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"setResource",taskId:r,url:o})},t.prototype._renderSlide=function(r){var o;return qi(this,void 0,void 0,function(){var s=this;return Ji(this,function(a){switch(a.label){case 0:return this.renderingIndex=r,this.player&&r===this.player.currentIndex?[2]:((ar.platform.isIOS()||ar.platform.isAndroid())&&this.iosResetCache.indexOf(r)<0&&this.iosResetCache.push(r),[4,(o=this.player)===null||o===void 0?void 0:o.renderSlide(r)]);case 1:return a.sent(),this.__slideState.currentSlideIndex=r,this.resizeView(),this.__slideState.interactiveSeqState={},this.__slideState.mediaState={},this.emitStateChange(),setTimeout(function(){var h,l;if(((l=(h=s.player)===null||h===void 0?void 0:h.view)===null||l===void 0?void 0:l.style.visibility)==="hidden"&&(s.player.view.style.visibility="visible"),s.frame.style.visibility==="hidden"&&(s.frame.style.visibility="visible"),s.needClearCacheImage)try{s.frame.removeChild(s.cacheImage)}catch{}},100),[2]}})})},t.prototype.renderSlide=function(r,o){if(o===void 0&&(o=!0),this.player){var s=Number(r);(s!==this.player.currentIndex||this.renderingTaskManager.hasStartTask())&&(s>this.slideCount&&this.slideCount>0||this.poseRenderSlide(s,o))}},t.prototype.needCreateNewPlayer=function(){var r=ar.platform.isLowGpuMemory()?15:30;return(ar.platform.isIOS()||ar.platform.isAndroid())&&this.iosResetCache.length>r},t.prototype.poseRenderSlide=function(r,o){this.mode==="interactive"?this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"renderSlide",index:r,isForward:o}):this.mode==="sync"?(this.doRenderSlide(r,o),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"renderSlide",index:r,isForward:o})):this.doRenderSlide(r,o)},t.prototype.doRenderSlide=function(r,o){var s,a,h,l=this;if(o===void 0&&(o=!0),!this.player)return Promise.resolve();if(this.needCreateNewPlayer()&&(this.iosResetCache=[],this.iosNewPlayer=this.initPlayer(this.config),this.iosNewPlayer.setResourceData(this.__slideState.taskId,this.__slideState.url)),this.iosNewPlayer){var u=this.player.getSnapshot();this.cacheImage.src=u,this.frame.appendChild(this.cacheImage),this.player.destroy(),(s=this.playerController)===null||s===void 0||s.destroy(),this.player=this.iosNewPlayer,this.iosNewPlayer=void 0,!((a=this.config)===null||a===void 0)&&a.controller&&this.createController(),this.needClearCacheImage=!0,!((h=this==null?void 0:this.player)===null||h===void 0)&&h.view&&(this.player.view.style.visibility="hidden",this.canvasContainer.appendChild(this.player.view))}var p=Math.random().toString(32).substr(2);return this.player.isForward=o,this.renderingTaskManager.addTask(function(){return l._renderSlide(r)},r,p),new Promise(function(y){l.renderingTaskManager.eventHub.once("task-end-"+p,y)})},t.prototype.getSnapshot=function(){var r,o;return(o=(r=this.player)===null||r===void 0?void 0:r.getSnapshot())!==null&&o!==void 0?o:null},t.prototype.nextStep=function(){!this.isLoading&&this.player&&this.interactive?(this.hasNextStep()||this.emit(lr.slideStepEnd),this.player.mainSeqHasNextStep()?this.mode==="interactive"?this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"nextStep",next:this.player.mainSeqStep()+1}):this.mode==="sync"?(this.doNextStep(!1,""),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"nextStep",next:this.player.mainSeqStep()})):this.doNextStep(!1,""):this.handleNextSlide()):this.logger.info("prevent nextStep. isLoading: "+this.isLoading+", player: "+!!this.player+", interactive: "+this.interactive,this.taskId)},t.prototype.doNextStep=function(r,o){if(this.player){var s=!this.config.clientId||o===this.config.clientId;this.player.nextStep(r,s);var a=this.player.mainSeqStep();this.__slideState.mainSeqStep=a,this.emitStateChange()}},t.prototype.prevStep=function(){!this.isLoading&&this.player&&this.interactive?(this.hasPrevStep()||this.emit(lr.slideStepStart),this.player.mainSeqHasPrevStep()?this.mode==="interactive"?this.emitSyncDispatch({type:"prevStep",slideIndex:this.__slideState.currentSlideIndex,next:this.player.mainSeqStep()-1}):this.mode==="sync"?(this.doPrevStep(),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"prevStep",next:this.player.mainSeqStep()})):this.doPrevStep():this.handlePrevSlide()):this.logger.info("prevent nextStep. isLoading: "+this.isLoading+", player: "+this.player+", interactive: "+this.interactive,this.taskId)},t.prototype.doPrevStep=function(r){if(r===void 0&&(r=!1),this.player){this.player.prevStep(r);var o=this.player.mainSeqStep();this.__slideState.mainSeqStep=o,this.emitStateChange()}},t.prototype.isSlideStateReady=function(r){return r.taskId.length>0&&r.url.length>0&&r.currentSlideIndex>0},t.prototype.emitStateChange=function(){if(this.mode!=="local"&&!this.isSyncingSlideState){var r=this.slideState;!iE()(this.lastEmitedState,r)&&this.isSlideStateReady(r)&&(this.lastEmitedState=r,this.emit(lr.stateChange,r),this.logger.info("stateChange dispatch "+JSON.stringify(this.slideState),this.taskId))}},t.prototype.emitSyncDispatch=function(r){if(!this.lock.isLocked(r.type)){var o=Math.random().toString(32).substr(2);this.lock.addLock(r.type,o);var s=ja(ja({},r),{uuid:o,clientId:this.config.clientId});this.config.mode==="sync"&&(s.incrId=this.dispatchIncrId),this.emit(lr.syncDispatch,s),this.logger.info("sync dispatch "+JSON.stringify(s),this.taskId)}},t.prototype.setMainSeqStep=function(r,o){var s;(s=this.player)===null||s===void 0||s.setMainSeqStep(r,o)},t.prototype.setInteractive=function(r){var o;this.interactive=r,(o=this.player)===null||o===void 0||o.setInteractive(r)},t.prototype.pause=function(){var r;(r=this.player)===null||r===void 0||r.pause()},t.prototype.resume=function(){var r;(r=this.player)===null||r===void 0||r.resume()},t.prototype._doFrozen=function(){var r;return qi(this,void 0,void 0,function(){var o,s,a,h=this;return Ji(this,function(l){switch(l.label){case 0:return this.logger.info("frozen with player["+!!this.player+"]",this.taskId),this.view&&this.player?[4,this.player.clock.waitUntil(function(){return!h.isLoading},6e4)]:[3,2];case 1:for(s in l.sent(),o=this.player.getSnapshot()||"",this.cacheImage.src=o,this.frame.appendChild(this.cacheImage),this.player.destroy(),(r=this.playerController)===null||r===void 0||r.destroy(),this.player=void 0,this.__slideState.mediaState)a=this.__slideState.mediaState[s],this.__slideState.mediaState[s]=ja(ja({},a),{frozenTime:this.timestamp()});l.label=2;case 2:return[2]}})})},t.prototype.frozen=function(){var r=this;this.frozenTaskManager.addTask("frozen",function(){return r._doFrozen()})},t.prototype._doRelease=function(){var r,o;return qi(this,void 0,void 0,function(){var s,a,h,l;return Ji(this,function(u){switch(u.label){case 0:if(this.logger.info("do release slide",this.taskId),this.player)return[2];for(a in this.player=this.initPlayer(this.config),!((r=this.config)===null||r===void 0)&&r.controller&&this.createController(),this.player.view&&(this.canvasContainer.appendChild(this.player.view),this.player.view.style.visibility="hidden"),s=this.__slideState,this.__slideState=fg()(Vg),s.mediaState)(h=s.mediaState[a]).type==="play"&&(l=Math.max((o=h.frozenTime)!==null&&o!==void 0?o:0,h.time),h.time=this.timestamp()-(l-h.time),h.frozenTime=void 0);return[4,this.setSlideState(s)];case 1:return u.sent(),[4,this.player.clock.delay(333)];case 2:u.sent(),this.player.view&&(this.player.view.style.visibility="visible");try{this.frame.removeChild(this.cacheImage)}catch{}return[2]}})})},t.prototype.release=function(){var r=this;this.frozenTaskManager.addTask("release",function(){return r._doRelease()})},t.prototype._doDestroy=function(){var r,o,s,a,h=this;this.logger.info("do destroy slide",this.taskId);var l=t.instances.findIndex(function(u){return u.randomId===h.randomId});l>=0&&t.instances.splice(l,1),this.playerController&&this.playerController.destroy(),this.frameResizeObserver.disconnect(),(r=this.player)===null||r===void 0||r.removeAllListeners(),(o=this.player)===null||o===void 0||o.destroy(),(s=this.player)===null||s===void 0||s.removeAllListeners(),this.logger={warn:function(){return{}},info:function(){return{}},error:function(){return{}}},this.syncQueue.destroy(),this.renderingTaskManager.destroy(),this.frozenTaskManager.destroy(),window.removeEventListener("__slide_ref__",this.handleSlideRef),window.removeEventListener("message",this.recoverHandler),this.removeAllListeners();try{!((a=this.player)===null||a===void 0)&&a.view&&this.anchor.removeChild(this.player.view),this.anchor.removeChild(this.frame)}catch{}t.volumeAdjuster.off("update",this._updateVolumeByStaticAdjuster)},t.prototype.waitLoadEnd=function(){return qi(this,void 0,void 0,function(){var r;return Ji(this,function(o){switch(o.label){case 0:r=0,o.label=1;case 1:return this.isLoading&&r<10?[4,vh(100)]:[3,3];case 2:return o.sent(),r+=1,[3,1];case 3:return[2]}})})},t.prototype.preload=function(r){return this.player?this.player.preload(r):Promise.resolve()},t.prototype.destroy=function(){var r=this;this.logger.info("pre destroy slide",""),this.isLoading?this.waitLoadEnd().then(function(){r._doDestroy()}):this._doDestroy()},t.prototype.clearSlideCache=function(){var r;(r=this.player)===null||r===void 0||r.clearLocalCache()},t.prototype.hasNextStep=function(){if(!this.player)return!1;var r=this.player.currentIndex===this.slideCount,o=this.mainSeqLength===0||this.mainSeqStep>=this.mainSeqLength-1,s=this.mainSeqState==="end"||this.mainSeqState==="running"||this.mainSeqState==null;return!(r&&o&&s)},t.prototype.hasPrevStep=function(){if(!this.player)return!1;var r=this.player.currentIndex===1,o=this.mainSeqLength===0||this.mainSeqStep===0,s=this.mainSeqState==="idle"||this.mainSeqState===null;return!(r&&o&&s)},t.prototype.snapshot=function(){return qi(this,void 0,void 0,function(){return Ji(this,function(r){return this.player?[2,this.player.getSnapshot()]:[2,null]})})},t.prototype.snapshotWithTimingEnd=function(r){return qi(this,void 0,void 0,function(){return Ji(this,function(o){return this.player?[2,this.player.snapshotWithTimingEnd(r)]:[2,null]})})},t.prototype.updateGlobalVolume=function(r){this.volumeAdjuster.volume=r},t.prototype.getGlobalVolume=function(){return this.volumeAdjuster.volume},t.clearLocalCache=function(){ar.clearLocalCache()},t.disposeLocalCache=function(){},e=t,t.preloadResource=zE,t.instances=[],t._tempFrozenIds=[],t._tempLog="",t._tempLogIndex=1,t.remoteLogAddress=null,t.usePlugin=function(r){r.context({logger:{info:function(o){t.appendLogString("INFO - "+new Date().toISOString()+" - "+o+`
|
|
7952
7952
|
`)},warn:function(o){t.appendLogString("WARN - "+new Date().toISOString()+" - "+o+`
|
|
7953
7953
|
`)},error:function(o){t.appendLogString("ERROR - "+new Date().toISOString()+" - "+o+`
|
|
7954
|
-
`)}}}),function(o){var s=oc.get(o.hookPoint)||[];s.push(o),oc.set(o.hookPoint,s)}(r)},t.volumeAdjuster=new cg,t.trackLogger=new GE,t.handleFrozenAllSlide=function(){t.instances.forEach(function(r){r.player&&(t._tempFrozenIds.push(r.randomId),r.frozen())})},t.handleReleaseAllSlide=function(){t._tempFrozenIds.forEach(function(r){var o=t.instances.find(function(s){return s.randomId===r});o&&o.release()}),t._tempFrozenIds=[]},t.handleLogReport=function(r){return qi(void 0,void 0,void 0,function(){var o,s,a,h,l,u;return Ji(e,function(p){switch(p.label){case 0:return[4,t.flushLog(!0)];case 1:if(p.sent(),!cr)return[3,12];o=[],p.label=2;case 2:return p.trys.push([2,4,,5]),[4,cr.keys()];case 3:return o=(p.sent()||[]).sort(function(y,x){return parseInt(y.replace("run_time_log_",""))-parseInt(x.replace("run_time_log_",""))}),[3,5];case 4:return p.sent(),[3,5];case 5:if(o.length===0)return window.postMessage({type:"@slide/_report_log_",log:"",index:1,total:1,customMessage:"@slide/_report_log_",sessionId:r},"*"),[2];s=0,a=o,p.label=6;case 6:if(!(s<a.length))return[3,12];h=a[s],l=h.replace("run_time_log_",""),u="",p.label=7;case 7:return p.trys.push([7,9,,10]),[4,cr.getItem(h)];case 8:return u=p.sent()||"",[3,10];case 9:return p.sent(),[3,10];case 10:window.postMessage({type:"@slide/_report_log_",log:u,index:parseInt(l,10),total:o.length,customMessage:"@slide/_report_log_",sessionId:r},"*"),p.label=11;case 11:return s++,[3,6];case 12:return[2]}})})},t.handleLogDownload=function(){return qi(void 0,void 0,void 0,function(){var r,o,s,a,h,l,u;return Ji(e,function(p){switch(p.label){case 0:return p.trys.push([0,7,,8]),[4,t.flushLog(!0)];case 1:return p.sent(),r="",cr?[4,cr.keys()]:[3,6];case 2:o=(p.sent()||[]).sort(function(y,x){return parseInt(y.replace("run_time_log_",""))-parseInt(x.replace("run_time_log_",""))}),s=0,a=o,p.label=3;case 3:return s<a.length?(h=a[s],l=r,[4,cr.getItem(h)]):[3,6];case 4:r=l+(p.sent()||""),p.label=5;case 5:return s++,[3,3];case 6:return(u=document.createElement("a")).setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(r)),u.setAttribute("download","slide_log"),u.style.display="none",document.body.appendChild(u),u.click(),document.body.removeChild(u),[3,8];case 7:return p.sent(),[3,8];case 8:return[2]}})})},WE([(n="Slide.initConfig",function(r,o,s){var a=s.value;s.value=function(){for(var h=[],l=0;l<arguments.length;l++)h[l]=arguments[l];for(var u=oc.get(n)||[],p=h,y=0,x=u;y<x.length;y++){var E=x[y];try{p=E.before(p)}catch{}if(!Array.isArray(p)||p.length!==h.length)throw new Error("plugin before hook return invalid args")}for(var A=a.bind(this).apply(void 0,p),C=0,j=u.reverse();C<j.length;C++){E=j[C];try{A=E.after(A)}catch{}if(!A)throw new Error("plugin after hook return undefined result")}return A}})],t.prototype,"initSlideConfig",null),t}(yi.a);cr==null||cr.clear().catch(function(){}),window.addEventListener("__slide_log__",to.handleLogDownload),window.addEventListener("message",function(i){if(i.data.type==="@slide/_request_log_")to.handleLogReport(i.data.sessionId).catch(function(){});else if(i.data.type==="@slide/_request_frozen_")to.handleFrozenAllSlide();else if(i.data.type==="@slide/_request_release_")to.handleReleaseAllSlide();else if(i.data.type==="@slide/_update_volume_"){var t=.5;try{t=parseFloat(i.data.volume.toString())}catch{}to.volumeAdjuster.volume=t}else i.data.type==="@slide/_get_volume_"?window.postMessage({type:"@slide/_report_volume_",volume:to.volumeAdjuster.volume,customMessage:"@slide/_report_volume_"},"*"):i.data.type==="@slide/_preload_slide_"&&to.preloadResource(i.data.taskId,i.data.prefix,function(e){window.postMessage({type:"@slide/_preload_slide_progress_",taskId:i.data.taskId,progress:e},"*")}).catch(function(e){window.postMessage({type:"@slide/_preload_slide_error_",taskId:i.data.taskId,error:e},"*")})}),window.setInterval(function(){to.flushLog().catch(function(){})},2e3)}]);const tS="!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",eS=87,nS=20,rv=[],iS=()=>{for(let b=0;b<nS;b++)rv[b]=tS.charAt(Math.random()*eS);return rv.join("")};function dv(b){try{return b()}catch(w){console.error(w)}}class Ka{constructor(){this.push=this.addDisposer,this.disposers=new Map}addDisposer(w,v=this.genUID()){return this.flush(v),this.disposers.set(v,Array.isArray(w)?rS(w):w),v}add(w,v=this.genUID()){const O=w();return O?this.addDisposer(O,v):v}addEventListener(w,v,O,M,I=this.genUID()){return w.addEventListener(v,O,M),this.addDisposer(()=>w.removeEventListener(v,O,M),I),I}setTimeout(w,v,O=this.genUID()){const M=window.setTimeout(()=>{this.remove(O),w()},v);return this.addDisposer(()=>window.clearTimeout(M),O)}setInterval(w,v,O=this.genUID()){const M=window.setInterval(w,v);return this.addDisposer(()=>window.clearInterval(M),O)}remove(w){const v=this.disposers.get(w);return this.disposers.delete(w),v}flush(w){const v=this.remove(w);v&&v()}flushAll(){this.disposers.forEach(dv),this.disposers.clear()}genUID(){let w;do w=iS();while(this.disposers.has(w));return w}}function rS(b){return()=>b.forEach(dv)}function pv(b,w,v){return Math.min(Math.max(b,w),v)}function oS(b){return typeof b=="object"&&b!==null}function sS(b){if(!b)return!1;const w=b.tagName;return w==="INPUT"||w==="TEXTAREA"||w==="SELECT"}var fv={exports:{}},aS={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]},mv={exports:{}},lS=function(w){return!w||typeof w=="string"?!1:w instanceof Array||Array.isArray(w)||w.length>=0&&(w.splice instanceof Function||Object.getOwnPropertyDescriptor(w,w.length-1)&&w.constructor.name!=="String")},hS=lS,uS=Array.prototype.concat,cS=Array.prototype.slice,ov=mv.exports=function(w){for(var v=[],O=0,M=w.length;O<M;O++){var I=w[O];hS(I)?v=uS.call(v,cS.call(I)):v.push(I)}return v};ov.wrap=function(b){return function(){return b(ov(arguments))}};var qa=aS,Za=mv.exports,gv=Object.hasOwnProperty,vv=Object.create(null);for(var Mc in qa)gv.call(qa,Mc)&&(vv[qa[Mc]]=Mc);var Sr=fv.exports={to:{},get:{}};Sr.get=function(b){var w=b.substring(0,3).toLowerCase(),v,O;switch(w){case"hsl":v=Sr.get.hsl(b),O="hsl";break;case"hwb":v=Sr.get.hwb(b),O="hwb";break;default:v=Sr.get.rgb(b),O="rgb";break}return v?{model:O,value:v}:null};Sr.get.rgb=function(b){if(!b)return null;var w=/^#([a-f0-9]{3,4})$/i,v=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,O=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,M=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,I=/^(\w+)$/,D=[0,0,0,1],k,z,W;if(k=b.match(v)){for(W=k[2],k=k[1],z=0;z<3;z++){var Y=z*2;D[z]=parseInt(k.slice(Y,Y+2),16)}W&&(D[3]=parseInt(W,16)/255)}else if(k=b.match(w)){for(k=k[1],W=k[3],z=0;z<3;z++)D[z]=parseInt(k[z]+k[z],16);W&&(D[3]=parseInt(W+W,16)/255)}else if(k=b.match(O)){for(z=0;z<3;z++)D[z]=parseInt(k[z+1],0);k[4]&&(k[5]?D[3]=parseFloat(k[4])*.01:D[3]=parseFloat(k[4]))}else if(k=b.match(M)){for(z=0;z<3;z++)D[z]=Math.round(parseFloat(k[z+1])*2.55);k[4]&&(k[5]?D[3]=parseFloat(k[4])*.01:D[3]=parseFloat(k[4]))}else return(k=b.match(I))?k[1]==="transparent"?[0,0,0,0]:gv.call(qa,k[1])?(D=qa[k[1]],D[3]=1,D):null:null;for(z=0;z<3;z++)D[z]=zo(D[z],0,255);return D[3]=zo(D[3],0,1),D};Sr.get.hsl=function(b){if(!b)return null;var w=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,v=b.match(w);if(v){var O=parseFloat(v[4]),M=(parseFloat(v[1])%360+360)%360,I=zo(parseFloat(v[2]),0,100),D=zo(parseFloat(v[3]),0,100),k=zo(isNaN(O)?1:O,0,1);return[M,I,D,k]}return null};Sr.get.hwb=function(b){if(!b)return null;var w=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,v=b.match(w);if(v){var O=parseFloat(v[4]),M=(parseFloat(v[1])%360+360)%360,I=zo(parseFloat(v[2]),0,100),D=zo(parseFloat(v[3]),0,100),k=zo(isNaN(O)?1:O,0,1);return[M,I,D,k]}return null};Sr.to.hex=function(){var b=Za(arguments);return"#"+yh(b[0])+yh(b[1])+yh(b[2])+(b[3]<1?yh(Math.round(b[3]*255)):"")};Sr.to.rgb=function(){var b=Za(arguments);return b.length<4||b[3]===1?"rgb("+Math.round(b[0])+", "+Math.round(b[1])+", "+Math.round(b[2])+")":"rgba("+Math.round(b[0])+", "+Math.round(b[1])+", "+Math.round(b[2])+", "+b[3]+")"};Sr.to.rgb.percent=function(){var b=Za(arguments),w=Math.round(b[0]/255*100),v=Math.round(b[1]/255*100),O=Math.round(b[2]/255*100);return b.length<4||b[3]===1?"rgb("+w+"%, "+v+"%, "+O+"%)":"rgba("+w+"%, "+v+"%, "+O+"%, "+b[3]+")"};Sr.to.hsl=function(){var b=Za(arguments);return b.length<4||b[3]===1?"hsl("+b[0]+", "+b[1]+"%, "+b[2]+"%)":"hsla("+b[0]+", "+b[1]+"%, "+b[2]+"%, "+b[3]+")"};Sr.to.hwb=function(){var b=Za(arguments),w="";return b.length>=4&&b[3]!==1&&(w=", "+b[3]),"hwb("+b[0]+", "+b[1]+"%, "+b[2]+"%"+w+")"};Sr.to.keyword=function(b){return vv[b.slice(0,3)]};function zo(b,w,v){return Math.min(Math.max(w,b),v)}function yh(b){var w=Math.round(b).toString(16).toUpperCase();return w.length<2?"0"+w:w}var dS=fv.exports;class pS{constructor(w){this.enable=w,this.apps={},this.level="debug",this.roomLogger=null,this._onMessage=v=>{let O;v instanceof CustomEvent?O=v.detail:oS(v.data)&&(O=v.data),O&&(typeof O.slide=="boolean"?this.enable=O.slide:O.slide==="__instance"?console.log(this):O.slide==="__debug"&&Object.values(this.apps).forEach(M=>{var I,D;(D=(I=M.controller)==null?void 0:I.slide)==null||D.createController()}))},this.initialize()}setAppContext(w,v){var O;((O=this.apps)[w]||(O[w]={})).context=v,this.log(`[Slide] new ${w}`)}setAppController(w,v){var O;((O=this.apps)[w]||(O[w]={})).controller=v}deleteApp(w){delete this.apps[w],this.log(`[Slide] delete ${w}`)}initialize(){window.addEventListener("message",this._onMessage)}dispose(){window.removeEventListener("message",this._onMessage)}log(...w){this.roomLogger?this.roomLogger.info(...w):this.enable&&console.log(...w)}verbose(...w){this.roomLogger?this.roomLogger.debug(...w):this.enable&&this.level==="verbose"&&console.log(...w)}warn(...w){this.roomLogger?this.roomLogger.warn(...w):console.warn(...w)}}const Nr=new pS(!1),ji=Nr.log.bind(Nr),Cc=Nr.verbose.bind(Nr),fS=b=>{Nr.roomLogger=b.logger};function _v(b){try{const w=window.getComputedStyle(b).backgroundColor;if(w!=="rgba(0, 0, 0, 0)"&&w!=="transparent")return w;if(b.parentElement)return _v(b.parentElement)}catch{}return"#ffffff"}function mS(b){const w=dS.get(b);if(w&&w.model==="rgb"){const v=w.value,M=(((Math.round(v[0])&255)<<16)+((Math.round(v[1])&255)<<8)+(Math.round(v[2])&255)).toString(16);return"#"+"000000".substring(M.length)+M}else return b}let xh="";function yv(b){return xh||(xh=mS(_v(b)),ji("[Slide] guess bg color",xh)),xh}function xv(b){const{width:w,height:v,slideCount:O,slideState:M}=b,{taskId:I,url:D}=M,k=[];for(let z=1;z<=O;++z)k.push({width:w,height:v,thumbnail:`${D}/${I}/preview/${z}.png`,src:"ppt"});return k}function sv(b,w,v,O){var k;const M=v.slideState.currentSlideIndex;if(!(M>0)||!w.getIsWritable())return;const I=[O,M].join("/");if(b.scenePathType(I)!=="page"){b.removeScenes(O);const z=v.slideCount,W=[];for(let Y=1;Y<=z;++Y)W.push({name:`${Y}`});b.putScenes(O,W)}let D;w.getBox().focus?D=b.state.sceneState.scenePath:D=((k=w.getView())==null?void 0:k.focusScenePath)||"",D!==I&&w.setScenePath(I)}const Dc="https://convertcdn.netless.link/dynamicConvert",gS=40,Rc={taskId:"",url:"",state:null};class vS{constructor({context:w,anchor:v,onPageChanged:O,onTransitionStart:M,onTransitionEnd:I,onError:D,onRenderError:k,showRenderError:z}){this.sideEffect=new Ka,this.ready=!1,this.readyPromise=new Promise(W=>{this.resolveReady=()=>{this.ready?ji("[Slide] render end"):setTimeout(()=>{this.ready=!0,W()},1e3)}}),this.onSyncDispatch=W=>{if(this.context.getIsWritable()&&this.room){const Y={type:li.SLIDE_EVENTS.syncDispatch,payload:W};Cc("[Slide] dispatch",JSON.stringify(W)),this.context.dispatchMagixEvent(li.SLIDE_EVENTS.syncDispatch,Y)}},this.magixEventListener=W=>{const{type:Y,payload:et}=W.payload;Y===li.SLIDE_EVENTS.syncDispatch&&(this.syncStateOnce(),Cc("[Slide] receive",JSON.stringify(et)),this.slide.emit(li.SLIDE_EVENTS.syncReceive,et))},this.onStateChange=W=>{this.context.getIsWritable()&&(Cc("[Slide] state change",JSON.stringify(W,null,2)),this.context.storage.setState({state:W}))},this.pollCount=0,this.pollReadyState=()=>{this.ready?this._toFreeze===1?this.freeze():this._toFreeze===-1&&this.unfreeze():this.pollCount<gS?(this.pollCount++,setTimeout(this.pollReadyState,500)):(this.pollCount=0,ji("[Slide] renderSlide 1 (retry after timeout)"),this.slide.renderSlide(1))},this._pageCount=0,this.destroyed=!1,this.timestamp=()=>this.room&&this.room.calibrationTimestamp?this.room.calibrationTimestamp:this.player?this.player.beginTimestamp+this.player.progressTime:Date.now(),this.isFrozen=!1,this._toFreeze=0,this.freeze=()=>{this.isFrozen=!0,this.ready?(ji("[Slide] freeze",this.context.appId),this.slide.frozen()):this._toFreeze=1},this.unfreeze=async()=>{!this.visible||(this.isFrozen=!1,this.ready?(ji("[Slide] unfreeze",this.context.appId),this.slide.release()):this._toFreeze=-1)},this.onVisibilityChange=async()=>{(this.visible=document.visibilityState==="visible")?(ji("[Slide] unfreeze because tab becomes visible",{savedIsFrozen:this.savedIsFrozen}),this.savedIsFrozen||this.unfreeze()):(this.savedIsFrozen=this.isFrozen,ji("[Slide] freeze because tab becomes invisible"),this.freeze())},this.onPageChanged=O,this.onTransitionStart=M,this.onTransitionEnd=I,this.onError=D,this.onRenderError=k,this.showRenderError=z!=null?z:!0,this.context=w,this.room=w.getRoom(),this.player=this.room?void 0:w.getDisplayer(),fS(this.room||this.player),this.slide=this.createSlide(v),this.syncStateOnceFlag=!this.context.isAddApp,this.visible=document.visibilityState==="visible",this.savedIsFrozen=!1,this.initialize()}jumpToPage(w){this.ready&&(w=pv(w,1,this.pageCount),this.slide.renderSlide(w))}initialize(){this.registerEventListeners(),this.kickStart()}kickStart(){const{context:w,slide:v}=this;w.getIsWritable()&&w.storage.ensureState(Rc);const{taskId:O,url:M,state:I}=w.storage.state;v.setResource(O,M||Dc),I?(ji("[Slide] init with state",JSON.stringify(I)),this.syncStateOnceFlag=!1,v.setSlideState(I)):w.isAddApp&&(ji("[Slide] init by renderSlide",1),v.renderSlide(1)),this.pollReadyState()}registerEventListeners(){const{context:w,slide:v}=this,O=this.sideEffect.addDisposer(w.storage.addStateChangedListener(()=>{w.storage.state.state&&(this.syncStateOnce(),this.sideEffect.flush(O))}));this.sideEffect.add(()=>w.addMagixEventListener(li.SLIDE_EVENTS.syncDispatch,this.magixEventListener,{fireSelfEventAfterCommit:!0})),v.on(li.SLIDE_EVENTS.slideChange,this.onPageChanged),v.on(li.SLIDE_EVENTS.renderStart,this.onTransitionStart),v.on(li.SLIDE_EVENTS.renderEnd,this.onTransitionEnd),v.on(li.SLIDE_EVENTS.mainSeqStepStart,this.onTransitionStart),v.on(li.SLIDE_EVENTS.mainSeqStepEnd,this.onTransitionEnd),v.on(li.SLIDE_EVENTS.renderError,this.onError),v.on(li.SLIDE_EVENTS.stateChange,this.onStateChange),v.on(li.SLIDE_EVENTS.syncDispatch,this.onSyncDispatch),v.on(li.SLIDE_EVENTS.renderEnd,this.resolveReady),this.sideEffect.add(()=>(document.addEventListener("visibilitychange",this.onVisibilityChange),()=>document.removeEventListener("visibilitychange",this.onVisibilityChange)))}syncStateOnce(){if(this.syncStateOnceFlag){this.context.getIsWritable()&&this.context.storage.ensureState(Rc);const{state:w}=this.context.storage.state;w&&(ji("[Slide] sync with state (once)",JSON.stringify(w)),this.slide.setSlideState(w),this.syncStateOnceFlag=!1)}}get pageCount(){return this._pageCount>0?this._pageCount:(this._pageCount=this.slide.slideCount,this._pageCount)}get page(){return this.slide.slideState.currentSlideIndex}createSlide(w){var M,I,D;const v=this.context.getAppOptions()||{};return new li.Slide({anchor:w,interactive:!0,mode:"interactive",controller:Nr.enable,enableGlobalClick:(M=v.enableGlobalClick)!=null?M:!0,renderOptions:{minFPS:v.minFPS||25,maxFPS:v.maxFPS||30,autoFPS:(I=v.autoFPS)!=null?I:!0,autoResolution:(D=v.autoResolution)!=null?D:!0,resolution:v.resolution,transactionBgColor:v.bgColor||yv(w),maxResolutionLevel:v.maxResolutionLevel,forceCanvas:v.forceCanvas,enableNvidiaDetect:v.enableNvidiaDetect},fixedFrameSize:v.fixedFrameSize,loaderDelegate:v.loaderDelegate,navigatorDelegate:v.navigatorDelegate,urlInterrupter:v.urlInterrupter,resourceTimeout:v.resourceTimeout,rtcAudio:v.rtcAudio,useLocalCache:v.useLocalCache,logger:v.logger,timestamp:this.timestamp})}destroy(){this.sideEffect.flushAll(),this.destroyed||(ji("[Slide] destroy slide (once)"),this.slide.destroy(),this.destroyed=!0)}}function _S(b){const w="http://www.w3.org/2000/svg",v=document.createElementNS(w,"svg");v.setAttribute("class",`${b}-footer-icon-sidebar`),v.setAttribute("viewBox","0 0 64 64");const O=document.createElementNS(w,"path");return O.setAttribute("fill","currentColor"),O.setAttribute("d","M50 8H14c-3.309 0-6 2.691-6 6v36c0 3.309 2.691 6 6 6h36c3.309 0 6-2.691 6-6V14c0-3.309-2.691-6-6-6zM12 50V14c0-1.103.897-2 2-2h8v40h-8c-1.103 0-2-.897-2-2zm40 0c0 1.103-.897 2-2 2H26V12h24c1.103 0 2 .897 2 2z"),v.appendChild(O),v}function yS(b){const w="http://www.w3.org/2000/svg",v=document.createElementNS(w,"svg");v.setAttribute("class",`${b}-footer-icon-arrow-left`),v.setAttribute("viewBox","0 0 500 500");const O=document.createElementNS(w,"path");return O.setAttribute("fill","currentColor"),O.setAttribute("d","M177.81 249.959L337.473 90.295c2.722-2.865 2.651-7.378-.143-10.1-2.793-2.65-7.163-2.65-9.956 0l-164.75 164.75c-2.793 2.793-2.793 7.306 0 10.1l164.75 164.75c2.865 2.722 7.378 2.65 10.099-.143 2.651-2.794 2.651-7.163 0-9.957L177.809 249.959z"),v.appendChild(O),v}function xS(b){const w="http://www.w3.org/2000/svg",v=document.createElementNS(w,"svg");v.setAttribute("class",`${b}-footer-icon-arrow-right`),v.setAttribute("viewBox","0 0 500 500");const O=document.createElementNS(w,"path");return O.setAttribute("fill","currentColor"),O.setAttribute("d","M322.19 250.041L162.527 409.705c-2.722 2.865-2.651 7.378.143 10.1 2.793 2.65 7.163 2.65 9.956 0l164.75-164.75c2.793-2.793 2.793-7.306 0-10.1l-164.75-164.75c-2.865-2.722-7.378-2.65-10.099.143-2.651 2.794-2.651 7.163 0 9.957l159.664 159.736z"),v.appendChild(O),v}function bS(b){const w="http://www.w3.org/2000/svg",v=document.createElementNS(w,"svg");v.setAttribute("class",`${b}-footer-icon-play`),v.setAttribute("viewBox","0 0 500 500");const O=document.createElementNS(w,"path");return O.setAttribute("fill","currentColor"),O.setAttribute("d","M418.158 257.419L174.663 413.33c-6.017 3.919-15.708 3.772-21.291-.29-2.791-2.018-4.295-4.483-4.295-7.084V94.109c0-5.65 6.883-10.289 15.271-10.289 4.298 0 8.391 1.307 11.181 3.332l242.629 155.484c6.016 3.917 6.451 10.292.649 14.491-.216.154-.432.154-.649.292zM170.621 391.288l223.116-141.301L170.71 107.753l-.089 283.535z"),v.appendChild(O),v}function TS(b){const w="http://www.w3.org/2000/svg",v=document.createElementNS(w,"svg");v.setAttribute("class",`${b}-footer-icon-pause`),v.setAttribute("viewBox","0 0 500 500");const O=document.createElementNS(w,"path");return O.setAttribute("fill","currentColor"),O.setAttribute("d","M312.491 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261zM165.257 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261z"),v.appendChild(O),v}const Wo=typeof window!="undefined",bv=Wo&&!("onscroll"in window)||typeof navigator!="undefined"&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),Tv=Wo&&"IntersectionObserver"in window,Ev=Wo&&"classList"in document.createElement("p"),Sv=Wo&&window.devicePixelRatio>1,ES={elements_selector:".lazy",container:bv||Wo?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_bg_set:"bg-set",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},wv=b=>Object.assign({},ES,b),av=function(b,w){let v;const O="LazyLoad::Initialized",M=new b(w);try{v=new CustomEvent(O,{detail:{instance:M}})}catch{v=document.createEvent("CustomEvent"),v.initCustomEvent(O,!1,!1,{instance:M})}window.dispatchEvent(v)},SS=(b,w)=>{if(!!w)if(!w.length)av(b,w);else for(let v=0,O;O=w[v];v+=1)av(b,O)},fo="src",Fc="srcset",Bc="sizes",Av="poster",Qa="llOriginalAttrs",Mv="data",Uc="loading",Cv="loaded",Rv="applied",wS="entered",kc="error",Iv="native",Pv="data-",Ov="ll-status",fr=(b,w)=>b.getAttribute(Pv+w),AS=(b,w,v)=>{var O=Pv+w;if(v===null){b.removeAttribute(O);return}b.setAttribute(O,v)},$a=b=>fr(b,Ov),gs=(b,w)=>AS(b,Ov,w),Eh=b=>gs(b,null),Gc=b=>$a(b)===null,MS=b=>$a(b)===Uc,CS=b=>$a(b)===kc,Hc=b=>$a(b)===Iv,RS=[Uc,Cv,Rv,kc],IS=b=>RS.indexOf($a(b))>=0,Xo=(b,w,v,O)=>{if(!!b){if(O!==void 0){b(w,v,O);return}if(v!==void 0){b(w,v);return}b(w)}},ta=(b,w)=>{if(Ev){b.classList.add(w);return}b.className+=(b.className?" ":"")+w},no=(b,w)=>{if(Ev){b.classList.remove(w);return}b.className=b.className.replace(new RegExp("(^|\\s+)"+w+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},PS=b=>{b.llTempImage=document.createElement("IMG")},OS=b=>{delete b.llTempImage},Nv=b=>b.llTempImage,Sh=(b,w)=>{if(!w)return;const v=w._observer;!v||v.unobserve(b)},NS=b=>{b.disconnect()},LS=(b,w,v)=>{w.unobserve_entered&&Sh(b,v)},jc=(b,w)=>{!b||(b.loadingCount+=w)},DS=b=>{!b||(b.toLoadCount-=1)},Lv=(b,w)=>{!b||(b.toLoadCount=w)},FS=b=>b.loadingCount>0,BS=b=>b.toLoadCount>0,Dv=b=>{let w=[];for(let v=0,O;O=b.children[v];v+=1)O.tagName==="SOURCE"&&w.push(O);return w},zc=(b,w)=>{const v=b.parentNode;if(!v||v.tagName!=="PICTURE")return;Dv(v).forEach(w)},Fv=(b,w)=>{Dv(b).forEach(w)},wh=[fo],Bv=[fo,Av],Ja=[fo,Fc,Bc],Uv=[Mv],Ah=b=>!!b[Qa],kv=b=>b[Qa],Gv=b=>delete b[Qa],$s=(b,w)=>{if(Ah(b))return;const v={};w.forEach(O=>{v[O]=b.getAttribute(O)}),b[Qa]=v},US=b=>{Ah(b)||(b[Qa]={backgroundImage:b.style.backgroundImage})},kS=(b,w,v)=>{if(!v){b.removeAttribute(w);return}b.setAttribute(w,v)},ms=(b,w)=>{if(!Ah(b))return;const v=kv(b);w.forEach(O=>{kS(b,O,v[O])})},GS=b=>{if(!Ah(b))return;const w=kv(b);b.style.backgroundImage=w.backgroundImage},Hv=(b,w,v)=>{ta(b,w.class_applied),gs(b,Rv),v&&(w.unobserve_completed&&Sh(b,w),Xo(w.callback_applied,b,v))},jv=(b,w,v)=>{ta(b,w.class_loading),gs(b,Uc),v&&(jc(v,1),Xo(w.callback_loading,b,v))},Vo=(b,w,v)=>{!v||b.setAttribute(w,v)},lv=(b,w)=>{Vo(b,Bc,fr(b,w.data_sizes)),Vo(b,Fc,fr(b,w.data_srcset)),Vo(b,fo,fr(b,w.data_src))},HS=(b,w)=>{zc(b,v=>{$s(v,Ja),lv(v,w)}),$s(b,Ja),lv(b,w)},jS=(b,w)=>{$s(b,wh),Vo(b,fo,fr(b,w.data_src))},zS=(b,w)=>{Fv(b,v=>{$s(v,wh),Vo(v,fo,fr(v,w.data_src))}),$s(b,Bv),Vo(b,Av,fr(b,w.data_poster)),Vo(b,fo,fr(b,w.data_src)),b.load()},VS=(b,w)=>{$s(b,Uv),Vo(b,Mv,fr(b,w.data_src))},WS=(b,w,v)=>{const O=fr(b,w.data_bg),M=fr(b,w.data_bg_hidpi),I=Sv&&M?M:O;!I||(b.style.backgroundImage=`url("${I}")`,Nv(b).setAttribute(fo,I),jv(b,w,v))},XS=(b,w,v)=>{const O=fr(b,w.data_bg_multi),M=fr(b,w.data_bg_multi_hidpi),I=Sv&&M?M:O;!I||(b.style.backgroundImage=I,Hv(b,w,v))},YS=(b,w,v)=>{const O=fr(b,w.data_bg_set);if(!O)return;const M=O.split("|");let I=M.map(D=>`image-set(${D})`);b.style.backgroundImage=I.join(),b.style.backgroundImage===""&&(I=M.map(D=>`-webkit-image-set(${D})`),b.style.backgroundImage=I.join()),Hv(b,w,v)},zv={IMG:HS,IFRAME:jS,VIDEO:zS,OBJECT:VS},qS=(b,w)=>{const v=zv[b.tagName];!v||v(b,w)},JS=(b,w,v)=>{const O=zv[b.tagName];!O||(O(b,w),jv(b,w,v))},KS=["IMG","IFRAME","VIDEO","OBJECT"],ZS=b=>KS.indexOf(b.tagName)>-1,Vv=(b,w)=>{w&&!FS(w)&&!BS(w)&&Xo(b.callback_finish,w)},hv=(b,w,v)=>{b.addEventListener(w,v),b.llEvLisnrs[w]=v},QS=(b,w,v)=>{b.removeEventListener(w,v)},Vc=b=>!!b.llEvLisnrs,$S=(b,w,v)=>{Vc(b)||(b.llEvLisnrs={});const O=b.tagName==="VIDEO"?"loadeddata":"load";hv(b,O,w),hv(b,"error",v)},Ic=b=>{if(!Vc(b))return;const w=b.llEvLisnrs;for(let v in w){const O=w[v];QS(b,v,O)}delete b.llEvLisnrs},Wv=(b,w,v)=>{OS(b),jc(v,-1),DS(v),no(b,w.class_loading),w.unobserve_completed&&Sh(b,v)},tw=(b,w,v,O)=>{const M=Hc(w);Wv(w,v,O),ta(w,v.class_loaded),gs(w,Cv),Xo(v.callback_loaded,w,O),M||Vv(v,O)},ew=(b,w,v,O)=>{const M=Hc(w);Wv(w,v,O),ta(w,v.class_error),gs(w,kc),Xo(v.callback_error,w,O),v.restore_on_error&&ms(w,Ja),M||Vv(v,O)},Wc=(b,w,v)=>{const O=Nv(b)||b;if(Vc(O))return;$S(O,D=>{tw(D,b,w,v),Ic(O)},D=>{ew(D,b,w,v),Ic(O)})},nw=(b,w,v)=>{PS(b),Wc(b,w,v),US(b),WS(b,w,v),XS(b,w,v),YS(b,w,v)},iw=(b,w,v)=>{Wc(b,w,v),JS(b,w,v)},Xc=(b,w,v)=>{ZS(b)?iw(b,w,v):nw(b,w,v)},rw=(b,w,v)=>{b.setAttribute("loading","lazy"),Wc(b,w,v),qS(b,w),gs(b,Iv)},uv=b=>{b.removeAttribute(fo),b.removeAttribute(Fc),b.removeAttribute(Bc)},ow=b=>{zc(b,w=>{uv(w)}),uv(b)},Xv=b=>{zc(b,w=>{ms(w,Ja)}),ms(b,Ja)},sw=b=>{Fv(b,w=>{ms(w,wh)}),ms(b,Bv),b.load()},aw=b=>{ms(b,wh)},lw=b=>{ms(b,Uv)},hw={IMG:Xv,IFRAME:aw,VIDEO:sw,OBJECT:lw},uw=b=>{const w=hw[b.tagName];if(!w){GS(b);return}w(b)},cw=(b,w)=>{Gc(b)||Hc(b)||(no(b,w.class_entered),no(b,w.class_exited),no(b,w.class_applied),no(b,w.class_loading),no(b,w.class_loaded),no(b,w.class_error))},dw=(b,w)=>{uw(b),cw(b,w),Eh(b),Gv(b)},pw=(b,w,v,O)=>{!v.cancel_on_exit||!MS(b)||b.tagName==="IMG"&&(Ic(b),ow(b),Xv(b),no(b,v.class_loading),jc(O,-1),Eh(b),Xo(v.callback_cancel,b,w,O))},fw=(b,w,v,O)=>{const M=IS(b);gs(b,wS),ta(b,v.class_entered),no(b,v.class_exited),LS(b,v,O),Xo(v.callback_enter,b,w,O),!M&&Xc(b,v,O)},mw=(b,w,v,O)=>{Gc(b)||(ta(b,v.class_exited),pw(b,w,v,O),Xo(v.callback_exit,b,w,O))},gw=["IMG","IFRAME","VIDEO"],Yv=b=>b.use_native&&"loading"in HTMLImageElement.prototype,vw=(b,w,v)=>{b.forEach(O=>{gw.indexOf(O.tagName)!==-1&&rw(O,w,v)}),Lv(v,0)},_w=b=>b.isIntersecting||b.intersectionRatio>0,yw=b=>({root:b.container===document?null:b.container,rootMargin:b.thresholds||b.threshold+"px"}),xw=(b,w,v)=>{b.forEach(O=>_w(O)?fw(O.target,O,w,v):mw(O.target,O,w,v))},bw=(b,w)=>{w.forEach(v=>{b.observe(v)})},Tw=(b,w)=>{NS(b),bw(b,w)},Ew=(b,w)=>{!Tv||Yv(b)||(w._observer=new IntersectionObserver(v=>{xw(v,b,w)},yw(b)))},qv=b=>Array.prototype.slice.call(b),bh=b=>b.container.querySelectorAll(b.elements_selector),Sw=b=>qv(b).filter(Gc),ww=b=>CS(b),Aw=b=>qv(b).filter(ww),cv=(b,w)=>Sw(b||bh(w)),Mw=(b,w)=>{Aw(bh(b)).forEach(O=>{no(O,b.class_error),Eh(O)}),w.update()},Cw=(b,w)=>{!Wo||(w._onlineHandler=()=>{Mw(b,w)},window.addEventListener("online",w._onlineHandler))},Rw=b=>{!Wo||window.removeEventListener("online",b._onlineHandler)},tl=function(b,w){const v=wv(b);this._settings=v,this.loadingCount=0,Ew(v,this),Cw(v,this),this.update(w)};tl.prototype={update:function(b){const w=this._settings,v=cv(b,w);if(Lv(this,v.length),bv||!Tv){this.loadAll(v);return}if(Yv(w)){vw(v,w,this);return}Tw(this._observer,v)},destroy:function(){this._observer&&this._observer.disconnect(),Rw(this),bh(this._settings).forEach(b=>{Gv(b)}),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(b){const w=this._settings;cv(b,w).forEach(O=>{Sh(O,this),Xc(O,w,this)})},restoreAll:function(){const b=this._settings;bh(b).forEach(w=>{dw(w,b)})}};tl.load=(b,w)=>{const v=wv(w);Xc(b,v)};tl.resetStatus=b=>{Eh(b)};Wo&&SS(tl,window.lazyLoadOptions);class Jv{constructor({readonly:w,onNewPageIndex:v,onPlay:O,urlInterrupter:M}){this._pages=[],this.pageIndex=0,this.setPaused=()=>{this.$btnPlay.classList.toggle(this.wrapClassName("footer-btn-playing"),!1)},this.setPlaying=()=>{this.$btnPlay.classList.toggle(this.wrapClassName("footer-btn-playing"),!0)},this.namespace="netless-app-slide",this.isShowPreview=!1,this.isSmallBox=!1,this.sideEffect=new Ka,this.readonly=w,this.onNewPageIndex=v,this.onPlay=O,this.urlInterrupter=M||(I=>I),this.render()}set pages(w){this._pages=w,this.refreshPreview().then(this.refreshBtnSidebar.bind(this)),this.refreshTotalPage()}get pages(){return this._pages}unmount(){this.$content.remove(),this.$footer.remove()}setReadonly(w){this.readonly=w,this.$content.classList.toggle(this.wrapClassName("readonly"),w),this.$footer.classList.toggle(this.wrapClassName("readonly"),w),this.$pageNumberInput.disabled=w}destroy(){var w;(w=this.previewLazyLoad)==null||w.destroy(),this.sideEffect.flushAll(),this.unmount()}setPageIndex(w){Number.isNaN(w)||(this.pageIndex=w,this.$pageNumberInput.value=String(w+1))}refreshTotalPage(){this.pages.length?this.$totalPage.textContent=" / "+this.pages.length:this.$totalPage.textContent=""}setSmallBox(w){this.isSmallBox!==w&&(this.isSmallBox=w,this.$footer.classList.toggle(this.wrapClassName("float-footer"),w))}render(){return this.renderContent(),this.renderFooter(),this.$content}renderContent(){if(!this.$content){const w=document.createElement("div");w.className=this.wrapClassName("content"),this.$content=w,this.readonly&&w.classList.add(this.wrapClassName("readonly")),w.appendChild(this.renderPreviewMask()),w.appendChild(this.renderPreview())}return this.$content}renderPreview(){if(!this.$preview){const w=document.createElement("div");w.className=this.wrapClassName("preview")+" tele-fancy-scrollbar",this.$preview=w,this.refreshPreview(),this.sideEffect.addEventListener(w,"click",v=>{var M;if(this.readonly)return;const O=(M=v.target.dataset)==null?void 0:M.pageIndex;O&&(v.preventDefault(),v.stopPropagation(),v.stopImmediatePropagation(),this.onNewPageIndex(Number(O)),this.togglePreview(!1))})}return this.$preview}async refreshPreview(){var I,D;const{$preview:w}=this,v=this.wrapClassName("preview-page"),O=this.wrapClassName("preview-page-name");for(;w.firstChild;)w.firstChild.remove();const M=[];for(let k=0,z=this.pages.length;k<z;k++){const W=this.pages[k],Y=(I=W.thumbnail)!=null?I:W.src.startsWith("ppt")?void 0:W.src;Y&&(M[k]=this.urlInterrupter(Y))}for(let k=0,z=this.pages.length;k<z;k++)M[k]=await M[k];this.pages.forEach((k,z)=>{const W=M[z];if(!W)return;const Y=String(z),et=document.createElement("a");et.className=v+" "+this.wrapClassName(`preview-page-${z}`),et.setAttribute("href","#"),et.dataset.pageIndex=Y;const ft=document.createElement("span");ft.className=O,ft.textContent=String(z+1),ft.dataset.pageIndex=Y;const Dt=document.createElement("img");Dt.width=k.width,Dt.height=k.height,Dt.dataset.src=W,Dt.dataset.pageIndex=Y,et.appendChild(Dt),et.appendChild(ft),w.appendChild(et)}),(D=this.previewLazyLoad)==null||D.update()}renderPreviewMask(){return this.$previewMask||(this.$previewMask=document.createElement("div"),this.$previewMask.className=this.wrapClassName("preview-mask"),this.sideEffect.addEventListener(this.$previewMask,"click",w=>{this.readonly||w.target===this.$previewMask&&this.togglePreview(!1)})),this.$previewMask}refreshBtnSidebar(){this.$btnSidebar.style.display=this.pages.length>0?"":"none"}renderFooter(){if(!this.$footer){const w=document.createElement("div");w.className=this.wrapClassName("footer"),this.$footer=w,this.readonly&&w.classList.add(this.wrapClassName("readonly")),this.isSmallBox&&w.classList.add(this.wrapClassName("float-footer"));const v=this.renderFooterBtn("btn-sidebar",_S(this.namespace));this.sideEffect.addEventListener(v,"click",()=>{this.readonly||this.togglePreview()}),this.$btnSidebar=v,this.$btnSidebar.style.display="none",this.$footer.appendChild(v);const O=document.createElement("div");O.className=this.wrapClassName("page-jumps");const M=this.renderFooterBtn("btn-page-back",yS(this.namespace));if(this.sideEffect.addEventListener(M,"click",()=>{this.readonly||this.onNewPageIndex(this.pageIndex-1)}),O.appendChild(M),this.onPlay){const W=this.renderFooterBtn("btn-page-play",bS(this.namespace),TS(this.namespace));this.$btnPlay=W,this.sideEffect.addEventListener(W,"click",()=>{this.readonly||(this.setPlaying(),this.onPlay&&this.onPlay())}),O.appendChild(W)}const I=this.renderFooterBtn("btn-page-next",xS(this.namespace));this.sideEffect.addEventListener(I,"click",()=>{this.readonly||this.onNewPageIndex(this.pageIndex+1)}),O.appendChild(I);const D=document.createElement("div");D.className=this.wrapClassName("page-number");const k=document.createElement("input");k.className=this.wrapClassName("page-number-input"),k.value=String(this.pageIndex+1),this.readonly&&(k.disabled=!0),this.$pageNumberInput=k,this.sideEffect.addEventListener(k,"focus",()=>{k.select()}),this.sideEffect.addEventListener(k,"change",()=>{this.readonly||k.value&&this.onNewPageIndex(Number(k.value)-1)});const z=document.createElement("span");this.$totalPage=z,D.appendChild(k),D.appendChild(z),this.$footer.appendChild(O),this.$footer.appendChild(D)}return this.$footer}renderFooterBtn(w,v,O){const M=document.createElement("button");return M.className=this.wrapClassName("footer-btn")+" "+this.wrapClassName(w),M.appendChild(v),O&&M.appendChild(O),M}togglePreview(w){if(this.isShowPreview=w!=null?w:!this.isShowPreview,this.$content.classList.toggle(this.wrapClassName("preview-active"),this.isShowPreview),this.isShowPreview){const v=this.$preview.querySelector("."+this.wrapClassName(`preview-page-${this.pageIndex}`));v&&(this.previewLazyLoad||(this.previewLazyLoad=new tl({container:this.$preview,elements_selector:`.${this.wrapClassName("preview-page>img")}`})),this.$preview.scrollTo({top:v.offsetTop-16}))}}wrapClassName(w){return`${this.namespace}-${w}`}}const Iw=new Set(["clicker"]);class Pw{constructor({box:w,view:v,mountSlideController:O,mountWhiteboard:M,baseScenePath:I,appId:D,urlInterrupter:k}){this.slideController=null,this.isViewMounted=!1,this.onError=({error:z,index:W})=>{var Y,et;this.viewer.setPaused(),(Y=this.slideController)!=null&&Y.showRenderError&&(this.$overlay.textContent=`Error on slide[page=${this.slideController.page}]: ${z.message}`,this.$overlay.style.opacity="1"),(et=this.slideController)!=null&&et.onRenderError&&this.slideController.onRenderError(z,W),Nr.warn("[Slide] render error",z)},this.onRenderEnd=()=>{this.$overlay.style.opacity=""},this.refreshPages=()=>{this.slideController&&(this.viewer.pages=xv(this.slideController.slide),this.viewer.setPageIndex(this.getPageIndex(this.slideController.page)),this.scaleDocsToFit())},this.scaleDocsToFit=()=>{if(this.slideController){const{width:z,height:W}=this.slideController.slide;z&&W&&(this.whiteboardView.moveCameraToContain({originX:-z/2,originY:-W/2,width:z,height:W,animationMode:"immediately"}),this.whiteboardView.setCameraBound({damping:1,maxContentMode:()=>this.whiteboardView.camera.scale,minContentMode:()=>this.whiteboardView.camera.scale,centerX:0,centerY:0,width:z,height:W}),this.isViewMounted||(this.isViewMounted=!0,console.log("[Slide] mount whiteboard view"),this.mountWhiteboard(this.$whiteboardView)))}},this.onPlay=()=>{this.slideController&&this.slideController.slide.nextStep()},this.onNewPageIndex=z=>{this.slideController&&this.slideController.jumpToPage(z+1)},this.sideEffect=new Ka,this.namespace="netless-app-slide",this.toPdf=async()=>{if(!this.slideController){this.reportProgress(100,null);return}const{slide:z}=this.slideController,W=1920,Y=document.createElement("canvas"),et=Y.getContext("2d"),{slideCount:ft,width:Dt,height:At}=z;let L=Math.floor(Dt),R=Math.floor(At);L>W&&(L=W,R=Math.floor(At*L/Dt)),R>W&&(R=W,L=Math.floor(Dt*R/At)),Y.width=L,Y.height=R;const B=document.createElement("canvas");B.width=L,B.height=R;const X=B.getContext("2d");if(!X||!this.getWhiteSnapshot||!et)return this.reportProgress(100,null),null;const P=L>R?"l":"p",{jsPDF:H}=await Promise.resolve().then(function(){return $E(require("jspdf"))}),tt=new H({format:[L,R],orientation:P,compress:!0});for(let zt=1;zt<=ft;zt++){let st=null;try{st=await this.slideController.slide.snapshotWithTimingEnd(zt)}catch{}if(st){const dt=document.createElement("img");dt.src=st,await new Promise($=>dt.onload=$),et.drawImage(dt,0,0,L,R)}X.clearRect(0,0,L,R),this.getWhiteSnapshot(zt,B,X,Dt,At);try{const dt=B.toDataURL("image/png"),$=document.createElement("img");$.src=dt,await new Promise(vt=>$.onload=vt),et.drawImage($,0,0,L,R)}catch{}const V=Y.toDataURL("image/jpeg",.6);zt>1&&tt.addPage(),tt.addImage(V,"JPEG",0,0,L,R,"","FAST"),et.clearRect(0,0,L,R),Math.ceil(zt/ft*100)<100&&this.reportProgress(Math.ceil(zt/ft*100),null)}const G=tt.output("arraybuffer"),Ot=this.box.title;this.reportProgress(100,{pdf:G,title:Ot})},this.box=w,this.whiteboardView=v,this.mountSlideController=O,this.mountWhiteboard=M,this.baseScenePath=I,this.appId=D,this.viewer=new Jv({readonly:w.readonly,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay,urlInterrupter:k}),this.sideEffect.add(()=>{const z=W=>{this.setReadonly(W)};return w.events.on("readonly",z),()=>w.events.off("readonly",z)}),this.sideEffect.add(()=>{const z=W=>{W.data.type==="@netless/_request_save_pdf_"&&W.data.appId===this.appId&&this.toPdf().catch(()=>this.reportProgress(100,null))};return window.addEventListener("message",z),()=>{window.removeEventListener("message",z)}}),this.render()}render(){this.viewer.$content.appendChild(this.renderSlideContainer()),this.viewer.$content.appendChild(this.renderWhiteboardView()),this.viewer.$content.appendChild(this.renderOverlay()),this.sideEffect.addEventListener(window,"keydown",w=>{if(this.box.focus&&this.slideController&&!sS(w.target))switch(w.key){case"ArrowUp":case"ArrowLeft":{this.slideController.slide.prevStep();break}case"ArrowRight":case"ArrowDown":{this.slideController.slide.nextStep();break}}})}renderOverlay(){if(!this.$overlay){const w=document.createElement("div");w.className=this.wrapClassName("overlay"),this.$overlay=w}return this.$overlay}renderSlideContainer(){if(!this.$slide){const w=document.createElement("div");w.className=this.wrapClassName("slide"),w.dataset.appKind="Slide",this.$slide=w}return this.$slide}renderWhiteboardView(){return this.$whiteboardView||(this.$whiteboardView=document.createElement("div"),this.$whiteboardView.className=this.wrapClassName("wb-view")),this.$whiteboardView}mount(){return this.box.mountContent(this.viewer.$content),this.box.mountFooter(this.viewer.$footer),this.slideController=this.mountSlideController({anchor:this.$slide,onRenderEnd:this.onRenderEnd,onTransitionStart:this.viewer.setPlaying,onTransitionEnd:this.viewer.setPaused,onReady:this.refreshPages,onError:this.onError}),this.scaleDocsToFit(),this.sideEffect.add(()=>(this.whiteboardView.callbacks.on("onSizeUpdated",this.scaleDocsToFit),()=>this.whiteboardView.callbacks.off("onSizeUpdated",this.scaleDocsToFit))),this}getPageIndex(w){return(w>0?w:1)-1}unmount(){return this.slideController&&(this.slideController.destroy(),this.slideController=null),this.viewer.unmount(),this}setReadonly(w){this.viewer.setReadonly(w)}destroy(){this.sideEffect.flushAll(),this.unmount(),this.viewer.destroy()}toggleClickThrough(w){this.$whiteboardView.style.pointerEvents=!w||Iw.has(w)?"none":"auto"}wrapClassName(w){return`${this.namespace}-${w}`}getWhiteSnapshot(w,v,O,M,I){this.whiteboardView.screenshotToCanvas(O,`${this.baseScenePath}/${w}`,v.width,v.height,{centerX:0,centerY:0,scale:Math.min(v.width/M,v.height/I)})}reportProgress(w,v){window.postMessage({type:"@netless/_result_save_pdf_",appId:this.appId,progress:w,result:v})}}let Pc=!1;exports.FreezerLength=2;function Ow(){return exports.FreezerLength}function Nw(b){exports.FreezerLength=b<1?1/0:b}const Ya=b=>"["+b+"]",Th={map:new Map,boxes:new Map,queue:[],validateQueue(){for(this.queue.sort((b,w)=>{var M,I,D,k;const v=(I=(M=this.boxes.get(b))==null?void 0:M.zIndex)!=null?I:0,O=(k=(D=this.boxes.get(w))==null?void 0:D.zIndex)!=null?k:0;return-(v-O)}),ji("[Slide] freezer: validate",Ya(this.queue));this.queue.length>exports.FreezerLength;){const b=this.queue.pop(),w=this.map.get(b);w&&(ji("[Slide] freezer: validate-freeze",b,Ya(this.queue)),w.freeze())}},set(b,w,v){ji("[Slide] freezer: add",b,Ya(this.queue)),this.map.set(b,w),this.boxes.set(b,v),this.queue.includes(b)||this.queue.unshift(b),this.validateQueue()},delete(b){this.map.delete(b),this.boxes.delete(b),this.queue=this.queue.filter(w=>w!==b),ji("[Slide] freezer: delete",b,Ya(this.queue))},focus(b){const w=this.map.get(b),v=this.queue.indexOf(b);v>-1&&this.queue.splice(v,1),this.queue.unshift(b),this.validateQueue(),ji("[Slide] freezer: focus",b,Ya(this.queue)),w&&w.unfreeze()}},Oc=new Set;function Lw(b){return Oc.add(b),()=>Oc.delete(b)}const Nc=new Set;function Dw(b){return Nc.add(b),()=>Nc.delete(b)}const Fw=b=>{Pc=!0,b.on("focus",({appId:w})=>{Th.focus(w)}),b.on("created",({appId:w})=>{Oc.forEach(v=>v(w))}),b.on("destroy",({appId:w})=>{Nc.forEach(v=>v(w))})};var Kv=(()=>`.netless-app-slide-content{position:relative;height:100%;overflow:hidden}.netless-app-slide-preview-mask{display:none;position:absolute;z-index:200;top:0;left:0;width:100%;height:100%}.netless-app-slide-preview{display:flex;flex-direction:column;align-items:center;position:absolute;z-index:300;top:0;left:0;width:33%;max-width:200px;height:100%;padding-top:10px;transform:translate(-100%);background:rgba(237,237,240,.9);box-shadow:inset -1px 0 #0000001c;transition:transform .4s}.netless-app-slide-preview-active .netless-app-slide-preview-mask{display:block}.netless-app-slide-preview-active .netless-app-slide-preview{transform:translate(0)}.netless-app-slide-preview-page{position:relative;display:block;width:55%;margin-bottom:10px;font-size:0;color:transparent;outline:none;border:7px solid transparent;border-radius:4px;transition:border-color .3s;user-select:none}.netless-app-slide-preview-page:hover,.netless-app-slide-preview-page.netless-app-slide-preview-page-active{border-color:#444e601a}.netless-app-slide-preview-page>img{width:100%;height:auto;box-sizing:border-box;border:1px solid rgba(0,0,0,.5);border-radius:1px;background-color:#fff;box-shadow:0 2px 8px #0000004d}.netless-app-slide-preview-page-name{position:absolute;top:1px;left:-10px;transform:translate(-100%);text-align:right;font-size:12px;color:#5f5f5f;user-select:none}.netless-app-slide-footer{box-sizing:border-box;height:26px;display:flex;align-items:center;padding:0 16px;border-top:1px solid #eeeef7;color:#191919}.netless-app-slide-float-footer{width:100%;min-height:26px;position:absolute;left:0;bottom:0;z-index:2000;background:rgba(249,249,252,.9);transition:opacity .4s}.netless-app-slide-footer-btn{box-sizing:border-box;width:26px;height:26px;font-size:0;margin:0;padding:3px;border:none;border-radius:1px;outline:none;color:currentColor;background:transparent;transition:background .4s;cursor:pointer;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-slide-footer-btn:hover{background:rgba(237,237,240,.9)}@media (hover: none){.netless-app-slide-footer-btn:hover{background:transparent!important}}.netless-app-slide-footer-btn>svg{width:100%;height:100%}.netless-app-slide-footer-btn>svg:nth-of-type(2){display:none}.netless-app-slide-footer-btn.netless-app-slide-footer-btn-playing>svg:nth-of-type(1){display:none}.netless-app-slide-footer-btn.netless-app-slide-footer-btn-playing>svg:nth-of-type(2){display:initial}.netless-app-slide-footer-btn~.netless-app-slide-footer-btn{margin-left:15px}.netless-app-slide-page-jumps{flex:1;display:flex;justify-content:center;align-items:center}.netless-app-slide-page-number{margin-left:auto;font-size:13px;user-select:none;white-space:nowrap;word-break:keep-all}.netless-app-slide-page-number-input{border:none;outline:none;width:3em;margin:0;padding:0 2px;text-align:right;font-size:13px;line-height:1;font-weight:400;font-family:inherit;border-radius:2px;color:currentColor;background:transparent;transition:background .4s;user-select:text;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-slide-page-number-input:hover,.netless-app-slide-page-number-input:focus,.netless-app-slide-page-number-input:active{background:#fff;box-shadow:#63636333 0 2px 8px}.netless-app-slide-readonly.netless-app-slide-footer{display:none}.telebox-color-scheme-dark .netless-app-slide-page-number-input{color:#a6a6a8}.telebox-color-scheme-dark .netless-app-slide-page-number-input:active,.telebox-color-scheme-dark .netless-app-slide-page-number-input:focus,.telebox-color-scheme-dark .netless-app-slide-page-number-input:hover{color:#222}.telebox-color-scheme-dark .netless-app-slide-footer{color:#a6a6a8;background:#2d2d33;border-top:none}.telebox-color-scheme-dark .netless-app-slide-footer-btn:hover{background:#212126}.telebox-color-scheme-dark .netless-app-slide-preview{background:rgba(50,50,50,.9)}.netless-app-slide-wb-view{position:absolute;top:0;left:0;width:100%;height:100%;z-index:100;overflow:hidden}.netless-app-slide-overlay{display:flex;align-items:center;justify-content:center;position:absolute;z-index:200;top:0;left:0;width:100%;height:100%;padding:8px;background:rgba(255,0,0,.25);transition:opacity .3s;opacity:0;pointer-events:none}.netless-app-slide-slide{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.netless-app-slide-slide canvas{transform:scale(var(--netless-app-slide-scale, 1))}
|
|
7955
|
-
`)();function Bw({container:b,taskId:w,url:v=Dc,debug:O=!1}){if(!w)throw new Error("[Slide] taskId is required");b.style.cssText+="display:flex;flex-direction:column";const M=new Zv({target:b});return M.debug=!!O,M.mount(w,v),M}class Zv{constructor(w){this.slide=null,this.debug=!1,this.sideEffect=new Ka,this.ready=!1,this.readyPromise=new Promise(v=>{this.resolveReady=()=>{this.ready=!0,v()}}),this.hotkeyListener=v=>{if(this.slide)switch(v.key){case"ArrowUp":case"ArrowLeft":{this.slide.prevStep();break}case"ArrowRight":case"ArrowDown":{this.slide.nextStep();break}}},this.onPageChanged=v=>{this.viewer.setPageIndex(v-1)},this.onTransitionStart=()=>{this.viewer.setPlaying()},this.onTransitionEnd=()=>{this.viewer.setPaused()},this.onError=({error:v})=>{this.viewer.setPaused(),console.warn("[Slide] render error",v)},this.destroyed=!1,this.refreshPages=()=>{this.slide&&(this.viewer.pages=xv(this.slide),this.viewer.setPageIndex(this.getPageIndex(this.slide.slideState.currentSlideIndex)))},this.onPlay=()=>{this.slide&&this.slide.nextStep()},this.onNewPageIndex=v=>{this.slide&&this.slide.slideCount>0&&this.slide.renderSlide(pv(v+1,1,this.slide.slideCount))},this.namespace="netless-app-slide",this.target=w.target,this.bgColor=yv(this.target),this.viewer=new Jv({readonly:!1,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay}),this.render()}render(){this.viewer.$content.appendChild(this.renderSlideContainer()),this.registerHotKeys(window)}registerHotKeys(w){this.sideEffect.addEventListener(w,"keydown",this.hotkeyListener,void 0,"hotkey")}mount(w,v){this.target.appendChild(this.renderStyle()),this.target.appendChild(this.viewer.$content),this.target.appendChild(this.viewer.$footer),this.slide=new li.Slide({anchor:this.$slide,interactive:!0,mode:"local",controller:this.debug,enableGlobalClick:!0,renderOptions:{minFPS:25,maxFPS:30,autoFPS:!0,autoResolution:!0,transactionBgColor:this.bgColor}}),this.registerEventListeners(),this.slide.setResource(w,v),this.slide.renderSlide(1)}renderStyle(){const w=document.createElement("style");return w.appendChild(document.createTextNode(Kv)),w}registerEventListeners(){if(!this.slide)return;const{slide:w}=this;w.on(li.SLIDE_EVENTS.slideChange,this.onPageChanged),w.on(li.SLIDE_EVENTS.renderStart,this.onTransitionStart),w.on(li.SLIDE_EVENTS.renderEnd,this.onTransitionEnd),w.on(li.SLIDE_EVENTS.mainSeqStepStart,this.onTransitionStart),w.on(li.SLIDE_EVENTS.mainSeqStepEnd,this.onTransitionEnd),w.on(li.SLIDE_EVENTS.renderError,this.onError),w.on(li.SLIDE_EVENTS.renderEnd,this.resolveReady),this.readyPromise.then(this.refreshPages)}destroy(){this.sideEffect.flushAll(),this.slide&&!this.destroyed&&(this.slide.destroy(),this.destroyed=!0),this.viewer.destroy()}getPageIndex(w){return(w>0?w:1)-1}renderSlideContainer(){if(!this.$slide){const w=document.createElement("div");w.className=this.wrapClassName("slide"),w.dataset.appKind="Slide",this.$slide=w}return this.$slide}wrapClassName(w){return`${this.namespace}-${w}`}}const Uw=li.Slide.usePlugin.bind(li.Slide),Lc="0.2.
|
|
7954
|
+
`)}}}),function(o){var s=oc.get(o.hookPoint)||[];s.push(o),oc.set(o.hookPoint,s)}(r)},t.volumeAdjuster=new cg,t.trackLogger=new GE,t.handleFrozenAllSlide=function(){t.instances.forEach(function(r){r.player&&(t._tempFrozenIds.push(r.randomId),r.frozen())})},t.handleReleaseAllSlide=function(){t._tempFrozenIds.forEach(function(r){var o=t.instances.find(function(s){return s.randomId===r});o&&o.release()}),t._tempFrozenIds=[]},t.handleLogReport=function(r){return qi(void 0,void 0,void 0,function(){var o,s,a,h,l,u;return Ji(e,function(p){switch(p.label){case 0:return[4,t.flushLog(!0)];case 1:if(p.sent(),!cr)return[3,12];o=[],p.label=2;case 2:return p.trys.push([2,4,,5]),[4,cr.keys()];case 3:return o=(p.sent()||[]).sort(function(y,x){return parseInt(y.replace("run_time_log_",""))-parseInt(x.replace("run_time_log_",""))}),[3,5];case 4:return p.sent(),[3,5];case 5:if(o.length===0)return window.postMessage({type:"@slide/_report_log_",log:"",index:1,total:1,customMessage:"@slide/_report_log_",sessionId:r},"*"),[2];s=0,a=o,p.label=6;case 6:if(!(s<a.length))return[3,12];h=a[s],l=h.replace("run_time_log_",""),u="",p.label=7;case 7:return p.trys.push([7,9,,10]),[4,cr.getItem(h)];case 8:return u=p.sent()||"",[3,10];case 9:return p.sent(),[3,10];case 10:window.postMessage({type:"@slide/_report_log_",log:u,index:parseInt(l,10),total:o.length,customMessage:"@slide/_report_log_",sessionId:r},"*"),p.label=11;case 11:return s++,[3,6];case 12:return[2]}})})},t.handleLogDownload=function(){return qi(void 0,void 0,void 0,function(){var r,o,s,a,h,l,u;return Ji(e,function(p){switch(p.label){case 0:return p.trys.push([0,7,,8]),[4,t.flushLog(!0)];case 1:return p.sent(),r="",cr?[4,cr.keys()]:[3,6];case 2:o=(p.sent()||[]).sort(function(y,x){return parseInt(y.replace("run_time_log_",""))-parseInt(x.replace("run_time_log_",""))}),s=0,a=o,p.label=3;case 3:return s<a.length?(h=a[s],l=r,[4,cr.getItem(h)]):[3,6];case 4:r=l+(p.sent()||""),p.label=5;case 5:return s++,[3,3];case 6:return(u=document.createElement("a")).setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(r)),u.setAttribute("download","slide_log"),u.style.display="none",document.body.appendChild(u),u.click(),document.body.removeChild(u),[3,8];case 7:return p.sent(),[3,8];case 8:return[2]}})})},WE([(n="Slide.initConfig",function(r,o,s){var a=s.value;s.value=function(){for(var h=[],l=0;l<arguments.length;l++)h[l]=arguments[l];for(var u=oc.get(n)||[],p=h,y=0,x=u;y<x.length;y++){var E=x[y];try{p=E.before(p)}catch{}if(!Array.isArray(p)||p.length!==h.length)throw new Error("plugin before hook return invalid args")}for(var A=a.bind(this).apply(void 0,p),C=0,j=u.reverse();C<j.length;C++){E=j[C];try{A=E.after(A)}catch{}if(!A)throw new Error("plugin after hook return undefined result")}return A}})],t.prototype,"initSlideConfig",null),t}(yi.a);cr==null||cr.clear().catch(function(){}),window.addEventListener("__slide_log__",to.handleLogDownload),window.addEventListener("message",function(i){if(i.data.type==="@slide/_request_log_")to.handleLogReport(i.data.sessionId).catch(function(){});else if(i.data.type==="@slide/_request_frozen_")to.handleFrozenAllSlide();else if(i.data.type==="@slide/_request_release_")to.handleReleaseAllSlide();else if(i.data.type==="@slide/_update_volume_"){var t=.5;try{t=parseFloat(i.data.volume.toString())}catch{}to.volumeAdjuster.volume=t}else i.data.type==="@slide/_get_volume_"?window.postMessage({type:"@slide/_report_volume_",volume:to.volumeAdjuster.volume,customMessage:"@slide/_report_volume_"},"*"):i.data.type==="@slide/_preload_slide_"&&to.preloadResource(i.data.taskId,i.data.prefix,function(e){window.postMessage({type:"@slide/_preload_slide_progress_",taskId:i.data.taskId,progress:e},"*")}).catch(function(e){window.postMessage({type:"@slide/_preload_slide_error_",taskId:i.data.taskId,error:e},"*")})}),window.setInterval(function(){to.flushLog().catch(function(){})},2e3)}]);const tS="!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",eS=87,nS=20,rv=[],iS=()=>{for(let b=0;b<nS;b++)rv[b]=tS.charAt(Math.random()*eS);return rv.join("")};function dv(b){try{return b()}catch(w){console.error(w)}}class Ka{constructor(){this.push=this.addDisposer,this.disposers=new Map}addDisposer(w,v=this.genUID()){return this.flush(v),this.disposers.set(v,Array.isArray(w)?rS(w):w),v}add(w,v=this.genUID()){const O=w();return O?this.addDisposer(O,v):v}addEventListener(w,v,O,M,I=this.genUID()){return w.addEventListener(v,O,M),this.addDisposer(()=>w.removeEventListener(v,O,M),I),I}setTimeout(w,v,O=this.genUID()){const M=window.setTimeout(()=>{this.remove(O),w()},v);return this.addDisposer(()=>window.clearTimeout(M),O)}setInterval(w,v,O=this.genUID()){const M=window.setInterval(w,v);return this.addDisposer(()=>window.clearInterval(M),O)}remove(w){const v=this.disposers.get(w);return this.disposers.delete(w),v}flush(w){const v=this.remove(w);v&&v()}flushAll(){this.disposers.forEach(dv),this.disposers.clear()}genUID(){let w;do w=iS();while(this.disposers.has(w));return w}}function rS(b){return()=>b.forEach(dv)}function pv(b,w,v){return Math.min(Math.max(b,w),v)}function oS(b){return typeof b=="object"&&b!==null}function sS(b){if(!b)return!1;const w=b.tagName;return w==="INPUT"||w==="TEXTAREA"||w==="SELECT"}var fv={exports:{}},aS={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]},mv={exports:{}},lS=function(w){return!w||typeof w=="string"?!1:w instanceof Array||Array.isArray(w)||w.length>=0&&(w.splice instanceof Function||Object.getOwnPropertyDescriptor(w,w.length-1)&&w.constructor.name!=="String")},hS=lS,uS=Array.prototype.concat,cS=Array.prototype.slice,ov=mv.exports=function(w){for(var v=[],O=0,M=w.length;O<M;O++){var I=w[O];hS(I)?v=uS.call(v,cS.call(I)):v.push(I)}return v};ov.wrap=function(b){return function(){return b(ov(arguments))}};var qa=aS,Za=mv.exports,gv=Object.hasOwnProperty,vv=Object.create(null);for(var Mc in qa)gv.call(qa,Mc)&&(vv[qa[Mc]]=Mc);var Sr=fv.exports={to:{},get:{}};Sr.get=function(b){var w=b.substring(0,3).toLowerCase(),v,O;switch(w){case"hsl":v=Sr.get.hsl(b),O="hsl";break;case"hwb":v=Sr.get.hwb(b),O="hwb";break;default:v=Sr.get.rgb(b),O="rgb";break}return v?{model:O,value:v}:null};Sr.get.rgb=function(b){if(!b)return null;var w=/^#([a-f0-9]{3,4})$/i,v=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,O=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,M=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,I=/^(\w+)$/,D=[0,0,0,1],k,V,W;if(k=b.match(v)){for(W=k[2],k=k[1],V=0;V<3;V++){var X=V*2;D[V]=parseInt(k.slice(X,X+2),16)}W&&(D[3]=parseInt(W,16)/255)}else if(k=b.match(w)){for(k=k[1],W=k[3],V=0;V<3;V++)D[V]=parseInt(k[V]+k[V],16);W&&(D[3]=parseInt(W+W,16)/255)}else if(k=b.match(O)){for(V=0;V<3;V++)D[V]=parseInt(k[V+1],0);k[4]&&(k[5]?D[3]=parseFloat(k[4])*.01:D[3]=parseFloat(k[4]))}else if(k=b.match(M)){for(V=0;V<3;V++)D[V]=Math.round(parseFloat(k[V+1])*2.55);k[4]&&(k[5]?D[3]=parseFloat(k[4])*.01:D[3]=parseFloat(k[4]))}else return(k=b.match(I))?k[1]==="transparent"?[0,0,0,0]:gv.call(qa,k[1])?(D=qa[k[1]],D[3]=1,D):null:null;for(V=0;V<3;V++)D[V]=zo(D[V],0,255);return D[3]=zo(D[3],0,1),D};Sr.get.hsl=function(b){if(!b)return null;var w=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,v=b.match(w);if(v){var O=parseFloat(v[4]),M=(parseFloat(v[1])%360+360)%360,I=zo(parseFloat(v[2]),0,100),D=zo(parseFloat(v[3]),0,100),k=zo(isNaN(O)?1:O,0,1);return[M,I,D,k]}return null};Sr.get.hwb=function(b){if(!b)return null;var w=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,v=b.match(w);if(v){var O=parseFloat(v[4]),M=(parseFloat(v[1])%360+360)%360,I=zo(parseFloat(v[2]),0,100),D=zo(parseFloat(v[3]),0,100),k=zo(isNaN(O)?1:O,0,1);return[M,I,D,k]}return null};Sr.to.hex=function(){var b=Za(arguments);return"#"+yh(b[0])+yh(b[1])+yh(b[2])+(b[3]<1?yh(Math.round(b[3]*255)):"")};Sr.to.rgb=function(){var b=Za(arguments);return b.length<4||b[3]===1?"rgb("+Math.round(b[0])+", "+Math.round(b[1])+", "+Math.round(b[2])+")":"rgba("+Math.round(b[0])+", "+Math.round(b[1])+", "+Math.round(b[2])+", "+b[3]+")"};Sr.to.rgb.percent=function(){var b=Za(arguments),w=Math.round(b[0]/255*100),v=Math.round(b[1]/255*100),O=Math.round(b[2]/255*100);return b.length<4||b[3]===1?"rgb("+w+"%, "+v+"%, "+O+"%)":"rgba("+w+"%, "+v+"%, "+O+"%, "+b[3]+")"};Sr.to.hsl=function(){var b=Za(arguments);return b.length<4||b[3]===1?"hsl("+b[0]+", "+b[1]+"%, "+b[2]+"%)":"hsla("+b[0]+", "+b[1]+"%, "+b[2]+"%, "+b[3]+")"};Sr.to.hwb=function(){var b=Za(arguments),w="";return b.length>=4&&b[3]!==1&&(w=", "+b[3]),"hwb("+b[0]+", "+b[1]+"%, "+b[2]+"%"+w+")"};Sr.to.keyword=function(b){return vv[b.slice(0,3)]};function zo(b,w,v){return Math.min(Math.max(w,b),v)}function yh(b){var w=Math.round(b).toString(16).toUpperCase();return w.length<2?"0"+w:w}var dS=fv.exports;class pS{constructor(w){this.enable=w,this.apps={},this.level="debug",this.roomLogger=null,this._onMessage=v=>{let O;v instanceof CustomEvent?O=v.detail:oS(v.data)&&(O=v.data),O&&(typeof O.slide=="boolean"?this.enable=O.slide:O.slide==="__instance"?console.log(this):O.slide==="__debug"&&Object.values(this.apps).forEach(M=>{var I,D;(D=(I=M.controller)==null?void 0:I.slide)==null||D.createController()}))},this.initialize()}setAppContext(w,v){var O;((O=this.apps)[w]||(O[w]={})).context=v,this.log(`[Slide] new ${w}`)}setAppController(w,v){var O;((O=this.apps)[w]||(O[w]={})).controller=v}deleteApp(w){delete this.apps[w],this.log(`[Slide] delete ${w}`)}initialize(){window.addEventListener("message",this._onMessage)}dispose(){window.removeEventListener("message",this._onMessage)}log(...w){this.roomLogger?this.roomLogger.info(...w):this.enable&&console.log(...w)}verbose(...w){this.roomLogger?this.roomLogger.debug(...w):this.enable&&this.level==="verbose"&&console.log(...w)}warn(...w){this.roomLogger?this.roomLogger.warn(...w):console.warn(...w)}}const Nr=new pS(!1),ji=Nr.log.bind(Nr),Cc=Nr.verbose.bind(Nr),fS=b=>{Nr.roomLogger=b.logger};function _v(b){try{const w=window.getComputedStyle(b).backgroundColor;if(w!=="rgba(0, 0, 0, 0)"&&w!=="transparent")return w;if(b.parentElement)return _v(b.parentElement)}catch{}return"#ffffff"}function mS(b){const w=dS.get(b);if(w&&w.model==="rgb"){const v=w.value,M=(((Math.round(v[0])&255)<<16)+((Math.round(v[1])&255)<<8)+(Math.round(v[2])&255)).toString(16);return"#"+"000000".substring(M.length)+M}else return b}let xh="";function yv(b){return xh||(xh=mS(_v(b)),ji("[Slide] guess bg color",xh)),xh}function xv(b){const{width:w,height:v,slideCount:O,slideState:M}=b,{taskId:I,url:D}=M,k=[];for(let V=1;V<=O;++V)k.push({width:w,height:v,thumbnail:`${D}/${I}/preview/${V}.png`,src:"ppt"});return k}function sv(b,w,v,O){var k;const M=v.slideState.currentSlideIndex;if(!(M>0)||!w.getIsWritable())return;const I=[O,M].join("/");if(b.scenePathType(I)!=="page"){b.removeScenes(O);const V=v.slideCount,W=[];for(let X=1;X<=V;++X)W.push({name:`${X}`});b.putScenes(O,W)}let D;w.getBox().focus?D=b.state.sceneState.scenePath:D=((k=w.getView())==null?void 0:k.focusScenePath)||"",D!==I&&w.setScenePath(I)}const Dc="https://convertcdn.netless.link/dynamicConvert",gS=40,Rc={taskId:"",url:"",state:null};class vS{constructor({context:w,anchor:v,onRenderStart:O,onPageChanged:M,onTransitionStart:I,onTransitionEnd:D,onError:k,onRenderError:V,showRenderError:W}){this.sideEffect=new Ka,this.ready=!1,this.readyPromise=new Promise(X=>{this.resolveReady=()=>{this.ready?ji("[Slide] render end"):setTimeout(()=>{this.ready=!0,X()},1e3)}}),this.onSyncDispatch=X=>{if(this.context.getIsWritable()&&this.room){const et={type:li.SLIDE_EVENTS.syncDispatch,payload:X};Cc("[Slide] dispatch",JSON.stringify(X)),this.context.dispatchMagixEvent(li.SLIDE_EVENTS.syncDispatch,et)}},this.magixEventListener=X=>{const{type:et,payload:ft}=X.payload;et===li.SLIDE_EVENTS.syncDispatch&&(this.syncStateOnce(),Cc("[Slide] receive",JSON.stringify(ft)),this.slide.emit(li.SLIDE_EVENTS.syncReceive,ft))},this.onStateChange=X=>{this.context.getIsWritable()&&(Cc("[Slide] state change",JSON.stringify(X,null,2)),this.context.storage.setState({state:X}))},this.pollCount=0,this.pollReadyState=()=>{this.ready?this._toFreeze===1?this.freeze():this._toFreeze===-1&&this.unfreeze():this.pollCount<gS?(this.pollCount++,setTimeout(this.pollReadyState,500)):(this.pollCount=0,ji("[Slide] renderSlide 1 (retry after timeout)"),this.slide.renderSlide(1))},this._pageCount=0,this.destroyed=!1,this.timestamp=()=>this.room&&this.room.calibrationTimestamp?this.room.calibrationTimestamp:this.player?this.player.beginTimestamp+this.player.progressTime:Date.now(),this.isFrozen=!1,this._toFreeze=0,this.freeze=()=>{this.isFrozen=!0,this.ready?(ji("[Slide] freeze",this.context.appId),this.slide.frozen()):this._toFreeze=1},this.unfreeze=async()=>{!this.visible||(this.isFrozen=!1,this.ready?(ji("[Slide] unfreeze",this.context.appId),this.slide.release()):this._toFreeze=-1)},this.onVisibilityChange=async()=>{(this.visible=document.visibilityState==="visible")?(ji("[Slide] unfreeze because tab becomes visible",{savedIsFrozen:this.savedIsFrozen}),this.savedIsFrozen||this.unfreeze()):(this.savedIsFrozen=this.isFrozen,ji("[Slide] freeze because tab becomes invisible"),this.freeze())},this.onRenderStart=O,this.onPageChanged=M,this.onTransitionStart=I,this.onTransitionEnd=D,this.onError=k,this.onRenderError=V,this.showRenderError=W!=null?W:!0,this.context=w,this.room=w.getRoom(),this.player=this.room?void 0:w.getDisplayer(),fS(this.room||this.player),this.slide=this.createSlide(v),this.syncStateOnceFlag=!this.context.isAddApp,this.visible=document.visibilityState==="visible",this.savedIsFrozen=!1,this.initialize()}jumpToPage(w){this.ready&&(w=pv(w,1,this.pageCount),this.slide.renderSlide(w))}initialize(){this.registerEventListeners(),this.kickStart()}kickStart(){const{context:w,slide:v}=this;w.getIsWritable()&&w.storage.ensureState(Rc);const{taskId:O,url:M,state:I}=w.storage.state;v.setResource(O,M||Dc),I?(ji("[Slide] init with state",JSON.stringify(I)),this.syncStateOnceFlag=!1,v.setSlideState(I)):w.isAddApp&&(ji("[Slide] init by renderSlide",1),v.renderSlide(1)),this.pollReadyState()}registerEventListeners(){const{context:w,slide:v}=this,O=this.sideEffect.addDisposer(w.storage.addStateChangedListener(()=>{w.storage.state.state&&(this.syncStateOnce(),this.sideEffect.flush(O))}));this.sideEffect.add(()=>w.addMagixEventListener(li.SLIDE_EVENTS.syncDispatch,this.magixEventListener,{fireSelfEventAfterCommit:!0})),v.on(li.SLIDE_EVENTS.renderStart,this.onRenderStart),v.on(li.SLIDE_EVENTS.slideChange,this.onPageChanged),v.on(li.SLIDE_EVENTS.renderEnd,this.onTransitionEnd),v.on(li.SLIDE_EVENTS.mainSeqStepStart,this.onTransitionStart),v.on(li.SLIDE_EVENTS.mainSeqStepEnd,this.onTransitionEnd),v.on(li.SLIDE_EVENTS.renderError,this.onError),v.on(li.SLIDE_EVENTS.stateChange,this.onStateChange),v.on(li.SLIDE_EVENTS.syncDispatch,this.onSyncDispatch),v.on(li.SLIDE_EVENTS.renderEnd,this.resolveReady),this.sideEffect.add(()=>(document.addEventListener("visibilitychange",this.onVisibilityChange),()=>document.removeEventListener("visibilitychange",this.onVisibilityChange)))}syncStateOnce(){if(this.syncStateOnceFlag){this.context.getIsWritable()&&this.context.storage.ensureState(Rc);const{state:w}=this.context.storage.state;w&&(ji("[Slide] sync with state (once)",JSON.stringify(w)),this.slide.setSlideState(w),this.syncStateOnceFlag=!1)}}get pageCount(){return this._pageCount>0?this._pageCount:(this._pageCount=this.slide.slideCount,this._pageCount)}get page(){return this.slide.slideState.currentSlideIndex}createSlide(w){var M,I,D;const v=this.context.getAppOptions()||{};return new li.Slide({anchor:w,interactive:!0,mode:"interactive",controller:Nr.enable,enableGlobalClick:(M=v.enableGlobalClick)!=null?M:!0,renderOptions:{minFPS:v.minFPS||25,maxFPS:v.maxFPS||30,autoFPS:(I=v.autoFPS)!=null?I:!0,autoResolution:(D=v.autoResolution)!=null?D:!0,resolution:v.resolution,transactionBgColor:v.bgColor||yv(w),maxResolutionLevel:v.maxResolutionLevel,forceCanvas:v.forceCanvas,enableNvidiaDetect:v.enableNvidiaDetect},fixedFrameSize:v.fixedFrameSize,loaderDelegate:v.loaderDelegate,navigatorDelegate:v.navigatorDelegate,urlInterrupter:v.urlInterrupter,resourceTimeout:v.resourceTimeout,rtcAudio:v.rtcAudio,useLocalCache:v.useLocalCache,logger:v.logger,timestamp:this.timestamp})}destroy(){this.sideEffect.flushAll(),this.destroyed||(ji("[Slide] destroy slide (once)"),this.slide.destroy(),this.destroyed=!0)}}function _S(b){const w="http://www.w3.org/2000/svg",v=document.createElementNS(w,"svg");v.setAttribute("class",`${b}-footer-icon-sidebar`),v.setAttribute("viewBox","0 0 64 64");const O=document.createElementNS(w,"path");return O.setAttribute("fill","currentColor"),O.setAttribute("d","M50 8H14c-3.309 0-6 2.691-6 6v36c0 3.309 2.691 6 6 6h36c3.309 0 6-2.691 6-6V14c0-3.309-2.691-6-6-6zM12 50V14c0-1.103.897-2 2-2h8v40h-8c-1.103 0-2-.897-2-2zm40 0c0 1.103-.897 2-2 2H26V12h24c1.103 0 2 .897 2 2z"),v.appendChild(O),v}function yS(b){const w="http://www.w3.org/2000/svg",v=document.createElementNS(w,"svg");v.setAttribute("class",`${b}-footer-icon-arrow-left`),v.setAttribute("viewBox","0 0 500 500");const O=document.createElementNS(w,"path");return O.setAttribute("fill","currentColor"),O.setAttribute("d","M177.81 249.959L337.473 90.295c2.722-2.865 2.651-7.378-.143-10.1-2.793-2.65-7.163-2.65-9.956 0l-164.75 164.75c-2.793 2.793-2.793 7.306 0 10.1l164.75 164.75c2.865 2.722 7.378 2.65 10.099-.143 2.651-2.794 2.651-7.163 0-9.957L177.809 249.959z"),v.appendChild(O),v}function xS(b){const w="http://www.w3.org/2000/svg",v=document.createElementNS(w,"svg");v.setAttribute("class",`${b}-footer-icon-arrow-right`),v.setAttribute("viewBox","0 0 500 500");const O=document.createElementNS(w,"path");return O.setAttribute("fill","currentColor"),O.setAttribute("d","M322.19 250.041L162.527 409.705c-2.722 2.865-2.651 7.378.143 10.1 2.793 2.65 7.163 2.65 9.956 0l164.75-164.75c2.793-2.793 2.793-7.306 0-10.1l-164.75-164.75c-2.865-2.722-7.378-2.65-10.099.143-2.651 2.794-2.651 7.163 0 9.957l159.664 159.736z"),v.appendChild(O),v}function bS(b){const w="http://www.w3.org/2000/svg",v=document.createElementNS(w,"svg");v.setAttribute("class",`${b}-footer-icon-play`),v.setAttribute("viewBox","0 0 500 500");const O=document.createElementNS(w,"path");return O.setAttribute("fill","currentColor"),O.setAttribute("d","M418.158 257.419L174.663 413.33c-6.017 3.919-15.708 3.772-21.291-.29-2.791-2.018-4.295-4.483-4.295-7.084V94.109c0-5.65 6.883-10.289 15.271-10.289 4.298 0 8.391 1.307 11.181 3.332l242.629 155.484c6.016 3.917 6.451 10.292.649 14.491-.216.154-.432.154-.649.292zM170.621 391.288l223.116-141.301L170.71 107.753l-.089 283.535z"),v.appendChild(O),v}function TS(b){const w="http://www.w3.org/2000/svg",v=document.createElementNS(w,"svg");v.setAttribute("class",`${b}-footer-icon-pause`),v.setAttribute("viewBox","0 0 500 500");const O=document.createElementNS(w,"path");return O.setAttribute("fill","currentColor"),O.setAttribute("d","M312.491 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261zM165.257 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261z"),v.appendChild(O),v}const Wo=typeof window!="undefined",bv=Wo&&!("onscroll"in window)||typeof navigator!="undefined"&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),Tv=Wo&&"IntersectionObserver"in window,Ev=Wo&&"classList"in document.createElement("p"),Sv=Wo&&window.devicePixelRatio>1,ES={elements_selector:".lazy",container:bv||Wo?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_bg_set:"bg-set",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},wv=b=>Object.assign({},ES,b),av=function(b,w){let v;const O="LazyLoad::Initialized",M=new b(w);try{v=new CustomEvent(O,{detail:{instance:M}})}catch{v=document.createEvent("CustomEvent"),v.initCustomEvent(O,!1,!1,{instance:M})}window.dispatchEvent(v)},SS=(b,w)=>{if(!!w)if(!w.length)av(b,w);else for(let v=0,O;O=w[v];v+=1)av(b,O)},fo="src",Fc="srcset",Bc="sizes",Av="poster",Qa="llOriginalAttrs",Mv="data",Uc="loading",Cv="loaded",Rv="applied",wS="entered",kc="error",Iv="native",Pv="data-",Ov="ll-status",fr=(b,w)=>b.getAttribute(Pv+w),AS=(b,w,v)=>{var O=Pv+w;if(v===null){b.removeAttribute(O);return}b.setAttribute(O,v)},$a=b=>fr(b,Ov),gs=(b,w)=>AS(b,Ov,w),Eh=b=>gs(b,null),Gc=b=>$a(b)===null,MS=b=>$a(b)===Uc,CS=b=>$a(b)===kc,Hc=b=>$a(b)===Iv,RS=[Uc,Cv,Rv,kc],IS=b=>RS.indexOf($a(b))>=0,Xo=(b,w,v,O)=>{if(!!b){if(O!==void 0){b(w,v,O);return}if(v!==void 0){b(w,v);return}b(w)}},ta=(b,w)=>{if(Ev){b.classList.add(w);return}b.className+=(b.className?" ":"")+w},no=(b,w)=>{if(Ev){b.classList.remove(w);return}b.className=b.className.replace(new RegExp("(^|\\s+)"+w+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},PS=b=>{b.llTempImage=document.createElement("IMG")},OS=b=>{delete b.llTempImage},Nv=b=>b.llTempImage,Sh=(b,w)=>{if(!w)return;const v=w._observer;!v||v.unobserve(b)},NS=b=>{b.disconnect()},LS=(b,w,v)=>{w.unobserve_entered&&Sh(b,v)},jc=(b,w)=>{!b||(b.loadingCount+=w)},DS=b=>{!b||(b.toLoadCount-=1)},Lv=(b,w)=>{!b||(b.toLoadCount=w)},FS=b=>b.loadingCount>0,BS=b=>b.toLoadCount>0,Dv=b=>{let w=[];for(let v=0,O;O=b.children[v];v+=1)O.tagName==="SOURCE"&&w.push(O);return w},zc=(b,w)=>{const v=b.parentNode;if(!v||v.tagName!=="PICTURE")return;Dv(v).forEach(w)},Fv=(b,w)=>{Dv(b).forEach(w)},wh=[fo],Bv=[fo,Av],Ja=[fo,Fc,Bc],Uv=[Mv],Ah=b=>!!b[Qa],kv=b=>b[Qa],Gv=b=>delete b[Qa],$s=(b,w)=>{if(Ah(b))return;const v={};w.forEach(O=>{v[O]=b.getAttribute(O)}),b[Qa]=v},US=b=>{Ah(b)||(b[Qa]={backgroundImage:b.style.backgroundImage})},kS=(b,w,v)=>{if(!v){b.removeAttribute(w);return}b.setAttribute(w,v)},ms=(b,w)=>{if(!Ah(b))return;const v=kv(b);w.forEach(O=>{kS(b,O,v[O])})},GS=b=>{if(!Ah(b))return;const w=kv(b);b.style.backgroundImage=w.backgroundImage},Hv=(b,w,v)=>{ta(b,w.class_applied),gs(b,Rv),v&&(w.unobserve_completed&&Sh(b,w),Xo(w.callback_applied,b,v))},jv=(b,w,v)=>{ta(b,w.class_loading),gs(b,Uc),v&&(jc(v,1),Xo(w.callback_loading,b,v))},Vo=(b,w,v)=>{!v||b.setAttribute(w,v)},lv=(b,w)=>{Vo(b,Bc,fr(b,w.data_sizes)),Vo(b,Fc,fr(b,w.data_srcset)),Vo(b,fo,fr(b,w.data_src))},HS=(b,w)=>{zc(b,v=>{$s(v,Ja),lv(v,w)}),$s(b,Ja),lv(b,w)},jS=(b,w)=>{$s(b,wh),Vo(b,fo,fr(b,w.data_src))},zS=(b,w)=>{Fv(b,v=>{$s(v,wh),Vo(v,fo,fr(v,w.data_src))}),$s(b,Bv),Vo(b,Av,fr(b,w.data_poster)),Vo(b,fo,fr(b,w.data_src)),b.load()},VS=(b,w)=>{$s(b,Uv),Vo(b,Mv,fr(b,w.data_src))},WS=(b,w,v)=>{const O=fr(b,w.data_bg),M=fr(b,w.data_bg_hidpi),I=Sv&&M?M:O;!I||(b.style.backgroundImage=`url("${I}")`,Nv(b).setAttribute(fo,I),jv(b,w,v))},XS=(b,w,v)=>{const O=fr(b,w.data_bg_multi),M=fr(b,w.data_bg_multi_hidpi),I=Sv&&M?M:O;!I||(b.style.backgroundImage=I,Hv(b,w,v))},YS=(b,w,v)=>{const O=fr(b,w.data_bg_set);if(!O)return;const M=O.split("|");let I=M.map(D=>`image-set(${D})`);b.style.backgroundImage=I.join(),b.style.backgroundImage===""&&(I=M.map(D=>`-webkit-image-set(${D})`),b.style.backgroundImage=I.join()),Hv(b,w,v)},zv={IMG:HS,IFRAME:jS,VIDEO:zS,OBJECT:VS},qS=(b,w)=>{const v=zv[b.tagName];!v||v(b,w)},JS=(b,w,v)=>{const O=zv[b.tagName];!O||(O(b,w),jv(b,w,v))},KS=["IMG","IFRAME","VIDEO","OBJECT"],ZS=b=>KS.indexOf(b.tagName)>-1,Vv=(b,w)=>{w&&!FS(w)&&!BS(w)&&Xo(b.callback_finish,w)},hv=(b,w,v)=>{b.addEventListener(w,v),b.llEvLisnrs[w]=v},QS=(b,w,v)=>{b.removeEventListener(w,v)},Vc=b=>!!b.llEvLisnrs,$S=(b,w,v)=>{Vc(b)||(b.llEvLisnrs={});const O=b.tagName==="VIDEO"?"loadeddata":"load";hv(b,O,w),hv(b,"error",v)},Ic=b=>{if(!Vc(b))return;const w=b.llEvLisnrs;for(let v in w){const O=w[v];QS(b,v,O)}delete b.llEvLisnrs},Wv=(b,w,v)=>{OS(b),jc(v,-1),DS(v),no(b,w.class_loading),w.unobserve_completed&&Sh(b,v)},tw=(b,w,v,O)=>{const M=Hc(w);Wv(w,v,O),ta(w,v.class_loaded),gs(w,Cv),Xo(v.callback_loaded,w,O),M||Vv(v,O)},ew=(b,w,v,O)=>{const M=Hc(w);Wv(w,v,O),ta(w,v.class_error),gs(w,kc),Xo(v.callback_error,w,O),v.restore_on_error&&ms(w,Ja),M||Vv(v,O)},Wc=(b,w,v)=>{const O=Nv(b)||b;if(Vc(O))return;$S(O,D=>{tw(D,b,w,v),Ic(O)},D=>{ew(D,b,w,v),Ic(O)})},nw=(b,w,v)=>{PS(b),Wc(b,w,v),US(b),WS(b,w,v),XS(b,w,v),YS(b,w,v)},iw=(b,w,v)=>{Wc(b,w,v),JS(b,w,v)},Xc=(b,w,v)=>{ZS(b)?iw(b,w,v):nw(b,w,v)},rw=(b,w,v)=>{b.setAttribute("loading","lazy"),Wc(b,w,v),qS(b,w),gs(b,Iv)},uv=b=>{b.removeAttribute(fo),b.removeAttribute(Fc),b.removeAttribute(Bc)},ow=b=>{zc(b,w=>{uv(w)}),uv(b)},Xv=b=>{zc(b,w=>{ms(w,Ja)}),ms(b,Ja)},sw=b=>{Fv(b,w=>{ms(w,wh)}),ms(b,Bv),b.load()},aw=b=>{ms(b,wh)},lw=b=>{ms(b,Uv)},hw={IMG:Xv,IFRAME:aw,VIDEO:sw,OBJECT:lw},uw=b=>{const w=hw[b.tagName];if(!w){GS(b);return}w(b)},cw=(b,w)=>{Gc(b)||Hc(b)||(no(b,w.class_entered),no(b,w.class_exited),no(b,w.class_applied),no(b,w.class_loading),no(b,w.class_loaded),no(b,w.class_error))},dw=(b,w)=>{uw(b),cw(b,w),Eh(b),Gv(b)},pw=(b,w,v,O)=>{!v.cancel_on_exit||!MS(b)||b.tagName==="IMG"&&(Ic(b),ow(b),Xv(b),no(b,v.class_loading),jc(O,-1),Eh(b),Xo(v.callback_cancel,b,w,O))},fw=(b,w,v,O)=>{const M=IS(b);gs(b,wS),ta(b,v.class_entered),no(b,v.class_exited),LS(b,v,O),Xo(v.callback_enter,b,w,O),!M&&Xc(b,v,O)},mw=(b,w,v,O)=>{Gc(b)||(ta(b,v.class_exited),pw(b,w,v,O),Xo(v.callback_exit,b,w,O))},gw=["IMG","IFRAME","VIDEO"],Yv=b=>b.use_native&&"loading"in HTMLImageElement.prototype,vw=(b,w,v)=>{b.forEach(O=>{gw.indexOf(O.tagName)!==-1&&rw(O,w,v)}),Lv(v,0)},_w=b=>b.isIntersecting||b.intersectionRatio>0,yw=b=>({root:b.container===document?null:b.container,rootMargin:b.thresholds||b.threshold+"px"}),xw=(b,w,v)=>{b.forEach(O=>_w(O)?fw(O.target,O,w,v):mw(O.target,O,w,v))},bw=(b,w)=>{w.forEach(v=>{b.observe(v)})},Tw=(b,w)=>{NS(b),bw(b,w)},Ew=(b,w)=>{!Tv||Yv(b)||(w._observer=new IntersectionObserver(v=>{xw(v,b,w)},yw(b)))},qv=b=>Array.prototype.slice.call(b),bh=b=>b.container.querySelectorAll(b.elements_selector),Sw=b=>qv(b).filter(Gc),ww=b=>CS(b),Aw=b=>qv(b).filter(ww),cv=(b,w)=>Sw(b||bh(w)),Mw=(b,w)=>{Aw(bh(b)).forEach(O=>{no(O,b.class_error),Eh(O)}),w.update()},Cw=(b,w)=>{!Wo||(w._onlineHandler=()=>{Mw(b,w)},window.addEventListener("online",w._onlineHandler))},Rw=b=>{!Wo||window.removeEventListener("online",b._onlineHandler)},tl=function(b,w){const v=wv(b);this._settings=v,this.loadingCount=0,Ew(v,this),Cw(v,this),this.update(w)};tl.prototype={update:function(b){const w=this._settings,v=cv(b,w);if(Lv(this,v.length),bv||!Tv){this.loadAll(v);return}if(Yv(w)){vw(v,w,this);return}Tw(this._observer,v)},destroy:function(){this._observer&&this._observer.disconnect(),Rw(this),bh(this._settings).forEach(b=>{Gv(b)}),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(b){const w=this._settings;cv(b,w).forEach(O=>{Sh(O,this),Xc(O,w,this)})},restoreAll:function(){const b=this._settings;bh(b).forEach(w=>{dw(w,b)})}};tl.load=(b,w)=>{const v=wv(w);Xc(b,v)};tl.resetStatus=b=>{Eh(b)};Wo&&SS(tl,window.lazyLoadOptions);class Jv{constructor({readonly:w,onNewPageIndex:v,onPlay:O,urlInterrupter:M}){this._pages=[],this.pageIndex=0,this.setPaused=()=>{this.$btnPlay.classList.toggle(this.wrapClassName("footer-btn-playing"),!1)},this.setPlaying=()=>{this.$btnPlay.classList.toggle(this.wrapClassName("footer-btn-playing"),!0)},this.namespace="netless-app-slide",this.isShowPreview=!1,this.isSmallBox=!1,this.sideEffect=new Ka,this.readonly=w,this.onNewPageIndex=v,this.onPlay=O,this.urlInterrupter=M||(I=>I),this.render()}set pages(w){this._pages=w,this.refreshPreview().then(this.refreshBtnSidebar.bind(this)),this.refreshTotalPage()}get pages(){return this._pages}unmount(){this.$content.remove(),this.$footer.remove()}setReadonly(w){this.readonly=w,this.$content.classList.toggle(this.wrapClassName("readonly"),w),this.$footer.classList.toggle(this.wrapClassName("readonly"),w),this.$pageNumberInput.disabled=w}destroy(){var w;(w=this.previewLazyLoad)==null||w.destroy(),this.sideEffect.flushAll(),this.unmount()}setPageIndex(w){Number.isNaN(w)||(this.pageIndex=w,this.$pageNumberInput.value=String(w+1))}refreshTotalPage(){this.pages.length?this.$totalPage.textContent=" / "+this.pages.length:this.$totalPage.textContent=""}setSmallBox(w){this.isSmallBox!==w&&(this.isSmallBox=w,this.$footer.classList.toggle(this.wrapClassName("float-footer"),w))}render(){return this.renderContent(),this.renderFooter(),this.$content}renderContent(){if(!this.$content){const w=document.createElement("div");w.className=this.wrapClassName("content"),this.$content=w,this.readonly&&w.classList.add(this.wrapClassName("readonly")),w.appendChild(this.renderPreviewMask()),w.appendChild(this.renderPreview())}return this.$content}renderPreview(){if(!this.$preview){const w=document.createElement("div");w.className=this.wrapClassName("preview")+" tele-fancy-scrollbar",this.$preview=w,this.refreshPreview(),this.sideEffect.addEventListener(w,"click",v=>{var M;if(this.readonly)return;const O=(M=v.target.dataset)==null?void 0:M.pageIndex;O&&(v.preventDefault(),v.stopPropagation(),v.stopImmediatePropagation(),this.onNewPageIndex(Number(O)),this.togglePreview(!1))})}return this.$preview}async refreshPreview(){var I,D;const{$preview:w}=this,v=this.wrapClassName("preview-page"),O=this.wrapClassName("preview-page-name");for(;w.firstChild;)w.firstChild.remove();const M=[];for(let k=0,V=this.pages.length;k<V;k++){const W=this.pages[k],X=(I=W.thumbnail)!=null?I:W.src.startsWith("ppt")?void 0:W.src;X&&(M[k]=this.urlInterrupter(X))}for(let k=0,V=this.pages.length;k<V;k++)M[k]=await M[k];this.pages.forEach((k,V)=>{const W=M[V];if(!W)return;const X=String(V),et=document.createElement("a");et.className=v+" "+this.wrapClassName(`preview-page-${V}`),et.setAttribute("href","#"),et.dataset.pageIndex=X;const ft=document.createElement("span");ft.className=O,ft.textContent=String(V+1),ft.dataset.pageIndex=X;const Dt=document.createElement("img");Dt.width=k.width,Dt.height=k.height,Dt.dataset.src=W,Dt.dataset.pageIndex=X,et.appendChild(Dt),et.appendChild(ft),w.appendChild(et)}),(D=this.previewLazyLoad)==null||D.update()}renderPreviewMask(){return this.$previewMask||(this.$previewMask=document.createElement("div"),this.$previewMask.className=this.wrapClassName("preview-mask"),this.sideEffect.addEventListener(this.$previewMask,"click",w=>{this.readonly||w.target===this.$previewMask&&this.togglePreview(!1)})),this.$previewMask}refreshBtnSidebar(){this.$btnSidebar.style.display=this.pages.length>0?"":"none"}renderFooter(){if(!this.$footer){const w=document.createElement("div");w.className=this.wrapClassName("footer"),this.$footer=w,this.readonly&&w.classList.add(this.wrapClassName("readonly")),this.isSmallBox&&w.classList.add(this.wrapClassName("float-footer"));const v=this.renderFooterBtn("btn-sidebar",_S(this.namespace));this.sideEffect.addEventListener(v,"click",()=>{this.readonly||this.togglePreview()}),this.$btnSidebar=v,this.$btnSidebar.style.display="none",this.$footer.appendChild(v);const O=document.createElement("div");O.className=this.wrapClassName("page-jumps");const M=this.renderFooterBtn("btn-page-back",yS(this.namespace));if(this.sideEffect.addEventListener(M,"click",()=>{this.readonly||this.onNewPageIndex(this.pageIndex-1)}),O.appendChild(M),this.onPlay){const W=this.renderFooterBtn("btn-page-play",bS(this.namespace),TS(this.namespace));this.$btnPlay=W,this.sideEffect.addEventListener(W,"click",()=>{this.readonly||(this.setPlaying(),this.onPlay&&this.onPlay())}),O.appendChild(W)}const I=this.renderFooterBtn("btn-page-next",xS(this.namespace));this.sideEffect.addEventListener(I,"click",()=>{this.readonly||this.onNewPageIndex(this.pageIndex+1)}),O.appendChild(I);const D=document.createElement("div");D.className=this.wrapClassName("page-number");const k=document.createElement("input");k.className=this.wrapClassName("page-number-input"),k.value=String(this.pageIndex+1),this.readonly&&(k.disabled=!0),this.$pageNumberInput=k,this.sideEffect.addEventListener(k,"focus",()=>{k.select()}),this.sideEffect.addEventListener(k,"change",()=>{this.readonly||k.value&&this.onNewPageIndex(Number(k.value)-1)});const V=document.createElement("span");this.$totalPage=V,D.appendChild(k),D.appendChild(V),this.$footer.appendChild(O),this.$footer.appendChild(D)}return this.$footer}renderFooterBtn(w,v,O){const M=document.createElement("button");return M.className=this.wrapClassName("footer-btn")+" "+this.wrapClassName(w),M.appendChild(v),O&&M.appendChild(O),M}togglePreview(w){if(this.isShowPreview=w!=null?w:!this.isShowPreview,this.$content.classList.toggle(this.wrapClassName("preview-active"),this.isShowPreview),this.isShowPreview){const v=this.$preview.querySelector("."+this.wrapClassName(`preview-page-${this.pageIndex}`));v&&(this.previewLazyLoad||(this.previewLazyLoad=new tl({container:this.$preview,elements_selector:`.${this.wrapClassName("preview-page>img")}`})),this.$preview.scrollTo({top:v.offsetTop-16}))}}wrapClassName(w){return`${this.namespace}-${w}`}}const Iw=new Set(["clicker"]);class Pw{constructor({box:w,view:v,mountSlideController:O,mountWhiteboard:M,baseScenePath:I,appId:D,urlInterrupter:k}){this.slideController=null,this.isViewMounted=!1,this.onError=({error:V,index:W})=>{var X,et;this.viewer.setPaused(),(X=this.slideController)!=null&&X.showRenderError&&(this.$overlay.textContent=`Error on slide[page=${this.slideController.page}]: ${V.message}`,this.$overlay.style.opacity="1"),(et=this.slideController)!=null&&et.onRenderError&&this.slideController.onRenderError(V,W),Nr.warn("[Slide] render error",V)},this.onRenderStart=()=>{this.$whiteboardView.classList.add(this.wrapClassName("wb-view-hidden"))},this.onRenderEnd=()=>{},this.onPageChanged=()=>{this.$overlay.style.opacity="",this.$whiteboardView.classList.remove(this.wrapClassName("wb-view-hidden"))},this.refreshPages=()=>{this.slideController&&(this.viewer.pages=xv(this.slideController.slide),this.viewer.setPageIndex(this.getPageIndex(this.slideController.page)),this.scaleDocsToFit())},this.scaleDocsToFit=()=>{if(this.slideController){const{width:V,height:W}=this.slideController.slide;V&&W&&(this.whiteboardView.moveCameraToContain({originX:-V/2,originY:-W/2,width:V,height:W,animationMode:"immediately"}),this.whiteboardView.setCameraBound({damping:1,maxContentMode:()=>this.whiteboardView.camera.scale,minContentMode:()=>this.whiteboardView.camera.scale,centerX:0,centerY:0,width:V,height:W}),this.isViewMounted||(this.isViewMounted=!0,console.log("[Slide] mount whiteboard view"),this.mountWhiteboard(this.$whiteboardView)))}},this.onPlay=()=>{this.slideController&&this.slideController.slide.nextStep()},this.onNewPageIndex=V=>{this.slideController&&this.slideController.jumpToPage(V+1)},this.sideEffect=new Ka,this.namespace="netless-app-slide",this.toPdf=async()=>{if(!this.slideController){this.reportProgress(100,null);return}const{slide:V}=this.slideController,W=1920,X=document.createElement("canvas"),et=X.getContext("2d"),{slideCount:ft,width:Dt,height:At}=V;let L=Math.floor(Dt),R=Math.floor(At);L>W&&(L=W,R=Math.floor(At*L/Dt)),R>W&&(R=W,L=Math.floor(Dt*R/At)),X.width=L,X.height=R;const B=document.createElement("canvas");B.width=L,B.height=R;const Y=B.getContext("2d");if(!Y||!this.getWhiteSnapshot||!et)return this.reportProgress(100,null),null;const P=L>R?"l":"p",{jsPDF:H}=await Promise.resolve().then(function(){return $E(require("jspdf"))}),tt=new H({format:[L,R],orientation:P,compress:!0});for(let zt=1;zt<=ft;zt++){let st=null;try{st=await this.slideController.slide.snapshotWithTimingEnd(zt)}catch{}if(st){const dt=document.createElement("img");dt.src=st,await new Promise($=>dt.onload=$),et.drawImage(dt,0,0,L,R)}Y.clearRect(0,0,L,R),this.getWhiteSnapshot(zt,B,Y,Dt,At);try{const dt=B.toDataURL("image/png"),$=document.createElement("img");$.src=dt,await new Promise(vt=>$.onload=vt),et.drawImage($,0,0,L,R)}catch{}const z=X.toDataURL("image/jpeg",.6);zt>1&&tt.addPage(),tt.addImage(z,"JPEG",0,0,L,R,"","FAST"),et.clearRect(0,0,L,R),Math.ceil(zt/ft*100)<100&&this.reportProgress(Math.ceil(zt/ft*100),null)}const G=tt.output("arraybuffer"),Ot=this.box.title;this.reportProgress(100,{pdf:G,title:Ot})},this.box=w,this.whiteboardView=v,this.mountSlideController=O,this.mountWhiteboard=M,this.baseScenePath=I,this.appId=D,this.viewer=new Jv({readonly:w.readonly,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay,urlInterrupter:k}),this.sideEffect.add(()=>{const V=W=>{this.setReadonly(W)};return w.events.on("readonly",V),()=>w.events.off("readonly",V)}),this.sideEffect.add(()=>{const V=W=>{W.data.type==="@netless/_request_save_pdf_"&&W.data.appId===this.appId&&this.toPdf().catch(()=>this.reportProgress(100,null))};return window.addEventListener("message",V),()=>{window.removeEventListener("message",V)}}),this.render()}render(){this.viewer.$content.appendChild(this.renderSlideContainer()),this.viewer.$content.appendChild(this.renderWhiteboardView()),this.viewer.$content.appendChild(this.renderOverlay()),this.sideEffect.addEventListener(window,"keydown",w=>{if(this.box.focus&&this.slideController&&!sS(w.target))switch(w.key){case"ArrowUp":case"ArrowLeft":{this.slideController.slide.prevStep();break}case"ArrowRight":case"ArrowDown":{this.slideController.slide.nextStep();break}}})}renderOverlay(){if(!this.$overlay){const w=document.createElement("div");w.className=this.wrapClassName("overlay"),this.$overlay=w}return this.$overlay}renderSlideContainer(){if(!this.$slide){const w=document.createElement("div");w.className=this.wrapClassName("slide"),w.dataset.appKind="Slide",this.$slide=w}return this.$slide}renderWhiteboardView(){return this.$whiteboardView||(this.$whiteboardView=document.createElement("div"),this.$whiteboardView.className=this.wrapClassName("wb-view")),this.$whiteboardView}mount(){return this.box.mountContent(this.viewer.$content),this.box.mountFooter(this.viewer.$footer),this.slideController=this.mountSlideController({anchor:this.$slide,onRenderStart:this.onRenderStart,onRenderEnd:this.onRenderEnd,onTransitionStart:this.viewer.setPlaying,onTransitionEnd:this.viewer.setPaused,onReady:this.refreshPages,onError:this.onError}),this.scaleDocsToFit(),this.sideEffect.add(()=>(this.whiteboardView.callbacks.on("onSizeUpdated",this.scaleDocsToFit),()=>this.whiteboardView.callbacks.off("onSizeUpdated",this.scaleDocsToFit))),this}getPageIndex(w){return(w>0?w:1)-1}unmount(){return this.slideController&&(this.slideController.destroy(),this.slideController=null),this.viewer.unmount(),this}setReadonly(w){this.viewer.setReadonly(w)}destroy(){this.sideEffect.flushAll(),this.unmount(),this.viewer.destroy()}toggleClickThrough(w){this.$whiteboardView.style.pointerEvents=!w||Iw.has(w)?"none":"auto"}wrapClassName(w){return`${this.namespace}-${w}`}getWhiteSnapshot(w,v,O,M,I){this.whiteboardView.screenshotToCanvas(O,`${this.baseScenePath}/${w}`,v.width,v.height,{centerX:0,centerY:0,scale:Math.min(v.width/M,v.height/I)})}reportProgress(w,v){window.postMessage({type:"@netless/_result_save_pdf_",appId:this.appId,progress:w,result:v})}}let Pc=!1;exports.FreezerLength=2;function Ow(){return exports.FreezerLength}function Nw(b){exports.FreezerLength=b<1?1/0:b}const Ya=b=>"["+b+"]",Th={map:new Map,boxes:new Map,queue:[],validateQueue(){for(this.queue.sort((b,w)=>{var M,I,D,k;const v=(I=(M=this.boxes.get(b))==null?void 0:M.zIndex)!=null?I:0,O=(k=(D=this.boxes.get(w))==null?void 0:D.zIndex)!=null?k:0;return-(v-O)}),ji("[Slide] freezer: validate",Ya(this.queue));this.queue.length>exports.FreezerLength;){const b=this.queue.pop(),w=this.map.get(b);w&&(ji("[Slide] freezer: validate-freeze",b,Ya(this.queue)),w.freeze())}},set(b,w,v){ji("[Slide] freezer: add",b,Ya(this.queue)),this.map.set(b,w),this.boxes.set(b,v),this.queue.includes(b)||this.queue.unshift(b),this.validateQueue()},delete(b){this.map.delete(b),this.boxes.delete(b),this.queue=this.queue.filter(w=>w!==b),ji("[Slide] freezer: delete",b,Ya(this.queue))},focus(b){const w=this.map.get(b),v=this.queue.indexOf(b);v>-1&&this.queue.splice(v,1),this.queue.unshift(b),this.validateQueue(),ji("[Slide] freezer: focus",b,Ya(this.queue)),w&&w.unfreeze()}},Oc=new Set;function Lw(b){return Oc.add(b),()=>Oc.delete(b)}const Nc=new Set;function Dw(b){return Nc.add(b),()=>Nc.delete(b)}const Fw=b=>{Pc=!0,b.on("focus",({appId:w})=>{Th.focus(w)}),b.on("created",({appId:w})=>{Oc.forEach(v=>v(w))}),b.on("destroy",({appId:w})=>{Nc.forEach(v=>v(w))})};var Kv=(()=>`.netless-app-slide-content{position:relative;height:100%;overflow:hidden}.netless-app-slide-preview-mask{display:none;position:absolute;z-index:200;top:0;left:0;width:100%;height:100%}.netless-app-slide-preview{display:flex;flex-direction:column;align-items:center;position:absolute;z-index:300;top:0;left:0;width:33%;max-width:200px;height:100%;padding-top:10px;transform:translate(-100%);background:rgba(237,237,240,.9);box-shadow:inset -1px 0 #0000001c;transition:transform .4s}.netless-app-slide-preview-active .netless-app-slide-preview-mask{display:block}.netless-app-slide-preview-active .netless-app-slide-preview{transform:translate(0)}.netless-app-slide-preview-page{position:relative;display:block;width:55%;margin-bottom:10px;font-size:0;color:transparent;outline:none;border:7px solid transparent;border-radius:4px;transition:border-color .3s;user-select:none}.netless-app-slide-preview-page:hover,.netless-app-slide-preview-page.netless-app-slide-preview-page-active{border-color:#444e601a}.netless-app-slide-preview-page>img{width:100%;height:auto;box-sizing:border-box;border:1px solid rgba(0,0,0,.5);border-radius:1px;background-color:#fff;box-shadow:0 2px 8px #0000004d}.netless-app-slide-preview-page-name{position:absolute;top:1px;left:-10px;transform:translate(-100%);text-align:right;font-size:12px;color:#5f5f5f;user-select:none}.netless-app-slide-footer{box-sizing:border-box;height:26px;display:flex;align-items:center;padding:0 16px;border-top:1px solid #eeeef7;color:#191919}.netless-app-slide-float-footer{width:100%;min-height:26px;position:absolute;left:0;bottom:0;z-index:2000;background:rgba(249,249,252,.9);transition:opacity .4s}.netless-app-slide-footer-btn{box-sizing:border-box;width:26px;height:26px;font-size:0;margin:0;padding:3px;border:none;border-radius:1px;outline:none;color:currentColor;background:transparent;transition:background .4s;cursor:pointer;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-slide-footer-btn:hover{background:rgba(237,237,240,.9)}@media (hover: none){.netless-app-slide-footer-btn:hover{background:transparent!important}}.netless-app-slide-footer-btn>svg{width:100%;height:100%}.netless-app-slide-footer-btn>svg:nth-of-type(2){display:none}.netless-app-slide-footer-btn.netless-app-slide-footer-btn-playing>svg:nth-of-type(1){display:none}.netless-app-slide-footer-btn.netless-app-slide-footer-btn-playing>svg:nth-of-type(2){display:initial}.netless-app-slide-footer-btn~.netless-app-slide-footer-btn{margin-left:15px}.netless-app-slide-page-jumps{flex:1;display:flex;justify-content:center;align-items:center}.netless-app-slide-page-number{margin-left:auto;font-size:13px;user-select:none;white-space:nowrap;word-break:keep-all}.netless-app-slide-page-number-input{border:none;outline:none;width:3em;margin:0;padding:0 2px;text-align:right;font-size:13px;line-height:1;font-weight:400;font-family:inherit;border-radius:2px;color:currentColor;background:transparent;transition:background .4s;user-select:text;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-slide-page-number-input:hover,.netless-app-slide-page-number-input:focus,.netless-app-slide-page-number-input:active{background:#fff;box-shadow:#63636333 0 2px 8px}.netless-app-slide-readonly.netless-app-slide-footer{display:none}.telebox-color-scheme-dark .netless-app-slide-page-number-input{color:#a6a6a8}.telebox-color-scheme-dark .netless-app-slide-page-number-input:active,.telebox-color-scheme-dark .netless-app-slide-page-number-input:focus,.telebox-color-scheme-dark .netless-app-slide-page-number-input:hover{color:#222}.telebox-color-scheme-dark .netless-app-slide-footer{color:#a6a6a8;background:#2d2d33;border-top:none}.telebox-color-scheme-dark .netless-app-slide-footer-btn:hover{background:#212126}.telebox-color-scheme-dark .netless-app-slide-preview{background:rgba(50,50,50,.9)}.netless-app-slide-wb-view{position:absolute;top:0;left:0;width:100%;height:100%;z-index:100;overflow:hidden;transition:opacity .1s}.netless-app-slide-wb-view-hidden{opacity:0}.netless-app-slide-overlay{display:flex;align-items:center;justify-content:center;position:absolute;z-index:200;top:0;left:0;width:100%;height:100%;padding:8px;background:rgba(255,0,0,.25);transition:opacity .3s;opacity:0;pointer-events:none}.netless-app-slide-slide{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.netless-app-slide-slide canvas{transform:scale(var(--netless-app-slide-scale, 1))}
|
|
7955
|
+
`)();function Bw({container:b,taskId:w,url:v=Dc,debug:O=!1}){if(!w)throw new Error("[Slide] taskId is required");b.style.cssText+="display:flex;flex-direction:column";const M=new Zv({target:b});return M.debug=!!O,M.mount(w,v),M}class Zv{constructor(w){this.slide=null,this.debug=!1,this.sideEffect=new Ka,this.ready=!1,this.readyPromise=new Promise(v=>{this.resolveReady=()=>{this.ready=!0,v()}}),this.hotkeyListener=v=>{if(this.slide)switch(v.key){case"ArrowUp":case"ArrowLeft":{this.slide.prevStep();break}case"ArrowRight":case"ArrowDown":{this.slide.nextStep();break}}},this.onPageChanged=v=>{this.viewer.setPageIndex(v-1)},this.onTransitionStart=()=>{this.viewer.setPlaying()},this.onTransitionEnd=()=>{this.viewer.setPaused()},this.onError=({error:v})=>{this.viewer.setPaused(),console.warn("[Slide] render error",v)},this.destroyed=!1,this.refreshPages=()=>{this.slide&&(this.viewer.pages=xv(this.slide),this.viewer.setPageIndex(this.getPageIndex(this.slide.slideState.currentSlideIndex)))},this.onPlay=()=>{this.slide&&this.slide.nextStep()},this.onNewPageIndex=v=>{this.slide&&this.slide.slideCount>0&&this.slide.renderSlide(pv(v+1,1,this.slide.slideCount))},this.namespace="netless-app-slide",this.target=w.target,this.bgColor=yv(this.target),this.viewer=new Jv({readonly:!1,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay}),this.render()}render(){this.viewer.$content.appendChild(this.renderSlideContainer()),this.registerHotKeys(window)}registerHotKeys(w){this.sideEffect.addEventListener(w,"keydown",this.hotkeyListener,void 0,"hotkey")}mount(w,v){this.target.appendChild(this.renderStyle()),this.target.appendChild(this.viewer.$content),this.target.appendChild(this.viewer.$footer),this.slide=new li.Slide({anchor:this.$slide,interactive:!0,mode:"local",controller:this.debug,enableGlobalClick:!0,renderOptions:{minFPS:25,maxFPS:30,autoFPS:!0,autoResolution:!0,transactionBgColor:this.bgColor}}),this.registerEventListeners(),this.slide.setResource(w,v),this.slide.renderSlide(1)}renderStyle(){const w=document.createElement("style");return w.appendChild(document.createTextNode(Kv)),w}registerEventListeners(){if(!this.slide)return;const{slide:w}=this;w.on(li.SLIDE_EVENTS.slideChange,this.onPageChanged),w.on(li.SLIDE_EVENTS.renderStart,this.onTransitionStart),w.on(li.SLIDE_EVENTS.renderEnd,this.onTransitionEnd),w.on(li.SLIDE_EVENTS.mainSeqStepStart,this.onTransitionStart),w.on(li.SLIDE_EVENTS.mainSeqStepEnd,this.onTransitionEnd),w.on(li.SLIDE_EVENTS.renderError,this.onError),w.on(li.SLIDE_EVENTS.renderEnd,this.resolveReady),this.readyPromise.then(this.refreshPages)}destroy(){this.sideEffect.flushAll(),this.slide&&!this.destroyed&&(this.slide.destroy(),this.destroyed=!0),this.viewer.destroy()}getPageIndex(w){return(w>0?w:1)-1}renderSlideContainer(){if(!this.$slide){const w=document.createElement("div");w.className=this.wrapClassName("slide"),w.dataset.appKind="Slide",this.$slide=w}return this.$slide}wrapClassName(w){return`${this.namespace}-${w}`}}const Uw=li.Slide.usePlugin.bind(li.Slide),Lc="0.2.45-alpha.2",kw={kind:"Slide",setup(b){var W;if(console.log("[Slide] setup @ "+Lc),b.getIsWritable()&&b.storage.ensureState(Rc),!b.storage.state.taskId)throw new Error("[Slide] no taskId");const w=b.getView();if(!w)throw new Error("[Slide] no view, please set scenePath on addApp()");w.disableCameraTransform=!0;const v=b.getBox();v.mountStyles(Kv);try{v.$content.dataset.appSlideVersion=Lc}catch{}const O=b.getInitScenePath();let M=null;const I=X=>{const et=b.getRoom();if(M&&M.slideController){let ft=!1;et&&b.getIsWritable()&&(sv(et,b,M.slideController.slide,O),ft=!0),ji("[Slide] page to",X,ft?"(synced)":""),M.viewer.setPageIndex(X-1),M.onPageChanged()}},D=X=>{const et=b.getAppOptions()||{},ft=new vS(iv(Ac({context:b},X),{onPageChanged:I,onRenderError:et.onRenderError,showRenderError:et.showRenderError}));return Pc&&Th.set(b.appId,ft,v),Nr.setAppController(b.appId,ft),ft.readyPromise.then(X.onReady).then(()=>{const Dt=b.getRoom();let At=!1;Dt&&b.getIsWritable()&&(sv(Dt,b,ft.slide,O),At=!0);const L=ft.slide.slideState.currentSlideIndex;ji("[Slide] page to",L,At?"(synced)":"","(on ready)"),ft.slide.on("renderEnd",X.onRenderEnd)}),ft};M=new Pw({box:v,view:w,mountSlideController:D,mountWhiteboard:b.mountView.bind(b),baseScenePath:O,appId:b.appId,urlInterrupter:(W=b.getAppOptions())==null?void 0:W.urlInterrupter});const k=b.getRoom(),V=new Ka;return V.add(()=>{var X;return Nr.setAppContext(b.appId,b),Nr.enable=((X=b.getAppOptions())==null?void 0:X.debug)||!1,Nr.level="debug",()=>Nr.deleteApp(b.appId)}),k&&(M.toggleClickThrough(k.state.memberState.currentApplianceName),V.add(()=>{const X=et=>{et.memberState&&M&&M.toggleClickThrough(et.memberState.currentApplianceName)};return k.callbacks.on("onRoomStateChanged",X),()=>k.callbacks.off("onRoomStateChanged",X)})),b.emitter.on("destroy",()=>{ji("[Slide] destroy",b.appId),Pc&&Th.delete(b.appId),V.flushAll(),M&&(M.destroy(),M=null)}),M.mount(),{viewer:()=>M,controller:()=>M==null?void 0:M.slideController,slide:()=>{var X;return(X=M==null?void 0:M.slideController)==null?void 0:X.slide},nextStep:()=>{var X;return M&&M.slideController?((X=M==null?void 0:M.slideController)==null||X.slide.nextStep(),!0):!1},prevStep:()=>{var X;return M&&M.slideController?((X=M==null?void 0:M.slideController)==null||X.slide.prevStep(),!0):!1},position:()=>{const X=M==null?void 0:M.slideController;if(X)return[X.page,X.pageCount]},nextPage:()=>{const X=M==null?void 0:M.slideController;if(X){const{page:et,pageCount:ft}=X;if(ft>0&&et<ft)return X.jumpToPage(et+1),!0}return!1},prevPage:()=>{const X=M==null?void 0:M.slideController;if(X){const{page:et,pageCount:ft}=X;if(ft>0&&et>1)return X.jumpToPage(et-1),!0}return!1},jumpToPage:X=>{const et=M==null?void 0:M.slideController;if(et){const{page:ft,pageCount:Dt}=et;if(Dt>0&&ft>0&&ft<=Dt)return et.jumpToPage(X),!0}return!1}}}};exports.DefaultUrl=Dc;exports.Slide=li.Slide;exports.SlidePreviewer=Zv;exports.addHooks=Fw;exports.apps=Th;exports.default=kw;exports.getFreezerLength=Ow;exports.onCreated=Lw;exports.onDestroyed=Dw;exports.previewSlide=Bw;exports.setFreezerLength=Nw;exports.usePlugin=Uw;exports.version=Lc;
|
|
7956
7956
|
//# sourceMappingURL=main.cjs.js.map
|