@eturnity/eturnity_3d 7.20.1 → 7.24.0
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/package.json +2 -2
- package/src/EventManager/EventManager.js +48 -0
- package/src/Item/Item.js +12 -0
- package/src/Layer/Layer.js +119 -0
- package/src/Overlay/AirTeamOverlay.js +605 -0
- package/src/Overlay/ImageOverlay.js +309 -0
- package/src/Overlay/Overlay.js +255 -0
- package/src/Overlay/OverlayFactory.js +19 -0
- package/src/Overlay/OverlayLayer.js +36 -0
- package/src/components/ThreeCanvasViewer.vue +17 -6
- package/src/config.js +120 -17
- package/src/helper/UpdateRoofModuleFieldRelations.js +65 -25
- package/src/helper/cameraMixin.js +25 -0
- package/src/helper/materialMixin.js +14 -1
- package/src/helper/projectedMaterial.js +662 -0
- package/src/helper/render/base.js +5 -5
- package/src/helper/render/clear.js +0 -17
- package/src/helper/render/edge.js +2 -0
- package/src/helper/render/geometryHandler.js +60 -31
- package/src/helper/render/imageOverlay.js +25 -144
- package/src/helper/render/index.js +2 -0
- package/src/helper/render/mergedGeometry.js +11 -2
- package/src/helper/render/obstacle.js +2 -1
- package/src/helper/render/overlay.js +41 -0
- package/src/helper/render/projectionMaterial.js +17 -19
- package/src/helper/render/roof.js +49 -52
- package/src/helper/render/texture.js +25 -0
- package/src/helper/render/tile.js +84 -24
- package/src/helper/render/tileProjection.js +23 -14
- package/src/helper/renderMixin.js +22 -8
- package/src/helper/threeMixin.js +5 -2
- package/src/store/hydrateData.js +23 -11
- package/src/store/nodesEdgesCreation.js +78 -4
- package/src/store/three-d-module.js +1 -1
- package/dist/css/app.58568098.css +0 -1
- package/dist/img/reneSola_Virtus_2_JC320S_24_Bbw.85a0cb6d.png +0 -0
- package/dist/index.html +0 -15
- package/dist/js/app-legacy.aa792c98.js +0 -2
- package/dist/js/app-legacy.aa792c98.js.map +0 -1
- package/dist/js/chunk-vendors-legacy.9bb3863d.js +0 -41
- package/dist/js/chunk-vendors-legacy.9bb3863d.js.map +0 -1
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
(self["webpackChunk_eturnity_eturnity_3d"]=self["webpackChunk_eturnity_eturnity_3d"]||[]).push([[504],{476:function(t,e,n){"use strict";n.d(e,{N1:function(){return B},bR:function(){return U},tS:function(){return de},xt:function(){return y},Ee:function(){return ee},Bd:function(){return _},_6:function(){return Et},JV:function(){return Lt},dF:function(){return Yt},Q8:function(){return le},y2:function(){return ne},bZ:function(){return be},Fp:function(){return zt},oK:function(){return Dt},OY:function(){return Nt},RU:function(){return kt},DP:function(){return Wt},zu:function(){return f},VN:function(){return b},hF:function(){return E},T2:function(){return x},U8:function(){return g},Nd:function(){return ue},xj:function(){return $t}});const i={colors:{primary:"#282387",secondary:"#818181",tertiary:"#d5d5d5",black:"#263238",yellow:"#fdb813",darkGray:"#818181",mediumGray:"#d5d5d5",lightGray:"#f2f2f2",white:"#ffffff",blue:"#48a2d0",brightBlue:"#0068DE",ballBlue:"#2CC0EB",red:"#FF5656",blue1:"#e4efff",blue2:"#F6FAFF",grey1:"#666",grey2:"#c4c4c4",grey3:"#b2b9c5",grey4:"#dee2eb",grey5:"#fafafa",grey6:"#555d61",turquoise:"#20A4CA",green:"#99db0c",purple:"#505ca6",disabled:"#dfe1e1",transparentWhite1:"#ffffff32",transparentBlack1:"#263238e6",transparentBlue1:"#20a4cae6",blueElectric:"#66dffa",eturnityGrey:"#263238"},screen:{mobileSmall:"345px",mobile:"425px",mobileLarge:"530px",tablet:"768px",tabletLarge:"950px"},borderRadius:"4px"};var r=i;const o=1,a=6371008,s=(r.colors.blueElectric,r.colors.red,r.colors.blue,r.colors.blue,r.colors.blue,r.colors.blue,r.colors.blue,r.colors.blue,r.colors.blueElectric,r.colors.blueElectric,500),l=3e3,u=["#FF5656","#FDB813","#505CA6","#C84E4E","#8392EE","#6CD5D5","#90A650","#D27CCA","#6276DF"];u.map((t=>t+"c0")),Math.exp(Math.log(2)/10);function h(t,e){return Math.floor((t+180)/360*Math.pow(2,e))}function c(t,e){return Math.floor((1-Math.log(Math.tan(t*Math.PI/180)+1/Math.cos(t*Math.PI/180))/Math.PI)/2*Math.pow(2,e))}function d(t,e){return t/Math.pow(2,e)*360-180}function p(t,e){var n=Math.PI-2*Math.PI*t/Math.pow(2,e);return 180/Math.PI*Math.atan(.5*(Math.exp(n)-Math.exp(-n)))}function f(t,e,n){const i=h(e,n),r=c(t,n);return{x:i,y:r}}function m(t,e,n){const i=d(t,n),r=p(e,n);return{lat:r,lng:i}}function g(t,e,n,i,r){const o=0,s=m(t,e,n),l=s.lat-i,u=s.lng-r;let{x:h,y:c}=v(l,u,i),d=2e3*a*Math.PI/Math.pow(2,n)*Math.cos(i*Math.PI/180),p={x:h,y:c,z:o},f={x:h+d,y:c,z:o},g={x:h+d,y:c-d,z:o},_={x:h,y:c-d,z:o};return[_,p,f,g]}function _(t,e,n){let i=180/Math.PI*(e/1e3)/a,r=180/Math.PI*(t/1e3)/a/Math.cos(n*Math.PI/180);return{lat:i,lng:r}}function v(t,e,n){let i=a*t*1e3/(180/Math.PI),r=a*e*1e3*Math.cos(n*Math.PI/180)/(180/Math.PI);return{x:r,y:i}}function y(t,e){const n={};return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n}function x(t,e){const n={};return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n}function b(t,e){const n={};return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n}function M(t,e){const n=t.x*e.x+t.y*e.y+t.z*e.z;return n}function w(t,e){const n={};return n.x=t.y*e.z-t.z*e.y,n.y=t.z*e.x-t.x*e.z,n.z=t.x*e.y-t.y*e.x,n}function S(t){let e={},n={x:0,y:0,z:0};return t.forEach((t=>{n=y(n,t)})),e=b(1/t.length,n),e}function T(t){return Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z)}function E(t){let e=T(t);return 0==e?t:b(1/e,t)}function P(t){let[[e,n,i],[r,o,a],[s,l,u]]=t,h=o*u-l*a,c=a*s-r*u,d=r*l-s*o,p=e*h+n*c+i*d;return 0!=p?[[h,i*l-n*u,n*a-i*o],[c,e*u-i*s,r*i-e*a],[d,s*n-e*l,e*o-r*n]].map((t=>t.map((t=>t/p)))):null}function L(t,e){if(!Array.isArray(t)||!Array.isArray(e)||!t.length||!e.length)throw new Error("arguments should be in 2-dimensional array format");let n=t.length,i=t[0].length,r=e[0].length;if(e.length!==i)throw new Error("number of columns in the first matrix should be the same as the number of rows in the second");let o=Array.apply(null,new Array(r)).map(Number.prototype.valueOf,0),a=new Array(n);for(let s=0;s<n;s++)a[s]=o.slice();for(let s=0;s<n;s++)for(let n=0;n<r;n++)for(let r=0;r<i;r++)a[s][n]+=t[s][r]*e[r][n];return a}const A="undefined"!==typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);var C={randomUUID:A};let R;const I=new Uint8Array(16);function D(){if(!R&&(R="undefined"!==typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!R))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return R(I)}const O=[];for(let Se=0;Se<256;++Se)O.push((Se+256).toString(16).slice(1));function z(t,e=0){return(O[t[e+0]]+O[t[e+1]]+O[t[e+2]]+O[t[e+3]]+"-"+O[t[e+4]]+O[t[e+5]]+"-"+O[t[e+6]]+O[t[e+7]]+"-"+O[t[e+8]]+O[t[e+9]]+"-"+O[t[e+10]]+O[t[e+11]]+O[t[e+12]]+O[t[e+13]]+O[t[e+14]]+O[t[e+15]]).toLowerCase()}function N(t,e,n){if(C.randomUUID&&!e&&!t)return C.randomUUID();t=t||{};const i=t.random||(t.rng||D)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+t]=i[t];return e}return z(i)}var k=N;class U{constructor(t=0,e=0,n=0,i=null){this.id=k(),this.type="point",this.version=0,this.x=t,this.y=e,this.z=n,this.layer=i,this.open=!1,this.selected=!1,this.visible=!0,this.hasWarning=!1}getIntersections(t){const e=[];if(t)return"line"==t.type?It(t.getProjectedPoint(this),this)&&e.push({...this}):"point"==t.type?It(t,this)&&e.push({...t}):"circle"==t.type&&At(this,t.center)==t.radius&&e.push({...this}),e}getPxDistanceTo(t,e){const n=e.toRealityRef,i=n(t);return Lt(i,this)/e.mmPerPx}getProjectedPoint(t){return this}getVerticalProjectedPoint(t){return this}getDistanceToPoint(t){return At(t,this.getProjectedPoint(t))}getHorizontalDistanceToPoint(t){return Lt(t,this.getVerticalProjectedPoint(t))}isInPlane(t){if(!t)return!1;const{point:e,normalVector:n}=t;return!(M(x(e,this),n)>.1)}translate(t){let e=Zt({x:this.x,y:this.y},t);this.x=e.x,this.y=e.y}serialize(){this.belongsTo||(this.belongsTo=[]);const t=this.belongsTo.map((t=>({polygon:t.polygon.serialize(),polygonId:t.polygonId,index:t.index})));return{x:this.x,y:this.y,z:this.z,layer:this.layer,type:this.type,belongsTo:t||[],itemType:this.itemType}}}class B{constructor(t,e,n,i=!1){this.id=k(),this.version=0,this.type="line",this.outline=t&&e?[t,e]:[],this.layer=n,this.visible=!0,this.infiniteLine=i}clone(){const t=new B;return this.outline.forEach((e=>{t.outline.push(new U(e.x,e.y,e.z))})),t.id=k(),t.layer=this.layer,t.infiniteLine=this.infiniteLine,t}getDirectionVector(){return E(x(this.outline[1],this.outline[0]))}getIntersections(t){const e=[];if(t){if("point"==t.type)It(this.getProjectedPoint(t),t)&&e.push({...t});else if("line"==t.type){const n=Pt(this.outline[0],this.getDirectionVector(),t.outline[0],t.getDirectionVector());if(!n)return[];let{distance:i,N:r}=n;i<.1&&r&&e.push({...r})}else if("circle"==t.type){let n=this.getProjectedPoint(t.center),i=At(n,t.center);if(i<=t.radius){let r=y(n,b(Math.sqrt(Math.pow(t.radius,2)-Math.pow(i,2)),this.getDirectionVector())),o=y(n,b(-Math.sqrt(Math.pow(t.radius,2)-Math.pow(i,2)),this.getDirectionVector()));e.push({...r}),e.push({...o})}}return e}}pxLength(t){return Lt(this.outline[0],this.outline[1])/t.mmPerPx}mmLength(){return At(this.outline[0],this.outline[1])}getMidPoint(){return Rt(this.outline[0],this.outline[1])}getAngleDeg(){const t=Math.atan2(this.outline[1].y-this.outline[0].y,this.outline[0].x-this.outline[1].x);return 180*t/Math.PI}getPxDistanceTo(t,e){e.toCanvasRef;const n=e.toRealityRef;if(this.outline.length<2)return console.error("line undefined"),null;if(It(this.outline[0],this.outline[1]))return console.error("line undefined"),null;let i=n(t),r={x:this.outline[0].x,y:this.outline[0].y,z:0},o={x:this.outline[1].x,y:this.outline[1].y,z:0},a={x:i.x,y:i.y,z:0},s=jt(a,r,o);return s.z=0,this.infiniteLine||Xt(s,r,o)?Lt(a,s)/e.mmPerPx:Math.min(Lt(a,r),Lt(a,o))/e.mmPerPx}isInPlane(t){if(!t)return!1;const{point:e,normalVector:n}=t;return!(M(this.getDirectionVector(),n)>.1)&&!(M(E(x(e,this.outline[0])),n)>.1)}includesPoint2D(t,e){const n=this.getVerticalProjectedPoint(t);return this.getHorizontalDistanceToPoint(t)<e&&Xt(n,this.outline[0],this.outline[1])}getDistanceToPoint(t){return At(t,this.getProjectedPoint(t))}getHorizontalDistanceToPoint(t){return Lt(t,this.getVerticalProjectedPoint(t))}getVerticalProjectedPoint(t){if(0==this.outline.length)return null;if(It(this.outline[0],this.outline[1]))return console.error("A == B Can't project point on Line"),null;let e={...this.outline[0],z:0},n={...this.outline[1],z:0},i=jt({...t,z:0},e,n),r=x(i,e),o=x(n,e),a=M(r,o)/M(o,o),s=this.outline[0].z+a*(this.outline[1].z-this.outline[0].z);return i.z=s,i}getProjectedPoint(t){if(0==this.outline.length)return null;if(It(this.outline[0],this.outline[1]))return console.error("A == B Can't project point on Line"),null;let e=jt(t,this.outline[0],this.outline[1]);return e}translate(t){this.outline=this.outline.map((e=>Zt(e,t)))}serialize(){this.belongsTo||(this.belongsTo=[]);const t=this.belongsTo.map((t=>({polygon:t.polygon.serialize(),polygonId:t.polygonId,index:t.index}))),e={outline:[this.outline[0],this.outline[1]],layer:this.layer,type:this.type,belongsTo:t||[],itemType:this.itemType};return JSON.parse(JSON.stringify(e))}}var F=n(341),V=n.n(F);class H{constructor(t=[],e=W){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let n=(this.length>>1)-1;n>=0;n--)this._down(n)}push(t){this.data.push(t),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;const t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:n}=this,i=e[t];while(t>0){const r=t-1>>1,o=e[r];if(n(i,o)>=0)break;e[t]=o,t=r}e[t]=i}_down(t){const{data:e,compare:n}=this,i=this.length>>1,r=e[t];while(t<i){let i=1+(t<<1),o=e[i];const a=i+1;if(a<this.length&&n(e[a],o)<0&&(i=a,o=e[a]),n(o,r)>=0)break;e[t]=o,t=i}e[t]=r}}function W(t,e){return t<e?-1:t>e?1:0}var G=n(95),j=n.n(G);const Z=11102230246251565e-32,q=134217729,X=(3+8*Z)*Z;function Y(t,e,n,i,r){let o,a,s,l,u=e[0],h=i[0],c=0,d=0;h>u===h>-u?(o=u,u=e[++c]):(o=h,h=i[++d]);let p=0;if(c<t&&d<n){h>u===h>-u?(a=u+o,s=o-(a-u),u=e[++c]):(a=h+o,s=o-(a-h),h=i[++d]),o=a,0!==s&&(r[p++]=s);while(c<t&&d<n)h>u===h>-u?(a=o+u,l=a-o,s=o-(a-l)+(u-l),u=e[++c]):(a=o+h,l=a-o,s=o-(a-l)+(h-l),h=i[++d]),o=a,0!==s&&(r[p++]=s)}while(c<t)a=o+u,l=a-o,s=o-(a-l)+(u-l),u=e[++c],o=a,0!==s&&(r[p++]=s);while(d<n)a=o+h,l=a-o,s=o-(a-l)+(h-l),h=i[++d],o=a,0!==s&&(r[p++]=s);return 0===o&&0!==p||(r[p++]=o),p}function K(t,e){let n=e[0];for(let i=1;i<t;i++)n+=e[i];return n}function J(t){return new Float64Array(t)}const $=(3+16*Z)*Z,Q=(2+12*Z)*Z,tt=(9+64*Z)*Z*Z,et=J(4),nt=J(8),it=J(12),rt=J(16),ot=J(4);function at(t,e,n,i,r,o,a){let s,l,u,h,c,d,p,f,m,g,_,v,y,x,b,M,w,S;const T=t-r,E=n-r,P=e-o,L=i-o;x=T*L,d=q*T,p=d-(d-T),f=T-p,d=q*L,m=d-(d-L),g=L-m,b=f*g-(x-p*m-f*m-p*g),M=P*E,d=q*P,p=d-(d-P),f=P-p,d=q*E,m=d-(d-E),g=E-m,w=f*g-(M-p*m-f*m-p*g),_=b-w,c=b-_,et[0]=b-(_+c)+(c-w),v=x+_,c=v-x,y=x-(v-c)+(_-c),_=y-M,c=y-_,et[1]=y-(_+c)+(c-M),S=v+_,c=S-v,et[2]=v-(S-c)+(_-c),et[3]=S;let A=K(4,et),C=Q*a;if(A>=C||-A>=C)return A;if(c=t-T,s=t-(T+c)+(c-r),c=n-E,u=n-(E+c)+(c-r),c=e-P,l=e-(P+c)+(c-o),c=i-L,h=i-(L+c)+(c-o),0===s&&0===l&&0===u&&0===h)return A;if(C=tt*a+X*Math.abs(A),A+=T*h+L*s-(P*u+E*l),A>=C||-A>=C)return A;x=s*L,d=q*s,p=d-(d-s),f=s-p,d=q*L,m=d-(d-L),g=L-m,b=f*g-(x-p*m-f*m-p*g),M=l*E,d=q*l,p=d-(d-l),f=l-p,d=q*E,m=d-(d-E),g=E-m,w=f*g-(M-p*m-f*m-p*g),_=b-w,c=b-_,ot[0]=b-(_+c)+(c-w),v=x+_,c=v-x,y=x-(v-c)+(_-c),_=y-M,c=y-_,ot[1]=y-(_+c)+(c-M),S=v+_,c=S-v,ot[2]=v-(S-c)+(_-c),ot[3]=S;const R=Y(4,et,4,ot,nt);x=T*h,d=q*T,p=d-(d-T),f=T-p,d=q*h,m=d-(d-h),g=h-m,b=f*g-(x-p*m-f*m-p*g),M=P*u,d=q*P,p=d-(d-P),f=P-p,d=q*u,m=d-(d-u),g=u-m,w=f*g-(M-p*m-f*m-p*g),_=b-w,c=b-_,ot[0]=b-(_+c)+(c-w),v=x+_,c=v-x,y=x-(v-c)+(_-c),_=y-M,c=y-_,ot[1]=y-(_+c)+(c-M),S=v+_,c=S-v,ot[2]=v-(S-c)+(_-c),ot[3]=S;const I=Y(R,nt,4,ot,it);x=s*h,d=q*s,p=d-(d-s),f=s-p,d=q*h,m=d-(d-h),g=h-m,b=f*g-(x-p*m-f*m-p*g),M=l*u,d=q*l,p=d-(d-l),f=l-p,d=q*u,m=d-(d-u),g=u-m,w=f*g-(M-p*m-f*m-p*g),_=b-w,c=b-_,ot[0]=b-(_+c)+(c-w),v=x+_,c=v-x,y=x-(v-c)+(_-c),_=y-M,c=y-_,ot[1]=y-(_+c)+(c-M),S=v+_,c=S-v,ot[2]=v-(S-c)+(_-c),ot[3]=S;const D=Y(I,it,4,ot,rt);return rt[D-1]}function st(t,e,n,i,r,o){const a=(e-o)*(n-r),s=(t-r)*(i-o),l=a-s,u=Math.abs(a+s);return Math.abs(l)>=$*u?l:-at(t,e,n,i,r,o,u)}J(4),J(4),J(4),J(4),J(4),J(4),J(4),J(4),J(4),J(8),J(8),J(8),J(4),J(8),J(8),J(8),J(12);J(192),J(192);J(4),J(4),J(4),J(4),J(4),J(4),J(4),J(4),J(8),J(8),J(8),J(8),J(8),J(8),J(8),J(8),J(8),J(4),J(4),J(4),J(8),J(16),J(16),J(16),J(32),J(32),J(48),J(64);J(1152),J(1152);J(4),J(4),J(4),J(4),J(4),J(4),J(4),J(4),J(4),J(4),J(24),J(24),J(24),J(24),J(24),J(24),J(24),J(24),J(24),J(24),J(1152),J(1152),J(1152),J(1152),J(1152),J(2304),J(2304),J(3456),J(5760),J(8),J(8),J(8),J(16),J(24),J(48),J(48),J(96),J(192),J(384),J(384),J(384),J(768);J(96),J(96),J(96),J(1152);function lt(t,e,n){e=Math.max(0,void 0===e?2:e),n=n||0;var i=_t(t),r=new(V())(16);r.toBBox=function(t){return{minX:t[0],minY:t[1],maxX:t[0],maxY:t[1]}},r.compareMinX=function(t,e){return t[0]-e[0]},r.compareMinY=function(t,e){return t[1]-e[1]},r.load(t);for(var o,a=[],s=0;s<i.length;s++){var l=i[s];r.remove(l),o=vt(l,o),a.push(o)}var u=new(V())(16);for(s=0;s<a.length;s++)u.insert(gt(a[s]));var h=e*e,c=n*n;while(a.length){var d=a.shift(),p=d.p,f=d.next.p,m=yt(p,f);if(!(m<c)){var g=m/h;l=ut(r,d.prev.p,p,f,d.next.next.p,g,u),l&&Math.min(yt(l,p),yt(l,f))<=g&&(a.push(d),a.push(vt(l,d)),r.remove(l),u.remove(d),u.insert(gt(d)),u.insert(gt(d.next)))}}d=o;var _=[];do{_.push(d.p),d=d.next}while(d!==o);return _.push(d.p),_}function ut(t,e,n,i,r,o,a){var s=new H([],ht),l=t.data;while(l){for(var u=0;u<l.children.length;u++){var h=l.children[u],c=l.leaf?xt(h,n,i):ct(n,i,h);c>o||s.push({node:h,dist:c})}while(s.length&&!s.peek().node.children){var d=s.pop(),p=d.node,f=xt(p,e,n),m=xt(p,i,r);if(d.dist<f&&d.dist<m&&pt(n,p,a)&&pt(i,p,a))return p}l=s.pop(),l&&(l=l.node)}return null}function ht(t,e){return t.dist-e.dist}function ct(t,e,n){if(dt(t,n)||dt(e,n))return 0;var i=bt(t[0],t[1],e[0],e[1],n.minX,n.minY,n.maxX,n.minY);if(0===i)return 0;var r=bt(t[0],t[1],e[0],e[1],n.minX,n.minY,n.minX,n.maxY);if(0===r)return 0;var o=bt(t[0],t[1],e[0],e[1],n.maxX,n.minY,n.maxX,n.maxY);if(0===o)return 0;var a=bt(t[0],t[1],e[0],e[1],n.minX,n.maxY,n.maxX,n.maxY);return 0===a?0:Math.min(i,r,o,a)}function dt(t,e){return t[0]>=e.minX&&t[0]<=e.maxX&&t[1]>=e.minY&&t[1]<=e.maxY}function pt(t,e,n){for(var i=Math.min(t[0],e[0]),r=Math.min(t[1],e[1]),o=Math.max(t[0],e[0]),a=Math.max(t[1],e[1]),s=n.search({minX:i,minY:r,maxX:o,maxY:a}),l=0;l<s.length;l++)if(mt(s[l].p,s[l].next.p,t,e))return!1;return!0}function ft(t,e,n){return st(t[0],t[1],e[0],e[1],n[0],n[1])}function mt(t,e,n,i){return t!==i&&e!==n&&ft(t,e,n)>0!==ft(t,e,i)>0&&ft(n,i,t)>0!==ft(n,i,e)>0}function gt(t){var e=t.p,n=t.next.p;return t.minX=Math.min(e[0],n[0]),t.minY=Math.min(e[1],n[1]),t.maxX=Math.max(e[0],n[0]),t.maxY=Math.max(e[1],n[1]),t}function _t(t){for(var e=t[0],n=t[0],i=t[0],r=t[0],o=0;o<t.length;o++){var a=t[o];a[0]<e[0]&&(e=a),a[0]>i[0]&&(i=a),a[1]<n[1]&&(n=a),a[1]>r[1]&&(r=a)}var s=[e,n,i,r],l=s.slice();for(o=0;o<t.length;o++)j()(t[o],s)||l.push(t[o]);return wt(l)}function vt(t,e){var n={p:t,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return e?(n.next=e.next,n.prev=e,e.next.prev=n,e.next=n):(n.prev=n,n.next=n),n}function yt(t,e){var n=t[0]-e[0],i=t[1]-e[1];return n*n+i*i}function xt(t,e,n){var i=e[0],r=e[1],o=n[0]-i,a=n[1]-r;if(0!==o||0!==a){var s=((t[0]-i)*o+(t[1]-r)*a)/(o*o+a*a);s>1?(i=n[0],r=n[1]):s>0&&(i+=o*s,r+=a*s)}return o=t[0]-i,a=t[1]-r,o*o+a*a}function bt(t,e,n,i,r,o,a,s){var l,u,h,c,d=n-t,p=i-e,f=a-r,m=s-o,g=t-r,_=e-o,v=d*d+p*p,y=d*f+p*m,x=f*f+m*m,b=d*g+p*_,M=f*g+m*_,w=v*x-y*y,S=w,T=w;0===w?(u=0,S=1,c=M,T=x):(u=y*M-x*b,c=v*M-y*b,u<0?(u=0,c=M,T=x):u>S&&(u=S,c=M+y,T=x)),c<0?(c=0,-b<0?u=0:-b>v?u=S:(u=-b,S=v)):c>T&&(c=T,-b+y<0?u=0:-b+y>v?u=S:(u=-b+y,S=v)),l=0===u?0:u/S,h=0===c?0:c/T;var E=(1-l)*t+l*n,P=(1-l)*e+l*i,L=(1-h)*r+h*a,A=(1-h)*o+h*s,C=L-E,R=A-P;return C*C+R*R}function Mt(t,e){return t[0]===e[0]?t[1]-e[1]:t[0]-e[0]}function wt(t){t.sort(Mt);for(var e=[],n=0;n<t.length;n++){while(e.length>=2&&ft(e[e.length-2],e[e.length-1],t[n])<=0)e.pop();e.push(t[n])}for(var i=[],r=t.length-1;r>=0;r--){while(i.length>=2&&ft(i[i.length-2],i[i.length-1],t[r])<=0)i.pop();i.push(t[r])}return i.pop(),e.pop(),e.concat(i)}function St(t,e){const n=t.reduce(((t,e)=>(t.push(...e.outline.map((t=>[t.x,t.y]))),t)),[]);let i=Lt(e[0],e[1]),r=Lt(e[0],e[3]),o=Math.max(i,r)+100;var a=lt(n,1,o);a.pop();let s=a.map((t=>({x:t[0],y:t[1],z:0})));return s=Tt(s),s}function Tt(t){const e=[];return t.forEach(((t,n,i)=>{let r=i.length,o=i[(n-1+r)%r],a=i[(n+1)%r],s=i[n%r];Ft(s,o,a)||e.push(s)})),e}function Et(t){const e=Math.atan2(t.y,t.x);return(180*e/Math.PI+90+360)%360}function Pt(t,e,n,i){let r=w(e,i),o=[[e.x,i.x,r.x],[e.y,i.y,r.y],[e.z,i.z,r.z]],a=P(o);if(!a)return null;let s=x(n,t),[l,u,h]=L(a,[[s.x],[s.y],[s.z]]),c=y(t,b(l,e)),d=y(n,b(-u,i)),p=At(c,d);return{m:o,mInv:a,M:c,N:d,A:t,B:n,u:e,v:i,w:r,distance:p,t1:l,t2:u,t3:h}}function Lt(t,e){const n=Math.hypot(t.x-e.x,t.y-e.y);return n}function At(t,e){const n=Math.hypot(t.x-e.x,t.y-e.y,t.z-e.z);return n}function Ct(t,e,n){let i=At;(void 0==t.z||void 0==e.z||void 0==n.z||isNaN(t.z)||isNaN(e.z)||isNaN(n.z))&&(i=Lt);const r=i(t,e),o=i(e,n),a=i(t,n);let s=180*Math.acos((r*r+o*o-a*a)/(2*r*o))/Math.PI;isNaN(s)&&(s=a<r?0:180);let l=-Math.sign(w(x(t,e),x(n,e)).z);return s*=l,s}function Rt(t,e){return t.z=t.z||0,e.z=e.z||0,{x:(t.x+e.x)/2,y:(t.y+e.y)/2,z:(t.z+e.z)/2}}function It(t,e){return t.x==e.x&&t.y==e.y&&t.z==e.z}function Dt(t,e,n){return Math.abs(t.x-e.x)<n&&Math.abs(t.y-e.y)<n&&Math.abs(t.z-e.z)<n}function Ot(t,e){return t.x==e.x&&t.y==e.y}function zt(t,e,n){return Math.abs(t.x-e.x)<n&&Math.abs(t.y-e.y)<n}function Nt(t,e,n){let i=zt(t[0],e[0],n)&&zt(t[1],e[1],n),r=zt(t[0],e[1],n)&&zt(t[1],e[0],n);return i||r}function kt(t,e,n){let i=Dt(t[0],e[0],n)&&Dt(t[1],e[1],n),r=Dt(t[0],e[1],n)&&Dt(t[1],e[0],n);return i||r}function Ut(t){const e={xMin:1/0,xMax:-1/0,yMin:1/0,yMax:-1/0};for(let n of t)e.xMin=Math.min(e.xMin,n.x),e.xMax=Math.max(e.xMax,n.x),e.yMin=Math.min(e.yMin,n.y),e.yMax=Math.max(e.yMax,n.y);return e}function Bt(t,e=[]){const n=Ut(t),i=(n.yMax+n.yMin)/2;let r=[];for(let c=0;c<t.length;c++){let e=(c+1)%t.length;const n=t[c],o=t[e];if(n.y<=i&&o.y>i||n.y>=i&&o.y<i){let t=n.x+(o.x-n.x)*((i-n.y)/(o.y-n.y));r.push(t)}}if(r.length<2)return void console.error("not enaugh edge crossing mid cut",t);r.sort(((t,e)=>t-e));let o=r[0],a=r[1];for(let c of e)if(Gt(t,c))return{x:(o+a)/2,y:i};let s,l=.1,u=0,h=!1;while(u<10&&0==h){u++;let t=o+l*(a-o);s={x:t,y:i},h=!0;for(let n of e)if(Wt(s,n)){h=!1;break}if(h)return s;l=(Math.cos(u*Math.PI/11)+1)/2}return s}function Ft(t,e,n){const i={x:e.x,y:e.y,z:0},r={x:n.x,y:n.y,z:0},o={x:t.x,y:t.y,z:0},a=x(o,i),s=x(o,r),l=x(r,i),u=a.x*l.y-a.y*l.x,h=T(l),c=T(s),d=T(a);return!(0!=h||!Ot(o,i))||!(0==h&&!Ot(o,i))&&(0==d||Math.abs(u)<.01&&c<h&&d<h)}function Vt(t,e){let n=t.length==e.length;return n&&t.every((t=>e.find((e=>e.x==t.x&&e.y==t.y))))&&e.every((e=>t.find((t=>t.x==e.x&&t.y==e.y))))}function Ht(t,e){let n=!1;for(let i=0,r=e.length-1;i<e.length;r=i++)Ft(t,e[i],e[r])&&(n=!0);return n}function Wt(t,e){const n=t.x,i=t.y;let r=!1;for(let o=0,a=e.length-1;o<e.length;a=o++){const t=e[o].x,s=e[o].y,l=e[a].x,u=e[a].y,h=s>i!==u>i&&n<=(l-t)*(i-s)/(u-s)+t;h&&(r=!r)}return r||(r=Ht(t,e)),r}function Gt(t,e){return t.every((t=>Wt(t,e)))}function jt(t,e,n){function i(t){return void 0==t.z||isNaN(t.z)}if(It(e,n))return console.error("A and B don't make a line : A==B"),null;let r={};if(i(t)||i(e)||i(n)){const i={x:t.x-e.x,y:t.y-e.y},o={x:n.x-e.x,y:n.y-e.y},a=i.x*o.x+i.y*o.y,s=Lt(e,n);if(0==s)console.error("A and B don't make a line : A==B"),r=t;else{const t=a/s;r.x=e.x+t*o.x/s,r.y=e.y+t*o.y/s}}else{const i={x:t.x-e.x,y:t.y-e.y,z:t.z-e.z},o={x:n.x-e.x,y:n.y-e.y,z:n.z-e.z},a=i.x*o.x+i.y*o.y+i.z*o.z,s=At(e,n);if(0==s)console.error("A and B don't make a line : A==B"),r=t;else{const t=a/s;r.x=e.x+t*o.x/s,r.y=e.y+t*o.y/s,r.z=e.z+t*o.z/s}}return r}function Zt(t,e){return{...t,x:t.x+e.x,y:t.y+e.y,z:t.z}}function qt(t,e,n){const i=E(x(t,e)),r=E(x(n,e)),o=E(y(i,r));return o}function Xt(t,e,n){const i=Lt(t,e),r=Lt(t,n),o=Lt(n,e),a=i<o&&r<o;return a}function Yt(t,e,n){const i=x(e,t),r=x(n,e),o=E(w(i,r));return o}function Kt(t){const e=Math.acos(M(t,{x:0,y:0,z:1})),n=180*e/Math.PI;return n}function Jt(t){t.z<0&&(t=b(-1,t));const e=E({...t,z:0});if(It(e,{x:0,y:0,z:0}))return 0;const n=Math.acos(M(e,{x:0,y:1,z:0}));let i=180*n/Math.PI;return e.x<0&&(i=360-i),i}function $t(t,e,n){const i=M(e,n),r=(i-e.x*t.x-e.y*t.y)/e.z,o={...t,z:r};return o}function Qt(t){const e=t.length;let n=1/0,i=1/0,r=null;t.forEach(((t,e)=>{t.x<=n&&(n=t.x,t.y<i&&(i=t.y,r=e))}));const o=t[r],a=t[(r-1+e)%e],s=t[(r+1)%e],l=(o.x-a.x)*(s.y-a.y)-(s.x-a.x)*(o.y-a.y);return l<0}function te(t,e,n,i,r,o){const a=b(i,E(w(x(e,t),o))),s=b(r,E(w(x(n,e),o))),l=x(e,t),u=M(l,s);let h;if(0==u)h=0!=M(s,s)?y(e,s):0!=M(a,a)?y(e,a):e;else{const t=M(s,s),n=M(a,s),i=(t-n)/u;h=y(y(e,a),b(i,l))}return h}function ee(t){for(var e=t.length,n=0,i=0;i<e;i++){var r=x(t[i],t[0]),o=x(t[(i+1)%e],t[0]);const a=w(r,o),s=a.z>0?-1:1;n+=.5*s*T(a)}return Math.abs(n)}function ne(t){for(let e=0;e<t.length;e++)if(Number.isNaN(t[e]))return!0;return!1}var ie=n(115),re=n(543),oe=n(181);function ae(t){return"roof"==t.layer?se(t):"obstacle"==t.layer?le(t):t}function se(t){let e=t.normalVector;t.isClockwise||(e=b(-1,e)),t.margins.outterOutline=t.flatOutline,t.margins.innerOutline=[];const n=t.outline.length;t.margins.distances=t.margins.distances.slice(0,n);for(let i=0;i<n;i++){void 0==t.margins.distances[i]&&(t.margins.distances[i]=t.margins.sameMargin);const r=t.margins.outterOutline[i],o=t.margins.outterOutline[(i-1+n)%n],a=t.margins.outterOutline[(i+1)%n];let s,l;t.margins.isSameMargin?(s=t.margins.sameMargin,l=t.margins.sameMargin,t.margins.distances[i]=t.margins.sameMargin):(void 0===!t.margins.distances[(i-1+n)%n]&&(t.margins.distances[(i-1+n)%n]=t.margins.sameMargin),void 0===!t.margins.distances[i]&&(t.margins.distances[i]=t.margins.sameMargin),s=t.margins.distances[(i-1+n)%n],l=t.margins.distances[i]);let u=te(o,r,a,s,l,e);t.margins.innerOutline.push(u)}return t}function le(t){let e=t.normalVector;t.isClockwise&&(e=b(-1,e)),t.margins.innerOutline=t.flatOutline,t.margins.outterOutline=[];const n=t.margins.innerOutline.length;t.margins.distances=t.margins.distances.slice(0,n);for(let i=0;i<n;i++){void 0==t.margins.distances[i]&&(t.margins.distances[i]=t.margins.sameMargin);const r=t.margins.innerOutline[i],o=t.margins.innerOutline[(i-1+n)%n],a=t.margins.innerOutline[(i+1)%n];let s,l;t.margins.isSameMargin?(s=t.margins.sameMargin,l=t.margins.sameMargin,t.margins.distances[i]=t.margins.sameMargin):(void 0===t.margins.distances[(i-1+n)%n]&&(t.margins.distances[(i-1+n)%n]=t.margins.sameMargin),void 0===t.margins.distances[i]&&(t.margins.distances[i]=t.margins.sameMargin),s=t.margins.distances[(i-1+n)%n],l=t.margins.distances[i]);let u=te(o,r,a,s,l,e);t.margins.outterOutline.push(u)}return t}function ue(t){if(!["roof","obstacle","moduleField"].includes(t.layer))return t;t.outline.length>0&&zt(t.outline[0],t.outline[t.outline.length-1],10)&&t.outline.pop(),t.outline=he(t.outline);const{projectedOutline:e,maximumGap:n,normalVector:i,meanPoint:r,incline:o,direction:a}=ce(t.outline);if(t.flatOutline=e,t.maximumGap=n,t.isFlat=n<s,t.normalVector=i,t.meanPoint=r,t.incline=o,t.direction=a,t.area=ee(t.flatOutline)/1e6,t.isClockwise=Qt(t.outline),t=ae(t),"moduleField"==t.layer){let e=[];t.panels.length>0&&(e=St(t.panels,t.panels[0].outline),e=e.map((e=>({x:e.x,y:e.y,z:$t(e,t.roof.normalVector,t.roof.flatOutline[0]).z})))),t.trimedOutline=e}return t}function he(t){const e=[],n=[];for(let i=0;i<t.length-1;i++)for(let r=i+1;r<t.length;r++)zt(t[i],t[r],2*o)&&(r==i+1?n.push(r):e.push([i,r]));for(let i of e){const e=t[(i[0]-1+t.length)%t.length],n=t[i[0]],r=t[(i[0]+1)%t.length],a=t[(i[1]-1+t.length)%t.length],s=t[i[1]],l=t[(i[1]+1)%t.length];let u=qt(e,n,r),h=qt(a,s,l);t[i[0]]={...t[i[0]],...y(b(-o,u),n),z:t[i[0]].z},t[i[1]]={...t[i[1]],...y(b(o,h),s),z:t[i[1]].z}}for(let i=n.length-1;i>=0;i--)t.splice(n[i],1);return t}function ce(t){if(t.length<3)return null;let e=!1,n=t;n.length<3&&(e=!0,n=t);const i=S(n),r=n.map((t=>x(t,i))),o=r.map((t=>[t.x,t.y,t.z]));let{v:a,q:l}=(0,oe.SVD)(o,!1),u=[[],[],[]];for(let s in a)for(let t in a[s])u[t][s]=a[s][t];a=u;let h=0;for(let s in l)!isNaN(l[s])&&l[s]<l[h]&&(h=s);let c=a[h],d={x:0,y:0,z:1};c?(d.x=c[0],d.y=c[1],d.z=c[2]):console.error("no normalVector found for:q",l,"v",a,"meanPoint",i,"a",o,"normal index",h,"v",a,"outline",n),d.z<0&&(d=b(-1,d)),d.z<.1&&(d={x:0,y:0,z:1});const p=t.map((t=>{const e=$t(t,d,i);return{x:e.x,y:e.y,z:Math.max(0,Math.min(5e4,e.z))}})),f=Math.max(...t.map(((t,e)=>{let n=Math.abs(t.z-p[e].z);return n})));let m=Math.max(...t.map(((t,n)=>t.selected&&!e?0:t.z-p[n].z)));p.forEach((t=>t.z+=m));const g=Math.max(...t.map(((t,e)=>t.selected?0:Math.abs(t.z-p[e].z))));for(let y in t){let e=t[y],n=Math.abs(e.z-p[y].z)==g&&g>s;e.hasWarning=n||!(Math.abs(e.z-p[y].z)<s)&&e.hasWarning}const _=Kt(d),v=Jt(d);return{projectedOutline:p,maximumGap:f,normalVector:d,meanPoint:i,incline:_,direction:v}}class de{constructor(t=[],e,n=!0){this.id=k(),this.name="",this.version=0,this.type="polygon",this.outline=JSON.parse(JSON.stringify(t)),this.holes=[],this.layer=e,this.isClosed=n,this.highlight=!1,this.visible=!0,this.heightReference=0,this.priority=0,this.margins={isSameMargin:!0,sameMargin:200,innerOutline:[],outterOutline:[],distances:[]},this.isLoading=!1,"obstacle"==this.layer&&(this.isParallel=!0)}clone(){const t=new de;return this.outline.forEach((e=>{t.outline.push({...e})})),this.holes.forEach((e=>{t.holes.push({...e})})),t.id=k(),t.layer=this.layer,t.isClosed=this.isClosed,t}getAngle(t){const e=this.outline.length,n=this.outline[(t-1+e)%e],i=this.outline[t%e],r=this.outline[(t+1)%e];return Ct(n,i,r)}getDirectionSnapAngle(){let t=[];for(let e=0;e<this.outline.length;e++){let n=this.outline[e],i=this.outline[(e+1)%this.outline.length],r=Math.atan2(n.x-i.x,n.y-i.y);r*=180/Math.PI,t.push(r+90),t.push(r+270)}return t}getBounds(){let t=this.outline.reduce(((t,e)=>({xMin:Math.min(t.xMin,e.x),yMin:Math.min(t.yMin,e.y),xMax:Math.max(t.xMax,e.x),yMax:Math.max(t.yMax,e.y)})),{xMin:1/0,xMax:-1/0,yMin:1/0,yMax:-1/0}),e={x:(t.xMax+t.xMin)/2,y:(t.yMax+t.yMin)/2},n=Math.hypot(t.xMax-t.xMin,t.yMax-t.yMin)/2;return{...t,radius:n,center:e}}get4pointsSquareAngle(t,e){const n=this.outline.length,i=this.outline[(t-1+n)%n],r=this.outline[t%n],o=this.outline[(t+1)%n],a=e.toCanvasRef,s=b(15*e.mmPerPx,E(x(i,r))),l=b(15*e.mmPerPx,E(x(o,r))),u=y(r,s),h=y(r,l),c=y(u,l);return[a(u),a(c),a(h)]}translate(t){this.version++,this.outline=this.outline.map((e=>Zt(e,t))),ue(this)}serialize(){const t={id:this.id,version:this.version,name:this.name,type:this.type,outline:this.outline.map((t=>({x:t.x,y:t.y,z:t.z,selected:t.selected,open:t.open}))),holes:this.holes.map((t=>t.id)),layer:this.layer,highlight:this.highlight,visible:this.visible,margins:{isSameMargin:this.margins.isSameMargin,sameMargin:this.margins.sameMargin,distances:JSON.parse(JSON.stringify(this.margins.distances))}},e={};if("roof"==this.layer)e.moduleFields=this.moduleFields.map((t=>({id:t.id})));else if("obstacle"==this.layer)e.isParallel=this.isParallel,e.height=this.height,e.roofs=this.roofs.map((t=>({id:t.id})));else if("moduleField"==this.layer){const t=[];this.panels&&this.panels.forEach((e=>{t.push({id:e.id,index:e.index,outline:e.outline,status:e.status||"active",clipped:e.clipped||!1})})),this.userDeactivatedPanels&&this.userDeactivatedPanels.forEach((e=>{t.push({id:e.id,index:e.index,outline:e.outline,status:e.status||"user_deactivated",clipped:e.clipped||!1})})),e.data={...this.data,modules:[...this.data.modules]},e.roof={id:this.roof.id},e.pvData=this.pvData?{...this.pvData}:null,e.mountingData=this.mountingData?{...this.mountingData}:null,e.modules=t,e.needsOptimisation=this.needsOptimisation,e.priority=this.priority}else("panel"==this.layer||"user_deactivated_panel"==this.layer)&&(e.index=this.index,e.moduleField={id:this.moduleField.id});return JSON.parse(JSON.stringify({...t,...e}))}serializeForBEStorage(){if("roof"==this.layer){const t=this.margins.isSameMargin?Array(this.outline.length).fill(this.margins.sameMargin):this.margins.distances;return{roof_uuid:this.id,version:this.version,roof_outline:this.outline.map((t=>[t.x,t.y,t.z])),roof_margins_mm:t,roof_slope_degrees:this.incline,roof_orientation_degrees:this.direction,roof_name:this.name,shading_data:this.shadingData?this.shadingData:void 0}}if("obstacle"==this.layer){const t=this.margins.isSameMargin?Array(this.outline.length).fill(this.margins.sameMargin):this.margins.distances;return{obstacle_uuid:this.id,version:this.version,obstacle_outline:this.outline.map((t=>[t.x,t.y,t.z])),obstacle_margins_mm:t,obstacle_height_above_ground_mm:this.height,obstacle_slope_is_parallel_to_roof:this.isParallel}}if(["moduleField","tmpModuleField"].includes(this.layer)){this.panels||(this.panels=[]),this.userDeactivatedPanels||(this.userDeactivatedPanels=[]);const t=this.data.modules;return{module_field_uuid:this.id,roof_uuid:this.roof.id,version:this.version,module_field_outline:this.outline.map((t=>[t.x,t.y,t.z])),col_spacing_mm:this.data.col_spacing_mm,row_spacing_mm:this.data.row_spacing_mm,offset_percent:this.data.offset_percent,panel_orientation:this.data.panel_orientation,panel_direction_degrees:this.data.panel_direction_degrees,component_id_pv_module:this.data.component_id_pv_module,component_id_mounting_system:this.data.component_id_mounting_system,modules:t,module_tilt_degrees:this.data.module_tilt_degrees,base_line_index:this.data.base_line_index,justify_percent:this.data.justify_percent,number_of_panels_override:!!this.data.number_of_panels_override,number_of_panels:this.data.number_of_panels,yearly_yield_manual_entry:this.data.yearly_yield_manual_entry,yearly_yield_kwh_kwp:this.data.yearly_yield_kwh_kwp,yearly_yield_kwh_kwp_2:this.data.yearly_yield_kwh_kwp_2}}if(["panel","user_deactivated_panel"].includes(this.layer))return{id:this.id,index:this.index,outline:this.outline.map((t=>[t.x,t.y,t.z])),moduleField:{id:this.moduleField.id}}}}function pe(t,e,n=0){let i=[];const r=t.outline.length;for(let o=0;o<r-1+n;o++){const n=t.outline[o],a=t.outline[(o+1)%r];for(let t=0;t<e.length;t++){const r=e[t].outline[0],s=e[t].outline[1],l=ve(n,a,r,s);l.forEach((e=>{i.push({polylineIndex:o,edgeIndex:t,polylineParam:e.param1,edgeParam:e.param2,point:e.point})}))}}return i=i.filter((t=>t.polylineParam>=0&&t.polylineParam<=1&&t.edgeParam>=0&&t.edgeParam<=1)),i}function fe(t,e,n){let i=[];e.forEach((t=>{i.push(t.outline[0]),i.push(t.outline[1])})),n.outline.forEach((t=>{const e=i.find((e=>zt(t,e,o)));e||i.push(t)}));const r=n.outline.length,a=i.find((t=>zt(t,n.outline[0],o))),s=i.find((t=>zt(t,n.outline[r-1],o)));n.outline.forEach(((t,e)=>{t.z!=l&&t.z||(t.z=a.z+e/(r-1)*(s.z-a.z)),i.push(t)})),t.forEach((t=>{i.push(t.point)}));const u=[];for(let l=0;l<i.length;l++){const t=i[l],e=u.find((e=>e&&zt(e,t,o)));e||u.push(t)}return u}function me(t,e,n,i,r){const a=[];let s=(0,re.groupBy)(e,(t=>t.edgeIndex)),l=(0,re.groupBy)(e,(t=>t.polylineIndex));s=Object.values(s),l=Object.values(l),s.forEach((t=>t.sort(((t,e)=>t.edgeParam-e.edgeParam)))),l.forEach((t=>t.sort(((t,e)=>t.polylineParam-e.polylineParam))));const u=l.map((t=>t[0].polylineIndex)),h=s.map((t=>t[0].edgeIndex)),c=[...Array(n.length).keys()].filter((t=>!h.includes(t))),d=[...Array(i.outline.length-1+r).keys()].filter((t=>!u.includes(t)));c.forEach((e=>{const i=t.findIndex((t=>zt(n[e].outline[0],t,o))),r=t.findIndex((t=>zt(n[e].outline[1],t,o)));a.push([i,r])})),d.forEach((e=>{const n=i.outline.length,r=t.findIndex((t=>zt(i.outline[e],t,o))),s=t.findIndex((t=>zt(i.outline[(e+1)%n],t,o)));a.push([r,s])})),s.forEach((e=>{const i=e.length,r=t.findIndex((t=>zt(n[e[0].edgeIndex].outline[0],t,o))),s=t.findIndex((t=>zt(e[0].point,t,o)));a.push([r,s]);for(let n=0;n<i-1;n++){const r=t.findIndex((t=>zt(e[n].point,t,o))),s=t.findIndex((t=>zt(e[(n+1)%i].point,t,o)));a.push([r,s])}const l=t.findIndex((t=>zt(e[i-1].point,t,o))),u=t.findIndex((t=>zt(n[e[0].edgeIndex].outline[1],t,o)));a.push([l,u])})),l.forEach((e=>{const n=e.length,r=i.outline.length,s=t.findIndex((t=>zt(i.outline[e[0].polylineIndex],t,o))),l=t.findIndex((t=>zt(e[0].point,t,o)));a.push([s,l]);for(let i=0;i<n-1;i++){const r=t.findIndex((t=>zt(e[i].point,t,o))),s=t.findIndex((t=>zt(e[(i+1)%n].point,t,o)));a.push([r,s])}const u=t.findIndex((t=>zt(e[n-1].point,t,o))),h=t.findIndex((t=>zt(i.outline[(e[0].polylineIndex+1)%r],t,o)));a.push([u,h])}));const p=[];return a.forEach((t=>{const e=p.find((e=>t[0]==e[0]&&t[1]==e[1]));e||t[0]==t[1]||p.push(t)})),p}function ge(t){if(t.children.length>0){let e=t.children.reduce((function(t,e){return t.push(...ge(e)),t}),[]);return t.cycle.length&&e.push(t.cycle),e}return[t.cycle]}function _e(t,e,n=[]){const i="outline",r=Math.min(...t.map((t=>t.x))),o=Math.min(...t.map((t=>t.y))),a=t.map((t=>[t.x-r,t.y-o])),s=new ie.iu,l=s.discover(a,e),u=[];if("forest"==i)return l.forest;for(let c in l.forest){const t=l.forest[c];let e=ge(t);u.push(...e)}let h=u.map((e=>e.map((e=>({x:t[e].x,y:t[e].y,z:t[e].z}))))).filter((t=>t.length>0));return h.forEach((t=>t.pop())),h=h.map((t=>{let e=n.find((e=>Vt(t,e.outline)));return e&&(t=JSON.parse(JSON.stringify(e.outline))),t})),h}function ve(t,e,n,i){const r=x(e,t),a=x(i,n);let s,l,u,h;const c={x:-r.y,y:r.x,z:0},d={x:-a.y,y:a.x,z:0},p=M(a,c),f=M(r,d),m=T(r),g=T(a);if(m<o&&g<o){if(Lt(t,n)<2*o)return[{point:t,param1:.5,param2:.5}]}else if(0==m){if(h=jt(t,n,i),Lt(h,t)<o)return l=T(x(n,t))/g,[{point:t,param1:0,param2:l}]}else if(0==g&&(u=jt(n,t,e),Lt(u,n)<o))return s=T(x(n,t))/m,[{point:n,param1:s,param2:0}];if(Math.abs(p)/(m*g)<.01){if(h=jt(t,n,i),u=jt(e,n,i),Lt(t,h)<o||Lt(e,u)<o){const r=[];return Xt(t,n,i)&&(l=Lt(t,n)/g,r.push({point:t,param1:0,param2:l})),Xt(e,n,i)&&(l=Lt(e,n)/g,r.push({point:e,param1:1,param2:l})),Xt(n,t,e)&&(s=Lt(t,n)/m,r.push({point:n,param1:s,param2:0})),Xt(i,t,e)&&(s=Lt(t,i)/m,r.push({point:i,param1:s,param2:1})),r}return[]}if(l=M(x(t,n),c)/p,s=M(x(n,t),d)/f,l<0||l>1||s<0||s>1)return[];const _=y(t,b(s,r));return _.z=n.z+l*(i.z-n.z),[{point:_,param1:s,param2:l}]}function ye(t,e,n="intersect"){const i=t.map((t=>({x:t.x,y:t.y,z:t.z})));i.push(i[0]);const r=e.map((t=>({x:t.x,y:t.y,z:t.z})));let o=[];i.forEach((t=>{o.push(t)})),r.forEach((t=>{o.push(t)}));const a=r.map(((t,e)=>({outline:[t,r[(e+1)%r.length]]})));let s=pe({outline:i},a);const l=fe(s,a,{outline:i}),u=me(l,s,a,{outline:i},1);try{const t=_e(l,u);return xe(t,i,r,n)}catch(h){return console.error("error with getOutlineList",l,u,h),[]}}function xe(t,e,n,i){for(var r,o,a,s=[],l=Me(t,1e-4),u=0;u<l.length;u++)a=Bt(l[u],l.filter(((t,e)=>e!=u))),r=Wt(a,e),o=Wt(a,n),("intersect"===i&&r&&o||"cut1"===i&&r&&!o||"cut2"===i&&!r&&o||"sum"===i&&(r||o))&&(l[u]=l[u].filter((t=>!!t)),s.push(l[u]));return s}function be(t,e){const n=t.map((t=>({x:t.x,y:t.y,z:t.z}))),i=e.map((t=>({x:t.x,y:t.y,z:t.z})));return ye(n,i,"intersect")}function Me(t,e){for(var n=[],i=0;i<t.length;i++)we(t[i])>=e&&n.push(t[i]);return n}function we(t){for(var e=t.length,n=0,i=0;i<e;i++)n+=Math.abs(t[i%e].x*t[(i+1)%e].y-t[i%e].y*t[(i+1)%e].x);return n/2}},621:function(t,e){"use strict";e.A=(t,e)=>{const n=t.__vccOpts||t;for(const[i,r]of e)n[i]=r;return n}},953:function(t,e,n){"use strict";n.d(e,{C4:function(){return T},EW:function(){return Ht},Gc:function(){return St},IG:function(){return It},Kh:function(){return wt},Pr:function(){return Ft},X2:function(){return b},bl:function(){return E},fE:function(){return At},g8:function(){return Pt},i9:function(){return kt},ju:function(){return Ct},o5:function(){return l},u4:function(){return P},uY:function(){return a},ux:function(){return Rt},yC:function(){return o}});var i=n(33);let r;class o{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=r,!t&&r&&(this.index=(r.scopes||(r.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const e=r;try{return r=this,t()}finally{r=e}}else 0}on(){r=this}off(){r=this.parent}stop(t){if(this._active){let e,n;for(e=0,n=this.effects.length;e<n;e++)this.effects[e].stop();for(e=0,n=this.cleanups.length;e<n;e++)this.cleanups[e]();if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].stop(!0);if(!this.detached&&this.parent&&!t){const t=this.parent.scopes.pop();t&&t!==this&&(this.parent.scopes[this.index]=t,t.index=this.index)}this.parent=void 0,this._active=!1}}}function a(t){return new o(t)}function s(t,e=r){e&&e.active&&e.effects.push(t)}function l(){return r}const u=t=>{const e=new Set(t);return e.w=0,e.n=0,e},h=t=>(t.w&g)>0,c=t=>(t.n&g)>0,d=({deps:t})=>{if(t.length)for(let e=0;e<t.length;e++)t[e].w|=g},p=t=>{const{deps:e}=t;if(e.length){let n=0;for(let i=0;i<e.length;i++){const r=e[i];h(r)&&!c(r)?r.delete(t):e[n++]=r,r.w&=~g,r.n&=~g}e.length=n}},f=new WeakMap;let m=0,g=1;const _=30;let v;const y=Symbol(""),x=Symbol("");class b{constructor(t,e=null,n){this.fn=t,this.scheduler=e,this.active=!0,this.deps=[],this.parent=void 0,s(this,n)}run(){if(!this.active)return this.fn();let t=v,e=w;while(t){if(t===this)return;t=t.parent}try{return this.parent=v,v=this,w=!0,g=1<<++m,m<=_?d(this):M(this),this.fn()}finally{m<=_&&p(this),g=1<<--m,v=this.parent,w=e,this.parent=void 0,this.deferStop&&this.stop()}}stop(){v===this?this.deferStop=!0:this.active&&(M(this),this.onStop&&this.onStop(),this.active=!1)}}function M(t){const{deps:e}=t;if(e.length){for(let n=0;n<e.length;n++)e[n].delete(t);e.length=0}}let w=!0;const S=[];function T(){S.push(w),w=!1}function E(){const t=S.pop();w=void 0===t||t}function P(t,e,n){if(w&&v){let e=f.get(t);e||f.set(t,e=new Map);let i=e.get(n);i||e.set(n,i=u());const r=void 0;L(i,r)}}function L(t,e){let n=!1;m<=_?c(t)||(t.n|=g,n=!h(t)):n=!t.has(v),n&&(t.add(v),v.deps.push(t))}function A(t,e,n,r,o,a){const s=f.get(t);if(!s)return;let l=[];if("clear"===e)l=[...s.values()];else if("length"===n&&(0,i.cy)(t)){const t=Number(r);s.forEach(((e,n)=>{("length"===n||n>=t)&&l.push(e)}))}else switch(void 0!==n&&l.push(s.get(n)),e){case"add":(0,i.cy)(t)?(0,i.yI)(n)&&l.push(s.get("length")):(l.push(s.get(y)),(0,i.jh)(t)&&l.push(s.get(x)));break;case"delete":(0,i.cy)(t)||(l.push(s.get(y)),(0,i.jh)(t)&&l.push(s.get(x)));break;case"set":(0,i.jh)(t)&&l.push(s.get(y));break}if(1===l.length)l[0]&&C(l[0]);else{const t=[];for(const e of l)e&&t.push(...e);C(u(t))}}function C(t,e){const n=(0,i.cy)(t)?t:[...t];for(const i of n)i.computed&&R(i,e);for(const i of n)i.computed||R(i,e)}function R(t,e){(t!==v||t.allowRecurse)&&(t.scheduler?t.scheduler():t.run())}const I=(0,i.pD)("__proto__,__v_isRef,__isVue"),D=new Set(Object.getOwnPropertyNames(Symbol).filter((t=>"arguments"!==t&&"caller"!==t)).map((t=>Symbol[t])).filter(i.Bm)),O=F(),z=F(!1,!0),N=F(!0),k=U();function U(){const t={};return["includes","indexOf","lastIndexOf"].forEach((e=>{t[e]=function(...t){const n=Rt(this);for(let e=0,r=this.length;e<r;e++)P(n,"get",e+"");const i=n[e](...t);return-1===i||!1===i?n[e](...t.map(Rt)):i}})),["push","pop","shift","unshift","splice"].forEach((e=>{t[e]=function(...t){T();const n=Rt(this)[e].apply(this,t);return E(),n}})),t}function B(t){const e=Rt(this);return P(e,"has",t),e.hasOwnProperty(t)}function F(t=!1,e=!1){return function(n,r,o){if("__v_isReactive"===r)return!t;if("__v_isReadonly"===r)return t;if("__v_isShallow"===r)return e;if("__v_raw"===r&&o===(t?e?xt:yt:e?vt:_t).get(n))return n;const a=(0,i.cy)(n);if(!t){if(a&&(0,i.$3)(k,r))return Reflect.get(k,r,o);if("hasOwnProperty"===r)return B}const s=Reflect.get(n,r,o);return((0,i.Bm)(r)?D.has(r):I(r))?s:(t||P(n,"get",r),e?s:kt(s)?a&&(0,i.yI)(r)?s:s.value:(0,i.Gv)(s)?t?Tt(s):wt(s):s)}}const V=W(),H=W(!0);function W(t=!1){return function(e,n,r,o){let a=e[n];if(Lt(a)&&kt(a)&&!kt(r))return!1;if(!t&&(At(r)||Lt(r)||(a=Rt(a),r=Rt(r)),!(0,i.cy)(e)&&kt(a)&&!kt(r)))return a.value=r,!0;const s=(0,i.cy)(e)&&(0,i.yI)(n)?Number(n)<e.length:(0,i.$3)(e,n),l=Reflect.set(e,n,r,o);return e===Rt(o)&&(s?(0,i.$H)(r,a)&&A(e,"set",n,r,a):A(e,"add",n,r)),l}}function G(t,e){const n=(0,i.$3)(t,e),r=t[e],o=Reflect.deleteProperty(t,e);return o&&n&&A(t,"delete",e,void 0,r),o}function j(t,e){const n=Reflect.has(t,e);return(0,i.Bm)(e)&&D.has(e)||P(t,"has",e),n}function Z(t){return P(t,"iterate",(0,i.cy)(t)?"length":y),Reflect.ownKeys(t)}const q={get:O,set:V,deleteProperty:G,has:j,ownKeys:Z},X={get:N,set(t,e){return!0},deleteProperty(t,e){return!0}},Y=(0,i.X$)({},q,{get:z,set:H}),K=t=>t,J=t=>Reflect.getPrototypeOf(t);function $(t,e,n=!1,i=!1){t=t["__v_raw"];const r=Rt(t),o=Rt(e);n||(e!==o&&P(r,"get",e),P(r,"get",o));const{has:a}=J(r),s=i?K:n?Ot:Dt;return a.call(r,e)?s(t.get(e)):a.call(r,o)?s(t.get(o)):void(t!==r&&t.get(e))}function Q(t,e=!1){const n=this["__v_raw"],i=Rt(n),r=Rt(t);return e||(t!==r&&P(i,"has",t),P(i,"has",r)),t===r?n.has(t):n.has(t)||n.has(r)}function tt(t,e=!1){return t=t["__v_raw"],!e&&P(Rt(t),"iterate",y),Reflect.get(t,"size",t)}function et(t){t=Rt(t);const e=Rt(this),n=J(e),i=n.has.call(e,t);return i||(e.add(t),A(e,"add",t,t)),this}function nt(t,e){e=Rt(e);const n=Rt(this),{has:r,get:o}=J(n);let a=r.call(n,t);a||(t=Rt(t),a=r.call(n,t));const s=o.call(n,t);return n.set(t,e),a?(0,i.$H)(e,s)&&A(n,"set",t,e,s):A(n,"add",t,e),this}function it(t){const e=Rt(this),{has:n,get:i}=J(e);let r=n.call(e,t);r||(t=Rt(t),r=n.call(e,t));const o=i?i.call(e,t):void 0,a=e.delete(t);return r&&A(e,"delete",t,void 0,o),a}function rt(){const t=Rt(this),e=0!==t.size,n=void 0,i=t.clear();return e&&A(t,"clear",void 0,void 0,n),i}function ot(t,e){return function(n,i){const r=this,o=r["__v_raw"],a=Rt(o),s=e?K:t?Ot:Dt;return!t&&P(a,"iterate",y),o.forEach(((t,e)=>n.call(i,s(t),s(e),r)))}}function at(t,e,n){return function(...r){const o=this["__v_raw"],a=Rt(o),s=(0,i.jh)(a),l="entries"===t||t===Symbol.iterator&&s,u="keys"===t&&s,h=o[t](...r),c=n?K:e?Ot:Dt;return!e&&P(a,"iterate",u?x:y),{next(){const{value:t,done:e}=h.next();return e?{value:t,done:e}:{value:l?[c(t[0]),c(t[1])]:c(t),done:e}},[Symbol.iterator](){return this}}}}function st(t){return function(...e){return"delete"!==t&&this}}function lt(){const t={get(t){return $(this,t)},get size(){return tt(this)},has:Q,add:et,set:nt,delete:it,clear:rt,forEach:ot(!1,!1)},e={get(t){return $(this,t,!1,!0)},get size(){return tt(this)},has:Q,add:et,set:nt,delete:it,clear:rt,forEach:ot(!1,!0)},n={get(t){return $(this,t,!0)},get size(){return tt(this,!0)},has(t){return Q.call(this,t,!0)},add:st("add"),set:st("set"),delete:st("delete"),clear:st("clear"),forEach:ot(!0,!1)},i={get(t){return $(this,t,!0,!0)},get size(){return tt(this,!0)},has(t){return Q.call(this,t,!0)},add:st("add"),set:st("set"),delete:st("delete"),clear:st("clear"),forEach:ot(!0,!0)},r=["keys","values","entries",Symbol.iterator];return r.forEach((r=>{t[r]=at(r,!1,!1),n[r]=at(r,!0,!1),e[r]=at(r,!1,!0),i[r]=at(r,!0,!0)})),[t,n,e,i]}const[ut,ht,ct,dt]=lt();function pt(t,e){const n=e?t?dt:ct:t?ht:ut;return(e,r,o)=>"__v_isReactive"===r?!t:"__v_isReadonly"===r?t:"__v_raw"===r?e:Reflect.get((0,i.$3)(n,r)&&r in e?n:e,r,o)}const ft={get:pt(!1,!1)},mt={get:pt(!1,!0)},gt={get:pt(!0,!1)};const _t=new WeakMap,vt=new WeakMap,yt=new WeakMap,xt=new WeakMap;function bt(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Mt(t){return t["__v_skip"]||!Object.isExtensible(t)?0:bt((0,i.Zf)(t))}function wt(t){return Lt(t)?t:Et(t,!1,q,ft,_t)}function St(t){return Et(t,!1,Y,mt,vt)}function Tt(t){return Et(t,!0,X,gt,yt)}function Et(t,e,n,r,o){if(!(0,i.Gv)(t))return t;if(t["__v_raw"]&&(!e||!t["__v_isReactive"]))return t;const a=o.get(t);if(a)return a;const s=Mt(t);if(0===s)return t;const l=new Proxy(t,2===s?r:n);return o.set(t,l),l}function Pt(t){return Lt(t)?Pt(t["__v_raw"]):!(!t||!t["__v_isReactive"])}function Lt(t){return!(!t||!t["__v_isReadonly"])}function At(t){return!(!t||!t["__v_isShallow"])}function Ct(t){return Pt(t)||Lt(t)}function Rt(t){const e=t&&t["__v_raw"];return e?Rt(e):t}function It(t){return(0,i.yQ)(t,"__v_skip",!0),t}const Dt=t=>(0,i.Gv)(t)?wt(t):t,Ot=t=>(0,i.Gv)(t)?Tt(t):t;function zt(t){w&&v&&(t=Rt(t),L(t.dep||(t.dep=u())))}function Nt(t,e){t=Rt(t);const n=t.dep;n&&C(n)}function kt(t){return!(!t||!0!==t.__v_isRef)}function Ut(t){return kt(t)?t.value:t}const Bt={get:(t,e,n)=>Ut(Reflect.get(t,e,n)),set:(t,e,n,i)=>{const r=t[e];return kt(r)&&!kt(n)?(r.value=n,!0):Reflect.set(t,e,n,i)}};function Ft(t){return Pt(t)?t:new Proxy(t,Bt)}class Vt{constructor(t,e,n,i){this._setter=e,this.dep=void 0,this.__v_isRef=!0,this["__v_isReadonly"]=!1,this._dirty=!0,this.effect=new b(t,(()=>{this._dirty||(this._dirty=!0,Nt(this))})),this.effect.computed=this,this.effect.active=this._cacheable=!i,this["__v_isReadonly"]=n}get value(){const t=Rt(this);return zt(t),!t._dirty&&t._cacheable||(t._dirty=!1,t._value=t.effect.run()),t._value}set value(t){this._setter(t)}}function Ht(t,e,n=!1){let r,o;const a=(0,i.Tn)(t);a?(r=t,o=i.tE):(r=t.get,o=t.set);const s=new Vt(r,o,a||!o,n);return s}},641:function(t,e,n){"use strict";n.d(e,{CE:function(){return ht},EW:function(){return zt},WQ:function(){return $},bF:function(){return _t},g2:function(){return Z},uX:function(){return at},wB:function(){return R}});var i=n(953),r=n(33);function o(t,e,n,i){let r;try{r=i?t(...i):t()}catch(o){s(o,e,n)}return r}function a(t,e,n,i){if((0,r.Tn)(t)){const a=o(t,e,n,i);return a&&(0,r.yL)(a)&&a.catch((t=>{s(t,e,n)})),a}const l=[];for(let r=0;r<t.length;r++)l.push(a(t[r],e,n,i));return l}function s(t,e,n,i=!0){const r=e?e.vnode:null;if(e){let i=e.parent;const r=e.proxy,a=n;while(i){const e=i.ec;if(e)for(let n=0;n<e.length;n++)if(!1===e[n](t,r,a))return;i=i.parent}const s=e.appContext.config.errorHandler;if(s)return void o(s,null,10,[t,r,a])}l(t,n,r,i)}function l(t,e,n,i=!0){console.error(t)}let u=!1,h=!1;const c=[];let d=0;const p=[];let f=null,m=0;const g=Promise.resolve();let _=null;function v(t){let e=d+1,n=c.length;while(e<n){const i=e+n>>>1,r=w(c[i]);r<t?e=i+1:n=i}return e}function y(t){c.length&&c.includes(t,u&&t.allowRecurse?d+1:d)||(null==t.id?c.push(t):c.splice(v(t.id),0,t),x())}function x(){u||h||(h=!0,_=g.then(T))}function b(t){(0,r.cy)(t)?p.push(...t):f&&f.includes(t,t.allowRecurse?m+1:m)||p.push(t),x()}function M(t){if(p.length){const t=[...new Set(p)];if(p.length=0,f)return void f.push(...t);for(f=t,f.sort(((t,e)=>w(t)-w(e))),m=0;m<f.length;m++)f[m]();f=null,m=0}}const w=t=>null==t.id?1/0:t.id,S=(t,e)=>{const n=w(t)-w(e);if(0===n){if(t.pre&&!e.pre)return-1;if(e.pre&&!t.pre)return 1}return n};function T(t){h=!1,u=!0,c.sort(S);r.tE;try{for(d=0;d<c.length;d++){const t=c[d];t&&!1!==t.active&&o(t,null,14)}}finally{d=0,c.length=0,M(t),u=!1,_=null,(c.length||p.length)&&T(t)}}let E=null,P=null;const L=t=>t.__isSuspense;function A(t,e){e&&e.pendingBranch?(0,r.cy)(t)?e.effects.push(...t):e.effects.push(t):b(t)}const C={};function R(t,e,n){return I(t,e,n)}function I(t,e,{immediate:n,deep:s,flush:l,onTrack:u,onTrigger:h}=r.MZ){var c;const d=(0,i.o5)()===(null==(c=Tt)?void 0:c.scope)?Tt:null;let p,f,m=!1,g=!1;if((0,i.i9)(t)?(p=()=>t.value,m=(0,i.fE)(t)):(0,i.g8)(t)?(p=()=>t,s=!0):(0,r.cy)(t)?(g=!0,m=t.some((t=>(0,i.g8)(t)||(0,i.fE)(t))),p=()=>t.map((t=>(0,i.i9)(t)?t.value:(0,i.g8)(t)?D(t):(0,r.Tn)(t)?o(t,d,2):void 0))):p=(0,r.Tn)(t)?e?()=>o(t,d,2):()=>{if(!d||!d.isUnmounted)return f&&f(),a(t,d,3,[v])}:r.tE,e&&s){const t=p;p=()=>D(t())}let _,v=t=>{f=w.onStop=()=>{o(t,d,4)}};if(It){if(v=r.tE,e?n&&a(e,d,3,[p(),g?[]:void 0,v]):p(),"sync"!==l)return r.tE;{const t=kt();_=t.__watcherHandles||(t.__watcherHandles=[])}}let x=g?new Array(t.length).fill(C):C;const b=()=>{if(w.active)if(e){const t=w.run();(s||m||(g?t.some(((t,e)=>(0,r.$H)(t,x[e]))):(0,r.$H)(t,x)))&&(f&&f(),a(e,d,3,[t,x===C?void 0:g&&x[0]===C?[]:x,v]),x=t)}else w.run()};let M;b.allowRecurse=!!e,"sync"===l?M=b:"post"===l?M=()=>Q(b,d&&d.suspense):(b.pre=!0,d&&(b.id=d.uid),M=()=>y(b));const w=new i.X2(p,M);e?n?b():x=w.run():"post"===l?Q(w.run.bind(w),d&&d.suspense):w.run();const S=()=>{w.stop(),d&&d.scope&&(0,r.TF)(d.scope.effects,w)};return _&&_.push(S),S}function D(t,e){if(!(0,r.Gv)(t)||t["__v_skip"])return t;if(e=e||new Set,e.has(t))return t;if(e.add(t),(0,i.i9)(t))D(t.value,e);else if((0,r.cy)(t))for(let n=0;n<t.length;n++)D(t[n],e);else if((0,r.vM)(t)||(0,r.jh)(t))t.forEach((t=>{D(t,e)}));else if((0,r.Qd)(t))for(const n in t)D(t[n],e);return t}const O=[Function,Array];Boolean,Boolean;function z(t,e){6&t.shapeFlag&&t.component?z(t.component.subTree,e):128&t.shapeFlag?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}const N=t=>!!t.type.__asyncLoader;RegExp,RegExp;function k(t,e){return(0,r.cy)(t)?t.some((t=>k(t,e))):(0,r.Kg)(t)?t.split(",").includes(e):!!(0,r.gd)(t)&&t.test(e)}function U(t){t.shapeFlag&=-257,t.shapeFlag&=-513}function B(t){return 128&t.shapeFlag?t.ssContent:t}function F(t,e,n=Tt,r=!1){if(n){const o=n[t]||(n[t]=[]),s=e.__weh||(e.__weh=(...r)=>{if(n.isUnmounted)return;(0,i.C4)(),Ct(n);const o=a(e,n,t,r);return Rt(),(0,i.bl)(),o});return r?o.unshift(s):o.push(s),s}}const V=t=>(e,n=Tt)=>(!It||"sp"===t)&&F(t,((...t)=>e(...t)),n),H=(V("bm"),V("m")),W=(V("bu"),V("u")),G=V("bum");V("um"),V("sp"),V("rtg"),V("rtc");const j="components";function Z(t,e){return X(j,t,!0,e)||t}const q=Symbol.for("v-ndc");function X(t,e,n=!0,i=!1){const o=E||Tt;if(o){const n=o.type;if(t===j){const t=Dt(n,!1);if(t&&(t===e||t===(0,r.PT)(e)||t===(0,r.ZH)((0,r.PT)(e))))return n}const a=Y(o[t]||n[t],e)||Y(o.appContext[t],e);return!a&&i?n:a}}function Y(t,e){return t&&(t[e]||t[(0,r.PT)(e)]||t[(0,r.ZH)((0,r.PT)(e))])}function K(){return{app:null,config:{isNativeTag:r.NO,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let J=null;function $(t,e,n=!1){const i=Tt||E;if(i||J){const o=i?null==i.parent?i.vnode.appContext&&i.vnode.appContext.provides:i.parent.provides:J._context.provides;if(o&&t in o)return o[t];if(arguments.length>1)return n&&(0,r.Tn)(e)?e.call(i&&i.proxy):e}else 0}const Q=A;const tt=t=>t.__isTeleport;const et=Symbol.for("v-fgt"),nt=Symbol.for("v-txt"),it=Symbol.for("v-cmt"),rt=(Symbol.for("v-stc"),[]);let ot=null;function at(t=!1){rt.push(ot=t?null:[])}function st(){rt.pop(),ot=rt[rt.length-1]||null}let lt=1;function ut(t){return t.dynamicChildren=lt>0?ot||r.Oj:null,st(),lt>0&&ot&&ot.push(t),t}function ht(t,e,n,i,r,o){return ut(gt(t,e,n,i,r,o,!0))}function ct(t){return!!t&&!0===t.__v_isVNode}function dt(t,e){return t.type===e.type&&t.key===e.key}const pt="__vInternal",ft=({key:t})=>null!=t?t:null,mt=({ref:t,ref_key:e,ref_for:n})=>("number"===typeof t&&(t=""+t),null!=t?(0,r.Kg)(t)||(0,i.i9)(t)||(0,r.Tn)(t)?{i:E,r:t,k:e,f:!!n}:t:null);function gt(t,e=null,n=null,i=0,o=null,a=(t===et?0:1),s=!1,l=!1){const u={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&ft(e),ref:e&&mt(e),scopeId:P,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:i,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:E};return l?(Mt(u,n),128&a&&t.normalize(u)):n&&(u.shapeFlag|=(0,r.Kg)(n)?8:16),lt>0&&!s&&ot&&(u.patchFlag>0||6&a)&&32!==u.patchFlag&&ot.push(u),u}const _t=vt;function vt(t,e=null,n=null,o=0,a=null,s=!1){if(t&&t!==q||(t=it),ct(t)){const i=xt(t,e,!0);return n&&Mt(i,n),lt>0&&!s&&ot&&(6&i.shapeFlag?ot[ot.indexOf(t)]=i:ot.push(i)),i.patchFlag|=-2,i}if(Ot(t)&&(t=t.__vccOpts),e){e=yt(e);let{class:t,style:n}=e;t&&!(0,r.Kg)(t)&&(e.class=(0,r.C4)(t)),(0,r.Gv)(n)&&((0,i.ju)(n)&&!(0,r.cy)(n)&&(n=(0,r.X$)({},n)),e.style=(0,r.Tr)(n))}const l=(0,r.Kg)(t)?1:L(t)?128:tt(t)?64:(0,r.Gv)(t)?4:(0,r.Tn)(t)?2:0;return gt(t,e,n,o,a,l,s,!0)}function yt(t){return t?(0,i.ju)(t)||pt in t?(0,r.X$)({},t):t:null}function xt(t,e,n=!1){const{props:i,ref:o,patchFlag:a,children:s}=t,l=e?wt(i||{},e):i,u={__v_isVNode:!0,__v_skip:!0,type:t.type,props:l,key:l&&ft(l),ref:e&&e.ref?n&&o?(0,r.cy)(o)?o.concat(mt(e)):[o,mt(e)]:mt(e):o,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:s,target:t.target,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==et?-1===a?16:16|a:a,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:t.transition,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&xt(t.ssContent),ssFallback:t.ssFallback&&xt(t.ssFallback),el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return u}function bt(t=" ",e=0){return _t(nt,null,t,e)}function Mt(t,e){let n=0;const{shapeFlag:i}=t;if(null==e)e=null;else if((0,r.cy)(e))n=16;else if("object"===typeof e){if(65&i){const n=e.default;return void(n&&(n._c&&(n._d=!1),Mt(t,n()),n._c&&(n._d=!0)))}{n=32;const i=e._;i||pt in e?3===i&&E&&(1===E.slots._?e._=1:(e._=2,t.patchFlag|=1024)):e._ctx=E}}else(0,r.Tn)(e)?(e={default:e,_ctx:E},n=32):(e=String(e),64&i?(n=16,e=[bt(e)]):n=8);t.children=e,t.shapeFlag|=n}function wt(...t){const e={};for(let n=0;n<t.length;n++){const i=t[n];for(const t in i)if("class"===t)e.class!==i.class&&(e.class=(0,r.C4)([e.class,i.class]));else if("style"===t)e.style=(0,r.Tr)([e.style,i.style]);else if((0,r.Mp)(t)){const n=e[t],o=i[t];!o||n===o||(0,r.cy)(n)&&n.includes(o)||(e[t]=n?[].concat(n,o):o)}else""!==t&&(e[t]=i[t])}return e}function St(t,e,n,i=null){a(t,e,7,[n,i])}K();let Tt=null;const Et=()=>Tt||E;let Pt,Lt,At="__VUE_INSTANCE_SETTERS__";(Lt=(0,r.We)()[At])||(Lt=(0,r.We)()[At]=[]),Lt.push((t=>Tt=t)),Pt=t=>{Lt.length>1?Lt.forEach((e=>e(t))):Lt[0](t)};const Ct=t=>{Pt(t),t.scope.on()},Rt=()=>{Tt&&Tt.scope.off(),Pt(null)};let It=!1;function Dt(t,e=!0){return(0,r.Tn)(t)?t.displayName||t.name:t.name||e&&t.__name}function Ot(t){return(0,r.Tn)(t)&&"__vccOpts"in t}const zt=(t,e)=>(0,i.EW)(t,e,It);const Nt=Symbol.for("v-scx"),kt=()=>{{const t=$(Nt);return t}}},33:function(t,e,n){"use strict";function i(t,e){const n=Object.create(null),i=t.split(",");for(let r=0;r<i.length;r++)n[i[r]]=!0;return e?t=>!!n[t.toLowerCase()]:t=>!!n[t]}n.d(e,{$3:function(){return f},$H:function(){return k},Bm:function(){return b},C4:function(){return J},CP:function(){return h},DY:function(){return U},Ft:function(){return j},Gv:function(){return M},Kg:function(){return x},MZ:function(){return r},Mp:function(){return u},NO:function(){return s},Oj:function(){return o},PT:function(){return I},Qd:function(){return P},Ro:function(){return V},SU:function(){return A},TF:function(){return d},Tg:function(){return O},Tn:function(){return y},Tr:function(){return Z},We:function(){return W},X$:function(){return c},ZH:function(){return z},Zf:function(){return E},bB:function(){return F},cy:function(){return m},gd:function(){return v},jh:function(){return g},pD:function(){return i},rU:function(){return N},tE:function(){return a},vM:function(){return _},yI:function(){return L},yL:function(){return w},yQ:function(){return B}});const r={},o=[],a=()=>{},s=()=>!1,l=/^on[^a-z]/,u=t=>l.test(t),h=t=>t.startsWith("onUpdate:"),c=Object.assign,d=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},p=Object.prototype.hasOwnProperty,f=(t,e)=>p.call(t,e),m=Array.isArray,g=t=>"[object Map]"===T(t),_=t=>"[object Set]"===T(t),v=t=>"[object RegExp]"===T(t),y=t=>"function"===typeof t,x=t=>"string"===typeof t,b=t=>"symbol"===typeof t,M=t=>null!==t&&"object"===typeof t,w=t=>M(t)&&y(t.then)&&y(t.catch),S=Object.prototype.toString,T=t=>S.call(t),E=t=>T(t).slice(8,-1),P=t=>"[object Object]"===T(t),L=t=>x(t)&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,A=i(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),C=t=>{const e=Object.create(null);return n=>{const i=e[n];return i||(e[n]=t(n))}},R=/-(\w)/g,I=C((t=>t.replace(R,((t,e)=>e?e.toUpperCase():"")))),D=/\B([A-Z])/g,O=C((t=>t.replace(D,"-$1").toLowerCase())),z=C((t=>t.charAt(0).toUpperCase()+t.slice(1))),N=C((t=>t?`on${z(t)}`:"")),k=(t,e)=>!Object.is(t,e),U=(t,e)=>{for(let n=0;n<t.length;n++)t[n](e)},B=(t,e,n)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:n})},F=t=>{const e=parseFloat(t);return isNaN(e)?t:e},V=t=>{const e=x(t)?Number(t):NaN;return isNaN(e)?t:e};let H;const W=()=>H||(H="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof self?self:"undefined"!==typeof window?window:"undefined"!==typeof n.g?n.g:{});const G="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console",j=i(G);function Z(t){if(m(t)){const e={};for(let n=0;n<t.length;n++){const i=t[n],r=x(i)?K(i):Z(i);if(r)for(const t in r)e[t]=r[t]}return e}return x(t)||M(t)?t:void 0}const q=/;(?![^(]*\))/g,X=/:([^]+)/,Y=/\/\*[^]*?\*\//g;function K(t){const e={};return t.replace(Y,"").split(q).forEach((t=>{if(t){const n=t.split(X);n.length>1&&(e[n[0].trim()]=n[1].trim())}})),e}function J(t){let e="";if(x(t))e=t;else if(m(t))for(let n=0;n<t.length;n++){const i=J(t[n]);i&&(e+=i+" ")}else if(M(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}},570:function(t){"use strict";function e(t,e,i){i=i||2;var o,a,s,l,h,c,d,p=e&&e.length,f=p?e[0]*i:t.length,m=n(t,0,f,i,!0),g=[];if(!m||m.next===m.prev)return g;if(p&&(m=u(t,e,m,i)),t.length>80*i){o=s=t[0],a=l=t[1];for(var _=i;_<f;_+=i)h=t[_],c=t[_+1],h<o&&(o=h),c<a&&(a=c),h>s&&(s=h),c>l&&(l=c);d=Math.max(s-o,l-a),d=0!==d?32767/d:0}return r(m,g,i,o,a,d,0),g}function n(t,e,n,i,r){var o,a;if(r===I(t,e,n,i)>0)for(o=e;o<n;o+=i)a=A(o,t[o],t[o+1],a);else for(o=n-i;o>=e;o-=i)a=A(o,t[o],t[o+1],a);return a&&b(a,a.next)&&(C(a),a=a.next),a}function i(t,e){if(!t)return t;e||(e=t);var n,i=t;do{if(n=!1,i.steiner||!b(i,i.next)&&0!==x(i.prev,i,i.next))i=i.next;else{if(C(i),i=e=i.prev,i===i.next)break;n=!0}}while(n||i!==e);return e}function r(t,e,n,u,h,c,d){if(t){!d&&c&&f(t,u,h,c);var p,m,g=t;while(t.prev!==t.next)if(p=t.prev,m=t.next,c?a(t,u,h,c):o(t))e.push(p.i/n|0),e.push(t.i/n|0),e.push(m.i/n|0),C(t),t=m.next,g=m.next;else if(t=m,t===g){d?1===d?(t=s(i(t),e,n),r(t,e,n,u,h,c,2)):2===d&&l(t,e,n,u,h,c):r(i(t),e,n,u,h,c,1);break}}}function o(t){var e=t.prev,n=t,i=t.next;if(x(e,n,i)>=0)return!1;var r=e.x,o=n.x,a=i.x,s=e.y,l=n.y,u=i.y,h=r<o?r<a?r:a:o<a?o:a,c=s<l?s<u?s:u:l<u?l:u,d=r>o?r>a?r:a:o>a?o:a,p=s>l?s>u?s:u:l>u?l:u,f=i.next;while(f!==e){if(f.x>=h&&f.x<=d&&f.y>=c&&f.y<=p&&v(r,s,o,l,a,u,f.x,f.y)&&x(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function a(t,e,n,i){var r=t.prev,o=t,a=t.next;if(x(r,o,a)>=0)return!1;var s=r.x,l=o.x,u=a.x,h=r.y,c=o.y,d=a.y,p=s<l?s<u?s:u:l<u?l:u,f=h<c?h<d?h:d:c<d?c:d,m=s>l?s>u?s:u:l>u?l:u,_=h>c?h>d?h:d:c>d?c:d,y=g(p,f,e,n,i),b=g(m,_,e,n,i),M=t.prevZ,w=t.nextZ;while(M&&M.z>=y&&w&&w.z<=b){if(M.x>=p&&M.x<=m&&M.y>=f&&M.y<=_&&M!==r&&M!==a&&v(s,h,l,c,u,d,M.x,M.y)&&x(M.prev,M,M.next)>=0)return!1;if(M=M.prevZ,w.x>=p&&w.x<=m&&w.y>=f&&w.y<=_&&w!==r&&w!==a&&v(s,h,l,c,u,d,w.x,w.y)&&x(w.prev,w,w.next)>=0)return!1;w=w.nextZ}while(M&&M.z>=y){if(M.x>=p&&M.x<=m&&M.y>=f&&M.y<=_&&M!==r&&M!==a&&v(s,h,l,c,u,d,M.x,M.y)&&x(M.prev,M,M.next)>=0)return!1;M=M.prevZ}while(w&&w.z<=b){if(w.x>=p&&w.x<=m&&w.y>=f&&w.y<=_&&w!==r&&w!==a&&v(s,h,l,c,u,d,w.x,w.y)&&x(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function s(t,e,n){var r=t;do{var o=r.prev,a=r.next.next;!b(o,a)&&M(o,r,r.next,a)&&E(o,a)&&E(a,o)&&(e.push(o.i/n|0),e.push(r.i/n|0),e.push(a.i/n|0),C(r),C(r.next),r=t=a),r=r.next}while(r!==t);return i(r)}function l(t,e,n,o,a,s){var l=t;do{var u=l.next.next;while(u!==l.prev){if(l.i!==u.i&&y(l,u)){var h=L(l,u);return l=i(l,l.next),h=i(h,h.next),r(l,e,n,o,a,s,0),void r(h,e,n,o,a,s,0)}u=u.next}l=l.next}while(l!==t)}function u(t,e,i,r){var o,a,s,l,u,d=[];for(o=0,a=e.length;o<a;o++)s=e[o]*r,l=o<a-1?e[o+1]*r:t.length,u=n(t,s,l,r,!1),u===u.next&&(u.steiner=!0),d.push(_(u));for(d.sort(h),o=0;o<d.length;o++)i=c(d[o],i);return i}function h(t,e){return t.x-e.x}function c(t,e){var n=d(t,e);if(!n)return e;var r=L(n,t);return i(r,r.next),i(n,n.next)}function d(t,e){var n,i=e,r=t.x,o=t.y,a=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var s=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&s>a&&(a=s,n=i.x<i.next.x?i:i.next,s===r))return n}i=i.next}while(i!==e);if(!n)return null;var l,u=n,h=n.x,c=n.y,d=1/0;i=n;do{r>=i.x&&i.x>=h&&r!==i.x&&v(o<c?r:a,o,h,c,o<c?a:r,o,i.x,i.y)&&(l=Math.abs(o-i.y)/(r-i.x),E(i,t)&&(l<d||l===d&&(i.x>n.x||i.x===n.x&&p(n,i)))&&(n=i,d=l)),i=i.next}while(i!==u);return n}function p(t,e){return x(t.prev,t,e.prev)<0&&x(e.next,t,t.next)<0}function f(t,e,n,i){var r=t;do{0===r.z&&(r.z=g(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,m(r)}function m(t){var e,n,i,r,o,a,s,l,u=1;do{n=t,t=null,o=null,a=0;while(n){for(a++,i=n,s=0,e=0;e<u;e++)if(s++,i=i.nextZ,!i)break;l=u;while(s>0||l>0&&i)0!==s&&(0===l||!i||n.z<=i.z)?(r=n,n=n.nextZ,s--):(r=i,i=i.nextZ,l--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;n=i}o.nextZ=null,u*=2}while(a>1);return t}function g(t,e,n,i,r){return t=(t-n)*r|0,e=(e-i)*r|0,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function _(t){var e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function v(t,e,n,i,r,o,a,s){return(r-a)*(e-s)>=(t-a)*(o-s)&&(t-a)*(i-s)>=(n-a)*(e-s)&&(n-a)*(o-s)>=(r-a)*(i-s)}function y(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!T(t,e)&&(E(t,e)&&E(e,t)&&P(t,e)&&(x(t.prev,t,e.prev)||x(t,e.prev,e))||b(t,e)&&x(t.prev,t,t.next)>0&&x(e.prev,e,e.next)>0)}function x(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function b(t,e){return t.x===e.x&&t.y===e.y}function M(t,e,n,i){var r=S(x(t,e,n)),o=S(x(t,e,i)),a=S(x(n,i,t)),s=S(x(n,i,e));return r!==o&&a!==s||(!(0!==r||!w(t,n,e))||(!(0!==o||!w(t,i,e))||(!(0!==a||!w(n,t,i))||!(0!==s||!w(n,e,i)))))}function w(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function S(t){return t>0?1:t<0?-1:0}function T(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&M(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function E(t,e){return x(t.prev,t,t.next)<0?x(t,e,t.next)>=0&&x(t,t.prev,e)>=0:x(t,e,t.prev)<0||x(t,t.next,e)<0}function P(t,e){var n=t,i=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!==n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}function L(t,e){var n=new R(t.i,t.x,t.y),i=new R(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function A(t,e,n,i){var r=new R(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function C(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function R(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function I(t,e,n,i){for(var r=0,o=e,a=n-i;o<n;o+=i)r+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return r}t.exports=e,t.exports["default"]=e,e.deviation=function(t,e,n,i){var r=e&&e.length,o=r?e[0]*n:t.length,a=Math.abs(I(t,0,o,n));if(r)for(var s=0,l=e.length;s<l;s++){var u=e[s]*n,h=s<l-1?e[s+1]*n:t.length;a-=Math.abs(I(t,u,h,n))}var c=0;for(s=0;s<i.length;s+=3){var d=i[s]*n,p=i[s+1]*n,f=i[s+2]*n;c+=Math.abs((t[d]-t[f])*(t[p+1]-t[d+1])-(t[d]-t[p])*(t[f+1]-t[d+1]))}return 0===a&&0===c?0:Math.abs((c-a)/a)},e.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},i=0,r=0;r<t.length;r++){for(var o=0;o<t[r].length;o++)for(var a=0;a<e;a++)n.vertices.push(t[r][o][a]);r>0&&(i+=t[r-1].length,n.holes.push(i))}return n}},769:function(){(function(){"use strict";var t=Symbol("newer"),e=Symbol("older"),n=function(t,e){"number"!==typeof t&&(e=t,t=0),this.size=0,this.limit=t,this.oldest=this.newest=void 0,this._keymap=new Map,e&&(this.assign(e),t<1&&(this.limit=this.size))};function i(n,i){this.key=n,this.value=i,this[t]=void 0,this[e]=void 0}function r(t){this.entry=t}function o(t){this.entry=t}function a(t){this.entry=t}function s(t,e){var n=0,i=null;i=setInterval((function(){if(n>=20)throw clearInterval(i),new Error("window.google not found after 10 seconds");window.google&&window.google.maps&&window.google.maps.Map&&(clearInterval(i),t.call(e)),++n}),500)}n.prototype._markEntryAsUsed=function(n){n!==this.newest&&(n[t]&&(n===this.oldest&&(this.oldest=n[t]),n[t][e]=n[e]),n[e]&&(n[e][t]=n[t]),n[t]=void 0,n[e]=this.newest,this.newest&&(this.newest[t]=n),this.newest=n)},n.prototype.assign=function(n){var r,o=this.limit||Number.MAX_VALUE;this._keymap.clear();for(var a=n[Symbol.iterator](),s=a.next();!s.done;s=a.next()){var l=new i(s.value[0],s.value[1]);if(this._keymap.set(l.key,l),r?(r[t]=l,l[e]=r):this.oldest=l,r=l,0==o--)throw new Error("overflow")}this.newest=r,this.size=this._keymap.size},n.prototype.get=function(t){var e=this._keymap.get(t);if(e)return this._markEntryAsUsed(e),e.value},n.prototype.set=function(n,r){var o=this._keymap.get(n);return o?(o.value=r,this._markEntryAsUsed(o),this):(this._keymap.set(n,o=new i(n,r)),this.newest?(this.newest[t]=o,o[e]=this.newest):this.oldest=o,this.newest=o,++this.size,this.size>this.limit&&this.shift(),this)},n.prototype.shift=function(){var n=this.oldest;if(n)return this.oldest[t]?(this.oldest=this.oldest[t],this.oldest[e]=void 0):(this.oldest=void 0,this.newest=void 0),n[t]=n[e]=void 0,this._keymap.delete(n.key),--this.size,[n.key,n.value]},n.prototype.find=function(t){var e=this._keymap.get(t);return e?e.value:void 0},n.prototype.has=function(t){return this._keymap.has(t)},n.prototype.delete=function(n){var i=this._keymap.get(n);if(i)return this._keymap.delete(i.key),i[t]&&i[e]?(i[e][t]=i[t],i[t][e]=i[e]):i[t]?(i[t][e]=void 0,this.oldest=i[t]):i[e]?(i[e][t]=void 0,this.newest=i[e]):this.oldest=this.newest=void 0,this.size--,i.value},n.prototype.clear=function(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()},n.prototype.keys=function(){return new o(this.oldest)},n.prototype.values=function(){return new a(this.oldest)},n.prototype.entries=function(){return this},n.prototype[Symbol.iterator]=function(){return new r(this.oldest)},n.prototype.forEach=function(e,n){"object"!==typeof n&&(n=this);var i=this.oldest;while(i)e.call(n,i.value,i.key,this),i=i[t]},n.prototype.toJSON=function(){var e=new Array(this.size),n=0,i=this.oldest;while(i)e[n++]={key:i.key,value:i.value},i=i[t];return e},n.prototype.toString=function(){var e="",n=this.oldest;while(n)e+=String(n.key)+":"+n.value,n=n[t],n&&(e+=" < ");return e},r.prototype[Symbol.iterator]=function(){return this},r.prototype.next=function(){var e=this.entry;return e?(this.entry=e[t],{done:!1,value:[e.key,e.value]}):{done:!0,value:void 0}},o.prototype[Symbol.iterator]=function(){return this},o.prototype.next=function(){var e=this.entry;return e?(this.entry=e[t],{done:!1,value:e.key}):{done:!0,value:void 0}},a.prototype[Symbol.iterator]=function(){return this},a.prototype.next=function(){var e=this.entry;return e?(this.entry=e[t],{done:!1,value:e.value}):{done:!0,value:void 0}},L.GridLayer.GoogleMutant=L.GridLayer.extend({options:{maxZoom:21,type:"roadmap",maxNativeZoom:21},initialize:function(t){L.GridLayer.prototype.initialize.call(this,t),this._tileCallbacks={},this._lru=new n(100),this._imagesPerTile="hybrid"===this.options.type?2:1,this._boundOnMutatedImage=this._onMutatedImage.bind(this)},onAdd:function(t){var e=this;L.GridLayer.prototype.onAdd.call(this,t),this._initMutantContainer(),this._logoContainer&&t._controlCorners.bottomleft.appendChild(this._logoContainer),this._attributionContainer&&t._controlCorners.bottomright.appendChild(this._attributionContainer),s((function(){e._map&&(e._initMutant(),google.maps.event.addListenerOnce(e._mutant,"idle",(function(){e._map&&(e._checkZoomLevels(),e._mutantIsReady=!0)})))}))},onRemove:function(t){L.GridLayer.prototype.onRemove.call(this,t),this._observer.disconnect(),t._container.removeChild(this._mutantContainer),this._logoContainer&&L.DomUtil.remove(this._logoContainer),this._attributionContainer&&L.DomUtil.remove(this._attributionContainer),this._mutant&&google.maps.event.clearListeners(this._mutant,"idle")},addGoogleLayer:function(t,e){var n=this;return this._subLayers||(this._subLayers={}),this.whenReady((function(){var i=google.maps[t],r=new i(e);r.setMap(n._mutant),n._subLayers[t]=r})),this},removeGoogleLayer:function(t){var e=this;return this.whenReady((function(){var n=e._subLayers&&e._subLayers[t];n&&(n.setMap(null),delete e._subLayers[t])})),this},_initMutantContainer:function(){this._mutantContainer||(this._mutantContainer=L.DomUtil.create("div","leaflet-google-mutant leaflet-top leaflet-left"),this._mutantContainer.id="_MutantContainer_"+L.Util.stamp(this._mutantContainer),this._mutantContainer.style.pointerEvents="none",this._mutantContainer.style.visibility="hidden",L.DomEvent.off(this._mutantContainer)),this._map.getContainer().appendChild(this._mutantContainer),this.setOpacity(this.options.opacity);var t=this._mutantContainer.style;this._map.options.zoomSnap<1?(t.width="180%",t.height="180%"):(t.width="100%",t.height="100%"),t.zIndex=-1,this._attachObserver(this._mutantContainer)},_initMutant:function(){if(!this._mutant){var t=new google.maps.Map(this._mutantContainer,{center:{lat:0,lng:0},zoom:0,tilt:0,mapTypeId:this.options.type,disableDefaultUI:!0,keyboardShortcuts:!1,draggable:!1,disableDoubleClickZoom:!0,scrollwheel:!1,styles:this.options.styles||[],backgroundColor:"transparent"});this._mutant=t,this._update(),this.fire("spawned",{mapObject:t}),this._waitControls(),this.once("controls_ready",this._setupAttribution)}},_attachObserver:function(t){this._observer||(this._observer=new MutationObserver(this._onMutations.bind(this))),this._observer.observe(t,{childList:!0,subtree:!0}),Array.prototype.forEach.call(t.querySelectorAll("img"),this._boundOnMutatedImage)},_waitControls:function(){var t=this,e=setInterval((function(){var n,i=t._mutant.__gm.layoutManager;i&&(clearInterval(e),Object.keys(i).forEach((function(t){var e=i[t];e.get&&e.get(1)instanceof Node&&(n=e)})),t.fire("controls_ready",{positions:n}))}),50)},_setupAttribution:function(t){if(this._map){var e=google.maps.ControlPosition,n=this._attributionContainer=t.positions.get(e.BOTTOM_RIGHT);L.DomUtil.addClass(n,"leaflet-control leaflet-control-attribution"),L.DomEvent.disableClickPropagation(n),n.style.height="14px",this._map._controlCorners.bottomright.appendChild(n),this._logoContainer=t.positions.get(e.BOTTOM_LEFT),this._logoContainer.style.pointerEvents="auto",this._map._controlCorners.bottomleft.appendChild(this._logoContainer)}},_onMutations:function(t){for(var e=0;e<t.length;++e)for(var n=t[e],i=0;i<n.addedNodes.length;++i){var r=n.addedNodes[i];r instanceof HTMLImageElement?this._onMutatedImage(r):r instanceof HTMLElement&&Array.prototype.forEach.call(r.querySelectorAll("img"),this._boundOnMutatedImage)}},_roadRegexp:/!1i(\d+)!2i(\d+)!3i(\d+|VinaFnapurmBegrtn)!/,_satRegexp:/x=(\d+)&y=(\d+)&z=(\d+|VinaFnapurmBegrtn)/,_onMutatedImage:function(t){var e,n=t.src.match(this._roadRegexp),i=0;if(n?(e={z:n[1],x:n[2],y:n[3]},this._imagesPerTile>1&&(t.style.zIndex=1,i=1)):(n=t.src.match(this._satRegexp),n&&(e={x:n[1],y:n[2],z:n[3]}),i=0),e){var r=this._tileCoordsToKey(e);t.style.position="absolute";var o=r+"/"+i;this._lru.set(o,t),o in this._tileCallbacks&&this._tileCallbacks[o]&&(this._tileCallbacks[o].forEach((function(e){return e(t)})),delete this._tileCallbacks[o])}},createTile:function(t,e){var n=this._tileCoordsToKey(t),i=L.DomUtil.create("div");i.style.textAlign="left",i.dataset.pending=this._imagesPerTile,e=e.bind(this,null,i);for(var r=0;r<this._imagesPerTile;++r){var o=n+"/"+r,a=this._lru.get(o);a?(i.appendChild(this._clone(a)),--i.dataset.pending):(this._tileCallbacks[o]=this._tileCallbacks[o]||[],this._tileCallbacks[o].push(function(t){return function(n){t.appendChild(this._clone(n)),--t.dataset.pending,parseInt(t.dataset.pending)||e()}.bind(this)}.bind(this)(i)))}return parseInt(i.dataset.pending)||L.Util.requestAnimFrame(e),i},_clone:function(t){var e=t.cloneNode(!0);return e.style.visibility="visible",e},_checkZoomLevels:function(){var t=this._map.getZoom(),e=this._mutant.getZoom();t&&e&&(e!==t||e>this.options.maxNativeZoom)&&this._setMaxNativeZoom(e)},_setMaxNativeZoom:function(t){t!==this.options.maxNativeZoom&&(this.options.maxNativeZoom=t,this._resetView())},_update:function(t){if(this._mutant){t=t||this._map.getCenter();var e=new google.maps.LatLng(t.lat,t.lng),n=Math.round(this._map.getZoom()),i=this._mutant.getZoom();this._mutant.setCenter(e),n!==i&&(this._mutant.setZoom(n),this._mutantIsReady&&this._checkZoomLevels())}L.GridLayer.prototype._update.call(this,t)},whenReady:function(t,e){return this._mutant?t.call(e||this,{target:this}):this.on("spawned",t,e),this}}),L.gridLayer.googleMutant=function(t){return new L.GridLayer.GoogleMutant(t)}})()},481:function(t,e){
|
|
2
|
-
/* @preserve
|
|
3
|
-
* Leaflet 1.8.0, a JS library for interactive maps. https://leafletjs.com
|
|
4
|
-
* (c) 2010-2022 Vladimir Agafonkin, (c) 2010-2011 CloudMade
|
|
5
|
-
*/
|
|
6
|
-
(function(t,n){n(e)})(0,(function(t){"use strict";var e="1.8.0";function n(t){var e,n,i,r;for(n=1,i=arguments.length;n<i;n++)for(e in r=arguments[n],r)t[e]=r[e];return t}var i=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}();function r(t,e){var n=Array.prototype.slice;if(t.bind)return t.bind.apply(t,n.call(arguments,1));var i=n.call(arguments,2);return function(){return t.apply(e,i.length?i.concat(n.call(arguments)):arguments)}}var o=0;function a(t){return"_leaflet_id"in t||(t["_leaflet_id"]=++o),t._leaflet_id}function s(t,e,n){var i,r,o,a;return a=function(){i=!1,r&&(o.apply(n,r),r=!1)},o=function(){i?r=arguments:(t.apply(n,arguments),setTimeout(a,e),i=!0)},o}function l(t,e,n){var i=e[1],r=e[0],o=i-r;return t===i&&n?t:((t-r)%o+o)%o+r}function u(){return!1}function h(t,e){if(!1===e)return t;var n=Math.pow(10,void 0===e?6:e);return Math.round(t*n)/n}function c(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function d(t){return c(t).split(/\s+/)}function p(t,e){for(var n in Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?i(t.options):{}),e)t.options[n]=e[n];return t.options}function f(t,e,n){var i=[];for(var r in t)i.push(encodeURIComponent(n?r.toUpperCase():r)+"="+encodeURIComponent(t[r]));return(e&&-1!==e.indexOf("?")?"&":"?")+i.join("&")}var m=/\{ *([\w_ -]+) *\}/g;function g(t,e){return t.replace(m,(function(t,n){var i=e[n];if(void 0===i)throw new Error("No value provided for variable "+t);return"function"===typeof i&&(i=i(e)),i}))}var _=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function v(t,e){for(var n=0;n<t.length;n++)if(t[n]===e)return n;return-1}var y="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function x(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var b=0;function M(t){var e=+new Date,n=Math.max(0,16-(e-b));return b=e+n,window.setTimeout(t,n)}var w=window.requestAnimationFrame||x("RequestAnimationFrame")||M,S=window.cancelAnimationFrame||x("CancelAnimationFrame")||x("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function T(t,e,n){if(!n||w!==M)return w.call(window,r(t,e));t.call(e)}function E(t){t&&S.call(window,t)}var P={__proto__:null,extend:n,create:i,bind:r,get lastId(){return o},stamp:a,throttle:s,wrapNum:l,falseFn:u,formatNum:h,trim:c,splitWords:d,setOptions:p,getParamString:f,template:g,isArray:_,indexOf:v,emptyImageUrl:y,requestFn:w,cancelFn:S,requestAnimFrame:T,cancelAnimFrame:E};function A(){}function C(t){if("undefined"!==typeof L&&L&&L.Mixin){t=_(t)?t:[t];for(var e=0;e<t.length;e++)t[e]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}A.extend=function(t){var e=function(){p(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},r=e.__super__=this.prototype,o=i(r);for(var a in o.constructor=e,e.prototype=o,this)Object.prototype.hasOwnProperty.call(this,a)&&"prototype"!==a&&"__super__"!==a&&(e[a]=this[a]);return t.statics&&n(e,t.statics),t.includes&&(C(t.includes),n.apply(null,[o].concat(t.includes))),n(o,t),delete o.statics,delete o.includes,o.options&&(o.options=r.options?i(r.options):{},n(o.options,t.options)),o._initHooks=[],o.callInitHooks=function(){if(!this._initHooksCalled){r.callInitHooks&&r.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=o._initHooks.length;t<e;t++)o._initHooks[t].call(this)}},e},A.include=function(t){var e=this.prototype.options;return n(this.prototype,t),t.options&&(this.prototype.options=e,this.mergeOptions(t.options)),this},A.mergeOptions=function(t){return n(this.prototype.options,t),this},A.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),n="function"===typeof t?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(n),this};var R={on:function(t,e,n){if("object"===typeof t)for(var i in t)this._on(i,t[i],e);else{t=d(t);for(var r=0,o=t.length;r<o;r++)this._on(t[r],e,n)}return this},off:function(t,e,n){if(arguments.length)if("object"===typeof t)for(var i in t)this._off(i,t[i],e);else{t=d(t);for(var r=1===arguments.length,o=0,a=t.length;o<a;o++)r?this._off(t[o]):this._off(t[o],e,n)}else delete this._events;return this},_on:function(t,e,n){if("function"===typeof e){this._events=this._events||{};var i=this._events[t];i||(i=[],this._events[t]=i),n===this&&(n=void 0);for(var r={fn:e,ctx:n},o=i,a=0,s=o.length;a<s;a++)if(o[a].fn===e&&o[a].ctx===n)return;o.push(r)}else console.warn("wrong listener type: "+typeof e)},_off:function(t,e,n){var i,r,o;if(this._events&&(i=this._events[t],i))if(1!==arguments.length)if(n===this&&(n=void 0),"function"===typeof e){for(r=0,o=i.length;r<o;r++){var a=i[r];if(a.ctx===n&&a.fn===e)return this._firingCount&&(a.fn=u,this._events[t]=i=i.slice()),void i.splice(r,1)}console.warn("listener not found")}else console.warn("wrong listener type: "+typeof e);else{if(this._firingCount)for(r=0,o=i.length;r<o;r++)i[r].fn=u;delete this._events[t]}},fire:function(t,e,i){if(!this.listens(t,i))return this;var r=n({},e,{type:t,target:this,sourceTarget:e&&e.sourceTarget||this});if(this._events){var o=this._events[t];if(o){this._firingCount=this._firingCount+1||1;for(var a=0,s=o.length;a<s;a++){var l=o[a];l.fn.call(l.ctx||this,r)}this._firingCount--}}return i&&this._propagateEvent(r),this},listens:function(t,e){"string"!==typeof t&&console.warn('"string" type argument expected');var n=this._events&&this._events[t];if(n&&n.length)return!0;if(e)for(var i in this._eventParents)if(this._eventParents[i].listens(t,e))return!0;return!1},once:function(t,e,n){if("object"===typeof t){for(var i in t)this.once(i,t[i],e);return this}var o=r((function(){this.off(t,e,n).off(t,o,n)}),this);return this.on(t,e,n).on(t,o,n)},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[a(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[a(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,n({layer:t.target,propagatedFrom:t.target},t),!0)}};R.addEventListener=R.on,R.removeEventListener=R.clearAllEventListeners=R.off,R.addOneTimeEventListener=R.once,R.fireEvent=R.fire,R.hasEventListeners=R.listens;var I=A.extend(R);function D(t,e,n){this.x=n?Math.round(t):t,this.y=n?Math.round(e):e}var O=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};function z(t,e,n){return t instanceof D?t:_(t)?new D(t[0],t[1]):void 0===t||null===t?t:"object"===typeof t&&"x"in t&&"y"in t?new D(t.x,t.y):new D(t,e,n)}function N(t,e){if(t)for(var n=e?[t,e]:t,i=0,r=n.length;i<r;i++)this.extend(n[i])}function k(t,e){return!t||t instanceof N?t:new N(t,e)}function U(t,e){if(t)for(var n=e?[t,e]:t,i=0,r=n.length;i<r;i++)this.extend(n[i])}function B(t,e){return t instanceof U?t:new U(t,e)}function F(t,e,n){if(isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=+t,this.lng=+e,void 0!==n&&(this.alt=+n)}function V(t,e,n){return t instanceof F?t:_(t)&&"object"!==typeof t[0]?3===t.length?new F(t[0],t[1],t[2]):2===t.length?new F(t[0],t[1]):null:void 0===t||null===t?t:"object"===typeof t&&"lat"in t?new F(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new F(t,e,n)}D.prototype={clone:function(){return new D(this.x,this.y)},add:function(t){return this.clone()._add(z(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(z(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new D(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new D(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=O(this.x),this.y=O(this.y),this},distanceTo:function(t){t=z(t);var e=t.x-this.x,n=t.y-this.y;return Math.sqrt(e*e+n*n)},equals:function(t){return t=z(t),t.x===this.x&&t.y===this.y},contains:function(t){return t=z(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+h(this.x)+", "+h(this.y)+")"}},N.prototype={extend:function(t){return t=z(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new D((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new D(this.min.x,this.max.y)},getTopRight:function(){return new D(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,n;return t="number"===typeof t[0]||t instanceof D?z(t):k(t),t instanceof N?(e=t.min,n=t.max):e=n=t,e.x>=this.min.x&&n.x<=this.max.x&&e.y>=this.min.y&&n.y<=this.max.y},intersects:function(t){t=k(t);var e=this.min,n=this.max,i=t.min,r=t.max,o=r.x>=e.x&&i.x<=n.x,a=r.y>=e.y&&i.y<=n.y;return o&&a},overlaps:function(t){t=k(t);var e=this.min,n=this.max,i=t.min,r=t.max,o=r.x>e.x&&i.x<n.x,a=r.y>e.y&&i.y<n.y;return o&&a},isValid:function(){return!(!this.min||!this.max)}},U.prototype={extend:function(t){var e,n,i=this._southWest,r=this._northEast;if(t instanceof F)e=t,n=t;else{if(!(t instanceof U))return t?this.extend(V(t)||B(t)):this;if(e=t._southWest,n=t._northEast,!e||!n)return this}return i||r?(i.lat=Math.min(e.lat,i.lat),i.lng=Math.min(e.lng,i.lng),r.lat=Math.max(n.lat,r.lat),r.lng=Math.max(n.lng,r.lng)):(this._southWest=new F(e.lat,e.lng),this._northEast=new F(n.lat,n.lng)),this},pad:function(t){var e=this._southWest,n=this._northEast,i=Math.abs(e.lat-n.lat)*t,r=Math.abs(e.lng-n.lng)*t;return new U(new F(e.lat-i,e.lng-r),new F(n.lat+i,n.lng+r))},getCenter:function(){return new F((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new F(this.getNorth(),this.getWest())},getSouthEast:function(){return new F(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"===typeof t[0]||t instanceof F||"lat"in t?V(t):B(t);var e,n,i=this._southWest,r=this._northEast;return t instanceof U?(e=t.getSouthWest(),n=t.getNorthEast()):e=n=t,e.lat>=i.lat&&n.lat<=r.lat&&e.lng>=i.lng&&n.lng<=r.lng},intersects:function(t){t=B(t);var e=this._southWest,n=this._northEast,i=t.getSouthWest(),r=t.getNorthEast(),o=r.lat>=e.lat&&i.lat<=n.lat,a=r.lng>=e.lng&&i.lng<=n.lng;return o&&a},overlaps:function(t){t=B(t);var e=this._southWest,n=this._northEast,i=t.getSouthWest(),r=t.getNorthEast(),o=r.lat>e.lat&&i.lat<n.lat,a=r.lng>e.lng&&i.lng<n.lng;return o&&a},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return!!t&&(t=B(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e))},isValid:function(){return!(!this._southWest||!this._northEast)}},F.prototype={equals:function(t,e){if(!t)return!1;t=V(t);var n=Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng));return n<=(void 0===e?1e-9:e)},toString:function(t){return"LatLng("+h(this.lat,t)+", "+h(this.lng,t)+")"},distanceTo:function(t){return W.distance(this,V(t))},wrap:function(){return W.wrapLatLng(this)},toBounds:function(t){var e=180*t/40075017,n=e/Math.cos(Math.PI/180*this.lat);return B([this.lat-e,this.lng-n],[this.lat+e,this.lng+n])},clone:function(){return new F(this.lat,this.lng,this.alt)}};var H={latLngToPoint:function(t,e){var n=this.projection.project(t),i=this.scale(e);return this.transformation._transform(n,i)},pointToLatLng:function(t,e){var n=this.scale(e),i=this.transformation.untransform(t,n);return this.projection.unproject(i)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var e=this.projection.bounds,n=this.scale(t),i=this.transformation.transform(e.min,n),r=this.transformation.transform(e.max,n);return new N(i,r)},infinite:!1,wrapLatLng:function(t){var e=this.wrapLng?l(t.lng,this.wrapLng,!0):t.lng,n=this.wrapLat?l(t.lat,this.wrapLat,!0):t.lat,i=t.alt;return new F(n,e,i)},wrapLatLngBounds:function(t){var e=t.getCenter(),n=this.wrapLatLng(e),i=e.lat-n.lat,r=e.lng-n.lng;if(0===i&&0===r)return t;var o=t.getSouthWest(),a=t.getNorthEast(),s=new F(o.lat-i,o.lng-r),l=new F(a.lat-i,a.lng-r);return new U(s,l)}},W=n({},H,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var n=Math.PI/180,i=t.lat*n,r=e.lat*n,o=Math.sin((e.lat-t.lat)*n/2),a=Math.sin((e.lng-t.lng)*n/2),s=o*o+Math.cos(i)*Math.cos(r)*a*a,l=2*Math.atan2(Math.sqrt(s),Math.sqrt(1-s));return this.R*l}}),G=6378137,j={R:G,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,n=this.MAX_LATITUDE,i=Math.max(Math.min(n,t.lat),-n),r=Math.sin(i*e);return new D(this.R*t.lng*e,this.R*Math.log((1+r)/(1-r))/2)},unproject:function(t){var e=180/Math.PI;return new F((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:function(){var t=G*Math.PI;return new N([-t,-t],[t,t])}()};function Z(t,e,n,i){if(_(t))return this._a=t[0],this._b=t[1],this._c=t[2],void(this._d=t[3]);this._a=t,this._b=e,this._c=n,this._d=i}function q(t,e,n,i){return new Z(t,e,n,i)}Z.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new D((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}};var X=n({},W,{code:"EPSG:3857",projection:j,transformation:function(){var t=.5/(Math.PI*j.R);return q(t,.5,-t,.5)}()}),Y=n({},X,{code:"EPSG:900913"});function K(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function J(t,e){var n,i,r,o,a,s,l="";for(n=0,r=t.length;n<r;n++){for(a=t[n],i=0,o=a.length;i<o;i++)s=a[i],l+=(i?"L":"M")+s.x+" "+s.y;l+=e?Ot.svg?"z":"x":""}return l||"M0 0"}var $=document.documentElement.style,Q="ActiveXObject"in window,tt=Q&&!document.addEventListener,et="msLaunchUri"in navigator&&!("documentMode"in document),nt=Dt("webkit"),it=Dt("android"),rt=Dt("android 2")||Dt("android 3"),ot=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),at=it&&Dt("Google")&&ot<537&&!("AudioNode"in window),st=!!window.opera,lt=!et&&Dt("chrome"),ut=Dt("gecko")&&!nt&&!st&&!Q,ht=!lt&&Dt("safari"),ct=Dt("phantom"),dt="OTransition"in $,pt=0===navigator.platform.indexOf("Win"),ft=Q&&"transition"in $,mt="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!rt,gt="MozPerspective"in $,_t=!window.L_DISABLE_3D&&(ft||mt||gt)&&!dt&&!ct,vt="undefined"!==typeof orientation||Dt("mobile"),yt=vt&&nt,xt=vt&&mt,bt=!window.PointerEvent&&window.MSPointerEvent,Mt=!(!window.PointerEvent&&!bt),wt="ontouchstart"in window||!!window.TouchEvent,St=!window.L_NO_TOUCH&&(wt||Mt),Tt=vt&&st,Et=vt&&ut,Pt=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Lt=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",u,e),window.removeEventListener("testPassiveEventSupport",u,e)}catch(n){}return t}(),At=function(){return!!document.createElement("canvas").getContext}(),Ct=!(!document.createElementNS||!K("svg").createSVGRect),Rt=!!Ct&&function(){var t=document.createElement("div");return t.innerHTML="<svg/>","http://www.w3.org/2000/svg"===(t.firstChild&&t.firstChild.namespaceURI)}(),It=!Ct&&function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"===typeof e.adj}catch(n){return!1}}();function Dt(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var Ot={ie:Q,ielt9:tt,edge:et,webkit:nt,android:it,android23:rt,androidStock:at,opera:st,chrome:lt,gecko:ut,safari:ht,phantom:ct,opera12:dt,win:pt,ie3d:ft,webkit3d:mt,gecko3d:gt,any3d:_t,mobile:vt,mobileWebkit:yt,mobileWebkit3d:xt,msPointer:bt,pointer:Mt,touch:St,touchNative:wt,mobileOpera:Tt,mobileGecko:Et,retina:Pt,passiveEvents:Lt,canvas:At,svg:Ct,vml:It,inlineSvg:Rt},zt=Ot.msPointer?"MSPointerDown":"pointerdown",Nt=Ot.msPointer?"MSPointerMove":"pointermove",kt=Ot.msPointer?"MSPointerUp":"pointerup",Ut=Ot.msPointer?"MSPointerCancel":"pointercancel",Bt={touchstart:zt,touchmove:Nt,touchend:kt,touchcancel:Ut},Ft={touchstart:Kt,touchmove:Yt,touchend:Yt,touchcancel:Yt},Vt={},Ht=!1;function Wt(t,e,n){return"touchstart"===e&&Xt(),Ft[e]?(n=Ft[e].bind(this,n),t.addEventListener(Bt[e],n,!1),n):(console.warn("wrong event specified:",e),L.Util.falseFn)}function Gt(t,e,n){Bt[e]?t.removeEventListener(Bt[e],n,!1):console.warn("wrong event specified:",e)}function jt(t){Vt[t.pointerId]=t}function Zt(t){Vt[t.pointerId]&&(Vt[t.pointerId]=t)}function qt(t){delete Vt[t.pointerId]}function Xt(){Ht||(document.addEventListener(zt,jt,!0),document.addEventListener(Nt,Zt,!0),document.addEventListener(kt,qt,!0),document.addEventListener(Ut,qt,!0),Ht=!0)}function Yt(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){for(var n in e.touches=[],Vt)e.touches.push(Vt[n]);e.changedTouches=[e],t(e)}}function Kt(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&je(e),Yt(t,e)}function Jt(t){var e,n,i={};for(n in t)e=t[n],i[n]=e&&e.bind?e.bind(t):e;return t=i,i.type="dblclick",i.detail=2,i.isTrusted=!1,i._simulated=!0,i}var $t=200;function Qt(t,e){t.addEventListener("dblclick",e);var n,i=0;function r(t){if(1===t.detail){if("mouse"!==t.pointerType&&(!t.sourceCapabilities||t.sourceCapabilities.firesTouchEvents)){var r=Date.now();r-i<=$t?(n++,2===n&&e(Jt(t))):n=1,i=r}}else n=t.detail}return t.addEventListener("click",r),{dblclick:e,simDblclick:r}}function te(t,e){t.removeEventListener("dblclick",e.dblclick),t.removeEventListener("click",e.simDblclick)}var ee,ne,ie,re,oe,ae=we(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),se=we(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),le="webkitTransition"===se||"OTransition"===se?se+"End":"transitionend";function ue(t){return"string"===typeof t?document.getElementById(t):t}function he(t,e){var n=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!n||"auto"===n)&&document.defaultView){var i=document.defaultView.getComputedStyle(t,null);n=i?i[e]:null}return"auto"===n?null:n}function ce(t,e,n){var i=document.createElement(t);return i.className=e||"",n&&n.appendChild(i),i}function de(t){var e=t.parentNode;e&&e.removeChild(t)}function pe(t){while(t.firstChild)t.removeChild(t.firstChild)}function fe(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function me(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function ge(t,e){if(void 0!==t.classList)return t.classList.contains(e);var n=xe(t);return n.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(n)}function _e(t,e){if(void 0!==t.classList)for(var n=d(e),i=0,r=n.length;i<r;i++)t.classList.add(n[i]);else if(!ge(t,e)){var o=xe(t);ye(t,(o?o+" ":"")+e)}}function ve(t,e){void 0!==t.classList?t.classList.remove(e):ye(t,c((" "+xe(t)+" ").replace(" "+e+" "," ")))}function ye(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}function xe(t){return t.correspondingElement&&(t=t.correspondingElement),void 0===t.className.baseVal?t.className:t.className.baseVal}function be(t,e){"opacity"in t.style?t.style.opacity=e:"filter"in t.style&&Me(t,e)}function Me(t,e){var n=!1,i="DXImageTransform.Microsoft.Alpha";try{n=t.filters.item(i)}catch(r){if(1===e)return}e=Math.round(100*e),n?(n.Enabled=100!==e,n.Opacity=e):t.style.filter+=" progid:"+i+"(opacity="+e+")"}function we(t){for(var e=document.documentElement.style,n=0;n<t.length;n++)if(t[n]in e)return t[n];return!1}function Se(t,e,n){var i=e||new D(0,0);t.style[ae]=(Ot.ie3d?"translate("+i.x+"px,"+i.y+"px)":"translate3d("+i.x+"px,"+i.y+"px,0)")+(n?" scale("+n+")":"")}function Te(t,e){t._leaflet_pos=e,Ot.any3d?Se(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function Ee(t){return t._leaflet_pos||new D(0,0)}if("onselectstart"in document)ee=function(){ze(window,"selectstart",je)},ne=function(){ke(window,"selectstart",je)};else{var Pe=we(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);ee=function(){if(Pe){var t=document.documentElement.style;ie=t[Pe],t[Pe]="none"}},ne=function(){Pe&&(document.documentElement.style[Pe]=ie,ie=void 0)}}function Le(){ze(window,"dragstart",je)}function Ae(){ke(window,"dragstart",je)}function Ce(t){while(-1===t.tabIndex)t=t.parentNode;t.style&&(Re(),re=t,oe=t.style.outline,t.style.outline="none",ze(window,"keydown",Re))}function Re(){re&&(re.style.outline=oe,re=void 0,oe=void 0,ke(window,"keydown",Re))}function Ie(t){do{t=t.parentNode}while((!t.offsetWidth||!t.offsetHeight)&&t!==document.body);return t}function De(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}var Oe={__proto__:null,TRANSFORM:ae,TRANSITION:se,TRANSITION_END:le,get:ue,getStyle:he,create:ce,remove:de,empty:pe,toFront:fe,toBack:me,hasClass:ge,addClass:_e,removeClass:ve,setClass:ye,getClass:xe,setOpacity:be,testProp:we,setTransform:Se,setPosition:Te,getPosition:Ee,get disableTextSelection(){return ee},get enableTextSelection(){return ne},disableImageDrag:Le,enableImageDrag:Ae,preventOutline:Ce,restoreOutline:Re,getSizedParentNode:Ie,getScale:De};function ze(t,e,n,i){if(e&&"object"===typeof e)for(var r in e)Fe(t,r,e[r],n);else{e=d(e);for(var o=0,a=e.length;o<a;o++)Fe(t,e[o],n,i)}return this}var Ne="_leaflet_events";function ke(t,e,n,i){if(1===arguments.length)Ue(t),delete t[Ne];else if(e&&"object"===typeof e)for(var r in e)Ve(t,r,e[r],n);else if(e=d(e),2===arguments.length)Ue(t,(function(t){return-1!==v(e,t)}));else for(var o=0,a=e.length;o<a;o++)Ve(t,e[o],n,i);return this}function Ue(t,e){for(var n in t[Ne]){var i=n.split(/\d/)[0];e&&!e(i)||Ve(t,i,null,null,n)}}var Be={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Fe(t,e,n,i){var r=e+a(n)+(i?"_"+a(i):"");if(t[Ne]&&t[Ne][r])return this;var o=function(e){return n.call(i||t,e||window.event)},s=o;!Ot.touchNative&&Ot.pointer&&0===e.indexOf("touch")?o=Wt(t,e,o):Ot.touch&&"dblclick"===e?o=Qt(t,o):"addEventListener"in t?"touchstart"===e||"touchmove"===e||"wheel"===e||"mousewheel"===e?t.addEventListener(Be[e]||e,o,!!Ot.passiveEvents&&{passive:!1}):"mouseenter"===e||"mouseleave"===e?(o=function(e){e=e||window.event,Ke(t,e)&&s(e)},t.addEventListener(Be[e],o,!1)):t.addEventListener(e,s,!1):t.attachEvent("on"+e,o),t[Ne]=t[Ne]||{},t[Ne][r]=o}function Ve(t,e,n,i,r){r=r||e+a(n)+(i?"_"+a(i):"");var o=t[Ne]&&t[Ne][r];if(!o)return this;!Ot.touchNative&&Ot.pointer&&0===e.indexOf("touch")?Gt(t,e,o):Ot.touch&&"dblclick"===e?te(t,o):"removeEventListener"in t?t.removeEventListener(Be[e]||e,o,!1):t.detachEvent("on"+e,o),t[Ne][r]=null}function He(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,this}function We(t){return Fe(t,"wheel",He),this}function Ge(t){return ze(t,"mousedown touchstart dblclick contextmenu",He),t["_leaflet_disable_click"]=!0,this}function je(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function Ze(t){return je(t),He(t),this}function qe(t,e){if(!e)return new D(t.clientX,t.clientY);var n=De(e),i=n.boundingClientRect;return new D((t.clientX-i.left)/n.x-e.clientLeft,(t.clientY-i.top)/n.y-e.clientTop)}var Xe=Ot.win&&Ot.chrome?2*window.devicePixelRatio:Ot.gecko?window.devicePixelRatio:1;function Ye(t){return Ot.edge?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/Xe:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}function Ke(t,e){var n=e.relatedTarget;if(!n)return!0;try{while(n&&n!==t)n=n.parentNode}catch(i){return!1}return n!==t}var Je={__proto__:null,on:ze,off:ke,stopPropagation:He,disableScrollPropagation:We,disableClickPropagation:Ge,preventDefault:je,stop:Ze,getMousePosition:qe,getWheelDelta:Ye,isExternalTarget:Ke,addListener:ze,removeListener:ke},$e=I.extend({run:function(t,e,n,i){this.stop(),this._el=t,this._inProgress=!0,this._duration=n||.25,this._easeOutPower=1/Math.max(i||.5,.2),this._startPos=Ee(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=T(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,n=1e3*this._duration;e<n?this._runFrame(this._easeOut(e/n),t):(this._runFrame(1),this._complete())},_runFrame:function(t,e){var n=this._startPos.add(this._offset.multiplyBy(t));e&&n._round(),Te(this._el,n),this.fire("step")},_complete:function(){E(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),Qe=I.extend({options:{crs:X,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,e){e=p(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=r(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(V(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=se&&Ot.any3d&&!Ot.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),ze(this._proxy,le,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,i){if(e=void 0===e?this._zoom:this._limitZoom(e),t=this._limitCenter(V(t),e,this.options.maxBounds),i=i||{},this._stop(),this._loaded&&!i.reset&&!0!==i){void 0!==i.animate&&(i.zoom=n({animate:i.animate},i.zoom),i.pan=n({animate:i.animate,duration:i.duration},i.pan));var r=this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,i.zoom):this._tryAnimatedPan(t,i.pan);if(r)return clearTimeout(this._sizeTimer),this}return this._resetView(t,e),this},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return t=t||(Ot.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+t,e)},zoomOut:function(t,e){return t=t||(Ot.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-t,e)},setZoomAround:function(t,e,n){var i=this.getZoomScale(e),r=this.getSize().divideBy(2),o=t instanceof D?t:this.latLngToContainerPoint(t),a=o.subtract(r).multiplyBy(1-1/i),s=this.containerPointToLatLng(r.add(a));return this.setView(s,e,{zoom:n})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():B(t);var n=z(e.paddingTopLeft||e.padding||[0,0]),i=z(e.paddingBottomRight||e.padding||[0,0]),r=this.getBoundsZoom(t,!1,n.add(i));if(r="number"===typeof e.maxZoom?Math.min(e.maxZoom,r):r,r===1/0)return{center:t.getCenter(),zoom:r};var o=i.subtract(n).divideBy(2),a=this.project(t.getSouthWest(),r),s=this.project(t.getNorthEast(),r),l=this.unproject(a.add(s).divideBy(2).add(o),r);return{center:l,zoom:r}},fitBounds:function(t,e){if(t=B(t),!t.isValid())throw new Error("Bounds are not valid.");var n=this._getBoundsCenterZoom(t,e);return this.setView(n.center,n.zoom,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t,e){if(t=z(t).round(),e=e||{},!t.x&&!t.y)return this.fire("moveend");if(!0!==e.animate&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new $e,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate){_e(this._mapPane,"leaflet-pan-anim");var n=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,n,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(t,e,n){if(n=n||{},!1===n.animate||!Ot.any3d)return this.setView(t,e,n);this._stop();var i=this.project(this.getCenter()),r=this.project(t),o=this.getSize(),a=this._zoom;t=V(t),e=void 0===e?a:e;var s=Math.max(o.x,o.y),l=s*this.getZoomScale(a,e),u=r.distanceTo(i)||1,h=1.42,c=h*h;function d(t){var e=t?-1:1,n=t?l:s,i=l*l-s*s+e*c*c*u*u,r=2*n*c*u,o=i/r,a=Math.sqrt(o*o+1)-o,h=a<1e-9?-18:Math.log(a);return h}function p(t){return(Math.exp(t)-Math.exp(-t))/2}function f(t){return(Math.exp(t)+Math.exp(-t))/2}function m(t){return p(t)/f(t)}var g=d(0);function _(t){return s*(f(g)/f(g+h*t))}function v(t){return s*(f(g)*m(g+h*t)-p(g))/c}function y(t){return 1-Math.pow(1-t,1.5)}var x=Date.now(),b=(d(1)-g)/h,M=n.duration?1e3*n.duration:1e3*b*.8;function w(){var n=(Date.now()-x)/M,o=y(n)*b;n<=1?(this._flyToFrame=T(w,this),this._move(this.unproject(i.add(r.subtract(i).multiplyBy(v(o)/u)),a),this.getScaleZoom(s/_(o),a),{flyTo:!0})):this._move(t,e)._moveEnd(!0)}return this._moveStart(!0,n.noMoveStart),w.call(this),this},flyToBounds:function(t,e){var n=this._getBoundsCenterZoom(t,e);return this.flyTo(n.center,n.zoom,e)},setMaxBounds:function(t){return t=B(t),t.isValid()?(this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this.off("moveend",this._panInsideMaxBounds))},setMinZoom:function(t){var e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var n=this.getCenter(),i=this._limitCenter(n,this._zoom,B(t));return n.equals(i)||this.panTo(i,e),this._enforcingBounds=!1,this},panInside:function(t,e){e=e||{};var n=z(e.paddingTopLeft||e.padding||[0,0]),i=z(e.paddingBottomRight||e.padding||[0,0]),r=this.project(this.getCenter()),o=this.project(t),a=this.getPixelBounds(),s=k([a.min.add(n),a.max.subtract(i)]),l=s.getSize();if(!s.contains(o)){this._enforcingBounds=!0;var u=o.subtract(s.getCenter()),h=s.extend(o).getSize().subtract(l);r.x+=u.x<0?-h.x:h.x,r.y+=u.y<0?-h.y:h.y,this.panTo(this.unproject(r),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=n({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var i=this.getSize(),o=e.divideBy(2).round(),a=i.divideBy(2).round(),s=o.subtract(a);return s.x||s.y?(t.animate&&t.pan?this.panBy(s):(t.pan&&this._rawPanBy(s),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(r(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=n({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=r(this._handleGeolocationResponse,this),i=r(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){if(this._container._leaflet_id){var e=t.code,n=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+n+"."})}},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var e=t.coords.latitude,n=t.coords.longitude,i=new F(e,n),r=i.toBounds(2*t.coords.accuracy),o=this._locateOptions;if(o.setView){var a=this.getBoundsZoom(r);this.setView(i,o.maxZoom?Math.min(a,o.maxZoom):a)}var s={latlng:i,bounds:r,timestamp:t.timestamp};for(var l in t.coords)"number"===typeof t.coords[l]&&(s[l]=t.coords[l]);this.fire("locationfound",s)}},addHandler:function(t,e){if(!e)return this;var n=this[t]=new e(this);return this._handlers.push(n),this.options[t]&&n.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(e){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),de(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(E(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)de(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var n="leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),i=ce("div",n,e||this._mapPane);return t&&(this._panes[t]=i),i},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds(),e=this.unproject(t.getBottomLeft()),n=this.unproject(t.getTopRight());return new U(e,n)},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,n){t=B(t),n=z(n||[0,0]);var i=this.getZoom()||0,r=this.getMinZoom(),o=this.getMaxZoom(),a=t.getNorthWest(),s=t.getSouthEast(),l=this.getSize().subtract(n),u=k(this.project(s,i),this.project(a,i)).getSize(),h=Ot.any3d?this.options.zoomSnap:1,c=l.x/u.x,d=l.y/u.y,p=e?Math.max(c,d):Math.min(c,d);return i=this.getScaleZoom(p,i),h&&(i=Math.round(i/(h/100))*(h/100),i=e?Math.ceil(i/h)*h:Math.floor(i/h)*h),Math.max(r,Math.min(o,i))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new D(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var n=this._getTopLeftPoint(t,e);return new N(n,n.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"===typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var n=this.options.crs;return e=void 0===e?this._zoom:e,n.scale(t)/n.scale(e)},getScaleZoom:function(t,e){var n=this.options.crs;e=void 0===e?this._zoom:e;var i=n.zoom(t*n.scale(e));return isNaN(i)?1/0:i},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(V(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(z(t),e)},layerPointToLatLng:function(t){var e=z(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){var e=this.project(V(t))._round();return e._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(V(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(B(t))},distance:function(t,e){return this.options.crs.distance(V(t),V(e))},containerPointToLayerPoint:function(t){return z(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return z(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(z(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(V(t)))},mouseEventToContainerPoint:function(t){return qe(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=ue(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");ze(e,"scroll",this._onScroll,this),this._containerId=a(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&Ot.any3d,_e(t,"leaflet-container"+(Ot.touch?" leaflet-touch":"")+(Ot.retina?" leaflet-retina":"")+(Ot.ielt9?" leaflet-oldie":"")+(Ot.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=he(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Te(this._mapPane,new D(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(_e(t.markerPane,"leaflet-zoom-hide"),_e(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e){Te(this._mapPane,new D(0,0));var n=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var i=this._zoom!==e;this._moveStart(i,!1)._move(t,e)._moveEnd(i),this.fire("viewreset"),n&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,n,i){void 0===e&&(e=this._zoom);var r=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),i?n&&n.pinch&&this.fire("zoom",n):((r||n&&n.pinch)&&this.fire("zoom",n),this.fire("move",n)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return E(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Te(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[a(this._container)]=this;var e=t?ke:ze;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),Ot.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){E(this._resizeRequest),this._resizeRequest=T((function(){this.invalidateSize({debounceMoveend:!0})}),this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){var n,i=[],r="mouseout"===e||"mouseover"===e,o=t.target||t.srcElement,s=!1;while(o){if(n=this._targets[a(o)],n&&("click"===e||"preclick"===e)&&this._draggableMoved(n)){s=!0;break}if(n&&n.listens(e,!0)){if(r&&!Ke(o,t))break;if(i.push(n),r)break}if(o===this._container)break;o=o.parentNode}return i.length||s||r||!this.listens(e,!0)||(i=[this]),i},_isClickDisabled:function(t){while(t!==this._container){if(t["_leaflet_disable_click"])return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e=t.target||t.srcElement;if(!(!this._loaded||e["_leaflet_disable_events"]||"click"===t.type&&this._isClickDisabled(e))){var n=t.type;"mousedown"===n&&Ce(e),this._fireDOMEvent(t,n)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,i){if("click"===t.type){var r=n({},t);r.type="preclick",this._fireDOMEvent(r,r.type,i)}var o=this._findEventTargets(t,e);if(i){for(var a=[],s=0;s<i.length;s++)i[s].listens(e,!0)&&a.push(i[s]);o=a.concat(o)}if(o.length){"contextmenu"===e&&je(t);var l=o[0],u={originalEvent:t};if("keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type){var h=l.getLatLng&&(!l._radius||l._radius<=10);u.containerPoint=h?this.latLngToContainerPoint(l.getLatLng()):this.mouseEventToContainerPoint(t),u.layerPoint=this.containerPointToLayerPoint(u.containerPoint),u.latlng=h?l.getLatLng():this.layerPointToLatLng(u.layerPoint)}for(s=0;s<o.length;s++)if(o[s].fire(e,u,!0),u.originalEvent._stopped||!1===o[s].options.bubblingMouseEvents&&-1!==v(this._mouseEvents,e))return}},_draggableMoved:function(t){return t=t.dragging&&t.dragging.enabled()?t:this,t.dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this},_getMapPanePos:function(){return Ee(this._mapPane)||new D(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){var n=t&&void 0!==e?this._getNewPixelOrigin(t,e):this.getPixelOrigin();return n.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var n=this.getSize()._divideBy(2);return this.project(t,e)._subtract(n)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,n){var i=this._getNewPixelOrigin(n,e);return this.project(t,e)._subtract(i)},_latLngBoundsToNewLayerBounds:function(t,e,n){var i=this._getNewPixelOrigin(n,e);return k([this.project(t.getSouthWest(),e)._subtract(i),this.project(t.getNorthWest(),e)._subtract(i),this.project(t.getSouthEast(),e)._subtract(i),this.project(t.getNorthEast(),e)._subtract(i)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,n){if(!n)return t;var i=this.project(t,e),r=this.getSize().divideBy(2),o=new N(i.subtract(r),i.add(r)),a=this._getBoundsOffset(o,n,e);return a.round().equals([0,0])?t:this.unproject(i.add(a),e)},_limitOffset:function(t,e){if(!e)return t;var n=this.getPixelBounds(),i=new N(n.min.add(t),n.max.add(t));return t.add(this._getBoundsOffset(i,e))},_getBoundsOffset:function(t,e,n){var i=k(this.project(e.getNorthEast(),n),this.project(e.getSouthWest(),n)),r=i.min.subtract(t.min),o=i.max.subtract(t.max),a=this._rebound(r.x,-o.x),s=this._rebound(r.y,-o.y);return new D(a,s)},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),n=this.getMaxZoom(),i=Ot.any3d?this.options.zoomSnap:1;return i&&(t=Math.round(t/i)*i),Math.max(e,Math.min(n,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){ve(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var n=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(n))&&(this.panBy(n,e),!0)},_createAnimProxy:function(){var t=this._proxy=ce("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",(function(t){var e=ae,n=this._proxy.style[e];Se(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),n===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()}),this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){de(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();Se(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,n){if(this._animatingZoom)return!0;if(n=n||{},!this._zoomAnimated||!1===n.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var i=this.getZoomScale(e),r=this._getCenterOffset(t)._divideBy(1-1/i);return!(!0!==n.animate&&!this.getSize().contains(r))&&(T((function(){this._moveStart(!0,!1)._animateZoom(t,e,!0)}),this),!0)},_animateZoom:function(t,e,n,i){this._mapPane&&(n&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,_e(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:i}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(r(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&ve(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function tn(t,e){return new Qe(t,e)}var en=A.extend({options:{position:"topright"},initialize:function(t){p(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),n=this.getPosition(),i=t._controlCorners[n];return _e(e,"leaflet-control"),-1!==n.indexOf("bottom")?i.insertBefore(e,i.firstChild):i.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(de(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),nn=function(t){return new en(t)};Qe.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",n=this._controlContainer=ce("div",e+"control-container",this._container);function i(i,r){var o=e+i+" "+e+r;t[i+r]=ce("div",o,n)}i("top","left"),i("top","right"),i("bottom","left"),i("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)de(this._controlCorners[t]);de(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var rn=en.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,n,i){return n<i?-1:i<n?1:0}},initialize:function(t,e,n){for(var i in p(this,n),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,t)this._addLayer(t[i],i);for(i in e)this._addLayer(e[i],i,!0)},onAdd:function(t){this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return en.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._map?this._update():this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);var e=this._getLayer(a(t));return e&&this._layers.splice(this._layers.indexOf(e),1),this._map?this._update():this},expand:function(){_e(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(_e(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):ve(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return ve(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=ce("div",t),n=this.options.collapsed;e.setAttribute("aria-haspopup",!0),Ge(e),We(e);var i=this._section=ce("section",t+"-list");n&&(this._map.on("click",this.collapse,this),ze(e,{mouseenter:function(){ze(i,"click",je),this.expand(),setTimeout((function(){ke(i,"click",je)}))},mouseleave:this.collapse},this));var r=this._layersLink=ce("a",t+"-toggle",e);r.href="#",r.title="Layers",r.setAttribute("role","button"),ze(r,"click",je),ze(r,"focus",this.expand,this),n||this.expand(),this._baseLayersList=ce("div",t+"-base",i),this._separator=ce("div",t+"-separator",i),this._overlaysList=ce("div",t+"-overlays",i),e.appendChild(i)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&a(this._layers[e].layer)===t)return this._layers[e]},_addLayer:function(t,e,n){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:n}),this.options.sortLayers&&this._layers.sort(r((function(t,e){return this.options.sortFunction(t.layer,e.layer,t.name,e.name)}),this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;pe(this._baseLayersList),pe(this._overlaysList),this._layerControlInputs=[];var t,e,n,i,r=0;for(n=0;n<this._layers.length;n++)i=this._layers[n],this._addItem(i),e=e||i.overlay,t=t||!i.overlay,r+=i.overlay?0:1;return this.options.hideSingleBase&&(t=t&&r>1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(a(t.target)),n=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;n&&this._map.fire(n,e)},_createRadioElement:function(t,e){var n='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(e?' checked="checked"':"")+"/>",i=document.createElement("div");return i.innerHTML=n,i.firstChild},_addItem:function(t){var e,n=document.createElement("label"),i=this._map.hasLayer(t.layer);t.overlay?(e=document.createElement("input"),e.type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=i):e=this._createRadioElement("leaflet-base-layers_"+a(this),i),this._layerControlInputs.push(e),e.layerId=a(t.layer),ze(e,"click",this._onInputClick,this);var r=document.createElement("span");r.innerHTML=" "+t.name;var o=document.createElement("span");n.appendChild(o),o.appendChild(e),o.appendChild(r);var s=t.overlay?this._overlaysList:this._baseLayersList;return s.appendChild(n),this._checkDisabledLayers(),n},_onInputClick:function(){var t,e,n=this._layerControlInputs,i=[],r=[];this._handlingClick=!0;for(var o=n.length-1;o>=0;o--)t=n[o],e=this._getLayer(t.layerId).layer,t.checked?i.push(e):t.checked||r.push(e);for(o=0;o<r.length;o++)this._map.hasLayer(r[o])&&this._map.removeLayer(r[o]);for(o=0;o<i.length;o++)this._map.hasLayer(i[o])||this._map.addLayer(i[o]);this._handlingClick=!1,this._refocusOnMap()},_checkDisabledLayers:function(){for(var t,e,n=this._layerControlInputs,i=this._map.getZoom(),r=n.length-1;r>=0;r--)t=n[r],e=this._getLayer(t.layerId).layer,t.disabled=void 0!==e.options.minZoom&&i<e.options.minZoom||void 0!==e.options.maxZoom&&i>e.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this}}),on=function(t,e,n){return new rn(t,e,n)},an=en.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">−</span>',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",n=ce("div",e+" leaflet-bar"),i=this.options;return this._zoomInButton=this._createButton(i.zoomInText,i.zoomInTitle,e+"-in",n,this._zoomIn),this._zoomOutButton=this._createButton(i.zoomOutText,i.zoomOutTitle,e+"-out",n,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),n},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,n,i,r){var o=ce("a",n,i);return o.innerHTML=t,o.href="#",o.title=e,o.setAttribute("role","button"),o.setAttribute("aria-label",e),Ge(o),ze(o,"click",Ze),ze(o,"click",r,this),ze(o,"click",this._refocusOnMap,this),o},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";ve(this._zoomInButton,e),ve(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(_e(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(_e(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}});Qe.mergeOptions({zoomControl:!0}),Qe.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new an,this.addControl(this.zoomControl))}));var sn=function(t){return new an(t)},ln=en.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",n=ce("div",e),i=this.options;return this._addScales(i,e+"-line",n),t.on(i.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),n},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,n){t.metric&&(this._mScale=ce("div",e,n)),t.imperial&&(this._iScale=ce("div",e,n))},_update:function(){var t=this._map,e=t.getSize().y/2,n=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(n)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t),n=e<1e3?e+" m":e/1e3+" km";this._updateScale(this._mScale,n,e/t)},_updateImperial:function(t){var e,n,i,r=3.2808399*t;r>5280?(e=r/5280,n=this._getRoundNum(e),this._updateScale(this._iScale,n+" mi",n/e)):(i=this._getRoundNum(r),this._updateScale(this._iScale,i+" ft",i/r))},_updateScale:function(t,e,n){t.style.width=Math.round(this.options.maxWidth*n)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),n=t/e;return n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:1,e*n}}),un=function(t){return new ln(t)},hn='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',cn=en.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(Ot.inlineSvg?hn+" ":"")+"Leaflet</a>"},initialize:function(t){p(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=ce("div","leaflet-control-attribution"),Ge(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",(function(){this.removeAttribution(t.layer.getAttribution())}),this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var n=[];this.options.prefix&&n.push(this.options.prefix),t.length&&n.push(t.join(", ")),this._container.innerHTML=n.join(' <span aria-hidden="true">|</span> ')}}});Qe.mergeOptions({attributionControl:!0}),Qe.addInitHook((function(){this.options.attributionControl&&(new cn).addTo(this)}));var dn=function(t){return new cn(t)};en.Layers=rn,en.Zoom=an,en.Scale=ln,en.Attribution=cn,nn.layers=on,nn.zoom=sn,nn.scale=un,nn.attribution=dn;var pn=A.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});pn.addTo=function(t,e){return t.addHandler(e,this),this};var fn,mn={Events:R},gn=Ot.touch?"touchstart mousedown":"mousedown",_n=I.extend({options:{clickTolerance:3},initialize:function(t,e,n,i){p(this,i),this._element=t,this._dragStartTarget=e||t,this._preventOutline=n},enable:function(){this._enabled||(ze(this._dragStartTarget,gn,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(_n._dragging===this&&this.finishDrag(!0),ke(this._dragStartTarget,gn,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(this._enabled&&(this._moved=!1,!ge(this._element,"leaflet-zoom-anim")))if(t.touches&&1!==t.touches.length)_n._dragging===this&&this.finishDrag();else if(!(_n._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches)&&(_n._dragging=this,this._preventOutline&&Ce(this._element),Le(),ee(),!this._moving)){this.fire("down");var e=t.touches?t.touches[0]:t,n=Ie(this._element);this._startPoint=new D(e.clientX,e.clientY),this._startPos=Ee(this._element),this._parentScale=De(n);var i="mousedown"===t.type;ze(document,i?"mousemove":"touchmove",this._onMove,this),ze(document,i?"mouseup":"touchend touchcancel",this._onUp,this)}},_onMove:function(t){if(this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var e=t.touches&&1===t.touches.length?t.touches[0]:t,n=new D(e.clientX,e.clientY)._subtract(this._startPoint);(n.x||n.y)&&(Math.abs(n.x)+Math.abs(n.y)<this.options.clickTolerance||(n.x/=this._parentScale.x,n.y/=this._parentScale.y,je(t),this._moved||(this.fire("dragstart"),this._moved=!0,_e(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),_e(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(n),this._moving=!0,this._lastEvent=t,this._updatePosition()))}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),Te(this._element,this._newPos),this.fire("drag",t)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(t){ve(document.body,"leaflet-dragging"),this._lastTarget&&(ve(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),ke(document,"mousemove touchmove",this._onMove,this),ke(document,"mouseup touchend touchcancel",this._onUp,this),Ae(),ne(),this._moved&&this._moving&&this.fire("dragend",{noInertia:t,distance:this._newPos.distanceTo(this._startPos)}),this._moving=!1,_n._dragging=!1}});function vn(t,e){if(!e||!t.length)return t.slice();var n=e*e;return t=wn(t,n),t=bn(t,n),t}function yn(t,e,n){return Math.sqrt(Ln(t,e,n,!0))}function xn(t,e,n){return Ln(t,e,n)}function bn(t,e){var n=t.length,i=typeof Uint8Array!==void 0+""?Uint8Array:Array,r=new i(n);r[0]=r[n-1]=1,Mn(t,r,e,0,n-1);var o,a=[];for(o=0;o<n;o++)r[o]&&a.push(t[o]);return a}function Mn(t,e,n,i,r){var o,a,s,l=0;for(a=i+1;a<=r-1;a++)s=Ln(t[a],t[i],t[r],!0),s>l&&(o=a,l=s);l>n&&(e[o]=1,Mn(t,e,n,i,o),Mn(t,e,n,o,r))}function wn(t,e){for(var n=[t[0]],i=1,r=0,o=t.length;i<o;i++)Pn(t[i],t[r])>e&&(n.push(t[i]),r=i);return r<o-1&&n.push(t[o-1]),n}function Sn(t,e,n,i,r){var o,a,s,l=i?fn:En(t,n),u=En(e,n);fn=u;while(1){if(!(l|u))return[t,e];if(l&u)return!1;o=l||u,a=Tn(t,e,o,n,r),s=En(a,n),o===l?(t=a,l=s):(e=a,u=s)}}function Tn(t,e,n,i,r){var o,a,s=e.x-t.x,l=e.y-t.y,u=i.min,h=i.max;return 8&n?(o=t.x+s*(h.y-t.y)/l,a=h.y):4&n?(o=t.x+s*(u.y-t.y)/l,a=u.y):2&n?(o=h.x,a=t.y+l*(h.x-t.x)/s):1&n&&(o=u.x,a=t.y+l*(u.x-t.x)/s),new D(o,a,r)}function En(t,e){var n=0;return t.x<e.min.x?n|=1:t.x>e.max.x&&(n|=2),t.y<e.min.y?n|=4:t.y>e.max.y&&(n|=8),n}function Pn(t,e){var n=e.x-t.x,i=e.y-t.y;return n*n+i*i}function Ln(t,e,n,i){var r,o=e.x,a=e.y,s=n.x-o,l=n.y-a,u=s*s+l*l;return u>0&&(r=((t.x-o)*s+(t.y-a)*l)/u,r>1?(o=n.x,a=n.y):r>0&&(o+=s*r,a+=l*r)),s=t.x-o,l=t.y-a,i?s*s+l*l:new D(o,a)}function An(t){return!_(t[0])||"object"!==typeof t[0][0]&&"undefined"!==typeof t[0][0]}function Cn(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),An(t)}var Rn={__proto__:null,simplify:vn,pointToSegmentDistance:yn,closestPointOnSegment:xn,clipSegment:Sn,_getEdgeIntersection:Tn,_getBitCode:En,_sqClosestPointOnSegment:Ln,isFlat:An,_flat:Cn};function In(t,e,n){var i,r,o,a,s,l,u,h,c,d=[1,4,2,8];for(r=0,u=t.length;r<u;r++)t[r]._code=En(t[r],e);for(a=0;a<4;a++){for(h=d[a],i=[],r=0,u=t.length,o=u-1;r<u;o=r++)s=t[r],l=t[o],s._code&h?l._code&h||(c=Tn(l,s,h,e,n),c._code=En(c,e),i.push(c)):(l._code&h&&(c=Tn(l,s,h,e,n),c._code=En(c,e),i.push(c)),i.push(s));t=i}return t}var Dn={__proto__:null,clipPolygon:In},On={project:function(t){return new D(t.lng,t.lat)},unproject:function(t){return new F(t.y,t.x)},bounds:new N([-180,-90],[180,90])},zn={R:6378137,R_MINOR:6356752.314245179,bounds:new N([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,n=this.R,i=t.lat*e,r=this.R_MINOR/n,o=Math.sqrt(1-r*r),a=o*Math.sin(i),s=Math.tan(Math.PI/4-i/2)/Math.pow((1-a)/(1+a),o/2);return i=-n*Math.log(Math.max(s,1e-10)),new D(t.lng*e*n,i)},unproject:function(t){for(var e,n=180/Math.PI,i=this.R,r=this.R_MINOR/i,o=Math.sqrt(1-r*r),a=Math.exp(-t.y/i),s=Math.PI/2-2*Math.atan(a),l=0,u=.1;l<15&&Math.abs(u)>1e-7;l++)e=o*Math.sin(s),e=Math.pow((1-e)/(1+e),o/2),u=Math.PI/2-2*Math.atan(a*e)-s,s+=u;return new F(s*n,t.x*n/i)}},Nn={__proto__:null,LonLat:On,Mercator:zn,SphericalMercator:j},kn=n({},W,{code:"EPSG:3395",projection:zn,transformation:function(){var t=.5/(Math.PI*zn.R);return q(t,.5,-t,.5)}()}),Un=n({},W,{code:"EPSG:4326",projection:On,transformation:q(1/180,1,-1/180,.5)}),Bn=n({},H,{projection:On,transformation:q(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var n=e.lng-t.lng,i=e.lat-t.lat;return Math.sqrt(n*n+i*i)},infinite:!0});H.Earth=W,H.EPSG3395=kn,H.EPSG3857=X,H.EPSG900913=Y,H.EPSG4326=Un,H.Simple=Bn;var Fn=I.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[a(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[a(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var n=this.getEvents();e.on(n,this),this.once("remove",(function(){e.off(n,this)}),this)}this.onAdd(e),this.fire("add"),e.fire("layeradd",{layer:this})}}});Qe.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=a(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=a(t);return this._layers[e]?(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return a(t)in this._layers},eachLayer:function(t,e){for(var n in this._layers)t.call(e,this._layers[n]);return this},_addLayers:function(t){t=t?_(t)?t:[t]:[];for(var e=0,n=t.length;e<n;e++)this.addLayer(t[e])},_addZoomLimit:function(t){isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[a(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var e=a(t);this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels())},_updateZoomLevels:function(){var t=1/0,e=-1/0,n=this._getZoomSpan();for(var i in this._zoomBoundLayers){var r=this._zoomBoundLayers[i].options;t=void 0===r.minZoom?t:Math.min(t,r.minZoom),e=void 0===r.maxZoom?e:Math.max(e,r.maxZoom)}this._layersMaxZoom=e===-1/0?void 0:e,this._layersMinZoom=t===1/0?void 0:t,n!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Vn=Fn.extend({initialize:function(t,e){var n,i;if(p(this,e),this._layers={},t)for(n=0,i=t.length;n<i;n++)this.addLayer(t[n])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){var e="number"===typeof t?t:this.getLayerId(t);return e in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var e,n,i=Array.prototype.slice.call(arguments,1);for(e in this._layers)n=this._layers[e],n[t]&&n[t].apply(n,i);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,e){for(var n in this._layers)t.call(e,this._layers[n]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return a(t)}}),Hn=function(t,e){return new Vn(t,e)},Wn=Vn.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),Vn.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),Vn.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new U;for(var e in this._layers){var n=this._layers[e];t.extend(n.getBounds?n.getBounds():n.getLatLng())}return t}}),Gn=function(t,e){return new Wn(t,e)},jn=A.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(t){p(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var n=this._getIconUrl(t);if(!n){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var i=this._createImg(n,e&&"IMG"===e.tagName?e:null);return this._setIconStyles(i,t),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),i},_setIconStyles:function(t,e){var n=this.options,i=n[e+"Size"];"number"===typeof i&&(i=[i,i]);var r=z(i),o=z("shadow"===e&&n.shadowAnchor||n.iconAnchor||r&&r.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(n.className||""),o&&(t.style.marginLeft=-o.x+"px",t.style.marginTop=-o.y+"px"),r&&(t.style.width=r.x+"px",t.style.height=r.y+"px")},_createImg:function(t,e){return e=e||document.createElement("img"),e.src=t,e},_getIconUrl:function(t){return Ot.retina&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});function Zn(t){return new jn(t)}var qn=jn.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return"string"!==typeof qn.imagePath&&(qn.imagePath=this._detectIconPath()),(this.options.imagePath||qn.imagePath)+jn.prototype._getIconUrl.call(this,t)},_stripUrl:function(t){var e=function(t,e,n){var i=e.exec(t);return i&&i[n]};return t=e(t,/^url\((['"])?(.+)\1\)$/,2),t&&e(t,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var t=ce("div","leaflet-default-icon-path",document.body),e=he(t,"background-image")||he(t,"backgroundImage");if(document.body.removeChild(t),e=this._stripUrl(e),e)return e;var n=document.querySelector('link[href$="leaflet.css"]');return n?n.href.substring(0,n.href.length-11-1):""}}),Xn=pn.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new _n(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),_e(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&ve(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,n=e._map,i=this._marker.options.autoPanSpeed,r=this._marker.options.autoPanPadding,o=Ee(e._icon),a=n.getPixelBounds(),s=n.getPixelOrigin(),l=k(a.min._subtract(s).add(r),a.max._subtract(s).subtract(r));if(!l.contains(o)){var u=z((Math.max(l.max.x,o.x)-l.max.x)/(a.max.x-l.max.x)-(Math.min(l.min.x,o.x)-l.min.x)/(a.min.x-l.min.x),(Math.max(l.max.y,o.y)-l.max.y)/(a.max.y-l.max.y)-(Math.min(l.min.y,o.y)-l.min.y)/(a.min.y-l.min.y)).multiplyBy(i);n.panBy(u,{animate:!1}),this._draggable._newPos._add(u),this._draggable._startPos._add(u),Te(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=T(this._adjustPan.bind(this,t))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(E(this._panRequest),this._panRequest=T(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,n=e._shadow,i=Ee(e._icon),r=e._map.layerPointToLatLng(i);n&&Te(n,i),e._latlng=r,t.latlng=r,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){E(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),Yn=Fn.extend({options:{icon:new qn,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,e){p(this,e),this._latlng=V(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var e=this._latlng;return this._latlng=V(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),n=t.icon.createIcon(this._icon),i=!1;n!==this._icon&&(this._icon&&this._removeIcon(),i=!0,t.title&&(n.title=t.title),"IMG"===n.tagName&&(n.alt=t.alt||"")),_e(n,e),t.keyboard&&(n.tabIndex="0",n.setAttribute("role","button")),this._icon=n,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&ze(n,"focus",this._panOnFocus,this);var r=t.icon.createShadow(this._shadow),o=!1;r!==this._shadow&&(this._removeShadow(),o=!0),r&&(_e(r,e),r.alt=""),this._shadow=r,t.opacity<1&&this._updateOpacity(),i&&this.getPane().appendChild(this._icon),this._initInteraction(),r&&o&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&ke(this._icon,"focus",this._panOnFocus,this),de(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&de(this._shadow),this._shadow=null},_setPos:function(t){this._icon&&Te(this._icon,t),this._shadow&&Te(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.interactive&&(_e(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Xn)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Xn(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&be(this._icon,t),this._shadow&&be(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var t=this._map;if(t){var e=this.options.icon.options,n=e.iconSize?z(e.iconSize):z(0,0),i=e.iconAnchor?z(e.iconAnchor):z(0,0);t.panInside(this._latlng,{paddingTopLeft:i,paddingBottomRight:n.subtract(i)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function Kn(t,e){return new Yn(t,e)}var Jn=Fn.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return p(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t&&Object.prototype.hasOwnProperty.call(t,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),$n=Jn.extend({options:{fill:!0,radius:10},initialize:function(t,e){p(this,e),this._latlng=V(t),this._radius=this.options.radius},setLatLng:function(t){var e=this._latlng;return this._latlng=V(t),this.redraw(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var e=t&&t.radius||this._radius;return Jn.prototype.setStyle.call(this,t),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,e=this._radiusY||t,n=this._clickTolerance(),i=[t+n,e+n];this._pxBounds=new N(this._point.subtract(i),this._point.add(i))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function Qn(t,e){return new $n(t,e)}var ti=$n.extend({initialize:function(t,e,i){if("number"===typeof e&&(e=n({},i,{radius:e})),p(this,e),this._latlng=V(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new U(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:Jn.prototype.setStyle,_project:function(){var t=this._latlng.lng,e=this._latlng.lat,n=this._map,i=n.options.crs;if(i.distance===W.distance){var r=Math.PI/180,o=this._mRadius/W.R/r,a=n.project([e+o,t]),s=n.project([e-o,t]),l=a.add(s).divideBy(2),u=n.unproject(l).lat,h=Math.acos((Math.cos(o*r)-Math.sin(e*r)*Math.sin(u*r))/(Math.cos(e*r)*Math.cos(u*r)))/r;(isNaN(h)||0===h)&&(h=o/Math.cos(Math.PI/180*e)),this._point=l.subtract(n.getPixelOrigin()),this._radius=isNaN(h)?0:l.x-n.project([u,t-h]).x,this._radiusY=l.y-a.y}else{var c=i.unproject(i.project(this._latlng).subtract([this._mRadius,0]));this._point=n.latLngToLayerPoint(this._latlng),this._radius=this._point.x-n.latLngToLayerPoint(c).x}this._updateBounds()}});function ei(t,e,n){return new ti(t,e,n)}var ni=Jn.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){p(this,e),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var e,n,i=1/0,r=null,o=Ln,a=0,s=this._parts.length;a<s;a++)for(var l=this._parts[a],u=1,h=l.length;u<h;u++){e=l[u-1],n=l[u];var c=o(t,e,n,!0);c<i&&(i=c,r=o(t,e,n))}return r&&(r.distance=Math.sqrt(i)),r},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,n,i,r,o,a,s=this._rings[0],l=s.length;if(!l)return null;for(t=0,e=0;t<l-1;t++)e+=s[t].distanceTo(s[t+1])/2;if(0===e)return this._map.layerPointToLatLng(s[0]);for(t=0,i=0;t<l-1;t++)if(r=s[t],o=s[t+1],n=r.distanceTo(o),i+=n,i>e)return a=(i-e)/n,this._map.layerPointToLatLng([o.x-a*(o.x-r.x),o.y-a*(o.y-r.y)])},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=V(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new U,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return An(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],n=An(t),i=0,r=t.length;i<r;i++)n?(e[i]=V(t[i]),this._bounds.extend(e[i])):e[i]=this._convertLatLngs(t[i]);return e},_project:function(){var t=new N;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),e=new D(t,t);this._rawPxBounds&&(this._pxBounds=new N([this._rawPxBounds.min.subtract(e),this._rawPxBounds.max.add(e)]))},_projectLatlngs:function(t,e,n){var i,r,o=t[0]instanceof F,a=t.length;if(o){for(r=[],i=0;i<a;i++)r[i]=this._map.latLngToLayerPoint(t[i]),n.extend(r[i]);e.push(r)}else for(i=0;i<a;i++)this._projectLatlngs(t[i],e,n)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else{var e,n,i,r,o,a,s,l=this._parts;for(e=0,i=0,r=this._rings.length;e<r;e++)for(s=this._rings[e],n=0,o=s.length;n<o-1;n++)a=Sn(s[n],s[n+1],t,n,!0),a&&(l[i]=l[i]||[],l[i].push(a[0]),a[1]===s[n+1]&&n!==o-2||(l[i].push(a[1]),i++))}},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,n=0,i=t.length;n<i;n++)t[n]=vn(t[n],e)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,e){var n,i,r,o,a,s,l=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(n=0,o=this._parts.length;n<o;n++)for(s=this._parts[n],i=0,a=s.length,r=a-1;i<a;r=i++)if((e||0!==i)&&yn(t,s[r],s[i])<=l)return!0;return!1}});function ii(t,e){return new ni(t,e)}ni._flat=Cn;var ri=ni.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,n,i,r,o,a,s,l,u=this._rings[0],h=u.length;if(!h)return null;for(o=a=s=0,t=0,e=h-1;t<h;e=t++)n=u[t],i=u[e],r=n.y*i.x-i.y*n.x,a+=(n.x+i.x)*r,s+=(n.y+i.y)*r,o+=3*r;return l=0===o?u[0]:[a/o,s/o],this._map.layerPointToLatLng(l)},_convertLatLngs:function(t){var e=ni.prototype._convertLatLngs.call(this,t),n=e.length;return n>=2&&e[0]instanceof F&&e[0].equals(e[n-1])&&e.pop(),e},_setLatLngs:function(t){ni.prototype._setLatLngs.call(this,t),An(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return An(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,n=new D(e,e);if(t=new N(t.min.subtract(n),t.max.add(n)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var i,r=0,o=this._rings.length;r<o;r++)i=In(this._rings[r],t,!0),i.length&&this._parts.push(i)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e,n,i,r,o,a,s,l,u=!1;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(r=0,s=this._parts.length;r<s;r++)for(e=this._parts[r],o=0,l=e.length,a=l-1;o<l;a=o++)n=e[o],i=e[a],n.y>t.y!==i.y>t.y&&t.x<(i.x-n.x)*(t.y-n.y)/(i.y-n.y)+n.x&&(u=!u);return u||ni.prototype._containsPoint.call(this,t,!0)}});function oi(t,e){return new ri(t,e)}var ai=Wn.extend({initialize:function(t,e){p(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,n,i,r=_(t)?t:t.features;if(r){for(e=0,n=r.length;e<n;e++)i=r[e],(i.geometries||i.geometry||i.features||i.coordinates)&&this.addData(i);return this}var o=this.options;if(o.filter&&!o.filter(t))return this;var a=si(t,o);return a?(a.feature=fi(t),a.defaultOptions=a.options,this.resetStyle(a),o.onEachFeature&&o.onEachFeature(t,a),this.addLayer(a)):this},resetStyle:function(t){return void 0===t?this.eachLayer(this.resetStyle,this):(t.options=n({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this)},setStyle:function(t){return this.eachLayer((function(e){this._setLayerStyle(e,t)}),this)},_setLayerStyle:function(t,e){t.setStyle&&("function"===typeof e&&(e=e(t.feature)),t.setStyle(e))}});function si(t,e){var n,i,r,o,a="Feature"===t.type?t.geometry:t,s=a?a.coordinates:null,l=[],u=e&&e.pointToLayer,h=e&&e.coordsToLatLng||ui;if(!s&&!a)return null;switch(a.type){case"Point":return n=h(s),li(u,t,n,e);case"MultiPoint":for(r=0,o=s.length;r<o;r++)n=h(s[r]),l.push(li(u,t,n,e));return new Wn(l);case"LineString":case"MultiLineString":return i=hi(s,"LineString"===a.type?0:1,h),new ni(i,e);case"Polygon":case"MultiPolygon":return i=hi(s,"Polygon"===a.type?1:2,h),new ri(i,e);case"GeometryCollection":for(r=0,o=a.geometries.length;r<o;r++){var c=si({geometry:a.geometries[r],type:"Feature",properties:t.properties},e);c&&l.push(c)}return new Wn(l);default:throw new Error("Invalid GeoJSON object.")}}function li(t,e,n,i){return t?t(e,n):new Yn(n,i&&i.markersInheritOptions&&i)}function ui(t){return new F(t[1],t[0],t[2])}function hi(t,e,n){for(var i,r=[],o=0,a=t.length;o<a;o++)i=e?hi(t[o],e-1,n):(n||ui)(t[o]),r.push(i);return r}function ci(t,e){return t=V(t),void 0!==t.alt?[h(t.lng,e),h(t.lat,e),h(t.alt,e)]:[h(t.lng,e),h(t.lat,e)]}function di(t,e,n,i){for(var r=[],o=0,a=t.length;o<a;o++)r.push(e?di(t[o],e-1,n,i):ci(t[o],i));return!e&&n&&r.push(r[0]),r}function pi(t,e){return t.feature?n({},t.feature,{geometry:e}):fi(e)}function fi(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var mi={toGeoJSON:function(t){return pi(this,{type:"Point",coordinates:ci(this.getLatLng(),t)})}};function gi(t,e){return new ai(t,e)}Yn.include(mi),ti.include(mi),$n.include(mi),ni.include({toGeoJSON:function(t){var e=!An(this._latlngs),n=di(this._latlngs,e?1:0,!1,t);return pi(this,{type:(e?"Multi":"")+"LineString",coordinates:n})}}),ri.include({toGeoJSON:function(t){var e=!An(this._latlngs),n=e&&!An(this._latlngs[0]),i=di(this._latlngs,n?2:e?1:0,!0,t);return e||(i=[i]),pi(this,{type:(n?"Multi":"")+"Polygon",coordinates:i})}}),Vn.include({toMultiPoint:function(t){var e=[];return this.eachLayer((function(n){e.push(n.toGeoJSON(t).geometry.coordinates)})),pi(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===e)return this.toMultiPoint(t);var n="GeometryCollection"===e,i=[];return this.eachLayer((function(e){if(e.toGeoJSON){var r=e.toGeoJSON(t);if(n)i.push(r.geometry);else{var o=fi(r);"FeatureCollection"===o.type?i.push.apply(i,o.features):i.push(o)}}})),n?pi(this,{geometries:i,type:"GeometryCollection"}):{type:"FeatureCollection",features:i}}});var _i=gi,vi=Fn.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,n){this._url=t,this._bounds=B(e),p(this,n)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(_e(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){de(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&fe(this._image),this},bringToBack:function(){return this._map&&me(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=B(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:ce("img");_e(e,"leaflet-image-layer"),this._zoomAnimated&&_e(e,"leaflet-zoom-animated"),this.options.className&&_e(e,this.options.className),e.onselectstart=u,e.onmousemove=u,e.onload=r(this.fire,this,"load"),e.onerror=r(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),n=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;Se(this._image,n,e)},_reset:function(){var t=this._image,e=new N(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),n=e.getSize();Te(t,e.min),t.style.width=n.x+"px",t.style.height=n.y+"px"},_updateOpacity:function(){be(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),yi=function(t,e,n){return new vi(t,e,n)},xi=vi.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:ce("video");if(_e(e,"leaflet-image-layer"),this._zoomAnimated&&_e(e,"leaflet-zoom-animated"),this.options.className&&_e(e,this.options.className),e.onselectstart=u,e.onmousemove=u,e.onloadeddata=r(this.fire,this,"load"),t){for(var n=e.getElementsByTagName("source"),i=[],o=0;o<n.length;o++)i.push(n[o].src);this._url=n.length>0?i:[e.src]}else{_(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style["objectFit"]="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted,e.playsInline=!!this.options.playsInline;for(var a=0;a<this._url.length;a++){var s=ce("source");s.src=this._url[a],e.appendChild(s)}}}});function bi(t,e,n){return new xi(t,e,n)}var Mi=vi.extend({_initImage:function(){var t=this._image=this._url;_e(t,"leaflet-image-layer"),this._zoomAnimated&&_e(t,"leaflet-zoom-animated"),this.options.className&&_e(t,this.options.className),t.onselectstart=u,t.onmousemove=u}});function wi(t,e,n){return new Mi(t,e,n)}var Si=Fn.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0},initialize:function(t,e){p(this,t),this._source=e},openOn:function(t){return t=arguments.length?t:this._source._map,t.hasLayer(this)||t.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(t){return this._map?this.close():(arguments.length?this._source=t:t=this._source,this._prepareOpen(),this.openOn(t._map)),this},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&be(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&be(this._container,1),this.bringToFront(),this.options.interactive&&(_e(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(t){t._fadeAnimated?(be(this._container,0),this._removeTimeout=setTimeout(r(de,void 0,this._container),200)):de(this._container),this.options.interactive&&(ve(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=V(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&fe(this._container),this},bringToBack:function(){return this._map&&me(this._container),this},_prepareOpen:function(t){var e=this._source;if(!e._map)return!1;if(e instanceof Wn){e=null;var n=this._source._layers;for(var i in n)if(n[i]._map){e=n[i];break}if(!e)return!1;this._source=e}if(!t)if(e.getCenter)t=e.getCenter();else if(e.getLatLng)t=e.getLatLng();else{if(!e.getBounds)throw new Error("Unable to get source layer LatLng.");t=e.getBounds().getCenter()}return this.setLatLng(t),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var t=this._contentNode,e="function"===typeof this._content?this._content(this._source||this):this._content;if("string"===typeof e)t.innerHTML=e;else{while(t.hasChildNodes())t.removeChild(t.firstChild);t.appendChild(e)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=z(this.options.offset),n=this._getAnchor();this._zoomAnimated?Te(this._container,t.add(n)):e=e.add(t).add(n);var i=this._containerBottom=-e.y,r=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=i+"px",this._container.style.left=r+"px"}},_getAnchor:function(){return[0,0]}});Qe.include({_initOverlay:function(t,e,n,i){var r=e;return r instanceof t||(r=new t(i).setContent(e)),n&&r.setLatLng(n),r}}),Fn.include({_initOverlay:function(t,e,n,i){var r=n;return r instanceof t?(p(r,i),r._source=this):(r=e&&!i?e:new t(i,this),r.setContent(n)),r}});var Ti=Si.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(t){return t=arguments.length?t:this._source._map,!t.hasLayer(this)&&t._popup&&t._popup.options.autoClose&&t.removeLayer(t._popup),t._popup=this,Si.prototype.openOn.call(this,t)},onAdd:function(t){Si.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof Jn||this._source.on("preclick",He))},onRemove:function(t){Si.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof Jn||this._source.off("preclick",He))},getEvents:function(){var t=Si.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this.close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_initLayout:function(){var t="leaflet-popup",e=this._container=ce("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),n=this._wrapper=ce("div",t+"-content-wrapper",e);if(this._contentNode=ce("div",t+"-content",n),Ge(e),We(this._contentNode),ze(e,"contextmenu",He),this._tipContainer=ce("div",t+"-tip-container",e),this._tip=ce("div",t+"-tip",this._tipContainer),this.options.closeButton){var i=this._closeButton=ce("a",t+"-close-button",e);i.setAttribute("role","button"),i.setAttribute("aria-label","Close popup"),i.href="#close",i.innerHTML='<span aria-hidden="true">×</span>',ze(i,"click",this.close,this)}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var n=t.offsetWidth;n=Math.min(n,this.options.maxWidth),n=Math.max(n,this.options.minWidth),e.width=n+1+"px",e.whiteSpace="",e.height="";var i=t.offsetHeight,r=this.options.maxHeight,o="leaflet-popup-scrolled";r&&i>r?(e.height=r+"px",_e(t,o)):ve(t,o),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),n=this._getAnchor();Te(this._container,e.add(n))},_adjustPan:function(t){if(this.options.autoPan){this._map._panAnim&&this._map._panAnim.stop();var e=this._map,n=parseInt(he(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+n,r=this._containerWidth,o=new D(this._containerLeft,-i-this._containerBottom);o._add(Ee(this._container));var a=e.layerPointToContainerPoint(o),s=z(this.options.autoPanPadding),l=z(this.options.autoPanPaddingTopLeft||s),u=z(this.options.autoPanPaddingBottomRight||s),h=e.getSize(),c=0,d=0;a.x+r+u.x>h.x&&(c=a.x+r-h.x+u.x),a.x-c-l.x<0&&(c=a.x-l.x),a.y+i+u.y>h.y&&(d=a.y+i-h.y+u.y),a.y-d-l.y<0&&(d=a.y-l.y),(c||d)&&e.fire("autopanstart").panBy([c,d],{animate:t&&"moveend"===t.type})}},_getAnchor:function(){return z(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Ei=function(t,e){return new Ti(t,e)};Qe.mergeOptions({closePopupOnClick:!0}),Qe.include({openPopup:function(t,e,n){return this._initOverlay(Ti,t,e,n).openOn(this),this},closePopup:function(t){return t=arguments.length?t:this._popup,t&&t.close(),this}}),Fn.include({bindPopup:function(t,e){return this._popup=this._initOverlay(Ti,this._popup,t,e),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&this._popup._prepareOpen(t)&&this._popup.openOn(this._map),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){if(this._popup&&this._map){Ze(t);var e=t.layer||t.target;this._popup._source!==e||e instanceof Jn?(this._popup._source=e,this.openPopup(t.latlng)):this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng)}},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var Pi=Si.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){Si.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){Si.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=Si.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip",e=t+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=ce("div",e)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,n,i=this._map,r=this._container,o=i.latLngToContainerPoint(i.getCenter()),a=i.layerPointToContainerPoint(t),s=this.options.direction,l=r.offsetWidth,u=r.offsetHeight,h=z(this.options.offset),c=this._getAnchor();"top"===s?(e=l/2,n=u):"bottom"===s?(e=l/2,n=0):"center"===s?(e=l/2,n=u/2):"right"===s?(e=0,n=u/2):"left"===s?(e=l,n=u/2):a.x<o.x?(s="right",e=0,n=u/2):(s="left",e=l+2*(h.x+c.x),n=u/2),t=t.subtract(z(e,n,!0)).add(h).add(c),ve(r,"leaflet-tooltip-right"),ve(r,"leaflet-tooltip-left"),ve(r,"leaflet-tooltip-top"),ve(r,"leaflet-tooltip-bottom"),_e(r,"leaflet-tooltip-"+s),Te(r,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&be(this._container,t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(e)},_getAnchor:function(){return z(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Li=function(t,e){return new Pi(t,e)};Qe.include({openTooltip:function(t,e,n){return this._initOverlay(Pi,t,e,n).openOn(this),this},closeTooltip:function(t){return t.close(),this}}),Fn.include({bindTooltip:function(t,e){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Pi,this._tooltip,t,e),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){if(t||!this._tooltipHandlersAdded){var e=t?"off":"on",n={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?n.add=this._openTooltip:(n.mouseover=this._openTooltip,n.mouseout=this.closeTooltip,n.click=this._openTooltip),this._tooltip.options.sticky&&(n.mousemove=this._moveTooltip),this[e](n),this._tooltipHandlersAdded=!t}},openTooltip:function(t){return this._tooltip&&this._tooltip._prepareOpen(t)&&this._tooltip.openOn(this._map),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_openTooltip:function(t){!this._tooltip||!this._map||this._map.dragging&&this._map.dragging.moving()||(this._tooltip._source=t.layer||t.target,this.openTooltip(this._tooltip.options.sticky?t.latlng:void 0))},_moveTooltip:function(t){var e,n,i=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(e=this._map.mouseEventToContainerPoint(t.originalEvent),n=this._map.containerPointToLayerPoint(e),i=this._map.layerPointToLatLng(n)),this._tooltip.setLatLng(i)}});var Ai=jn.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var e=t&&"DIV"===t.tagName?t:document.createElement("div"),n=this.options;if(n.html instanceof Element?(pe(e),e.appendChild(n.html)):e.innerHTML=!1!==n.html?n.html:"",n.bgPos){var i=z(n.bgPos);e.style.backgroundPosition=-i.x+"px "+-i.y+"px"}return this._setIconStyles(e,"icon"),e},createShadow:function(){return null}});function Ci(t){return new Ai(t)}jn.Default=qn;var Ri=Fn.extend({options:{tileSize:256,opacity:1,updateWhenIdle:Ot.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){p(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),de(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(fe(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(me(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var t=this._clampZoom(this._map.getZoom());t!==this._tileZoom&&(this._tileZoom=t,this._updateLevels()),this._update()}return this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=s(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof D?t:new D(t,t)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e,n=this.getPane().children,i=-t(-1/0,1/0),r=0,o=n.length;r<o;r++)e=n[r].style.zIndex,n[r]!==this._container&&e&&(i=t(i,+e));isFinite(i)&&(this.options.zIndex=i+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!Ot.ielt9){be(this._container,this.options.opacity);var t=+new Date,e=!1,n=!1;for(var i in this._tiles){var r=this._tiles[i];if(r.current&&r.loaded){var o=Math.min(1,(t-r.loaded)/200);be(r.el,o),o<1?e=!0:(r.active?n=!0:this._onOpaqueTile(r),r.active=!0)}}n&&!this._noPrune&&this._pruneTiles(),e&&(E(this._fadeFrame),this._fadeFrame=T(this._updateOpacity,this))}},_onOpaqueTile:u,_initContainer:function(){this._container||(this._container=ce("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,e=this.options.maxZoom;if(void 0!==t){for(var n in this._levels)n=Number(n),this._levels[n].el.children.length||n===t?(this._levels[n].el.style.zIndex=e-Math.abs(t-n),this._onUpdateLevel(n)):(de(this._levels[n].el),this._removeTilesAtZoom(n),this._onRemoveLevel(n),delete this._levels[n]);var i=this._levels[t],r=this._map;return i||(i=this._levels[t]={},i.el=ce("div","leaflet-tile-container leaflet-zoom-animated",this._container),i.el.style.zIndex=e,i.origin=r.project(r.unproject(r.getPixelOrigin()),t).round(),i.zoom=t,this._setZoomTransform(i,r.getCenter(),r.getZoom()),u(i.el.offsetWidth),this._onCreateLevel(i)),this._level=i,i}},_onUpdateLevel:u,_onRemoveLevel:u,_onCreateLevel:u,_pruneTiles:function(){if(this._map){var t,e,n=this._map.getZoom();if(n>this.options.maxZoom||n<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)e=this._tiles[t],e.retain=e.current;for(t in this._tiles)if(e=this._tiles[t],e.current&&!e.active){var i=e.coords;this._retainParent(i.x,i.y,i.z,i.z-5)||this._retainChildren(i.x,i.y,i.z,i.z+2)}for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}}},_removeTilesAtZoom:function(t){for(var e in this._tiles)this._tiles[e].coords.z===t&&this._removeTile(e)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)de(this._levels[t].el),this._onRemoveLevel(Number(t)),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,e,n,i){var r=Math.floor(t/2),o=Math.floor(e/2),a=n-1,s=new D(+r,+o);s.z=+a;var l=this._tileCoordsToKey(s),u=this._tiles[l];return u&&u.active?(u.retain=!0,!0):(u&&u.loaded&&(u.retain=!0),a>i&&this._retainParent(r,o,a,i))},_retainChildren:function(t,e,n,i){for(var r=2*t;r<2*t+2;r++)for(var o=2*e;o<2*e+2;o++){var a=new D(r,o);a.z=n+1;var s=this._tileCoordsToKey(a),l=this._tiles[s];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),n+1<i&&this._retainChildren(r,o,n+1,i))}},_resetView:function(t){var e=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),e,e)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var e=this.options;return void 0!==e.minNativeZoom&&t<e.minNativeZoom?e.minNativeZoom:void 0!==e.maxNativeZoom&&e.maxNativeZoom<t?e.maxNativeZoom:t},_setView:function(t,e,n,i){var r=Math.round(e);r=void 0!==this.options.maxZoom&&r>this.options.maxZoom||void 0!==this.options.minZoom&&r<this.options.minZoom?void 0:this._clampZoom(r);var o=this.options.updateWhenZooming&&r!==this._tileZoom;i&&!o||(this._tileZoom=r,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==r&&this._update(t),n||this._pruneTiles(),this._noPrune=!!n),this._setZoomTransforms(t,e)},_setZoomTransforms:function(t,e){for(var n in this._levels)this._setZoomTransform(this._levels[n],t,e)},_setZoomTransform:function(t,e,n){var i=this._map.getZoomScale(n,t.zoom),r=t.origin.multiplyBy(i).subtract(this._map._getNewPixelOrigin(e,n)).round();Ot.any3d?Se(t.el,r,i):Te(t.el,r)},_resetGrid:function(){var t=this._map,e=t.options.crs,n=this._tileSize=this.getTileSize(),i=this._tileZoom,r=this._map.getPixelWorldBounds(this._tileZoom);r&&(this._globalTileRange=this._pxBoundsToTileRange(r)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],i).x/n.x),Math.ceil(t.project([0,e.wrapLng[1]],i).x/n.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],i).y/n.x),Math.ceil(t.project([e.wrapLat[1],0],i).y/n.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(t){var e=this._map,n=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),i=e.getZoomScale(n,this._tileZoom),r=e.project(t,this._tileZoom).floor(),o=e.getSize().divideBy(2*i);return new N(r.subtract(o),r.add(o))},_update:function(t){var e=this._map;if(e){var n=this._clampZoom(e.getZoom());if(void 0===t&&(t=e.getCenter()),void 0!==this._tileZoom){var i=this._getTiledPixelBounds(t),r=this._pxBoundsToTileRange(i),o=r.getCenter(),a=[],s=this.options.keepBuffer,l=new N(r.getBottomLeft().subtract([s,-s]),r.getTopRight().add([s,-s]));if(!(isFinite(r.min.x)&&isFinite(r.min.y)&&isFinite(r.max.x)&&isFinite(r.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var u in this._tiles){var h=this._tiles[u].coords;h.z===this._tileZoom&&l.contains(new D(h.x,h.y))||(this._tiles[u].current=!1)}if(Math.abs(n-this._tileZoom)>1)this._setView(t,n);else{for(var c=r.min.y;c<=r.max.y;c++)for(var d=r.min.x;d<=r.max.x;d++){var p=new D(d,c);if(p.z=this._tileZoom,this._isValidTile(p)){var f=this._tiles[this._tileCoordsToKey(p)];f?f.current=!0:a.push(p)}}if(a.sort((function(t,e){return t.distanceTo(o)-e.distanceTo(o)})),0!==a.length){this._loading||(this._loading=!0,this.fire("loading"));var m=document.createDocumentFragment();for(d=0;d<a.length;d++)this._addTile(a[d],m);this._level.el.appendChild(m)}}}}},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var n=this._globalTileRange;if(!e.wrapLng&&(t.x<n.min.x||t.x>n.max.x)||!e.wrapLat&&(t.y<n.min.y||t.y>n.max.y))return!1}if(!this.options.bounds)return!0;var i=this._tileCoordsToBounds(t);return B(this.options.bounds).overlaps(i)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,n=this.getTileSize(),i=t.scaleBy(n),r=i.add(n),o=e.unproject(i,t.z),a=e.unproject(r,t.z);return[o,a]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),n=new U(e[0],e[1]);return this.options.noWrap||(n=this._map.wrapLatLngBounds(n)),n},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),n=new D(+e[0],+e[1]);return n.z=+e[2],n},_removeTile:function(t){var e=this._tiles[t];e&&(de(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){_e(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=u,t.onmousemove=u,Ot.ielt9&&this.options.opacity<1&&be(t,this.options.opacity)},_addTile:function(t,e){var n=this._getTilePos(t),i=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),r(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&T(r(this._tileReady,this,t,null,o)),Te(o,n),this._tiles[i]={el:o,coords:t,current:!0},e.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})},_tileReady:function(t,e,n){e&&this.fire("tileerror",{error:e,tile:n,coords:t});var i=this._tileCoordsToKey(t);n=this._tiles[i],n&&(n.loaded=+new Date,this._map._fadeAnimated?(be(n.el,0),E(this._fadeFrame),this._fadeFrame=T(this._updateOpacity,this)):(n.active=!0,this._pruneTiles()),e||(_e(n.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:n.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Ot.ielt9||!this._map._fadeAnimated?T(this._pruneTiles,this):setTimeout(r(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new D(this._wrapX?l(t.x,this._wrapX):t.x,this._wrapY?l(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new N(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function Ii(t){return new Ri(t)}var Di=Ri.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,e=p(this,e),e.detectRetina&&Ot.retina&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom++):(e.zoomOffset++,e.maxZoom--),e.minZoom=Math.max(0,e.minZoom)),"string"===typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var n=document.createElement("img");return ze(n,"load",r(this._tileOnLoad,this,e,n)),ze(n,"error",r(this._tileOnError,this,e,n)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(n.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"===typeof this.options.referrerPolicy&&(n.referrerPolicy=this.options.referrerPolicy),n.alt="",n.setAttribute("role","presentation"),n.src=this.getTileUrl(t),n},getTileUrl:function(t){var e={r:Ot.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var i=this._globalTileRange.max.y-t.y;this.options.tms&&(e["y"]=i),e["-y"]=i}return g(this._url,n(e,this.options))},_tileOnLoad:function(t,e){Ot.ielt9?setTimeout(r(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,n){var i=this.options.errorTileUrl;i&&e.getAttribute("src")!==i&&(e.src=i),t(n,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom,n=this.options.zoomReverse,i=this.options.zoomOffset;return n&&(t=e-t),t+i},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)if(this._tiles[t].coords.z!==this._tileZoom&&(e=this._tiles[t].el,e.onload=u,e.onerror=u,!e.complete)){e.src=y;var n=this._tiles[t].coords;de(e),delete this._tiles[t],this.fire("tileabort",{tile:e,coords:n})}},_removeTile:function(t){var e=this._tiles[t];if(e)return e.el.setAttribute("src",y),Ri.prototype._removeTile.call(this,t)},_tileReady:function(t,e,n){if(this._map&&(!n||n.getAttribute("src")!==y))return Ri.prototype._tileReady.call(this,t,e,n)}});function Oi(t,e){return new Di(t,e)}var zi=Di.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var i=n({},this.defaultWmsParams);for(var r in e)r in this.options||(i[r]=e[r]);e=p(this,e);var o=e.detectRetina&&Ot.retina?2:1,a=this.getTileSize();i.width=a.x*o,i.height=a.y*o,this.wmsParams=i},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,Di.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),n=this._crs,i=k(n.project(e[0]),n.project(e[1])),r=i.min,o=i.max,a=(this._wmsVersion>=1.3&&this._crs===Un?[r.y,r.x,o.y,o.x]:[r.x,r.y,o.x,o.y]).join(","),s=Di.prototype.getTileUrl.call(this,t);return s+f(this.wmsParams,s,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+a},setParams:function(t,e){return n(this.wmsParams,t),e||this.redraw(),this}});function Ni(t,e){return new zi(t,e)}Di.WMS=zi,Oi.wms=Ni;var ki=Fn.extend({options:{padding:.1},initialize:function(t){p(this,t),a(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&_e(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var n=this._map.getZoomScale(e,this._zoom),i=this._map.getSize().multiplyBy(.5+this.options.padding),r=this._map.project(this._center,e),o=i.multiplyBy(-n).add(r).subtract(this._map._getNewPixelOrigin(t,e));Ot.any3d?Se(this._container,o,n):Te(this._container,o)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),n=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new N(n,n.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Ui=ki.extend({options:{tolerance:0},getEvents:function(){var t=ki.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ki.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");ze(t,"mousemove",this._onMouseMove,this),ze(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),ze(t,"mouseout",this._handleMouseOut,this),t["_leaflet_disable_events"]=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){E(this._redrawRequest),delete this._ctx,de(this._container),ke(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var t;for(var e in this._redrawBounds=null,this._layers)t=this._layers[e],t._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){ki.prototype._update.call(this);var t=this._bounds,e=this._container,n=t.getSize(),i=Ot.retina?2:1;Te(e,t.min),e.width=i*n.x,e.height=i*n.y,e.style.width=n.x+"px",e.style.height=n.y+"px",Ot.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){ki.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[a(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,n=e.next,i=e.prev;n?n.prev=i:this._drawLast=i,i?i.next=n:this._drawFirst=n,delete t._order,delete this._layers[a(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"===typeof t.options.dashArray){var e,n,i=t.options.dashArray.split(/[, ]+/),r=[];for(n=0;n<i.length;n++){if(e=Number(i[n]),isNaN(e))return;r.push(e)}t.options._dashArray=r}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||T(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var e=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new N,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t=this._redrawBounds;if(t){var e=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,e.x,e.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var t,e=this._redrawBounds;if(this._ctx.save(),e){var n=e.getSize();this._ctx.beginPath(),this._ctx.rect(e.min.x,e.min.y,n.x,n.y),this._ctx.clip()}this._drawing=!0;for(var i=this._drawFirst;i;i=i.next)t=i.layer,(!e||t._pxBounds&&t._pxBounds.intersects(e))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,e){if(this._drawing){var n,i,r,o,a=t._parts,s=a.length,l=this._ctx;if(s){for(l.beginPath(),n=0;n<s;n++){for(i=0,r=a[n].length;i<r;i++)o=a[n][i],l[i?"lineTo":"moveTo"](o.x,o.y);e&&l.closePath()}this._fillStroke(l,t)}}},_updateCircle:function(t){if(this._drawing&&!t._empty()){var e=t._point,n=this._ctx,i=Math.max(Math.round(t._radius),1),r=(Math.max(Math.round(t._radiusY),1)||i)/i;1!==r&&(n.save(),n.scale(1,r)),n.beginPath(),n.arc(e.x,e.y/r,i,0,2*Math.PI,!1),1!==r&&n.restore(),this._fillStroke(n,t)}},_fillStroke:function(t,e){var n=e.options;n.fill&&(t.globalAlpha=n.fillOpacity,t.fillStyle=n.fillColor||n.color,t.fill(n.fillRule||"evenodd")),n.stroke&&0!==n.weight&&(t.setLineDash&&t.setLineDash(e.options&&e.options._dashArray||[]),t.globalAlpha=n.opacity,t.lineWidth=n.weight,t.strokeStyle=n.color,t.lineCap=n.lineCap,t.lineJoin=n.lineJoin,t.stroke())},_onClick:function(t){for(var e,n,i=this._map.mouseEventToLayerPoint(t),r=this._drawFirst;r;r=r.next)e=r.layer,e.options.interactive&&e._containsPoint(i)&&("click"!==t.type&&"preclick"!==t.type||!this._map._draggableMoved(e))&&(n=e);this._fireEvent(!!n&&[n],t)},_onMouseMove:function(t){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var e=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,e)}},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(ve(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(t,e){if(!this._mouseHoverThrottled){for(var n,i,o=this._drawFirst;o;o=o.next)n=o.layer,n.options.interactive&&n._containsPoint(e)&&(i=n);i!==this._hoveredLayer&&(this._handleMouseOut(t),i&&(_e(this._container,"leaflet-interactive"),this._fireEvent([i],t,"mouseover"),this._hoveredLayer=i)),this._fireEvent(!!this._hoveredLayer&&[this._hoveredLayer],t),this._mouseHoverThrottled=!0,setTimeout(r((function(){this._mouseHoverThrottled=!1}),this),32)}},_fireEvent:function(t,e,n){this._map._fireDOMEvent(e,n||e.type,t)},_bringToFront:function(t){var e=t._order;if(e){var n=e.next,i=e.prev;n&&(n.prev=i,i?i.next=n:n&&(this._drawFirst=n),e.prev=this._drawLast,this._drawLast.next=e,e.next=null,this._drawLast=e,this._requestRedraw(t))}},_bringToBack:function(t){var e=t._order;if(e){var n=e.next,i=e.prev;i&&(i.next=n,n?n.prev=i:i&&(this._drawLast=i),e.prev=null,e.next=this._drawFirst,this._drawFirst.prev=e,this._drawFirst=e,this._requestRedraw(t))}}});function Bi(t){return Ot.canvas?new Ui(t):null}var Fi=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch(t){}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Vi={_initContainer:function(){this._container=ce("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ki.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=Fi("shape");_e(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=Fi("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[a(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;de(e),t.removeInteractiveTarget(e),delete this._layers[a(t)]},_updateStyle:function(t){var e=t._stroke,n=t._fill,i=t.options,r=t._container;r.stroked=!!i.stroke,r.filled=!!i.fill,i.stroke?(e||(e=t._stroke=Fi("stroke")),r.appendChild(e),e.weight=i.weight+"px",e.color=i.color,e.opacity=i.opacity,i.dashArray?e.dashStyle=_(i.dashArray)?i.dashArray.join(" "):i.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=i.lineCap.replace("butt","flat"),e.joinstyle=i.lineJoin):e&&(r.removeChild(e),t._stroke=null),i.fill?(n||(n=t._fill=Fi("fill")),r.appendChild(n),n.color=i.fillColor||i.color,n.opacity=i.fillOpacity):n&&(r.removeChild(n),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),n=Math.round(t._radius),i=Math.round(t._radiusY||n);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+n+","+i+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){fe(t._container)},_bringToBack:function(t){me(t._container)}},Hi=Ot.vml?Fi:K,Wi=ki.extend({_initContainer:function(){this._container=Hi("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Hi("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){de(this._container),ke(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!this._map._animatingZoom||!this._bounds){ki.prototype._update.call(this);var t=this._bounds,e=t.getSize(),n=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,n.setAttribute("width",e.x),n.setAttribute("height",e.y)),Te(n,t.min),n.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=Hi("path");t.options.className&&_e(e,t.options.className),t.options.interactive&&_e(e,"leaflet-interactive"),this._updateStyle(t),this._layers[a(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){de(t._path),t.removeInteractiveTarget(t._path),delete this._layers[a(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,n=t.options;e&&(n.stroke?(e.setAttribute("stroke",n.color),e.setAttribute("stroke-opacity",n.opacity),e.setAttribute("stroke-width",n.weight),e.setAttribute("stroke-linecap",n.lineCap),e.setAttribute("stroke-linejoin",n.lineJoin),n.dashArray?e.setAttribute("stroke-dasharray",n.dashArray):e.removeAttribute("stroke-dasharray"),n.dashOffset?e.setAttribute("stroke-dashoffset",n.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),n.fill?(e.setAttribute("fill",n.fillColor||n.color),e.setAttribute("fill-opacity",n.fillOpacity),e.setAttribute("fill-rule",n.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,J(t._parts,e))},_updateCircle:function(t){var e=t._point,n=Math.max(Math.round(t._radius),1),i=Math.max(Math.round(t._radiusY),1)||n,r="a"+n+","+i+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(e.x-n)+","+e.y+r+2*n+",0 "+r+2*-n+",0 ";this._setPath(t,o)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){fe(t._path)},_bringToBack:function(t){me(t._path)}});function Gi(t){return Ot.svg||Ot.vml?new Wi(t):null}Ot.vml&&Wi.include(Vi),Qe.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&Bi(t)||Gi(t)}});var ji=ri.extend({initialize:function(t,e){ri.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=B(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function Zi(t,e){return new ji(t,e)}Wi.create=Hi,Wi.pointsToPath=J,ai.geometryToLayer=si,ai.coordsToLatLng=ui,ai.coordsToLatLngs=hi,ai.latLngToCoords=ci,ai.latLngsToCoords=di,ai.getFeature=pi,ai.asFeature=fi,Qe.mergeOptions({boxZoom:!0});var qi=pn.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){ze(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){ke(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){de(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),ee(),Le(),this._startPoint=this._map.mouseEventToContainerPoint(t),ze(document,{contextmenu:Ze,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=ce("div","leaflet-zoom-box",this._container),_e(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new N(this._point,this._startPoint),n=e.getSize();Te(this._box,e.min),this._box.style.width=n.x+"px",this._box.style.height=n.y+"px"},_finish:function(){this._moved&&(de(this._box),ve(this._container,"leaflet-crosshair")),ne(),Ae(),ke(document,{contextmenu:Ze,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(r(this._resetState,this),0);var e=new U(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Qe.addInitHook("addHandler","boxZoom",qi),Qe.mergeOptions({doubleClickZoom:!0});var Xi=pn.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,n=e.getZoom(),i=e.options.zoomDelta,r=t.originalEvent.shiftKey?n-i:n+i;"center"===e.options.doubleClickZoom?e.setZoom(r):e.setZoomAround(t.containerPoint,r)}});Qe.addInitHook("addHandler","doubleClickZoom",Xi),Qe.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Yi=pn.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new _n(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}_e(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){ve(this._map._container,"leaflet-grab"),ve(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=B(this._map.options.maxBounds);this._offsetLimit=k(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,n=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(n),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){while(this._positions.length>1&&t-this._times[0]>50)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),n=this._initialWorldOffset,i=this._draggable._newPos.x,r=(i-e+n)%t+e-n,o=(i+e+n)%t-e-n,a=Math.abs(r+n)<Math.abs(o+n)?r:o;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=a},_onDragEnd:function(t){var e=this._map,n=e.options,i=!n.inertia||t.noInertia||this._times.length<2;if(e.fire("dragend",t),i)e.fire("moveend");else{this._prunePositions(+new Date);var r=this._lastPos.subtract(this._positions[0]),o=(this._lastTime-this._times[0])/1e3,a=n.easeLinearity,s=r.multiplyBy(a/o),l=s.distanceTo([0,0]),u=Math.min(n.inertiaMaxSpeed,l),h=s.multiplyBy(u/l),c=u/(n.inertiaDeceleration*a),d=h.multiplyBy(-c/2).round();d.x||d.y?(d=e._limitOffset(d,e.options.maxBounds),T((function(){e.panBy(d,{duration:c,easeLinearity:a,noMoveStart:!0,animate:!0})}))):e.fire("moveend")}}});Qe.addInitHook("addHandler","dragging",Yi),Qe.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Ki=pn.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),ze(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),ke(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var t=document.body,e=document.documentElement,n=t.scrollTop||e.scrollTop,i=t.scrollLeft||e.scrollLeft;this._map._container.focus(),window.scrollTo(i,n)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var e,n,i=this._panKeys={},r=this.keyCodes;for(e=0,n=r.left.length;e<n;e++)i[r.left[e]]=[-1*t,0];for(e=0,n=r.right.length;e<n;e++)i[r.right[e]]=[t,0];for(e=0,n=r.down.length;e<n;e++)i[r.down[e]]=[0,t];for(e=0,n=r.up.length;e<n;e++)i[r.up[e]]=[0,-1*t]},_setZoomDelta:function(t){var e,n,i=this._zoomKeys={},r=this.keyCodes;for(e=0,n=r.zoomIn.length;e<n;e++)i[r.zoomIn[e]]=t;for(e=0,n=r.zoomOut.length;e<n;e++)i[r.zoomOut[e]]=-t},_addHooks:function(){ze(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){ke(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e,n=t.keyCode,i=this._map;if(n in this._panKeys)i._panAnim&&i._panAnim._inProgress||(e=this._panKeys[n],t.shiftKey&&(e=z(e).multiplyBy(3)),i.panBy(e),i.options.maxBounds&&i.panInsideBounds(i.options.maxBounds));else if(n in this._zoomKeys)i.setZoom(i.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[n]);else{if(27!==n||!i._popup||!i._popup.options.closeOnEscapeKey)return;i.closePopup()}Ze(t)}}});Qe.addInitHook("addHandler","keyboard",Ki),Qe.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var Ji=pn.extend({addHooks:function(){ze(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){ke(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=Ye(t),n=this._map.options.wheelDebounceTime;this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var i=Math.max(n-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(r(this._performZoom,this),i),Ze(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),n=this._map.options.zoomSnap||0;t._stop();var i=this._delta/(4*this._map.options.wheelPxPerZoomLevel),r=4*Math.log(2/(1+Math.exp(-Math.abs(i))))/Math.LN2,o=n?Math.ceil(r/n)*n:r,a=t._limitZoom(e+(this._delta>0?o:-o))-e;this._delta=0,this._startTime=null,a&&("center"===t.options.scrollWheelZoom?t.setZoom(e+a):t.setZoomAround(this._lastMousePos,e+a))}});Qe.addInitHook("addHandler","scrollWheelZoom",Ji);var $i=600;Qe.mergeOptions({tapHold:Ot.touchNative&&Ot.safari&&Ot.mobile,tapTolerance:15});var Qi=pn.extend({addHooks:function(){ze(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){ke(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(clearTimeout(this._holdTimeout),1===t.touches.length){var e=t.touches[0];this._startPos=this._newPos=new D(e.clientX,e.clientY),this._holdTimeout=setTimeout(r((function(){this._cancel(),this._isTapValid()&&(ze(document,"touchend",je),ze(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",e))}),this),$i),ze(document,"touchend touchcancel contextmenu",this._cancel,this),ze(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){ke(document,"touchend",je),ke(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),ke(document,"touchend touchcancel contextmenu",this._cancel,this),ke(document,"touchmove",this._onMove,this)},_onMove:function(t){var e=t.touches[0];this._newPos=new D(e.clientX,e.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,e){var n=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY});n._simulated=!0,e.target.dispatchEvent(n)}});Qe.addInitHook("addHandler","tapHold",Qi),Qe.mergeOptions({touchZoom:Ot.touch,bounceAtZoomLimits:!0});var tr=pn.extend({addHooks:function(){_e(this._map._container,"leaflet-touch-zoom"),ze(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ve(this._map._container,"leaflet-touch-zoom"),ke(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var n=e.mouseEventToContainerPoint(t.touches[0]),i=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(n.add(i)._divideBy(2))),this._startDist=n.distanceTo(i),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),ze(document,"touchmove",this._onTouchMove,this),ze(document,"touchend touchcancel",this._onTouchEnd,this),je(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,n=e.mouseEventToContainerPoint(t.touches[0]),i=e.mouseEventToContainerPoint(t.touches[1]),o=n.distanceTo(i)/this._startDist;if(this._zoom=e.getScaleZoom(o,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&o<1||this._zoom>e.getMaxZoom()&&o>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===o)return}else{var a=n._add(i)._divideBy(2)._subtract(this._centerPoint);if(1===o&&0===a.x&&0===a.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(a),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),E(this._animRequest);var s=r(e._move,e,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=T(s,this,!0),je(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,E(this._animRequest),ke(document,"touchmove",this._onTouchMove,this),ke(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});Qe.addInitHook("addHandler","touchZoom",tr),Qe.BoxZoom=qi,Qe.DoubleClickZoom=Xi,Qe.Drag=Yi,Qe.Keyboard=Ki,Qe.ScrollWheelZoom=Ji,Qe.TapHold=Qi,Qe.TouchZoom=tr,t.Bounds=N,t.Browser=Ot,t.CRS=H,t.Canvas=Ui,t.Circle=ti,t.CircleMarker=$n,t.Class=A,t.Control=en,t.DivIcon=Ai,t.DivOverlay=Si,t.DomEvent=Je,t.DomUtil=Oe,t.Draggable=_n,t.Evented=I,t.FeatureGroup=Wn,t.GeoJSON=ai,t.GridLayer=Ri,t.Handler=pn,t.Icon=jn,t.ImageOverlay=vi,t.LatLng=F,t.LatLngBounds=U,t.Layer=Fn,t.LayerGroup=Vn,t.LineUtil=Rn,t.Map=Qe,t.Marker=Yn,t.Mixin=mn,t.Path=Jn,t.Point=D,t.PolyUtil=Dn,t.Polygon=ri,t.Polyline=ni,t.Popup=Ti,t.PosAnimation=$e,t.Projection=Nn,t.Rectangle=ji,t.Renderer=ki,t.SVG=Wi,t.SVGOverlay=Mi,t.TileLayer=Di,t.Tooltip=Pi,t.Transformation=Z,t.Util=P,t.VideoOverlay=xi,t.bind=r,t.bounds=k,t.canvas=Bi,t.circle=ei,t.circleMarker=Qn,t.control=nn,t.divIcon=Ci,t.extend=n,t.featureGroup=Gn,t.geoJSON=gi,t.geoJson=_i,t.gridLayer=Ii,t.icon=Zn,t.imageOverlay=yi,t.latLng=V,t.latLngBounds=B,t.layerGroup=Hn,t.map=tn,t.marker=Kn,t.point=z,t.polygon=oi,t.polyline=ii,t.popup=Ei,t.rectangle=Zi,t.setOptions=p,t.stamp=a,t.svg=Gi,t.svgOverlay=wi,t.tileLayer=Oi,t.tooltip=Li,t.transformation=q,t.version=e,t.videoOverlay=bi;var er=window.L;t.noConflict=function(){return window.L=er,this},window.L=t}))},543:function(t,e,n){var i;
|
|
7
|
-
/**
|
|
8
|
-
* @license
|
|
9
|
-
* Lodash <https://lodash.com/>
|
|
10
|
-
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
11
|
-
* Released under MIT license <https://lodash.com/license>
|
|
12
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
13
|
-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
14
|
-
*/t=n.nmd(t),function(){var r,o="4.17.21",a=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",u="Invalid `variable` option passed into `_.template`",h="__lodash_hash_undefined__",c=500,d="__lodash_placeholder__",p=1,f=2,m=4,g=1,_=2,v=1,y=2,x=4,b=8,M=16,w=32,S=64,T=128,E=256,P=512,L=30,A="...",C=800,R=16,I=1,D=2,O=3,z=1/0,N=9007199254740991,k=17976931348623157e292,U=NaN,B=4294967295,F=B-1,V=B>>>1,H=[["ary",T],["bind",v],["bindKey",y],["curry",b],["curryRight",M],["flip",P],["partial",w],["partialRight",S],["rearg",E]],W="[object Arguments]",G="[object Array]",j="[object AsyncFunction]",Z="[object Boolean]",q="[object Date]",X="[object DOMException]",Y="[object Error]",K="[object Function]",J="[object GeneratorFunction]",$="[object Map]",Q="[object Number]",tt="[object Null]",et="[object Object]",nt="[object Promise]",it="[object Proxy]",rt="[object RegExp]",ot="[object Set]",at="[object String]",st="[object Symbol]",lt="[object Undefined]",ut="[object WeakMap]",ht="[object WeakSet]",ct="[object ArrayBuffer]",dt="[object DataView]",pt="[object Float32Array]",ft="[object Float64Array]",mt="[object Int8Array]",gt="[object Int16Array]",_t="[object Int32Array]",vt="[object Uint8Array]",yt="[object Uint8ClampedArray]",xt="[object Uint16Array]",bt="[object Uint32Array]",Mt=/\b__p \+= '';/g,wt=/\b(__p \+=) '' \+/g,St=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Tt=/&(?:amp|lt|gt|quot|#39);/g,Et=/[&<>"']/g,Pt=RegExp(Tt.source),Lt=RegExp(Et.source),At=/<%-([\s\S]+?)%>/g,Ct=/<%([\s\S]+?)%>/g,Rt=/<%=([\s\S]+?)%>/g,It=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Dt=/^\w*$/,Ot=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,zt=/[\\^$.*+?()[\]{}|]/g,Nt=RegExp(zt.source),kt=/^\s+/,Ut=/\s/,Bt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ft=/\{\n\/\* \[wrapped with (.+)\] \*/,Vt=/,? & /,Ht=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Wt=/[()=,{}\[\]\/\s]/,Gt=/\\(\\)?/g,jt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Zt=/\w*$/,qt=/^[-+]0x[0-9a-f]+$/i,Xt=/^0b[01]+$/i,Yt=/^\[object .+?Constructor\]$/,Kt=/^0o[0-7]+$/i,Jt=/^(?:0|[1-9]\d*)$/,$t=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Qt=/($^)/,te=/['\n\r\u2028\u2029\\]/g,ee="\\ud800-\\udfff",ne="\\u0300-\\u036f",ie="\\ufe20-\\ufe2f",re="\\u20d0-\\u20ff",oe=ne+ie+re,ae="\\u2700-\\u27bf",se="a-z\\xdf-\\xf6\\xf8-\\xff",le="\\xac\\xb1\\xd7\\xf7",ue="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",he="\\u2000-\\u206f",ce=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",de="A-Z\\xc0-\\xd6\\xd8-\\xde",pe="\\ufe0e\\ufe0f",fe=le+ue+he+ce,me="['’]",ge="["+ee+"]",_e="["+fe+"]",ve="["+oe+"]",ye="\\d+",xe="["+ae+"]",be="["+se+"]",Me="[^"+ee+fe+ye+ae+se+de+"]",we="\\ud83c[\\udffb-\\udfff]",Se="(?:"+ve+"|"+we+")",Te="[^"+ee+"]",Ee="(?:\\ud83c[\\udde6-\\uddff]){2}",Pe="[\\ud800-\\udbff][\\udc00-\\udfff]",Le="["+de+"]",Ae="\\u200d",Ce="(?:"+be+"|"+Me+")",Re="(?:"+Le+"|"+Me+")",Ie="(?:"+me+"(?:d|ll|m|re|s|t|ve))?",De="(?:"+me+"(?:D|LL|M|RE|S|T|VE))?",Oe=Se+"?",ze="["+pe+"]?",Ne="(?:"+Ae+"(?:"+[Te,Ee,Pe].join("|")+")"+ze+Oe+")*",ke="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ue="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Be=ze+Oe+Ne,Fe="(?:"+[xe,Ee,Pe].join("|")+")"+Be,Ve="(?:"+[Te+ve+"?",ve,Ee,Pe,ge].join("|")+")",He=RegExp(me,"g"),We=RegExp(ve,"g"),Ge=RegExp(we+"(?="+we+")|"+Ve+Be,"g"),je=RegExp([Le+"?"+be+"+"+Ie+"(?="+[_e,Le,"$"].join("|")+")",Re+"+"+De+"(?="+[_e,Le+Ce,"$"].join("|")+")",Le+"?"+Ce+"+"+Ie,Le+"+"+De,Ue,ke,ye,Fe].join("|"),"g"),Ze=RegExp("["+Ae+ee+oe+pe+"]"),qe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Xe=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ye=-1,Ke={};Ke[pt]=Ke[ft]=Ke[mt]=Ke[gt]=Ke[_t]=Ke[vt]=Ke[yt]=Ke[xt]=Ke[bt]=!0,Ke[W]=Ke[G]=Ke[ct]=Ke[Z]=Ke[dt]=Ke[q]=Ke[Y]=Ke[K]=Ke[$]=Ke[Q]=Ke[et]=Ke[rt]=Ke[ot]=Ke[at]=Ke[ut]=!1;var Je={};Je[W]=Je[G]=Je[ct]=Je[dt]=Je[Z]=Je[q]=Je[pt]=Je[ft]=Je[mt]=Je[gt]=Je[_t]=Je[$]=Je[Q]=Je[et]=Je[rt]=Je[ot]=Je[at]=Je[st]=Je[vt]=Je[yt]=Je[xt]=Je[bt]=!0,Je[Y]=Je[K]=Je[ut]=!1;var $e={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},Qe={"&":"&","<":"<",">":">",'"':""","'":"'"},tn={"&":"&","<":"<",">":">",""":'"',"'":"'"},en={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},nn=parseFloat,rn=parseInt,on="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,an="object"==typeof self&&self&&self.Object===Object&&self,sn=on||an||Function("return this")(),ln=e&&!e.nodeType&&e,un=ln&&t&&!t.nodeType&&t,hn=un&&un.exports===ln,cn=hn&&on.process,dn=function(){try{var t=un&&un.require&&un.require("util").types;return t||cn&&cn.binding&&cn.binding("util")}catch(e){}}(),pn=dn&&dn.isArrayBuffer,fn=dn&&dn.isDate,mn=dn&&dn.isMap,gn=dn&&dn.isRegExp,_n=dn&&dn.isSet,vn=dn&&dn.isTypedArray;function yn(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function xn(t,e,n,i){var r=-1,o=null==t?0:t.length;while(++r<o){var a=t[r];e(i,a,n(a),t)}return i}function bn(t,e){var n=-1,i=null==t?0:t.length;while(++n<i)if(!1===e(t[n],n,t))break;return t}function Mn(t,e){var n=null==t?0:t.length;while(n--)if(!1===e(t[n],n,t))break;return t}function wn(t,e){var n=-1,i=null==t?0:t.length;while(++n<i)if(!e(t[n],n,t))return!1;return!0}function Sn(t,e){var n=-1,i=null==t?0:t.length,r=0,o=[];while(++n<i){var a=t[n];e(a,n,t)&&(o[r++]=a)}return o}function Tn(t,e){var n=null==t?0:t.length;return!!n&&kn(t,e,0)>-1}function En(t,e,n){var i=-1,r=null==t?0:t.length;while(++i<r)if(n(e,t[i]))return!0;return!1}function Pn(t,e){var n=-1,i=null==t?0:t.length,r=Array(i);while(++n<i)r[n]=e(t[n],n,t);return r}function Ln(t,e){var n=-1,i=e.length,r=t.length;while(++n<i)t[r+n]=e[n];return t}function An(t,e,n,i){var r=-1,o=null==t?0:t.length;i&&o&&(n=t[++r]);while(++r<o)n=e(n,t[r],r,t);return n}function Cn(t,e,n,i){var r=null==t?0:t.length;i&&r&&(n=t[--r]);while(r--)n=e(n,t[r],r,t);return n}function Rn(t,e){var n=-1,i=null==t?0:t.length;while(++n<i)if(e(t[n],n,t))return!0;return!1}var In=Vn("length");function Dn(t){return t.split("")}function On(t){return t.match(Ht)||[]}function zn(t,e,n){var i;return n(t,(function(t,n,r){if(e(t,n,r))return i=n,!1})),i}function Nn(t,e,n,i){var r=t.length,o=n+(i?1:-1);while(i?o--:++o<r)if(e(t[o],o,t))return o;return-1}function kn(t,e,n){return e===e?pi(t,e,n):Nn(t,Bn,n)}function Un(t,e,n,i){var r=n-1,o=t.length;while(++r<o)if(i(t[r],e))return r;return-1}function Bn(t){return t!==t}function Fn(t,e){var n=null==t?0:t.length;return n?jn(t,e)/n:U}function Vn(t){return function(e){return null==e?r:e[t]}}function Hn(t){return function(e){return null==t?r:t[e]}}function Wn(t,e,n,i,r){return r(t,(function(t,r,o){n=i?(i=!1,t):e(n,t,r,o)})),n}function Gn(t,e){var n=t.length;t.sort(e);while(n--)t[n]=t[n].value;return t}function jn(t,e){var n,i=-1,o=t.length;while(++i<o){var a=e(t[i]);a!==r&&(n=n===r?a:n+a)}return n}function Zn(t,e){var n=-1,i=Array(t);while(++n<t)i[n]=e(n);return i}function qn(t,e){return Pn(e,(function(e){return[e,t[e]]}))}function Xn(t){return t?t.slice(0,_i(t)+1).replace(kt,""):t}function Yn(t){return function(e){return t(e)}}function Kn(t,e){return Pn(e,(function(e){return t[e]}))}function Jn(t,e){return t.has(e)}function $n(t,e){var n=-1,i=t.length;while(++n<i&&kn(e,t[n],0)>-1);return n}function Qn(t,e){var n=t.length;while(n--&&kn(e,t[n],0)>-1);return n}function ti(t,e){var n=t.length,i=0;while(n--)t[n]===e&&++i;return i}var ei=Hn($e),ni=Hn(Qe);function ii(t){return"\\"+en[t]}function ri(t,e){return null==t?r:t[e]}function oi(t){return Ze.test(t)}function ai(t){return qe.test(t)}function si(t){var e,n=[];while(!(e=t.next()).done)n.push(e.value);return n}function li(t){var e=-1,n=Array(t.size);return t.forEach((function(t,i){n[++e]=[i,t]})),n}function ui(t,e){return function(n){return t(e(n))}}function hi(t,e){var n=-1,i=t.length,r=0,o=[];while(++n<i){var a=t[n];a!==e&&a!==d||(t[n]=d,o[r++]=n)}return o}function ci(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function di(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function pi(t,e,n){var i=n-1,r=t.length;while(++i<r)if(t[i]===e)return i;return-1}function fi(t,e,n){var i=n+1;while(i--)if(t[i]===e)return i;return i}function mi(t){return oi(t)?yi(t):In(t)}function gi(t){return oi(t)?xi(t):Dn(t)}function _i(t){var e=t.length;while(e--&&Ut.test(t.charAt(e)));return e}var vi=Hn(tn);function yi(t){var e=Ge.lastIndex=0;while(Ge.test(t))++e;return e}function xi(t){return t.match(Ge)||[]}function bi(t){return t.match(je)||[]}var Mi=function t(e){e=null==e?sn:wi.defaults(sn.Object(),e,wi.pick(sn,Xe));var n=e.Array,i=e.Date,Ut=e.Error,Ht=e.Function,ee=e.Math,ne=e.Object,ie=e.RegExp,re=e.String,oe=e.TypeError,ae=n.prototype,se=Ht.prototype,le=ne.prototype,ue=e["__core-js_shared__"],he=se.toString,ce=le.hasOwnProperty,de=0,pe=function(){var t=/[^.]+$/.exec(ue&&ue.keys&&ue.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),fe=le.toString,me=he.call(ne),ge=sn._,_e=ie("^"+he.call(ce).replace(zt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ve=hn?e.Buffer:r,ye=e.Symbol,xe=e.Uint8Array,be=ve?ve.allocUnsafe:r,Me=ui(ne.getPrototypeOf,ne),we=ne.create,Se=le.propertyIsEnumerable,Te=ae.splice,Ee=ye?ye.isConcatSpreadable:r,Pe=ye?ye.iterator:r,Le=ye?ye.toStringTag:r,Ae=function(){try{var t=qa(ne,"defineProperty");return t({},"",{}),t}catch(e){}}(),Ce=e.clearTimeout!==sn.clearTimeout&&e.clearTimeout,Re=i&&i.now!==sn.Date.now&&i.now,Ie=e.setTimeout!==sn.setTimeout&&e.setTimeout,De=ee.ceil,Oe=ee.floor,ze=ne.getOwnPropertySymbols,Ne=ve?ve.isBuffer:r,ke=e.isFinite,Ue=ae.join,Be=ui(ne.keys,ne),Fe=ee.max,Ve=ee.min,Ge=i.now,je=e.parseInt,Ze=ee.random,qe=ae.reverse,$e=qa(e,"DataView"),Qe=qa(e,"Map"),tn=qa(e,"Promise"),en=qa(e,"Set"),on=qa(e,"WeakMap"),an=qa(ne,"create"),ln=on&&new on,un={},cn=Is($e),dn=Is(Qe),In=Is(tn),Dn=Is(en),Hn=Is(on),pi=ye?ye.prototype:r,yi=pi?pi.valueOf:r,xi=pi?pi.toString:r;function Mi(t){if(Th(t)&&!lh(t)&&!(t instanceof Pi)){if(t instanceof Ei)return t;if(ce.call(t,"__wrapped__"))return Os(t)}return new Ei(t)}var Si=function(){function t(){}return function(e){if(!Sh(e))return{};if(we)return we(e);t.prototype=e;var n=new t;return t.prototype=r,n}}();function Ti(){}function Ei(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=r}function Pi(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=B,this.__views__=[]}function Li(){var t=new Pi(this.__wrapped__);return t.__actions__=ra(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=ra(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=ra(this.__views__),t}function Ai(){if(this.__filtered__){var t=new Pi(this);t.__dir__=-1,t.__filtered__=!0}else t=this.clone(),t.__dir__*=-1;return t}function Ci(){var t=this.__wrapped__.value(),e=this.__dir__,n=lh(t),i=e<0,r=n?t.length:0,o=$a(0,r,this.__views__),a=o.start,s=o.end,l=s-a,u=i?s:a-1,h=this.__iteratees__,c=h.length,d=0,p=Ve(l,this.__takeCount__);if(!n||!i&&r==l&&p==l)return Bo(t,this.__actions__);var f=[];t:while(l--&&d<p){u+=e;var m=-1,g=t[u];while(++m<c){var _=h[m],v=_.iteratee,y=_.type,x=v(g);if(y==D)g=x;else if(!x){if(y==I)continue t;break t}}f[d++]=g}return f}function Ri(t){var e=-1,n=null==t?0:t.length;this.clear();while(++e<n){var i=t[e];this.set(i[0],i[1])}}function Ii(){this.__data__=an?an(null):{},this.size=0}function Di(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function Oi(t){var e=this.__data__;if(an){var n=e[t];return n===h?r:n}return ce.call(e,t)?e[t]:r}function zi(t){var e=this.__data__;return an?e[t]!==r:ce.call(e,t)}function Ni(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=an&&e===r?h:e,this}function ki(t){var e=-1,n=null==t?0:t.length;this.clear();while(++e<n){var i=t[e];this.set(i[0],i[1])}}function Ui(){this.__data__=[],this.size=0}function Bi(t){var e=this.__data__,n=hr(e,t);if(n<0)return!1;var i=e.length-1;return n==i?e.pop():Te.call(e,n,1),--this.size,!0}function Fi(t){var e=this.__data__,n=hr(e,t);return n<0?r:e[n][1]}function Vi(t){return hr(this.__data__,t)>-1}function Hi(t,e){var n=this.__data__,i=hr(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}function Wi(t){var e=-1,n=null==t?0:t.length;this.clear();while(++e<n){var i=t[e];this.set(i[0],i[1])}}function Gi(){this.size=0,this.__data__={hash:new Ri,map:new(Qe||ki),string:new Ri}}function ji(t){var e=ja(this,t)["delete"](t);return this.size-=e?1:0,e}function Zi(t){return ja(this,t).get(t)}function qi(t){return ja(this,t).has(t)}function Xi(t,e){var n=ja(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}function Yi(t){var e=-1,n=null==t?0:t.length;this.__data__=new Wi;while(++e<n)this.add(t[e])}function Ki(t){return this.__data__.set(t,h),this}function Ji(t){return this.__data__.has(t)}function $i(t){var e=this.__data__=new ki(t);this.size=e.size}function Qi(){this.__data__=new ki,this.size=0}function tr(t){var e=this.__data__,n=e["delete"](t);return this.size=e.size,n}function er(t){return this.__data__.get(t)}function nr(t){return this.__data__.has(t)}function ir(t,e){var n=this.__data__;if(n instanceof ki){var i=n.__data__;if(!Qe||i.length<a-1)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new Wi(i)}return n.set(t,e),this.size=n.size,this}function rr(t,e){var n=lh(t),i=!n&&sh(t),r=!n&&!i&&ph(t),o=!n&&!i&&!r&&Fh(t),a=n||i||r||o,s=a?Zn(t.length,re):[],l=s.length;for(var u in t)!e&&!ce.call(t,u)||a&&("length"==u||r&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||as(u,l))||s.push(u);return s}function or(t){var e=t.length;return e?t[vo(0,e-1)]:r}function ar(t,e){return As(ra(t),gr(e,0,t.length))}function sr(t){return As(ra(t))}function lr(t,e,n){(n!==r&&!rh(t[e],n)||n===r&&!(e in t))&&fr(t,e,n)}function ur(t,e,n){var i=t[e];ce.call(t,e)&&rh(i,n)&&(n!==r||e in t)||fr(t,e,n)}function hr(t,e){var n=t.length;while(n--)if(rh(t[n][0],e))return n;return-1}function cr(t,e,n,i){return Mr(t,(function(t,r,o){e(i,t,n(t),o)})),i}function dr(t,e){return t&&oa(e,Mc(e),t)}function pr(t,e){return t&&oa(e,wc(e),t)}function fr(t,e,n){"__proto__"==e&&Ae?Ae(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function mr(t,e){var i=-1,o=e.length,a=n(o),s=null==t;while(++i<o)a[i]=s?r:gc(t,e[i]);return a}function gr(t,e,n){return t===t&&(n!==r&&(t=t<=n?t:n),e!==r&&(t=t>=e?t:e)),t}function _r(t,e,n,i,o,a){var s,l=e&p,u=e&f,h=e&m;if(n&&(s=o?n(t,i,o,a):n(t)),s!==r)return s;if(!Sh(t))return t;var c=lh(t);if(c){if(s=es(t),!l)return ra(t,s)}else{var d=Ja(t),g=d==K||d==J;if(ph(t))return Xo(t,l);if(d==et||d==W||g&&!o){if(s=u||g?{}:ns(t),!l)return u?sa(t,pr(s,t)):aa(t,dr(s,t))}else{if(!Je[d])return o?t:{};s=is(t,d,l)}}a||(a=new $i);var _=a.get(t);if(_)return _;a.set(t,s),kh(t)?t.forEach((function(i){s.add(_r(i,e,n,i,t,a))})):Eh(t)&&t.forEach((function(i,r){s.set(r,_r(i,e,n,r,t,a))}));var v=h?u?Fa:Ba:u?wc:Mc,y=c?r:v(t);return bn(y||t,(function(i,r){y&&(r=i,i=t[r]),ur(s,r,_r(i,e,n,r,t,a))})),s}function vr(t){var e=Mc(t);return function(n){return yr(n,t,e)}}function yr(t,e,n){var i=n.length;if(null==t)return!i;t=ne(t);while(i--){var o=n[i],a=e[o],s=t[o];if(s===r&&!(o in t)||!a(s))return!1}return!0}function xr(t,e,n){if("function"!=typeof t)throw new oe(l);return Ts((function(){t.apply(r,n)}),e)}function br(t,e,n,i){var r=-1,o=Tn,s=!0,l=t.length,u=[],h=e.length;if(!l)return u;n&&(e=Pn(e,Yn(n))),i?(o=En,s=!1):e.length>=a&&(o=Jn,s=!1,e=new Yi(e));t:while(++r<l){var c=t[r],d=null==n?c:n(c);if(c=i||0!==c?c:0,s&&d===d){var p=h;while(p--)if(e[p]===d)continue t;u.push(c)}else o(e,d,i)||u.push(c)}return u}Mi.templateSettings={escape:At,evaluate:Ct,interpolate:Rt,variable:"",imports:{_:Mi}},Mi.prototype=Ti.prototype,Mi.prototype.constructor=Mi,Ei.prototype=Si(Ti.prototype),Ei.prototype.constructor=Ei,Pi.prototype=Si(Ti.prototype),Pi.prototype.constructor=Pi,Ri.prototype.clear=Ii,Ri.prototype["delete"]=Di,Ri.prototype.get=Oi,Ri.prototype.has=zi,Ri.prototype.set=Ni,ki.prototype.clear=Ui,ki.prototype["delete"]=Bi,ki.prototype.get=Fi,ki.prototype.has=Vi,ki.prototype.set=Hi,Wi.prototype.clear=Gi,Wi.prototype["delete"]=ji,Wi.prototype.get=Zi,Wi.prototype.has=qi,Wi.prototype.set=Xi,Yi.prototype.add=Yi.prototype.push=Ki,Yi.prototype.has=Ji,$i.prototype.clear=Qi,$i.prototype["delete"]=tr,$i.prototype.get=er,$i.prototype.has=nr,$i.prototype.set=ir;var Mr=ha(Rr),wr=ha(Ir,!0);function Sr(t,e){var n=!0;return Mr(t,(function(t,i,r){return n=!!e(t,i,r),n})),n}function Tr(t,e,n){var i=-1,o=t.length;while(++i<o){var a=t[i],s=e(a);if(null!=s&&(l===r?s===s&&!Bh(s):n(s,l)))var l=s,u=a}return u}function Er(t,e,n,i){var o=t.length;n=Xh(n),n<0&&(n=-n>o?0:o+n),i=i===r||i>o?o:Xh(i),i<0&&(i+=o),i=n>i?0:Yh(i);while(n<i)t[n++]=e;return t}function Pr(t,e){var n=[];return Mr(t,(function(t,i,r){e(t,i,r)&&n.push(t)})),n}function Lr(t,e,n,i,r){var o=-1,a=t.length;n||(n=os),r||(r=[]);while(++o<a){var s=t[o];e>0&&n(s)?e>1?Lr(s,e-1,n,i,r):Ln(r,s):i||(r[r.length]=s)}return r}var Ar=ca(),Cr=ca(!0);function Rr(t,e){return t&&Ar(t,e,Mc)}function Ir(t,e){return t&&Cr(t,e,Mc)}function Dr(t,e){return Sn(e,(function(e){return bh(t[e])}))}function Or(t,e){e=Go(e,t);var n=0,i=e.length;while(null!=t&&n<i)t=t[Rs(e[n++])];return n&&n==i?t:r}function zr(t,e,n){var i=e(t);return lh(t)?i:Ln(i,n(t))}function Nr(t){return null==t?t===r?lt:tt:Le&&Le in ne(t)?Xa(t):ys(t)}function kr(t,e){return t>e}function Ur(t,e){return null!=t&&ce.call(t,e)}function Br(t,e){return null!=t&&e in ne(t)}function Fr(t,e,n){return t>=Ve(e,n)&&t<Fe(e,n)}function Vr(t,e,i){var o=i?En:Tn,a=t[0].length,s=t.length,l=s,u=n(s),h=1/0,c=[];while(l--){var d=t[l];l&&e&&(d=Pn(d,Yn(e))),h=Ve(d.length,h),u[l]=!i&&(e||a>=120&&d.length>=120)?new Yi(l&&d):r}d=t[0];var p=-1,f=u[0];t:while(++p<a&&c.length<h){var m=d[p],g=e?e(m):m;if(m=i||0!==m?m:0,!(f?Jn(f,g):o(c,g,i))){l=s;while(--l){var _=u[l];if(!(_?Jn(_,g):o(t[l],g,i)))continue t}f&&f.push(g),c.push(m)}}return c}function Hr(t,e,n,i){return Rr(t,(function(t,r,o){e(i,n(t),r,o)})),i}function Wr(t,e,n){e=Go(e,t),t=bs(t,e);var i=null==t?t:t[Rs(ol(e))];return null==i?r:yn(i,t,n)}function Gr(t){return Th(t)&&Nr(t)==W}function jr(t){return Th(t)&&Nr(t)==ct}function Zr(t){return Th(t)&&Nr(t)==q}function qr(t,e,n,i,r){return t===e||(null==t||null==e||!Th(t)&&!Th(e)?t!==t&&e!==e:Xr(t,e,n,i,qr,r))}function Xr(t,e,n,i,r,o){var a=lh(t),s=lh(e),l=a?G:Ja(t),u=s?G:Ja(e);l=l==W?et:l,u=u==W?et:u;var h=l==et,c=u==et,d=l==u;if(d&&ph(t)){if(!ph(e))return!1;a=!0,h=!1}if(d&&!h)return o||(o=new $i),a||Fh(t)?za(t,e,n,i,r,o):Na(t,e,l,n,i,r,o);if(!(n&g)){var p=h&&ce.call(t,"__wrapped__"),f=c&&ce.call(e,"__wrapped__");if(p||f){var m=p?t.value():t,_=f?e.value():e;return o||(o=new $i),r(m,_,n,i,o)}}return!!d&&(o||(o=new $i),ka(t,e,n,i,r,o))}function Yr(t){return Th(t)&&Ja(t)==$}function Kr(t,e,n,i){var o=n.length,a=o,s=!i;if(null==t)return!a;t=ne(t);while(o--){var l=n[o];if(s&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}while(++o<a){l=n[o];var u=l[0],h=t[u],c=l[1];if(s&&l[2]){if(h===r&&!(u in t))return!1}else{var d=new $i;if(i)var p=i(h,c,u,t,e,d);if(!(p===r?qr(c,h,g|_,i,d):p))return!1}}return!0}function Jr(t){if(!Sh(t)||cs(t))return!1;var e=bh(t)?_e:Yt;return e.test(Is(t))}function $r(t){return Th(t)&&Nr(t)==rt}function Qr(t){return Th(t)&&Ja(t)==ot}function to(t){return Th(t)&&wh(t.length)&&!!Ke[Nr(t)]}function eo(t){return"function"==typeof t?t:null==t?Cd:"object"==typeof t?lh(t)?so(t[0],t[1]):ao(t):Wd(t)}function no(t){if(!ps(t))return Be(t);var e=[];for(var n in ne(t))ce.call(t,n)&&"constructor"!=n&&e.push(n);return e}function io(t){if(!Sh(t))return vs(t);var e=ps(t),n=[];for(var i in t)("constructor"!=i||!e&&ce.call(t,i))&&n.push(i);return n}function ro(t,e){return t<e}function oo(t,e){var i=-1,r=hh(t)?n(t.length):[];return Mr(t,(function(t,n,o){r[++i]=e(t,n,o)})),r}function ao(t){var e=Za(t);return 1==e.length&&e[0][2]?ms(e[0][0],e[0][1]):function(n){return n===t||Kr(n,t,e)}}function so(t,e){return ls(t)&&fs(e)?ms(Rs(t),e):function(n){var i=gc(n,t);return i===r&&i===e?vc(n,t):qr(e,i,g|_)}}function lo(t,e,n,i,o){t!==e&&Ar(e,(function(a,s){if(o||(o=new $i),Sh(a))uo(t,e,s,n,lo,i,o);else{var l=i?i(ws(t,s),a,s+"",t,e,o):r;l===r&&(l=a),lr(t,s,l)}}),wc)}function uo(t,e,n,i,o,a,s){var l=ws(t,n),u=ws(e,n),h=s.get(u);if(h)lr(t,n,h);else{var c=a?a(l,u,n+"",t,e,s):r,d=c===r;if(d){var p=lh(u),f=!p&&ph(u),m=!p&&!f&&Fh(u);c=u,p||f||m?lh(l)?c=l:ch(l)?c=ra(l):f?(d=!1,c=Xo(u,!0)):m?(d=!1,c=Qo(u,!0)):c=[]:Oh(u)||sh(u)?(c=l,sh(l)?c=Jh(l):Sh(l)&&!bh(l)||(c=ns(u))):d=!1}d&&(s.set(u,c),o(c,u,i,a,s),s["delete"](u)),lr(t,n,c)}}function ho(t,e){var n=t.length;if(n)return e+=e<0?n:0,as(e,n)?t[e]:r}function co(t,e,n){e=e.length?Pn(e,(function(t){return lh(t)?function(e){return Or(e,1===t.length?t[0]:t)}:t})):[Cd];var i=-1;e=Pn(e,Yn(Ga()));var r=oo(t,(function(t,n,r){var o=Pn(e,(function(e){return e(t)}));return{criteria:o,index:++i,value:t}}));return Gn(r,(function(t,e){return ea(t,e,n)}))}function po(t,e){return fo(t,e,(function(e,n){return vc(t,n)}))}function fo(t,e,n){var i=-1,r=e.length,o={};while(++i<r){var a=e[i],s=Or(t,a);n(s,a)&&So(o,Go(a,t),s)}return o}function mo(t){return function(e){return Or(e,t)}}function go(t,e,n,i){var r=i?Un:kn,o=-1,a=e.length,s=t;t===e&&(e=ra(e)),n&&(s=Pn(t,Yn(n)));while(++o<a){var l=0,u=e[o],h=n?n(u):u;while((l=r(s,h,l,i))>-1)s!==t&&Te.call(s,l,1),Te.call(t,l,1)}return t}function _o(t,e){var n=t?e.length:0,i=n-1;while(n--){var r=e[n];if(n==i||r!==o){var o=r;as(r)?Te.call(t,r,1):No(t,r)}}return t}function vo(t,e){return t+Oe(Ze()*(e-t+1))}function yo(t,e,i,r){var o=-1,a=Fe(De((e-t)/(i||1)),0),s=n(a);while(a--)s[r?a:++o]=t,t+=i;return s}function xo(t,e){var n="";if(!t||e<1||e>N)return n;do{e%2&&(n+=t),e=Oe(e/2),e&&(t+=t)}while(e);return n}function bo(t,e){return Es(xs(t,e,Cd),t+"")}function Mo(t){return or(Vc(t))}function wo(t,e){var n=Vc(t);return As(n,gr(e,0,n.length))}function So(t,e,n,i){if(!Sh(t))return t;e=Go(e,t);var o=-1,a=e.length,s=a-1,l=t;while(null!=l&&++o<a){var u=Rs(e[o]),h=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return t;if(o!=s){var c=l[u];h=i?i(c,u,l):r,h===r&&(h=Sh(c)?c:as(e[o+1])?[]:{})}ur(l,u,h),l=l[u]}return t}var To=ln?function(t,e){return ln.set(t,e),t}:Cd,Eo=Ae?function(t,e){return Ae(t,"toString",{configurable:!0,enumerable:!1,value:Ed(e),writable:!0})}:Cd;function Po(t){return As(Vc(t))}function Lo(t,e,i){var r=-1,o=t.length;e<0&&(e=-e>o?0:o+e),i=i>o?o:i,i<0&&(i+=o),o=e>i?0:i-e>>>0,e>>>=0;var a=n(o);while(++r<o)a[r]=t[r+e];return a}function Ao(t,e){var n;return Mr(t,(function(t,i,r){return n=e(t,i,r),!n})),!!n}function Co(t,e,n){var i=0,r=null==t?i:t.length;if("number"==typeof e&&e===e&&r<=V){while(i<r){var o=i+r>>>1,a=t[o];null!==a&&!Bh(a)&&(n?a<=e:a<e)?i=o+1:r=o}return r}return Ro(t,e,Cd,n)}function Ro(t,e,n,i){var o=0,a=null==t?0:t.length;if(0===a)return 0;e=n(e);var s=e!==e,l=null===e,u=Bh(e),h=e===r;while(o<a){var c=Oe((o+a)/2),d=n(t[c]),p=d!==r,f=null===d,m=d===d,g=Bh(d);if(s)var _=i||m;else _=h?m&&(i||p):l?m&&p&&(i||!f):u?m&&p&&!f&&(i||!g):!f&&!g&&(i?d<=e:d<e);_?o=c+1:a=c}return Ve(a,F)}function Io(t,e){var n=-1,i=t.length,r=0,o=[];while(++n<i){var a=t[n],s=e?e(a):a;if(!n||!rh(s,l)){var l=s;o[r++]=0===a?0:a}}return o}function Do(t){return"number"==typeof t?t:Bh(t)?U:+t}function Oo(t){if("string"==typeof t)return t;if(lh(t))return Pn(t,Oo)+"";if(Bh(t))return xi?xi.call(t):"";var e=t+"";return"0"==e&&1/t==-z?"-0":e}function zo(t,e,n){var i=-1,r=Tn,o=t.length,s=!0,l=[],u=l;if(n)s=!1,r=En;else if(o>=a){var h=e?null:Aa(t);if(h)return ci(h);s=!1,r=Jn,u=new Yi}else u=e?[]:l;t:while(++i<o){var c=t[i],d=e?e(c):c;if(c=n||0!==c?c:0,s&&d===d){var p=u.length;while(p--)if(u[p]===d)continue t;e&&u.push(d),l.push(c)}else r(u,d,n)||(u!==l&&u.push(d),l.push(c))}return l}function No(t,e){return e=Go(e,t),t=bs(t,e),null==t||delete t[Rs(ol(e))]}function ko(t,e,n,i){return So(t,e,n(Or(t,e)),i)}function Uo(t,e,n,i){var r=t.length,o=i?r:-1;while((i?o--:++o<r)&&e(t[o],o,t));return n?Lo(t,i?0:o,i?o+1:r):Lo(t,i?o+1:0,i?r:o)}function Bo(t,e){var n=t;return n instanceof Pi&&(n=n.value()),An(e,(function(t,e){return e.func.apply(e.thisArg,Ln([t],e.args))}),n)}function Fo(t,e,i){var r=t.length;if(r<2)return r?zo(t[0]):[];var o=-1,a=n(r);while(++o<r){var s=t[o],l=-1;while(++l<r)l!=o&&(a[o]=br(a[o]||s,t[l],e,i))}return zo(Lr(a,1),e,i)}function Vo(t,e,n){var i=-1,o=t.length,a=e.length,s={};while(++i<o){var l=i<a?e[i]:r;n(s,t[i],l)}return s}function Ho(t){return ch(t)?t:[]}function Wo(t){return"function"==typeof t?t:Cd}function Go(t,e){return lh(t)?t:ls(t,e)?[t]:Cs(Qh(t))}var jo=bo;function Zo(t,e,n){var i=t.length;return n=n===r?i:n,!e&&n>=i?t:Lo(t,e,n)}var qo=Ce||function(t){return sn.clearTimeout(t)};function Xo(t,e){if(e)return t.slice();var n=t.length,i=be?be(n):new t.constructor(n);return t.copy(i),i}function Yo(t){var e=new t.constructor(t.byteLength);return new xe(e).set(new xe(t)),e}function Ko(t,e){var n=e?Yo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}function Jo(t){var e=new t.constructor(t.source,Zt.exec(t));return e.lastIndex=t.lastIndex,e}function $o(t){return yi?ne(yi.call(t)):{}}function Qo(t,e){var n=e?Yo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function ta(t,e){if(t!==e){var n=t!==r,i=null===t,o=t===t,a=Bh(t),s=e!==r,l=null===e,u=e===e,h=Bh(e);if(!l&&!h&&!a&&t>e||a&&s&&u&&!l&&!h||i&&s&&u||!n&&u||!o)return 1;if(!i&&!a&&!h&&t<e||h&&n&&o&&!i&&!a||l&&n&&o||!s&&o||!u)return-1}return 0}function ea(t,e,n){var i=-1,r=t.criteria,o=e.criteria,a=r.length,s=n.length;while(++i<a){var l=ta(r[i],o[i]);if(l){if(i>=s)return l;var u=n[i];return l*("desc"==u?-1:1)}}return t.index-e.index}function na(t,e,i,r){var o=-1,a=t.length,s=i.length,l=-1,u=e.length,h=Fe(a-s,0),c=n(u+h),d=!r;while(++l<u)c[l]=e[l];while(++o<s)(d||o<a)&&(c[i[o]]=t[o]);while(h--)c[l++]=t[o++];return c}function ia(t,e,i,r){var o=-1,a=t.length,s=-1,l=i.length,u=-1,h=e.length,c=Fe(a-l,0),d=n(c+h),p=!r;while(++o<c)d[o]=t[o];var f=o;while(++u<h)d[f+u]=e[u];while(++s<l)(p||o<a)&&(d[f+i[s]]=t[o++]);return d}function ra(t,e){var i=-1,r=t.length;e||(e=n(r));while(++i<r)e[i]=t[i];return e}function oa(t,e,n,i){var o=!n;n||(n={});var a=-1,s=e.length;while(++a<s){var l=e[a],u=i?i(n[l],t[l],l,n,t):r;u===r&&(u=t[l]),o?fr(n,l,u):ur(n,l,u)}return n}function aa(t,e){return oa(t,Ya(t),e)}function sa(t,e){return oa(t,Ka(t),e)}function la(t,e){return function(n,i){var r=lh(n)?xn:cr,o=e?e():{};return r(n,t,Ga(i,2),o)}}function ua(t){return bo((function(e,n){var i=-1,o=n.length,a=o>1?n[o-1]:r,s=o>2?n[2]:r;a=t.length>3&&"function"==typeof a?(o--,a):r,s&&ss(n[0],n[1],s)&&(a=o<3?r:a,o=1),e=ne(e);while(++i<o){var l=n[i];l&&t(e,l,i,a)}return e}))}function ha(t,e){return function(n,i){if(null==n)return n;if(!hh(n))return t(n,i);var r=n.length,o=e?r:-1,a=ne(n);while(e?o--:++o<r)if(!1===i(a[o],o,a))break;return n}}function ca(t){return function(e,n,i){var r=-1,o=ne(e),a=i(e),s=a.length;while(s--){var l=a[t?s:++r];if(!1===n(o[l],l,o))break}return e}}function da(t,e,n){var i=e&v,r=ma(t);function o(){var e=this&&this!==sn&&this instanceof o?r:t;return e.apply(i?n:this,arguments)}return o}function pa(t){return function(e){e=Qh(e);var n=oi(e)?gi(e):r,i=n?n[0]:e.charAt(0),o=n?Zo(n,1).join(""):e.slice(1);return i[t]()+o}}function fa(t){return function(e){return An(bd(Xc(e).replace(He,"")),t,"")}}function ma(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Si(t.prototype),i=t.apply(n,e);return Sh(i)?i:n}}function ga(t,e,i){var o=ma(t);function a(){var s=arguments.length,l=n(s),u=s,h=Wa(a);while(u--)l[u]=arguments[u];var c=s<3&&l[0]!==h&&l[s-1]!==h?[]:hi(l,h);if(s-=c.length,s<i)return Pa(t,e,ya,a.placeholder,r,l,c,r,r,i-s);var d=this&&this!==sn&&this instanceof a?o:t;return yn(d,this,l)}return a}function _a(t){return function(e,n,i){var o=ne(e);if(!hh(e)){var a=Ga(n,3);e=Mc(e),n=function(t){return a(o[t],t,o)}}var s=t(e,n,i);return s>-1?o[a?e[s]:s]:r}}function va(t){return Ua((function(e){var n=e.length,i=n,o=Ei.prototype.thru;t&&e.reverse();while(i--){var a=e[i];if("function"!=typeof a)throw new oe(l);if(o&&!s&&"wrapper"==Ha(a))var s=new Ei([],!0)}i=s?i:n;while(++i<n){a=e[i];var u=Ha(a),h="wrapper"==u?Va(a):r;s=h&&hs(h[0])&&h[1]==(T|b|w|E)&&!h[4].length&&1==h[9]?s[Ha(h[0])].apply(s,h[3]):1==a.length&&hs(a)?s[u]():s.thru(a)}return function(){var t=arguments,i=t[0];if(s&&1==t.length&&lh(i))return s.plant(i).value();var r=0,o=n?e[r].apply(this,t):i;while(++r<n)o=e[r].call(this,o);return o}}))}function ya(t,e,i,o,a,s,l,u,h,c){var d=e&T,p=e&v,f=e&y,m=e&(b|M),g=e&P,_=f?r:ma(t);function x(){var r=arguments.length,v=n(r),y=r;while(y--)v[y]=arguments[y];if(m)var b=Wa(x),M=ti(v,b);if(o&&(v=na(v,o,a,m)),s&&(v=ia(v,s,l,m)),r-=M,m&&r<c){var w=hi(v,b);return Pa(t,e,ya,x.placeholder,i,v,w,u,h,c-r)}var S=p?i:this,T=f?S[t]:t;return r=v.length,u?v=Ms(v,u):g&&r>1&&v.reverse(),d&&h<r&&(v.length=h),this&&this!==sn&&this instanceof x&&(T=_||ma(T)),T.apply(S,v)}return x}function xa(t,e){return function(n,i){return Hr(n,t,e(i),{})}}function ba(t,e){return function(n,i){var o;if(n===r&&i===r)return e;if(n!==r&&(o=n),i!==r){if(o===r)return i;"string"==typeof n||"string"==typeof i?(n=Oo(n),i=Oo(i)):(n=Do(n),i=Do(i)),o=t(n,i)}return o}}function Ma(t){return Ua((function(e){return e=Pn(e,Yn(Ga())),bo((function(n){var i=this;return t(e,(function(t){return yn(t,i,n)}))}))}))}function wa(t,e){e=e===r?" ":Oo(e);var n=e.length;if(n<2)return n?xo(e,t):e;var i=xo(e,De(t/mi(e)));return oi(e)?Zo(gi(i),0,t).join(""):i.slice(0,t)}function Sa(t,e,i,r){var o=e&v,a=ma(t);function s(){var e=-1,l=arguments.length,u=-1,h=r.length,c=n(h+l),d=this&&this!==sn&&this instanceof s?a:t;while(++u<h)c[u]=r[u];while(l--)c[u++]=arguments[++e];return yn(d,o?i:this,c)}return s}function Ta(t){return function(e,n,i){return i&&"number"!=typeof i&&ss(e,n,i)&&(n=i=r),e=qh(e),n===r?(n=e,e=0):n=qh(n),i=i===r?e<n?1:-1:qh(i),yo(e,n,i,t)}}function Ea(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=Kh(e),n=Kh(n)),t(e,n)}}function Pa(t,e,n,i,o,a,s,l,u,h){var c=e&b,d=c?s:r,p=c?r:s,f=c?a:r,m=c?r:a;e|=c?w:S,e&=~(c?S:w),e&x||(e&=~(v|y));var g=[t,e,o,f,d,m,p,l,u,h],_=n.apply(r,g);return hs(t)&&Ss(_,g),_.placeholder=i,Ps(_,t,e)}function La(t){var e=ee[t];return function(t,n){if(t=Kh(t),n=null==n?0:Ve(Xh(n),292),n&&ke(t)){var i=(Qh(t)+"e").split("e"),r=e(i[0]+"e"+(+i[1]+n));return i=(Qh(r)+"e").split("e"),+(i[0]+"e"+(+i[1]-n))}return e(t)}}var Aa=en&&1/ci(new en([,-0]))[1]==z?function(t){return new en(t)}:Ud;function Ca(t){return function(e){var n=Ja(e);return n==$?li(e):n==ot?di(e):qn(e,t(e))}}function Ra(t,e,n,i,o,a,s,u){var h=e&y;if(!h&&"function"!=typeof t)throw new oe(l);var c=i?i.length:0;if(c||(e&=~(w|S),i=o=r),s=s===r?s:Fe(Xh(s),0),u=u===r?u:Xh(u),c-=o?o.length:0,e&S){var d=i,p=o;i=o=r}var f=h?r:Va(t),m=[t,e,n,i,o,d,p,a,s,u];if(f&&_s(m,f),t=m[0],e=m[1],n=m[2],i=m[3],o=m[4],u=m[9]=m[9]===r?h?0:t.length:Fe(m[9]-c,0),!u&&e&(b|M)&&(e&=~(b|M)),e&&e!=v)g=e==b||e==M?ga(t,e,u):e!=w&&e!=(v|w)||o.length?ya.apply(r,m):Sa(t,e,n,i);else var g=da(t,e,n);var _=f?To:Ss;return Ps(_(g,m),t,e)}function Ia(t,e,n,i){return t===r||rh(t,le[n])&&!ce.call(i,n)?e:t}function Da(t,e,n,i,o,a){return Sh(t)&&Sh(e)&&(a.set(e,t),lo(t,e,r,Da,a),a["delete"](e)),t}function Oa(t){return Oh(t)?r:t}function za(t,e,n,i,o,a){var s=n&g,l=t.length,u=e.length;if(l!=u&&!(s&&u>l))return!1;var h=a.get(t),c=a.get(e);if(h&&c)return h==e&&c==t;var d=-1,p=!0,f=n&_?new Yi:r;a.set(t,e),a.set(e,t);while(++d<l){var m=t[d],v=e[d];if(i)var y=s?i(v,m,d,e,t,a):i(m,v,d,t,e,a);if(y!==r){if(y)continue;p=!1;break}if(f){if(!Rn(e,(function(t,e){if(!Jn(f,e)&&(m===t||o(m,t,n,i,a)))return f.push(e)}))){p=!1;break}}else if(m!==v&&!o(m,v,n,i,a)){p=!1;break}}return a["delete"](t),a["delete"](e),p}function Na(t,e,n,i,r,o,a){switch(n){case dt:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case ct:return!(t.byteLength!=e.byteLength||!o(new xe(t),new xe(e)));case Z:case q:case Q:return rh(+t,+e);case Y:return t.name==e.name&&t.message==e.message;case rt:case at:return t==e+"";case $:var s=li;case ot:var l=i&g;if(s||(s=ci),t.size!=e.size&&!l)return!1;var u=a.get(t);if(u)return u==e;i|=_,a.set(t,e);var h=za(s(t),s(e),i,r,o,a);return a["delete"](t),h;case st:if(yi)return yi.call(t)==yi.call(e)}return!1}function ka(t,e,n,i,o,a){var s=n&g,l=Ba(t),u=l.length,h=Ba(e),c=h.length;if(u!=c&&!s)return!1;var d=u;while(d--){var p=l[d];if(!(s?p in e:ce.call(e,p)))return!1}var f=a.get(t),m=a.get(e);if(f&&m)return f==e&&m==t;var _=!0;a.set(t,e),a.set(e,t);var v=s;while(++d<u){p=l[d];var y=t[p],x=e[p];if(i)var b=s?i(x,y,p,e,t,a):i(y,x,p,t,e,a);if(!(b===r?y===x||o(y,x,n,i,a):b)){_=!1;break}v||(v="constructor"==p)}if(_&&!v){var M=t.constructor,w=e.constructor;M==w||!("constructor"in t)||!("constructor"in e)||"function"==typeof M&&M instanceof M&&"function"==typeof w&&w instanceof w||(_=!1)}return a["delete"](t),a["delete"](e),_}function Ua(t){return Es(xs(t,r,Xs),t+"")}function Ba(t){return zr(t,Mc,Ya)}function Fa(t){return zr(t,wc,Ka)}var Va=ln?function(t){return ln.get(t)}:Ud;function Ha(t){var e=t.name+"",n=un[e],i=ce.call(un,e)?n.length:0;while(i--){var r=n[i],o=r.func;if(null==o||o==t)return r.name}return e}function Wa(t){var e=ce.call(Mi,"placeholder")?Mi:t;return e.placeholder}function Ga(){var t=Mi.iteratee||Rd;return t=t===Rd?eo:t,arguments.length?t(arguments[0],arguments[1]):t}function ja(t,e){var n=t.__data__;return us(e)?n["string"==typeof e?"string":"hash"]:n.map}function Za(t){var e=Mc(t),n=e.length;while(n--){var i=e[n],r=t[i];e[n]=[i,r,fs(r)]}return e}function qa(t,e){var n=ri(t,e);return Jr(n)?n:r}function Xa(t){var e=ce.call(t,Le),n=t[Le];try{t[Le]=r;var i=!0}catch(a){}var o=fe.call(t);return i&&(e?t[Le]=n:delete t[Le]),o}var Ya=ze?function(t){return null==t?[]:(t=ne(t),Sn(ze(t),(function(e){return Se.call(t,e)})))}:qd,Ka=ze?function(t){var e=[];while(t)Ln(e,Ya(t)),t=Me(t);return e}:qd,Ja=Nr;function $a(t,e,n){var i=-1,r=n.length;while(++i<r){var o=n[i],a=o.size;switch(o.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=Ve(e,t+a);break;case"takeRight":t=Fe(t,e-a);break}}return{start:t,end:e}}function Qa(t){var e=t.match(Ft);return e?e[1].split(Vt):[]}function ts(t,e,n){e=Go(e,t);var i=-1,r=e.length,o=!1;while(++i<r){var a=Rs(e[i]);if(!(o=null!=t&&n(t,a)))break;t=t[a]}return o||++i!=r?o:(r=null==t?0:t.length,!!r&&wh(r)&&as(a,r)&&(lh(t)||sh(t)))}function es(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&ce.call(t,"index")&&(n.index=t.index,n.input=t.input),n}function ns(t){return"function"!=typeof t.constructor||ps(t)?{}:Si(Me(t))}function is(t,e,n){var i=t.constructor;switch(e){case ct:return Yo(t);case Z:case q:return new i(+t);case dt:return Ko(t,n);case pt:case ft:case mt:case gt:case _t:case vt:case yt:case xt:case bt:return Qo(t,n);case $:return new i;case Q:case at:return new i(t);case rt:return Jo(t);case ot:return new i;case st:return $o(t)}}function rs(t,e){var n=e.length;if(!n)return t;var i=n-1;return e[i]=(n>1?"& ":"")+e[i],e=e.join(n>2?", ":" "),t.replace(Bt,"{\n/* [wrapped with "+e+"] */\n")}function os(t){return lh(t)||sh(t)||!!(Ee&&t&&t[Ee])}function as(t,e){var n=typeof t;return e=null==e?N:e,!!e&&("number"==n||"symbol"!=n&&Jt.test(t))&&t>-1&&t%1==0&&t<e}function ss(t,e,n){if(!Sh(n))return!1;var i=typeof e;return!!("number"==i?hh(n)&&as(e,n.length):"string"==i&&e in n)&&rh(n[e],t)}function ls(t,e){if(lh(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Bh(t))||(Dt.test(t)||!It.test(t)||null!=e&&t in ne(e))}function us(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}function hs(t){var e=Ha(t),n=Mi[e];if("function"!=typeof n||!(e in Pi.prototype))return!1;if(t===n)return!0;var i=Va(n);return!!i&&t===i[0]}function cs(t){return!!pe&&pe in t}($e&&Ja(new $e(new ArrayBuffer(1)))!=dt||Qe&&Ja(new Qe)!=$||tn&&Ja(tn.resolve())!=nt||en&&Ja(new en)!=ot||on&&Ja(new on)!=ut)&&(Ja=function(t){var e=Nr(t),n=e==et?t.constructor:r,i=n?Is(n):"";if(i)switch(i){case cn:return dt;case dn:return $;case In:return nt;case Dn:return ot;case Hn:return ut}return e});var ds=ue?bh:Xd;function ps(t){var e=t&&t.constructor,n="function"==typeof e&&e.prototype||le;return t===n}function fs(t){return t===t&&!Sh(t)}function ms(t,e){return function(n){return null!=n&&(n[t]===e&&(e!==r||t in ne(n)))}}function gs(t){var e=Fu(t,(function(t){return n.size===c&&n.clear(),t})),n=e.cache;return e}function _s(t,e){var n=t[1],i=e[1],r=n|i,o=r<(v|y|T),a=i==T&&n==b||i==T&&n==E&&t[7].length<=e[8]||i==(T|E)&&e[7].length<=e[8]&&n==b;if(!o&&!a)return t;i&v&&(t[2]=e[2],r|=n&v?0:x);var s=e[3];if(s){var l=t[3];t[3]=l?na(l,s,e[4]):s,t[4]=l?hi(t[3],d):e[4]}return s=e[5],s&&(l=t[5],t[5]=l?ia(l,s,e[6]):s,t[6]=l?hi(t[5],d):e[6]),s=e[7],s&&(t[7]=s),i&T&&(t[8]=null==t[8]?e[8]:Ve(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=r,t}function vs(t){var e=[];if(null!=t)for(var n in ne(t))e.push(n);return e}function ys(t){return fe.call(t)}function xs(t,e,i){return e=Fe(e===r?t.length-1:e,0),function(){var r=arguments,o=-1,a=Fe(r.length-e,0),s=n(a);while(++o<a)s[o]=r[e+o];o=-1;var l=n(e+1);while(++o<e)l[o]=r[o];return l[e]=i(s),yn(t,this,l)}}function bs(t,e){return e.length<2?t:Or(t,Lo(e,0,-1))}function Ms(t,e){var n=t.length,i=Ve(e.length,n),o=ra(t);while(i--){var a=e[i];t[i]=as(a,n)?o[a]:r}return t}function ws(t,e){if(("constructor"!==e||"function"!==typeof t[e])&&"__proto__"!=e)return t[e]}var Ss=Ls(To),Ts=Ie||function(t,e){return sn.setTimeout(t,e)},Es=Ls(Eo);function Ps(t,e,n){var i=e+"";return Es(t,rs(i,Ds(Qa(i),n)))}function Ls(t){var e=0,n=0;return function(){var i=Ge(),o=R-(i-n);if(n=i,o>0){if(++e>=C)return arguments[0]}else e=0;return t.apply(r,arguments)}}function As(t,e){var n=-1,i=t.length,o=i-1;e=e===r?i:e;while(++n<e){var a=vo(n,o),s=t[a];t[a]=t[n],t[n]=s}return t.length=e,t}var Cs=gs((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Ot,(function(t,n,i,r){e.push(i?r.replace(Gt,"$1"):n||t)})),e}));function Rs(t){if("string"==typeof t||Bh(t))return t;var e=t+"";return"0"==e&&1/t==-z?"-0":e}function Is(t){if(null!=t){try{return he.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function Ds(t,e){return bn(H,(function(n){var i="_."+n[0];e&n[1]&&!Tn(t,i)&&t.push(i)})),t.sort()}function Os(t){if(t instanceof Pi)return t.clone();var e=new Ei(t.__wrapped__,t.__chain__);return e.__actions__=ra(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}function zs(t,e,i){e=(i?ss(t,e,i):e===r)?1:Fe(Xh(e),0);var o=null==t?0:t.length;if(!o||e<1)return[];var a=0,s=0,l=n(De(o/e));while(a<o)l[s++]=Lo(t,a,a+=e);return l}function Ns(t){var e=-1,n=null==t?0:t.length,i=0,r=[];while(++e<n){var o=t[e];o&&(r[i++]=o)}return r}function ks(){var t=arguments.length;if(!t)return[];var e=n(t-1),i=arguments[0],r=t;while(r--)e[r-1]=arguments[r];return Ln(lh(i)?ra(i):[i],Lr(e,1))}var Us=bo((function(t,e){return ch(t)?br(t,Lr(e,1,ch,!0)):[]})),Bs=bo((function(t,e){var n=ol(e);return ch(n)&&(n=r),ch(t)?br(t,Lr(e,1,ch,!0),Ga(n,2)):[]})),Fs=bo((function(t,e){var n=ol(e);return ch(n)&&(n=r),ch(t)?br(t,Lr(e,1,ch,!0),r,n):[]}));function Vs(t,e,n){var i=null==t?0:t.length;return i?(e=n||e===r?1:Xh(e),Lo(t,e<0?0:e,i)):[]}function Hs(t,e,n){var i=null==t?0:t.length;return i?(e=n||e===r?1:Xh(e),e=i-e,Lo(t,0,e<0?0:e)):[]}function Ws(t,e){return t&&t.length?Uo(t,Ga(e,3),!0,!0):[]}function Gs(t,e){return t&&t.length?Uo(t,Ga(e,3),!0):[]}function js(t,e,n,i){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&ss(t,e,n)&&(n=0,i=r),Er(t,e,n,i)):[]}function Zs(t,e,n){var i=null==t?0:t.length;if(!i)return-1;var r=null==n?0:Xh(n);return r<0&&(r=Fe(i+r,0)),Nn(t,Ga(e,3),r)}function qs(t,e,n){var i=null==t?0:t.length;if(!i)return-1;var o=i-1;return n!==r&&(o=Xh(n),o=n<0?Fe(i+o,0):Ve(o,i-1)),Nn(t,Ga(e,3),o,!0)}function Xs(t){var e=null==t?0:t.length;return e?Lr(t,1):[]}function Ys(t){var e=null==t?0:t.length;return e?Lr(t,z):[]}function Ks(t,e){var n=null==t?0:t.length;return n?(e=e===r?1:Xh(e),Lr(t,e)):[]}function Js(t){var e=-1,n=null==t?0:t.length,i={};while(++e<n){var r=t[e];i[r[0]]=r[1]}return i}function $s(t){return t&&t.length?t[0]:r}function Qs(t,e,n){var i=null==t?0:t.length;if(!i)return-1;var r=null==n?0:Xh(n);return r<0&&(r=Fe(i+r,0)),kn(t,e,r)}function tl(t){var e=null==t?0:t.length;return e?Lo(t,0,-1):[]}var el=bo((function(t){var e=Pn(t,Ho);return e.length&&e[0]===t[0]?Vr(e):[]})),nl=bo((function(t){var e=ol(t),n=Pn(t,Ho);return e===ol(n)?e=r:n.pop(),n.length&&n[0]===t[0]?Vr(n,Ga(e,2)):[]})),il=bo((function(t){var e=ol(t),n=Pn(t,Ho);return e="function"==typeof e?e:r,e&&n.pop(),n.length&&n[0]===t[0]?Vr(n,r,e):[]}));function rl(t,e){return null==t?"":Ue.call(t,e)}function ol(t){var e=null==t?0:t.length;return e?t[e-1]:r}function al(t,e,n){var i=null==t?0:t.length;if(!i)return-1;var o=i;return n!==r&&(o=Xh(n),o=o<0?Fe(i+o,0):Ve(o,i-1)),e===e?fi(t,e,o):Nn(t,Bn,o,!0)}function sl(t,e){return t&&t.length?ho(t,Xh(e)):r}var ll=bo(ul);function ul(t,e){return t&&t.length&&e&&e.length?go(t,e):t}function hl(t,e,n){return t&&t.length&&e&&e.length?go(t,e,Ga(n,2)):t}function cl(t,e,n){return t&&t.length&&e&&e.length?go(t,e,r,n):t}var dl=Ua((function(t,e){var n=null==t?0:t.length,i=mr(t,e);return _o(t,Pn(e,(function(t){return as(t,n)?+t:t})).sort(ta)),i}));function pl(t,e){var n=[];if(!t||!t.length)return n;var i=-1,r=[],o=t.length;e=Ga(e,3);while(++i<o){var a=t[i];e(a,i,t)&&(n.push(a),r.push(i))}return _o(t,r),n}function fl(t){return null==t?t:qe.call(t)}function ml(t,e,n){var i=null==t?0:t.length;return i?(n&&"number"!=typeof n&&ss(t,e,n)?(e=0,n=i):(e=null==e?0:Xh(e),n=n===r?i:Xh(n)),Lo(t,e,n)):[]}function gl(t,e){return Co(t,e)}function _l(t,e,n){return Ro(t,e,Ga(n,2))}function vl(t,e){var n=null==t?0:t.length;if(n){var i=Co(t,e);if(i<n&&rh(t[i],e))return i}return-1}function yl(t,e){return Co(t,e,!0)}function xl(t,e,n){return Ro(t,e,Ga(n,2),!0)}function bl(t,e){var n=null==t?0:t.length;if(n){var i=Co(t,e,!0)-1;if(rh(t[i],e))return i}return-1}function Ml(t){return t&&t.length?Io(t):[]}function wl(t,e){return t&&t.length?Io(t,Ga(e,2)):[]}function Sl(t){var e=null==t?0:t.length;return e?Lo(t,1,e):[]}function Tl(t,e,n){return t&&t.length?(e=n||e===r?1:Xh(e),Lo(t,0,e<0?0:e)):[]}function El(t,e,n){var i=null==t?0:t.length;return i?(e=n||e===r?1:Xh(e),e=i-e,Lo(t,e<0?0:e,i)):[]}function Pl(t,e){return t&&t.length?Uo(t,Ga(e,3),!1,!0):[]}function Ll(t,e){return t&&t.length?Uo(t,Ga(e,3)):[]}var Al=bo((function(t){return zo(Lr(t,1,ch,!0))})),Cl=bo((function(t){var e=ol(t);return ch(e)&&(e=r),zo(Lr(t,1,ch,!0),Ga(e,2))})),Rl=bo((function(t){var e=ol(t);return e="function"==typeof e?e:r,zo(Lr(t,1,ch,!0),r,e)}));function Il(t){return t&&t.length?zo(t):[]}function Dl(t,e){return t&&t.length?zo(t,Ga(e,2)):[]}function Ol(t,e){return e="function"==typeof e?e:r,t&&t.length?zo(t,r,e):[]}function zl(t){if(!t||!t.length)return[];var e=0;return t=Sn(t,(function(t){if(ch(t))return e=Fe(t.length,e),!0})),Zn(e,(function(e){return Pn(t,Vn(e))}))}function Nl(t,e){if(!t||!t.length)return[];var n=zl(t);return null==e?n:Pn(n,(function(t){return yn(e,r,t)}))}var kl=bo((function(t,e){return ch(t)?br(t,e):[]})),Ul=bo((function(t){return Fo(Sn(t,ch))})),Bl=bo((function(t){var e=ol(t);return ch(e)&&(e=r),Fo(Sn(t,ch),Ga(e,2))})),Fl=bo((function(t){var e=ol(t);return e="function"==typeof e?e:r,Fo(Sn(t,ch),r,e)})),Vl=bo(zl);function Hl(t,e){return Vo(t||[],e||[],ur)}function Wl(t,e){return Vo(t||[],e||[],So)}var Gl=bo((function(t){var e=t.length,n=e>1?t[e-1]:r;return n="function"==typeof n?(t.pop(),n):r,Nl(t,n)}));function jl(t){var e=Mi(t);return e.__chain__=!0,e}function Zl(t,e){return e(t),t}function ql(t,e){return e(t)}var Xl=Ua((function(t){var e=t.length,n=e?t[0]:0,i=this.__wrapped__,o=function(e){return mr(e,t)};return!(e>1||this.__actions__.length)&&i instanceof Pi&&as(n)?(i=i.slice(n,+n+(e?1:0)),i.__actions__.push({func:ql,args:[o],thisArg:r}),new Ei(i,this.__chain__).thru((function(t){return e&&!t.length&&t.push(r),t}))):this.thru(o)}));function Yl(){return jl(this)}function Kl(){return new Ei(this.value(),this.__chain__)}function Jl(){this.__values__===r&&(this.__values__=Zh(this.value()));var t=this.__index__>=this.__values__.length,e=t?r:this.__values__[this.__index__++];return{done:t,value:e}}function $l(){return this}function Ql(t){var e,n=this;while(n instanceof Ti){var i=Os(n);i.__index__=0,i.__values__=r,e?o.__wrapped__=i:e=i;var o=i;n=n.__wrapped__}return o.__wrapped__=t,e}function tu(){var t=this.__wrapped__;if(t instanceof Pi){var e=t;return this.__actions__.length&&(e=new Pi(this)),e=e.reverse(),e.__actions__.push({func:ql,args:[fl],thisArg:r}),new Ei(e,this.__chain__)}return this.thru(fl)}function eu(){return Bo(this.__wrapped__,this.__actions__)}var nu=la((function(t,e,n){ce.call(t,n)?++t[n]:fr(t,n,1)}));function iu(t,e,n){var i=lh(t)?wn:Sr;return n&&ss(t,e,n)&&(e=r),i(t,Ga(e,3))}function ru(t,e){var n=lh(t)?Sn:Pr;return n(t,Ga(e,3))}var ou=_a(Zs),au=_a(qs);function su(t,e){return Lr(gu(t,e),1)}function lu(t,e){return Lr(gu(t,e),z)}function uu(t,e,n){return n=n===r?1:Xh(n),Lr(gu(t,e),n)}function hu(t,e){var n=lh(t)?bn:Mr;return n(t,Ga(e,3))}function cu(t,e){var n=lh(t)?Mn:wr;return n(t,Ga(e,3))}var du=la((function(t,e,n){ce.call(t,n)?t[n].push(e):fr(t,n,[e])}));function pu(t,e,n,i){t=hh(t)?t:Vc(t),n=n&&!i?Xh(n):0;var r=t.length;return n<0&&(n=Fe(r+n,0)),Uh(t)?n<=r&&t.indexOf(e,n)>-1:!!r&&kn(t,e,n)>-1}var fu=bo((function(t,e,i){var r=-1,o="function"==typeof e,a=hh(t)?n(t.length):[];return Mr(t,(function(t){a[++r]=o?yn(e,t,i):Wr(t,e,i)})),a})),mu=la((function(t,e,n){fr(t,n,e)}));function gu(t,e){var n=lh(t)?Pn:oo;return n(t,Ga(e,3))}function _u(t,e,n,i){return null==t?[]:(lh(e)||(e=null==e?[]:[e]),n=i?r:n,lh(n)||(n=null==n?[]:[n]),co(t,e,n))}var vu=la((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));function yu(t,e,n){var i=lh(t)?An:Wn,r=arguments.length<3;return i(t,Ga(e,4),n,r,Mr)}function xu(t,e,n){var i=lh(t)?Cn:Wn,r=arguments.length<3;return i(t,Ga(e,4),n,r,wr)}function bu(t,e){var n=lh(t)?Sn:Pr;return n(t,Vu(Ga(e,3)))}function Mu(t){var e=lh(t)?or:Mo;return e(t)}function wu(t,e,n){e=(n?ss(t,e,n):e===r)?1:Xh(e);var i=lh(t)?ar:wo;return i(t,e)}function Su(t){var e=lh(t)?sr:Po;return e(t)}function Tu(t){if(null==t)return 0;if(hh(t))return Uh(t)?mi(t):t.length;var e=Ja(t);return e==$||e==ot?t.size:no(t).length}function Eu(t,e,n){var i=lh(t)?Rn:Ao;return n&&ss(t,e,n)&&(e=r),i(t,Ga(e,3))}var Pu=bo((function(t,e){if(null==t)return[];var n=e.length;return n>1&&ss(t,e[0],e[1])?e=[]:n>2&&ss(e[0],e[1],e[2])&&(e=[e[0]]),co(t,Lr(e,1),[])})),Lu=Re||function(){return sn.Date.now()};function Au(t,e){if("function"!=typeof e)throw new oe(l);return t=Xh(t),function(){if(--t<1)return e.apply(this,arguments)}}function Cu(t,e,n){return e=n?r:e,e=t&&null==e?t.length:e,Ra(t,T,r,r,r,r,e)}function Ru(t,e){var n;if("function"!=typeof e)throw new oe(l);return t=Xh(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=r),n}}var Iu=bo((function(t,e,n){var i=v;if(n.length){var r=hi(n,Wa(Iu));i|=w}return Ra(t,i,e,n,r)})),Du=bo((function(t,e,n){var i=v|y;if(n.length){var r=hi(n,Wa(Du));i|=w}return Ra(e,i,t,n,r)}));function Ou(t,e,n){e=n?r:e;var i=Ra(t,b,r,r,r,r,r,e);return i.placeholder=Ou.placeholder,i}function zu(t,e,n){e=n?r:e;var i=Ra(t,M,r,r,r,r,r,e);return i.placeholder=zu.placeholder,i}function Nu(t,e,n){var i,o,a,s,u,h,c=0,d=!1,p=!1,f=!0;if("function"!=typeof t)throw new oe(l);function m(e){var n=i,a=o;return i=o=r,c=e,s=t.apply(a,n),s}function g(t){return c=t,u=Ts(y,e),d?m(t):s}function _(t){var n=t-h,i=t-c,r=e-n;return p?Ve(r,a-i):r}function v(t){var n=t-h,i=t-c;return h===r||n>=e||n<0||p&&i>=a}function y(){var t=Lu();if(v(t))return x(t);u=Ts(y,_(t))}function x(t){return u=r,f&&i?m(t):(i=o=r,s)}function b(){u!==r&&qo(u),c=0,i=h=o=u=r}function M(){return u===r?s:x(Lu())}function w(){var t=Lu(),n=v(t);if(i=arguments,o=this,h=t,n){if(u===r)return g(h);if(p)return qo(u),u=Ts(y,e),m(h)}return u===r&&(u=Ts(y,e)),s}return e=Kh(e)||0,Sh(n)&&(d=!!n.leading,p="maxWait"in n,a=p?Fe(Kh(n.maxWait)||0,e):a,f="trailing"in n?!!n.trailing:f),w.cancel=b,w.flush=M,w}var ku=bo((function(t,e){return xr(t,1,e)})),Uu=bo((function(t,e,n){return xr(t,Kh(e)||0,n)}));function Bu(t){return Ra(t,P)}function Fu(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new oe(l);var n=function(){var i=arguments,r=e?e.apply(this,i):i[0],o=n.cache;if(o.has(r))return o.get(r);var a=t.apply(this,i);return n.cache=o.set(r,a)||o,a};return n.cache=new(Fu.Cache||Wi),n}function Vu(t){if("function"!=typeof t)throw new oe(l);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function Hu(t){return Ru(2,t)}Fu.Cache=Wi;var Wu=jo((function(t,e){e=1==e.length&&lh(e[0])?Pn(e[0],Yn(Ga())):Pn(Lr(e,1),Yn(Ga()));var n=e.length;return bo((function(i){var r=-1,o=Ve(i.length,n);while(++r<o)i[r]=e[r].call(this,i[r]);return yn(t,this,i)}))})),Gu=bo((function(t,e){var n=hi(e,Wa(Gu));return Ra(t,w,r,e,n)})),ju=bo((function(t,e){var n=hi(e,Wa(ju));return Ra(t,S,r,e,n)})),Zu=Ua((function(t,e){return Ra(t,E,r,r,r,e)}));function qu(t,e){if("function"!=typeof t)throw new oe(l);return e=e===r?e:Xh(e),bo(t,e)}function Xu(t,e){if("function"!=typeof t)throw new oe(l);return e=null==e?0:Fe(Xh(e),0),bo((function(n){var i=n[e],r=Zo(n,0,e);return i&&Ln(r,i),yn(t,this,r)}))}function Yu(t,e,n){var i=!0,r=!0;if("function"!=typeof t)throw new oe(l);return Sh(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),Nu(t,e,{leading:i,maxWait:e,trailing:r})}function Ku(t){return Cu(t,1)}function Ju(t,e){return Gu(Wo(e),t)}function $u(){if(!arguments.length)return[];var t=arguments[0];return lh(t)?t:[t]}function Qu(t){return _r(t,m)}function th(t,e){return e="function"==typeof e?e:r,_r(t,m,e)}function eh(t){return _r(t,p|m)}function nh(t,e){return e="function"==typeof e?e:r,_r(t,p|m,e)}function ih(t,e){return null==e||yr(t,e,Mc(e))}function rh(t,e){return t===e||t!==t&&e!==e}var oh=Ea(kr),ah=Ea((function(t,e){return t>=e})),sh=Gr(function(){return arguments}())?Gr:function(t){return Th(t)&&ce.call(t,"callee")&&!Se.call(t,"callee")},lh=n.isArray,uh=pn?Yn(pn):jr;function hh(t){return null!=t&&wh(t.length)&&!bh(t)}function ch(t){return Th(t)&&hh(t)}function dh(t){return!0===t||!1===t||Th(t)&&Nr(t)==Z}var ph=Ne||Xd,fh=fn?Yn(fn):Zr;function mh(t){return Th(t)&&1===t.nodeType&&!Oh(t)}function gh(t){if(null==t)return!0;if(hh(t)&&(lh(t)||"string"==typeof t||"function"==typeof t.splice||ph(t)||Fh(t)||sh(t)))return!t.length;var e=Ja(t);if(e==$||e==ot)return!t.size;if(ps(t))return!no(t).length;for(var n in t)if(ce.call(t,n))return!1;return!0}function _h(t,e){return qr(t,e)}function vh(t,e,n){n="function"==typeof n?n:r;var i=n?n(t,e):r;return i===r?qr(t,e,r,n):!!i}function yh(t){if(!Th(t))return!1;var e=Nr(t);return e==Y||e==X||"string"==typeof t.message&&"string"==typeof t.name&&!Oh(t)}function xh(t){return"number"==typeof t&&ke(t)}function bh(t){if(!Sh(t))return!1;var e=Nr(t);return e==K||e==J||e==j||e==it}function Mh(t){return"number"==typeof t&&t==Xh(t)}function wh(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=N}function Sh(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Th(t){return null!=t&&"object"==typeof t}var Eh=mn?Yn(mn):Yr;function Ph(t,e){return t===e||Kr(t,e,Za(e))}function Lh(t,e,n){return n="function"==typeof n?n:r,Kr(t,e,Za(e),n)}function Ah(t){return Dh(t)&&t!=+t}function Ch(t){if(ds(t))throw new Ut(s);return Jr(t)}function Rh(t){return null===t}function Ih(t){return null==t}function Dh(t){return"number"==typeof t||Th(t)&&Nr(t)==Q}function Oh(t){if(!Th(t)||Nr(t)!=et)return!1;var e=Me(t);if(null===e)return!0;var n=ce.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&he.call(n)==me}var zh=gn?Yn(gn):$r;function Nh(t){return Mh(t)&&t>=-N&&t<=N}var kh=_n?Yn(_n):Qr;function Uh(t){return"string"==typeof t||!lh(t)&&Th(t)&&Nr(t)==at}function Bh(t){return"symbol"==typeof t||Th(t)&&Nr(t)==st}var Fh=vn?Yn(vn):to;function Vh(t){return t===r}function Hh(t){return Th(t)&&Ja(t)==ut}function Wh(t){return Th(t)&&Nr(t)==ht}var Gh=Ea(ro),jh=Ea((function(t,e){return t<=e}));function Zh(t){if(!t)return[];if(hh(t))return Uh(t)?gi(t):ra(t);if(Pe&&t[Pe])return si(t[Pe]());var e=Ja(t),n=e==$?li:e==ot?ci:Vc;return n(t)}function qh(t){if(!t)return 0===t?t:0;if(t=Kh(t),t===z||t===-z){var e=t<0?-1:1;return e*k}return t===t?t:0}function Xh(t){var e=qh(t),n=e%1;return e===e?n?e-n:e:0}function Yh(t){return t?gr(Xh(t),0,B):0}function Kh(t){if("number"==typeof t)return t;if(Bh(t))return U;if(Sh(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Sh(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Xn(t);var n=Xt.test(t);return n||Kt.test(t)?rn(t.slice(2),n?2:8):qt.test(t)?U:+t}function Jh(t){return oa(t,wc(t))}function $h(t){return t?gr(Xh(t),-N,N):0===t?t:0}function Qh(t){return null==t?"":Oo(t)}var tc=ua((function(t,e){if(ps(e)||hh(e))oa(e,Mc(e),t);else for(var n in e)ce.call(e,n)&&ur(t,n,e[n])})),ec=ua((function(t,e){oa(e,wc(e),t)})),nc=ua((function(t,e,n,i){oa(e,wc(e),t,i)})),ic=ua((function(t,e,n,i){oa(e,Mc(e),t,i)})),rc=Ua(mr);function oc(t,e){var n=Si(t);return null==e?n:dr(n,e)}var ac=bo((function(t,e){t=ne(t);var n=-1,i=e.length,o=i>2?e[2]:r;o&&ss(e[0],e[1],o)&&(i=1);while(++n<i){var a=e[n],s=wc(a),l=-1,u=s.length;while(++l<u){var h=s[l],c=t[h];(c===r||rh(c,le[h])&&!ce.call(t,h))&&(t[h]=a[h])}}return t})),sc=bo((function(t){return t.push(r,Da),yn(Pc,r,t)}));function lc(t,e){return zn(t,Ga(e,3),Rr)}function uc(t,e){return zn(t,Ga(e,3),Ir)}function hc(t,e){return null==t?t:Ar(t,Ga(e,3),wc)}function cc(t,e){return null==t?t:Cr(t,Ga(e,3),wc)}function dc(t,e){return t&&Rr(t,Ga(e,3))}function pc(t,e){return t&&Ir(t,Ga(e,3))}function fc(t){return null==t?[]:Dr(t,Mc(t))}function mc(t){return null==t?[]:Dr(t,wc(t))}function gc(t,e,n){var i=null==t?r:Or(t,e);return i===r?n:i}function _c(t,e){return null!=t&&ts(t,e,Ur)}function vc(t,e){return null!=t&&ts(t,e,Br)}var yc=xa((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=fe.call(e)),t[e]=n}),Ed(Cd)),xc=xa((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=fe.call(e)),ce.call(t,e)?t[e].push(n):t[e]=[n]}),Ga),bc=bo(Wr);function Mc(t){return hh(t)?rr(t):no(t)}function wc(t){return hh(t)?rr(t,!0):io(t)}function Sc(t,e){var n={};return e=Ga(e,3),Rr(t,(function(t,i,r){fr(n,e(t,i,r),t)})),n}function Tc(t,e){var n={};return e=Ga(e,3),Rr(t,(function(t,i,r){fr(n,i,e(t,i,r))})),n}var Ec=ua((function(t,e,n){lo(t,e,n)})),Pc=ua((function(t,e,n,i){lo(t,e,n,i)})),Lc=Ua((function(t,e){var n={};if(null==t)return n;var i=!1;e=Pn(e,(function(e){return e=Go(e,t),i||(i=e.length>1),e})),oa(t,Fa(t),n),i&&(n=_r(n,p|f|m,Oa));var r=e.length;while(r--)No(n,e[r]);return n}));function Ac(t,e){return Rc(t,Vu(Ga(e)))}var Cc=Ua((function(t,e){return null==t?{}:po(t,e)}));function Rc(t,e){if(null==t)return{};var n=Pn(Fa(t),(function(t){return[t]}));return e=Ga(e),fo(t,n,(function(t,n){return e(t,n[0])}))}function Ic(t,e,n){e=Go(e,t);var i=-1,o=e.length;o||(o=1,t=r);while(++i<o){var a=null==t?r:t[Rs(e[i])];a===r&&(i=o,a=n),t=bh(a)?a.call(t):a}return t}function Dc(t,e,n){return null==t?t:So(t,e,n)}function Oc(t,e,n,i){return i="function"==typeof i?i:r,null==t?t:So(t,e,n,i)}var zc=Ca(Mc),Nc=Ca(wc);function kc(t,e,n){var i=lh(t),r=i||ph(t)||Fh(t);if(e=Ga(e,4),null==n){var o=t&&t.constructor;n=r?i?new o:[]:Sh(t)&&bh(o)?Si(Me(t)):{}}return(r?bn:Rr)(t,(function(t,i,r){return e(n,t,i,r)})),n}function Uc(t,e){return null==t||No(t,e)}function Bc(t,e,n){return null==t?t:ko(t,e,Wo(n))}function Fc(t,e,n,i){return i="function"==typeof i?i:r,null==t?t:ko(t,e,Wo(n),i)}function Vc(t){return null==t?[]:Kn(t,Mc(t))}function Hc(t){return null==t?[]:Kn(t,wc(t))}function Wc(t,e,n){return n===r&&(n=e,e=r),n!==r&&(n=Kh(n),n=n===n?n:0),e!==r&&(e=Kh(e),e=e===e?e:0),gr(Kh(t),e,n)}function Gc(t,e,n){return e=qh(e),n===r?(n=e,e=0):n=qh(n),t=Kh(t),Fr(t,e,n)}function jc(t,e,n){if(n&&"boolean"!=typeof n&&ss(t,e,n)&&(e=n=r),n===r&&("boolean"==typeof e?(n=e,e=r):"boolean"==typeof t&&(n=t,t=r)),t===r&&e===r?(t=0,e=1):(t=qh(t),e===r?(e=t,t=0):e=qh(e)),t>e){var i=t;t=e,e=i}if(n||t%1||e%1){var o=Ze();return Ve(t+o*(e-t+nn("1e-"+((o+"").length-1))),e)}return vo(t,e)}var Zc=fa((function(t,e,n){return e=e.toLowerCase(),t+(n?qc(e):e)}));function qc(t){return xd(Qh(t).toLowerCase())}function Xc(t){return t=Qh(t),t&&t.replace($t,ei).replace(We,"")}function Yc(t,e,n){t=Qh(t),e=Oo(e);var i=t.length;n=n===r?i:gr(Xh(n),0,i);var o=n;return n-=e.length,n>=0&&t.slice(n,o)==e}function Kc(t){return t=Qh(t),t&&Lt.test(t)?t.replace(Et,ni):t}function Jc(t){return t=Qh(t),t&&Nt.test(t)?t.replace(zt,"\\$&"):t}var $c=fa((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Qc=fa((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),td=pa("toLowerCase");function ed(t,e,n){t=Qh(t),e=Xh(e);var i=e?mi(t):0;if(!e||i>=e)return t;var r=(e-i)/2;return wa(Oe(r),n)+t+wa(De(r),n)}function nd(t,e,n){t=Qh(t),e=Xh(e);var i=e?mi(t):0;return e&&i<e?t+wa(e-i,n):t}function id(t,e,n){t=Qh(t),e=Xh(e);var i=e?mi(t):0;return e&&i<e?wa(e-i,n)+t:t}function rd(t,e,n){return n||null==e?e=0:e&&(e=+e),je(Qh(t).replace(kt,""),e||0)}function od(t,e,n){return e=(n?ss(t,e,n):e===r)?1:Xh(e),xo(Qh(t),e)}function ad(){var t=arguments,e=Qh(t[0]);return t.length<3?e:e.replace(t[1],t[2])}var sd=fa((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));function ld(t,e,n){return n&&"number"!=typeof n&&ss(t,e,n)&&(e=n=r),n=n===r?B:n>>>0,n?(t=Qh(t),t&&("string"==typeof e||null!=e&&!zh(e))&&(e=Oo(e),!e&&oi(t))?Zo(gi(t),0,n):t.split(e,n)):[]}var ud=fa((function(t,e,n){return t+(n?" ":"")+xd(e)}));function hd(t,e,n){return t=Qh(t),n=null==n?0:gr(Xh(n),0,t.length),e=Oo(e),t.slice(n,n+e.length)==e}function cd(t,e,n){var i=Mi.templateSettings;n&&ss(t,e,n)&&(e=r),t=Qh(t),e=nc({},e,i,Ia);var o,a,s=nc({},e.imports,i.imports,Ia),l=Mc(s),h=Kn(s,l),c=0,d=e.interpolate||Qt,p="__p += '",f=ie((e.escape||Qt).source+"|"+d.source+"|"+(d===Rt?jt:Qt).source+"|"+(e.evaluate||Qt).source+"|$","g"),m="//# sourceURL="+(ce.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ye+"]")+"\n";t.replace(f,(function(e,n,i,r,s,l){return i||(i=r),p+=t.slice(c,l).replace(te,ii),n&&(o=!0,p+="' +\n__e("+n+") +\n'"),s&&(a=!0,p+="';\n"+s+";\n__p += '"),i&&(p+="' +\n((__t = ("+i+")) == null ? '' : __t) +\n'"),c=l+e.length,e})),p+="';\n";var g=ce.call(e,"variable")&&e.variable;if(g){if(Wt.test(g))throw new Ut(u)}else p="with (obj) {\n"+p+"\n}\n";p=(a?p.replace(Mt,""):p).replace(wt,"$1").replace(St,"$1;"),p="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var _=Md((function(){return Ht(l,m+"return "+p).apply(r,h)}));if(_.source=p,yh(_))throw _;return _}function dd(t){return Qh(t).toLowerCase()}function pd(t){return Qh(t).toUpperCase()}function fd(t,e,n){if(t=Qh(t),t&&(n||e===r))return Xn(t);if(!t||!(e=Oo(e)))return t;var i=gi(t),o=gi(e),a=$n(i,o),s=Qn(i,o)+1;return Zo(i,a,s).join("")}function md(t,e,n){if(t=Qh(t),t&&(n||e===r))return t.slice(0,_i(t)+1);if(!t||!(e=Oo(e)))return t;var i=gi(t),o=Qn(i,gi(e))+1;return Zo(i,0,o).join("")}function gd(t,e,n){if(t=Qh(t),t&&(n||e===r))return t.replace(kt,"");if(!t||!(e=Oo(e)))return t;var i=gi(t),o=$n(i,gi(e));return Zo(i,o).join("")}function _d(t,e){var n=L,i=A;if(Sh(e)){var o="separator"in e?e.separator:o;n="length"in e?Xh(e.length):n,i="omission"in e?Oo(e.omission):i}t=Qh(t);var a=t.length;if(oi(t)){var s=gi(t);a=s.length}if(n>=a)return t;var l=n-mi(i);if(l<1)return i;var u=s?Zo(s,0,l).join(""):t.slice(0,l);if(o===r)return u+i;if(s&&(l+=u.length-l),zh(o)){if(t.slice(l).search(o)){var h,c=u;o.global||(o=ie(o.source,Qh(Zt.exec(o))+"g")),o.lastIndex=0;while(h=o.exec(c))var d=h.index;u=u.slice(0,d===r?l:d)}}else if(t.indexOf(Oo(o),l)!=l){var p=u.lastIndexOf(o);p>-1&&(u=u.slice(0,p))}return u+i}function vd(t){return t=Qh(t),t&&Pt.test(t)?t.replace(Tt,vi):t}var yd=fa((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),xd=pa("toUpperCase");function bd(t,e,n){return t=Qh(t),e=n?r:e,e===r?ai(t)?bi(t):On(t):t.match(e)||[]}var Md=bo((function(t,e){try{return yn(t,r,e)}catch(n){return yh(n)?n:new Ut(n)}})),wd=Ua((function(t,e){return bn(e,(function(e){e=Rs(e),fr(t,e,Iu(t[e],t))})),t}));function Sd(t){var e=null==t?0:t.length,n=Ga();return t=e?Pn(t,(function(t){if("function"!=typeof t[1])throw new oe(l);return[n(t[0]),t[1]]})):[],bo((function(n){var i=-1;while(++i<e){var r=t[i];if(yn(r[0],this,n))return yn(r[1],this,n)}}))}function Td(t){return vr(_r(t,p))}function Ed(t){return function(){return t}}function Pd(t,e){return null==t||t!==t?e:t}var Ld=va(),Ad=va(!0);function Cd(t){return t}function Rd(t){return eo("function"==typeof t?t:_r(t,p))}function Id(t){return ao(_r(t,p))}function Dd(t,e){return so(t,_r(e,p))}var Od=bo((function(t,e){return function(n){return Wr(n,t,e)}})),zd=bo((function(t,e){return function(n){return Wr(t,n,e)}}));function Nd(t,e,n){var i=Mc(e),r=Dr(e,i);null!=n||Sh(e)&&(r.length||!i.length)||(n=e,e=t,t=this,r=Dr(e,Mc(e)));var o=!(Sh(n)&&"chain"in n)||!!n.chain,a=bh(t);return bn(r,(function(n){var i=e[n];t[n]=i,a&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__),r=n.__actions__=ra(this.__actions__);return r.push({func:i,args:arguments,thisArg:t}),n.__chain__=e,n}return i.apply(t,Ln([this.value()],arguments))})})),t}function kd(){return sn._===this&&(sn._=ge),this}function Ud(){}function Bd(t){return t=Xh(t),bo((function(e){return ho(e,t)}))}var Fd=Ma(Pn),Vd=Ma(wn),Hd=Ma(Rn);function Wd(t){return ls(t)?Vn(Rs(t)):mo(t)}function Gd(t){return function(e){return null==t?r:Or(t,e)}}var jd=Ta(),Zd=Ta(!0);function qd(){return[]}function Xd(){return!1}function Yd(){return{}}function Kd(){return""}function Jd(){return!0}function $d(t,e){if(t=Xh(t),t<1||t>N)return[];var n=B,i=Ve(t,B);e=Ga(e),t-=B;var r=Zn(i,e);while(++n<t)e(n);return r}function Qd(t){return lh(t)?Pn(t,Rs):Bh(t)?[t]:ra(Cs(Qh(t)))}function tp(t){var e=++de;return Qh(t)+e}var ep=ba((function(t,e){return t+e}),0),np=La("ceil"),ip=ba((function(t,e){return t/e}),1),rp=La("floor");function op(t){return t&&t.length?Tr(t,Cd,kr):r}function ap(t,e){return t&&t.length?Tr(t,Ga(e,2),kr):r}function sp(t){return Fn(t,Cd)}function lp(t,e){return Fn(t,Ga(e,2))}function up(t){return t&&t.length?Tr(t,Cd,ro):r}function hp(t,e){return t&&t.length?Tr(t,Ga(e,2),ro):r}var cp=ba((function(t,e){return t*e}),1),dp=La("round"),pp=ba((function(t,e){return t-e}),0);function fp(t){return t&&t.length?jn(t,Cd):0}function mp(t,e){return t&&t.length?jn(t,Ga(e,2)):0}return Mi.after=Au,Mi.ary=Cu,Mi.assign=tc,Mi.assignIn=ec,Mi.assignInWith=nc,Mi.assignWith=ic,Mi.at=rc,Mi.before=Ru,Mi.bind=Iu,Mi.bindAll=wd,Mi.bindKey=Du,Mi.castArray=$u,Mi.chain=jl,Mi.chunk=zs,Mi.compact=Ns,Mi.concat=ks,Mi.cond=Sd,Mi.conforms=Td,Mi.constant=Ed,Mi.countBy=nu,Mi.create=oc,Mi.curry=Ou,Mi.curryRight=zu,Mi.debounce=Nu,Mi.defaults=ac,Mi.defaultsDeep=sc,Mi.defer=ku,Mi.delay=Uu,Mi.difference=Us,Mi.differenceBy=Bs,Mi.differenceWith=Fs,Mi.drop=Vs,Mi.dropRight=Hs,Mi.dropRightWhile=Ws,Mi.dropWhile=Gs,Mi.fill=js,Mi.filter=ru,Mi.flatMap=su,Mi.flatMapDeep=lu,Mi.flatMapDepth=uu,Mi.flatten=Xs,Mi.flattenDeep=Ys,Mi.flattenDepth=Ks,Mi.flip=Bu,Mi.flow=Ld,Mi.flowRight=Ad,Mi.fromPairs=Js,Mi.functions=fc,Mi.functionsIn=mc,Mi.groupBy=du,Mi.initial=tl,Mi.intersection=el,Mi.intersectionBy=nl,Mi.intersectionWith=il,Mi.invert=yc,Mi.invertBy=xc,Mi.invokeMap=fu,Mi.iteratee=Rd,Mi.keyBy=mu,Mi.keys=Mc,Mi.keysIn=wc,Mi.map=gu,Mi.mapKeys=Sc,Mi.mapValues=Tc,Mi.matches=Id,Mi.matchesProperty=Dd,Mi.memoize=Fu,Mi.merge=Ec,Mi.mergeWith=Pc,Mi.method=Od,Mi.methodOf=zd,Mi.mixin=Nd,Mi.negate=Vu,Mi.nthArg=Bd,Mi.omit=Lc,Mi.omitBy=Ac,Mi.once=Hu,Mi.orderBy=_u,Mi.over=Fd,Mi.overArgs=Wu,Mi.overEvery=Vd,Mi.overSome=Hd,Mi.partial=Gu,Mi.partialRight=ju,Mi.partition=vu,Mi.pick=Cc,Mi.pickBy=Rc,Mi.property=Wd,Mi.propertyOf=Gd,Mi.pull=ll,Mi.pullAll=ul,Mi.pullAllBy=hl,Mi.pullAllWith=cl,Mi.pullAt=dl,Mi.range=jd,Mi.rangeRight=Zd,Mi.rearg=Zu,Mi.reject=bu,Mi.remove=pl,Mi.rest=qu,Mi.reverse=fl,Mi.sampleSize=wu,Mi.set=Dc,Mi.setWith=Oc,Mi.shuffle=Su,Mi.slice=ml,Mi.sortBy=Pu,Mi.sortedUniq=Ml,Mi.sortedUniqBy=wl,Mi.split=ld,Mi.spread=Xu,Mi.tail=Sl,Mi.take=Tl,Mi.takeRight=El,Mi.takeRightWhile=Pl,Mi.takeWhile=Ll,Mi.tap=Zl,Mi.throttle=Yu,Mi.thru=ql,Mi.toArray=Zh,Mi.toPairs=zc,Mi.toPairsIn=Nc,Mi.toPath=Qd,Mi.toPlainObject=Jh,Mi.transform=kc,Mi.unary=Ku,Mi.union=Al,Mi.unionBy=Cl,Mi.unionWith=Rl,Mi.uniq=Il,Mi.uniqBy=Dl,Mi.uniqWith=Ol,Mi.unset=Uc,Mi.unzip=zl,Mi.unzipWith=Nl,Mi.update=Bc,Mi.updateWith=Fc,Mi.values=Vc,Mi.valuesIn=Hc,Mi.without=kl,Mi.words=bd,Mi.wrap=Ju,Mi.xor=Ul,Mi.xorBy=Bl,Mi.xorWith=Fl,Mi.zip=Vl,Mi.zipObject=Hl,Mi.zipObjectDeep=Wl,Mi.zipWith=Gl,Mi.entries=zc,Mi.entriesIn=Nc,Mi.extend=ec,Mi.extendWith=nc,Nd(Mi,Mi),Mi.add=ep,Mi.attempt=Md,Mi.camelCase=Zc,Mi.capitalize=qc,Mi.ceil=np,Mi.clamp=Wc,Mi.clone=Qu,Mi.cloneDeep=eh,Mi.cloneDeepWith=nh,Mi.cloneWith=th,Mi.conformsTo=ih,Mi.deburr=Xc,Mi.defaultTo=Pd,Mi.divide=ip,Mi.endsWith=Yc,Mi.eq=rh,Mi.escape=Kc,Mi.escapeRegExp=Jc,Mi.every=iu,Mi.find=ou,Mi.findIndex=Zs,Mi.findKey=lc,Mi.findLast=au,Mi.findLastIndex=qs,Mi.findLastKey=uc,Mi.floor=rp,Mi.forEach=hu,Mi.forEachRight=cu,Mi.forIn=hc,Mi.forInRight=cc,Mi.forOwn=dc,Mi.forOwnRight=pc,Mi.get=gc,Mi.gt=oh,Mi.gte=ah,Mi.has=_c,Mi.hasIn=vc,Mi.head=$s,Mi.identity=Cd,Mi.includes=pu,Mi.indexOf=Qs,Mi.inRange=Gc,Mi.invoke=bc,Mi.isArguments=sh,Mi.isArray=lh,Mi.isArrayBuffer=uh,Mi.isArrayLike=hh,Mi.isArrayLikeObject=ch,Mi.isBoolean=dh,Mi.isBuffer=ph,Mi.isDate=fh,Mi.isElement=mh,Mi.isEmpty=gh,Mi.isEqual=_h,Mi.isEqualWith=vh,Mi.isError=yh,Mi.isFinite=xh,Mi.isFunction=bh,Mi.isInteger=Mh,Mi.isLength=wh,Mi.isMap=Eh,Mi.isMatch=Ph,Mi.isMatchWith=Lh,Mi.isNaN=Ah,Mi.isNative=Ch,Mi.isNil=Ih,Mi.isNull=Rh,Mi.isNumber=Dh,Mi.isObject=Sh,Mi.isObjectLike=Th,Mi.isPlainObject=Oh,Mi.isRegExp=zh,Mi.isSafeInteger=Nh,Mi.isSet=kh,Mi.isString=Uh,Mi.isSymbol=Bh,Mi.isTypedArray=Fh,Mi.isUndefined=Vh,Mi.isWeakMap=Hh,Mi.isWeakSet=Wh,Mi.join=rl,Mi.kebabCase=$c,Mi.last=ol,Mi.lastIndexOf=al,Mi.lowerCase=Qc,Mi.lowerFirst=td,Mi.lt=Gh,Mi.lte=jh,Mi.max=op,Mi.maxBy=ap,Mi.mean=sp,Mi.meanBy=lp,Mi.min=up,Mi.minBy=hp,Mi.stubArray=qd,Mi.stubFalse=Xd,Mi.stubObject=Yd,Mi.stubString=Kd,Mi.stubTrue=Jd,Mi.multiply=cp,Mi.nth=sl,Mi.noConflict=kd,Mi.noop=Ud,Mi.now=Lu,Mi.pad=ed,Mi.padEnd=nd,Mi.padStart=id,Mi.parseInt=rd,Mi.random=jc,Mi.reduce=yu,Mi.reduceRight=xu,Mi.repeat=od,Mi.replace=ad,Mi.result=Ic,Mi.round=dp,Mi.runInContext=t,Mi.sample=Mu,Mi.size=Tu,Mi.snakeCase=sd,Mi.some=Eu,Mi.sortedIndex=gl,Mi.sortedIndexBy=_l,Mi.sortedIndexOf=vl,Mi.sortedLastIndex=yl,Mi.sortedLastIndexBy=xl,Mi.sortedLastIndexOf=bl,Mi.startCase=ud,Mi.startsWith=hd,Mi.subtract=pp,Mi.sum=fp,Mi.sumBy=mp,Mi.template=cd,Mi.times=$d,Mi.toFinite=qh,Mi.toInteger=Xh,Mi.toLength=Yh,Mi.toLower=dd,Mi.toNumber=Kh,Mi.toSafeInteger=$h,Mi.toString=Qh,Mi.toUpper=pd,Mi.trim=fd,Mi.trimEnd=md,Mi.trimStart=gd,Mi.truncate=_d,Mi.unescape=vd,Mi.uniqueId=tp,Mi.upperCase=yd,Mi.upperFirst=xd,Mi.each=hu,Mi.eachRight=cu,Mi.first=$s,Nd(Mi,function(){var t={};return Rr(Mi,(function(e,n){ce.call(Mi.prototype,n)||(t[n]=e)})),t}(),{chain:!1}),Mi.VERSION=o,bn(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Mi[t].placeholder=Mi})),bn(["drop","take"],(function(t,e){Pi.prototype[t]=function(n){n=n===r?1:Fe(Xh(n),0);var i=this.__filtered__&&!e?new Pi(this):this.clone();return i.__filtered__?i.__takeCount__=Ve(n,i.__takeCount__):i.__views__.push({size:Ve(n,B),type:t+(i.__dir__<0?"Right":"")}),i},Pi.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),bn(["filter","map","takeWhile"],(function(t,e){var n=e+1,i=n==I||n==O;Pi.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Ga(t,3),type:n}),e.__filtered__=e.__filtered__||i,e}})),bn(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Pi.prototype[t]=function(){return this[n](1).value()[0]}})),bn(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Pi.prototype[t]=function(){return this.__filtered__?new Pi(this):this[n](1)}})),Pi.prototype.compact=function(){return this.filter(Cd)},Pi.prototype.find=function(t){return this.filter(t).head()},Pi.prototype.findLast=function(t){return this.reverse().find(t)},Pi.prototype.invokeMap=bo((function(t,e){return"function"==typeof t?new Pi(this):this.map((function(n){return Wr(n,t,e)}))})),Pi.prototype.reject=function(t){return this.filter(Vu(Ga(t)))},Pi.prototype.slice=function(t,e){t=Xh(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Pi(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==r&&(e=Xh(e),n=e<0?n.dropRight(-e):n.take(e-t)),n)},Pi.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Pi.prototype.toArray=function(){return this.take(B)},Rr(Pi.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),i=/^(?:head|last)$/.test(e),o=Mi[i?"take"+("last"==e?"Right":""):e],a=i||/^find/.test(e);o&&(Mi.prototype[e]=function(){var e=this.__wrapped__,s=i?[1]:arguments,l=e instanceof Pi,u=s[0],h=l||lh(e),c=function(t){var e=o.apply(Mi,Ln([t],s));return i&&d?e[0]:e};h&&n&&"function"==typeof u&&1!=u.length&&(l=h=!1);var d=this.__chain__,p=!!this.__actions__.length,f=a&&!d,m=l&&!p;if(!a&&h){e=m?e:new Pi(this);var g=t.apply(e,s);return g.__actions__.push({func:ql,args:[c],thisArg:r}),new Ei(g,d)}return f&&m?t.apply(this,s):(g=this.thru(c),f?i?g.value()[0]:g.value():g)})})),bn(["pop","push","shift","sort","splice","unshift"],(function(t){var e=ae[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",i=/^(?:pop|shift)$/.test(t);Mi.prototype[t]=function(){var t=arguments;if(i&&!this.__chain__){var r=this.value();return e.apply(lh(r)?r:[],t)}return this[n]((function(n){return e.apply(lh(n)?n:[],t)}))}})),Rr(Pi.prototype,(function(t,e){var n=Mi[e];if(n){var i=n.name+"";ce.call(un,i)||(un[i]=[]),un[i].push({name:e,func:n})}})),un[ya(r,y).name]=[{name:"wrapper",func:r}],Pi.prototype.clone=Li,Pi.prototype.reverse=Ai,Pi.prototype.value=Ci,Mi.prototype.at=Xl,Mi.prototype.chain=Yl,Mi.prototype.commit=Kl,Mi.prototype.next=Jl,Mi.prototype.plant=Ql,Mi.prototype.reverse=tu,Mi.prototype.toJSON=Mi.prototype.valueOf=Mi.prototype.value=eu,Mi.prototype.first=Mi.prototype.head,Pe&&(Mi.prototype[Pe]=$l),Mi},wi=Mi();sn._=wi,i=function(){return wi}.call(e,n,e,t),i===r||(t.exports=i)}.call(this)},427:function(t,e,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n],e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},i.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.getAreaTree=e.AreaTreeType=void 0;var r,o=n(46),a=n(655);(function(t){t["CHILD"]="CHILD",t["ROOT"]="ROOT"})(r=e.AreaTreeType||(e.AreaTreeType={}));var s=function(t,e,n,i){var r=(0,a.getPointPath)(i,n[e.polygonIndex].edges),o=(0,a.getPointPath)(i,t.edges),s=o[0],l=(0,a.isInside)(i,s,r),u=(0,a.allPointsLieOnBoundary)(o,(0,a.getLinePath)(r));return l&&!u},l=function(t,e,n,i){void 0===n&&(n={type:r.ROOT,children:[]}),void 0===i&&(i=0);for(var o=i;o<e.length;o++){var a=e[o];if(!a.visited){var u=n.type===r.ROOT;if(u||s(a,n,e,t)){var h={type:r.CHILD,area:{total:a.area,withoutChildren:a.area},polygonIndex:o,polygon:a.edges,children:[]};a.visited=!0,n.children.push(h),n.type===r.CHILD&&(n.area.withoutChildren=n.area.withoutChildren-a.area),e[o+1]&&l(t,e,h,o+1)}}}return n},u=function(t,e){var n=e.map((function(e,n){return i(i({},e),{id:n,visited:!1,area:(0,a.getPolygonArea)(t,e)})})).sort((function(t,e){return e.area-t.area}));return l(t,n)},h=function(t,e){return void 0===e&&(e=[]),t.forEach((function(t){e.push(t.cycle),h(t.children,e)})),e.filter((function(t){return!!t.length}))},c=function(t,e){var n=new o.PlanarFaceTree,i=n.discover(t,e);if("ERROR"===i.type)throw new Error(i.reason);var r=h(i.forest,[]);return u(t,r.map((function(t){return{edges:t}})))};e.getAreaTree=c},655:function(t,e){"use strict";var n,i=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,r=0,o=e.length;r<o;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.irregularPolygonArea=e.areaUnderLineSegment=e.getPolygonArea=e.isInside=e.allPointsLieOnBoundary=e.pointLiesOnPolygonBoundary=e.determineWindingOrder=e.getLinePath=e.getPointPath=e.WindingOrder=void 0,function(t){t["CW"]="CW",t["CCW"]="CCW",t["COLINEAR"]="CL"}(n=e.WindingOrder||(e.WindingOrder={}));var r=function(t,e){var n=e.slice(0,e.length-1);return n.map((function(e){return t[e]}))};e.getPointPath=r;var o=function(t){return t.reduce((function(t,e,n,r){return i(i([],t,!0),[[e,r[n+1]?r[n+1]:r[0]]],!1)}),[])};e.getLinePath=o;var a=function(t){var e=t.reduce((function(e,n,i){var r=n[0],o=n[1],a=t[i+1]?t[i+1]:t[0],s=a[0],l=a[1];return e+(s-r)*(l+o)}),0);return 0===e?n.COLINEAR:e>0?n.CW:n.CCW};e.determineWindingOrder=a;var s=function(t){var e=-1;return t.forEach((function(t){t[0]>e&&(e=t[0])})),e},l=function(t,n){for(var i=0;i<n.length;i++){var r=n[i],o=r[0],a=r[1],s=(0,e.determineWindingOrder)([o,a,t]);if("CL"===s&&f(o,t,a))return!0}return!1};e.pointLiesOnPolygonBoundary=l;var u=function(t,n){for(var i=0;i<t.length;i++){var r=t[i],o=(0,e.pointLiesOnPolygonBoundary)(r,n);if(!o)return!1}return!0};e.allPointsLieOnBoundary=u;var h=function(t,i,r){var o=[s(r)+10,i[1]],a=0,l=0;do{var u=(l+1)%r.length;if(m(r[l],r[u],i,o)){if((0,e.determineWindingOrder)([r[l],i,r[u]])==n.COLINEAR)return f(r[l],i,r[u]);a++}l=u}while(0!=l);return a%2==1};e.isInside=h;var c=function(t,n){var i=(0,e.getPointPath)(t,n.edges),r=(0,e.determineWindingOrder)(i),o=(0,e.getLinePath)(i);return(0,e.irregularPolygonArea)(o,r)||0};e.getPolygonArea=c;var d=function(t){var e=t[0],n=e[0],i=e[1],r=t[1],o=r[0],a=r[1],s=(i+a)/2,l=o-n,u=s*l;return u};e.areaUnderLineSegment=d;var p=function(t,i){return i===n.COLINEAR?0:t.reduce((function(t,r){switch(i){case n.CW:return t+(0,e.areaUnderLineSegment)(r);case n.CCW:return t-(0,e.areaUnderLineSegment)(r)}}),0)};function f(t,e,n){return e[0]<=Math.max(t[0],n[0])&&e[0]>=Math.min(t[0],n[0])&&e[1]<=Math.max(t[1],n[1])&&e[1]>=Math.min(t[1],n[1])}e.irregularPolygonArea=p;var m=function(t,i,r,o){var a=(0,e.determineWindingOrder)([t,i,r]),s=(0,e.determineWindingOrder)([t,i,o]),l=(0,e.determineWindingOrder)([r,o,t]),u=(0,e.determineWindingOrder)([r,o,i]);return a!==s&&l!==u||(!(a!==n.COLINEAR||!f(t,r,i))||(!(s!==n.COLINEAR||!f(t,o,i))||(!(l!==n.COLINEAR||!f(r,t,o))||!(u!==n.COLINEAR||!f(r,i,o)))))}},115:function(t,e,n){"use strict";e.iu=void 0;var i=n(46);Object.defineProperty(e,"iu",{enumerable:!0,get:function(){return i.PlanarFaceTree}});var r=n(427)},46:function(t,e){"use strict";var n=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,r=0,o=e.length;r<o;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.PlanarFaceTree=e.DiscoveryErrorCode=e.DiscoveryResultType=e.CycleTree=void 0;var i=function(){function t(t,e){this.cycle=t,this.children=e}return t.prototype.isEmpty=function(){return 0===this.cycle.length&&0===this.children.length},t.prototype.toJSON=function(){return JSON.parse(JSON.stringify({cycle:n([],this.cycle,!0),children:this.children.map((function(t){return t.toJSON()}))}))},t}();e.CycleTree=i;var r,o,a=function(){function t(t,e){this.name=t,this.position=e,this.visited=0,this.adjacent=new Set}return t}();(function(t){t["ERROR"]="ERROR",t["RESULT"]="RESULT"})(r=e.DiscoveryResultType||(e.DiscoveryResultType={})),function(t){t["INVALID_COORDINATE_SYSTEM"]="INVALID_COORDINATE_SYSTEM",t["EDGE_ENDPOINT_OUT_OF_BOUNDS"]="EDGE_ENDPOINT_OUT_OF_BOUNDS",t["VERTICES_HAVE_SAME_POSITION"]="VERTICES_HAVE_SAME_POSITION",t["DUPLICATE_EDGE_FOUND"]="DUPLICATE_EDGE_FOUND",t["GRAPH_EMPTY"]="GRAPH_EMPTY"}(o=e.DiscoveryErrorCode||(e.DiscoveryErrorCode={}));var s=function(){function t(){this.vertexStore=[]}return t.prototype.discover=function(e,n){var i=this,o=[],s=t.validateInputs(e,n);if(s)return s;var l=new Map;n.forEach((function(t){for(var n=0;n<2;n++){var i=t[n];if(!l.has(i)){var r=new a(i,e[i]);l.set(i,r)}}}));var u=[];Array.from(l.entries()).forEach((function(t){t[0];var e=t[1];i.vertexStore.push(e),u.push(e)})),n.forEach((function(t){var e=l.get(t[0]),n=l.get(t[1]);e&&n&&(e.adjacent.add(n),n.adjacent.add(e))}));var h=[];return this.vertexStore.forEach((function(e){0===e.visited&&(h.push({value:[]}),t.depthFirstSearch(e,h[h.length-1]))})),this.vertexStore.forEach((function(t){t.visited=0})),h.forEach((function(t){o.push(i.extractBasis(t))})),{type:r.RESULT,forest:o.filter((function(t){return!t.isEmpty()}))}},t.validateInputs=function(t,e){if(0===t.length||0===e.length)return{type:r.ERROR,reason:o.GRAPH_EMPTY};for(var n=new Set,i=0;i<t.length;i++){var a=t[i],s=a[0]+"->"+a[1];if(n.has(s))return{type:r.ERROR,reason:o.VERTICES_HAVE_SAME_POSITION};if(n.add(s),a[0]<0||a[1]<0)return{type:r.ERROR,reason:o.INVALID_COORDINATE_SYSTEM}}for(var l=new Set,u=t.length-1,h=0;h<e.length;h++){var c=e[h];s=c[0]+"->"+c[1];if(l.has(s))return{type:r.ERROR,reason:o.DUPLICATE_EDGE_FOUND};if(l.add(s),c[0]<0||c[0]>u||c[1]<0||c[1]>u)return{type:r.ERROR,reason:o.EDGE_ENDPOINT_OUT_OF_BOUNDS}}return null},t.depthFirstSearch=function(t,e){var n=[];n.push(t);while(n.length>0){var i=n[n.length-1];i.visited=1;for(var r=0,o=Array.from(i.adjacent.values()),a=0;a<o.length;a++){var s=o[r];if(s&&0===s.visited){n.push(s);break}++r}r===i.adjacent.size&&(i.visited=2,e.value.push(i),n.pop())}},t.extractCycle=function(t){for(var e=t.value.length,n=[],i=0;i<e;++i)n[i]=t.value[i].name;var r=t.value[0],o=t.value[1],a=r.adjacent.size>2?r:null;r.adjacent.delete(o),o.adjacent.delete(r);while(o!==a&&1===o.adjacent.size){var s=Array.from(o.adjacent)[0];o.adjacent.delete(s),s.adjacent.delete(o),o=s}if(o!==r){a=o;while(r!==a&&1===r.adjacent.size)o=Array.from(r.adjacent)[0],r.adjacent.delete(o),o.adjacent.delete(r),r=o}return n},t.prototype.extractBasis=function(t){var e=new i([],[]);while(t.value.length>0)this.removeFilaments(t),t.value.length>0&&e.children.push(this.extractCycleFromComponent(t));if(0===e.cycle.length&&1===e.children.length){var n=e.children[e.children.length-1];e.cycle=n.cycle,e.children=n.children}return e},t.prototype.removeFilaments=function(t){var e=[];if(t.value.forEach((function(t){1===t.adjacent.size&&e.push(t)})),e.length>0){e.forEach((function(t){if(1===t.adjacent.size){var e=t;while(1===e.adjacent.size){var n=Array.from(e.adjacent.values())[0];n.adjacent.delete(e),e.adjacent.delete(n),e=n}}}));var n=[];t.value.forEach((function(t){t.adjacent.size>0&&n.push(t)})),t.value=n}},t.prototype.extractCycleFromComponent=function(t){var e=t.value[0];t.value.forEach((function(t){t.position[0]===e.position[0]&&t.position[1]<e.position[1]&&(e=t),t.position[0]<e.position[0]&&(e=t)}));var n={value:[]},i=e,r=i;n.value.push(r);var o=this.getClockwiseMost(null,r);while(o!==r){n.value.push(o);var a=this.getCounterClockwiseMost(i,o);i=o,o=a}n.value.push(r);var s=this.extractCycleFromClosedWalk(n),l=[];return t.value.forEach((function(t){t.adjacent.size>0&&l.push(t)})),t.value=l,s},t.prototype.extractCycleFromClosedWalk=function(e){for(var r=this,o=new i([],[]),s=new Map,l=new Set,u=e.value.length,h=1;h<u-1;++h){var c=s.get(e.value[h])||null;if(null!==c){var d=c,p=h;l.add(d);for(var f=d+1;f<p;++f){var m=e.value[f];s.delete(m),l.delete(f)}var g=d+1,_=p+1,v=_-g;e.value.splice(g,v),u=e.value.length,h=d}else s.set(e.value[h],h)}if(u>3)l.add(0),l.forEach((function(i){for(var s=e.value[i],l=e.value[i+1],h=i>0?e.value[i-1]:e.value[u-2],c=[0,0],d=[0,0],p=0;p<2;++p)c[p]=h.position[p]-s.position[p],d[p]=l.position[p]-s.position[p];var f=d[0]*c[1]>=d[1]*c[0],m=new Set,g=s.adjacent;if(g.forEach((function(t){if(t.name!==h.name&&t.name!==l.name){for(var e=[0,0],n=0;n<2;++n)e[n]=t.position[n]-s.position[n];var i=!1;i=f?e[0]*c[1]>e[1]*c[0]&&e[0]*d[1]<e[1]*d[0]:e[0]*c[1]>e[1]*c[0]||e[0]*d[1]<e[1]*d[0],i&&m.add(t)}})),m.size>0){var _=new a(s.name,n([],s.position,!0));r.vertexStore.push(_),m.forEach((function(t){s.adjacent.delete(t),t.adjacent.delete(s),_.adjacent.add(t),t.adjacent.add(_)}));var v={value:[]};t.depthFirstSearch(_,v),o.children.push(r.extractBasis(v))}})),o.cycle=t.extractCycle(e);else{var y=e.value[0],x=e.value[1],b=new a(y.name,n([],y.position,!0));this.vertexStore.push(b),y.adjacent.delete(x),x.adjacent.delete(y),b.adjacent.add(x),x.adjacent.add(b);var M={value:[]};if(t.depthFirstSearch(b,M),o.children.push(this.extractBasis(M)),0===o.cycle.length&&1===o.children.length){var w=o.children[o.children.length-1];o.cycle=w.cycle,o.children=w.children}}return o},t.prototype.getClockwiseMost=function(t,e){var n=null,i=!1,r=[0,0],o=[0,0];return t?(r[0]=e.position[0]-t.position[0],r[1]=e.position[1]-t.position[1]):(r[0]=0,r[1]=-1),e.adjacent.forEach((function(a){if(a!==t){var s=[a.position[0]-e.position[0],a.position[1]-e.position[1]];if(!n)return n=a,o=s,void(i=o[0]*r[1]<=o[1]*r[0]);i?(r[0]*s[1]<r[1]*s[0]||o[0]*s[1]<o[1]*s[0])&&(n=a,o=s,i=o[0]*r[1]<=o[1]*r[0]):r[0]*s[1]<r[1]*s[0]&&o[0]*s[1]<o[1]*s[0]&&(n=a,o=s,i=o[0]*r[1]<o[1]*r[0])}})),n},t.prototype.getCounterClockwiseMost=function(t,e){var n=null,i=!1,r=[0,0],o=[0,0];return t?(r[0]=e.position[0]-t.position[0],r[1]=e.position[1]-t.position[1]):(r[0]=0,r[1]=-1),e.adjacent.forEach((function(a){if(a!==t){var s=[a.position[0]-e.position[0],a.position[1]-e.position[1]];if(!n)return n=a,o=s,void(i=o[0]*r[1]<=o[1]*r[0]);i?r[0]*s[1]>r[1]*s[0]&&o[0]*s[1]>o[1]*s[0]&&(n=a,o=s,i=o[0]*r[1]<=o[1]*r[0]):(r[0]*s[1]>r[1]*s[0]||o[0]*s[1]>o[1]*s[0])&&(n=a,o=s,i=o[0]*r[1]<=o[1]*r[0])}})),n},t}();e.PlanarFaceTree=s},841:function(t){t.exports=function(t,e,n,i){var r=t[0],o=t[1],a=!1;void 0===n&&(n=0),void 0===i&&(i=e.length);for(var s=(i-n)/2,l=0,u=s-1;l<s;u=l++){var h=e[n+2*l+0],c=e[n+2*l+1],d=e[n+2*u+0],p=e[n+2*u+1],f=c>o!==p>o&&r<(d-h)*(o-c)/(p-c)+h;f&&(a=!a)}return a}},95:function(t,e,n){var i=n(841),r=n(137);t.exports=function(t,e,n,o){return e.length>0&&Array.isArray(e[0])?r(t,e,n,o):i(t,e,n,o)},t.exports.nested=r,t.exports.flat=i},137:function(t){t.exports=function(t,e,n,i){var r=t[0],o=t[1],a=!1;void 0===n&&(n=0),void 0===i&&(i=e.length);for(var s=i-n,l=0,u=s-1;l<s;u=l++){var h=e[l+n][0],c=e[l+n][1],d=e[u+n][0],p=e[u+n][1],f=c>o!==p>o&&r<(d-h)*(o-c)/(p-c)+h;f&&(a=!a)}return a}},341:function(t){!function(e,n){t.exports=n()}(0,(function(){"use strict";function t(t,i,r,o,a){!function t(n,i,r,o,a){for(;o>r;){if(o-r>600){var s=o-r+1,l=i-r+1,u=Math.log(s),h=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*h*(s-h)/s)*(l-s/2<0?-1:1),d=Math.max(r,Math.floor(i-l*h/s+c)),p=Math.min(o,Math.floor(i+(s-l)*h/s+c));t(n,i,d,p,a)}var f=n[i],m=r,g=o;for(e(n,r,i),a(n[o],f)>0&&e(n,r,o);m<g;){for(e(n,m,g),m++,g--;a(n[m],f)<0;)m++;for(;a(n[g],f)>0;)g--}0===a(n[r],f)?e(n,r,g):e(n,++g,o),g<=i&&(r=g+1),i<=g&&(o=g-1)}}(t,i,r||0,o||t.length-1,a||n)}function e(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function n(t,e){return t<e?-1:t>e?1:0}var i=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function r(t,e,n){if(!n)return e.indexOf(t);for(var i=0;i<e.length;i++)if(n(t,e[i]))return i;return-1}function o(t,e){a(t,0,t.children.length,e,t)}function a(t,e,n,i,r){r||(r=f(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(var o=e;o<n;o++){var a=t.children[o];s(r,t.leaf?i(a):a)}return r}function s(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function l(t,e){return t.minX-e.minX}function u(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function c(t){return t.maxX-t.minX+(t.maxY-t.minY)}function d(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function p(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function f(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function m(e,n,i,r,o){for(var a=[n,i];a.length;)if(!((i=a.pop())-(n=a.pop())<=r)){var s=n+Math.ceil((i-n)/r/2)*r;t(e,s,n,i,o),a.push(n,s,s,i)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,n=[];if(!p(t,e))return n;for(var i=this.toBBox,r=[];e;){for(var o=0;o<e.children.length;o++){var a=e.children[o],s=e.leaf?i(a):a;p(t,s)&&(e.leaf?n.push(a):d(t,s)?this._all(a,n):r.push(a))}e=r.pop()}return n},i.prototype.collides=function(t){var e=this.data;if(!p(t,e))return!1;for(var n=[];e;){for(var i=0;i<e.children.length;i++){var r=e.children[i],o=e.leaf?this.toBBox(r):r;if(p(t,o)){if(e.leaf||d(t,o))return!0;n.push(r)}}e=n.pop()}return!1},i.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var i=this.data;this.data=n,n=i}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},i.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},i.prototype.clear=function(){return this.data=f([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var n,i,o,a=this.data,s=this.toBBox(t),l=[],u=[];a||l.length;){if(a||(a=l.pop(),i=l[l.length-1],n=u.pop(),o=!0),a.leaf){var h=r(t,a.children,e);if(-1!==h)return a.children.splice(h,1),l.push(a),this._condense(l),this}o||a.leaf||!d(a,s)?i?(n++,a=i.children[n],o=!1):a=null:(l.push(a),u.push(n),n=0,i=a,a=a.children[0])}return this},i.prototype.toBBox=function(t){return t},i.prototype.compareMinX=function(t,e){return t.minX-e.minX},i.prototype.compareMinY=function(t,e){return t.minY-e.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(t){return this.data=t,this},i.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},i.prototype._build=function(t,e,n,i){var r,a=n-e+1,s=this._maxEntries;if(a<=s)return o(r=f(t.slice(e,n+1)),this.toBBox),r;i||(i=Math.ceil(Math.log(a)/Math.log(s)),s=Math.ceil(a/Math.pow(s,i-1))),(r=f([])).leaf=!1,r.height=i;var l=Math.ceil(a/s),u=l*Math.ceil(Math.sqrt(s));m(t,e,n,u,this.compareMinX);for(var h=e;h<=n;h+=u){var c=Math.min(h+u-1,n);m(t,h,c,l,this.compareMinY);for(var d=h;d<=c;d+=l){var p=Math.min(d+l-1,c);r.children.push(this._build(t,d,p,i-1))}}return o(r,this.toBBox),r},i.prototype._chooseSubtree=function(t,e,n,i){for(;i.push(e),!e.leaf&&i.length-1!==n;){for(var r=1/0,o=1/0,a=void 0,s=0;s<e.children.length;s++){var l=e.children[s],u=h(l),c=(d=t,p=l,(Math.max(p.maxX,d.maxX)-Math.min(p.minX,d.minX))*(Math.max(p.maxY,d.maxY)-Math.min(p.minY,d.minY))-u);c<o?(o=c,r=u<r?u:r,a=l):c===o&&u<r&&(r=u,a=l)}e=a||e.children[0]}var d,p;return e},i.prototype._insert=function(t,e,n){var i=n?t:this.toBBox(t),r=[],o=this._chooseSubtree(i,this.data,e,r);for(o.children.push(t),s(o,i);e>=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(i,r,e)},i.prototype._split=function(t,e){var n=t[e],i=n.children.length,r=this._minEntries;this._chooseSplitAxis(n,r,i);var a=this._chooseSplitIndex(n,r,i),s=f(n.children.splice(a,n.children.length-a));s.height=n.height,s.leaf=n.leaf,o(n,this.toBBox),o(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},i.prototype._splitRoot=function(t,e){this.data=f([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,n){for(var i,r,o,s,l,u,c,d=1/0,p=1/0,f=e;f<=n-e;f++){var m=a(t,0,f,this.toBBox),g=a(t,f,n,this.toBBox),_=(r=m,o=g,s=void 0,l=void 0,u=void 0,c=void 0,s=Math.max(r.minX,o.minX),l=Math.max(r.minY,o.minY),u=Math.min(r.maxX,o.maxX),c=Math.min(r.maxY,o.maxY),Math.max(0,u-s)*Math.max(0,c-l)),v=h(m)+h(g);_<d?(d=_,i=f,p=v<p?v:p):_===d&&v<p&&(p=v,i=f)}return i||n-e},i.prototype._chooseSplitAxis=function(t,e,n){var i=t.leaf?this.compareMinX:l,r=t.leaf?this.compareMinY:u;this._allDistMargin(t,e,n,i)<this._allDistMargin(t,e,n,r)&&t.children.sort(i)},i.prototype._allDistMargin=function(t,e,n,i){t.children.sort(i);for(var r=this.toBBox,o=a(t,0,e,r),l=a(t,n-e,n,r),u=c(o)+c(l),h=e;h<n-e;h++){var d=t.children[h];s(o,t.leaf?r(d):d),u+=c(o)}for(var p=n-e-1;p>=e;p--){var f=t.children[p];s(l,t.leaf?r(f):f),u+=c(l)}return u},i.prototype._adjustParentBBoxes=function(t,e,n){for(var i=n;i>=0;i--)s(e[i],t)},i.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():o(t[e],this.toBBox)},i}))},181:function(t,e){!function(t,n){n(e)}(0,(function(t){"use strict";t.SVD=function(t,e,n,i,r){if(e=void 0===e||e,n=void 0===n||n,r=1e-64/(i=i||Math.pow(2,-52)),!t)throw new TypeError("Matrix a is not defined");var o,a,s,l,u,h,c,d,p,f,m,g,_=t[0].length,v=t.length;if(v<_)throw new TypeError("Invalid matrix: m < n");for(var y=[],x=[],b=[],M="f"===e?v:_,w=f=c=0;w<v;w++)x[w]=new Array(M).fill(0);for(w=0;w<_;w++)b[w]=new Array(_).fill(0);var S,T=new Array(_).fill(0);for(w=0;w<v;w++)for(o=0;o<_;o++)x[w][o]=t[w][o];for(w=0;w<_;w++){for(y[w]=c,p=0,s=w+1,o=w;o<v;o++)p+=Math.pow(x[o][w],2);if(p<r)c=0;else for(d=(h=x[w][w])*(c=h<0?Math.sqrt(p):-Math.sqrt(p))-p,x[w][w]=h-c,o=s;o<_;o++){for(p=0,a=w;a<v;a++)p+=x[a][w]*x[a][o];for(h=p/d,a=w;a<v;a++)x[a][o]=x[a][o]+h*x[a][w]}for(T[w]=c,p=0,o=s;o<_;o++)p+=Math.pow(x[w][o],2);if(p<r)c=0;else{for(d=(h=x[w][w+1])*(c=h<0?Math.sqrt(p):-Math.sqrt(p))-p,x[w][w+1]=h-c,o=s;o<_;o++)y[o]=x[w][o]/d;for(o=s;o<v;o++){for(p=0,a=s;a<_;a++)p+=x[o][a]*x[w][a];for(a=s;a<_;a++)x[o][a]=x[o][a]+p*y[a]}}f<(m=Math.abs(T[w])+Math.abs(y[w]))&&(f=m)}if(n)for(w=_-1;0<=w;w--){if(0!==c){for(d=x[w][w+1]*c,o=s;o<_;o++)b[o][w]=x[w][o]/d;for(o=s;o<_;o++){for(p=0,a=s;a<_;a++)p+=x[w][a]*b[a][o];for(a=s;a<_;a++)b[a][o]=b[a][o]+p*b[a][w]}}for(o=s;o<_;o++)b[w][o]=0,b[o][w]=0;b[w][w]=1,c=y[w],s=w}if(e){if("f"===e)for(w=_;w<v;w++){for(o=_;o<v;o++)x[w][o]=0;x[w][w]=1}for(w=_-1;0<=w;w--){for(s=w+1,c=T[w],o=s;o<M;o++)x[w][o]=0;if(0!==c){for(d=x[w][w]*c,o=s;o<M;o++){for(p=0,a=s;a<v;a++)p+=x[a][w]*x[a][o];for(h=p/d,a=w;a<v;a++)x[a][o]=x[a][o]+h*x[a][w]}for(o=w;o<v;o++)x[o][w]=x[o][w]/c}else for(o=w;o<v;o++)x[o][w]=0;x[w][w]=x[w][w]+1}}for(i*=f,a=_-1;0<=a;a--)for(var E=0;E<50;E++){for(S=!1,s=a;0<=s;s--){if(Math.abs(y[s])<=i){S=!0;break}if(Math.abs(T[s-1])<=i)break}if(!S)for(u=0,l=s-(p=1),w=s;w<a+1&&(h=p*y[w],y[w]=u*y[w],!(Math.abs(h)<=i));w++)if(c=T[w],T[w]=Math.sqrt(h*h+c*c),u=c/(d=T[w]),p=-h/d,e)for(o=0;o<v;o++)m=x[o][l],g=x[o][w],x[o][l]=m*u+g*p,x[o][w]=-m*p+g*u;if(g=T[a],s===a){if(g<0&&(T[a]=-g,n))for(o=0;o<_;o++)b[o][a]=-b[o][a];break}for(f=T[s],h=(((m=T[a-1])-g)*(m+g)+((c=y[a-1])-(d=y[a]))*(c+d))/(2*d*m),c=Math.sqrt(h*h+1),h=((f-g)*(f+g)+d*(m/(h<0?h-c:h+c)-d))/f,w=s+(p=u=1);w<a+1;w++){if(c=y[w],m=T[w],d=p*c,c*=u,g=Math.sqrt(h*h+d*d),h=f*(u=h/(y[w-1]=g))+c*(p=d/g),c=-f*p+c*u,d=m*p,m*=u,n)for(o=0;o<_;o++)f=b[o][w-1],g=b[o][w],b[o][w-1]=f*u+g*p,b[o][w]=-f*p+g*u;if(g=Math.sqrt(h*h+d*d),h=(u=h/(T[w-1]=g))*c+(p=d/g)*m,f=-p*c+u*m,e)for(o=0;o<v;o++)m=x[o][w-1],g=x[o][w],x[o][w-1]=m*u+g*p,x[o][w]=-m*p+g*u}y[s]=0,y[a]=h,T[a]=f}for(w=0;w<_;w++)T[w]<i&&(T[w]=0);return{u:x,q:T,v:b}},t.VERSION="1.1.1",Object.defineProperty(t,"__esModule",{value:!0})}))},759:function(t){void 0===Date.now&&(Date.now=function(){return(new Date).valueOf()});var e=e||function(){var t=[];return{REVISION:"8",getAll:function(){return t},removeAll:function(){t=[]},add:function(e){t.push(e)},remove:function(e){var n=t.indexOf(e);-1!==n&&t.splice(n,1)},update:function(e){if(0===t.length)return!1;var n=0,i=t.length;e=void 0!==e?e:Date.now();while(n<i)t[n].update(e)?n++:(t.splice(n,1),i--);return!0}}}();e.Tween=function(t){var n=t,i={},r={},o=1e3,a=0,s=null,l=e.Easing.Linear.None,u=e.Interpolation.Linear,h=[],c=null,d=!1,p=null,f=null;this.to=function(t,e){return void 0!==e&&(o=e),r=t,this},this.start=function(t){for(var o in e.add(this),d=!1,s=void 0!==t?t:Date.now(),s+=a,r)if(null!==n[o]&&o in n){if(r[o]instanceof Array){if(0===r[o].length)continue;r[o]=[n[o]].concat(r[o])}i[o]=n[o]}return this},this.stop=function(){return e.remove(this),this},this.delay=function(t){return a=t,this},this.easing=function(t){return l=t,this},this.interpolation=function(t){return u=t,this},this.chain=function(){return h=arguments,this},this.onStart=function(t){return c=t,this},this.onUpdate=function(t){return p=t,this},this.onComplete=function(t){return f=t,this},this.update=function(t){if(t<s)return!0;!1===d&&(null!==c&&c.call(n),d=!0);var e=(t-s)/o;e=e>1?1:e;var a=l(e);for(var m in i){var g=i[m],_=r[m];n[m]=_ instanceof Array?u(_,a):g+(_-g)*a}if(null!==p&&p.call(n,a),1==e){null!==f&&f.call(n);for(var v=0,y=h.length;v<y;v++)h[v].start(t);return!1}return!0}},e.Easing={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){var e,n=.1,i=.4;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=i/4):e=i*Math.asin(1/n)/(2*Math.PI),-n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i))},Out:function(t){var e,n=.1,i=.4;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=i/4):e=i*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/i)+1)},InOut:function(t){var e,n=.1,i=.4;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=i/4):e=i*Math.asin(1/n)/(2*Math.PI),(t*=2)<1?n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*-.5:n*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*.5+1)}},Back:{In:function(t){var e=1.70158;return t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}},Bounce:{In:function(t){return 1-e.Easing.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*e.Easing.Bounce.In(2*t):.5*e.Easing.Bounce.Out(2*t-1)+.5}}},e.Interpolation={Linear:function(t,n){var i=t.length-1,r=i*n,o=Math.floor(r),a=e.Interpolation.Utils.Linear;return n<0?a(t[0],t[1],r):n>1?a(t[i],t[i-1],i-r):a(t[o],t[o+1>i?i:o+1],r-o)},Bezier:function(t,n){var i,r=0,o=t.length-1,a=Math.pow,s=e.Interpolation.Utils.Bernstein;for(i=0;i<=o;i++)r+=a(1-n,o-i)*a(n,i)*t[i]*s(o,i);return r},CatmullRom:function(t,n){var i=t.length-1,r=i*n,o=Math.floor(r),a=e.Interpolation.Utils.CatmullRom;return t[0]===t[i]?(n<0&&(o=Math.floor(r=i*(1+n))),a(t[(o-1+i)%i],t[o],t[(o+1)%i],t[(o+2)%i],r-o)):n<0?t[0]-(a(t[0],t[0],t[1],t[1],-r)-t[0]):n>1?t[i]-(a(t[i],t[i],t[i-1],t[i-1],r-i)-t[i]):a(t[o?o-1:0],t[o],t[i<o+1?i:o+1],t[i<o+2?i:o+2],r-o)},Utils:{Linear:function(t,e,n){return(e-t)*n+t},Bernstein:function(t,n){var i=e.Interpolation.Utils.Factorial;return i(t)/i(n)/i(t-n)},Factorial:function(){var t=[1];return function(e){var n,i=1;if(t[e])return t[e];for(n=e;n>1;n--)i*=n;return t[e]=i}}(),CatmullRom:function(t,e,n,i,r){var o=.5*(n-t),a=.5*(i-e),s=r*r,l=r*s;return(2*e-2*n+o+a)*l+(-3*e+3*n-2*o-a)*s+o*r+e}}},t.exports=e},278:function(t,e,n){"use strict";n.d(e,{i0:function(){return ot},L8:function(){return rt},PY:function(){return it},aH:function(){return nt}});var i=n(641),r=n(953);function o(){return a().__VUE_DEVTOOLS_GLOBAL_HOOK__}function a(){return"undefined"!==typeof navigator&&"undefined"!==typeof window?window:"undefined"!==typeof globalThis?globalThis:{}}const s="function"===typeof Proxy,l="devtools-plugin:setup",u="plugin:settings:set";let h,c;function d(){var t;return void 0!==h||("undefined"!==typeof window&&window.performance?(h=!0,c=window.performance):"undefined"!==typeof globalThis&&(null===(t=globalThis.perf_hooks)||void 0===t?void 0:t.performance)?(h=!0,c=globalThis.perf_hooks.performance):h=!1),h}function p(){return d()?c.now():Date.now()}class f{constructor(t,e){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=t,this.hook=e;const n={};if(t.settings)for(const a in t.settings){const e=t.settings[a];n[a]=e.defaultValue}const i=`__vue-devtools-plugin-settings__${t.id}`;let r=Object.assign({},n);try{const t=localStorage.getItem(i),e=JSON.parse(t);Object.assign(r,e)}catch(o){}this.fallbacks={getSettings(){return r},setSettings(t){try{localStorage.setItem(i,JSON.stringify(t))}catch(o){}r=t},now(){return p()}},e&&e.on(u,((t,e)=>{t===this.plugin.id&&this.fallbacks.setSettings(e)})),this.proxiedOn=new Proxy({},{get:(t,e)=>this.target?this.target.on[e]:(...t)=>{this.onQueue.push({method:e,args:t})}}),this.proxiedTarget=new Proxy({},{get:(t,e)=>this.target?this.target[e]:"on"===e?this.proxiedOn:Object.keys(this.fallbacks).includes(e)?(...t)=>(this.targetQueue.push({method:e,args:t,resolve:()=>{}}),this.fallbacks[e](...t)):(...t)=>new Promise((n=>{this.targetQueue.push({method:e,args:t,resolve:n})}))})}async setRealTarget(t){this.target=t;for(const e of this.onQueue)this.target.on[e.method](...e.args);for(const e of this.targetQueue)e.resolve(await this.target[e.method](...e.args))}}function m(t,e){const n=t,i=a(),r=o(),u=s&&n.enableEarlyProxy;if(!r||!i.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__&&u){const t=u?new f(n,r):null,o=i.__VUE_DEVTOOLS_PLUGINS__=i.__VUE_DEVTOOLS_PLUGINS__||[];o.push({pluginDescriptor:n,setupFn:e,proxy:t}),t&&e(t.proxiedTarget)}else r.emit(l,t,e)}
|
|
15
|
-
/*!
|
|
16
|
-
* vuex v4.1.0
|
|
17
|
-
* (c) 2022 Evan You
|
|
18
|
-
* @license MIT
|
|
19
|
-
*/
|
|
20
|
-
var g="store";function _(t,e){Object.keys(t).forEach((function(n){return e(t[n],n)}))}function v(t){return null!==t&&"object"===typeof t}function y(t){return t&&"function"===typeof t.then}function x(t,e){return function(){return t(e)}}function b(t,e,n){return e.indexOf(t)<0&&(n&&n.prepend?e.unshift(t):e.push(t)),function(){var n=e.indexOf(t);n>-1&&e.splice(n,1)}}function M(t,e){t._actions=Object.create(null),t._mutations=Object.create(null),t._wrappedGetters=Object.create(null),t._modulesNamespaceMap=Object.create(null);var n=t.state;S(t,n,[],t._modules.root,!0),w(t,n,e)}function w(t,e,n){var o=t._state,a=t._scope;t.getters={},t._makeLocalGettersCache=Object.create(null);var s=t._wrappedGetters,l={},u={},h=(0,r.uY)(!0);h.run((function(){_(s,(function(e,n){l[n]=x(e,t),u[n]=(0,i.EW)((function(){return l[n]()})),Object.defineProperty(t.getters,n,{get:function(){return u[n].value},enumerable:!0})}))})),t._state=(0,r.Kh)({data:e}),t._scope=h,t.strict&&C(t),o&&n&&t._withCommit((function(){o.data=null})),a&&a.stop()}function S(t,e,n,i,r){var o=!n.length,a=t._modules.getNamespace(n);if(i.namespaced&&(t._modulesNamespaceMap[a],t._modulesNamespaceMap[a]=i),!o&&!r){var s=R(e,n.slice(0,-1)),l=n[n.length-1];t._withCommit((function(){s[l]=i.state}))}var u=i.context=T(t,a,n);i.forEachMutation((function(e,n){var i=a+n;P(t,i,e,u)})),i.forEachAction((function(e,n){var i=e.root?n:a+n,r=e.handler||e;L(t,i,r,u)})),i.forEachGetter((function(e,n){var i=a+n;A(t,i,e,u)})),i.forEachChild((function(i,o){S(t,e,n.concat(o),i,r)}))}function T(t,e,n){var i=""===e,r={dispatch:i?t.dispatch:function(n,i,r){var o=I(n,i,r),a=o.payload,s=o.options,l=o.type;return s&&s.root||(l=e+l),t.dispatch(l,a)},commit:i?t.commit:function(n,i,r){var o=I(n,i,r),a=o.payload,s=o.options,l=o.type;s&&s.root||(l=e+l),t.commit(l,a,s)}};return Object.defineProperties(r,{getters:{get:i?function(){return t.getters}:function(){return E(t,e)}},state:{get:function(){return R(t.state,n)}}}),r}function E(t,e){if(!t._makeLocalGettersCache[e]){var n={},i=e.length;Object.keys(t.getters).forEach((function(r){if(r.slice(0,i)===e){var o=r.slice(i);Object.defineProperty(n,o,{get:function(){return t.getters[r]},enumerable:!0})}})),t._makeLocalGettersCache[e]=n}return t._makeLocalGettersCache[e]}function P(t,e,n,i){var r=t._mutations[e]||(t._mutations[e]=[]);r.push((function(e){n.call(t,i.state,e)}))}function L(t,e,n,i){var r=t._actions[e]||(t._actions[e]=[]);r.push((function(e){var r=n.call(t,{dispatch:i.dispatch,commit:i.commit,getters:i.getters,state:i.state,rootGetters:t.getters,rootState:t.state},e);return y(r)||(r=Promise.resolve(r)),t._devtoolHook?r.catch((function(e){throw t._devtoolHook.emit("vuex:error",e),e})):r}))}function A(t,e,n,i){t._wrappedGetters[e]||(t._wrappedGetters[e]=function(t){return n(i.state,i.getters,t.state,t.getters)})}function C(t){(0,i.wB)((function(){return t._state.data}),(function(){0}),{deep:!0,flush:"sync"})}function R(t,e){return e.reduce((function(t,e){return t[e]}),t)}function I(t,e,n){return v(t)&&t.type&&(n=e,e=t,t=t.type),{type:t,payload:e,options:n}}var D="vuex bindings",O="vuex:mutations",z="vuex:actions",N="vuex",k=0;function U(t,e){m({id:"org.vuejs.vuex",app:t,label:"Vuex",homepage:"https://next.vuex.vuejs.org/",logo:"https://vuejs.org/images/icons/favicon-96x96.png",packageName:"vuex",componentStateTypes:[D]},(function(n){n.addTimelineLayer({id:O,label:"Vuex Mutations",color:B}),n.addTimelineLayer({id:z,label:"Vuex Actions",color:B}),n.addInspector({id:N,label:"Vuex",icon:"storage",treeFilterPlaceholder:"Filter stores..."}),n.on.getInspectorTree((function(n){if(n.app===t&&n.inspectorId===N)if(n.filter){var i=[];j(i,e._modules.root,n.filter,""),n.rootNodes=i}else n.rootNodes=[G(e._modules.root,"")]})),n.on.getInspectorState((function(n){if(n.app===t&&n.inspectorId===N){var i=n.nodeId;E(e,i),n.state=Z(X(e._modules,i),"root"===i?e.getters:e._makeLocalGettersCache,i)}})),n.on.editInspectorState((function(n){if(n.app===t&&n.inspectorId===N){var i=n.nodeId,r=n.path;"root"!==i&&(r=i.split("/").filter(Boolean).concat(r)),e._withCommit((function(){n.set(e._state.data,r,n.state.value)}))}})),e.subscribe((function(t,e){var i={};t.payload&&(i.payload=t.payload),i.state=e,n.notifyComponentUpdate(),n.sendInspectorTree(N),n.sendInspectorState(N),n.addTimelineEvent({layerId:O,event:{time:Date.now(),title:t.type,data:i}})})),e.subscribeAction({before:function(t,e){var i={};t.payload&&(i.payload=t.payload),t._id=k++,t._time=Date.now(),i.state=e,n.addTimelineEvent({layerId:z,event:{time:t._time,title:t.type,groupId:t._id,subtitle:"start",data:i}})},after:function(t,e){var i={},r=Date.now()-t._time;i.duration={_custom:{type:"duration",display:r+"ms",tooltip:"Action duration",value:r}},t.payload&&(i.payload=t.payload),i.state=e,n.addTimelineEvent({layerId:z,event:{time:Date.now(),title:t.type,groupId:t._id,subtitle:"end",data:i}})}})}))}var B=8702998,F=6710886,V=16777215,H={label:"namespaced",textColor:V,backgroundColor:F};function W(t){return t&&"root"!==t?t.split("/").slice(-2,-1)[0]:"Root"}function G(t,e){return{id:e||"root",label:W(e),tags:t.namespaced?[H]:[],children:Object.keys(t._children).map((function(n){return G(t._children[n],e+n+"/")}))}}function j(t,e,n,i){i.includes(n)&&t.push({id:i||"root",label:i.endsWith("/")?i.slice(0,i.length-1):i||"Root",tags:e.namespaced?[H]:[]}),Object.keys(e._children).forEach((function(r){j(t,e._children[r],n,i+r+"/")}))}function Z(t,e,n){e="root"===n?e:e[n];var i=Object.keys(e),r={state:Object.keys(t.state).map((function(e){return{key:e,editable:!0,value:t.state[e]}}))};if(i.length){var o=q(e);r.getters=Object.keys(o).map((function(t){return{key:t.endsWith("/")?W(t):t,editable:!1,value:Y((function(){return o[t]}))}}))}return r}function q(t){var e={};return Object.keys(t).forEach((function(n){var i=n.split("/");if(i.length>1){var r=e,o=i.pop();i.forEach((function(t){r[t]||(r[t]={_custom:{value:{},display:t,tooltip:"Module",abstract:!0}}),r=r[t]._custom.value})),r[o]=Y((function(){return t[n]}))}else e[n]=Y((function(){return t[n]}))})),e}function X(t,e){var n=e.split("/").filter((function(t){return t}));return n.reduce((function(t,i,r){var o=t[i];if(!o)throw new Error('Missing module "'+i+'" for path "'+e+'".');return r===n.length-1?o:o._children}),"root"===e?t:t.root._children)}function Y(t){try{return t()}catch(e){return e}}var K=function(t,e){this.runtime=e,this._children=Object.create(null),this._rawModule=t;var n=t.state;this.state=("function"===typeof n?n():n)||{}},J={namespaced:{configurable:!0}};J.namespaced.get=function(){return!!this._rawModule.namespaced},K.prototype.addChild=function(t,e){this._children[t]=e},K.prototype.removeChild=function(t){delete this._children[t]},K.prototype.getChild=function(t){return this._children[t]},K.prototype.hasChild=function(t){return t in this._children},K.prototype.update=function(t){this._rawModule.namespaced=t.namespaced,t.actions&&(this._rawModule.actions=t.actions),t.mutations&&(this._rawModule.mutations=t.mutations),t.getters&&(this._rawModule.getters=t.getters)},K.prototype.forEachChild=function(t){_(this._children,t)},K.prototype.forEachGetter=function(t){this._rawModule.getters&&_(this._rawModule.getters,t)},K.prototype.forEachAction=function(t){this._rawModule.actions&&_(this._rawModule.actions,t)},K.prototype.forEachMutation=function(t){this._rawModule.mutations&&_(this._rawModule.mutations,t)},Object.defineProperties(K.prototype,J);var $=function(t){this.register([],t,!1)};function Q(t,e,n){if(e.update(n),n.modules)for(var i in n.modules){if(!e.getChild(i))return void 0;Q(t.concat(i),e.getChild(i),n.modules[i])}}$.prototype.get=function(t){return t.reduce((function(t,e){return t.getChild(e)}),this.root)},$.prototype.getNamespace=function(t){var e=this.root;return t.reduce((function(t,n){return e=e.getChild(n),t+(e.namespaced?n+"/":"")}),"")},$.prototype.update=function(t){Q([],this.root,t)},$.prototype.register=function(t,e,n){var i=this;void 0===n&&(n=!0);var r=new K(e,n);if(0===t.length)this.root=r;else{var o=this.get(t.slice(0,-1));o.addChild(t[t.length-1],r)}e.modules&&_(e.modules,(function(e,r){i.register(t.concat(r),e,n)}))},$.prototype.unregister=function(t){var e=this.get(t.slice(0,-1)),n=t[t.length-1],i=e.getChild(n);i&&i.runtime&&e.removeChild(n)},$.prototype.isRegistered=function(t){var e=this.get(t.slice(0,-1)),n=t[t.length-1];return!!e&&e.hasChild(n)};var tt=function(t){var e=this;void 0===t&&(t={});var n=t.plugins;void 0===n&&(n=[]);var i=t.strict;void 0===i&&(i=!1);var r=t.devtools;this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new $(t),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._makeLocalGettersCache=Object.create(null),this._scope=null,this._devtools=r;var o=this,a=this,s=a.dispatch,l=a.commit;this.dispatch=function(t,e){return s.call(o,t,e)},this.commit=function(t,e,n){return l.call(o,t,e,n)},this.strict=i;var u=this._modules.root.state;S(this,u,[],this._modules.root),w(this,u),n.forEach((function(t){return t(e)}))},et={state:{configurable:!0}};tt.prototype.install=function(t,e){t.provide(e||g,this),t.config.globalProperties.$store=this;var n=void 0!==this._devtools&&this._devtools;n&&U(t,this)},et.state.get=function(){return this._state.data},et.state.set=function(t){0},tt.prototype.commit=function(t,e,n){var i=this,r=I(t,e,n),o=r.type,a=r.payload,s=(r.options,{type:o,payload:a}),l=this._mutations[o];l&&(this._withCommit((function(){l.forEach((function(t){t(a)}))})),this._subscribers.slice().forEach((function(t){return t(s,i.state)})))},tt.prototype.dispatch=function(t,e){var n=this,i=I(t,e),r=i.type,o=i.payload,a={type:r,payload:o},s=this._actions[r];if(s){try{this._actionSubscribers.slice().filter((function(t){return t.before})).forEach((function(t){return t.before(a,n.state)}))}catch(u){0}var l=s.length>1?Promise.all(s.map((function(t){return t(o)}))):s[0](o);return new Promise((function(t,e){l.then((function(e){try{n._actionSubscribers.filter((function(t){return t.after})).forEach((function(t){return t.after(a,n.state)}))}catch(u){0}t(e)}),(function(t){try{n._actionSubscribers.filter((function(t){return t.error})).forEach((function(e){return e.error(a,n.state,t)}))}catch(u){0}e(t)}))}))}},tt.prototype.subscribe=function(t,e){return b(t,this._subscribers,e)},tt.prototype.subscribeAction=function(t,e){var n="function"===typeof t?{before:t}:t;return b(n,this._actionSubscribers,e)},tt.prototype.watch=function(t,e,n){var r=this;return(0,i.wB)((function(){return t(r.state,r.getters)}),e,Object.assign({},n))},tt.prototype.replaceState=function(t){var e=this;this._withCommit((function(){e._state.data=t}))},tt.prototype.registerModule=function(t,e,n){void 0===n&&(n={}),"string"===typeof t&&(t=[t]),this._modules.register(t,e),S(this,this.state,t,this._modules.get(t),n.preserveState),w(this,this.state)},tt.prototype.unregisterModule=function(t){var e=this;"string"===typeof t&&(t=[t]),this._modules.unregister(t),this._withCommit((function(){var n=R(e.state,t.slice(0,-1));delete n[t[t.length-1]]})),M(this)},tt.prototype.hasModule=function(t){return"string"===typeof t&&(t=[t]),this._modules.isRegistered(t)},tt.prototype.hotUpdate=function(t){this._modules.update(t),M(this,!0)},tt.prototype._withCommit=function(t){var e=this._committing;this._committing=!0,t(),this._committing=e},Object.defineProperties(tt.prototype,et);var nt=lt((function(t,e){var n={};return at(e).forEach((function(e){var i=e.key,r=e.val;n[i]=function(){var e=this.$store.state,n=this.$store.getters;if(t){var i=ut(this.$store,"mapState",t);if(!i)return;e=i.context.state,n=i.context.getters}return"function"===typeof r?r.call(this,e,n):e[r]},n[i].vuex=!0})),n})),it=lt((function(t,e){var n={};return at(e).forEach((function(e){var i=e.key,r=e.val;n[i]=function(){var e=[],n=arguments.length;while(n--)e[n]=arguments[n];var i=this.$store.commit;if(t){var o=ut(this.$store,"mapMutations",t);if(!o)return;i=o.context.commit}return"function"===typeof r?r.apply(this,[i].concat(e)):i.apply(this.$store,[r].concat(e))}})),n})),rt=lt((function(t,e){var n={};return at(e).forEach((function(e){var i=e.key,r=e.val;r=t+r,n[i]=function(){if(!t||ut(this.$store,"mapGetters",t))return this.$store.getters[r]},n[i].vuex=!0})),n})),ot=lt((function(t,e){var n={};return at(e).forEach((function(e){var i=e.key,r=e.val;n[i]=function(){var e=[],n=arguments.length;while(n--)e[n]=arguments[n];var i=this.$store.dispatch;if(t){var o=ut(this.$store,"mapActions",t);if(!o)return;i=o.context.dispatch}return"function"===typeof r?r.apply(this,[i].concat(e)):i.apply(this.$store,[r].concat(e))}})),n}));function at(t){return st(t)?Array.isArray(t)?t.map((function(t){return{key:t,val:t}})):Object.keys(t).map((function(e){return{key:e,val:t[e]}})):[]}function st(t){return Array.isArray(t)||v(t)}function lt(t){return function(e,n){return"string"!==typeof e?(n=e,e=""):"/"!==e.charAt(e.length-1)&&(e+="/"),t(e,n)}}function ut(t,e,n){var i=t._modulesNamespaceMap[n];return i}},85:function(t,e,n){"use strict";n.d(e,{KU:function(){return o}});var i=n(437);
|
|
21
|
-
/*! *****************************************************************************
|
|
22
|
-
Copyright (c) Microsoft Corporation.
|
|
23
|
-
|
|
24
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
25
|
-
purpose with or without fee is hereby granted.
|
|
26
|
-
|
|
27
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
28
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
29
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
30
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
31
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
32
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
33
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
34
|
-
***************************************************************************** */function r(t,e,n,i){function r(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,o){function a(t){try{l(i.next(t))}catch(e){o(e)}}function s(t){try{l(i["throw"](t))}catch(e){o(e)}}function l(t){t.done?n(t.value):r(t.value).then(a,s)}l((i=i.apply(t,e||[])).next())}))}class o{constructor(){this.name="",this.minZoom=0,this.maxZoom=20,this.bounds=[],this.center=[]}fetchTile(t,e,n){return null}getMetaData(){return r(this,void 0,void 0,(function*(){}))}}class a extends o{constructor(t="https://a.tile.openstreetmap.org/"){super(),this.address=t,this.format="png",this.maxZoom=19}fetchTile(t,e,n){return new Promise(((i,r)=>{const o=document.createElement("img");o.onload=function(){i(o)},o.onerror=function(){r()},o.crossOrigin="Anonymous",o.src=this.address+t+"/"+e+"/"+n+"."+this.format}))}}class s{static createOffscreenCanvas(t,e){if("undefined"!==typeof OffscreenCanvas)return new OffscreenCanvas(t,e);{let n=document.createElement("canvas");return n.width=t,n.height=e,n}}}class l{static createFillTexture(t="#000000",e=1,n=1){const r=s.createOffscreenCanvas(e,n),o=r.getContext("2d");o.fillStyle=t,o.fillRect(0,0,e,n);const a=new i.gPd(r);return a.format=i.GWd,a.magFilter=i.k6q,a.minFilter=i.k6q,a.generateMipmaps=!1,a.needsUpdate=!0,a}}class u{}u.root=-1,u.topLeft=0,u.topRight=1,u.bottomLeft=2,u.bottomRight=3;class h extends i.eaF{constructor(t=null,e=null,n=u.root,i=0,r=0,o=0,a=null,s=null){super(a,s),this.mapView=null,this.parentNode=null,this.subdivided=!1,this.disposed=!1,this.nodesLoaded=0,this.childrenCache=null,this.isMesh=!0,this.mapView=e,this.parentNode=t,this.disposed=!1,this.location=n,this.level=i,this.x=r,this.y=o,this.initialize()}initialize(){return r(this,void 0,void 0,(function*(){}))}createChildNodes(){}subdivide(){const t=this.mapView.maxZoom();this.children.length>0||this.level+1>t||null!==this.parentNode&&this.parentNode.nodesLoaded<h.childrens||(this.mapView.cacheTiles&&null!==this.childrenCache?(this.isMesh=!1,this.children=this.childrenCache,this.nodesLoaded=this.childrenCache.length):this.createChildNodes(),this.subdivided=!0)}simplify(){const t=this.mapView.minZoom();if(!(this.level-1<t)){if(this.mapView.cacheTiles)this.childrenCache=this.children;else for(let t=0;t<this.children.length;t++)this.children[t].dispose();this.subdivided=!1,this.isMesh=!0,this.children=[],this.nodesLoaded=0}}loadData(){return r(this,void 0,void 0,(function*(){if(this.level<this.mapView.provider.minZoom||this.level>this.mapView.provider.maxZoom)return console.warn("Geo-Three: Loading tile outside of provider range.",this),this.material.map=h.defaultTexture,void(this.material.needsUpdate=!0);try{const t=yield this.mapView.provider.fetchTile(this.level,this.x,this.y);if(this.disposed)return;const e=new i.gPd(t);e.generateMipmaps=!1,e.format=i.GWd,e.magFilter=i.k6q,e.minFilter=i.k6q,e.needsUpdate=!0,this.material.map=e}catch(t){if(this.disposed)return;console.warn("Geo-Three: Failed to load node tile data.",this),this.material.map=h.defaultTexture}this.material.needsUpdate=!0}))}nodeReady(){if(this.disposed)return console.warn("Geo-Three: nodeReady() called for disposed node.",this),void this.dispose();if(null!==this.parentNode){if(this.parentNode.nodesLoaded++,this.parentNode.nodesLoaded===h.childrens){!0===this.parentNode.subdivided&&(this.parentNode.isMesh=!1);for(let t=0;t<this.parentNode.children.length;t++)this.parentNode.children[t].visible=!0}this.parentNode.nodesLoaded>h.childrens&&console.error("Geo-Three: Loaded more children objects than expected.",this.parentNode.nodesLoaded,this)}else this.visible=!0}dispose(){this.disposed=!0;const t=this;try{const e=t.material;e.dispose()}catch(e){}try{t.geometry.dispose()}catch(e){}}}h.defaultTexture=l.createFillTexture(),h.baseGeometry=null,h.baseScale=null,h.childrens=4;class c extends i.LoY{constructor(t=1,e=1,n=1,r=1,o=!1,a=10){super();const s=[],l=[],u=[],h=[];c.buildPlane(t,e,n,r,s,l,u,h),o&&c.buildSkirt(t,e,n,r,a,s,l,u,h),this.setIndex(s),this.setAttribute("position",new i.qtW(l,3)),this.setAttribute("normal",new i.qtW(u,3)),this.setAttribute("uv",new i.qtW(h,2))}static buildPlane(t=1,e=1,n=1,i=1,r,o,a,s){const l=t/2,u=e/2,h=n+1,c=i+1,d=t/n,p=e/i;for(let f=0;f<c;f++){const t=f*p-u;for(let e=0;e<h;e++){const r=e*d-l;o.push(r,0,t),a.push(0,1,0),s.push(e/n,1-f/i)}}for(let f=0;f<i;f++)for(let t=0;t<n;t++){const e=t+h*f,n=t+h*(f+1),i=t+1+h*(f+1),o=t+1+h*f;r.push(e,n,o,n,i,o)}}static buildSkirt(t=1,e=1,n=1,i=1,r,o,a,s,l){const u=t/2,h=e/2,c=n+1,d=i+1,p=t/n,f=e/i;let m=a.length/3;for(let _=0;_<c;_++){const t=_*p-u,e=-h;a.push(t,-r,e),s.push(0,1,0),l.push(_/n,1)}for(let _=0;_<n;_++){const t=_,e=_+1,n=_+m,i=_+m+1;o.push(e,n,t,e,i,n)}m=a.length/3;for(let _=0;_<c;_++){const t=_*p-u,e=i*f-h;a.push(t,-r,e),s.push(0,1,0),l.push(_/n,0)}let g=c*d-n-1;for(let _=0;_<n;_++){const t=g+_,e=g+_+1,n=_+m,i=_+m+1;o.push(t,n,e,n,i,e)}m=a.length/3;for(let _=0;_<d;_++){const t=_*f-h,e=-u;a.push(e,-r,t),s.push(0,1,0),l.push(0,1-_/i)}for(let _=0;_<i;_++){const t=_*d,e=(_+1)*d,n=_+m,i=_+m+1;o.push(t,n,e,n,i,e)}m=a.length/3;for(let _=0;_<d;_++){const t=_*f-h,e=n*p-u;a.push(e,-r,t),s.push(0,1,0),l.push(1,1-_/i)}for(let _=0;_<i;_++){const t=_*d+i,e=(_+1)*d+i,n=_+m,r=_+m+1;o.push(e,n,t,e,r,n)}}}class d{constructor(t,e){this.latitude=t,this.longitude=e}}class p{static datumsToSpherical(t,e){const n=e*p.EARTH_ORIGIN/180;let r=Math.log(Math.tan((90+t)*Math.PI/360))/(Math.PI/180);return r=r*p.EARTH_ORIGIN/180,new i.I9Y(n,r)}static sphericalToDatums(t,e){const n=t/p.EARTH_ORIGIN*180;let i=e/p.EARTH_ORIGIN*180;return i=180/Math.PI*(2*Math.atan(Math.exp(i*Math.PI/180))-Math.PI/2),new d(i,n)}static quadtreeToDatums(t,e,n){const i=Math.pow(2,t),r=e/i*360-180,o=Math.atan(Math.sinh(Math.PI*(1-2*n/i))),a=o/Math.PI*180;return new d(a,r)}static vectorToDatums(t){const e=180/Math.PI,n=Math.atan2(t.y,Math.sqrt(Math.pow(t.x,2)+Math.pow(-t.z,2)))*e,i=Math.atan2(-t.z,t.x)*e;return new d(n,i)}static datumsToVector(t,e){const n=Math.PI/180,r=e*n,o=t*n;var a=Math.cos(o);return new i.Pq0(-Math.cos(r+Math.PI)*a,Math.sin(o),Math.sin(r+Math.PI)*a)}static mapboxAltitude(t){return.1*(255*t.r*65536+255*t.g*256+255*t.b)-1e4}}p.EARTH_RADIUS=6371008,p.EARTH_RADIUS_A=6378137,p.EARTH_RADIUS_B=6356752.314245,p.EARTH_PERIMETER=2*Math.PI*p.EARTH_RADIUS,p.EARTH_ORIGIN=p.EARTH_PERIMETER/2;class f extends h{constructor(t=null,e=null,n=u.root,r=0,o=0,a=0){super(t,e,n,r,o,a,f.geometry,new i.V9B({wireframe:!1})),this.matrixAutoUpdate=!1,this.isMesh=!0,this.visible=!1}initialize(){const t=Object.create(null,{initialize:{get:()=>super.initialize}});return r(this,void 0,void 0,(function*(){t.initialize.call(this),yield this.loadData(),this.nodeReady()}))}createChildNodes(){const t=this.level+1,e=2*this.x,n=2*this.y,i=Object.getPrototypeOf(this).constructor;let r=new i(this,this.mapView,u.topLeft,t,e,n);r.scale.set(.5,1,.5),r.position.set(-.25,0,-.25),this.add(r),r.updateMatrix(),r.updateMatrixWorld(!0),r=new i(this,this.mapView,u.topRight,t,e+1,n),r.scale.set(.5,1,.5),r.position.set(.25,0,-.25),this.add(r),r.updateMatrix(),r.updateMatrixWorld(!0),r=new i(this,this.mapView,u.bottomLeft,t,e,n+1),r.scale.set(.5,1,.5),r.position.set(-.25,0,.25),this.add(r),r.updateMatrix(),r.updateMatrixWorld(!0),r=new i(this,this.mapView,u.bottomRight,t,e+1,n+1),r.scale.set(.5,1,.5),r.position.set(.25,0,.25),this.add(r),r.updateMatrix(),r.updateMatrixWorld(!0)}raycast(t,e){!0===this.isMesh&&super.raycast(t,e)}}f.geometry=new c(1,1,1,1,!1),f.baseGeometry=f.geometry,f.baseScale=new i.Pq0(p.EARTH_PERIMETER,1,p.EARTH_PERIMETER);class m extends i.LoY{constructor(t=1,e=1,n=1,r=1,o=!1,a=10,s=null,l=!0){super();const u=[],h=[],d=[],p=[];c.buildPlane(t,e,n,r,u,h,d,p);const f=s.data;for(let i=0,c=0;i<f.length&&c<h.length;i+=4,c+=3){const t=f[i],e=f[i+1],n=f[i+2],r=.1*(65536*t+256*e+n)-1e4;h[c+1]=r}o&&c.buildSkirt(t,e,n,r,a,u,h,d,p),this.setIndex(u),this.setAttribute("position",new i.qtW(h,3)),this.setAttribute("normal",new i.qtW(d,3)),this.setAttribute("uv",new i.qtW(p,2)),l&&this.computeNormals(n,r)}computeNormals(t,e){const n=this.getAttribute("position");if(void 0!==n){let r=this.getAttribute("normal");const o=e*t;for(let t=0;t<o;t++)r.setXYZ(t,0,0,0);const a=new i.Pq0,s=new i.Pq0,l=new i.Pq0,u=new i.Pq0,h=new i.Pq0,c=new i.Pq0,d=new i.Pq0,p=new i.Pq0,f=e*t*6;for(let t=0;t<f;t+=3){const e=this.index.getX(t+0),i=this.index.getX(t+1),o=this.index.getX(t+2);a.fromBufferAttribute(n,e),s.fromBufferAttribute(n,i),l.fromBufferAttribute(n,o),d.subVectors(l,s),p.subVectors(a,s),d.cross(p),u.fromBufferAttribute(r,e),h.fromBufferAttribute(r,i),c.fromBufferAttribute(r,o),u.add(d),h.add(d),c.add(d),r.setXYZ(e,u.x,u.y,u.z),r.setXYZ(i,h.x,h.y,h.z),r.setXYZ(o,c.x,c.y,c.z)}this.normalizeNormals(),r.needsUpdate=!0}}}class g extends h{constructor(t=null,e=null,n=u.root,r=0,o=0,a=0,s=g.geometry,l=new i.tXL({wireframe:!1,color:16777215})){super(t,e,n,r,o,a,s,l),this.heightLoaded=!1,this.textureLoaded=!1,this.geometrySize=16,this.geometryNormals=!1,this.isMesh=!0,this.visible=!1,this.matrixAutoUpdate=!1}initialize(){const t=Object.create(null,{initialize:{get:()=>super.initialize}});return r(this,void 0,void 0,(function*(){t.initialize.call(this),yield this.loadData(),yield this.loadHeightGeometry(),this.nodeReady()}))}loadData(){const t=Object.create(null,{loadData:{get:()=>super.loadData}});return r(this,void 0,void 0,(function*(){yield t.loadData.call(this),this.textureLoaded=!0}))}loadHeightGeometry(){return r(this,void 0,void 0,(function*(){if(null===this.mapView.heightProvider)throw new Error("GeoThree: MapView.heightProvider provider is null.");if(this.level<this.mapView.heightProvider.minZoom||this.level>this.mapView.heightProvider.maxZoom)return console.warn("Geo-Three: Loading tile outside of provider range.",this),void(this.geometry=f.baseGeometry);try{const t=yield this.mapView.heightProvider.fetchTile(this.level,this.x,this.y);if(this.disposed)return;const e=s.createOffscreenCanvas(this.geometrySize+1,this.geometrySize+1),n=e.getContext("2d");n.imageSmoothingEnabled=!1,n.drawImage(t,0,0,g.tileSize,g.tileSize,0,0,e.width,e.height);const i=n.getImageData(0,0,e.width,e.height);this.geometry=new m(1,1,this.geometrySize,this.geometrySize,!0,10,i,!0)}catch(t){if(this.disposed)return;this.geometry=f.baseGeometry}this.heightLoaded=!0}))}createChildNodes(){const t=this.level+1,e=Object.getPrototypeOf(this).constructor,n=2*this.x,i=2*this.y;let r=new e(this,this.mapView,u.topLeft,t,n,i);r.scale.set(.5,1,.5),r.position.set(-.25,0,-.25),this.add(r),r.updateMatrix(),r.updateMatrixWorld(!0),r=new e(this,this.mapView,u.topRight,t,n+1,i),r.scale.set(.5,1,.5),r.position.set(.25,0,-.25),this.add(r),r.updateMatrix(),r.updateMatrixWorld(!0),r=new e(this,this.mapView,u.bottomLeft,t,n,i+1),r.scale.set(.5,1,.5),r.position.set(-.25,0,.25),this.add(r),r.updateMatrix(),r.updateMatrixWorld(!0),r=new e(this,this.mapView,u.bottomRight,t,n+1,i+1),r.scale.set(.5,1,.5),r.position.set(.25,0,.25),this.add(r),r.updateMatrix(),r.updateMatrixWorld(!0)}raycast(t,e){!0===this.isMesh&&super.raycast(t,e)}}g.tileSize=256,g.geometry=new c(1,1,1,1),g.baseGeometry=f.geometry,g.baseScale=new i.Pq0(p.EARTH_PERIMETER,1,p.EARTH_PERIMETER);class _ extends i.LoY{constructor(t,e,n,r,o,a,s){super();const l=a+s;let u=0;const h=[],c=new i.Pq0,d=new i.Pq0,p=[],f=[],m=[],g=[];for(let i=0;i<=n;i++){const l=[],p=i/n;for(let n=0;n<=e;n++){const i=n/e;c.x=-t*Math.cos(r+i*o)*Math.sin(a+p*s),c.y=t*Math.cos(a+p*s),c.z=t*Math.sin(r+i*o)*Math.sin(a+p*s),f.push(c.x,c.y,c.z),d.set(c.x,c.y,c.z).normalize(),m.push(d.x,d.y,d.z),g.push(i,1-p),l.push(u++)}h.push(l)}for(let i=0;i<n;i++)for(let t=0;t<e;t++){const e=h[i][t+1],r=h[i][t],o=h[i+1][t],s=h[i+1][t+1];(0!==i||a>0)&&p.push(e,r,s),(i!==n-1||l<Math.PI)&&p.push(r,o,s)}this.setIndex(p),this.setAttribute("position",new i.qtW(f,3)),this.setAttribute("normal",new i.qtW(m,3)),this.setAttribute("uv",new i.qtW(g,2))}}class v extends h{constructor(t=null,e=null,n=u.root,r=0,o=0,a=0){super(t,e,n,r,o,a,v.createGeometry(r,o,a),new i.V9B({wireframe:!1})),this.applyScaleNode(),this.matrixAutoUpdate=!1,this.isMesh=!0,this.visible=!1}initialize(){const t=Object.create(null,{initialize:{get:()=>super.initialize}});return r(this,void 0,void 0,(function*(){t.initialize.call(this),yield this.loadData(),this.nodeReady()}))}static createGeometry(t,e,n){const i=Math.pow(2,t),r=40,o=Math.floor(v.segments*(r/(t+1))/r),a=1/i*2*Math.PI,s=e*a,l=1/i*Math.PI,u=n*l;return new _(1,o,o,s,a,u,l)}applyScaleNode(){this.geometry.computeBoundingBox();const t=this.geometry.boundingBox.clone(),e=t.getCenter(new i.Pq0),n=new i.kn4;n.compose(new i.Pq0(-e.x,-e.y,-e.z),new i.PTz,new i.Pq0(p.EARTH_RADIUS,p.EARTH_RADIUS,p.EARTH_RADIUS)),this.geometry.applyMatrix4(n),this.position.copy(e),this.updateMatrix(),this.updateMatrixWorld()}updateMatrix(){this.matrix.setPosition(this.position),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t=!1){(this.matrixWorldNeedsUpdate||t)&&(this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1)}createChildNodes(){const t=this.level+1,e=2*this.x,n=2*this.y,i=Object.getPrototypeOf(this).constructor;let r=new i(this,this.mapView,u.topLeft,t,e,n);this.add(r),r=new i(this,this.mapView,u.topRight,t,e+1,n),this.add(r),r=new i(this,this.mapView,u.bottomLeft,t,e,n+1),this.add(r),r=new i(this,this.mapView,u.bottomRight,t,e+1,n+1),this.add(r)}raycast(t,e){!0===this.isMesh&&super.raycast(t,e)}}v.baseGeometry=new _(p.EARTH_RADIUS,64,64,0,2*Math.PI,0,Math.PI),v.baseScale=new i.Pq0(1,1,1),v.segments=80;class y extends g{constructor(t=null,e=null,n=u.root,r=0,o=0,a=0){const s=y.prepareMaterial(new i.tXL({map:h.defaultTexture,color:16777215}));super(t,e,n,r,o,a,y.geometry,s),this.frustumCulled=!1}static prepareMaterial(t){return t.userData={heightMap:{value:y.defaultHeightTexture}},t.onBeforeCompile=e=>{for(const n in t.userData)e.uniforms[n]=t.userData[n];e.vertexShader="\n\t\t\tuniform sampler2D heightMap;\n\t\t\t"+e.vertexShader,e.vertexShader=e.vertexShader.replace("#include <fog_vertex>","\n\t\t\t#include <fog_vertex>\n\t\n\t\t\t// Calculate height of the title\n\t\t\tvec4 _theight = texture2D(heightMap, vUv);\n\t\t\tfloat _height = ((_theight.r * 255.0 * 65536.0 + _theight.g * 255.0 * 256.0 + _theight.b * 255.0) * 0.1) - 10000.0;\n\t\t\tvec3 _transformed = position + _height * normal;\n\t\n\t\t\t// Vertex position based on height\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4(_transformed, 1.0);\n\t\t\t")},t}loadData(){const t=Object.create(null,{loadData:{get:()=>super.loadData}});return r(this,void 0,void 0,(function*(){yield t.loadData.call(this),this.textureLoaded=!0}))}loadHeightGeometry(){return r(this,void 0,void 0,(function*(){if(null===this.mapView.heightProvider)throw new Error("GeoThree: MapView.heightProvider provider is null.");if(this.level<this.mapView.heightProvider.minZoom||this.level>this.mapView.heightProvider.maxZoom)return console.warn("Geo-Three: Loading tile outside of provider range.",this),this.material.map=y.defaultTexture,void(this.material.needsUpdate=!0);try{const t=yield this.mapView.heightProvider.fetchTile(this.level,this.x,this.y);if(this.disposed)return;const e=new i.gPd(t);e.generateMipmaps=!1,e.format=i.GWd,e.magFilter=i.hxR,e.minFilter=i.hxR,e.needsUpdate=!0,this.material.userData.heightMap.value=e}catch(t){if(this.disposed)return;console.error("Geo-Three: Failed to load node tile height data.",this),this.material.userData.heightMap.value=y.defaultHeightTexture}this.material.needsUpdate=!0,this.heightLoaded=!0}))}raycast(t,e){!0===this.isMesh&&(this.geometry=f.geometry,super.raycast(t,e),this.geometry=y.geometry)}}y.defaultHeightTexture=l.createFillTexture("#0186C0"),y.geometrySize=256,y.geometry=new c(1,1,y.geometrySize,y.geometrySize,!0),y.baseGeometry=f.geometry,y.baseScale=new i.Pq0(p.EARTH_PERIMETER,1,p.EARTH_PERIMETER);class x{constructor(){this.subdivisionRays=1,this.thresholdUp=.6,this.thresholdDown=.15,this.raycaster=new i.tBo,this.mouse=new i.I9Y,this.powerDistance=!1,this.scaleDistance=!0}updateLOD(t,e,n,r){const o=[];for(let i=0;i<this.subdivisionRays;i++)this.mouse.set(2*Math.random()-1,2*Math.random()-1),this.raycaster.setFromCamera(this.mouse,e),this.raycaster.intersectObjects(t.children,!0,o);for(let a=0;a<o.length;a++){const t=o[a].object;let e=o[a].distance;if(this.powerDistance&&(e=Math.pow(2*e,t.level)),this.scaleDistance){const n=t.matrixWorld.elements,r=new i.Pq0(n[0],n[1],n[2]);e=r.length()/e}e>this.thresholdUp?t.subdivide():e<this.thresholdDown&&t.parentNode&&t.parentNode.simplify()}}}class b{constructor(t=257){this.gridSize=t;const e=t-1;if(e&e-1)throw new Error(`Expected grid size to be 2^n+1, got ${t}.`);this.numTriangles=e*e*2-2,this.numParentTriangles=this.numTriangles-e*e,this.indices=new Uint32Array(this.gridSize*this.gridSize),this.coords=new Uint16Array(4*this.numTriangles);for(let n=0;n<this.numTriangles;n++){let t=n+2,i=0,r=0,o=0,a=0,s=0,l=0;1&t?o=a=s=e:i=r=l=e;while((t>>=1)>1){const e=i+o>>1,n=r+a>>1;1&t?(o=i,a=r,i=s,r=l):(i=o,r=a,o=s,a=l),s=e,l=n}const u=4*n;this.coords[u+0]=i,this.coords[u+1]=r,this.coords[u+2]=o,this.coords[u+3]=a}}createTile(t){return new M(t,this)}}class M{constructor(t,e){const n=e.gridSize;if(t.length!==n*n)throw new Error(`Expected terrain data of length ${n*n} (${n} x ${n}), got ${t.length}.`);this.terrain=t,this.martini=e,this.errors=new Float32Array(t.length),this.update()}update(){const{numTriangles:t,numParentTriangles:e,coords:n,gridSize:i}=this.martini,{terrain:r,errors:o}=this;for(let a=t-1;a>=0;a--){const t=4*a,s=n[t+0],l=n[t+1],u=n[t+2],h=n[t+3],c=s+u>>1,d=l+h>>1,p=c+d-l,f=d+s-c,m=(r[l*i+s]+r[h*i+u])/2,g=d*i+c,_=Math.abs(m-r[g]);if(o[g]=Math.max(o[g],_),a<e){const t=(l+f>>1)*i+(s+p>>1),e=(h+f>>1)*i+(u+p>>1);o[g]=Math.max(o[g],o[t],o[e])}}}getMesh(t=0,e=!1){const{gridSize:n,indices:i}=this.martini,{errors:r}=this;let o=0,a=0;const s=n-1;let l,u,h=0;const c=[],d=[],p=[],f=[];function m(g,_,v,y,x,b){const M=g+v>>1,w=_+y>>1;Math.abs(g-x)+Math.abs(_-b)>1&&r[w*n+M]>t?(m(x,b,g,_,M,w),m(v,y,x,b,M,w)):(l=_*n+g,u=y*n+v,h=b*n+x,0===i[l]&&(e&&(0===g?c.push(o):g===s&&d.push(o),0===_?p.push(o):_===s&&f.push(o)),i[l]=++o),0===i[u]&&(e&&(0===v?c.push(o):v===s&&d.push(o),0===y?p.push(o):y===s&&f.push(o)),i[u]=++o),0===i[h]&&(e&&(0===x?c.push(o):x===s&&d.push(o),0===b?p.push(o):b===s&&f.push(o)),i[h]=++o),a++)}i.fill(0),m(0,0,s,s,s,0),m(s,s,0,0,0,s);let g=2*o,_=3*a;e&&(g+=2*(c.length+d.length+p.length+f.length),_+=3*(2*(c.length-1)+2*(d.length-1)+2*(p.length-1)+2*(f.length-1)));const v=new Uint16Array(g),y=new Uint32Array(_);let x=0;function b(e,o,a,s,l,u){const h=e+a>>1,c=o+s>>1;if(Math.abs(e-l)+Math.abs(o-u)>1&&r[c*n+h]>t)b(l,u,e,o,h,c),b(a,s,l,u,h,c);else{const t=i[o*n+e]-1,r=i[s*n+a]-1,h=i[u*n+l]-1;v[2*t]=e,v[2*t+1]=o,v[2*r]=a,v[2*r+1]=s,v[2*h]=l,v[2*h+1]=u,y[x++]=t,y[x++]=r,y[x++]=h}}if(b(0,0,s,s,s,0),b(s,s,0,0,0,s),e){c.sort(((t,e)=>v[2*t+1]-v[2*e+1])),d.sort(((t,e)=>v[2*e+1]-v[2*t+1])),p.sort(((t,e)=>v[2*e]-v[2*t])),f.sort(((t,e)=>v[2*t]-v[2*e]));let M=2*o;function w(t){const e=t.length;for(let n=0;n<e-1;n++){const e=t[n],i=t[n+1],r=M/2,o=(M+2)/2;v[M++]=v[2*e],v[M++]=v[2*e+1],y[x++]=e,y[x++]=r,y[x++]=i,y[x++]=r,y[x++]=o,y[x++]=i}v[M++]=v[2*t[e-1]],v[M++]=v[2*t[e-1]+1]}w(c),w(d),w(p),w(f)}return{vertices:v,triangles:y,numVerticesWithoutSkirts:o}}}class w extends g{constructor(t=null,e=null,n=u.root,r=0,o=0,a=0,{elevationDecoder:s=null,meshMaxError:l=10,exageration:h=1}={}){super(t,e,n,r,o,a,w.geometry,w.prepareMaterial(new i.tXL({map:w.emptyTexture,color:16777215,side:i.$EB}),r,h)),this.elevationDecoder={rScaler:256,gScaler:1,bScaler:1/256,offset:-32768},this.exageration=1,this.meshMaxError=10,s&&(this.elevationDecoder=s),this.meshMaxError=l,this.exageration=h,this.frustumCulled=!1}static prepareMaterial(t,e,n=1){return t.userData={heightMap:{value:w.emptyTexture},drawNormals:{value:0},drawBlack:{value:0},zoomlevel:{value:e},computeNormals:{value:1},drawTexture:{value:1}},t.onBeforeCompile=e=>{for(let n in t.userData)e.uniforms[n]=t.userData[n];e.vertexShader="\n\t\t\t\tuniform bool computeNormals;\n\t\t\t\tuniform float zoomlevel;\n\t\t\t\tuniform sampler2D heightMap;\n\t\t\t\t"+e.vertexShader,e.fragmentShader="\n\t\t\t\tuniform bool drawNormals;\n\t\t\t\tuniform bool drawTexture;\n\t\t\t\tuniform bool drawBlack;\n\t\t\t\t"+e.fragmentShader,e.fragmentShader=e.fragmentShader.replace("#include <dithering_fragment>","\n\t\t\t\tif(drawBlack) {\n\t\t\t\t\tgl_FragColor = vec4( 0.0,0.0,0.0, 1.0 );\n\t\t\t\t} else if(drawNormals) {\n\t\t\t\t\tgl_FragColor = vec4( ( 0.5 * vNormal + 0.5 ), 1.0 );\n\t\t\t\t} else if (!drawTexture) {\n\t\t\t\t\tgl_FragColor = vec4( 0.0,0.0,0.0, 0.0 );\n\t\t\t\t}"),e.vertexShader=e.vertexShader.replace("#include <fog_vertex>","\n\t\t\t\t#include <fog_vertex>\n\n\t\t\t\t// queried pixels:\n\t\t\t\t// +-----------+\n\t\t\t\t// | | | |\n\t\t\t\t// | a | b | c |\n\t\t\t\t// | | | |\n\t\t\t\t// +-----------+\n\t\t\t\t// | | | |\n\t\t\t\t// | d | e | f |\n\t\t\t\t// | | | |\n\t\t\t\t// +-----------+\n\t\t\t\t// | | | |\n\t\t\t\t// | g | h | i |\n\t\t\t\t// | | | |\n\t\t\t\t// +-----------+\n\n\t\t\t\tif (computeNormals) {\n\t\t\t\t\tfloat e = getElevation(vUv, 0.0);\n\t\t\t\t\tivec2 size = textureSize(heightMap, 0);\n\t\t\t\t\tfloat offset = 1.0 / float(size.x);\n\t\t\t\t\tfloat a = getElevation(vUv + vec2(-offset, -offset), 0.0);\n\t\t\t\t\tfloat b = getElevation(vUv + vec2(0, -offset), 0.0);\n\t\t\t\t\tfloat c = getElevation(vUv + vec2(offset, -offset), 0.0);\n\t\t\t\t\tfloat d = getElevation(vUv + vec2(-offset, 0), 0.0);\n\t\t\t\t\tfloat f = getElevation(vUv + vec2(offset, 0), 0.0);\n\t\t\t\t\tfloat g = getElevation(vUv + vec2(-offset, offset), 0.0);\n\t\t\t\t\tfloat h = getElevation(vUv + vec2(0, offset), 0.0);\n\t\t\t\t\tfloat i = getElevation(vUv + vec2(offset,offset), 0.0);\n\n\n\t\t\t\t\tfloat normalLength = 500.0 / zoomlevel;\n\n\t\t\t\t\tvec3 v0 = vec3(0.0, 0.0, 0.0);\n\t\t\t\t\tvec3 v1 = vec3(0.0, normalLength, 0.0);\n\t\t\t\t\tvec3 v2 = vec3(normalLength, 0.0, 0.0);\n\t\t\t\t\tv0.z = (e + d + g + h) / 4.0;\n\t\t\t\t\tv1.z = (e+ b + a + d) / 4.0;\n\t\t\t\t\tv2.z = (e+ h + i + f) / 4.0;\n\t\t\t\t\tvNormal = (normalize(cross(v2 - v0, v1 - v0))).rbg;\n\t\t\t\t}\n\t\t\t\t")},t}static getTerrain(t,e,n){const{rScaler:i,bScaler:r,gScaler:o,offset:a}=n,s=e+1,l=new Float32Array(s*s);for(let u=0,h=0;h<e;h++)for(let n=0;n<e;n++,u++){const e=4*u,n=t[e+0],s=t[e+1],c=t[e+2];l[u+h]=n*i+s*o+c*r+a}for(let u=s*(s-1),h=0;h<s-1;h++,u++)l[u]=l[u-s];for(let u=s-1,h=0;h<s;h++,u+=s)l[u]=l[u-1];return l}static getMeshAttributes(t,e,n,i,r){const o=n+1,a=t.length/2,s=new Float32Array(3*a),l=new Float32Array(2*a),[u,h,c,d]=i||[0,0,n,n],p=(c-u)/n,f=(d-h)/n;for(let m=0;m<a;m++){const i=t[2*m],a=t[2*m+1],h=a*o+i;s[3*m+0]=i*p+u,s[3*m+1]=-e[h]*r,s[3*m+2]=-a*f+d,l[2*m+0]=i/n,l[2*m+1]=a/n}return{position:{value:s,size:3},uv:{value:l,size:2}}}processHeight(t){return r(this,void 0,void 0,(function*(){const e=t.width,n=e+1;var r=s.createOffscreenCanvas(e,e),o=r.getContext("2d");o.imageSmoothingEnabled=!1,o.drawImage(t,0,0,e,e,0,0,r.width,r.height);var a=o.getImageData(0,0,r.width,r.height),l=a.data;const u=w.getTerrain(l,e,this.elevationDecoder),h=new b(n),c=h.createTile(u),{vertices:d,triangles:p}=c.getMesh("function"===typeof this.meshMaxError?this.meshMaxError(this.level):this.meshMaxError),f=w.getMeshAttributes(d,u,e,[-.5,-.5,.5,.5],this.exageration);this.geometry=new i.LoY,this.geometry.setIndex(new i.MW4(p,1)),this.geometry.setAttribute("position",new i.qtW(f.position.value,f.position.size)),this.geometry.setAttribute("uv",new i.qtW(f.uv.value,f.uv.size)),this.geometry.rotateX(Math.PI);var m=new i.gPd(t);m.generateMipmaps=!1,m.format=i.GWd,m.magFilter=i.hxR,m.minFilter=i.hxR,m.needsUpdate=!0,this.material.userData.heightMap.value=m,this.material.map=m,this.material.needsUpdate=!0}))}loadHeightGeometry(){return r(this,void 0,void 0,(function*(){if(null===this.mapView.heightProvider)throw new Error("GeoThree: MapView.heightProvider provider is null.");const t=yield this.mapView.heightProvider.fetchTile(this.level,this.x,this.y);this.disposed||(this.processHeight(t),this.heightLoaded=!0,this.nodeReady())}))}}w.geometrySize=16,w.emptyTexture=new i.gPd,w.geometry=new c(1,1,1,1),w.tileSize=256;class S extends i.eaF{constructor(t=S.PLANAR,e=new a,n=null){super(void 0,new i.V9B({transparent:!0,opacity:0})),this.lod=null,this.provider=null,this.heightProvider=null,this.root=null,this.cacheTiles=!1,this.onBeforeRender=(t,e,n,i,r,o)=>{this.lod.updateLOD(this,n,t,e)},this.lod=new x,this.provider=e,this.heightProvider=n,this.setRoot(t),this.preSubdivide()}setRoot(t){if("number"===typeof t){if(!S.mapModes.has(t))throw new Error("Map mode "+t+" does is not registered.");const e=S.mapModes.get(t);t=new e(null,this)}null!==this.root&&(this.remove(this.root),this.root=null),this.root=t,null!==this.root&&(this.geometry=this.root.constructor.baseGeometry,this.scale.copy(this.root.constructor.baseScale),this.root.mapView=this,this.add(this.root),this.root.initialize())}preSubdivide(){var t,e;function n(t,e){if(!(e<=0)){t.subdivide();for(let i=0;i<t.children.length;i++)if(t.children[i]instanceof h){const r=t.children[i];n(r,e-1)}}}const i=Math.max(this.provider.minZoom,null!==(e=null===(t=this.heightProvider)||void 0===t?void 0:t.minZoom)&&void 0!==e?e:-1/0);i>0&&n(this.root,i)}setProvider(t){t!==this.provider&&(this.provider=t,this.clear())}setHeightProvider(t){t!==this.heightProvider&&(this.heightProvider=t,this.clear())}clear(){return this.traverse((function(t){t.childrenCache&&(t.childrenCache=null),t.initialize&&t.initialize()})),this}minZoom(){var t,e;return Math.max(this.provider.minZoom,null!==(e=null===(t=this.heightProvider)||void 0===t?void 0:t.minZoom)&&void 0!==e?e:-1/0)}maxZoom(){var t,e;return Math.min(this.provider.maxZoom,null!==(e=null===(t=this.heightProvider)||void 0===t?void 0:t.maxZoom)&&void 0!==e?e:1/0)}getMetaData(){this.provider.getMetaData()}raycast(t,e){return!1}}S.PLANAR=200,S.SPHERICAL=201,S.HEIGHT=202,S.HEIGHT_SHADER=203,S.MARTINI=204,S.mapModes=new Map([[S.PLANAR,f],[S.SPHERICAL,v],[S.HEIGHT,g],[S.HEIGHT_SHADER,y],[S.MARTINI,w]]);new i.Pq0,new i.Pq0;new i.kn4,new i.Pq0,new i.PPD,new i.Pq0;class T{static get(t){return r(this,void 0,void 0,(function*(){return new Promise((function(e,n){const i=new XMLHttpRequest;i.overrideMimeType("text/plain"),i.open("GET",t,!0),i.onload=function(){e(i.response)},i.onerror=n,i.send(null)}))}))}static getRaw(t){return r(this,void 0,void 0,(function*(){return new Promise((function(e,n){var i=new XMLHttpRequest;i.responseType="arraybuffer",i.open("GET",t,!0),i.onload=function(){e(i.response)},i.onerror=n,i.send(null)}))}))}static request(t,e,n,i,r,o,a){function s(t){try{return JSON.parse(t)}catch(e){return t}}const l=new XMLHttpRequest;if(l.overrideMimeType("text/plain"),l.open(e,t,!0),null!==n&&void 0!==n)for(const u in n)l.setRequestHeader(u,n[u]);return void 0!==r&&(l.onload=function(t){r(s(l.response),l)}),void 0!==o&&(l.onerror=o),void 0!==a&&(l.onprogress=a),l.send(void 0!==i?i:null),l}}class E extends o{constructor(t="",e=E.AERIAL){super(),this.maxZoom=19,this.minZoom=1,this.format="jpeg",this.mapSize=512,this.subdomain="t1",this.meta=null,this.apiKey=t,this.type=e}getMetaData(){return r(this,void 0,void 0,(function*(){const t=E.ADDRESS+"/REST/V1/Imagery/Metadata/RoadOnDemand?output=json&include=ImageryProviders&key="+this.apiKey,e=yield T.get(t);this.meta=JSON.parse(e)}))}static quadKey(t,e,n){let i="";for(let r=t;r>0;r--){const t=1<<r-1;let o=0;0!==(e&t)&&o++,0!==(n&t)&&(o+=2),i+=o}return i}fetchTile(t,e,n){return new Promise(((i,r)=>{const o=document.createElement("img");o.onload=function(){i(o)},o.onerror=function(){r()},o.crossOrigin="Anonymous",o.src="http://ecn."+this.subdomain+".tiles.virtualearth.net/tiles/"+this.type+E.quadKey(t,e,n)+".jpeg?g=1173"}))}}E.ADDRESS="https://dev.virtualearth.net",E.AERIAL="a",E.ROAD="r",E.AERIAL_LABELS="h",E.OBLIQUE="o",E.OBLIQUE_LABELS="b";class P extends o{constructor(t="",e="",n="base",i="normal.day",r="png",o=512){super(),this.appId=t,this.appCode=e,this.style=n,this.scheme=i,this.format=r,this.size=o,this.version="newest",this.server=1}nextServer(){this.server=this.server%4===0?1:this.server+1}getMetaData(){return r(this,void 0,void 0,(function*(){}))}fetchTile(t,e,n){return this.nextServer(),new Promise(((i,r)=>{const o=document.createElement("img");o.onload=function(){i(o)},o.onerror=function(){r()},o.crossOrigin="Anonymous",o.src="https://"+this.server+"."+this.style+".maps.api.here.com/maptile/2.1/maptile/"+this.version+"/"+this.scheme+"/"+t+"/"+e+"/"+n+"/"+this.size+"/"+this.format+"?app_id="+this.appId+"&app_code="+this.appCode}))}}P.PATH="/maptile/2.1/";class L extends o{constructor(t="",e="",n=L.STYLE,i="png",r=!1,o="v4"){super(),this.apiToken=t,this.format=i,this.useHDPI=r,this.mode=n,this.mapId=e,this.style=e,this.version=o}getMetaData(){return r(this,void 0,void 0,(function*(){const t=L.ADDRESS+this.version+"/"+this.mapId+".json?access_token="+this.apiToken,e=yield T.get(t),n=JSON.parse(e);this.name=n.name,this.minZoom=n.minZoom,this.maxZoom=n.maxZoom,this.bounds=n.bounds,this.center=n.center}))}fetchTile(t,e,n){return new Promise(((i,r)=>{const o=document.createElement("img");o.onload=function(){i(o)},o.onerror=function(){r()},o.crossOrigin="Anonymous",this.mode===L.STYLE?o.src=L.ADDRESS+"styles/v1/"+this.style+"/tiles/"+t+"/"+e+"/"+n+(this.useHDPI?"@2x?access_token=":"?access_token=")+this.apiToken:o.src=L.ADDRESS+"v4/"+this.mapId+"/"+t+"/"+e+"/"+n+(this.useHDPI?"@2x.":".")+this.format+"?access_token="+this.apiToken}))}}L.ADDRESS="https://api.mapbox.com/",L.STYLE=100,L.MAP_ID=101},985:function(t,e,n){"use strict";n.d(e,{A:function(){return m}});var i=n(437),r=0;function o(t){return"__private_"+r+++"_"+t}function a(t,e){if(!Object.prototype.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}function s(t,e){let{defines:n="",header:i="",main:r="",...o}=e,a=t;const s=(t,e,n)=>t.split(e).join(n);Object.keys(o).forEach((t=>{a=s(a,t,o[t])})),a=a.replace("void main() {",`\n ${i}\n void main() {\n ${r}\n `);const l=Object.keys(n).map((t=>`#define ${t} ${n[t]}`)).join("\n");return`\n ${l}\n ${a}\n `}function l(t,e){if(t.image&&0!==t.image.videoWidth&&0!==t.image.videoHeight)return;const n=setInterval((()=>{if(t.image&&0!==t.image.videoWidth&&0!==t.image.videoHeight)return clearInterval(n),e(t)}),16)}var u=o("camera"),h=o("cover"),c=o("textureScale"),d=o("saveCameraProjectionMatrix"),p=o("saveDimensions"),f=o("saveCameraMatrices");class m extends i.uSd{get camera(){return a(this,u)[u]}set camera(t){if(!t||!t.isCamera)throw new Error("Invalid camera set to the ProjectedMaterial");if(t.type!==a(this,u)[u].type)throw new Error("Cannot change camera type after the material has been created. Use another material.");a(this,u)[u]=t,a(this,p)[p]()}get texture(){return this.uniforms.projectedTexture.value}set texture(t){if(null==t||!t.isTexture)throw new Error("Invalid texture set to the ProjectedMaterial");this.uniforms.projectedTexture.value=t,this.uniforms.isTextureLoaded.value=Boolean(t.image),this.uniforms.isTextureLoaded.value?a(this,p)[p]():l(t,(()=>{this.uniforms.isTextureLoaded.value=!0,this.dispatchEvent({type:"textureload"}),a(this,p)[p]()}))}get textureScale(){return a(this,c)[c]}set textureScale(t){a(this,c)[c]=t,a(this,p)[p]()}get textureOffset(){return this.uniforms.textureOffset.value}set textureOffset(t){this.uniforms.textureOffset.value=t}get cover(){return a(this,h)[h]}set cover(t){a(this,h)[h]=t,a(this,p)[p]()}constructor(t){let{camera:e=new i.ubm,texture:n=new i.gPd,textureScale:r=1,textureOffset:o=new i.I9Y,cover:m=!1,...v}=void 0===t?{}:t;if(!n.isTexture)throw new Error("Invalid texture passed to the ProjectedMaterial");if(!e.isCamera)throw new Error("Invalid camera passed to the ProjectedMaterial");super(v),Object.defineProperty(this,f,{value:_}),Object.defineProperty(this,p,{value:g}),Object.defineProperty(this,u,{writable:!0,value:void 0}),Object.defineProperty(this,h,{writable:!0,value:void 0}),Object.defineProperty(this,c,{writable:!0,value:void 0}),Object.defineProperty(this,d,{writable:!0,value:()=>{this.uniforms.projectionMatrixCamera.value.copy(this.camera.projectionMatrix),a(this,p)[p]()}}),Object.defineProperty(this,"isProjectedMaterial",{value:!0}),a(this,u)[u]=e,a(this,h)[h]=m,a(this,c)[c]=r;const[x,b]=y(n,e,r,m);this.uniforms={projectedTexture:{value:n},isTextureLoaded:{value:Boolean(n.image)},isTextureProjected:{value:!1},backgroundOpacity:{value:1},viewMatrixCamera:{value:new i.kn4},projectionMatrixCamera:{value:new i.kn4},projPosition:{value:new i.Pq0},projDirection:{value:new i.Pq0(0,0,-1)},savedModelMatrix:{value:new i.kn4},widthScaled:{value:x},heightScaled:{value:b},textureOffset:{value:o}},this.onBeforeCompile=t=>{Object.assign(this.uniforms,t.uniforms),t.uniforms=this.uniforms,this.camera.isOrthographicCamera&&(t.defines.ORTHOGRAPHIC=""),t.vertexShader=s(t.vertexShader,{header:"\n uniform mat4 viewMatrixCamera;\n uniform mat4 projectionMatrixCamera;\n\n #ifdef USE_INSTANCING\n attribute vec4 savedModelMatrix0;\n attribute vec4 savedModelMatrix1;\n attribute vec4 savedModelMatrix2;\n attribute vec4 savedModelMatrix3;\n #else\n uniform mat4 savedModelMatrix;\n #endif\n\n varying vec3 vSavedNormal;\n varying vec4 vTexCoords;\n #ifndef ORTHOGRAPHIC\n varying vec4 vWorldPosition;\n #endif\n ",main:"\n #ifdef USE_INSTANCING\n mat4 savedModelMatrix = mat4(\n savedModelMatrix0,\n savedModelMatrix1,\n savedModelMatrix2,\n savedModelMatrix3\n );\n #endif\n\n vSavedNormal = mat3(savedModelMatrix) * normal;\n vTexCoords = projectionMatrixCamera * viewMatrixCamera * savedModelMatrix * vec4(position, 1.0);\n #ifndef ORTHOGRAPHIC\n vWorldPosition = savedModelMatrix * vec4(position, 1.0);\n #endif\n "}),t.fragmentShader=s(t.fragmentShader,{header:"\n uniform sampler2D projectedTexture;\n uniform bool isTextureLoaded;\n uniform bool isTextureProjected;\n uniform float backgroundOpacity;\n uniform vec3 projPosition;\n uniform vec3 projDirection;\n uniform float widthScaled;\n uniform float heightScaled;\n uniform vec2 textureOffset;\n\n varying vec3 vSavedNormal;\n varying vec4 vTexCoords;\n #ifndef ORTHOGRAPHIC\n varying vec4 vWorldPosition;\n #endif\n\n float mapRange(float value, float min1, float max1, float min2, float max2) {\n return min2 + (value - min1) * (max2 - min2) / (max1 - min1);\n }\n ","vec4 diffuseColor = vec4( diffuse, opacity );":"\n // clamp the w to make sure we don't project behind\n float w = max(vTexCoords.w, 0.0);\n\n vec2 uv = (vTexCoords.xy / w) * 0.5 + 0.5;\n\n uv += textureOffset;\n\n // apply the corrected width and height\n uv.x = mapRange(uv.x, 0.0, 1.0, 0.5 - widthScaled / 2.0, 0.5 + widthScaled / 2.0);\n uv.y = mapRange(uv.y, 0.0, 1.0, 0.5 - heightScaled / 2.0, 0.5 + heightScaled / 2.0);\n\n // this makes sure we don't sample out of the texture\n bool isInTexture = (max(uv.x, uv.y) <= 1.0 && min(uv.x, uv.y) >= 0.0);\n\n // this makes sure we don't render also the back of the object\n #ifdef ORTHOGRAPHIC\n vec3 projectorDirection = projDirection;\n #else\n vec3 projectorDirection = normalize(projPosition - vWorldPosition.xyz);\n #endif\n float dotProduct = dot(vSavedNormal, projectorDirection);\n bool isFacingProjector = dotProduct > 0.0000001;\n\n\n vec4 diffuseColor = vec4(diffuse, opacity * backgroundOpacity);\n\n if (isFacingProjector && isInTexture && isTextureLoaded && isTextureProjected) {\n vec4 textureColor = texture2D(projectedTexture, uv);\n\n // apply the material opacity\n textureColor.a *= opacity;\n\n // https://learnopengl.com/Advanced-OpenGL/Blending\n diffuseColor = textureColor * textureColor.a + diffuseColor * (1.0 - textureColor.a);\n }\n "})},window.addEventListener("resize",a(this,d)[d]),l(n,(()=>{this.uniforms.isTextureLoaded.value=!0,this.dispatchEvent({type:"textureload"}),a(this,p)[p]()}))}project(t){if(!(Array.isArray(t.material)?t.material.some((t=>t.isProjectedMaterial)):t.material.isProjectedMaterial))throw new Error("The mesh material must be a ProjectedMaterial");if(!(Array.isArray(t.material)?t.material.some((t=>t===this)):t.material===this))throw new Error("The provided mesh doesn't have the same material as where project() has been called from");if(t.updateWorldMatrix(!0,!1),this.uniforms.savedModelMatrix.value.copy(t.matrixWorld),Array.isArray(t.material)){const e=t.material.indexOf(this);if(!t.material[e].transparent)throw new Error('You have to pass "transparent: true" to the ProjectedMaterial if you\'re working with multiple materials.');e>0&&(this.uniforms.backgroundOpacity.value=0)}a(this,f)[f]()}projectInstanceAt(t,e,n,i){let{forceCameraSave:r=!1}=void 0===i?{}:i;if(!e.isInstancedMesh)throw new Error("The provided mesh is not an InstancedMesh");if(!(Array.isArray(e.material)?e.material.every((t=>t.isProjectedMaterial)):e.material.isProjectedMaterial))throw new Error("The InstancedMesh material must be a ProjectedMaterial");if(!(Array.isArray(e.material)?e.material.some((t=>t===this)):e.material===this))throw new Error("The provided InstancedMeshhave't i samenclude thas e material where project() has been called from");if(!e.geometry.attributes["savedModelMatrix0"]||!e.geometry.attributes["savedModelMatrix1"]||!e.geometry.attributes["savedModelMatrix2"]||!e.geometry.attributes["savedModelMatrix3"])throw new Error("No allocated data found on the geometry, please call 'allocateProjectionData(geometry, instancesCount)'");if(e.geometry.attributes["savedModelMatrix0"].setXYZW(t,n.elements[0],n.elements[1],n.elements[2],n.elements[3]),e.geometry.attributes["savedModelMatrix1"].setXYZW(t,n.elements[4],n.elements[5],n.elements[6],n.elements[7]),e.geometry.attributes["savedModelMatrix2"].setXYZW(t,n.elements[8],n.elements[9],n.elements[10],n.elements[11]),e.geometry.attributes["savedModelMatrix3"].setXYZW(t,n.elements[12],n.elements[13],n.elements[14],n.elements[15]),Array.isArray(e.material)){const t=e.material.indexOf(this);if(!e.material[t].transparent)throw new Error('You have to pass "transparent: true" to the ProjectedMaterial if you\'re working with multiple materials.');t>0&&(this.uniforms.backgroundOpacity.value=0)}(0===t||r)&&a(this,f)[f]()}copy(t){return super.copy(t),this.camera=t.camera,this.texture=t.texture,this.textureScale=t.textureScale,this.textureOffset=t.textureOffset,this.cover=t.cover,this}dispose(){super.dispose(),window.removeEventListener("resize",a(this,d)[d])}}function g(){const[t,e]=y(this.texture,this.camera,this.textureScale,this.cover);this.uniforms.widthScaled.value=t,this.uniforms.heightScaled.value=e}function _(){this.camera.updateProjectionMatrix(),this.camera.updateMatrixWorld(),this.camera.updateWorldMatrix();const t=this.camera.matrixWorldInverse,e=this.camera.projectionMatrix,n=this.camera.matrixWorld;this.uniforms.viewMatrixCamera.value.copy(t),this.uniforms.projectionMatrixCamera.value.copy(e),this.uniforms.projPosition.value.setFromMatrixPosition(n),this.uniforms.projDirection.value.set(0,0,1).applyMatrix4(n),this.uniforms.isTextureProjected.value=!0}function v(t){switch(t.type){case"PerspectiveCamera":return t.aspect;case"OrthographicCamera":{const e=Math.abs(t.right-t.left),n=Math.abs(t.top-t.bottom);return e/n}default:throw new Error(`${t.type} is currently not supported in ProjectedMaterial`)}}function y(t,e,n,i){if(!t.image)return[1,1];if(0===t.image.videoWidth&&0===t.image.videoHeight)return[1,1];const r=t.image.naturalWidth||t.image.videoWidth||t.image.clientWidth,o=t.image.naturalHeight||t.image.videoHeight||t.image.clientHeight,a=r/o,s=v(e),l=1,u=l*(1/s);let h,c;if(i?a>s:a<s){const t=u*a;h=1/(t/l*n),c=1/n}else{const t=l*(1/a);c=1/(t/u*n),h=1/n}return[h,c]}},437:function(t,e,n){"use strict";n.d(e,{$EB:function(){return f},$p8:function(){return mc},BH$:function(){return Lh},BKk:function(){return Or},GOR:function(){return zh},GWd:function(){return Pt},G_z:function(){return Fh},Ho_:function(){return Nh},I9Y:function(){return sn},JeP:function(){return Th},LlO:function(){return Rr},LoY:function(){return ur},MW4:function(){return tr},ONl:function(){return Dh},PPD:function(){return Xr},PTz:function(){return Dn},Pq0:function(){return On},Q1f:function(){return Mn},Qev:function(){return Ie},THS:function(){return $i},Tap:function(){return sc},V9B:function(){return Yi},YHV:function(){return Rc},YJl:function(){return _h},Z58:function(){return Ph},ZyN:function(){return fc},bdM:function(){return Jr},cj9:function(){return an},eaF:function(){return wr},gPd:function(){return Ln},hB5:function(){return d},hsX:function(){return p},hxR:function(){return ut},iNn:function(){return Er},k6q:function(){return dt},kBv:function(){return r},kn4:function(){return hi},qUd:function(){return Vs},qtW:function(){return er},tBo:function(){return Lc},tXL:function(){return Bh},uSd:function(){return Uh},ubm:function(){return Nr},wtR:function(){return o}});
|
|
35
|
-
/**
|
|
36
|
-
* @license
|
|
37
|
-
* Copyright 2010-2023 Three.js Authors
|
|
38
|
-
* SPDX-License-Identifier: MIT
|
|
39
|
-
*/
|
|
40
|
-
const i="149",r={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},o={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},a=0,s=1,l=2,u=1,h=2,c=3,d=0,p=1,f=2,m=0,g=1,_=2,v=3,y=4,x=5,b=100,M=101,w=102,S=103,T=104,E=200,P=201,L=202,A=203,C=204,R=205,I=206,D=207,O=208,z=209,N=210,k=0,U=1,B=2,F=3,V=4,H=5,W=6,G=7,j=0,Z=1,q=2,X=0,Y=1,K=2,J=3,$=4,Q=5,tt=300,et=301,nt=302,it=303,rt=304,ot=306,at=1e3,st=1001,lt=1002,ut=1003,ht=1004,ct=1005,dt=1006,pt=1007,ft=1008,mt=1009,gt=1010,_t=1011,vt=1012,yt=1013,xt=1014,bt=1015,Mt=1016,wt=1017,St=1018,Tt=1020,Et=1021,Pt=1023,Lt=1024,At=1025,Ct=1026,Rt=1027,It=1028,Dt=1029,Ot=1030,zt=1031,Nt=1033,kt=33776,Ut=33777,Bt=33778,Ft=33779,Vt=35840,Ht=35841,Wt=35842,Gt=35843,jt=36196,Zt=37492,qt=37496,Xt=37808,Yt=37809,Kt=37810,Jt=37811,$t=37812,Qt=37813,te=37814,ee=37815,ne=37816,ie=37817,re=37818,oe=37819,ae=37820,se=37821,le=36492,ue=36283,he=36284,ce=36285,de=36286,pe=2300,fe=2301,me=2302,ge=2400,_e=2401,ve=2402,ye=3e3,xe=3001,be=3200,Me=3201,we=0,Se=1,Te="srgb",Ee="srgb-linear",Pe=7680,Le=519,Ae=35044,Ce="300 es",Re=1035;class Ie{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)}hasEventListener(t,e){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)}removeEventListener(t,e){if(void 0===this._listeners)return;const n=this._listeners,i=n[t];if(void 0!==i){const t=i.indexOf(e);-1!==t&&i.splice(t,1)}}dispatchEvent(t){if(void 0===this._listeners)return;const e=this._listeners,n=e[t.type];if(void 0!==n){t.target=this;const e=n.slice(0);for(let n=0,i=e.length;n<i;n++)e[n].call(this,t);t.target=null}}}const De=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let Oe=1234567;const ze=Math.PI/180,Ne=180/Math.PI;function ke(){const t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0,r=De[255&t]+De[t>>8&255]+De[t>>16&255]+De[t>>24&255]+"-"+De[255&e]+De[e>>8&255]+"-"+De[e>>16&15|64]+De[e>>24&255]+"-"+De[63&n|128]+De[n>>8&255]+"-"+De[n>>16&255]+De[n>>24&255]+De[255&i]+De[i>>8&255]+De[i>>16&255]+De[i>>24&255];return r.toLowerCase()}function Ue(t,e,n){return Math.max(e,Math.min(n,t))}function Be(t,e){return(t%e+e)%e}function Fe(t,e,n,i,r){return i+(t-e)*(r-i)/(n-e)}function Ve(t,e,n){return t!==e?(n-t)/(e-t):0}function He(t,e,n){return(1-n)*t+n*e}function We(t,e,n,i){return He(t,e,1-Math.exp(-n*i))}function Ge(t,e=1){return e-Math.abs(Be(t,2*e)-e)}function je(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))}function Ze(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(6*t-15)+10))}function qe(t,e){return t+Math.floor(Math.random()*(e-t+1))}function Xe(t,e){return t+Math.random()*(e-t)}function Ye(t){return t*(.5-Math.random())}function Ke(t){void 0!==t&&(Oe=t);let e=Oe+=1831565813;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296}function Je(t){return t*ze}function $e(t){return t*Ne}function Qe(t){return 0===(t&t-1)&&0!==t}function tn(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function en(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function nn(t,e,n,i,r){const o=Math.cos,a=Math.sin,s=o(n/2),l=a(n/2),u=o((e+i)/2),h=a((e+i)/2),c=o((e-i)/2),d=a((e-i)/2),p=o((i-e)/2),f=a((i-e)/2);switch(r){case"XYX":t.set(s*h,l*c,l*d,s*u);break;case"YZY":t.set(l*d,s*h,l*c,s*u);break;case"ZXZ":t.set(l*c,l*d,s*h,s*u);break;case"XZX":t.set(s*h,l*f,l*p,s*u);break;case"YXY":t.set(l*p,s*h,l*f,s*u);break;case"ZYZ":t.set(l*f,l*p,s*h,s*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function rn(t,e){switch(e.constructor){case Float32Array:return t;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function on(t,e){switch(e.constructor){case Float32Array:return t;case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw new Error("Invalid component type.")}}var an=Object.freeze({__proto__:null,DEG2RAD:ze,RAD2DEG:Ne,ceilPowerOfTwo:tn,clamp:Ue,damp:We,degToRad:Je,denormalize:rn,euclideanModulo:Be,floorPowerOfTwo:en,generateUUID:ke,inverseLerp:Ve,isPowerOfTwo:Qe,lerp:He,mapLinear:Fe,normalize:on,pingpong:Ge,radToDeg:$e,randFloat:Xe,randFloatSpread:Ye,randInt:qe,seededRandom:Ke,setQuaternionFromProperEuler:nn,smootherstep:Ze,smoothstep:je});class sn{constructor(t=0,e=0){sn.prototype.isVector2=!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){return 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){return 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,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[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(){const t=Math.atan2(-this.y,-this.x)+Math.PI;return t}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){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),i=Math.sin(e),r=this.x-t.x,o=this.y-t.y;return this.x=r*n-o*i+t.x,this.y=r*i+o*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class ln{constructor(){ln.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(t,e,n,i,r,o,a,s,l){const u=this.elements;return u[0]=t,u[1]=i,u[2]=a,u[3]=e,u[4]=r,u[5]=s,u[6]=n,u[7]=o,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,i=e.elements,r=this.elements,o=n[0],a=n[3],s=n[6],l=n[1],u=n[4],h=n[7],c=n[2],d=n[5],p=n[8],f=i[0],m=i[3],g=i[6],_=i[1],v=i[4],y=i[7],x=i[2],b=i[5],M=i[8];return r[0]=o*f+a*_+s*x,r[3]=o*m+a*v+s*b,r[6]=o*g+a*y+s*M,r[1]=l*f+u*_+h*x,r[4]=l*m+u*v+h*b,r[7]=l*g+u*y+h*M,r[2]=c*f+d*_+p*x,r[5]=c*m+d*v+p*b,r[8]=c*g+d*y+p*M,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],i=t[2],r=t[3],o=t[4],a=t[5],s=t[6],l=t[7],u=t[8];return e*o*u-e*a*l-n*r*u+n*a*s+i*r*l-i*o*s}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],a=t[5],s=t[6],l=t[7],u=t[8],h=u*o-a*l,c=a*s-u*r,d=l*r-o*s,p=e*h+n*c+i*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const f=1/p;return t[0]=h*f,t[1]=(i*l-u*n)*f,t[2]=(a*n-i*o)*f,t[3]=c*f,t[4]=(u*e-i*s)*f,t[5]=(i*r-a*e)*f,t[6]=d*f,t[7]=(n*s-l*e)*f,t[8]=(o*e-n*r)*f,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,i,r,o,a){const s=Math.cos(r),l=Math.sin(r);return this.set(n*s,n*l,-n*(s*o+l*a)+o+t,-i*l,i*s,-i*(-l*o+s*a)+a+e,0,0,1),this}scale(t,e){return this.premultiply(un.makeScale(t,e)),this}rotate(t){return this.premultiply(un.makeRotation(-t)),this}translate(t,e){return this.premultiply(un.makeTranslation(t,e)),this}makeTranslation(t,e){return this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,n=t.elements;for(let i=0;i<9;i++)if(e[i]!==n[i])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)}}const un=new ln;function hn(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;function cn(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function dn(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function pn(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const fn={[Te]:{[Ee]:dn},[Ee]:{[Te]:pn}},mn={legacyMode:!0,get workingColorSpace(){return Ee},set workingColorSpace(t){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(t,e,n){if(this.legacyMode||e===n||!e||!n)return t;if(fn[e]&&void 0!==fn[e][n]){const i=fn[e][n];return t.r=i(t.r),t.g=i(t.g),t.b=i(t.b),t}throw new Error("Unsupported color space conversion.")},fromWorkingColorSpace:function(t,e){return this.convert(t,this.workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this.workingColorSpace)}},gn={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},_n={r:0,g:0,b:0},vn={h:0,s:0,l:0},yn={h:0,s:0,l:0};function xn(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}function bn(t,e){return e.r=t.r,e.g=t.g,e.b=t.b,e}class Mn{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,void 0===e&&void 0===n?this.set(t):this.setRGB(t,e,n)}set(t){return t&&t.isColor?this.copy(t):"number"===typeof t?this.setHex(t):"string"===typeof t&&this.setStyle(t),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Te){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,mn.toWorkingColorSpace(this,e),this}setRGB(t,e,n,i=mn.workingColorSpace){return this.r=t,this.g=e,this.b=n,mn.toWorkingColorSpace(this,i),this}setHSL(t,e,n,i=mn.workingColorSpace){if(t=Be(t,1),e=Ue(e,0,1),n=Ue(n,0,1),0===e)this.r=this.g=this.b=n;else{const i=n<=.5?n*(1+e):n+e-n*e,r=2*n-i;this.r=xn(r,i,t+1/3),this.g=xn(r,i,t),this.b=xn(r,i,t-1/3)}return mn.toWorkingColorSpace(this,i),this}setStyle(t,e=Te){function n(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let t;const r=i[1],o=i[2];switch(r){case"rgb":case"rgba":if(t=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(t[1],10))/255,this.g=Math.min(255,parseInt(t[2],10))/255,this.b=Math.min(255,parseInt(t[3],10))/255,mn.toWorkingColorSpace(this,e),n(t[4]),this;if(t=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(t[1],10))/100,this.g=Math.min(100,parseInt(t[2],10))/100,this.b=Math.min(100,parseInt(t[3],10))/100,mn.toWorkingColorSpace(this,e),n(t[4]),this;break;case"hsl":case"hsla":if(t=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){const i=parseFloat(t[1])/360,r=parseFloat(t[2])/100,o=parseFloat(t[3])/100;return n(t[4]),this.setHSL(i,r,o,e)}break}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){const t=i[1],n=t.length;if(3===n)return this.r=parseInt(t.charAt(0)+t.charAt(0),16)/255,this.g=parseInt(t.charAt(1)+t.charAt(1),16)/255,this.b=parseInt(t.charAt(2)+t.charAt(2),16)/255,mn.toWorkingColorSpace(this,e),this;if(6===n)return this.r=parseInt(t.charAt(0)+t.charAt(1),16)/255,this.g=parseInt(t.charAt(2)+t.charAt(3),16)/255,this.b=parseInt(t.charAt(4)+t.charAt(5),16)/255,mn.toWorkingColorSpace(this,e),this}return t&&t.length>0?this.setColorName(t,e):this}setColorName(t,e=Te){const n=gn[t.toLowerCase()];return void 0!==n?this.setHex(n,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}copySRGBToLinear(t){return this.r=dn(t.r),this.g=dn(t.g),this.b=dn(t.b),this}copyLinearToSRGB(t){return this.r=pn(t.r),this.g=pn(t.g),this.b=pn(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Te){return mn.fromWorkingColorSpace(bn(this,_n),t),Ue(255*_n.r,0,255)<<16^Ue(255*_n.g,0,255)<<8^Ue(255*_n.b,0,255)<<0}getHexString(t=Te){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=mn.workingColorSpace){mn.fromWorkingColorSpace(bn(this,_n),e);const n=_n.r,i=_n.g,r=_n.b,o=Math.max(n,i,r),a=Math.min(n,i,r);let s,l;const u=(a+o)/2;if(a===o)s=0,l=0;else{const t=o-a;switch(l=u<=.5?t/(o+a):t/(2-o-a),o){case n:s=(i-r)/t+(i<r?6:0);break;case i:s=(r-n)/t+2;break;case r:s=(n-i)/t+4;break}s/=6}return t.h=s,t.s=l,t.l=u,t}getRGB(t,e=mn.workingColorSpace){return mn.fromWorkingColorSpace(bn(this,_n),e),t.r=_n.r,t.g=_n.g,t.b=_n.b,t}getStyle(t=Te){return mn.fromWorkingColorSpace(bn(this,_n),t),t!==Te?`color(${t} ${_n.r} ${_n.g} ${_n.b})`:`rgb(${255*_n.r|0},${255*_n.g|0},${255*_n.b|0})`}offsetHSL(t,e,n){return this.getHSL(vn),vn.h+=t,vn.s+=e,vn.l+=n,this.setHSL(vn.h,vn.s,vn.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(vn),t.getHSL(yn);const n=He(vn.h,yn.h,e),i=He(vn.s,yn.s,e),r=He(vn.l,yn.l,e);return this.setHSL(n,i,r),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),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}let wn;Mn.NAMES=gn;class Sn{static getDataURL(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===wn&&(wn=cn("canvas")),wn.width=t.width,wn.height=t.height;const n=wn.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=wn}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")}static sRGBToLinear(t){if("undefined"!==typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&t instanceof ImageBitmap){const e=cn("canvas");e.width=t.width,e.height=t.height;const n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);const i=n.getImageData(0,0,t.width,t.height),r=i.data;for(let t=0;t<r.length;t++)r[t]=255*dn(r[t]/255);return n.putImageData(i,0,0),e}if(t.data){const e=t.data.slice(0);for(let t=0;t<e.length;t++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[t]=Math.floor(255*dn(e[t]/255)):e[t]=dn(e[t]);return{data:e,width:t.width,height:t.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}}class Tn{constructor(t=null){this.isSource=!0,this.uuid=ke(),this.data=t,this.version=0}set needsUpdate(t){!0===t&&this.version++}toJSON(t){const e=void 0===t||"string"===typeof t;if(!e&&void 0!==t.images[this.uuid])return t.images[this.uuid];const n={uuid:this.uuid,url:""},i=this.data;if(null!==i){let t;if(Array.isArray(i)){t=[];for(let e=0,n=i.length;e<n;e++)i[e].isDataTexture?t.push(En(i[e].image)):t.push(En(i[e]))}else t=En(i);n.url=t}return e||(t.images[this.uuid]=n),n}}function En(t){return"undefined"!==typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&t instanceof ImageBitmap?Sn.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let Pn=0;class Ln extends Ie{constructor(t=Ln.DEFAULT_IMAGE,e=Ln.DEFAULT_MAPPING,n=st,i=st,r=dt,o=ft,a=Pt,s=mt,l=Ln.DEFAULT_ANISOTROPY,u=ye){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Pn++}),this.uuid=ke(),this.name="",this.source=new Tn(t),this.mipmaps=[],this.mapping=e,this.wrapS=n,this.wrapT=i,this.magFilter=r,this.minFilter=o,this.anisotropy=l,this.format=a,this.internalFormat=null,this.type=s,this.offset=new sn(0,0),this.repeat=new sn(1,1),this.center=new sn(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new ln,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=u,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(t){this.source.data=t}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.source=t.source,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.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){const e=void 0===t||"string"===typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];const n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,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,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==tt)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case at:t.x=t.x-Math.floor(t.x);break;case st:t.x=t.x<0?0:1;break;case lt:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case at:t.y=t.y-Math.floor(t.y);break;case st:t.y=t.y<0?0:1;break;case lt:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}}Ln.DEFAULT_IMAGE=null,Ln.DEFAULT_MAPPING=tt,Ln.DEFAULT_ANISOTROPY=1;class An{constructor(t=0,e=0,n=0,i=1){An.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=i}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,i){return this.x=t,this.y=e,this.z=n,this.w=i,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=void 0!==t.w?t.w:1,this}add(t){return 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){return 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,i=this.z,r=this.w,o=t.elements;return this.x=o[0]*e+o[4]*n+o[8]*i+o[12]*r,this.y=o[1]*e+o[5]*n+o[9]*i+o[13]*r,this.z=o[2]*e+o[6]*n+o[10]*i+o[14]*r,this.w=o[3]*e+o[7]*n+o[11]*i+o[15]*r,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,i,r;const o=.01,a=.1,s=t.elements,l=s[0],u=s[4],h=s[8],c=s[1],d=s[5],p=s[9],f=s[2],m=s[6],g=s[10];if(Math.abs(u-c)<o&&Math.abs(h-f)<o&&Math.abs(p-m)<o){if(Math.abs(u+c)<a&&Math.abs(h+f)<a&&Math.abs(p+m)<a&&Math.abs(l+d+g-3)<a)return this.set(1,0,0,0),this;e=Math.PI;const t=(l+1)/2,s=(d+1)/2,_=(g+1)/2,v=(u+c)/4,y=(h+f)/4,x=(p+m)/4;return t>s&&t>_?t<o?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(t),i=v/n,r=y/n):s>_?s<o?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(s),n=v/i,r=x/i):_<o?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(_),n=y/r,i=x/r),this.set(n,i,r,e),this}let _=Math.sqrt((m-p)*(m-p)+(h-f)*(h-f)+(c-u)*(c-u));return Math.abs(_)<.001&&(_=1),this.x=(m-p)/_,this.y=(h-f)/_,this.z=(c-u)/_,this.w=Math.acos((l+d+g-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){return 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}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Cn extends Ie{constructor(t=1,e=1,n={}){super(),this.isWebGLRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new An(0,0,t,e),this.scissorTest=!1,this.viewport=new An(0,0,t,e);const i={width:t,height:e,depth:1};this.texture=new Ln(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.internalFormat=void 0!==n.internalFormat?n.internalFormat:null,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:dt,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0!==n.stencilBuffer&&n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null,this.samples=void 0!==n.samples?n.samples:0}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){this.width=t.width,this.height=t.height,this.depth=t.depth,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.texture.isRenderTargetTexture=!0;const e=Object.assign({},t.texture.image);return this.texture.source=new Tn(e),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,null!==t.depthTexture&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Rn extends Ln{constructor(t=null,e=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=ut,this.minFilter=ut,this.wrapR=st,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class In extends Ln{constructor(t=null,e=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=ut,this.minFilter=ut,this.wrapR=st,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Dn{constructor(t=0,e=0,n=0,i=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=n,this._w=i}static slerpFlat(t,e,n,i,r,o,a){let s=n[i+0],l=n[i+1],u=n[i+2],h=n[i+3];const c=r[o+0],d=r[o+1],p=r[o+2],f=r[o+3];if(0===a)return t[e+0]=s,t[e+1]=l,t[e+2]=u,void(t[e+3]=h);if(1===a)return t[e+0]=c,t[e+1]=d,t[e+2]=p,void(t[e+3]=f);if(h!==f||s!==c||l!==d||u!==p){let t=1-a;const e=s*c+l*d+u*p+h*f,n=e>=0?1:-1,i=1-e*e;if(i>Number.EPSILON){const r=Math.sqrt(i),o=Math.atan2(r,e*n);t=Math.sin(t*o)/r,a=Math.sin(a*o)/r}const r=a*n;if(s=s*t+c*r,l=l*t+d*r,u=u*t+p*r,h=h*t+f*r,t===1-a){const t=1/Math.sqrt(s*s+l*l+u*u+h*h);s*=t,l*=t,u*=t,h*=t}}t[e]=s,t[e+1]=l,t[e+2]=u,t[e+3]=h}static multiplyQuaternionsFlat(t,e,n,i,r,o){const a=n[i],s=n[i+1],l=n[i+2],u=n[i+3],h=r[o],c=r[o+1],d=r[o+2],p=r[o+3];return t[e]=a*p+u*h+s*d-l*c,t[e+1]=s*p+u*c+l*h-a*d,t[e+2]=l*p+u*d+a*c-s*h,t[e+3]=u*p-a*h-s*c-l*d,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,i){return this._x=t,this._y=e,this._z=n,this._w=i,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){const n=t._x,i=t._y,r=t._z,o=t._order,a=Math.cos,s=Math.sin,l=a(n/2),u=a(i/2),h=a(r/2),c=s(n/2),d=s(i/2),p=s(r/2);switch(o){case"XYZ":this._x=c*u*h+l*d*p,this._y=l*d*h-c*u*p,this._z=l*u*p+c*d*h,this._w=l*u*h-c*d*p;break;case"YXZ":this._x=c*u*h+l*d*p,this._y=l*d*h-c*u*p,this._z=l*u*p-c*d*h,this._w=l*u*h+c*d*p;break;case"ZXY":this._x=c*u*h-l*d*p,this._y=l*d*h+c*u*p,this._z=l*u*p+c*d*h,this._w=l*u*h-c*d*p;break;case"ZYX":this._x=c*u*h-l*d*p,this._y=l*d*h+c*u*p,this._z=l*u*p-c*d*h,this._w=l*u*h+c*d*p;break;case"YZX":this._x=c*u*h+l*d*p,this._y=l*d*h+c*u*p,this._z=l*u*p-c*d*h,this._w=l*u*h-c*d*p;break;case"XZY":this._x=c*u*h-l*d*p,this._y=l*d*h-c*u*p,this._z=l*u*p+c*d*h,this._w=l*u*h+c*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return!1!==e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],i=e[4],r=e[8],o=e[1],a=e[5],s=e[9],l=e[2],u=e[6],h=e[10],c=n+a+h;if(c>0){const t=.5/Math.sqrt(c+1);this._w=.25/t,this._x=(u-s)*t,this._y=(r-l)*t,this._z=(o-i)*t}else if(n>a&&n>h){const t=2*Math.sqrt(1+n-a-h);this._w=(u-s)/t,this._x=.25*t,this._y=(i+o)/t,this._z=(r+l)/t}else if(a>h){const t=2*Math.sqrt(1+a-n-h);this._w=(r-l)/t,this._x=(i+o)/t,this._y=.25*t,this._z=(s+u)/t}else{const t=2*Math.sqrt(1+h-n-a);this._w=(o-i)/t,this._x=(r+l)/t,this._y=(s+u)/t,this._z=.25*t}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(Ue(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(0===n)return this;const i=Math.min(1,e/n);return this.slerp(t,i),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 0===t?(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){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,i=t._y,r=t._z,o=t._w,a=e._x,s=e._y,l=e._z,u=e._w;return this._x=n*u+o*a+i*l-r*s,this._y=i*u+o*s+r*a-n*l,this._z=r*u+o*l+n*s-i*a,this._w=o*u-n*a-i*s-r*l,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const n=this._x,i=this._y,r=this._z,o=this._w;let a=o*t._w+n*t._x+i*t._y+r*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=o,this._x=n,this._y=i,this._z=r,this;const s=1-a*a;if(s<=Number.EPSILON){const t=1-e;return this._w=t*o+e*this._w,this._x=t*n+e*this._x,this._y=t*i+e*this._y,this._z=t*r+e*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(s),u=Math.atan2(l,a),h=Math.sin((1-e)*u)/l,c=Math.sin(e*u)/l;return this._w=o*h+this._w*c,this._x=n*h+this._x*c,this._y=i*h+this._y*c,this._z=r*h+this._z*c,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){const t=Math.random(),e=Math.sqrt(1-t),n=Math.sqrt(t),i=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(e*Math.cos(i),n*Math.sin(r),n*Math.cos(r),e*Math.sin(i))}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(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class On{constructor(t=0,e=0,n=0){On.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return void 0===n&&(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){return 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){return 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){return 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 this.applyQuaternion(Nn.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(Nn.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*i,this.y=r[1]*e+r[4]*n+r[7]*i,this.z=r[2]*e+r[5]*n+r[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=t.elements,o=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*o,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*o,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*o,this}applyQuaternion(t){const e=this.x,n=this.y,i=this.z,r=t.x,o=t.y,a=t.z,s=t.w,l=s*e+o*i-a*n,u=s*n+a*e-r*i,h=s*i+r*n-o*e,c=-r*e-o*n-a*i;return this.x=l*s+c*-r+u*-a-h*-o,this.y=u*s+c*-o+h*-r-l*-a,this.z=h*s+c*-a+l*-o-u*-r,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,i=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*i,this.y=r[1]*e+r[5]*n+r[9]*i,this.z=r[2]*e+r[6]*n+r[10]*i,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){return this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,i=t.y,r=t.z,o=e.x,a=e.y,s=e.z;return this.x=i*s-r*a,this.y=r*o-n*s,this.z=n*a-i*o,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return zn.copy(this).projectOnVector(t),this.sub(zn)}reflect(t){return this.sub(zn.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(Ue(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}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 i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*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(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}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){return 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}randomDirection(){const t=2*(Math.random()-.5),e=Math.random()*Math.PI*2,n=Math.sqrt(1-t**2);return this.x=n*Math.cos(e),this.y=n*Math.sin(e),this.z=t,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const zn=new On,Nn=new Dn;class kn{constructor(t=new On(1/0,1/0,1/0),e=new On(-1/0,-1/0,-1/0)){this.isBox3=!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,i=1/0,r=-1/0,o=-1/0,a=-1/0;for(let s=0,l=t.length;s<l;s+=3){const l=t[s],u=t[s+1],h=t[s+2];l<e&&(e=l),u<n&&(n=u),h<i&&(i=h),l>r&&(r=l),u>o&&(o=u),h>a&&(a=h)}return this.min.set(e,n,i),this.max.set(r,o,a),this}setFromBufferAttribute(t){let e=1/0,n=1/0,i=1/0,r=-1/0,o=-1/0,a=-1/0;for(let s=0,l=t.count;s<l;s++){const l=t.getX(s),u=t.getY(s),h=t.getZ(s);l<e&&(e=l),u<n&&(n=u),h<i&&(i=h),l>r&&(r=l),u>o&&(o=u),h>a&&(a=h)}return this.min.set(e,n,i),this.max.set(r,o,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=Bn.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}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,e=!1){t.updateWorldMatrix(!1,!1);const n=t.geometry;if(void 0!==n)if(e&&void 0!=n.attributes&&void 0!==n.attributes.position){const e=n.attributes.position;for(let n=0,i=e.count;n<i;n++)Bn.fromBufferAttribute(e,n).applyMatrix4(t.matrixWorld),this.expandByPoint(Bn)}else null===n.boundingBox&&n.computeBoundingBox(),Fn.copy(n.boundingBox),Fn.applyMatrix4(t.matrixWorld),this.union(Fn);const i=t.children;for(let r=0,o=i.length;r<o;r++)this.expandByObject(i[r],e);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,Bn),Bn.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(qn),Xn.subVectors(this.max,qn),Vn.subVectors(t.a,qn),Hn.subVectors(t.b,qn),Wn.subVectors(t.c,qn),Gn.subVectors(Hn,Vn),jn.subVectors(Wn,Hn),Zn.subVectors(Vn,Wn);let e=[0,-Gn.z,Gn.y,0,-jn.z,jn.y,0,-Zn.z,Zn.y,Gn.z,0,-Gn.x,jn.z,0,-jn.x,Zn.z,0,-Zn.x,-Gn.y,Gn.x,0,-jn.y,jn.x,0,-Zn.y,Zn.x,0];return!!Jn(e,Vn,Hn,Wn,Xn)&&(e=[1,0,0,0,1,0,0,0,1],!!Jn(e,Vn,Hn,Wn,Xn)&&(Yn.crossVectors(Gn,jn),e=[Yn.x,Yn.y,Yn.z],Jn(e,Vn,Hn,Wn,Xn)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){const e=Bn.copy(t).clamp(this.min,this.max);return e.sub(t).length()}getBoundingSphere(t){return this.getCenter(t.center),t.radius=.5*this.getSize(Bn).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()||(Un[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Un[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Un[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Un[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Un[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Un[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Un[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Un[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Un)),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)}}const Un=[new On,new On,new On,new On,new On,new On,new On,new On],Bn=new On,Fn=new kn,Vn=new On,Hn=new On,Wn=new On,Gn=new On,jn=new On,Zn=new On,qn=new On,Xn=new On,Yn=new On,Kn=new On;function Jn(t,e,n,i,r){for(let o=0,a=t.length-3;o<=a;o+=3){Kn.fromArray(t,o);const a=r.x*Math.abs(Kn.x)+r.y*Math.abs(Kn.y)+r.z*Math.abs(Kn.z),s=e.dot(Kn),l=n.dot(Kn),u=i.dot(Kn);if(Math.max(-Math.max(s,l,u),Math.min(s,l,u))>a)return!1}return!0}const $n=new kn,Qn=new On,ti=new On;class ei{constructor(t=new On,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;void 0!==e?n.copy(e):$n.setFromPoints(t).getCenter(n);let i=0;for(let r=0,o=t.length;r<o;r++)i=Math.max(i,n.distanceToSquared(t[r]));return this.radius=Math.sqrt(i),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){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;Qn.subVectors(t,this.center);const e=Qn.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),n=.5*(t-this.radius);this.center.addScaledVector(Qn,n/t),this.radius+=n}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(!0===this.center.equals(t.center)?this.radius=Math.max(this.radius,t.radius):(ti.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Qn.copy(t.center).add(ti)),this.expandByPoint(Qn.copy(t.center).sub(ti))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const ni=new On,ii=new On,ri=new On,oi=new On,ai=new On,si=new On,li=new On;class ui{constructor(t=new On,e=new On(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,ni)),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=ni.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(ni.copy(this.direction).multiplyScalar(e).add(this.origin),ni.distanceToSquared(t))}distanceSqToSegment(t,e,n,i){ii.copy(t).add(e).multiplyScalar(.5),ri.copy(e).sub(t).normalize(),oi.copy(this.origin).sub(ii);const r=.5*t.distanceTo(e),o=-this.direction.dot(ri),a=oi.dot(this.direction),s=-oi.dot(ri),l=oi.lengthSq(),u=Math.abs(1-o*o);let h,c,d,p;if(u>0)if(h=o*s-a,c=o*a-s,p=r*u,h>=0)if(c>=-p)if(c<=p){const t=1/u;h*=t,c*=t,d=h*(h+o*c+2*a)+c*(o*h+c+2*s)+l}else c=r,h=Math.max(0,-(o*c+a)),d=-h*h+c*(c+2*s)+l;else c=-r,h=Math.max(0,-(o*c+a)),d=-h*h+c*(c+2*s)+l;else c<=-p?(h=Math.max(0,-(-o*r+a)),c=h>0?-r:Math.min(Math.max(-r,-s),r),d=-h*h+c*(c+2*s)+l):c<=p?(h=0,c=Math.min(Math.max(-r,-s),r),d=c*(c+2*s)+l):(h=Math.max(0,-(o*r+a)),c=h>0?r:Math.min(Math.max(-r,-s),r),d=-h*h+c*(c+2*s)+l);else c=o>0?-r:r,h=Math.max(0,-(o*c+a)),d=-h*h+c*(c+2*s)+l;return n&&n.copy(this.direction).multiplyScalar(h).add(this.origin),i&&i.copy(ri).multiplyScalar(c).add(ii),d}intersectSphere(t,e){ni.subVectors(t.center,this.origin);const n=ni.dot(this.direction),i=ni.dot(ni)-n*n,r=t.radius*t.radius;if(i>r)return null;const o=Math.sqrt(r-i),a=n-o,s=n+o;return a<0&&s<0?null:a<0?this.at(s,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(0===e)return 0===t.distanceToPoint(this.origin)?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 null===n?null:this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);if(0===e)return!0;const n=t.normal.dot(this.direction);return n*e<0}intersectBox(t,e){let n,i,r,o,a,s;const l=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,c=this.origin;return l>=0?(n=(t.min.x-c.x)*l,i=(t.max.x-c.x)*l):(n=(t.max.x-c.x)*l,i=(t.min.x-c.x)*l),u>=0?(r=(t.min.y-c.y)*u,o=(t.max.y-c.y)*u):(r=(t.max.y-c.y)*u,o=(t.min.y-c.y)*u),n>o||r>i?null:((r>n||isNaN(n))&&(n=r),(o<i||isNaN(i))&&(i=o),h>=0?(a=(t.min.z-c.z)*h,s=(t.max.z-c.z)*h):(a=(t.max.z-c.z)*h,s=(t.min.z-c.z)*h),n>s||a>i?null:((a>n||n!==n)&&(n=a),(s<i||i!==i)&&(i=s),i<0?null:this.at(n>=0?n:i,e)))}intersectsBox(t){return null!==this.intersectBox(t,ni)}intersectTriangle(t,e,n,i,r){ai.subVectors(e,t),si.subVectors(n,t),li.crossVectors(ai,si);let o,a=this.direction.dot(li);if(a>0){if(i)return null;o=1}else{if(!(a<0))return null;o=-1,a=-a}oi.subVectors(this.origin,t);const s=o*this.direction.dot(si.crossVectors(oi,si));if(s<0)return null;const l=o*this.direction.dot(ai.cross(oi));if(l<0)return null;if(s+l>a)return null;const u=-o*oi.dot(li);return u<0?null:this.at(u/a,r)}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 hi{constructor(){hi.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(t,e,n,i,r,o,a,s,l,u,h,c,d,p,f,m){const g=this.elements;return g[0]=t,g[4]=e,g[8]=n,g[12]=i,g[1]=r,g[5]=o,g[9]=a,g[13]=s,g[2]=l,g[6]=u,g[10]=h,g[14]=c,g[3]=d,g[7]=p,g[11]=f,g[15]=m,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 hi).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,i=1/ci.setFromMatrixColumn(t,0).length(),r=1/ci.setFromMatrixColumn(t,1).length(),o=1/ci.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*o,e[9]=n[9]*o,e[10]=n[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,n=t.x,i=t.y,r=t.z,o=Math.cos(n),a=Math.sin(n),s=Math.cos(i),l=Math.sin(i),u=Math.cos(r),h=Math.sin(r);if("XYZ"===t.order){const t=o*u,n=o*h,i=a*u,r=a*h;e[0]=s*u,e[4]=-s*h,e[8]=l,e[1]=n+i*l,e[5]=t-r*l,e[9]=-a*s,e[2]=r-t*l,e[6]=i+n*l,e[10]=o*s}else if("YXZ"===t.order){const t=s*u,n=s*h,i=l*u,r=l*h;e[0]=t+r*a,e[4]=i*a-n,e[8]=o*l,e[1]=o*h,e[5]=o*u,e[9]=-a,e[2]=n*a-i,e[6]=r+t*a,e[10]=o*s}else if("ZXY"===t.order){const t=s*u,n=s*h,i=l*u,r=l*h;e[0]=t-r*a,e[4]=-o*h,e[8]=i+n*a,e[1]=n+i*a,e[5]=o*u,e[9]=r-t*a,e[2]=-o*l,e[6]=a,e[10]=o*s}else if("ZYX"===t.order){const t=o*u,n=o*h,i=a*u,r=a*h;e[0]=s*u,e[4]=i*l-n,e[8]=t*l+r,e[1]=s*h,e[5]=r*l+t,e[9]=n*l-i,e[2]=-l,e[6]=a*s,e[10]=o*s}else if("YZX"===t.order){const t=o*s,n=o*l,i=a*s,r=a*l;e[0]=s*u,e[4]=r-t*h,e[8]=i*h+n,e[1]=h,e[5]=o*u,e[9]=-a*u,e[2]=-l*u,e[6]=n*h+i,e[10]=t-r*h}else if("XZY"===t.order){const t=o*s,n=o*l,i=a*s,r=a*l;e[0]=s*u,e[4]=-h,e[8]=l*u,e[1]=t*h+r,e[5]=o*u,e[9]=n*h-i,e[2]=i*h-n,e[6]=a*u,e[10]=r*h+t}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(pi,t,fi)}lookAt(t,e,n){const i=this.elements;return _i.subVectors(t,e),0===_i.lengthSq()&&(_i.z=1),_i.normalize(),mi.crossVectors(n,_i),0===mi.lengthSq()&&(1===Math.abs(n.z)?_i.x+=1e-4:_i.z+=1e-4,_i.normalize(),mi.crossVectors(n,_i)),mi.normalize(),gi.crossVectors(_i,mi),i[0]=mi.x,i[4]=gi.x,i[8]=_i.x,i[1]=mi.y,i[5]=gi.y,i[9]=_i.y,i[2]=mi.z,i[6]=gi.z,i[10]=_i.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,r=this.elements,o=n[0],a=n[4],s=n[8],l=n[12],u=n[1],h=n[5],c=n[9],d=n[13],p=n[2],f=n[6],m=n[10],g=n[14],_=n[3],v=n[7],y=n[11],x=n[15],b=i[0],M=i[4],w=i[8],S=i[12],T=i[1],E=i[5],P=i[9],L=i[13],A=i[2],C=i[6],R=i[10],I=i[14],D=i[3],O=i[7],z=i[11],N=i[15];return r[0]=o*b+a*T+s*A+l*D,r[4]=o*M+a*E+s*C+l*O,r[8]=o*w+a*P+s*R+l*z,r[12]=o*S+a*L+s*I+l*N,r[1]=u*b+h*T+c*A+d*D,r[5]=u*M+h*E+c*C+d*O,r[9]=u*w+h*P+c*R+d*z,r[13]=u*S+h*L+c*I+d*N,r[2]=p*b+f*T+m*A+g*D,r[6]=p*M+f*E+m*C+g*O,r[10]=p*w+f*P+m*R+g*z,r[14]=p*S+f*L+m*I+g*N,r[3]=_*b+v*T+y*A+x*D,r[7]=_*M+v*E+y*C+x*O,r[11]=_*w+v*P+y*R+x*z,r[15]=_*S+v*L+y*I+x*N,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],i=t[8],r=t[12],o=t[1],a=t[5],s=t[9],l=t[13],u=t[2],h=t[6],c=t[10],d=t[14],p=t[3],f=t[7],m=t[11],g=t[15];return p*(+r*s*h-i*l*h-r*a*c+n*l*c+i*a*d-n*s*d)+f*(+e*s*d-e*l*c+r*o*c-i*o*d+i*l*u-r*s*u)+m*(+e*l*h-e*a*d-r*o*h+n*o*d+r*a*u-n*l*u)+g*(-i*a*u-e*s*h+e*a*c+i*o*h-n*o*c+n*s*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 i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],a=t[5],s=t[6],l=t[7],u=t[8],h=t[9],c=t[10],d=t[11],p=t[12],f=t[13],m=t[14],g=t[15],_=h*m*l-f*c*l+f*s*d-a*m*d-h*s*g+a*c*g,v=p*c*l-u*m*l-p*s*d+o*m*d+u*s*g-o*c*g,y=u*f*l-p*h*l+p*a*d-o*f*d-u*a*g+o*h*g,x=p*h*s-u*f*s-p*a*c+o*f*c+u*a*m-o*h*m,b=e*_+n*v+i*y+r*x;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const M=1/b;return t[0]=_*M,t[1]=(f*c*r-h*m*r-f*i*d+n*m*d+h*i*g-n*c*g)*M,t[2]=(a*m*r-f*s*r+f*i*l-n*m*l-a*i*g+n*s*g)*M,t[3]=(h*s*r-a*c*r-h*i*l+n*c*l+a*i*d-n*s*d)*M,t[4]=v*M,t[5]=(u*m*r-p*c*r+p*i*d-e*m*d-u*i*g+e*c*g)*M,t[6]=(p*s*r-o*m*r-p*i*l+e*m*l+o*i*g-e*s*g)*M,t[7]=(o*c*r-u*s*r+u*i*l-e*c*l-o*i*d+e*s*d)*M,t[8]=y*M,t[9]=(p*h*r-u*f*r-p*n*d+e*f*d+u*n*g-e*h*g)*M,t[10]=(o*f*r-p*a*r+p*n*l-e*f*l-o*n*g+e*a*g)*M,t[11]=(u*a*r-o*h*r-u*n*l+e*h*l+o*n*d-e*a*d)*M,t[12]=x*M,t[13]=(u*f*i-p*h*i+p*n*c-e*f*c-u*n*m+e*h*m)*M,t[14]=(p*a*i-o*f*i-p*n*s+e*f*s+o*n*m-e*a*m)*M,t[15]=(o*h*i-u*a*i+u*n*s-e*h*s-o*n*c+e*a*c)*M,this}scale(t){const e=this.elements,n=t.x,i=t.y,r=t.z;return e[0]*=n,e[4]*=i,e[8]*=r,e[1]*=n,e[5]*=i,e[9]*=r,e[2]*=n,e[6]*=i,e[10]*=r,e[3]*=n,e[7]*=i,e[11]*=r,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],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}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),i=Math.sin(e),r=1-n,o=t.x,a=t.y,s=t.z,l=r*o,u=r*a;return this.set(l*o+n,l*a-i*s,l*s+i*a,0,l*a+i*s,u*a+n,u*s-i*o,0,l*s-i*a,u*s+i*o,r*s*s+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,i,r,o){return this.set(1,n,r,0,t,1,o,0,e,i,1,0,0,0,0,1),this}compose(t,e,n){const i=this.elements,r=e._x,o=e._y,a=e._z,s=e._w,l=r+r,u=o+o,h=a+a,c=r*l,d=r*u,p=r*h,f=o*u,m=o*h,g=a*h,_=s*l,v=s*u,y=s*h,x=n.x,b=n.y,M=n.z;return i[0]=(1-(f+g))*x,i[1]=(d+y)*x,i[2]=(p-v)*x,i[3]=0,i[4]=(d-y)*b,i[5]=(1-(c+g))*b,i[6]=(m+_)*b,i[7]=0,i[8]=(p+v)*M,i[9]=(m-_)*M,i[10]=(1-(c+f))*M,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,n){const i=this.elements;let r=ci.set(i[0],i[1],i[2]).length();const o=ci.set(i[4],i[5],i[6]).length(),a=ci.set(i[8],i[9],i[10]).length(),s=this.determinant();s<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],di.copy(this);const l=1/r,u=1/o,h=1/a;return di.elements[0]*=l,di.elements[1]*=l,di.elements[2]*=l,di.elements[4]*=u,di.elements[5]*=u,di.elements[6]*=u,di.elements[8]*=h,di.elements[9]*=h,di.elements[10]*=h,e.setFromRotationMatrix(di),n.x=r,n.y=o,n.z=a,this}makePerspective(t,e,n,i,r,o){const a=this.elements,s=2*r/(e-t),l=2*r/(n-i),u=(e+t)/(e-t),h=(n+i)/(n-i),c=-(o+r)/(o-r),d=-2*o*r/(o-r);return a[0]=s,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=l,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=c,a[14]=d,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(t,e,n,i,r,o){const a=this.elements,s=1/(e-t),l=1/(n-i),u=1/(o-r),h=(e+t)*s,c=(n+i)*l,d=(o+r)*u;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*l,a[9]=0,a[13]=-c,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-d,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(t){const e=this.elements,n=t.elements;for(let i=0;i<16;i++)if(e[i]!==n[i])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}}const ci=new On,di=new hi,pi=new On(0,0,0),fi=new On(1,1,1),mi=new On,gi=new On,_i=new On,vi=new hi,yi=new Dn;class xi{constructor(t=0,e=0,n=0,i=xi.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=i}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,i=this._order){return this._x=t,this._y=e,this._z=n,this._order=i,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 i=t.elements,r=i[0],o=i[4],a=i[8],s=i[1],l=i[5],u=i[9],h=i[2],c=i[6],d=i[10];switch(e){case"XYZ":this._y=Math.asin(Ue(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,d),this._z=Math.atan2(-o,r)):(this._x=Math.atan2(c,l),this._z=0);break;case"YXZ":this._x=Math.asin(-Ue(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,d),this._z=Math.atan2(s,l)):(this._y=Math.atan2(-h,r),this._z=0);break;case"ZXY":this._x=Math.asin(Ue(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-o,l)):(this._y=0,this._z=Math.atan2(s,r));break;case"ZYX":this._y=Math.asin(-Ue(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(c,d),this._z=Math.atan2(s,r)):(this._x=0,this._z=Math.atan2(-o,l));break;case"YZX":this._z=Math.asin(Ue(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-h,r)):(this._x=0,this._y=Math.atan2(a,d));break;case"XZY":this._z=Math.asin(-Ue(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(c,l),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-u,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===n&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return vi.makeRotationFromQuaternion(t),this.setFromRotationMatrix(vi,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return yi.setFromEuler(this),this.setFromQuaternion(yi,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],void 0!==t[3]&&(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}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}xi.DEFAULT_ORDER="XYZ";class bi{constructor(){this.mask=1}set(t){this.mask=(1<<t|0)>>>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 0!==(this.mask&t.mask)}isEnabled(t){return 0!==(this.mask&(1<<t|0))}}let Mi=0;const wi=new On,Si=new Dn,Ti=new hi,Ei=new On,Pi=new On,Li=new On,Ai=new Dn,Ci=new On(1,0,0),Ri=new On(0,1,0),Ii=new On(0,0,1),Di={type:"added"},Oi={type:"removed"};class zi extends Ie{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Mi++}),this.uuid=ke(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=zi.DEFAULT_UP.clone();const t=new On,e=new xi,n=new Dn,i=new On(1,1,1);function r(){n.setFromEuler(e,!1)}function o(){e.setFromQuaternion(n,void 0,!1)}e._onChange(r),n._onChange(o),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:i},modelViewMatrix:{value:new hi},normalMatrix:{value:new ln}}),this.matrix=new hi,this.matrixWorld=new hi,this.matrixAutoUpdate=zi.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.matrixWorldAutoUpdate=zi.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.layers=new bi,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 Si.setFromAxisAngle(t,e),this.quaternion.multiply(Si),this}rotateOnWorldAxis(t,e){return Si.setFromAxisAngle(t,e),this.quaternion.premultiply(Si),this}rotateX(t){return this.rotateOnAxis(Ci,t)}rotateY(t){return this.rotateOnAxis(Ri,t)}rotateZ(t){return this.rotateOnAxis(Ii,t)}translateOnAxis(t,e){return wi.copy(t).applyQuaternion(this.quaternion),this.position.add(wi.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(Ci,t)}translateY(t){return this.translateOnAxis(Ri,t)}translateZ(t){return this.translateOnAxis(Ii,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(Ti.copy(this.matrixWorld).invert())}lookAt(t,e,n){t.isVector3?Ei.copy(t):Ei.set(t,e,n);const i=this.parent;this.updateWorldMatrix(!0,!1),Pi.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ti.lookAt(Pi,Ei,this.up):Ti.lookAt(Ei,Pi,this.up),this.quaternion.setFromRotationMatrix(Ti),i&&(Ti.extractRotation(i.matrixWorld),Si.setFromRotationMatrix(Ti),this.quaternion.premultiply(Si.invert()))}add(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);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?(null!==t.parent&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent(Di)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}const e=this.children.indexOf(t);return-1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(Oi)),this}removeFromParent(){const t=this.parent;return null!==t&&t.remove(this),this}clear(){for(let t=0;t<this.children.length;t++){const e=this.children[t];e.parent=null,e.dispatchEvent(Oi)}return this.children.length=0,this}attach(t){return this.updateWorldMatrix(!0,!1),Ti.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),Ti.multiply(t.parent.matrixWorld)),t.applyMatrix4(Ti),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,i=this.children.length;n<i;n++){const i=this.children[n],r=i.getObjectByProperty(t,e);if(void 0!==r)return r}}getObjectsByProperty(t,e){let n=[];this[t]===e&&n.push(this);for(let i=0,r=this.children.length;i<r;i++){const r=this.children[i].getObjectsByProperty(t,e);r.length>0&&(n=n.concat(r))}return n}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Pi,t,Li),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Pi,Ai,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,i=e.length;n<i;n++)e[n].traverse(t)}traverseVisible(t){if(!1===this.visible)return;t(this);const e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverseVisible(t)}traverseAncestors(t){const e=this.parent;null!==e&&(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)&&(null===this.parent?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,i=e.length;n<i;n++){const i=e[n];!0!==i.matrixWorldAutoUpdate&&!0!==t||i.updateMatrixWorld(t)}}updateWorldMatrix(t,e){const n=this.parent;if(!0===t&&null!==n&&!0===n.matrixWorldAutoUpdate&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===e){const t=this.children;for(let e=0,n=t.length;e<n;e++){const n=t[e];!0===n.matrixWorldAutoUpdate&&n.updateWorldMatrix(!1,!0)}}}toJSON(t){const e=void 0===t||"string"===typeof t,n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});const i={};function r(e,n){return void 0===e[n.uuid]&&(e[n.uuid]=n.toJSON(t)),n.uuid}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),!0===this.castShadow&&(i.castShadow=!0),!0===this.receiveShadow&&(i.receiveShadow=!0),!1===this.visible&&(i.visible=!1),!1===this.frustumCulled&&(i.frustumCulled=!1),0!==this.renderOrder&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(i.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(i.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(t.geometries,this.geometry);const e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){const n=e.shapes;if(Array.isArray(n))for(let e=0,i=n.length;e<i;e++){const i=n[e];r(t.shapes,i)}else r(t.shapes,n)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(r(t.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const e=[];for(let n=0,i=this.material.length;n<i;n++)e.push(r(t.materials,this.material[n]));i.material=e}else i.material=r(t.materials,this.material);if(this.children.length>0){i.children=[];for(let e=0;e<this.children.length;e++)i.children.push(this.children[e].toJSON(t).object)}if(this.animations.length>0){i.animations=[];for(let e=0;e<this.animations.length;e++){const n=this.animations[e];i.animations.push(r(t.animations,n))}}if(e){const e=o(t.geometries),i=o(t.materials),r=o(t.textures),a=o(t.images),s=o(t.shapes),l=o(t.skeletons),u=o(t.animations),h=o(t.nodes);e.length>0&&(n.geometries=e),i.length>0&&(n.materials=i),r.length>0&&(n.textures=r),a.length>0&&(n.images=a),s.length>0&&(n.shapes=s),l.length>0&&(n.skeletons=l),u.length>0&&(n.animations=u),h.length>0&&(n.nodes=h)}return n.object=i,n;function o(t){const e=[];for(const n in t){const i=t[n];delete i.metadata,e.push(i)}return e}}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.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,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)),!0===e)for(let n=0;n<t.children.length;n++){const e=t.children[n];this.add(e.clone())}return this}}zi.DEFAULT_UP=new On(0,1,0),zi.DEFAULT_MATRIX_AUTO_UPDATE=!0,zi.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Ni=new On,ki=new On,Ui=new On,Bi=new On,Fi=new On,Vi=new On,Hi=new On,Wi=new On,Gi=new On,ji=new On;class Zi{constructor(t=new On,e=new On,n=new On){this.a=t,this.b=e,this.c=n}static getNormal(t,e,n,i){i.subVectors(n,e),Ni.subVectors(t,e),i.cross(Ni);const r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(t,e,n,i,r){Ni.subVectors(i,e),ki.subVectors(n,e),Ui.subVectors(t,e);const o=Ni.dot(Ni),a=Ni.dot(ki),s=Ni.dot(Ui),l=ki.dot(ki),u=ki.dot(Ui),h=o*l-a*a;if(0===h)return r.set(-2,-1,-1);const c=1/h,d=(l*s-a*u)*c,p=(o*u-a*s)*c;return r.set(1-d-p,p,d)}static containsPoint(t,e,n,i){return this.getBarycoord(t,e,n,i,Bi),Bi.x>=0&&Bi.y>=0&&Bi.x+Bi.y<=1}static getUV(t,e,n,i,r,o,a,s){return this.getBarycoord(t,e,n,i,Bi),s.set(0,0),s.addScaledVector(r,Bi.x),s.addScaledVector(o,Bi.y),s.addScaledVector(a,Bi.z),s}static isFrontFacing(t,e,n,i){return Ni.subVectors(n,e),ki.subVectors(t,e),Ni.cross(ki).dot(i)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this}setFromAttributeAndIndices(t,e,n,i){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,i),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 Ni.subVectors(this.c,this.b),ki.subVectors(this.a,this.b),.5*Ni.cross(ki).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Zi.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return Zi.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,n,i,r){return Zi.getUV(t,this.a,this.b,this.c,e,n,i,r)}containsPoint(t){return Zi.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Zi.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const n=this.a,i=this.b,r=this.c;let o,a;Fi.subVectors(i,n),Vi.subVectors(r,n),Wi.subVectors(t,n);const s=Fi.dot(Wi),l=Vi.dot(Wi);if(s<=0&&l<=0)return e.copy(n);Gi.subVectors(t,i);const u=Fi.dot(Gi),h=Vi.dot(Gi);if(u>=0&&h<=u)return e.copy(i);const c=s*h-u*l;if(c<=0&&s>=0&&u<=0)return o=s/(s-u),e.copy(n).addScaledVector(Fi,o);ji.subVectors(t,r);const d=Fi.dot(ji),p=Vi.dot(ji);if(p>=0&&d<=p)return e.copy(r);const f=d*l-s*p;if(f<=0&&l>=0&&p<=0)return a=l/(l-p),e.copy(n).addScaledVector(Vi,a);const m=u*p-d*h;if(m<=0&&h-u>=0&&d-p>=0)return Hi.subVectors(r,i),a=(h-u)/(h-u+(d-p)),e.copy(i).addScaledVector(Hi,a);const g=1/(m+f+c);return o=f*g,a=c*g,e.copy(n).addScaledVector(Fi,o).addScaledVector(Vi,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}let qi=0;class Xi extends Ie{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:qi++}),this.uuid=ke(),this.name="",this.type="Material",this.blending=g,this.side=d,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=C,this.blendDst=R,this.blendEquation=b,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=F,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Le,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Pe,this.stencilZFail=Pe,this.stencilZPass=Pe,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.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!==t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(void 0!==t)for(const e in t){const n=t[e];if(void 0===n){console.warn("THREE.Material: '"+e+"' parameter is undefined.");continue}const i=this[e];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[e]=n:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}}toJSON(t){const e=void 0===t||"string"===typeof t;e&&(t={textures:{},images:{}});const n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function i(t){const e=[];for(const n in t){const i=t[n];delete i.metadata,e.push(i)}return e}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()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(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()),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),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.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==g&&(n.blending=this.blending),this.side!==d&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(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,void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(n.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.forceSinglePass&&(n.forceSinglePass=this.forceSinglePass),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=this.flatShading),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),e){const e=i(t.textures),r=i(t.images);e.length>0&&(n.textures=e),r.length>0&&(n.images=r)}return n}clone(){return(new this.constructor).copy(this)}copy(t){this.name=t.name,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(null!==e){const t=e.length;n=new Array(t);for(let i=0;i!==t;++i)n[i]=e[i].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.forceSinglePass=t.forceSinglePass,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){!0===t&&this.version++}}class Yi extends Xi{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Mn(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=j,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,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.fog=t.fog,this}}const Ki=new On,Ji=new sn;class $i{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=n,this.usage=Ae,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&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 i=0,r=this.itemSize;i<r;i++)this.array[t+i]=e.array[n+i];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(2===this.itemSize)for(let e=0,n=this.count;e<n;e++)Ji.fromBufferAttribute(this,e),Ji.applyMatrix3(t),this.setXY(e,Ji.x,Ji.y);else if(3===this.itemSize)for(let e=0,n=this.count;e<n;e++)Ki.fromBufferAttribute(this,e),Ki.applyMatrix3(t),this.setXYZ(e,Ki.x,Ki.y,Ki.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)Ki.fromBufferAttribute(this,e),Ki.applyMatrix4(t),this.setXYZ(e,Ki.x,Ki.y,Ki.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)Ki.fromBufferAttribute(this,e),Ki.applyNormalMatrix(t),this.setXYZ(e,Ki.x,Ki.y,Ki.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)Ki.fromBufferAttribute(this,e),Ki.transformDirection(t),this.setXYZ(e,Ki.x,Ki.y,Ki.z);return this}set(t,e=0){return this.array.set(t,e),this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=rn(e,this.array)),e}setX(t,e){return this.normalized&&(e=on(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=rn(e,this.array)),e}setY(t,e){return this.normalized&&(e=on(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=rn(e,this.array)),e}setZ(t,e){return this.normalized&&(e=on(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=rn(e,this.array)),e}setW(t,e){return this.normalized&&(e=on(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=on(e,this.array),n=on(n,this.array)),this.array[t+0]=e,this.array[t+1]=n,this}setXYZ(t,e,n,i){return t*=this.itemSize,this.normalized&&(e=on(e,this.array),n=on(n,this.array),i=on(i,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this}setXYZW(t,e,n,i,r){return t*=this.itemSize,this.normalized&&(e=on(e,this.array),n=on(n,this.array),i=on(i,this.array),r=on(r,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this.array[t+3]=r,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.from(this.array),normalized:this.normalized};return""!==this.name&&(t.name=this.name),this.usage!==Ae&&(t.usage=this.usage),0===this.updateRange.offset&&-1===this.updateRange.count||(t.updateRange=this.updateRange),t}copyColorsArray(){console.error("THREE.BufferAttribute: copyColorsArray() was removed in r144.")}copyVector2sArray(){console.error("THREE.BufferAttribute: copyVector2sArray() was removed in r144.")}copyVector3sArray(){console.error("THREE.BufferAttribute: copyVector3sArray() was removed in r144.")}copyVector4sArray(){console.error("THREE.BufferAttribute: copyVector4sArray() was removed in r144.")}}class Qi extends $i{constructor(t,e,n){super(new Uint16Array(t),e,n)}}class tr extends $i{constructor(t,e,n){super(new Uint32Array(t),e,n)}}class er extends $i{constructor(t,e,n){super(new Float32Array(t),e,n)}}let nr=0;const ir=new hi,rr=new zi,or=new On,ar=new kn,sr=new kn,lr=new On;class ur extends Ie{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:nr++}),this.uuid=ke(),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(hn(t)?tr:Qi)(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 void 0!==this.attributes[t]}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;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const e=(new ln).getNormalMatrix(t);n.applyNormalMatrix(e),n.needsUpdate=!0}const i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(t),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(t){return ir.makeRotationFromQuaternion(t),this.applyMatrix4(ir),this}rotateX(t){return ir.makeRotationX(t),this.applyMatrix4(ir),this}rotateY(t){return ir.makeRotationY(t),this.applyMatrix4(ir),this}rotateZ(t){return ir.makeRotationZ(t),this.applyMatrix4(ir),this}translate(t,e,n){return ir.makeTranslation(t,e,n),this.applyMatrix4(ir),this}scale(t,e,n){return ir.makeScale(t,e,n),this.applyMatrix4(ir),this}lookAt(t){return rr.lookAt(t),rr.updateMatrix(),this.applyMatrix4(rr.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(or).negate(),this.translate(or.x,or.y,or.z),this}setFromPoints(t){const e=[];for(let n=0,i=t.length;n<i;n++){const i=t[n];e.push(i.x,i.y,i.z||0)}return this.setAttribute("position",new er(e,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new kn);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 On(-1/0,-1/0,-1/0),new On(1/0,1/0,1/0));if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(let n=0,i=e.length;n<i;n++){const t=e[n];ar.setFromBufferAttribute(t),this.morphTargetsRelative?(lr.addVectors(this.boundingBox.min,ar.min),this.boundingBox.expandByPoint(lr),lr.addVectors(this.boundingBox.max,ar.max),this.boundingBox.expandByPoint(lr)):(this.boundingBox.expandByPoint(ar.min),this.boundingBox.expandByPoint(ar.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(){null===this.boundingSphere&&(this.boundingSphere=new ei);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 On,1/0);if(t){const n=this.boundingSphere.center;if(ar.setFromBufferAttribute(t),e)for(let t=0,r=e.length;t<r;t++){const n=e[t];sr.setFromBufferAttribute(n),this.morphTargetsRelative?(lr.addVectors(ar.min,sr.min),ar.expandByPoint(lr),lr.addVectors(ar.max,sr.max),ar.expandByPoint(lr)):(ar.expandByPoint(sr.min),ar.expandByPoint(sr.max))}ar.getCenter(n);let i=0;for(let e=0,r=t.count;e<r;e++)lr.fromBufferAttribute(t,e),i=Math.max(i,n.distanceToSquared(lr));if(e)for(let r=0,o=e.length;r<o;r++){const o=e[r],a=this.morphTargetsRelative;for(let e=0,r=o.count;e<r;e++)lr.fromBufferAttribute(o,e),a&&(or.fromBufferAttribute(t,e),lr.add(or)),i=Math.max(i,n.distanceToSquared(lr))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const t=this.index,e=this.attributes;if(null===t||void 0===e.position||void 0===e.normal||void 0===e.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const n=t.array,i=e.position.array,r=e.normal.array,o=e.uv.array,a=i.length/3;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new $i(new Float32Array(4*a),4));const s=this.getAttribute("tangent").array,l=[],u=[];for(let T=0;T<a;T++)l[T]=new On,u[T]=new On;const h=new On,c=new On,d=new On,p=new sn,f=new sn,m=new sn,g=new On,_=new On;function v(t,e,n){h.fromArray(i,3*t),c.fromArray(i,3*e),d.fromArray(i,3*n),p.fromArray(o,2*t),f.fromArray(o,2*e),m.fromArray(o,2*n),c.sub(h),d.sub(h),f.sub(p),m.sub(p);const r=1/(f.x*m.y-m.x*f.y);isFinite(r)&&(g.copy(c).multiplyScalar(m.y).addScaledVector(d,-f.y).multiplyScalar(r),_.copy(d).multiplyScalar(f.x).addScaledVector(c,-m.x).multiplyScalar(r),l[t].add(g),l[e].add(g),l[n].add(g),u[t].add(_),u[e].add(_),u[n].add(_))}let y=this.groups;0===y.length&&(y=[{start:0,count:n.length}]);for(let T=0,E=y.length;T<E;++T){const t=y[T],e=t.start,i=t.count;for(let r=e,o=e+i;r<o;r+=3)v(n[r+0],n[r+1],n[r+2])}const x=new On,b=new On,M=new On,w=new On;function S(t){M.fromArray(r,3*t),w.copy(M);const e=l[t];x.copy(e),x.sub(M.multiplyScalar(M.dot(e))).normalize(),b.crossVectors(w,e);const n=b.dot(u[t]),i=n<0?-1:1;s[4*t]=x.x,s[4*t+1]=x.y,s[4*t+2]=x.z,s[4*t+3]=i}for(let T=0,E=y.length;T<E;++T){const t=y[T],e=t.start,i=t.count;for(let r=e,o=e+i;r<o;r+=3)S(n[r+0]),S(n[r+1]),S(n[r+2])}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(void 0!==e){let n=this.getAttribute("normal");if(void 0===n)n=new $i(new Float32Array(3*e.count),3),this.setAttribute("normal",n);else for(let t=0,e=n.count;t<e;t++)n.setXYZ(t,0,0,0);const i=new On,r=new On,o=new On,a=new On,s=new On,l=new On,u=new On,h=new On;if(t)for(let c=0,d=t.count;c<d;c+=3){const d=t.getX(c+0),p=t.getX(c+1),f=t.getX(c+2);i.fromBufferAttribute(e,d),r.fromBufferAttribute(e,p),o.fromBufferAttribute(e,f),u.subVectors(o,r),h.subVectors(i,r),u.cross(h),a.fromBufferAttribute(n,d),s.fromBufferAttribute(n,p),l.fromBufferAttribute(n,f),a.add(u),s.add(u),l.add(u),n.setXYZ(d,a.x,a.y,a.z),n.setXYZ(p,s.x,s.y,s.z),n.setXYZ(f,l.x,l.y,l.z)}else for(let t=0,c=e.count;t<c;t+=3)i.fromBufferAttribute(e,t+0),r.fromBufferAttribute(e,t+1),o.fromBufferAttribute(e,t+2),u.subVectors(o,r),h.subVectors(i,r),u.cross(h),n.setXYZ(t+0,u.x,u.y,u.z),n.setXYZ(t+1,u.x,u.y,u.z),n.setXYZ(t+2,u.x,u.y,u.z);this.normalizeNormals(),n.needsUpdate=!0}}merge(){return console.error("THREE.BufferGeometry.merge() has been removed. Use THREE.BufferGeometryUtils.mergeBufferGeometries() instead."),this}normalizeNormals(){const t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)lr.fromBufferAttribute(t,e),lr.normalize(),t.setXYZ(e,lr.x,lr.y,lr.z)}toNonIndexed(){function t(t,e){const n=t.array,i=t.itemSize,r=t.normalized,o=new n.constructor(e.length*i);let a=0,s=0;for(let l=0,u=e.length;l<u;l++){a=t.isInterleavedBufferAttribute?e[l]*t.data.stride+t.offset:e[l]*i;for(let t=0;t<i;t++)o[s++]=n[a++]}return new $i(o,i,r)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new ur,n=this.index.array,i=this.attributes;for(const a in i){const r=i[a],o=t(r,n);e.setAttribute(a,o)}const r=this.morphAttributes;for(const a in r){const i=[],o=r[a];for(let e=0,r=o.length;e<r;e++){const r=o[e],a=t(r,n);i.push(a)}e.morphAttributes[a]=i}e.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let a=0,s=o.length;a<s;a++){const t=o[a];e.addGroup(t.start,t.count,t.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),void 0!==this.parameters){const e=this.parameters;for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const s in n){const e=n[s];t.data.attributes[s]=e.toJSON(t.data)}const i={};let r=!1;for(const s in this.morphAttributes){const e=this.morphAttributes[s],n=[];for(let i=0,r=e.length;i<r;i++){const r=e[i];n.push(r.toJSON(t.data))}n.length>0&&(i[s]=n,r=!0)}r&&(t.data.morphAttributes=i,t.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(t.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return null!==a&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),t}clone(){return(new this.constructor).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;null!==n&&this.setIndex(n.clone(e));const i=t.attributes;for(const l in i){const t=i[l];this.setAttribute(l,t.clone(e))}const r=t.morphAttributes;for(const l in r){const t=[],n=r[l];for(let i=0,r=n.length;i<r;i++)t.push(n[i].clone(e));this.morphAttributes[l]=t}this.morphTargetsRelative=t.morphTargetsRelative;const o=t.groups;for(let l=0,u=o.length;l<u;l++){const t=o[l];this.addGroup(t.start,t.count,t.materialIndex)}const a=t.boundingBox;null!==a&&(this.boundingBox=a.clone());const s=t.boundingSphere;return null!==s&&(this.boundingSphere=s.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,void 0!==t.parameters&&(this.parameters=Object.assign({},t.parameters)),this}dispose(){this.dispatchEvent({type:"dispose"})}}const hr=new hi,cr=new ui,dr=new ei,pr=new On,fr=new On,mr=new On,gr=new On,_r=new On,vr=new sn,yr=new sn,xr=new sn,br=new On,Mr=new On;class wr extends zi{constructor(t=new ur,e=new Yi){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=t.material,this.geometry=t.geometry,this}updateMorphTargets(){const t=this.geometry,e=t.morphAttributes,n=Object.keys(e);if(n.length>0){const t=e[n[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,n=t.length;e<n;e++){const n=t[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}}}getVertexPosition(t,e){const n=this.geometry,i=n.attributes.position,r=n.morphAttributes.position,o=n.morphTargetsRelative;e.fromBufferAttribute(i,t);const a=this.morphTargetInfluences;if(r&&a){_r.set(0,0,0);for(let n=0,i=r.length;n<i;n++){const i=a[n],s=r[n];0!==i&&(gr.fromBufferAttribute(s,t),o?_r.addScaledVector(gr,i):_r.addScaledVector(gr.sub(e),i))}e.add(_r)}return this.isSkinnedMesh&&this.boneTransform(t,e),e}raycast(t,e){const n=this.geometry,i=this.material,r=this.matrixWorld;if(void 0===i)return;if(null===n.boundingSphere&&n.computeBoundingSphere(),dr.copy(n.boundingSphere),dr.applyMatrix4(r),!1===t.ray.intersectsSphere(dr))return;if(hr.copy(r).invert(),cr.copy(t.ray).applyMatrix4(hr),null!==n.boundingBox&&!1===cr.intersectsBox(n.boundingBox))return;let o;const a=n.index,s=n.attributes.position,l=n.attributes.uv,u=n.attributes.uv2,h=n.groups,c=n.drawRange;if(null!==a)if(Array.isArray(i))for(let d=0,p=h.length;d<p;d++){const n=h[d],r=i[n.materialIndex],s=Math.max(n.start,c.start),p=Math.min(a.count,Math.min(n.start+n.count,c.start+c.count));for(let i=s,h=p;i<h;i+=3){const s=a.getX(i),h=a.getX(i+1),c=a.getX(i+2);o=Tr(this,r,t,cr,l,u,s,h,c),o&&(o.faceIndex=Math.floor(i/3),o.face.materialIndex=n.materialIndex,e.push(o))}}else{const n=Math.max(0,c.start),r=Math.min(a.count,c.start+c.count);for(let s=n,h=r;s<h;s+=3){const n=a.getX(s),r=a.getX(s+1),h=a.getX(s+2);o=Tr(this,i,t,cr,l,u,n,r,h),o&&(o.faceIndex=Math.floor(s/3),e.push(o))}}else if(void 0!==s)if(Array.isArray(i))for(let d=0,p=h.length;d<p;d++){const n=h[d],r=i[n.materialIndex],a=Math.max(n.start,c.start),p=Math.min(s.count,Math.min(n.start+n.count,c.start+c.count));for(let i=a,s=p;i<s;i+=3){const a=i,s=i+1,h=i+2;o=Tr(this,r,t,cr,l,u,a,s,h),o&&(o.faceIndex=Math.floor(i/3),o.face.materialIndex=n.materialIndex,e.push(o))}}else{const n=Math.max(0,c.start),r=Math.min(s.count,c.start+c.count);for(let a=n,s=r;a<s;a+=3){const n=a,r=a+1,s=a+2;o=Tr(this,i,t,cr,l,u,n,r,s),o&&(o.faceIndex=Math.floor(a/3),e.push(o))}}}}function Sr(t,e,n,i,r,o,a,s){let l;if(l=e.side===p?i.intersectTriangle(a,o,r,!0,s):i.intersectTriangle(r,o,a,e.side===d,s),null===l)return null;Mr.copy(s),Mr.applyMatrix4(t.matrixWorld);const u=n.ray.origin.distanceTo(Mr);return u<n.near||u>n.far?null:{distance:u,point:Mr.clone(),object:t}}function Tr(t,e,n,i,r,o,a,s,l){t.getVertexPosition(a,pr),t.getVertexPosition(s,fr),t.getVertexPosition(l,mr);const u=Sr(t,e,n,i,pr,fr,mr,br);if(u){r&&(vr.fromBufferAttribute(r,a),yr.fromBufferAttribute(r,s),xr.fromBufferAttribute(r,l),u.uv=Zi.getUV(br,pr,fr,mr,vr,yr,xr,new sn)),o&&(vr.fromBufferAttribute(o,a),yr.fromBufferAttribute(o,s),xr.fromBufferAttribute(o,l),u.uv2=Zi.getUV(br,pr,fr,mr,vr,yr,xr,new sn));const t={a:a,b:s,c:l,normal:new On,materialIndex:0};Zi.getNormal(pr,fr,mr,t.normal),u.face=t}return u}class Er extends ur{constructor(t=1,e=1,n=1,i=1,r=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:o};const a=this;i=Math.floor(i),r=Math.floor(r),o=Math.floor(o);const s=[],l=[],u=[],h=[];let c=0,d=0;function p(t,e,n,i,r,o,p,f,m,g,_){const v=o/m,y=p/g,x=o/2,b=p/2,M=f/2,w=m+1,S=g+1;let T=0,E=0;const P=new On;for(let a=0;a<S;a++){const o=a*y-b;for(let s=0;s<w;s++){const c=s*v-x;P[t]=c*i,P[e]=o*r,P[n]=M,l.push(P.x,P.y,P.z),P[t]=0,P[e]=0,P[n]=f>0?1:-1,u.push(P.x,P.y,P.z),h.push(s/m),h.push(1-a/g),T+=1}}for(let a=0;a<g;a++)for(let t=0;t<m;t++){const e=c+t+w*a,n=c+t+w*(a+1),i=c+(t+1)+w*(a+1),r=c+(t+1)+w*a;s.push(e,n,r),s.push(n,i,r),E+=6}a.addGroup(d,E,_),d+=E,c+=T}p("z","y","x",-1,-1,n,e,t,o,r,0),p("z","y","x",1,-1,n,e,-t,o,r,1),p("x","z","y",1,1,t,n,e,i,o,2),p("x","z","y",1,-1,t,n,-e,i,o,3),p("x","y","z",1,-1,t,e,n,i,r,4),p("x","y","z",-1,-1,t,e,-n,i,r,5),this.setIndex(s),this.setAttribute("position",new er(l,3)),this.setAttribute("normal",new er(u,3)),this.setAttribute("uv",new er(h,2))}static fromJSON(t){return new Er(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}function Pr(t){const e={};for(const n in t){e[n]={};for(const i in t[n]){const r=t[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?e[n][i]=r.clone():Array.isArray(r)?e[n][i]=r.slice():e[n][i]=r}}return e}function Lr(t){const e={};for(let n=0;n<t.length;n++){const i=Pr(t[n]);for(const t in i)e[t]=i[t]}return e}function Ar(t){const e=[];for(let n=0;n<t.length;n++)e.push(t[n].clone());return e}function Cr(t){return null===t.getRenderTarget()&&t.outputEncoding===xe?Te:Ee}const Rr={clone:Pr,merge:Lr};var Ir="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",Dr="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";class Or extends Xi{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=Ir,this.fragmentShader=Dr,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!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,void 0!==t&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Pr(t.uniforms),this.uniformsGroups=Ar(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,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 i in this.uniforms){const n=this.uniforms[i],r=n.value;r&&r.isTexture?e.uniforms[i]={type:"t",value:r.toJSON(t).uuid}:r&&r.isColor?e.uniforms[i]={type:"c",value:r.getHex()}:r&&r.isVector2?e.uniforms[i]={type:"v2",value:r.toArray()}:r&&r.isVector3?e.uniforms[i]={type:"v3",value:r.toArray()}:r&&r.isVector4?e.uniforms[i]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?e.uniforms[i]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?e.uniforms[i]={type:"m4",value:r.toArray()}:e.uniforms[i]={value:r}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;const n={};for(const i in this.extensions)!0===this.extensions[i]&&(n[i]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}}class zr extends zi{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new hi,this.projectionMatrix=new hi,this.projectionMatrixInverse=new hi}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)}}class Nr extends zr{constructor(t=50,e=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=i,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=null===t.view?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*Ne*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(.5*ze*this.fov);return.5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*Ne*Math.atan(Math.tan(.5*ze*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,i,r,o){this.aspect=t/e,null===this.view&&(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=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(.5*ze*this.fov)/this.zoom,n=2*e,i=this.aspect*n,r=-.5*i;const o=this.view;if(null!==this.view&&this.view.enabled){const t=o.fullWidth,a=o.fullHeight;r+=o.offsetX*i/t,e-=o.offsetY*n/a,i*=o.width/t,n*=o.height/a}const a=this.filmOffset;0!==a&&(r+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,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,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}const kr=-90,Ur=1;class Br extends zi{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n;const i=new Nr(kr,Ur,t,e);i.layers=this.layers,i.up.set(0,1,0),i.lookAt(1,0,0),this.add(i);const r=new Nr(kr,Ur,t,e);r.layers=this.layers,r.up.set(0,1,0),r.lookAt(-1,0,0),this.add(r);const o=new Nr(kr,Ur,t,e);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(0,1,0),this.add(o);const a=new Nr(kr,Ur,t,e);a.layers=this.layers,a.up.set(0,0,1),a.lookAt(0,-1,0),this.add(a);const s=new Nr(kr,Ur,t,e);s.layers=this.layers,s.up.set(0,1,0),s.lookAt(0,0,1),this.add(s);const l=new Nr(kr,Ur,t,e);l.layers=this.layers,l.up.set(0,1,0),l.lookAt(0,0,-1),this.add(l)}update(t,e){null===this.parent&&this.updateMatrixWorld();const n=this.renderTarget,[i,r,o,a,s,l]=this.children,u=t.getRenderTarget(),h=t.toneMapping,c=t.xr.enabled;t.toneMapping=X,t.xr.enabled=!1;const d=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0),t.render(e,i),t.setRenderTarget(n,1),t.render(e,r),t.setRenderTarget(n,2),t.render(e,o),t.setRenderTarget(n,3),t.render(e,a),t.setRenderTarget(n,4),t.render(e,s),n.texture.generateMipmaps=d,t.setRenderTarget(n,5),t.render(e,l),t.setRenderTarget(u),t.toneMapping=h,t.xr.enabled=c,n.texture.needsPMREMUpdate=!0}}class Fr extends Ln{constructor(t,e,n,i,r,o,a,s,l,u){t=void 0!==t?t:[],e=void 0!==e?e:et,super(t,e,n,i,r,o,a,s,l,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class Vr extends Cn{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const n={width:t,height:t,depth:1},i=[n,n,n,n,n,n];this.texture=new Fr(i,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==e.generateMipmaps&&e.generateMipmaps,this.texture.minFilter=void 0!==e.minFilter?e.minFilter:dt}fromEquirectangularTexture(t,e){this.texture.type=e.type,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:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},i=new Er(5,5,5),r=new Or({name:"CubemapFromEquirect",uniforms:Pr(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:p,blending:m});r.uniforms.tEquirect.value=e;const o=new wr(i,r),a=e.minFilter;e.minFilter===ft&&(e.minFilter=dt);const s=new Br(1,10,this);return s.update(t,o),e.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(t,e,n,i){const r=t.getRenderTarget();for(let o=0;o<6;o++)t.setRenderTarget(this,o),t.clear(e,n,i);t.setRenderTarget(r)}}const Hr=new On,Wr=new On,Gr=new ln;class jr{constructor(t=new On(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){const i=Hr.subVectors(n,e).cross(Wr.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)}intersectLine(t,e){const n=t.delta(Hr),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;const r=-(t.start.dot(this.normal)+this.constant)/i;return r<0||r>1?null:e.copy(n).multiplyScalar(r).add(t.start)}intersectsLine(t){const e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const n=e||Gr.getNormalMatrix(t),i=this.coplanarPoint(Hr).applyMatrix4(t),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const Zr=new ei,qr=new On;class Xr{constructor(t=new jr,e=new jr,n=new jr,i=new jr,r=new jr,o=new jr){this.planes=[t,e,n,i,r,o]}set(t,e,n,i,r,o){const a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(i),a[4].copy(r),a[5].copy(o),this}copy(t){const e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t){const e=this.planes,n=t.elements,i=n[0],r=n[1],o=n[2],a=n[3],s=n[4],l=n[5],u=n[6],h=n[7],c=n[8],d=n[9],p=n[10],f=n[11],m=n[12],g=n[13],_=n[14],v=n[15];return e[0].setComponents(a-i,h-s,f-c,v-m).normalize(),e[1].setComponents(a+i,h+s,f+c,v+m).normalize(),e[2].setComponents(a+r,h+l,f+d,v+g).normalize(),e[3].setComponents(a-r,h-l,f-d,v-g).normalize(),e[4].setComponents(a-o,h-u,f-p,v-_).normalize(),e[5].setComponents(a+o,h+u,f+p,v+_).normalize(),this}intersectsObject(t){const e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),Zr.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(Zr)}intersectsSprite(t){return Zr.center.set(0,0,0),Zr.radius=.7071067811865476,Zr.applyMatrix4(t.matrixWorld),this.intersectsSphere(Zr)}intersectsSphere(t){const e=this.planes,n=t.center,i=-t.radius;for(let r=0;r<6;r++){const t=e[r].distanceToPoint(n);if(t<i)return!1}return!0}intersectsBox(t){const e=this.planes;for(let n=0;n<6;n++){const i=e[n];if(qr.x=i.normal.x>0?t.max.x:t.min.x,qr.y=i.normal.y>0?t.max.y:t.min.y,qr.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(qr)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function Yr(){let t=null,e=!1,n=null,i=null;function r(e,o){n(e,o),i=t.requestAnimationFrame(r)}return{start:function(){!0!==e&&null!==n&&(i=t.requestAnimationFrame(r),e=!0)},stop:function(){t.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(t){n=t},setContext:function(e){t=e}}}function Kr(t,e){const n=e.isWebGL2,i=new WeakMap;function r(e,i){const r=e.array,o=e.usage,a=t.createBuffer();let s;if(t.bindBuffer(i,a),t.bufferData(i,r,o),e.onUploadCallback(),r instanceof Float32Array)s=5126;else if(r instanceof Uint16Array)if(e.isFloat16BufferAttribute){if(!n)throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");s=5131}else s=5123;else if(r instanceof Int16Array)s=5122;else if(r instanceof Uint32Array)s=5125;else if(r instanceof Int32Array)s=5124;else if(r instanceof Int8Array)s=5120;else if(r instanceof Uint8Array)s=5121;else{if(!(r instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+r);s=5121}return{buffer:a,type:s,bytesPerElement:r.BYTES_PER_ELEMENT,version:e.version}}function o(e,i,r){const o=i.array,a=i.updateRange;t.bindBuffer(r,e),-1===a.count?t.bufferSubData(r,0,o):(n?t.bufferSubData(r,a.offset*o.BYTES_PER_ELEMENT,o,a.offset,a.count):t.bufferSubData(r,a.offset*o.BYTES_PER_ELEMENT,o.subarray(a.offset,a.offset+a.count)),a.count=-1),i.onUploadCallback()}function a(t){return t.isInterleavedBufferAttribute&&(t=t.data),i.get(t)}function s(e){e.isInterleavedBufferAttribute&&(e=e.data);const n=i.get(e);n&&(t.deleteBuffer(n.buffer),i.delete(e))}function l(t,e){if(t.isGLBufferAttribute){const e=i.get(t);return void((!e||e.version<t.version)&&i.set(t,{buffer:t.buffer,type:t.type,bytesPerElement:t.elementSize,version:t.version}))}t.isInterleavedBufferAttribute&&(t=t.data);const n=i.get(t);void 0===n?i.set(t,r(t,e)):n.version<t.version&&(o(n.buffer,t,e),n.version=t.version)}return{get:a,remove:s,update:l}}class Jr extends ur{constructor(t=1,e=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:i};const r=t/2,o=e/2,a=Math.floor(n),s=Math.floor(i),l=a+1,u=s+1,h=t/a,c=e/s,d=[],p=[],f=[],m=[];for(let g=0;g<u;g++){const t=g*c-o;for(let e=0;e<l;e++){const n=e*h-r;p.push(n,-t,0),f.push(0,0,1),m.push(e/a),m.push(1-g/s)}}for(let g=0;g<s;g++)for(let t=0;t<a;t++){const e=t+l*g,n=t+l*(g+1),i=t+1+l*(g+1),r=t+1+l*g;d.push(e,n,r),d.push(n,i,r)}this.setIndex(d),this.setAttribute("position",new er(p,3)),this.setAttribute("normal",new er(f,3)),this.setAttribute("uv",new er(m,2))}static fromJSON(t){return new Jr(t.width,t.height,t.widthSegments,t.heightSegments)}}var $r="#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",Qr="#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",to="#ifdef USE_ALPHATEST\n\tif ( diffuseColor.a < alphaTest ) discard;\n#endif",eo="#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",no="#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",io="#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",ro="vec3 transformed = vec3( position );",oo="vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",ao="vec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( V * D );\n}\n#ifdef USE_IRIDESCENCE\n\tvec3 BRDF_GGX_Iridescence( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float iridescence, const in vec3 iridescenceFresnel, const in float roughness ) {\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = mix( F_Schlick( f0, f90, dotVH ), iridescenceFresnel, iridescence );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif",so="#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\t return vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat R21 = R12;\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif",lo="#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos.xyz );\n\t\tvec3 vSigmaY = dFdy( surf_pos.xyz );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",uo="#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",ho="#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",co="#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",po="#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",fo="#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",mo="#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",go="#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",_o="#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",vo="#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",yo="#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",xo="vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",bo="#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",Mo="#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",wo="#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",So="#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",To="gl_FragColor = linearToOutputTexel( gl_FragColor );",Eo="vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}",Po="#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",Lo="#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",Ao="#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",Co="#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",Ro="#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",Io="#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",Do="#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",Oo="#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",zo="#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",No="#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",ko="#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",Uo="#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",Bo="LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",Fo="varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",Vo="uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#else\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",Ho="#if defined( USE_ENVMAP )\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n#endif",Wo="ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",Go="varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon",jo="BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",Zo="varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong",qo="PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULARINTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n\t\t#endif\n\t\t#ifdef USE_SPECULARCOLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vUv ).rgb;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;\n\t#endif\n#endif",Xo="struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\treflectedLight.directSpecular += irradiance * BRDF_GGX_Iridescence( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness );\n\t#else\n\t\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",Yo="\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometry.viewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",Ko="#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",Jo="#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",$o="#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",Qo="#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",ta="#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",ea="#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",na="#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",ia="#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",ra="#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",oa="#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",aa="float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",sa="#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",la="#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",ua="#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",ha="#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",ca="#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",da="float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",pa="#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",fa="#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",ma="#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",ga="#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",_a="#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\t}\n#endif",va="#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",ya="#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n\t#endif\n#endif",xa="#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",ba="#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",Ma="#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",wa="vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",Sa="#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",Ta="vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",Ea="#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",Pa="#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",La="float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",Aa="#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",Ca="#if NUM_SPOT_LIGHT_COORDS > 0\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",Ra="#if NUM_SPOT_LIGHT_COORDS > 0\n uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",Ia="#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif",Da="float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",Oa="#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",za="#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tuniform int boneTextureSize;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tfloat j = i * 4.0;\n\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\ty = dy * ( y + 0.5 );\n\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\treturn bone;\n\t}\n#endif",Na="#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",ka="#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",Ua="float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",Ba="#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",Fa="#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",Va="#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",Ha="#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmission.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, material.transmission );\n#endif",Wa="#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\t#ifdef texture2DLodEXT\n\t\t\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#else\n\t\t\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#endif\n\t}\n\tvec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance * radiance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\t}\n#endif",Ga="#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",ja="#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",Za="#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",qa="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",Xa="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",Ya="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",Ka="#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif";const Ja="varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",$a="uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",Qa="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",ts="#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",es="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",ns="uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",is="#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",rs="#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",os="#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",as="#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",ss="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",ls="uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",us="uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",hs="uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",cs="#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",ds="uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",ps="#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",fs="#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",ms="#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",gs="#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",_s="#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",vs="#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",ys="#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",xs="#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",bs="#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",Ms="#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULARINTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n\t#ifdef USE_SPECULARCOLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",ws="#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",Ss="#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",Ts="uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",Es="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",Ps="#include <common>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",Ls="uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",As="uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",Cs="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",Rs={alphamap_fragment:$r,alphamap_pars_fragment:Qr,alphatest_fragment:to,alphatest_pars_fragment:eo,aomap_fragment:no,aomap_pars_fragment:io,begin_vertex:ro,beginnormal_vertex:oo,bsdfs:ao,iridescence_fragment:so,bumpmap_pars_fragment:lo,clipping_planes_fragment:uo,clipping_planes_pars_fragment:ho,clipping_planes_pars_vertex:co,clipping_planes_vertex:po,color_fragment:fo,color_pars_fragment:mo,color_pars_vertex:go,color_vertex:_o,common:vo,cube_uv_reflection_fragment:yo,defaultnormal_vertex:xo,displacementmap_pars_vertex:bo,displacementmap_vertex:Mo,emissivemap_fragment:wo,emissivemap_pars_fragment:So,encodings_fragment:To,encodings_pars_fragment:Eo,envmap_fragment:Po,envmap_common_pars_fragment:Lo,envmap_pars_fragment:Ao,envmap_pars_vertex:Co,envmap_physical_pars_fragment:Ho,envmap_vertex:Ro,fog_vertex:Io,fog_pars_vertex:Do,fog_fragment:Oo,fog_pars_fragment:zo,gradientmap_pars_fragment:No,lightmap_fragment:ko,lightmap_pars_fragment:Uo,lights_lambert_fragment:Bo,lights_lambert_pars_fragment:Fo,lights_pars_begin:Vo,lights_toon_fragment:Wo,lights_toon_pars_fragment:Go,lights_phong_fragment:jo,lights_phong_pars_fragment:Zo,lights_physical_fragment:qo,lights_physical_pars_fragment:Xo,lights_fragment_begin:Yo,lights_fragment_maps:Ko,lights_fragment_end:Jo,logdepthbuf_fragment:$o,logdepthbuf_pars_fragment:Qo,logdepthbuf_pars_vertex:ta,logdepthbuf_vertex:ea,map_fragment:na,map_pars_fragment:ia,map_particle_fragment:ra,map_particle_pars_fragment:oa,metalnessmap_fragment:aa,metalnessmap_pars_fragment:sa,morphcolor_vertex:la,morphnormal_vertex:ua,morphtarget_pars_vertex:ha,morphtarget_vertex:ca,normal_fragment_begin:da,normal_fragment_maps:pa,normal_pars_fragment:fa,normal_pars_vertex:ma,normal_vertex:ga,normalmap_pars_fragment:_a,clearcoat_normal_fragment_begin:va,clearcoat_normal_fragment_maps:ya,clearcoat_pars_fragment:xa,iridescence_pars_fragment:ba,output_fragment:Ma,packing:wa,premultiplied_alpha_fragment:Sa,project_vertex:Ta,dithering_fragment:Ea,dithering_pars_fragment:Pa,roughnessmap_fragment:La,roughnessmap_pars_fragment:Aa,shadowmap_pars_fragment:Ca,shadowmap_pars_vertex:Ra,shadowmap_vertex:Ia,shadowmask_pars_fragment:Da,skinbase_vertex:Oa,skinning_pars_vertex:za,skinning_vertex:Na,skinnormal_vertex:ka,specularmap_fragment:Ua,specularmap_pars_fragment:Ba,tonemapping_fragment:Fa,tonemapping_pars_fragment:Va,transmission_fragment:Ha,transmission_pars_fragment:Wa,uv_pars_fragment:Ga,uv_pars_vertex:ja,uv_vertex:Za,uv2_pars_fragment:qa,uv2_pars_vertex:Xa,uv2_vertex:Ya,worldpos_vertex:Ka,background_vert:Ja,background_frag:$a,backgroundCube_vert:Qa,backgroundCube_frag:ts,cube_vert:es,cube_frag:ns,depth_vert:is,depth_frag:rs,distanceRGBA_vert:os,distanceRGBA_frag:as,equirect_vert:ss,equirect_frag:ls,linedashed_vert:us,linedashed_frag:hs,meshbasic_vert:cs,meshbasic_frag:ds,meshlambert_vert:ps,meshlambert_frag:fs,meshmatcap_vert:ms,meshmatcap_frag:gs,meshnormal_vert:_s,meshnormal_frag:vs,meshphong_vert:ys,meshphong_frag:xs,meshphysical_vert:bs,meshphysical_frag:Ms,meshtoon_vert:ws,meshtoon_frag:Ss,points_vert:Ts,points_frag:Es,shadow_vert:Ps,shadow_frag:Ls,sprite_vert:As,sprite_frag:Cs},Is={common:{diffuse:{value:new Mn(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new ln},uv2Transform:{value:new ln},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new sn(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Mn(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Mn(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new ln}},sprite:{diffuse:{value:new Mn(16777215)},opacity:{value:1},center:{value:new sn(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new ln}}},Ds={basic:{uniforms:Lr([Is.common,Is.specularmap,Is.envmap,Is.aomap,Is.lightmap,Is.fog]),vertexShader:Rs.meshbasic_vert,fragmentShader:Rs.meshbasic_frag},lambert:{uniforms:Lr([Is.common,Is.specularmap,Is.envmap,Is.aomap,Is.lightmap,Is.emissivemap,Is.bumpmap,Is.normalmap,Is.displacementmap,Is.fog,Is.lights,{emissive:{value:new Mn(0)}}]),vertexShader:Rs.meshlambert_vert,fragmentShader:Rs.meshlambert_frag},phong:{uniforms:Lr([Is.common,Is.specularmap,Is.envmap,Is.aomap,Is.lightmap,Is.emissivemap,Is.bumpmap,Is.normalmap,Is.displacementmap,Is.fog,Is.lights,{emissive:{value:new Mn(0)},specular:{value:new Mn(1118481)},shininess:{value:30}}]),vertexShader:Rs.meshphong_vert,fragmentShader:Rs.meshphong_frag},standard:{uniforms:Lr([Is.common,Is.envmap,Is.aomap,Is.lightmap,Is.emissivemap,Is.bumpmap,Is.normalmap,Is.displacementmap,Is.roughnessmap,Is.metalnessmap,Is.fog,Is.lights,{emissive:{value:new Mn(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Rs.meshphysical_vert,fragmentShader:Rs.meshphysical_frag},toon:{uniforms:Lr([Is.common,Is.aomap,Is.lightmap,Is.emissivemap,Is.bumpmap,Is.normalmap,Is.displacementmap,Is.gradientmap,Is.fog,Is.lights,{emissive:{value:new Mn(0)}}]),vertexShader:Rs.meshtoon_vert,fragmentShader:Rs.meshtoon_frag},matcap:{uniforms:Lr([Is.common,Is.bumpmap,Is.normalmap,Is.displacementmap,Is.fog,{matcap:{value:null}}]),vertexShader:Rs.meshmatcap_vert,fragmentShader:Rs.meshmatcap_frag},points:{uniforms:Lr([Is.points,Is.fog]),vertexShader:Rs.points_vert,fragmentShader:Rs.points_frag},dashed:{uniforms:Lr([Is.common,Is.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Rs.linedashed_vert,fragmentShader:Rs.linedashed_frag},depth:{uniforms:Lr([Is.common,Is.displacementmap]),vertexShader:Rs.depth_vert,fragmentShader:Rs.depth_frag},normal:{uniforms:Lr([Is.common,Is.bumpmap,Is.normalmap,Is.displacementmap,{opacity:{value:1}}]),vertexShader:Rs.meshnormal_vert,fragmentShader:Rs.meshnormal_frag},sprite:{uniforms:Lr([Is.sprite,Is.fog]),vertexShader:Rs.sprite_vert,fragmentShader:Rs.sprite_frag},background:{uniforms:{uvTransform:{value:new ln},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Rs.background_vert,fragmentShader:Rs.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:Rs.backgroundCube_vert,fragmentShader:Rs.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Rs.cube_vert,fragmentShader:Rs.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Rs.equirect_vert,fragmentShader:Rs.equirect_frag},distanceRGBA:{uniforms:Lr([Is.common,Is.displacementmap,{referencePosition:{value:new On},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Rs.distanceRGBA_vert,fragmentShader:Rs.distanceRGBA_frag},shadow:{uniforms:Lr([Is.lights,Is.fog,{color:{value:new Mn(0)},opacity:{value:1}}]),vertexShader:Rs.shadow_vert,fragmentShader:Rs.shadow_frag}};Ds.physical={uniforms:Lr([Ds.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new sn(1,1)},clearcoatNormalMap:{value:null},iridescence:{value:0},iridescenceMap:{value:null},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},sheen:{value:0},sheenColor:{value:new Mn(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new sn},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new Mn(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new Mn(1,1,1)},specularColorMap:{value:null}}]),vertexShader:Rs.meshphysical_vert,fragmentShader:Rs.meshphysical_frag};const Os={r:0,b:0,g:0};function zs(t,e,n,i,r,o,a){const s=new Mn(0);let l,u,h=!0===o?0:1,c=null,f=0,m=null;function g(i,o){let a=!1,g=!0===o.isScene?o.background:null;if(g&&g.isTexture){const t=o.backgroundBlurriness>0;g=(t?n:e).get(g)}const v=t.xr,y=v.getSession&&v.getSession();y&&"additive"===y.environmentBlendMode&&(g=null),null===g?_(s,h):g&&g.isColor&&(_(g,1),a=!0),(t.autoClear||a)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),g&&(g.isCubeTexture||g.mapping===ot)?(void 0===u&&(u=new wr(new Er(1,1,1),new Or({name:"BackgroundCubeMaterial",uniforms:Pr(Ds.backgroundCube.uniforms),vertexShader:Ds.backgroundCube.vertexShader,fragmentShader:Ds.backgroundCube.fragmentShader,side:p,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(u)),u.material.uniforms.envMap.value=g,u.material.uniforms.flipEnvMap.value=g.isCubeTexture&&!1===g.isRenderTargetTexture?-1:1,u.material.uniforms.backgroundBlurriness.value=o.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=o.backgroundIntensity,u.material.toneMapped=g.encoding!==xe,c===g&&f===g.version&&m===t.toneMapping||(u.material.needsUpdate=!0,c=g,f=g.version,m=t.toneMapping),u.layers.enableAll(),i.unshift(u,u.geometry,u.material,0,0,null)):g&&g.isTexture&&(void 0===l&&(l=new wr(new Jr(2,2),new Or({name:"BackgroundMaterial",uniforms:Pr(Ds.background.uniforms),vertexShader:Ds.background.vertexShader,fragmentShader:Ds.background.fragmentShader,side:d,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(l)),l.material.uniforms.t2D.value=g,l.material.uniforms.backgroundIntensity.value=o.backgroundIntensity,l.material.toneMapped=g.encoding!==xe,!0===g.matrixAutoUpdate&&g.updateMatrix(),l.material.uniforms.uvTransform.value.copy(g.matrix),c===g&&f===g.version&&m===t.toneMapping||(l.material.needsUpdate=!0,c=g,f=g.version,m=t.toneMapping),l.layers.enableAll(),i.unshift(l,l.geometry,l.material,0,0,null))}function _(e,n){e.getRGB(Os,Cr(t)),i.buffers.color.setClear(Os.r,Os.g,Os.b,n,a)}return{getClearColor:function(){return s},setClearColor:function(t,e=1){s.set(t),h=e,_(s,h)},getClearAlpha:function(){return h},setClearAlpha:function(t){h=t,_(s,h)},render:g}}function Ns(t,e,n,i){const r=t.getParameter(34921),o=i.isWebGL2?null:e.get("OES_vertex_array_object"),a=i.isWebGL2||null!==o,s={},l=g(null);let u=l,h=!1;function c(e,i,r,o,s){let l=!1;if(a){const t=m(o,r,i);u!==t&&(u=t,p(u.object)),l=_(e,o,r,s),l&&v(e,o,r,s)}else{const t=!0===i.wireframe;u.geometry===o.id&&u.program===r.id&&u.wireframe===t||(u.geometry=o.id,u.program=r.id,u.wireframe=t,l=!0)}null!==s&&n.update(s,34963),(l||h)&&(h=!1,S(e,i,r,o),null!==s&&t.bindBuffer(34963,n.get(s).buffer))}function d(){return i.isWebGL2?t.createVertexArray():o.createVertexArrayOES()}function p(e){return i.isWebGL2?t.bindVertexArray(e):o.bindVertexArrayOES(e)}function f(e){return i.isWebGL2?t.deleteVertexArray(e):o.deleteVertexArrayOES(e)}function m(t,e,n){const i=!0===n.wireframe;let r=s[t.id];void 0===r&&(r={},s[t.id]=r);let o=r[e.id];void 0===o&&(o={},r[e.id]=o);let a=o[i];return void 0===a&&(a=g(d()),o[i]=a),a}function g(t){const e=[],n=[],i=[];for(let o=0;o<r;o++)e[o]=0,n[o]=0,i[o]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:e,enabledAttributes:n,attributeDivisors:i,object:t,attributes:{},index:null}}function _(t,e,n,i){const r=u.attributes,o=e.attributes;let a=0;const s=n.getAttributes();for(const l in s){const e=s[l];if(e.location>=0){const e=r[l];let n=o[l];if(void 0===n&&("instanceMatrix"===l&&t.instanceMatrix&&(n=t.instanceMatrix),"instanceColor"===l&&t.instanceColor&&(n=t.instanceColor)),void 0===e)return!0;if(e.attribute!==n)return!0;if(n&&e.data!==n.data)return!0;a++}}return u.attributesNum!==a||u.index!==i}function v(t,e,n,i){const r={},o=e.attributes;let a=0;const s=n.getAttributes();for(const l in s){const e=s[l];if(e.location>=0){let e=o[l];void 0===e&&("instanceMatrix"===l&&t.instanceMatrix&&(e=t.instanceMatrix),"instanceColor"===l&&t.instanceColor&&(e=t.instanceColor));const n={};n.attribute=e,e&&e.data&&(n.data=e.data),r[l]=n,a++}}u.attributes=r,u.attributesNum=a,u.index=i}function y(){const t=u.newAttributes;for(let e=0,n=t.length;e<n;e++)t[e]=0}function x(t){b(t,0)}function b(n,r){const o=u.newAttributes,a=u.enabledAttributes,s=u.attributeDivisors;if(o[n]=1,0===a[n]&&(t.enableVertexAttribArray(n),a[n]=1),s[n]!==r){const o=i.isWebGL2?t:e.get("ANGLE_instanced_arrays");o[i.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,r),s[n]=r}}function M(){const e=u.newAttributes,n=u.enabledAttributes;for(let i=0,r=n.length;i<r;i++)n[i]!==e[i]&&(t.disableVertexAttribArray(i),n[i]=0)}function w(e,n,r,o,a,s){!0!==i.isWebGL2||5124!==r&&5125!==r?t.vertexAttribPointer(e,n,r,o,a,s):t.vertexAttribIPointer(e,n,r,a,s)}function S(r,o,a,s){if(!1===i.isWebGL2&&(r.isInstancedMesh||s.isInstancedBufferGeometry)&&null===e.get("ANGLE_instanced_arrays"))return;y();const l=s.attributes,u=a.getAttributes(),h=o.defaultAttributeValues;for(const e in u){const i=u[e];if(i.location>=0){let o=l[e];if(void 0===o&&("instanceMatrix"===e&&r.instanceMatrix&&(o=r.instanceMatrix),"instanceColor"===e&&r.instanceColor&&(o=r.instanceColor)),void 0!==o){const e=o.normalized,a=o.itemSize,l=n.get(o);if(void 0===l)continue;const u=l.buffer,h=l.type,c=l.bytesPerElement;if(o.isInterleavedBufferAttribute){const n=o.data,l=n.stride,d=o.offset;if(n.isInstancedInterleavedBuffer){for(let t=0;t<i.locationSize;t++)b(i.location+t,n.meshPerAttribute);!0!==r.isInstancedMesh&&void 0===s._maxInstanceCount&&(s._maxInstanceCount=n.meshPerAttribute*n.count)}else for(let t=0;t<i.locationSize;t++)x(i.location+t);t.bindBuffer(34962,u);for(let t=0;t<i.locationSize;t++)w(i.location+t,a/i.locationSize,h,e,l*c,(d+a/i.locationSize*t)*c)}else{if(o.isInstancedBufferAttribute){for(let t=0;t<i.locationSize;t++)b(i.location+t,o.meshPerAttribute);!0!==r.isInstancedMesh&&void 0===s._maxInstanceCount&&(s._maxInstanceCount=o.meshPerAttribute*o.count)}else for(let t=0;t<i.locationSize;t++)x(i.location+t);t.bindBuffer(34962,u);for(let t=0;t<i.locationSize;t++)w(i.location+t,a/i.locationSize,h,e,a*c,a/i.locationSize*t*c)}}else if(void 0!==h){const n=h[e];if(void 0!==n)switch(n.length){case 2:t.vertexAttrib2fv(i.location,n);break;case 3:t.vertexAttrib3fv(i.location,n);break;case 4:t.vertexAttrib4fv(i.location,n);break;default:t.vertexAttrib1fv(i.location,n)}}}}M()}function T(){L();for(const t in s){const e=s[t];for(const t in e){const n=e[t];for(const t in n)f(n[t].object),delete n[t];delete e[t]}delete s[t]}}function E(t){if(void 0===s[t.id])return;const e=s[t.id];for(const n in e){const t=e[n];for(const e in t)f(t[e].object),delete t[e];delete e[n]}delete s[t.id]}function P(t){for(const e in s){const n=s[e];if(void 0===n[t.id])continue;const i=n[t.id];for(const t in i)f(i[t].object),delete i[t];delete n[t.id]}}function L(){A(),h=!0,u!==l&&(u=l,p(u.object))}function A(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:c,reset:L,resetDefaultState:A,dispose:T,releaseStatesOfGeometry:E,releaseStatesOfProgram:P,initAttributes:y,enableAttribute:x,disableUnusedAttributes:M}}function ks(t,e,n,i){const r=i.isWebGL2;let o;function a(t){o=t}function s(e,i){t.drawArrays(o,e,i),n.update(i,o,1)}function l(i,a,s){if(0===s)return;let l,u;if(r)l=t,u="drawArraysInstanced";else if(l=e.get("ANGLE_instanced_arrays"),u="drawArraysInstancedANGLE",null===l)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[u](o,i,a,s),n.update(a,o,s)}this.setMode=a,this.render=s,this.renderInstances=l}function Us(t,e,n){let i;function r(){if(void 0!==i)return i;if(!0===e.has("EXT_texture_filter_anisotropic")){const n=e.get("EXT_texture_filter_anisotropic");i=t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function o(e){if("highp"===e){if(t.getShaderPrecisionFormat(35633,36338).precision>0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const a="undefined"!==typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext;let s=void 0!==n.precision?n.precision:"highp";const l=o(s);l!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",l,"instead."),s=l);const u=a||e.has("WEBGL_draw_buffers"),h=!0===n.logarithmicDepthBuffer,c=t.getParameter(34930),d=t.getParameter(35660),p=t.getParameter(3379),f=t.getParameter(34076),m=t.getParameter(34921),g=t.getParameter(36347),_=t.getParameter(36348),v=t.getParameter(36349),y=d>0,x=a||e.has("OES_texture_float"),b=y&&x,M=a?t.getParameter(36183):0;return{isWebGL2:a,drawBuffers:u,getMaxAnisotropy:r,getMaxPrecision:o,precision:s,logarithmicDepthBuffer:h,maxTextures:c,maxVertexTextures:d,maxTextureSize:p,maxCubemapSize:f,maxAttributes:m,maxVertexUniforms:g,maxVaryings:_,maxFragmentUniforms:v,vertexTextures:y,floatFragmentTextures:x,floatVertexTextures:b,maxSamples:M}}function Bs(t){const e=this;let n=null,i=0,r=!1,o=!1;const a=new jr,s=new ln,l={value:null,needsUpdate:!1};function u(){l.value!==n&&(l.value=n,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function h(t,n,i,r){const o=null!==t?t.length:0;let u=null;if(0!==o){if(u=l.value,!0!==r||null===u){const e=i+4*o,r=n.matrixWorldInverse;s.getNormalMatrix(r),(null===u||u.length<e)&&(u=new Float32Array(e));for(let n=0,l=i;n!==o;++n,l+=4)a.copy(t[n]).applyMatrix4(r,s),a.normal.toArray(u,l),u[l+3]=a.constant}l.value=u,l.needsUpdate=!0}return e.numPlanes=o,e.numIntersection=0,u}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(t,e){const n=0!==t.length||e||0!==i||r;return r=e,i=t.length,n},this.beginShadows=function(){o=!0,h(null)},this.endShadows=function(){o=!1},this.setGlobalState=function(t,e){n=h(t,e,0)},this.setState=function(e,a,s){const c=e.clippingPlanes,d=e.clipIntersection,p=e.clipShadows,f=t.get(e);if(!r||null===c||0===c.length||o&&!p)o?h(null):u();else{const t=o?0:i,e=4*t;let r=f.clippingState||null;l.value=r,r=h(c,a,e,s);for(let i=0;i!==e;++i)r[i]=n[i];f.clippingState=r,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=t}}}function Fs(t){let e=new WeakMap;function n(t,e){return e===it?t.mapping=et:e===rt&&(t.mapping=nt),t}function i(i){if(i&&i.isTexture&&!1===i.isRenderTargetTexture){const o=i.mapping;if(o===it||o===rt){if(e.has(i)){const t=e.get(i).texture;return n(t,i.mapping)}{const o=i.image;if(o&&o.height>0){const a=new Vr(o.height/2);return a.fromEquirectangularTexture(t,i),e.set(i,a),i.addEventListener("dispose",r),n(a.texture,i.mapping)}return null}}}return i}function r(t){const n=t.target;n.removeEventListener("dispose",r);const i=e.get(n);void 0!==i&&(e.delete(n),i.dispose())}function o(){e=new WeakMap}return{get:i,dispose:o}}class Vs extends zr{constructor(t=-1,e=1,n=1,i=-1,r=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=i,this.near=r,this.far=o,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=null===t.view?null:Object.assign({},t.view),this}setViewOffset(t,e,n,i,r,o){null===this.view&&(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=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(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,i=(this.top+this.bottom)/2;let r=n-t,o=n+t,a=i+e,s=i-e;if(null!==this.view&&this.view.enabled){const t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=t*this.view.offsetX,o=r+t*this.view.width,a-=e*this.view.offsetY,s=a-e*this.view.height}this.projectionMatrix.makeOrthographic(r,o,a,s,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,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}const Hs=4,Ws=[.125,.215,.35,.446,.526,.582],Gs=20,js=new Vs,Zs=new Mn;let qs=null;const Xs=(1+Math.sqrt(5))/2,Ys=1/Xs,Ks=[new On(1,1,1),new On(-1,1,1),new On(1,1,-1),new On(-1,1,-1),new On(0,Xs,Ys),new On(0,Xs,-Ys),new On(Ys,0,Xs),new On(-Ys,0,Xs),new On(Xs,Ys,0),new On(-Xs,Ys,0)];class Js{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,n=.1,i=100){qs=this._renderer.getRenderTarget(),this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(t,n,i,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=il(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=nl(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++)this._lodPlanes[t].dispose()}_cleanup(t){this._renderer.setRenderTarget(qs),t.scissorTest=!1,tl(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===et||t.mapping===nt?this._setSize(0===t.image.length?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),qs=this._renderer.getRenderTarget();const n=e||this._allocateTargets();return this._textureToCubeUV(t,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize,n={magFilter:dt,minFilter:dt,generateMipmaps:!1,type:Mt,format:Pt,encoding:ye,depthBuffer:!1},i=Qs(t,e,n);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=Qs(t,e,n);const{_lodMax:i}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=$s(i)),this._blurMaterial=el(i,t,e)}return i}_compileMaterial(t){const e=new wr(this._lodPlanes[0],t);this._renderer.compile(e,js)}_sceneToCubeUV(t,e,n,i){const r=90,o=1,a=new Nr(r,o,e,n),s=[1,-1,1,1,1,1],l=[1,1,1,-1,-1,-1],u=this._renderer,h=u.autoClear,c=u.toneMapping;u.getClearColor(Zs),u.toneMapping=X,u.autoClear=!1;const d=new Yi({name:"PMREM.Background",side:p,depthWrite:!1,depthTest:!1}),f=new wr(new Er,d);let m=!1;const g=t.background;g?g.isColor&&(d.color.copy(g),t.background=null,m=!0):(d.color.copy(Zs),m=!0);for(let p=0;p<6;p++){const e=p%3;0===e?(a.up.set(0,s[p],0),a.lookAt(l[p],0,0)):1===e?(a.up.set(0,0,s[p]),a.lookAt(0,l[p],0)):(a.up.set(0,s[p],0),a.lookAt(0,0,l[p]));const n=this._cubeSize;tl(i,e*n,p>2?n:0,n,n),u.setRenderTarget(i),m&&u.render(f,a),u.render(t,a)}f.geometry.dispose(),f.material.dispose(),u.toneMapping=c,u.autoClear=h,t.background=g}_textureToCubeUV(t,e){const n=this._renderer,i=t.mapping===et||t.mapping===nt;i?(null===this._cubemapMaterial&&(this._cubemapMaterial=il()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===t.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=nl());const r=i?this._cubemapMaterial:this._equirectMaterial,o=new wr(this._lodPlanes[0],r),a=r.uniforms;a["envMap"].value=t;const s=this._cubeSize;tl(e,0,0,3*s,2*s),n.setRenderTarget(e),n.render(o,js)}_applyPMREM(t){const e=this._renderer,n=e.autoClear;e.autoClear=!1;for(let i=1;i<this._lodPlanes.length;i++){const e=Math.sqrt(this._sigmas[i]*this._sigmas[i]-this._sigmas[i-1]*this._sigmas[i-1]),n=Ks[(i-1)%Ks.length];this._blur(t,i-1,i,e,n)}e.autoClear=n}_blur(t,e,n,i,r){const o=this._pingPongRenderTarget;this._halfBlur(t,o,e,n,i,"latitudinal",r),this._halfBlur(o,t,n,n,i,"longitudinal",r)}_halfBlur(t,e,n,i,r,o,a){const s=this._renderer,l=this._blurMaterial;"latitudinal"!==o&&"longitudinal"!==o&&console.error("blur direction must be either latitudinal or longitudinal!");const u=3,h=new wr(this._lodPlanes[i],l),c=l.uniforms,d=this._sizeLods[n]-1,p=isFinite(r)?Math.PI/(2*d):2*Math.PI/(2*Gs-1),f=r/p,m=isFinite(r)?1+Math.floor(u*f):Gs;m>Gs&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${Gs}`);const g=[];let _=0;for(let M=0;M<Gs;++M){const t=M/f,e=Math.exp(-t*t/2);g.push(e),0===M?_+=e:M<m&&(_+=2*e)}for(let M=0;M<g.length;M++)g[M]=g[M]/_;c["envMap"].value=t.texture,c["samples"].value=m,c["weights"].value=g,c["latitudinal"].value="latitudinal"===o,a&&(c["poleAxis"].value=a);const{_lodMax:v}=this;c["dTheta"].value=p,c["mipInt"].value=v-n;const y=this._sizeLods[i],x=3*y*(i>v-Hs?i-v+Hs:0),b=4*(this._cubeSize-y);tl(e,x,b,3*y,2*y),s.setRenderTarget(e),s.render(h,js)}}function $s(t){const e=[],n=[],i=[];let r=t;const o=t-Hs+1+Ws.length;for(let a=0;a<o;a++){const o=Math.pow(2,r);n.push(o);let s=1/o;a>t-Hs?s=Ws[a-t+Hs-1]:0===a&&(s=0),i.push(s);const l=1/(o-2),u=-l,h=1+l,c=[u,u,h,u,h,h,u,u,h,h,u,h],d=6,p=6,f=3,m=2,g=1,_=new Float32Array(f*p*d),v=new Float32Array(m*p*d),y=new Float32Array(g*p*d);for(let t=0;t<d;t++){const e=t%3*2/3-1,n=t>2?0:-1,i=[e,n,0,e+2/3,n,0,e+2/3,n+1,0,e,n,0,e+2/3,n+1,0,e,n+1,0];_.set(i,f*p*t),v.set(c,m*p*t);const r=[t,t,t,t,t,t];y.set(r,g*p*t)}const x=new ur;x.setAttribute("position",new $i(_,f)),x.setAttribute("uv",new $i(v,m)),x.setAttribute("faceIndex",new $i(y,g)),e.push(x),r>Hs&&r--}return{lodPlanes:e,sizeLods:n,sigmas:i}}function Qs(t,e,n){const i=new Cn(t,e,n);return i.texture.mapping=ot,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function tl(t,e,n,i,r){t.viewport.set(e,n,i,r),t.scissor.set(e,n,i,r)}function el(t,e,n){const i=new Float32Array(Gs),r=new On(0,1,0),o=new Or({name:"SphericalGaussianBlur",defines:{n:Gs,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:rl(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:m,depthTest:!1,depthWrite:!1});return o}function nl(){return new Or({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:rl(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:m,depthTest:!1,depthWrite:!1})}function il(){return new Or({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:rl(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:m,depthTest:!1,depthWrite:!1})}function rl(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}function ol(t){let e=new WeakMap,n=null;function i(i){if(i&&i.isTexture){const a=i.mapping,s=a===it||a===rt,l=a===et||a===nt;if(s||l){if(i.isRenderTargetTexture&&!0===i.needsPMREMUpdate){i.needsPMREMUpdate=!1;let r=e.get(i);return null===n&&(n=new Js(t)),r=s?n.fromEquirectangular(i,r):n.fromCubemap(i,r),e.set(i,r),r.texture}if(e.has(i))return e.get(i).texture;{const a=i.image;if(s&&a&&a.height>0||l&&a&&r(a)){null===n&&(n=new Js(t));const r=s?n.fromEquirectangular(i):n.fromCubemap(i);return e.set(i,r),i.addEventListener("dispose",o),r.texture}return null}}}return i}function r(t){let e=0;const n=6;for(let i=0;i<n;i++)void 0!==t[i]&&e++;return e===n}function o(t){const n=t.target;n.removeEventListener("dispose",o);const i=e.get(n);void 0!==i&&(e.delete(n),i.dispose())}function a(){e=new WeakMap,null!==n&&(n.dispose(),n=null)}return{get:i,dispose:a}}function al(t){const e={};function n(n){if(void 0!==e[n])return e[n];let i;switch(n){case"WEBGL_depth_texture":i=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=t.getExtension(n)}return e[n]=i,i}return{has:function(t){return null!==n(t)},init:function(t){t.isWebGL2?n("EXT_color_buffer_float"):(n("WEBGL_depth_texture"),n("OES_texture_float"),n("OES_texture_half_float"),n("OES_texture_half_float_linear"),n("OES_standard_derivatives"),n("OES_element_index_uint"),n("OES_vertex_array_object"),n("ANGLE_instanced_arrays")),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture")},get:function(t){const e=n(t);return null===e&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),e}}}function sl(t,e,n,i){const r={},o=new WeakMap;function a(t){const s=t.target;null!==s.index&&e.remove(s.index);for(const n in s.attributes)e.remove(s.attributes[n]);s.removeEventListener("dispose",a),delete r[s.id];const l=o.get(s);l&&(e.remove(l),o.delete(s)),i.releaseStatesOfGeometry(s),!0===s.isInstancedBufferGeometry&&delete s._maxInstanceCount,n.memory.geometries--}function s(t,e){return!0===r[e.id]||(e.addEventListener("dispose",a),r[e.id]=!0,n.memory.geometries++),e}function l(t){const n=t.attributes;for(const r in n)e.update(n[r],34962);const i=t.morphAttributes;for(const r in i){const t=i[r];for(let n=0,i=t.length;n<i;n++)e.update(t[n],34962)}}function u(t){const n=[],i=t.index,r=t.attributes.position;let a=0;if(null!==i){const t=i.array;a=i.version;for(let e=0,i=t.length;e<i;e+=3){const i=t[e+0],r=t[e+1],o=t[e+2];n.push(i,r,r,o,o,i)}}else{const t=r.array;a=r.version;for(let e=0,i=t.length/3-1;e<i;e+=3){const t=e+0,i=e+1,r=e+2;n.push(t,i,i,r,r,t)}}const s=new(hn(n)?tr:Qi)(n,1);s.version=a;const l=o.get(t);l&&e.remove(l),o.set(t,s)}function h(t){const e=o.get(t);if(e){const n=t.index;null!==n&&e.version<n.version&&u(t)}else u(t);return o.get(t)}return{get:s,update:l,getWireframeAttribute:h}}function ll(t,e,n,i){const r=i.isWebGL2;let o,a,s;function l(t){o=t}function u(t){a=t.type,s=t.bytesPerElement}function h(e,i){t.drawElements(o,i,a,e*s),n.update(i,o,1)}function c(i,l,u){if(0===u)return;let h,c;if(r)h=t,c="drawElementsInstanced";else if(h=e.get("ANGLE_instanced_arrays"),c="drawElementsInstancedANGLE",null===h)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");h[c](o,l,a,i*s,u),n.update(l,o,u)}this.setMode=l,this.setIndex=u,this.render=h,this.renderInstances=c}function ul(t){const e={geometries:0,textures:0},n={frame:0,calls:0,triangles:0,points:0,lines:0};function i(t,e,i){switch(n.calls++,e){case 4:n.triangles+=i*(t/3);break;case 1:n.lines+=i*(t/2);break;case 3:n.lines+=i*(t-1);break;case 2:n.lines+=i*t;break;case 0:n.points+=i*t;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",e);break}}function r(){n.frame++,n.calls=0,n.triangles=0,n.points=0,n.lines=0}return{memory:e,render:n,programs:null,autoReset:!0,reset:r,update:i}}function hl(t,e){return t[0]-e[0]}function cl(t,e){return Math.abs(e[1])-Math.abs(t[1])}function dl(t,e,n){const i={},r=new Float32Array(8),o=new WeakMap,a=new An,s=[];for(let u=0;u<8;u++)s[u]=[u,0];function l(l,u,h,c){const d=l.morphTargetInfluences;if(!0===e.isWebGL2){const p=u.morphAttributes.position||u.morphAttributes.normal||u.morphAttributes.color,f=void 0!==p?p.length:0;let m=o.get(u);if(void 0===m||m.count!==f){void 0!==m&&m.texture.dispose();const v=void 0!==u.morphAttributes.position,y=void 0!==u.morphAttributes.normal,x=void 0!==u.morphAttributes.color,b=u.morphAttributes.position||[],M=u.morphAttributes.normal||[],w=u.morphAttributes.color||[];let S=0;!0===v&&(S=1),!0===y&&(S=2),!0===x&&(S=3);let T=u.attributes.position.count*S,E=1;T>e.maxTextureSize&&(E=Math.ceil(T/e.maxTextureSize),T=e.maxTextureSize);const P=new Float32Array(T*E*4*f),L=new Rn(P,T,E,f);L.type=bt,L.needsUpdate=!0;const A=4*S;for(let R=0;R<f;R++){const I=b[R],D=M[R],O=w[R],z=T*E*4*R;for(let N=0;N<I.count;N++){const k=N*A;!0===v&&(a.fromBufferAttribute(I,N),P[z+k+0]=a.x,P[z+k+1]=a.y,P[z+k+2]=a.z,P[z+k+3]=0),!0===y&&(a.fromBufferAttribute(D,N),P[z+k+4]=a.x,P[z+k+5]=a.y,P[z+k+6]=a.z,P[z+k+7]=0),!0===x&&(a.fromBufferAttribute(O,N),P[z+k+8]=a.x,P[z+k+9]=a.y,P[z+k+10]=a.z,P[z+k+11]=4===O.itemSize?a.w:1)}}function C(){L.dispose(),o.delete(u),u.removeEventListener("dispose",C)}m={count:f,texture:L,size:new sn(T,E)},o.set(u,m),u.addEventListener("dispose",C)}let g=0;for(let U=0;U<d.length;U++)g+=d[U];const _=u.morphTargetsRelative?1:1-g;c.getUniforms().setValue(t,"morphTargetBaseInfluence",_),c.getUniforms().setValue(t,"morphTargetInfluences",d),c.getUniforms().setValue(t,"morphTargetsTexture",m.texture,n),c.getUniforms().setValue(t,"morphTargetsTextureSize",m.size)}else{const B=void 0===d?0:d.length;let F=i[u.id];if(void 0===F||F.length!==B){F=[];for(let j=0;j<B;j++)F[j]=[j,0];i[u.id]=F}for(let Z=0;Z<B;Z++){const q=F[Z];q[0]=Z,q[1]=d[Z]}F.sort(cl);for(let X=0;X<8;X++)X<B&&F[X][1]?(s[X][0]=F[X][0],s[X][1]=F[X][1]):(s[X][0]=Number.MAX_SAFE_INTEGER,s[X][1]=0);s.sort(hl);const V=u.morphAttributes.position,H=u.morphAttributes.normal;let W=0;for(let Y=0;Y<8;Y++){const K=s[Y],J=K[0],$=K[1];J!==Number.MAX_SAFE_INTEGER&&$?(V&&u.getAttribute("morphTarget"+Y)!==V[J]&&u.setAttribute("morphTarget"+Y,V[J]),H&&u.getAttribute("morphNormal"+Y)!==H[J]&&u.setAttribute("morphNormal"+Y,H[J]),r[Y]=$,W+=$):(V&&!0===u.hasAttribute("morphTarget"+Y)&&u.deleteAttribute("morphTarget"+Y),H&&!0===u.hasAttribute("morphNormal"+Y)&&u.deleteAttribute("morphNormal"+Y),r[Y]=0)}const G=u.morphTargetsRelative?1:1-W;c.getUniforms().setValue(t,"morphTargetBaseInfluence",G),c.getUniforms().setValue(t,"morphTargetInfluences",r)}}return{update:l}}function pl(t,e,n,i){let r=new WeakMap;function o(t){const o=i.render.frame,a=t.geometry,l=e.get(t,a);return r.get(l)!==o&&(e.update(l),r.set(l,o)),t.isInstancedMesh&&(!1===t.hasEventListener("dispose",s)&&t.addEventListener("dispose",s),n.update(t.instanceMatrix,34962),null!==t.instanceColor&&n.update(t.instanceColor,34962)),l}function a(){r=new WeakMap}function s(t){const e=t.target;e.removeEventListener("dispose",s),n.remove(e.instanceMatrix),null!==e.instanceColor&&n.remove(e.instanceColor)}return{update:o,dispose:a}}const fl=new Ln,ml=new Rn,gl=new In,_l=new Fr,vl=[],yl=[],xl=new Float32Array(16),bl=new Float32Array(9),Ml=new Float32Array(4);function wl(t,e,n){const i=t[0];if(i<=0||i>0)return t;const r=e*n;let o=vl[r];if(void 0===o&&(o=new Float32Array(r),vl[r]=o),0!==e){i.toArray(o,0);for(let i=1,r=0;i!==e;++i)r+=n,t[i].toArray(o,r)}return o}function Sl(t,e){if(t.length!==e.length)return!1;for(let n=0,i=t.length;n<i;n++)if(t[n]!==e[n])return!1;return!0}function Tl(t,e){for(let n=0,i=e.length;n<i;n++)t[n]=e[n]}function El(t,e){let n=yl[e];void 0===n&&(n=new Int32Array(e),yl[e]=n);for(let i=0;i!==e;++i)n[i]=t.allocateTextureUnit();return n}function Pl(t,e){const n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function Ll(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(Sl(n,e))return;t.uniform2fv(this.addr,e),Tl(n,e)}}function Al(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else if(void 0!==e.r)n[0]===e.r&&n[1]===e.g&&n[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b);else{if(Sl(n,e))return;t.uniform3fv(this.addr,e),Tl(n,e)}}function Cl(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(Sl(n,e))return;t.uniform4fv(this.addr,e),Tl(n,e)}}function Rl(t,e){const n=this.cache,i=e.elements;if(void 0===i){if(Sl(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),Tl(n,e)}else{if(Sl(n,i))return;Ml.set(i),t.uniformMatrix2fv(this.addr,!1,Ml),Tl(n,i)}}function Il(t,e){const n=this.cache,i=e.elements;if(void 0===i){if(Sl(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),Tl(n,e)}else{if(Sl(n,i))return;bl.set(i),t.uniformMatrix3fv(this.addr,!1,bl),Tl(n,i)}}function Dl(t,e){const n=this.cache,i=e.elements;if(void 0===i){if(Sl(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),Tl(n,e)}else{if(Sl(n,i))return;xl.set(i),t.uniformMatrix4fv(this.addr,!1,xl),Tl(n,i)}}function Ol(t,e){const n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function zl(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2i(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(Sl(n,e))return;t.uniform2iv(this.addr,e),Tl(n,e)}}function Nl(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3i(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else{if(Sl(n,e))return;t.uniform3iv(this.addr,e),Tl(n,e)}}function kl(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4i(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(Sl(n,e))return;t.uniform4iv(this.addr,e),Tl(n,e)}}function Ul(t,e){const n=this.cache;n[0]!==e&&(t.uniform1ui(this.addr,e),n[0]=e)}function Bl(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2ui(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(Sl(n,e))return;t.uniform2uiv(this.addr,e),Tl(n,e)}}function Fl(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3ui(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else{if(Sl(n,e))return;t.uniform3uiv(this.addr,e),Tl(n,e)}}function Vl(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4ui(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(Sl(n,e))return;t.uniform4uiv(this.addr,e),Tl(n,e)}}function Hl(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture2D(e||fl,r)}function Wl(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture3D(e||gl,r)}function Gl(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTextureCube(e||_l,r)}function jl(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture2DArray(e||ml,r)}function Zl(t){switch(t){case 5126:return Pl;case 35664:return Ll;case 35665:return Al;case 35666:return Cl;case 35674:return Rl;case 35675:return Il;case 35676:return Dl;case 5124:case 35670:return Ol;case 35667:case 35671:return zl;case 35668:case 35672:return Nl;case 35669:case 35673:return kl;case 5125:return Ul;case 36294:return Bl;case 36295:return Fl;case 36296:return Vl;case 35678:case 36198:case 36298:case 36306:case 35682:return Hl;case 35679:case 36299:case 36307:return Wl;case 35680:case 36300:case 36308:case 36293:return Gl;case 36289:case 36303:case 36311:case 36292:return jl}}function ql(t,e){t.uniform1fv(this.addr,e)}function Xl(t,e){const n=wl(e,this.size,2);t.uniform2fv(this.addr,n)}function Yl(t,e){const n=wl(e,this.size,3);t.uniform3fv(this.addr,n)}function Kl(t,e){const n=wl(e,this.size,4);t.uniform4fv(this.addr,n)}function Jl(t,e){const n=wl(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function $l(t,e){const n=wl(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function Ql(t,e){const n=wl(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function tu(t,e){t.uniform1iv(this.addr,e)}function eu(t,e){t.uniform2iv(this.addr,e)}function nu(t,e){t.uniform3iv(this.addr,e)}function iu(t,e){t.uniform4iv(this.addr,e)}function ru(t,e){t.uniform1uiv(this.addr,e)}function ou(t,e){t.uniform2uiv(this.addr,e)}function au(t,e){t.uniform3uiv(this.addr,e)}function su(t,e){t.uniform4uiv(this.addr,e)}function lu(t,e,n){const i=this.cache,r=e.length,o=El(n,r);Sl(i,o)||(t.uniform1iv(this.addr,o),Tl(i,o));for(let a=0;a!==r;++a)n.setTexture2D(e[a]||fl,o[a])}function uu(t,e,n){const i=this.cache,r=e.length,o=El(n,r);Sl(i,o)||(t.uniform1iv(this.addr,o),Tl(i,o));for(let a=0;a!==r;++a)n.setTexture3D(e[a]||gl,o[a])}function hu(t,e,n){const i=this.cache,r=e.length,o=El(n,r);Sl(i,o)||(t.uniform1iv(this.addr,o),Tl(i,o));for(let a=0;a!==r;++a)n.setTextureCube(e[a]||_l,o[a])}function cu(t,e,n){const i=this.cache,r=e.length,o=El(n,r);Sl(i,o)||(t.uniform1iv(this.addr,o),Tl(i,o));for(let a=0;a!==r;++a)n.setTexture2DArray(e[a]||ml,o[a])}function du(t){switch(t){case 5126:return ql;case 35664:return Xl;case 35665:return Yl;case 35666:return Kl;case 35674:return Jl;case 35675:return $l;case 35676:return Ql;case 5124:case 35670:return tu;case 35667:case 35671:return eu;case 35668:case 35672:return nu;case 35669:case 35673:return iu;case 5125:return ru;case 36294:return ou;case 36295:return au;case 36296:return su;case 35678:case 36198:case 36298:case 36306:case 35682:return lu;case 35679:case 36299:case 36307:return uu;case 35680:case 36300:case 36308:case 36293:return hu;case 36289:case 36303:case 36311:case 36292:return cu}}class pu{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.setValue=Zl(e.type)}}class fu{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.size=e.size,this.setValue=du(e.type)}}class mu{constructor(t){this.id=t,this.seq=[],this.map={}}setValue(t,e,n){const i=this.seq;for(let r=0,o=i.length;r!==o;++r){const o=i[r];o.setValue(t,e[o.id],n)}}}const gu=/(\w+)(\])?(\[|\.)?/g;function _u(t,e){t.seq.push(e),t.map[e.id]=e}function vu(t,e,n){const i=t.name,r=i.length;gu.lastIndex=0;while(1){const o=gu.exec(i),a=gu.lastIndex;let s=o[1];const l="]"===o[2],u=o[3];if(l&&(s|=0),void 0===u||"["===u&&a+2===r){_u(n,void 0===u?new pu(s,t,e):new fu(s,t,e));break}{const t=n.map;let e=t[s];void 0===e&&(e=new mu(s),_u(n,e)),n=e}}}class yu{constructor(t,e){this.seq=[],this.map={};const n=t.getProgramParameter(e,35718);for(let i=0;i<n;++i){const n=t.getActiveUniform(e,i),r=t.getUniformLocation(e,n.name);vu(n,r,this)}}setValue(t,e,n,i){const r=this.map[e];void 0!==r&&r.setValue(t,n,i)}setOptional(t,e,n){const i=e[n];void 0!==i&&this.setValue(t,n,i)}static upload(t,e,n,i){for(let r=0,o=e.length;r!==o;++r){const o=e[r],a=n[o.id];!1!==a.needsUpdate&&o.setValue(t,a.value,i)}}static seqWithValue(t,e){const n=[];for(let i=0,r=t.length;i!==r;++i){const r=t[i];r.id in e&&n.push(r)}return n}}function xu(t,e,n){const i=t.createShader(e);return t.shaderSource(i,n),t.compileShader(i),i}let bu=0;function Mu(t,e){const n=t.split("\n"),i=[],r=Math.max(e-6,0),o=Math.min(e+6,n.length);for(let a=r;a<o;a++){const t=a+1;i.push(`${t===e?">":" "} ${t}: ${n[a]}`)}return i.join("\n")}function wu(t){switch(t){case ye:return["Linear","( value )"];case xe:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",t),["Linear","( value )"]}}function Su(t,e,n){const i=t.getShaderParameter(e,35713),r=t.getShaderInfoLog(e).trim();if(i&&""===r)return"";const o=/ERROR: 0:(\d+)/.exec(r);if(o){const i=parseInt(o[1]);return n.toUpperCase()+"\n\n"+r+"\n\n"+Mu(t.getShaderSource(e),i)}return r}function Tu(t,e){const n=wu(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function Eu(t,e){let n;switch(e){case Y:n="Linear";break;case K:n="Reinhard";break;case J:n="OptimizedCineon";break;case $:n="ACESFilmic";break;case Q:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function Pu(t){const e=[t.extensionDerivatives||t.envMapCubeUVHeight||t.bumpMap||t.tangentSpaceNormalMap||t.clearcoatNormalMap||t.flatShading||"physical"===t.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap||t.transmission)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""];return e.filter(Cu).join("\n")}function Lu(t){const e=[];for(const n in t){const i=t[n];!1!==i&&e.push("#define "+n+" "+i)}return e.join("\n")}function Au(t,e){const n={},i=t.getProgramParameter(e,35721);for(let r=0;r<i;r++){const i=t.getActiveAttrib(e,r),o=i.name;let a=1;35674===i.type&&(a=2),35675===i.type&&(a=3),35676===i.type&&(a=4),n[o]={type:i.type,location:t.getAttribLocation(e,o),locationSize:a}}return n}function Cu(t){return""!==t}function Ru(t,e){const n=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function Iu(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const Du=/^[ \t]*#include +<([\w\d./]+)>/gm;function Ou(t){return t.replace(Du,zu)}function zu(t,e){const n=Rs[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return Ou(n)}const Nu=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function ku(t){return t.replace(Nu,Uu)}function Uu(t,e,n,i){let r="";for(let o=parseInt(e);o<parseInt(n);o++)r+=i.replace(/\[\s*i\s*\]/g,"[ "+o+" ]").replace(/UNROLLED_LOOP_INDEX/g,o);return r}function Bu(t){let e="precision "+t.precision+" float;\nprecision "+t.precision+" int;";return"highp"===t.precision?e+="\n#define HIGH_PRECISION":"mediump"===t.precision?e+="\n#define MEDIUM_PRECISION":"lowp"===t.precision&&(e+="\n#define LOW_PRECISION"),e}function Fu(t){let e="SHADOWMAP_TYPE_BASIC";return t.shadowMapType===u?e="SHADOWMAP_TYPE_PCF":t.shadowMapType===h?e="SHADOWMAP_TYPE_PCF_SOFT":t.shadowMapType===c&&(e="SHADOWMAP_TYPE_VSM"),e}function Vu(t){let e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case et:case nt:e="ENVMAP_TYPE_CUBE";break;case ot:e="ENVMAP_TYPE_CUBE_UV";break}return e}function Hu(t){let e="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case nt:e="ENVMAP_MODE_REFRACTION";break}return e}function Wu(t){let e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case j:e="ENVMAP_BLENDING_MULTIPLY";break;case Z:e="ENVMAP_BLENDING_MIX";break;case q:e="ENVMAP_BLENDING_ADD";break}return e}function Gu(t){const e=t.envMapCubeUVHeight;if(null===e)return null;const n=Math.log2(e)-2,i=1/e,r=1/(3*Math.max(Math.pow(2,n),112));return{texelWidth:r,texelHeight:i,maxMip:n}}function ju(t,e,n,i){const r=t.getContext(),o=n.defines;let a=n.vertexShader,s=n.fragmentShader;const l=Fu(n),u=Vu(n),h=Hu(n),c=Wu(n),d=Gu(n),p=n.isWebGL2?"":Pu(n),f=Lu(o),m=r.createProgram();let g,_,v=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(g=[f].filter(Cu).join("\n"),g.length>0&&(g+="\n"),_=[p,f].filter(Cu).join("\n"),_.length>0&&(_+="\n")):(g=[Bu(n),"#define SHADER_NAME "+n.shaderName,f,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+h:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",n.specularColorMap?"#define USE_SPECULARCOLORMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEENCOLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.morphColors&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Cu).join("\n"),_=[p,Bu(n),"#define SHADER_NAME "+n.shaderName,f,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.envMap?"#define "+h:"",n.envMap?"#define "+c:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",n.specularColorMap?"#define USE_SPECULARCOLORMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEENCOLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==X?"#define TONE_MAPPING":"",n.toneMapping!==X?Rs["tonemapping_pars_fragment"]:"",n.toneMapping!==X?Eu("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Rs["encodings_pars_fragment"],Tu("linearToOutputTexel",n.outputEncoding),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Cu).join("\n")),a=Ou(a),a=Ru(a,n),a=Iu(a,n),s=Ou(s),s=Ru(s,n),s=Iu(s,n),a=ku(a),s=ku(s),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(v="#version 300 es\n",g=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+g,_=["#define varying in",n.glslVersion===Ce?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===Ce?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+_);const y=v+g+a,x=v+_+s,b=xu(r,35633,y),M=xu(r,35632,x);if(r.attachShader(m,b),r.attachShader(m,M),void 0!==n.index0AttributeName?r.bindAttribLocation(m,0,n.index0AttributeName):!0===n.morphTargets&&r.bindAttribLocation(m,0,"position"),r.linkProgram(m),t.debug.checkShaderErrors){const t=r.getProgramInfoLog(m).trim(),e=r.getShaderInfoLog(b).trim(),n=r.getShaderInfoLog(M).trim();let i=!0,o=!0;if(!1===r.getProgramParameter(m,35714)){i=!1;const e=Su(r,b,"vertex"),n=Su(r,M,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(m,35715)+"\n\nProgram Info Log: "+t+"\n"+e+"\n"+n)}else""!==t?console.warn("THREE.WebGLProgram: Program Info Log:",t):""!==e&&""!==n||(o=!1);o&&(this.diagnostics={runnable:i,programLog:t,vertexShader:{log:e,prefix:g},fragmentShader:{log:n,prefix:_}})}let w,S;return r.deleteShader(b),r.deleteShader(M),this.getUniforms=function(){return void 0===w&&(w=new yu(r,m)),w},this.getAttributes=function(){return void 0===S&&(S=Au(r,m)),S},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(m),this.program=void 0},this.name=n.shaderName,this.id=bu++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=b,this.fragmentShader=M,this}let Zu=0;class qu{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const e=t.vertexShader,n=t.fragmentShader,i=this._getShaderStage(e),r=this._getShaderStage(n),o=this._getShaderCacheForMaterial(t);return!1===o.has(i)&&(o.add(i),i.usedTimes++),!1===o.has(r)&&(o.add(r),r.usedTimes++),this}remove(t){const e=this.materialCache.get(t);for(const n of e)n.usedTimes--,0===n.usedTimes&&this.shaderCache.delete(n.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const e=this.materialCache;let n=e.get(t);return void 0===n&&(n=new Set,e.set(t,n)),n}_getShaderStage(t){const e=this.shaderCache;let n=e.get(t);return void 0===n&&(n=new Xu(t),e.set(t,n)),n}}class Xu{constructor(t){this.id=Zu++,this.code=t,this.usedTimes=0}}function Yu(t,e,n,i,r,o,a){const s=new bi,l=new qu,u=[],h=r.isWebGL2,c=r.logarithmicDepthBuffer,d=r.vertexTextures;let m=r.precision;const _={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function v(o,s,u,v,y){const x=v.fog,b=y.geometry,M=o.isMeshStandardMaterial?v.environment:null,w=(o.isMeshStandardMaterial?n:e).get(o.envMap||M),S=w&&w.mapping===ot?w.image.height:null,T=_[o.type];null!==o.precision&&(m=r.getMaxPrecision(o.precision),m!==o.precision&&console.warn("THREE.WebGLProgram.getParameters:",o.precision,"not supported, using",m,"instead."));const E=b.morphAttributes.position||b.morphAttributes.normal||b.morphAttributes.color,P=void 0!==E?E.length:0;let L,A,C,R,I=0;if(void 0!==b.morphAttributes.position&&(I=1),void 0!==b.morphAttributes.normal&&(I=2),void 0!==b.morphAttributes.color&&(I=3),T){const t=Ds[T];L=t.vertexShader,A=t.fragmentShader}else L=o.vertexShader,A=o.fragmentShader,l.update(o),C=l.getVertexShaderID(o),R=l.getFragmentShaderID(o);const D=t.getRenderTarget(),O=o.alphaTest>0,z=o.clearcoat>0,N=o.iridescence>0,k={isWebGL2:h,shaderID:T,shaderName:o.type,vertexShader:L,fragmentShader:A,defines:o.defines,customVertexShaderID:C,customFragmentShaderID:R,isRawShaderMaterial:!0===o.isRawShaderMaterial,glslVersion:o.glslVersion,precision:m,instancing:!0===y.isInstancedMesh,instancingColor:!0===y.isInstancedMesh&&null!==y.instanceColor,supportsVertexTextures:d,outputEncoding:null===D?t.outputEncoding:!0===D.isXRRenderTarget?D.texture.encoding:ye,map:!!o.map,matcap:!!o.matcap,envMap:!!w,envMapMode:w&&w.mapping,envMapCubeUVHeight:S,lightMap:!!o.lightMap,aoMap:!!o.aoMap,emissiveMap:!!o.emissiveMap,bumpMap:!!o.bumpMap,normalMap:!!o.normalMap,objectSpaceNormalMap:o.normalMapType===Se,tangentSpaceNormalMap:o.normalMapType===we,decodeVideoTexture:!!o.map&&!0===o.map.isVideoTexture&&o.map.encoding===xe,clearcoat:z,clearcoatMap:z&&!!o.clearcoatMap,clearcoatRoughnessMap:z&&!!o.clearcoatRoughnessMap,clearcoatNormalMap:z&&!!o.clearcoatNormalMap,iridescence:N,iridescenceMap:N&&!!o.iridescenceMap,iridescenceThicknessMap:N&&!!o.iridescenceThicknessMap,displacementMap:!!o.displacementMap,roughnessMap:!!o.roughnessMap,metalnessMap:!!o.metalnessMap,specularMap:!!o.specularMap,specularIntensityMap:!!o.specularIntensityMap,specularColorMap:!!o.specularColorMap,opaque:!1===o.transparent&&o.blending===g,alphaMap:!!o.alphaMap,alphaTest:O,gradientMap:!!o.gradientMap,sheen:o.sheen>0,sheenColorMap:!!o.sheenColorMap,sheenRoughnessMap:!!o.sheenRoughnessMap,transmission:o.transmission>0,transmissionMap:!!o.transmissionMap,thicknessMap:!!o.thicknessMap,combine:o.combine,vertexTangents:!!o.normalMap&&!!b.attributes.tangent,vertexColors:o.vertexColors,vertexAlphas:!0===o.vertexColors&&!!b.attributes.color&&4===b.attributes.color.itemSize,vertexUvs:!!o.map||!!o.bumpMap||!!o.normalMap||!!o.specularMap||!!o.alphaMap||!!o.emissiveMap||!!o.roughnessMap||!!o.metalnessMap||!!o.clearcoatMap||!!o.clearcoatRoughnessMap||!!o.clearcoatNormalMap||!!o.iridescenceMap||!!o.iridescenceThicknessMap||!!o.displacementMap||!!o.transmissionMap||!!o.thicknessMap||!!o.specularIntensityMap||!!o.specularColorMap||!!o.sheenColorMap||!!o.sheenRoughnessMap,uvsVertexOnly:!(o.map||o.bumpMap||o.normalMap||o.specularMap||o.alphaMap||o.emissiveMap||o.roughnessMap||o.metalnessMap||o.clearcoatNormalMap||o.iridescenceMap||o.iridescenceThicknessMap||o.transmission>0||o.transmissionMap||o.thicknessMap||o.specularIntensityMap||o.specularColorMap||o.sheen>0||o.sheenColorMap||o.sheenRoughnessMap)&&!!o.displacementMap,fog:!!x,useFog:!0===o.fog,fogExp2:x&&x.isFogExp2,flatShading:!!o.flatShading,sizeAttenuation:o.sizeAttenuation,logarithmicDepthBuffer:c,skinning:!0===y.isSkinnedMesh,morphTargets:void 0!==b.morphAttributes.position,morphNormals:void 0!==b.morphAttributes.normal,morphColors:void 0!==b.morphAttributes.color,morphTargetsCount:P,morphTextureStride:I,numDirLights:s.directional.length,numPointLights:s.point.length,numSpotLights:s.spot.length,numSpotLightMaps:s.spotLightMap.length,numRectAreaLights:s.rectArea.length,numHemiLights:s.hemi.length,numDirLightShadows:s.directionalShadowMap.length,numPointLightShadows:s.pointShadowMap.length,numSpotLightShadows:s.spotShadowMap.length,numSpotLightShadowsWithMaps:s.numSpotLightShadowsWithMaps,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:o.dithering,shadowMapEnabled:t.shadowMap.enabled&&u.length>0,shadowMapType:t.shadowMap.type,toneMapping:o.toneMapped?t.toneMapping:X,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:o.premultipliedAlpha,doubleSided:o.side===f,flipSided:o.side===p,useDepthPacking:!!o.depthPacking,depthPacking:o.depthPacking||0,index0AttributeName:o.index0AttributeName,extensionDerivatives:o.extensions&&o.extensions.derivatives,extensionFragDepth:o.extensions&&o.extensions.fragDepth,extensionDrawBuffers:o.extensions&&o.extensions.drawBuffers,extensionShaderTextureLOD:o.extensions&&o.extensions.shaderTextureLOD,rendererExtensionFragDepth:h||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:h||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:h||i.has("EXT_shader_texture_lod"),customProgramCacheKey:o.customProgramCacheKey()};return k}function y(e){const n=[];if(e.shaderID?n.push(e.shaderID):(n.push(e.customVertexShaderID),n.push(e.customFragmentShaderID)),void 0!==e.defines)for(const t in e.defines)n.push(t),n.push(e.defines[t]);return!1===e.isRawShaderMaterial&&(x(n,e),b(n,e),n.push(t.outputEncoding)),n.push(e.customProgramCacheKey),n.join()}function x(t,e){t.push(e.precision),t.push(e.outputEncoding),t.push(e.envMapMode),t.push(e.envMapCubeUVHeight),t.push(e.combine),t.push(e.vertexUvs),t.push(e.fogExp2),t.push(e.sizeAttenuation),t.push(e.morphTargetsCount),t.push(e.morphAttributeCount),t.push(e.numDirLights),t.push(e.numPointLights),t.push(e.numSpotLights),t.push(e.numSpotLightMaps),t.push(e.numHemiLights),t.push(e.numRectAreaLights),t.push(e.numDirLightShadows),t.push(e.numPointLightShadows),t.push(e.numSpotLightShadows),t.push(e.numSpotLightShadowsWithMaps),t.push(e.shadowMapType),t.push(e.toneMapping),t.push(e.numClippingPlanes),t.push(e.numClipIntersection),t.push(e.depthPacking)}function b(t,e){s.disableAll(),e.isWebGL2&&s.enable(0),e.supportsVertexTextures&&s.enable(1),e.instancing&&s.enable(2),e.instancingColor&&s.enable(3),e.map&&s.enable(4),e.matcap&&s.enable(5),e.envMap&&s.enable(6),e.lightMap&&s.enable(7),e.aoMap&&s.enable(8),e.emissiveMap&&s.enable(9),e.bumpMap&&s.enable(10),e.normalMap&&s.enable(11),e.objectSpaceNormalMap&&s.enable(12),e.tangentSpaceNormalMap&&s.enable(13),e.clearcoat&&s.enable(14),e.clearcoatMap&&s.enable(15),e.clearcoatRoughnessMap&&s.enable(16),e.clearcoatNormalMap&&s.enable(17),e.iridescence&&s.enable(18),e.iridescenceMap&&s.enable(19),e.iridescenceThicknessMap&&s.enable(20),e.displacementMap&&s.enable(21),e.specularMap&&s.enable(22),e.roughnessMap&&s.enable(23),e.metalnessMap&&s.enable(24),e.gradientMap&&s.enable(25),e.alphaMap&&s.enable(26),e.alphaTest&&s.enable(27),e.vertexColors&&s.enable(28),e.vertexAlphas&&s.enable(29),e.vertexUvs&&s.enable(30),e.vertexTangents&&s.enable(31),e.uvsVertexOnly&&s.enable(32),t.push(s.mask),s.disableAll(),e.fog&&s.enable(0),e.useFog&&s.enable(1),e.flatShading&&s.enable(2),e.logarithmicDepthBuffer&&s.enable(3),e.skinning&&s.enable(4),e.morphTargets&&s.enable(5),e.morphNormals&&s.enable(6),e.morphColors&&s.enable(7),e.premultipliedAlpha&&s.enable(8),e.shadowMapEnabled&&s.enable(9),e.physicallyCorrectLights&&s.enable(10),e.doubleSided&&s.enable(11),e.flipSided&&s.enable(12),e.useDepthPacking&&s.enable(13),e.dithering&&s.enable(14),e.specularIntensityMap&&s.enable(15),e.specularColorMap&&s.enable(16),e.transmission&&s.enable(17),e.transmissionMap&&s.enable(18),e.thicknessMap&&s.enable(19),e.sheen&&s.enable(20),e.sheenColorMap&&s.enable(21),e.sheenRoughnessMap&&s.enable(22),e.decodeVideoTexture&&s.enable(23),e.opaque&&s.enable(24),t.push(s.mask)}function M(t){const e=_[t.type];let n;if(e){const t=Ds[e];n=Rr.clone(t.uniforms)}else n=t.uniforms;return n}function w(e,n){let i;for(let t=0,r=u.length;t<r;t++){const e=u[t];if(e.cacheKey===n){i=e,++i.usedTimes;break}}return void 0===i&&(i=new ju(t,n,e,o),u.push(i)),i}function S(t){if(0===--t.usedTimes){const e=u.indexOf(t);u[e]=u[u.length-1],u.pop(),t.destroy()}}function T(t){l.remove(t)}function E(){l.dispose()}return{getParameters:v,getProgramCacheKey:y,getUniforms:M,acquireProgram:w,releaseProgram:S,releaseShaderCache:T,programs:u,dispose:E}}function Ku(){let t=new WeakMap;function e(e){let n=t.get(e);return void 0===n&&(n={},t.set(e,n)),n}function n(e){t.delete(e)}function i(e,n,i){t.get(e)[n]=i}function r(){t=new WeakMap}return{get:e,remove:n,update:i,dispose:r}}function Ju(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function $u(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function Qu(){const t=[];let e=0;const n=[],i=[],r=[];function o(){e=0,n.length=0,i.length=0,r.length=0}function a(n,i,r,o,a,s){let l=t[e];return void 0===l?(l={id:n.id,object:n,geometry:i,material:r,groupOrder:o,renderOrder:n.renderOrder,z:a,group:s},t[e]=l):(l.id=n.id,l.object=n,l.geometry=i,l.material=r,l.groupOrder=o,l.renderOrder=n.renderOrder,l.z=a,l.group=s),e++,l}function s(t,e,o,s,l,u){const h=a(t,e,o,s,l,u);o.transmission>0?i.push(h):!0===o.transparent?r.push(h):n.push(h)}function l(t,e,o,s,l,u){const h=a(t,e,o,s,l,u);o.transmission>0?i.unshift(h):!0===o.transparent?r.unshift(h):n.unshift(h)}function u(t,e){n.length>1&&n.sort(t||Ju),i.length>1&&i.sort(e||$u),r.length>1&&r.sort(e||$u)}function h(){for(let n=e,i=t.length;n<i;n++){const e=t[n];if(null===e.id)break;e.id=null,e.object=null,e.geometry=null,e.material=null,e.group=null}}return{opaque:n,transmissive:i,transparent:r,init:o,push:s,unshift:l,finish:h,sort:u}}function th(){let t=new WeakMap;function e(e,n){const i=t.get(e);let r;return void 0===i?(r=new Qu,t.set(e,[r])):n>=i.length?(r=new Qu,i.push(r)):r=i[n],r}function n(){t=new WeakMap}return{get:e,dispose:n}}function eh(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new On,color:new Mn};break;case"SpotLight":n={position:new On,direction:new On,color:new Mn,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new On,color:new Mn,distance:0,decay:0};break;case"HemisphereLight":n={direction:new On,skyColor:new Mn,groundColor:new Mn};break;case"RectAreaLight":n={color:new Mn,position:new On,halfWidth:new On,halfHeight:new On};break}return t[e.id]=n,n}}}function nh(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new sn};break;case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new sn};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new sn,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let ih=0;function rh(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function oh(t,e){const n=new eh,i=nh(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0};for(let h=0;h<9;h++)r.probe.push(new On);const o=new On,a=new hi,s=new hi;function l(o,a){let s=0,l=0,u=0;for(let t=0;t<9;t++)r.probe[t].set(0,0,0);let h=0,c=0,d=0,p=0,f=0,m=0,g=0,_=0,v=0,y=0;o.sort(rh);const x=!0!==a?Math.PI:1;for(let t=0,e=o.length;t<e;t++){const e=o[t],a=e.color,b=e.intensity,M=e.distance,w=e.shadow&&e.shadow.map?e.shadow.map.texture:null;if(e.isAmbientLight)s+=a.r*b*x,l+=a.g*b*x,u+=a.b*b*x;else if(e.isLightProbe)for(let t=0;t<9;t++)r.probe[t].addScaledVector(e.sh.coefficients[t],b);else if(e.isDirectionalLight){const t=n.get(e);if(t.color.copy(e.color).multiplyScalar(e.intensity*x),e.castShadow){const t=e.shadow,n=i.get(e);n.shadowBias=t.bias,n.shadowNormalBias=t.normalBias,n.shadowRadius=t.radius,n.shadowMapSize=t.mapSize,r.directionalShadow[h]=n,r.directionalShadowMap[h]=w,r.directionalShadowMatrix[h]=e.shadow.matrix,m++}r.directional[h]=t,h++}else if(e.isSpotLight){const t=n.get(e);t.position.setFromMatrixPosition(e.matrixWorld),t.color.copy(a).multiplyScalar(b*x),t.distance=M,t.coneCos=Math.cos(e.angle),t.penumbraCos=Math.cos(e.angle*(1-e.penumbra)),t.decay=e.decay,r.spot[d]=t;const o=e.shadow;if(e.map&&(r.spotLightMap[v]=e.map,v++,o.updateMatrices(e),e.castShadow&&y++),r.spotLightMatrix[d]=o.matrix,e.castShadow){const t=i.get(e);t.shadowBias=o.bias,t.shadowNormalBias=o.normalBias,t.shadowRadius=o.radius,t.shadowMapSize=o.mapSize,r.spotShadow[d]=t,r.spotShadowMap[d]=w,_++}d++}else if(e.isRectAreaLight){const t=n.get(e);t.color.copy(a).multiplyScalar(b),t.halfWidth.set(.5*e.width,0,0),t.halfHeight.set(0,.5*e.height,0),r.rectArea[p]=t,p++}else if(e.isPointLight){const t=n.get(e);if(t.color.copy(e.color).multiplyScalar(e.intensity*x),t.distance=e.distance,t.decay=e.decay,e.castShadow){const t=e.shadow,n=i.get(e);n.shadowBias=t.bias,n.shadowNormalBias=t.normalBias,n.shadowRadius=t.radius,n.shadowMapSize=t.mapSize,n.shadowCameraNear=t.camera.near,n.shadowCameraFar=t.camera.far,r.pointShadow[c]=n,r.pointShadowMap[c]=w,r.pointShadowMatrix[c]=e.shadow.matrix,g++}r.point[c]=t,c++}else if(e.isHemisphereLight){const t=n.get(e);t.skyColor.copy(e.color).multiplyScalar(b*x),t.groundColor.copy(e.groundColor).multiplyScalar(b*x),r.hemi[f]=t,f++}}p>0&&(e.isWebGL2||!0===t.has("OES_texture_float_linear")?(r.rectAreaLTC1=Is.LTC_FLOAT_1,r.rectAreaLTC2=Is.LTC_FLOAT_2):!0===t.has("OES_texture_half_float_linear")?(r.rectAreaLTC1=Is.LTC_HALF_1,r.rectAreaLTC2=Is.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=s,r.ambient[1]=l,r.ambient[2]=u;const b=r.hash;b.directionalLength===h&&b.pointLength===c&&b.spotLength===d&&b.rectAreaLength===p&&b.hemiLength===f&&b.numDirectionalShadows===m&&b.numPointShadows===g&&b.numSpotShadows===_&&b.numSpotMaps===v||(r.directional.length=h,r.spot.length=d,r.rectArea.length=p,r.point.length=c,r.hemi.length=f,r.directionalShadow.length=m,r.directionalShadowMap.length=m,r.pointShadow.length=g,r.pointShadowMap.length=g,r.spotShadow.length=_,r.spotShadowMap.length=_,r.directionalShadowMatrix.length=m,r.pointShadowMatrix.length=g,r.spotLightMatrix.length=_+v-y,r.spotLightMap.length=v,r.numSpotLightShadowsWithMaps=y,b.directionalLength=h,b.pointLength=c,b.spotLength=d,b.rectAreaLength=p,b.hemiLength=f,b.numDirectionalShadows=m,b.numPointShadows=g,b.numSpotShadows=_,b.numSpotMaps=v,r.version=ih++)}function u(t,e){let n=0,i=0,l=0,u=0,h=0;const c=e.matrixWorldInverse;for(let d=0,p=t.length;d<p;d++){const e=t[d];if(e.isDirectionalLight){const t=r.directional[n];t.direction.setFromMatrixPosition(e.matrixWorld),o.setFromMatrixPosition(e.target.matrixWorld),t.direction.sub(o),t.direction.transformDirection(c),n++}else if(e.isSpotLight){const t=r.spot[l];t.position.setFromMatrixPosition(e.matrixWorld),t.position.applyMatrix4(c),t.direction.setFromMatrixPosition(e.matrixWorld),o.setFromMatrixPosition(e.target.matrixWorld),t.direction.sub(o),t.direction.transformDirection(c),l++}else if(e.isRectAreaLight){const t=r.rectArea[u];t.position.setFromMatrixPosition(e.matrixWorld),t.position.applyMatrix4(c),s.identity(),a.copy(e.matrixWorld),a.premultiply(c),s.extractRotation(a),t.halfWidth.set(.5*e.width,0,0),t.halfHeight.set(0,.5*e.height,0),t.halfWidth.applyMatrix4(s),t.halfHeight.applyMatrix4(s),u++}else if(e.isPointLight){const t=r.point[i];t.position.setFromMatrixPosition(e.matrixWorld),t.position.applyMatrix4(c),i++}else if(e.isHemisphereLight){const t=r.hemi[h];t.direction.setFromMatrixPosition(e.matrixWorld),t.direction.transformDirection(c),h++}}}return{setup:l,setupView:u,state:r}}function ah(t,e){const n=new oh(t,e),i=[],r=[];function o(){i.length=0,r.length=0}function a(t){i.push(t)}function s(t){r.push(t)}function l(t){n.setup(i,t)}function u(t){n.setupView(i,t)}const h={lightsArray:i,shadowsArray:r,lights:n};return{init:o,state:h,setupLights:l,setupLightsView:u,pushLight:a,pushShadow:s}}function sh(t,e){let n=new WeakMap;function i(i,r=0){const o=n.get(i);let a;return void 0===o?(a=new ah(t,e),n.set(i,[a])):r>=o.length?(a=new ah(t,e),o.push(a)):a=o[r],a}function r(){n=new WeakMap}return{get:i,dispose:r}}class lh extends Xi{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=be,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class uh extends Xi{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.referencePosition=new On,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}const hh="void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",ch="uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}";function dh(t,e,n){let i=new Xr;const r=new sn,o=new sn,a=new An,s=new lh({depthPacking:Me}),l=new uh,h={},g=n.maxTextureSize,_={[d]:p,[p]:d,[f]:f},v=new Or({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new sn},radius:{value:4}},vertexShader:hh,fragmentShader:ch}),y=v.clone();y.defines.HORIZONTAL_PASS=1;const x=new ur;x.setAttribute("position",new $i(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const b=new wr(x,v),M=this;function w(n,i){const o=e.update(b);v.defines.VSM_SAMPLES!==n.blurSamples&&(v.defines.VSM_SAMPLES=n.blurSamples,y.defines.VSM_SAMPLES=n.blurSamples,v.needsUpdate=!0,y.needsUpdate=!0),null===n.mapPass&&(n.mapPass=new Cn(r.x,r.y)),v.uniforms.shadow_pass.value=n.map.texture,v.uniforms.resolution.value=n.mapSize,v.uniforms.radius.value=n.radius,t.setRenderTarget(n.mapPass),t.clear(),t.renderBufferDirect(i,null,o,v,b,null),y.uniforms.shadow_pass.value=n.mapPass.texture,y.uniforms.resolution.value=n.mapSize,y.uniforms.radius.value=n.radius,t.setRenderTarget(n.map),t.clear(),t.renderBufferDirect(i,null,o,y,b,null)}function S(e,n,i,r,o,a){let u=null;const d=!0===i.isPointLight?e.customDistanceMaterial:e.customDepthMaterial;if(void 0!==d)u=d;else if(u=!0===i.isPointLight?l:s,t.localClippingEnabled&&!0===n.clipShadows&&Array.isArray(n.clippingPlanes)&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0){const t=u.uuid,e=n.uuid;let i=h[t];void 0===i&&(i={},h[t]=i);let r=i[e];void 0===r&&(r=u.clone(),i[e]=r),u=r}return u.visible=n.visible,u.wireframe=n.wireframe,u.side=a===c?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:_[n.side],u.alphaMap=n.alphaMap,u.alphaTest=n.alphaTest,u.map=n.map,u.clipShadows=n.clipShadows,u.clippingPlanes=n.clippingPlanes,u.clipIntersection=n.clipIntersection,u.displacementMap=n.displacementMap,u.displacementScale=n.displacementScale,u.displacementBias=n.displacementBias,u.wireframeLinewidth=n.wireframeLinewidth,u.linewidth=n.linewidth,!0===i.isPointLight&&!0===u.isMeshDistanceMaterial&&(u.referencePosition.setFromMatrixPosition(i.matrixWorld),u.nearDistance=r,u.farDistance=o),u}function T(n,r,o,a,s){if(!1===n.visible)return;const l=n.layers.test(r.layers);if(l&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&s===c)&&(!n.frustumCulled||i.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,n.matrixWorld);const i=e.update(n),r=n.material;if(Array.isArray(r)){const e=i.groups;for(let l=0,u=e.length;l<u;l++){const u=e[l],h=r[u.materialIndex];if(h&&h.visible){const e=S(n,h,a,o.near,o.far,s);t.renderBufferDirect(o,null,i,e,n,u)}}}else if(r.visible){const e=S(n,r,a,o.near,o.far,s);t.renderBufferDirect(o,null,i,e,n,null)}}const u=n.children;for(let t=0,e=u.length;t<e;t++)T(u[t],r,o,a,s)}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=u,this.render=function(e,n,s){if(!1===M.enabled)return;if(!1===M.autoUpdate&&!1===M.needsUpdate)return;if(0===e.length)return;const l=t.getRenderTarget(),u=t.getActiveCubeFace(),h=t.getActiveMipmapLevel(),d=t.state;d.setBlending(m),d.buffers.color.setClear(1,1,1,1),d.buffers.depth.setTest(!0),d.setScissorTest(!1);for(let p=0,f=e.length;p<f;p++){const l=e[p],u=l.shadow;if(void 0===u){console.warn("THREE.WebGLShadowMap:",l,"has no shadow.");continue}if(!1===u.autoUpdate&&!1===u.needsUpdate)continue;r.copy(u.mapSize);const h=u.getFrameExtents();if(r.multiply(h),o.copy(u.mapSize),(r.x>g||r.y>g)&&(r.x>g&&(o.x=Math.floor(g/h.x),r.x=o.x*h.x,u.mapSize.x=o.x),r.y>g&&(o.y=Math.floor(g/h.y),r.y=o.y*h.y,u.mapSize.y=o.y)),null===u.map){const t=this.type!==c?{minFilter:ut,magFilter:ut}:{};u.map=new Cn(r.x,r.y,t),u.map.texture.name=l.name+".shadowMap",u.camera.updateProjectionMatrix()}t.setRenderTarget(u.map),t.clear();const f=u.getViewportCount();for(let t=0;t<f;t++){const e=u.getViewport(t);a.set(o.x*e.x,o.y*e.y,o.x*e.z,o.y*e.w),d.viewport(a),u.updateMatrices(l,t),i=u.getFrustum(),T(n,s,u.camera,l,this.type)}!0!==u.isPointLightShadow&&this.type===c&&w(u,s),u.needsUpdate=!1}M.needsUpdate=!1,t.setRenderTarget(l,u,h)}}function ph(t,e,n){const i=n.isWebGL2;function r(){let e=!1;const n=new An;let i=null;const r=new An(0,0,0,0);return{setMask:function(n){i===n||e||(t.colorMask(n,n,n,n),i=n)},setLocked:function(t){e=t},setClear:function(e,i,o,a,s){!0===s&&(e*=a,i*=a,o*=a),n.set(e,i,o,a),!1===r.equals(n)&&(t.clearColor(e,i,o,a),r.copy(n))},reset:function(){e=!1,i=null,r.set(-1,0,0,0)}}}function o(){let e=!1,n=null,i=null,r=null;return{setTest:function(t){t?St(2929):Tt(2929)},setMask:function(i){n===i||e||(t.depthMask(i),n=i)},setFunc:function(e){if(i!==e){switch(e){case k:t.depthFunc(512);break;case U:t.depthFunc(519);break;case B:t.depthFunc(513);break;case F:t.depthFunc(515);break;case V:t.depthFunc(514);break;case H:t.depthFunc(518);break;case W:t.depthFunc(516);break;case G:t.depthFunc(517);break;default:t.depthFunc(515)}i=e}},setLocked:function(t){e=t},setClear:function(e){r!==e&&(t.clearDepth(e),r=e)},reset:function(){e=!1,n=null,i=null,r=null}}}function u(){let e=!1,n=null,i=null,r=null,o=null,a=null,s=null,l=null,u=null;return{setTest:function(t){e||(t?St(2960):Tt(2960))},setMask:function(i){n===i||e||(t.stencilMask(i),n=i)},setFunc:function(e,n,a){i===e&&r===n&&o===a||(t.stencilFunc(e,n,a),i=e,r=n,o=a)},setOp:function(e,n,i){a===e&&s===n&&l===i||(t.stencilOp(e,n,i),a=e,s=n,l=i)},setLocked:function(t){e=t},setClear:function(e){u!==e&&(t.clearStencil(e),u=e)},reset:function(){e=!1,n=null,i=null,r=null,o=null,a=null,s=null,l=null,u=null}}}const h=new r,c=new o,d=new u,j=new WeakMap,Z=new WeakMap;let q={},X={},Y=new WeakMap,K=[],J=null,$=!1,Q=null,tt=null,et=null,nt=null,it=null,rt=null,ot=null,at=!1,st=null,lt=null,ut=null,ht=null,ct=null;const dt=t.getParameter(35661);let pt=!1,ft=0;const mt=t.getParameter(7938);-1!==mt.indexOf("WebGL")?(ft=parseFloat(/^WebGL (\d)/.exec(mt)[1]),pt=ft>=1):-1!==mt.indexOf("OpenGL ES")&&(ft=parseFloat(/^OpenGL ES (\d)/.exec(mt)[1]),pt=ft>=2);let gt=null,_t={};const vt=t.getParameter(3088),yt=t.getParameter(2978),xt=(new An).fromArray(vt),bt=(new An).fromArray(yt);function Mt(e,n,i){const r=new Uint8Array(4),o=t.createTexture();t.bindTexture(e,o),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(let a=0;a<i;a++)t.texImage2D(n+a,0,6408,1,1,0,6408,5121,r);return o}const wt={};function St(e){!0!==q[e]&&(t.enable(e),q[e]=!0)}function Tt(e){!1!==q[e]&&(t.disable(e),q[e]=!1)}function Et(e,n){return X[e]!==n&&(t.bindFramebuffer(e,n),X[e]=n,i&&(36009===e&&(X[36160]=n),36160===e&&(X[36009]=n)),!0)}function Pt(i,r){let o=K,a=!1;if(i)if(o=Y.get(r),void 0===o&&(o=[],Y.set(r,o)),i.isWebGLMultipleRenderTargets){const t=i.texture;if(o.length!==t.length||36064!==o[0]){for(let e=0,n=t.length;e<n;e++)o[e]=36064+e;o.length=t.length,a=!0}}else 36064!==o[0]&&(o[0]=36064,a=!0);else 1029!==o[0]&&(o[0]=1029,a=!0);a&&(n.isWebGL2?t.drawBuffers(o):e.get("WEBGL_draw_buffers").drawBuffersWEBGL(o))}function Lt(e){return J!==e&&(t.useProgram(e),J=e,!0)}wt[3553]=Mt(3553,3553,1),wt[34067]=Mt(34067,34069,6),h.setClear(0,0,0,1),c.setClear(1),d.setClear(0),St(2929),c.setFunc(F),Dt(!1),Ot(s),St(2884),Rt(m);const At={[b]:32774,[M]:32778,[w]:32779};if(i)At[S]=32775,At[T]=32776;else{const t=e.get("EXT_blend_minmax");null!==t&&(At[S]=t.MIN_EXT,At[T]=t.MAX_EXT)}const Ct={[E]:0,[P]:1,[L]:768,[C]:770,[N]:776,[O]:774,[I]:772,[A]:769,[R]:771,[z]:775,[D]:773};function Rt(e,n,i,r,o,a,s,l){if(e!==m){if(!1===$&&(St(3042),$=!0),e===x)o=o||n,a=a||i,s=s||r,n===tt&&o===it||(t.blendEquationSeparate(At[n],At[o]),tt=n,it=o),i===et&&r===nt&&a===rt&&s===ot||(t.blendFuncSeparate(Ct[i],Ct[r],Ct[a],Ct[s]),et=i,nt=r,rt=a,ot=s),Q=e,at=!1;else if(e!==Q||l!==at){if(tt===b&&it===b||(t.blendEquation(32774),tt=b,it=b),l)switch(e){case g:t.blendFuncSeparate(1,771,1,771);break;case _:t.blendFunc(1,1);break;case v:t.blendFuncSeparate(0,769,0,1);break;case y:t.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",e);break}else switch(e){case g:t.blendFuncSeparate(770,771,1,771);break;case _:t.blendFunc(770,1);break;case v:t.blendFuncSeparate(0,769,0,1);break;case y:t.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",e);break}et=null,nt=null,rt=null,ot=null,Q=e,at=l}}else!0===$&&(Tt(3042),$=!1)}function It(t,e){t.side===f?Tt(2884):St(2884);let n=t.side===p;e&&(n=!n),Dt(n),t.blending===g&&!1===t.transparent?Rt(m):Rt(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),c.setFunc(t.depthFunc),c.setTest(t.depthTest),c.setMask(t.depthWrite),h.setMask(t.colorWrite);const i=t.stencilWrite;d.setTest(i),i&&(d.setMask(t.stencilWriteMask),d.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),d.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),Nt(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits),!0===t.alphaToCoverage?St(32926):Tt(32926)}function Dt(e){st!==e&&(e?t.frontFace(2304):t.frontFace(2305),st=e)}function Ot(e){e!==a?(St(2884),e!==lt&&(e===s?t.cullFace(1029):e===l?t.cullFace(1028):t.cullFace(1032))):Tt(2884),lt=e}function zt(e){e!==ut&&(pt&&t.lineWidth(e),ut=e)}function Nt(e,n,i){e?(St(32823),ht===n&&ct===i||(t.polygonOffset(n,i),ht=n,ct=i)):Tt(32823)}function kt(t){t?St(3089):Tt(3089)}function Ut(e){void 0===e&&(e=33984+dt-1),gt!==e&&(t.activeTexture(e),gt=e)}function Bt(e,n,i){void 0===i&&(i=null===gt?33984+dt-1:gt);let r=_t[i];void 0===r&&(r={type:void 0,texture:void 0},_t[i]=r),r.type===e&&r.texture===n||(gt!==i&&(t.activeTexture(i),gt=i),t.bindTexture(e,n||wt[e]),r.type=e,r.texture=n)}function Ft(){const e=_t[gt];void 0!==e&&void 0!==e.type&&(t.bindTexture(e.type,null),e.type=void 0,e.texture=void 0)}function Vt(){try{t.compressedTexImage2D.apply(t,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function Ht(){try{t.compressedTexImage3D.apply(t,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function Wt(){try{t.texSubImage2D.apply(t,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function Gt(){try{t.texSubImage3D.apply(t,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function jt(){try{t.compressedTexSubImage2D.apply(t,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function Zt(){try{t.compressedTexSubImage3D.apply(t,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function qt(){try{t.texStorage2D.apply(t,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function Xt(){try{t.texStorage3D.apply(t,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function Yt(){try{t.texImage2D.apply(t,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function Kt(){try{t.texImage3D.apply(t,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function Jt(e){!1===xt.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),xt.copy(e))}function $t(e){!1===bt.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),bt.copy(e))}function Qt(e,n){let i=Z.get(n);void 0===i&&(i=new WeakMap,Z.set(n,i));let r=i.get(e);void 0===r&&(r=t.getUniformBlockIndex(n,e.name),i.set(e,r))}function te(e,n){const i=Z.get(n),r=i.get(e);j.get(n)!==r&&(t.uniformBlockBinding(n,r,e.__bindingPointIndex),j.set(n,r))}function ee(){t.disable(3042),t.disable(2884),t.disable(2929),t.disable(32823),t.disable(3089),t.disable(2960),t.disable(32926),t.blendEquation(32774),t.blendFunc(1,0),t.blendFuncSeparate(1,0,1,0),t.colorMask(!0,!0,!0,!0),t.clearColor(0,0,0,0),t.depthMask(!0),t.depthFunc(513),t.clearDepth(1),t.stencilMask(4294967295),t.stencilFunc(519,0,4294967295),t.stencilOp(7680,7680,7680),t.clearStencil(0),t.cullFace(1029),t.frontFace(2305),t.polygonOffset(0,0),t.activeTexture(33984),t.bindFramebuffer(36160,null),!0===i&&(t.bindFramebuffer(36009,null),t.bindFramebuffer(36008,null)),t.useProgram(null),t.lineWidth(1),t.scissor(0,0,t.canvas.width,t.canvas.height),t.viewport(0,0,t.canvas.width,t.canvas.height),q={},gt=null,_t={},X={},Y=new WeakMap,K=[],J=null,$=!1,Q=null,tt=null,et=null,nt=null,it=null,rt=null,ot=null,at=!1,st=null,lt=null,ut=null,ht=null,ct=null,xt.set(0,0,t.canvas.width,t.canvas.height),bt.set(0,0,t.canvas.width,t.canvas.height),h.reset(),c.reset(),d.reset()}return{buffers:{color:h,depth:c,stencil:d},enable:St,disable:Tt,bindFramebuffer:Et,drawBuffers:Pt,useProgram:Lt,setBlending:Rt,setMaterial:It,setFlipSided:Dt,setCullFace:Ot,setLineWidth:zt,setPolygonOffset:Nt,setScissorTest:kt,activeTexture:Ut,bindTexture:Bt,unbindTexture:Ft,compressedTexImage2D:Vt,compressedTexImage3D:Ht,texImage2D:Yt,texImage3D:Kt,updateUBOMapping:Qt,uniformBlockBinding:te,texStorage2D:qt,texStorage3D:Xt,texSubImage2D:Wt,texSubImage3D:Gt,compressedTexSubImage2D:jt,compressedTexSubImage3D:Zt,scissor:Jt,viewport:$t,reset:ee}}function fh(t,e,n,i,r,o,a){const s=r.isWebGL2,l=r.maxTextures,u=r.maxCubemapSize,h=r.maxTextureSize,c=r.maxSamples,d=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,p="undefined"!==typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),f=new WeakMap;let m;const g=new WeakMap;let _=!1;try{_="undefined"!==typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(rt){}function v(t,e){return _?new OffscreenCanvas(t,e):cn("canvas")}function y(t,e,n,i){let r=1;if((t.width>i||t.height>i)&&(r=i/Math.max(t.width,t.height)),r<1||!0===e){if("undefined"!==typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&t instanceof ImageBitmap){const i=e?en:Math.floor,o=i(r*t.width),a=i(r*t.height);void 0===m&&(m=v(o,a));const s=n?v(o,a):m;s.width=o,s.height=a;const l=s.getContext("2d");return l.drawImage(t,0,0,o,a),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+o+"x"+a+")."),s}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function x(t){return Qe(t.width)&&Qe(t.height)}function b(t){return!s&&(t.wrapS!==st||t.wrapT!==st||t.minFilter!==ut&&t.minFilter!==dt)}function M(t,e){return t.generateMipmaps&&e&&t.minFilter!==ut&&t.minFilter!==dt}function w(e){t.generateMipmap(e)}function S(n,i,r,o,a=!1){if(!1===s)return i;if(null!==n){if(void 0!==t[n])return t[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let l=i;return 6403===i&&(5126===r&&(l=33326),5131===r&&(l=33325),5121===r&&(l=33321)),33319===i&&(5126===r&&(l=33328),5131===r&&(l=33327),5121===r&&(l=33323)),6408===i&&(5126===r&&(l=34836),5131===r&&(l=34842),5121===r&&(l=o===xe&&!1===a?35907:32856),32819===r&&(l=32854),32820===r&&(l=32855)),33325!==l&&33326!==l&&33327!==l&&33328!==l&&34842!==l&&34836!==l||e.get("EXT_color_buffer_float"),l}function T(t,e,n){return!0===M(t,n)||t.isFramebufferTexture&&t.minFilter!==ut&&t.minFilter!==dt?Math.log2(Math.max(e.width,e.height))+1:void 0!==t.mipmaps&&t.mipmaps.length>0?t.mipmaps.length:t.isCompressedTexture&&Array.isArray(t.image)?e.mipmaps.length:1}function E(t){return t===ut||t===ht||t===ct?9728:9729}function P(t){const e=t.target;e.removeEventListener("dispose",P),A(e),e.isVideoTexture&&f.delete(e)}function L(t){const e=t.target;e.removeEventListener("dispose",L),R(e)}function A(t){const e=i.get(t);if(void 0===e.__webglInit)return;const n=t.source,r=g.get(n);if(r){const i=r[e.__cacheKey];i.usedTimes--,0===i.usedTimes&&C(t),0===Object.keys(r).length&&g.delete(n)}i.remove(t)}function C(e){const n=i.get(e);t.deleteTexture(n.__webglTexture);const r=e.source,o=g.get(r);delete o[n.__cacheKey],a.memory.textures--}function R(e){const n=e.texture,r=i.get(e),o=i.get(n);if(void 0!==o.__webglTexture&&(t.deleteTexture(o.__webglTexture),a.memory.textures--),e.depthTexture&&e.depthTexture.dispose(),e.isWebGLCubeRenderTarget)for(let i=0;i<6;i++)t.deleteFramebuffer(r.__webglFramebuffer[i]),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer[i]);else{if(t.deleteFramebuffer(r.__webglFramebuffer),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer),r.__webglMultisampledFramebuffer&&t.deleteFramebuffer(r.__webglMultisampledFramebuffer),r.__webglColorRenderbuffer)for(let e=0;e<r.__webglColorRenderbuffer.length;e++)r.__webglColorRenderbuffer[e]&&t.deleteRenderbuffer(r.__webglColorRenderbuffer[e]);r.__webglDepthRenderbuffer&&t.deleteRenderbuffer(r.__webglDepthRenderbuffer)}if(e.isWebGLMultipleRenderTargets)for(let s=0,l=n.length;s<l;s++){const e=i.get(n[s]);e.__webglTexture&&(t.deleteTexture(e.__webglTexture),a.memory.textures--),i.remove(n[s])}i.remove(n),i.remove(e)}let I=0;function D(){I=0}function O(){const t=I;return t>=l&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+l),I+=1,t}function z(t){const e=[];return e.push(t.wrapS),e.push(t.wrapT),e.push(t.wrapR||0),e.push(t.magFilter),e.push(t.minFilter),e.push(t.anisotropy),e.push(t.internalFormat),e.push(t.format),e.push(t.type),e.push(t.generateMipmaps),e.push(t.premultiplyAlpha),e.push(t.flipY),e.push(t.unpackAlignment),e.push(t.encoding),e.join()}function N(t,e){const r=i.get(t);if(t.isVideoTexture&&nt(t),!1===t.isRenderTargetTexture&&t.version>0&&r.__version!==t.version){const n=t.image;if(null===n)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==n.complete)return void G(r,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.bindTexture(3553,r.__webglTexture,33984+e)}function k(t,e){const r=i.get(t);t.version>0&&r.__version!==t.version?G(r,t,e):n.bindTexture(35866,r.__webglTexture,33984+e)}function U(t,e){const r=i.get(t);t.version>0&&r.__version!==t.version?G(r,t,e):n.bindTexture(32879,r.__webglTexture,33984+e)}function B(t,e){const r=i.get(t);t.version>0&&r.__version!==t.version?j(r,t,e):n.bindTexture(34067,r.__webglTexture,33984+e)}const F={[at]:10497,[st]:33071,[lt]:33648},V={[ut]:9728,[ht]:9984,[ct]:9986,[dt]:9729,[pt]:9985,[ft]:9987};function H(n,o,a){if(a?(t.texParameteri(n,10242,F[o.wrapS]),t.texParameteri(n,10243,F[o.wrapT]),32879!==n&&35866!==n||t.texParameteri(n,32882,F[o.wrapR]),t.texParameteri(n,10240,V[o.magFilter]),t.texParameteri(n,10241,V[o.minFilter])):(t.texParameteri(n,10242,33071),t.texParameteri(n,10243,33071),32879!==n&&35866!==n||t.texParameteri(n,32882,33071),o.wrapS===st&&o.wrapT===st||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(n,10240,E(o.magFilter)),t.texParameteri(n,10241,E(o.minFilter)),o.minFilter!==ut&&o.minFilter!==dt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),!0===e.has("EXT_texture_filter_anisotropic")){const a=e.get("EXT_texture_filter_anisotropic");if(o.magFilter===ut)return;if(o.minFilter!==ct&&o.minFilter!==ft)return;if(o.type===bt&&!1===e.has("OES_texture_float_linear"))return;if(!1===s&&o.type===Mt&&!1===e.has("OES_texture_half_float_linear"))return;(o.anisotropy>1||i.get(o).__currentAnisotropy)&&(t.texParameterf(n,a.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,r.getMaxAnisotropy())),i.get(o).__currentAnisotropy=o.anisotropy)}}function W(e,n){let i=!1;void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",P));const r=n.source;let o=g.get(r);void 0===o&&(o={},g.set(r,o));const s=z(n);if(s!==e.__cacheKey){void 0===o[s]&&(o[s]={texture:t.createTexture(),usedTimes:0},a.memory.textures++,i=!0),o[s].usedTimes++;const r=o[e.__cacheKey];void 0!==r&&(o[e.__cacheKey].usedTimes--,0===r.usedTimes&&C(n)),e.__cacheKey=s,e.__webglTexture=o[s].texture}return i}function G(e,r,a){let l=3553;(r.isDataArrayTexture||r.isCompressedArrayTexture)&&(l=35866),r.isData3DTexture&&(l=32879);const u=W(e,r),c=r.source;n.bindTexture(l,e.__webglTexture,33984+a);const d=i.get(c);if(c.version!==d.__version||!0===u){n.activeTexture(33984+a),t.pixelStorei(37440,r.flipY),t.pixelStorei(37441,r.premultiplyAlpha),t.pixelStorei(3317,r.unpackAlignment),t.pixelStorei(37443,0);const e=b(r)&&!1===x(r.image);let i=y(r.image,e,!1,h);i=it(r,i);const p=x(i)||s,f=o.convert(r.format,r.encoding);let m,g=o.convert(r.type),_=S(r.internalFormat,f,g,r.encoding,r.isVideoTexture);H(l,r,p);const v=r.mipmaps,E=s&&!0!==r.isVideoTexture,P=void 0===d.__version||!0===u,L=T(r,i,p);if(r.isDepthTexture)_=6402,s?_=r.type===bt?36012:r.type===xt?33190:r.type===Tt?35056:33189:r.type===bt&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),r.format===Ct&&6402===_&&r.type!==vt&&r.type!==xt&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=xt,g=o.convert(r.type)),r.format===Rt&&6402===_&&(_=34041,r.type!==Tt&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=Tt,g=o.convert(r.type))),P&&(E?n.texStorage2D(3553,1,_,i.width,i.height):n.texImage2D(3553,0,_,i.width,i.height,0,f,g,null));else if(r.isDataTexture)if(v.length>0&&p){E&&P&&n.texStorage2D(3553,L,_,v[0].width,v[0].height);for(let t=0,e=v.length;t<e;t++)m=v[t],E?n.texSubImage2D(3553,t,0,0,m.width,m.height,f,g,m.data):n.texImage2D(3553,t,_,m.width,m.height,0,f,g,m.data);r.generateMipmaps=!1}else E?(P&&n.texStorage2D(3553,L,_,i.width,i.height),n.texSubImage2D(3553,0,0,0,i.width,i.height,f,g,i.data)):n.texImage2D(3553,0,_,i.width,i.height,0,f,g,i.data);else if(r.isCompressedTexture)if(r.isCompressedArrayTexture){E&&P&&n.texStorage3D(35866,L,_,v[0].width,v[0].height,i.depth);for(let t=0,e=v.length;t<e;t++)m=v[t],r.format!==Pt?null!==f?E?n.compressedTexSubImage3D(35866,t,0,0,0,m.width,m.height,i.depth,f,m.data,0,0):n.compressedTexImage3D(35866,t,_,m.width,m.height,i.depth,0,m.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):E?n.texSubImage3D(35866,t,0,0,0,m.width,m.height,i.depth,f,g,m.data):n.texImage3D(35866,t,_,m.width,m.height,i.depth,0,f,g,m.data)}else{E&&P&&n.texStorage2D(3553,L,_,v[0].width,v[0].height);for(let t=0,e=v.length;t<e;t++)m=v[t],r.format!==Pt?null!==f?E?n.compressedTexSubImage2D(3553,t,0,0,m.width,m.height,f,m.data):n.compressedTexImage2D(3553,t,_,m.width,m.height,0,m.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):E?n.texSubImage2D(3553,t,0,0,m.width,m.height,f,g,m.data):n.texImage2D(3553,t,_,m.width,m.height,0,f,g,m.data)}else if(r.isDataArrayTexture)E?(P&&n.texStorage3D(35866,L,_,i.width,i.height,i.depth),n.texSubImage3D(35866,0,0,0,0,i.width,i.height,i.depth,f,g,i.data)):n.texImage3D(35866,0,_,i.width,i.height,i.depth,0,f,g,i.data);else if(r.isData3DTexture)E?(P&&n.texStorage3D(32879,L,_,i.width,i.height,i.depth),n.texSubImage3D(32879,0,0,0,0,i.width,i.height,i.depth,f,g,i.data)):n.texImage3D(32879,0,_,i.width,i.height,i.depth,0,f,g,i.data);else if(r.isFramebufferTexture){if(P)if(E)n.texStorage2D(3553,L,_,i.width,i.height);else{let t=i.width,e=i.height;for(let i=0;i<L;i++)n.texImage2D(3553,i,_,t,e,0,f,g,null),t>>=1,e>>=1}}else if(v.length>0&&p){E&&P&&n.texStorage2D(3553,L,_,v[0].width,v[0].height);for(let t=0,e=v.length;t<e;t++)m=v[t],E?n.texSubImage2D(3553,t,0,0,f,g,m):n.texImage2D(3553,t,_,f,g,m);r.generateMipmaps=!1}else E?(P&&n.texStorage2D(3553,L,_,i.width,i.height),n.texSubImage2D(3553,0,0,0,f,g,i)):n.texImage2D(3553,0,_,f,g,i);M(r,p)&&w(l),d.__version=c.version,r.onUpdate&&r.onUpdate(r)}e.__version=r.version}function j(e,r,a){if(6!==r.image.length)return;const l=W(e,r),h=r.source;n.bindTexture(34067,e.__webglTexture,33984+a);const c=i.get(h);if(h.version!==c.__version||!0===l){n.activeTexture(33984+a),t.pixelStorei(37440,r.flipY),t.pixelStorei(37441,r.premultiplyAlpha),t.pixelStorei(3317,r.unpackAlignment),t.pixelStorei(37443,0);const e=r.isCompressedTexture||r.image[0].isCompressedTexture,i=r.image[0]&&r.image[0].isDataTexture,d=[];for(let t=0;t<6;t++)d[t]=e||i?i?r.image[t].image:r.image[t]:y(r.image[t],!1,!0,u),d[t]=it(r,d[t]);const p=d[0],f=x(p)||s,m=o.convert(r.format,r.encoding),g=o.convert(r.type),_=S(r.internalFormat,m,g,r.encoding),v=s&&!0!==r.isVideoTexture,b=void 0===c.__version||!0===l;let E,P=T(r,p,f);if(H(34067,r,f),e){v&&b&&n.texStorage2D(34067,P,_,p.width,p.height);for(let t=0;t<6;t++){E=d[t].mipmaps;for(let e=0;e<E.length;e++){const i=E[e];r.format!==Pt?null!==m?v?n.compressedTexSubImage2D(34069+t,e,0,0,i.width,i.height,m,i.data):n.compressedTexImage2D(34069+t,e,_,i.width,i.height,0,i.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):v?n.texSubImage2D(34069+t,e,0,0,i.width,i.height,m,g,i.data):n.texImage2D(34069+t,e,_,i.width,i.height,0,m,g,i.data)}}}else{E=r.mipmaps,v&&b&&(E.length>0&&P++,n.texStorage2D(34067,P,_,d[0].width,d[0].height));for(let t=0;t<6;t++)if(i){v?n.texSubImage2D(34069+t,0,0,0,d[t].width,d[t].height,m,g,d[t].data):n.texImage2D(34069+t,0,_,d[t].width,d[t].height,0,m,g,d[t].data);for(let e=0;e<E.length;e++){const i=E[e],r=i.image[t].image;v?n.texSubImage2D(34069+t,e+1,0,0,r.width,r.height,m,g,r.data):n.texImage2D(34069+t,e+1,_,r.width,r.height,0,m,g,r.data)}}else{v?n.texSubImage2D(34069+t,0,0,0,m,g,d[t]):n.texImage2D(34069+t,0,_,m,g,d[t]);for(let e=0;e<E.length;e++){const i=E[e];v?n.texSubImage2D(34069+t,e+1,0,0,m,g,i.image[t]):n.texImage2D(34069+t,e+1,_,m,g,i.image[t])}}}M(r,f)&&w(34067),c.__version=h.version,r.onUpdate&&r.onUpdate(r)}e.__version=r.version}function Z(e,r,a,s,l){const u=o.convert(a.format,a.encoding),h=o.convert(a.type),c=S(a.internalFormat,u,h,a.encoding),p=i.get(r);p.__hasExternalTextures||(32879===l||35866===l?n.texImage3D(l,0,c,r.width,r.height,r.depth,0,u,h,null):n.texImage2D(l,0,c,r.width,r.height,0,u,h,null)),n.bindFramebuffer(36160,e),et(r)?d.framebufferTexture2DMultisampleEXT(36160,s,l,i.get(a).__webglTexture,0,tt(r)):(3553===l||l>=34069&&l<=34074)&&t.framebufferTexture2D(36160,s,l,i.get(a).__webglTexture,0),n.bindFramebuffer(36160,null)}function q(e,n,i){if(t.bindRenderbuffer(36161,e),n.depthBuffer&&!n.stencilBuffer){let r=33189;if(i||et(n)){const e=n.depthTexture;e&&e.isDepthTexture&&(e.type===bt?r=36012:e.type===xt&&(r=33190));const i=tt(n);et(n)?d.renderbufferStorageMultisampleEXT(36161,i,r,n.width,n.height):t.renderbufferStorageMultisample(36161,i,r,n.width,n.height)}else t.renderbufferStorage(36161,r,n.width,n.height);t.framebufferRenderbuffer(36160,36096,36161,e)}else if(n.depthBuffer&&n.stencilBuffer){const r=tt(n);i&&!1===et(n)?t.renderbufferStorageMultisample(36161,r,35056,n.width,n.height):et(n)?d.renderbufferStorageMultisampleEXT(36161,r,35056,n.width,n.height):t.renderbufferStorage(36161,34041,n.width,n.height),t.framebufferRenderbuffer(36160,33306,36161,e)}else{const e=!0===n.isWebGLMultipleRenderTargets?n.texture:[n.texture];for(let r=0;r<e.length;r++){const a=e[r],s=o.convert(a.format,a.encoding),l=o.convert(a.type),u=S(a.internalFormat,s,l,a.encoding),h=tt(n);i&&!1===et(n)?t.renderbufferStorageMultisample(36161,h,u,n.width,n.height):et(n)?d.renderbufferStorageMultisampleEXT(36161,h,u,n.width,n.height):t.renderbufferStorage(36161,u,n.width,n.height)}}t.bindRenderbuffer(36161,null)}function X(e,r){const o=r&&r.isWebGLCubeRenderTarget;if(o)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(36160,e),!r.depthTexture||!r.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");i.get(r.depthTexture).__webglTexture&&r.depthTexture.image.width===r.width&&r.depthTexture.image.height===r.height||(r.depthTexture.image.width=r.width,r.depthTexture.image.height=r.height,r.depthTexture.needsUpdate=!0),N(r.depthTexture,0);const a=i.get(r.depthTexture).__webglTexture,s=tt(r);if(r.depthTexture.format===Ct)et(r)?d.framebufferTexture2DMultisampleEXT(36160,36096,3553,a,0,s):t.framebufferTexture2D(36160,36096,3553,a,0);else{if(r.depthTexture.format!==Rt)throw new Error("Unknown depthTexture format");et(r)?d.framebufferTexture2DMultisampleEXT(36160,33306,3553,a,0,s):t.framebufferTexture2D(36160,33306,3553,a,0)}}function Y(e){const r=i.get(e),o=!0===e.isWebGLCubeRenderTarget;if(e.depthTexture&&!r.__autoAllocateDepthBuffer){if(o)throw new Error("target.depthTexture not supported in Cube render targets");X(r.__webglFramebuffer,e)}else if(o){r.__webglDepthbuffer=[];for(let i=0;i<6;i++)n.bindFramebuffer(36160,r.__webglFramebuffer[i]),r.__webglDepthbuffer[i]=t.createRenderbuffer(),q(r.__webglDepthbuffer[i],e,!1)}else n.bindFramebuffer(36160,r.__webglFramebuffer),r.__webglDepthbuffer=t.createRenderbuffer(),q(r.__webglDepthbuffer,e,!1);n.bindFramebuffer(36160,null)}function K(t,e,n){const r=i.get(t);void 0!==e&&Z(r.__webglFramebuffer,t,t.texture,36064,3553),void 0!==n&&Y(t)}function J(e){const l=e.texture,u=i.get(e),h=i.get(l);e.addEventListener("dispose",L),!0!==e.isWebGLMultipleRenderTargets&&(void 0===h.__webglTexture&&(h.__webglTexture=t.createTexture()),h.__version=l.version,a.memory.textures++);const c=!0===e.isWebGLCubeRenderTarget,d=!0===e.isWebGLMultipleRenderTargets,p=x(e)||s;if(c){u.__webglFramebuffer=[];for(let e=0;e<6;e++)u.__webglFramebuffer[e]=t.createFramebuffer()}else{if(u.__webglFramebuffer=t.createFramebuffer(),d)if(r.drawBuffers){const n=e.texture;for(let e=0,r=n.length;e<r;e++){const r=i.get(n[e]);void 0===r.__webglTexture&&(r.__webglTexture=t.createTexture(),a.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");if(s&&e.samples>0&&!1===et(e)){const i=d?l:[l];u.__webglMultisampledFramebuffer=t.createFramebuffer(),u.__webglColorRenderbuffer=[],n.bindFramebuffer(36160,u.__webglMultisampledFramebuffer);for(let n=0;n<i.length;n++){const r=i[n];u.__webglColorRenderbuffer[n]=t.createRenderbuffer(),t.bindRenderbuffer(36161,u.__webglColorRenderbuffer[n]);const a=o.convert(r.format,r.encoding),s=o.convert(r.type),l=S(r.internalFormat,a,s,r.encoding,!0===e.isXRRenderTarget),h=tt(e);t.renderbufferStorageMultisample(36161,h,l,e.width,e.height),t.framebufferRenderbuffer(36160,36064+n,36161,u.__webglColorRenderbuffer[n])}t.bindRenderbuffer(36161,null),e.depthBuffer&&(u.__webglDepthRenderbuffer=t.createRenderbuffer(),q(u.__webglDepthRenderbuffer,e,!0)),n.bindFramebuffer(36160,null)}}if(c){n.bindTexture(34067,h.__webglTexture),H(34067,l,p);for(let t=0;t<6;t++)Z(u.__webglFramebuffer[t],e,l,36064,34069+t);M(l,p)&&w(34067),n.unbindTexture()}else if(d){const t=e.texture;for(let r=0,o=t.length;r<o;r++){const o=t[r],a=i.get(o);n.bindTexture(3553,a.__webglTexture),H(3553,o,p),Z(u.__webglFramebuffer,e,o,36064+r,3553),M(o,p)&&w(3553)}n.unbindTexture()}else{let t=3553;(e.isWebGL3DRenderTarget||e.isWebGLArrayRenderTarget)&&(s?t=e.isWebGL3DRenderTarget?32879:35866:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),n.bindTexture(t,h.__webglTexture),H(t,l,p),Z(u.__webglFramebuffer,e,l,36064,t),M(l,p)&&w(t),n.unbindTexture()}e.depthBuffer&&Y(e)}function $(t){const e=x(t)||s,r=!0===t.isWebGLMultipleRenderTargets?t.texture:[t.texture];for(let o=0,a=r.length;o<a;o++){const a=r[o];if(M(a,e)){const e=t.isWebGLCubeRenderTarget?34067:3553,r=i.get(a).__webglTexture;n.bindTexture(e,r),w(e),n.unbindTexture()}}}function Q(e){if(s&&e.samples>0&&!1===et(e)){const r=e.isWebGLMultipleRenderTargets?e.texture:[e.texture],o=e.width,a=e.height;let s=16384;const l=[],u=e.stencilBuffer?33306:36096,h=i.get(e),c=!0===e.isWebGLMultipleRenderTargets;if(c)for(let e=0;e<r.length;e++)n.bindFramebuffer(36160,h.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064+e,36161,null),n.bindFramebuffer(36160,h.__webglFramebuffer),t.framebufferTexture2D(36009,36064+e,3553,null,0);n.bindFramebuffer(36008,h.__webglMultisampledFramebuffer),n.bindFramebuffer(36009,h.__webglFramebuffer);for(let n=0;n<r.length;n++){l.push(36064+n),e.depthBuffer&&l.push(u);const d=void 0!==h.__ignoreDepthValues&&h.__ignoreDepthValues;if(!1===d&&(e.depthBuffer&&(s|=256),e.stencilBuffer&&(s|=1024)),c&&t.framebufferRenderbuffer(36008,36064,36161,h.__webglColorRenderbuffer[n]),!0===d&&(t.invalidateFramebuffer(36008,[u]),t.invalidateFramebuffer(36009,[u])),c){const e=i.get(r[n]).__webglTexture;t.framebufferTexture2D(36009,36064,3553,e,0)}t.blitFramebuffer(0,0,o,a,0,0,o,a,s,9728),p&&t.invalidateFramebuffer(36008,l)}if(n.bindFramebuffer(36008,null),n.bindFramebuffer(36009,null),c)for(let e=0;e<r.length;e++){n.bindFramebuffer(36160,h.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064+e,36161,h.__webglColorRenderbuffer[e]);const o=i.get(r[e]).__webglTexture;n.bindFramebuffer(36160,h.__webglFramebuffer),t.framebufferTexture2D(36009,36064+e,3553,o,0)}n.bindFramebuffer(36009,h.__webglMultisampledFramebuffer)}}function tt(t){return Math.min(c,t.samples)}function et(t){const n=i.get(t);return s&&t.samples>0&&!0===e.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function nt(t){const e=a.render.frame;f.get(t)!==e&&(f.set(t,e),t.update())}function it(t,n){const i=t.encoding,r=t.format,o=t.type;return!0===t.isCompressedTexture||!0===t.isVideoTexture||t.format===Re||i!==ye&&(i===xe?!1===s?!0===e.has("EXT_sRGB")&&r===Pt?(t.format=Re,t.minFilter=dt,t.generateMipmaps=!1):n=Sn.sRGBToLinear(n):r===Pt&&o===mt||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",i)),n}this.allocateTextureUnit=O,this.resetTextureUnits=D,this.setTexture2D=N,this.setTexture2DArray=k,this.setTexture3D=U,this.setTextureCube=B,this.rebindTextures=K,this.setupRenderTarget=J,this.updateRenderTargetMipmap=$,this.updateMultisampleRenderTarget=Q,this.setupDepthRenderbuffer=Y,this.setupFrameBufferTexture=Z,this.useMultisampledRTT=et}function mh(t,e,n){const i=n.isWebGL2;function r(n,r=null){let o;if(n===mt)return 5121;if(n===wt)return 32819;if(n===St)return 32820;if(n===gt)return 5120;if(n===_t)return 5122;if(n===vt)return 5123;if(n===yt)return 5124;if(n===xt)return 5125;if(n===bt)return 5126;if(n===Mt)return i?5131:(o=e.get("OES_texture_half_float"),null!==o?o.HALF_FLOAT_OES:null);if(n===Et)return 6406;if(n===Pt)return 6408;if(n===Lt)return 6409;if(n===At)return 6410;if(n===Ct)return 6402;if(n===Rt)return 34041;if(n===Re)return o=e.get("EXT_sRGB"),null!==o?o.SRGB_ALPHA_EXT:null;if(n===It)return 6403;if(n===Dt)return 36244;if(n===Ot)return 33319;if(n===zt)return 33320;if(n===Nt)return 36249;if(n===kt||n===Ut||n===Bt||n===Ft)if(r===xe){if(o=e.get("WEBGL_compressed_texture_s3tc_srgb"),null===o)return null;if(n===kt)return o.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===Ut)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===Bt)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Ft)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(o=e.get("WEBGL_compressed_texture_s3tc"),null===o)return null;if(n===kt)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===Ut)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===Bt)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Ft)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(n===Vt||n===Ht||n===Wt||n===Gt){if(o=e.get("WEBGL_compressed_texture_pvrtc"),null===o)return null;if(n===Vt)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===Ht)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Wt)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Gt)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(n===jt)return o=e.get("WEBGL_compressed_texture_etc1"),null!==o?o.COMPRESSED_RGB_ETC1_WEBGL:null;if(n===Zt||n===qt){if(o=e.get("WEBGL_compressed_texture_etc"),null===o)return null;if(n===Zt)return r===xe?o.COMPRESSED_SRGB8_ETC2:o.COMPRESSED_RGB8_ETC2;if(n===qt)return r===xe?o.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:o.COMPRESSED_RGBA8_ETC2_EAC}if(n===Xt||n===Yt||n===Kt||n===Jt||n===$t||n===Qt||n===te||n===ee||n===ne||n===ie||n===re||n===oe||n===ae||n===se){if(o=e.get("WEBGL_compressed_texture_astc"),null===o)return null;if(n===Xt)return r===xe?o.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:o.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Yt)return r===xe?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:o.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Kt)return r===xe?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:o.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Jt)return r===xe?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:o.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===$t)return r===xe?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:o.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===Qt)return r===xe?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:o.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===te)return r===xe?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:o.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===ee)return r===xe?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:o.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===ne)return r===xe?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:o.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===ie)return r===xe?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:o.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===re)return r===xe?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:o.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===oe)return r===xe?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:o.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===ae)return r===xe?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:o.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===se)return r===xe?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:o.COMPRESSED_RGBA_ASTC_12x12_KHR}if(n===le){if(o=e.get("EXT_texture_compression_bptc"),null===o)return null;if(n===le)return r===xe?o.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:o.COMPRESSED_RGBA_BPTC_UNORM_EXT}if(n===ue||n===he||n===ce||n===de){if(o=e.get("EXT_texture_compression_rgtc"),null===o)return null;if(n===le)return o.COMPRESSED_RED_RGTC1_EXT;if(n===he)return o.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===ce)return o.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===de)return o.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return n===Tt?i?34042:(o=e.get("WEBGL_depth_texture"),null!==o?o.UNSIGNED_INT_24_8_WEBGL:null):void 0!==t[n]?t[n]:null}return{convert:r}}class gh extends Nr{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}}class _h extends zi{constructor(){super(),this.isGroup=!0,this.type="Group"}}const vh={type:"move"};class yh{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new _h,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new _h,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new On,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new On),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new _h,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new On,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new On),this._grip}dispatchEvent(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),null!==this._hand&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){const e=this._hand;if(e)for(const n of t.hand.values())this._getHandJoint(e,n)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(t,e,n){let i=null,r=null,o=null;const a=this._targetRay,s=this._grip,l=this._hand;if(t&&"visible-blurred"!==e.session.visibilityState){if(l&&t.hand){o=!0;for(const o of t.hand.values()){const t=e.getJointPose(o,n),i=this._getHandJoint(l,o);null!==t&&(i.matrix.fromArray(t.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.jointRadius=t.radius),i.visible=null!==t}const i=l.joints["index-finger-tip"],r=l.joints["thumb-tip"],a=i.position.distanceTo(r.position),s=.02,u=.005;l.inputState.pinching&&a>s+u?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&a<=s-u&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==s&&t.gripSpace&&(r=e.getPose(t.gripSpace,n),null!==r&&(s.matrix.fromArray(r.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),r.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(r.linearVelocity)):s.hasLinearVelocity=!1,r.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(r.angularVelocity)):s.hasAngularVelocity=!1));null!==a&&(i=e.getPose(t.targetRaySpace,n),null===i&&null!==r&&(i=r),null!==i&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(vh)))}return null!==a&&(a.visible=null!==i),null!==s&&(s.visible=null!==r),null!==l&&(l.visible=null!==o),this}_getHandJoint(t,e){if(void 0===t.joints[e.jointName]){const n=new _h;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}}class xh extends Ln{constructor(t,e,n,i,r,o,a,s,l,u){if(u=void 0!==u?u:Ct,u!==Ct&&u!==Rt)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&u===Ct&&(n=xt),void 0===n&&u===Rt&&(n=Tt),super(null,i,r,o,a,s,u,n,l),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=void 0!==a?a:ut,this.minFilter=void 0!==s?s:ut,this.flipY=!1,this.generateMipmaps=!1}}class bh extends Ie{constructor(t,e){super();const n=this;let i=null,r=1,o=null,a="local-floor",s=1,l=null,u=null,h=null,c=null,d=null,p=null;const f=e.getContextAttributes();let m=null,g=null;const _=[],v=[],y=new Set,x=new Map,b=new Nr;b.layers.enable(1),b.viewport=new An;const M=new Nr;M.layers.enable(2),M.viewport=new An;const w=[b,M],S=new gh;S.layers.enable(1),S.layers.enable(2);let T=null,E=null;function P(t){const e=v.indexOf(t.inputSource);if(-1===e)return;const n=_[e];void 0!==n&&n.dispatchEvent({type:t.type,data:t.inputSource})}function L(){i.removeEventListener("select",P),i.removeEventListener("selectstart",P),i.removeEventListener("selectend",P),i.removeEventListener("squeeze",P),i.removeEventListener("squeezestart",P),i.removeEventListener("squeezeend",P),i.removeEventListener("end",L),i.removeEventListener("inputsourceschange",A);for(let t=0;t<_.length;t++){const e=v[t];null!==e&&(v[t]=null,_[t].disconnect(e))}T=null,E=null,t.setRenderTarget(m),d=null,c=null,h=null,i=null,g=null,N.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function A(t){for(let e=0;e<t.removed.length;e++){const n=t.removed[e],i=v.indexOf(n);i>=0&&(v[i]=null,_[i].disconnect(n))}for(let e=0;e<t.added.length;e++){const n=t.added[e];let i=v.indexOf(n);if(-1===i){for(let t=0;t<_.length;t++){if(t>=v.length){v.push(n),i=t;break}if(null===v[t]){v[t]=n,i=t;break}}if(-1===i)break}const r=_[i];r&&r.connect(n)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(t){let e=_[t];return void 0===e&&(e=new yh,_[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){let e=_[t];return void 0===e&&(e=new yh,_[t]=e),e.getGripSpace()},this.getHand=function(t){let e=_[t];return void 0===e&&(e=new yh,_[t]=e),e.getHandSpace()},this.setFramebufferScaleFactor=function(t){r=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(t){a=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||o},this.setReferenceSpace=function(t){l=t},this.getBaseLayer=function(){return null!==c?c:d},this.getBinding=function(){return h},this.getFrame=function(){return p},this.getSession=function(){return i},this.setSession=async function(u){if(i=u,null!==i){if(m=t.getRenderTarget(),i.addEventListener("select",P),i.addEventListener("selectstart",P),i.addEventListener("selectend",P),i.addEventListener("squeeze",P),i.addEventListener("squeezestart",P),i.addEventListener("squeezeend",P),i.addEventListener("end",L),i.addEventListener("inputsourceschange",A),!0!==f.xrCompatible&&await e.makeXRCompatible(),void 0===i.renderState.layers||!1===t.capabilities.isWebGL2){const n={antialias:void 0!==i.renderState.layers||f.antialias,alpha:f.alpha,depth:f.depth,stencil:f.stencil,framebufferScaleFactor:r};d=new XRWebGLLayer(i,e,n),i.updateRenderState({baseLayer:d}),g=new Cn(d.framebufferWidth,d.framebufferHeight,{format:Pt,type:mt,encoding:t.outputEncoding,stencilBuffer:f.stencil})}else{let n=null,o=null,a=null;f.depth&&(a=f.stencil?35056:33190,n=f.stencil?Rt:Ct,o=f.stencil?Tt:xt);const s={colorFormat:32856,depthFormat:a,scaleFactor:r};h=new XRWebGLBinding(i,e),c=h.createProjectionLayer(s),i.updateRenderState({layers:[c]}),g=new Cn(c.textureWidth,c.textureHeight,{format:Pt,type:mt,depthTexture:new xh(c.textureWidth,c.textureHeight,o,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:f.stencil,encoding:t.outputEncoding,samples:f.antialias?4:0});const l=t.properties.get(g);l.__ignoreDepthValues=c.ignoreDepthValues}g.isXRRenderTarget=!0,this.setFoveation(s),l=null,o=await i.requestReferenceSpace(a),N.setContext(i),N.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};const C=new On,R=new On;function I(t,e,n){C.setFromMatrixPosition(e.matrixWorld),R.setFromMatrixPosition(n.matrixWorld);const i=C.distanceTo(R),r=e.projectionMatrix.elements,o=n.projectionMatrix.elements,a=r[14]/(r[10]-1),s=r[14]/(r[10]+1),l=(r[9]+1)/r[5],u=(r[9]-1)/r[5],h=(r[8]-1)/r[0],c=(o[8]+1)/o[0],d=a*h,p=a*c,f=i/(-h+c),m=f*-h;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(m),t.translateZ(f),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.copy(t.matrixWorld).invert();const g=a+f,_=s+f,v=d-m,y=p+(i-m),x=l*s/_*g,b=u*s/_*g;t.projectionMatrix.makePerspective(v,y,x,b,g,_)}function D(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.copy(t.matrixWorld).invert()}this.updateCamera=function(t){if(null===i)return;S.near=M.near=b.near=t.near,S.far=M.far=b.far=t.far,T===S.near&&E===S.far||(i.updateRenderState({depthNear:S.near,depthFar:S.far}),T=S.near,E=S.far);const e=t.parent,n=S.cameras;D(S,e);for(let i=0;i<n.length;i++)D(n[i],e);S.matrixWorld.decompose(S.position,S.quaternion,S.scale),t.matrix.copy(S.matrix),t.matrix.decompose(t.position,t.quaternion,t.scale);const r=t.children;for(let i=0,o=r.length;i<o;i++)r[i].updateMatrixWorld(!0);2===n.length?I(S,b,M):S.projectionMatrix.copy(b.projectionMatrix)},this.getCamera=function(){return S},this.getFoveation=function(){if(null!==c||null!==d)return s},this.setFoveation=function(t){s=t,null!==c&&(c.fixedFoveation=t),null!==d&&void 0!==d.fixedFoveation&&(d.fixedFoveation=t)},this.getPlanes=function(){return y};let O=null;function z(e,i){if(u=i.getViewerPose(l||o),p=i,null!==u){const e=u.views;null!==d&&(t.setRenderTargetFramebuffer(g,d.framebuffer),t.setRenderTarget(g));let n=!1;e.length!==S.cameras.length&&(S.cameras.length=0,n=!0);for(let i=0;i<e.length;i++){const r=e[i];let o=null;if(null!==d)o=d.getViewport(r);else{const e=h.getViewSubImage(c,r);o=e.viewport,0===i&&(t.setRenderTargetTextures(g,e.colorTexture,c.ignoreDepthValues?void 0:e.depthStencilTexture),t.setRenderTarget(g))}let a=w[i];void 0===a&&(a=new Nr,a.layers.enable(i),a.viewport=new An,w[i]=a),a.matrix.fromArray(r.transform.matrix),a.projectionMatrix.fromArray(r.projectionMatrix),a.viewport.set(o.x,o.y,o.width,o.height),0===i&&S.matrix.copy(a.matrix),!0===n&&S.cameras.push(a)}}for(let t=0;t<_.length;t++){const e=v[t],n=_[t];null!==e&&void 0!==n&&n.update(e,i,l||o)}if(O&&O(e,i),i.detectedPlanes){n.dispatchEvent({type:"planesdetected",data:i.detectedPlanes});let t=null;for(const e of y)i.detectedPlanes.has(e)||(null===t&&(t=[]),t.push(e));if(null!==t)for(const e of t)y.delete(e),x.delete(e),n.dispatchEvent({type:"planeremoved",data:e});for(const e of i.detectedPlanes)if(y.has(e)){const t=x.get(e);e.lastChangedTime>t&&(x.set(e,e.lastChangedTime),n.dispatchEvent({type:"planechanged",data:e}))}else y.add(e),x.set(e,i.lastChangedTime),n.dispatchEvent({type:"planeadded",data:e})}p=null}const N=new Yr;N.setAnimationLoop(z),this.setAnimationLoop=function(t){O=t},this.dispose=function(){}}}function Mh(t,e){function n(e,n){n.color.getRGB(e.fogColor.value,Cr(t)),n.isFog?(e.fogNear.value=n.near,e.fogFar.value=n.far):n.isFogExp2&&(e.fogDensity.value=n.density)}function i(t,e,n,i,p){e.isMeshBasicMaterial||e.isMeshLambertMaterial?r(t,e):e.isMeshToonMaterial?(r(t,e),h(t,e)):e.isMeshPhongMaterial?(r(t,e),u(t,e)):e.isMeshStandardMaterial?(r(t,e),c(t,e),e.isMeshPhysicalMaterial&&d(t,e,p)):e.isMeshMatcapMaterial?(r(t,e),f(t,e)):e.isMeshDepthMaterial?r(t,e):e.isMeshDistanceMaterial?(r(t,e),m(t,e)):e.isMeshNormalMaterial?r(t,e):e.isLineBasicMaterial?(o(t,e),e.isLineDashedMaterial&&a(t,e)):e.isPointsMaterial?s(t,e,n,i):e.isSpriteMaterial?l(t,e):e.isShadowMaterial?(t.color.value.copy(e.color),t.opacity.value=e.opacity):e.isShaderMaterial&&(e.uniformsNeedUpdate=!1)}function r(n,i){n.opacity.value=i.opacity,i.color&&n.diffuse.value.copy(i.color),i.emissive&&n.emissive.value.copy(i.emissive).multiplyScalar(i.emissiveIntensity),i.map&&(n.map.value=i.map),i.alphaMap&&(n.alphaMap.value=i.alphaMap),i.bumpMap&&(n.bumpMap.value=i.bumpMap,n.bumpScale.value=i.bumpScale,i.side===p&&(n.bumpScale.value*=-1)),i.displacementMap&&(n.displacementMap.value=i.displacementMap,n.displacementScale.value=i.displacementScale,n.displacementBias.value=i.displacementBias),i.emissiveMap&&(n.emissiveMap.value=i.emissiveMap),i.normalMap&&(n.normalMap.value=i.normalMap,n.normalScale.value.copy(i.normalScale),i.side===p&&n.normalScale.value.negate()),i.specularMap&&(n.specularMap.value=i.specularMap),i.alphaTest>0&&(n.alphaTest.value=i.alphaTest);const r=e.get(i).envMap;if(r&&(n.envMap.value=r,n.flipEnvMap.value=r.isCubeTexture&&!1===r.isRenderTargetTexture?-1:1,n.reflectivity.value=i.reflectivity,n.ior.value=i.ior,n.refractionRatio.value=i.refractionRatio),i.lightMap){n.lightMap.value=i.lightMap;const e=!0!==t.physicallyCorrectLights?Math.PI:1;n.lightMapIntensity.value=i.lightMapIntensity*e}let o,a;i.aoMap&&(n.aoMap.value=i.aoMap,n.aoMapIntensity.value=i.aoMapIntensity),i.map?o=i.map:i.specularMap?o=i.specularMap:i.displacementMap?o=i.displacementMap:i.normalMap?o=i.normalMap:i.bumpMap?o=i.bumpMap:i.roughnessMap?o=i.roughnessMap:i.metalnessMap?o=i.metalnessMap:i.alphaMap?o=i.alphaMap:i.emissiveMap?o=i.emissiveMap:i.clearcoatMap?o=i.clearcoatMap:i.clearcoatNormalMap?o=i.clearcoatNormalMap:i.clearcoatRoughnessMap?o=i.clearcoatRoughnessMap:i.iridescenceMap?o=i.iridescenceMap:i.iridescenceThicknessMap?o=i.iridescenceThicknessMap:i.specularIntensityMap?o=i.specularIntensityMap:i.specularColorMap?o=i.specularColorMap:i.transmissionMap?o=i.transmissionMap:i.thicknessMap?o=i.thicknessMap:i.sheenColorMap?o=i.sheenColorMap:i.sheenRoughnessMap&&(o=i.sheenRoughnessMap),void 0!==o&&(o.isWebGLRenderTarget&&(o=o.texture),!0===o.matrixAutoUpdate&&o.updateMatrix(),n.uvTransform.value.copy(o.matrix)),i.aoMap?a=i.aoMap:i.lightMap&&(a=i.lightMap),void 0!==a&&(a.isWebGLRenderTarget&&(a=a.texture),!0===a.matrixAutoUpdate&&a.updateMatrix(),n.uv2Transform.value.copy(a.matrix))}function o(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity}function a(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}function s(t,e,n,i){let r;t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*n,t.scale.value=.5*i,e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.alphaTest>0&&(t.alphaTest.value=e.alphaTest),e.map?r=e.map:e.alphaMap&&(r=e.alphaMap),void 0!==r&&(!0===r.matrixAutoUpdate&&r.updateMatrix(),t.uvTransform.value.copy(r.matrix))}function l(t,e){let n;t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.alphaTest>0&&(t.alphaTest.value=e.alphaTest),e.map?n=e.map:e.alphaMap&&(n=e.alphaMap),void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),t.uvTransform.value.copy(n.matrix))}function u(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4)}function h(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap)}function c(t,n){t.roughness.value=n.roughness,t.metalness.value=n.metalness,n.roughnessMap&&(t.roughnessMap.value=n.roughnessMap),n.metalnessMap&&(t.metalnessMap.value=n.metalnessMap);const i=e.get(n).envMap;i&&(t.envMapIntensity.value=n.envMapIntensity)}function d(t,e,n){t.ior.value=e.ior,e.sheen>0&&(t.sheenColor.value.copy(e.sheenColor).multiplyScalar(e.sheen),t.sheenRoughness.value=e.sheenRoughness,e.sheenColorMap&&(t.sheenColorMap.value=e.sheenColorMap),e.sheenRoughnessMap&&(t.sheenRoughnessMap.value=e.sheenRoughnessMap)),e.clearcoat>0&&(t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap),e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap),e.clearcoatNormalMap&&(t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),t.clearcoatNormalMap.value=e.clearcoatNormalMap,e.side===p&&t.clearcoatNormalScale.value.negate())),e.iridescence>0&&(t.iridescence.value=e.iridescence,t.iridescenceIOR.value=e.iridescenceIOR,t.iridescenceThicknessMinimum.value=e.iridescenceThicknessRange[0],t.iridescenceThicknessMaximum.value=e.iridescenceThicknessRange[1],e.iridescenceMap&&(t.iridescenceMap.value=e.iridescenceMap),e.iridescenceThicknessMap&&(t.iridescenceThicknessMap.value=e.iridescenceThicknessMap)),e.transmission>0&&(t.transmission.value=e.transmission,t.transmissionSamplerMap.value=n.texture,t.transmissionSamplerSize.value.set(n.width,n.height),e.transmissionMap&&(t.transmissionMap.value=e.transmissionMap),t.thickness.value=e.thickness,e.thicknessMap&&(t.thicknessMap.value=e.thicknessMap),t.attenuationDistance.value=e.attenuationDistance,t.attenuationColor.value.copy(e.attenuationColor)),t.specularIntensity.value=e.specularIntensity,t.specularColor.value.copy(e.specularColor),e.specularIntensityMap&&(t.specularIntensityMap.value=e.specularIntensityMap),e.specularColorMap&&(t.specularColorMap.value=e.specularColorMap)}function f(t,e){e.matcap&&(t.matcap.value=e.matcap)}function m(t,e){t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function wh(t,e,n,i){let r={},o={},a=[];const s=n.isWebGL2?t.getParameter(35375):0;function l(t,e){const n=e.program;i.uniformBlockBinding(t,n)}function u(t,n){let a=r[t.id];void 0===a&&(f(t),a=h(t),r[t.id]=a,t.addEventListener("dispose",g));const s=n.program;i.updateUBOMapping(t,s);const l=e.render.frame;o[t.id]!==l&&(d(t),o[t.id]=l)}function h(e){const n=c();e.__bindingPointIndex=n;const i=t.createBuffer(),r=e.__size,o=e.usage;return t.bindBuffer(35345,i),t.bufferData(35345,r,o),t.bindBuffer(35345,null),t.bindBufferBase(35345,n,i),i}function c(){for(let t=0;t<s;t++)if(-1===a.indexOf(t))return a.push(t),t;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function d(e){const n=r[e.id],i=e.uniforms,o=e.__cache;t.bindBuffer(35345,n);for(let r=0,a=i.length;r<a;r++){const e=i[r];if(!0===p(e,r,o)){const n=e.__offset,i=Array.isArray(e.value)?e.value:[e.value];let r=0;for(let o=0;o<i.length;o++){const a=i[o],s=m(a);"number"===typeof a?(e.__data[0]=a,t.bufferSubData(35345,n+r,e.__data)):a.isMatrix3?(e.__data[0]=a.elements[0],e.__data[1]=a.elements[1],e.__data[2]=a.elements[2],e.__data[3]=a.elements[0],e.__data[4]=a.elements[3],e.__data[5]=a.elements[4],e.__data[6]=a.elements[5],e.__data[7]=a.elements[0],e.__data[8]=a.elements[6],e.__data[9]=a.elements[7],e.__data[10]=a.elements[8],e.__data[11]=a.elements[0]):(a.toArray(e.__data,r),r+=s.storage/Float32Array.BYTES_PER_ELEMENT)}t.bufferSubData(35345,n,e.__data)}}t.bindBuffer(35345,null)}function p(t,e,n){const i=t.value;if(void 0===n[e]){if("number"===typeof i)n[e]=i;else{const t=Array.isArray(i)?i:[i],r=[];for(let e=0;e<t.length;e++)r.push(t[e].clone());n[e]=r}return!0}if("number"===typeof i){if(n[e]!==i)return n[e]=i,!0}else{const t=Array.isArray(n[e])?n[e]:[n[e]],r=Array.isArray(i)?i:[i];for(let e=0;e<t.length;e++){const n=t[e];if(!1===n.equals(r[e]))return n.copy(r[e]),!0}}return!1}function f(t){const e=t.uniforms;let n=0;const i=16;let r=0;for(let o=0,a=e.length;o<a;o++){const t=e[o],a={boundary:0,storage:0},s=Array.isArray(t.value)?t.value:[t.value];for(let e=0,n=s.length;e<n;e++){const t=s[e],n=m(t);a.boundary+=n.boundary,a.storage+=n.storage}if(t.__data=new Float32Array(a.storage/Float32Array.BYTES_PER_ELEMENT),t.__offset=n,o>0){r=n%i;const e=i-r;0!==r&&e-a.boundary<0&&(n+=i-r,t.__offset=n)}n+=a.storage}return r=n%i,r>0&&(n+=i-r),t.__size=n,t.__cache={},this}function m(t){const e={boundary:0,storage:0};return"number"===typeof t?(e.boundary=4,e.storage=4):t.isVector2?(e.boundary=8,e.storage=8):t.isVector3||t.isColor?(e.boundary=16,e.storage=12):t.isVector4?(e.boundary=16,e.storage=16):t.isMatrix3?(e.boundary=48,e.storage=48):t.isMatrix4?(e.boundary=64,e.storage=64):t.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",t),e}function g(e){const n=e.target;n.removeEventListener("dispose",g);const i=a.indexOf(n.__bindingPointIndex);a.splice(i,1),t.deleteBuffer(r[n.id]),delete r[n.id],delete o[n.id]}function _(){for(const e in r)t.deleteBuffer(r[e]);a=[],r={},o={}}return{bind:l,update:u,dispose:_}}function Sh(){const t=cn("canvas");return t.style.display="block",t}function Th(t={}){this.isWebGLRenderer=!0;const e=void 0!==t.canvas?t.canvas:Sh(),n=void 0!==t.context?t.context:null,r=void 0===t.depth||t.depth,o=void 0===t.stencil||t.stencil,a=void 0!==t.antialias&&t.antialias,s=void 0===t.premultipliedAlpha||t.premultipliedAlpha,l=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,u=void 0!==t.powerPreference?t.powerPreference:"default",h=void 0!==t.failIfMajorPerformanceCaveat&&t.failIfMajorPerformanceCaveat;let c;c=null!==n?n.getContextAttributes().alpha:void 0!==t.alpha&&t.alpha;let m=null,g=null;const _=[],v=[];this.domElement=e,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.outputEncoding=ye,this.physicallyCorrectLights=!1,this.toneMapping=X,this.toneMappingExposure=1;const y=this;let x=!1,b=0,M=0,w=null,S=-1,T=null;const E=new An,P=new An;let L=null,A=e.width,C=e.height,R=1,I=null,D=null;const O=new An(0,0,A,C),z=new An(0,0,A,C);let N=!1;const k=new Xr;let U=!1,B=!1,F=null;const V=new hi,H=new sn,W=new On,G={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function j(){return null===w?R:1}let Z,q,Y,K,J,$,Q,tt,et,nt,it,rt,ot,at,st,lt,ut,ht,ct,dt,pt,gt,_t,vt,yt=n;function xt(t,n){for(let i=0;i<t.length;i++){const r=t[i],o=e.getContext(r,n);if(null!==o)return o}return null}try{const t={alpha:!0,depth:r,stencil:o,antialias:a,premultipliedAlpha:s,preserveDrawingBuffer:l,powerPreference:u,failIfMajorPerformanceCaveat:h};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${i}`),e.addEventListener("webglcontextlost",Tt,!1),e.addEventListener("webglcontextrestored",Et,!1),e.addEventListener("webglcontextcreationerror",Lt,!1),null===yt){const e=["webgl2","webgl","experimental-webgl"];if(!0===y.isWebGL1Renderer&&e.shift(),yt=xt(e,t),null===yt)throw xt(e)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}void 0===yt.getShaderPrecisionFormat&&(yt.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(qt){throw console.error("THREE.WebGLRenderer: "+qt.message),qt}function wt(){Z=new al(yt),q=new Us(yt,Z,t),Z.init(q),gt=new mh(yt,Z,q),Y=new ph(yt,Z,q),K=new ul,J=new Ku,$=new fh(yt,Z,Y,J,q,gt,K),Q=new Fs(y),tt=new ol(y),et=new Kr(yt,q),_t=new Ns(yt,Z,et,q),nt=new sl(yt,et,K,_t),it=new pl(yt,nt,et,K),ct=new dl(yt,q,$),lt=new Bs(J),rt=new Yu(y,Q,tt,Z,q,_t,lt),ot=new Mh(y,J),at=new th,st=new sh(Z,q),ht=new zs(y,Q,tt,Y,it,c,s),ut=new dh(y,it,q),vt=new wh(yt,K,q,Y),dt=new ks(yt,Z,K,q),pt=new ll(yt,Z,K,q),K.programs=rt.programs,y.capabilities=q,y.extensions=Z,y.properties=J,y.renderLists=at,y.shadowMap=ut,y.state=Y,y.info=K}wt();const St=new bh(y,yt);function Tt(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),x=!0}function Et(){console.log("THREE.WebGLRenderer: Context Restored."),x=!1;const t=K.autoReset,e=ut.enabled,n=ut.autoUpdate,i=ut.needsUpdate,r=ut.type;wt(),K.autoReset=t,ut.enabled=e,ut.autoUpdate=n,ut.needsUpdate=i,ut.type=r}function Lt(t){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",t.statusMessage)}function At(t){const e=t.target;e.removeEventListener("dispose",At),Ct(e)}function Ct(t){Rt(t),J.remove(t)}function Rt(t){const e=J.get(t).programs;void 0!==e&&(e.forEach((function(t){rt.releaseProgram(t)})),t.isShaderMaterial&&rt.releaseShaderCache(t))}this.xr=St,this.getContext=function(){return yt},this.getContextAttributes=function(){return yt.getContextAttributes()},this.forceContextLoss=function(){const t=Z.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){const t=Z.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return R},this.setPixelRatio=function(t){void 0!==t&&(R=t,this.setSize(A,C,!1))},this.getSize=function(t){return t.set(A,C)},this.setSize=function(t,n,i){St.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(A=t,C=n,e.width=Math.floor(t*R),e.height=Math.floor(n*R),!1!==i&&(e.style.width=t+"px",e.style.height=n+"px"),this.setViewport(0,0,t,n))},this.getDrawingBufferSize=function(t){return t.set(A*R,C*R).floor()},this.setDrawingBufferSize=function(t,n,i){A=t,C=n,R=i,e.width=Math.floor(t*i),e.height=Math.floor(n*i),this.setViewport(0,0,t,n)},this.getCurrentViewport=function(t){return t.copy(E)},this.getViewport=function(t){return t.copy(O)},this.setViewport=function(t,e,n,i){t.isVector4?O.set(t.x,t.y,t.z,t.w):O.set(t,e,n,i),Y.viewport(E.copy(O).multiplyScalar(R).floor())},this.getScissor=function(t){return t.copy(z)},this.setScissor=function(t,e,n,i){t.isVector4?z.set(t.x,t.y,t.z,t.w):z.set(t,e,n,i),Y.scissor(P.copy(z).multiplyScalar(R).floor())},this.getScissorTest=function(){return N},this.setScissorTest=function(t){Y.setScissorTest(N=t)},this.setOpaqueSort=function(t){I=t},this.setTransparentSort=function(t){D=t},this.getClearColor=function(t){return t.copy(ht.getClearColor())},this.setClearColor=function(){ht.setClearColor.apply(ht,arguments)},this.getClearAlpha=function(){return ht.getClearAlpha()},this.setClearAlpha=function(){ht.setClearAlpha.apply(ht,arguments)},this.clear=function(t=!0,e=!0,n=!0){let i=0;t&&(i|=16384),e&&(i|=256),n&&(i|=1024),yt.clear(i)},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(){e.removeEventListener("webglcontextlost",Tt,!1),e.removeEventListener("webglcontextrestored",Et,!1),e.removeEventListener("webglcontextcreationerror",Lt,!1),at.dispose(),st.dispose(),J.dispose(),Q.dispose(),tt.dispose(),it.dispose(),_t.dispose(),vt.dispose(),rt.dispose(),St.dispose(),St.removeEventListener("sessionstart",Ot),St.removeEventListener("sessionend",zt),F&&(F.dispose(),F=null),Nt.stop()},this.renderBufferDirect=function(t,e,n,i,r,o){null===e&&(e=G);const a=r.isMesh&&r.matrixWorld.determinant()<0,s=Gt(t,e,n,i,r);Y.setMaterial(i,a);let l=n.index,u=1;!0===i.wireframe&&(l=nt.getWireframeAttribute(n),u=2);const h=n.drawRange,c=n.attributes.position;let d=h.start*u,p=(h.start+h.count)*u;null!==o&&(d=Math.max(d,o.start*u),p=Math.min(p,(o.start+o.count)*u)),null!==l?(d=Math.max(d,0),p=Math.min(p,l.count)):void 0!==c&&null!==c&&(d=Math.max(d,0),p=Math.min(p,c.count));const f=p-d;if(f<0||f===1/0)return;let m;_t.setup(r,i,s,n,l);let g=dt;if(null!==l&&(m=et.get(l),g=pt,g.setIndex(m)),r.isMesh)!0===i.wireframe?(Y.setLineWidth(i.wireframeLinewidth*j()),g.setMode(1)):g.setMode(4);else if(r.isLine){let t=i.linewidth;void 0===t&&(t=1),Y.setLineWidth(t*j()),r.isLineSegments?g.setMode(1):r.isLineLoop?g.setMode(2):g.setMode(3)}else r.isPoints?g.setMode(0):r.isSprite&&g.setMode(4);if(r.isInstancedMesh)g.renderInstances(d,f,r.count);else if(n.isInstancedBufferGeometry){const t=void 0!==n._maxInstanceCount?n._maxInstanceCount:1/0,e=Math.min(n.instanceCount,t);g.renderInstances(d,f,e)}else g.render(d,f)},this.compile=function(t,e){function n(t,e,n){!0===t.transparent&&t.side===f&&!1===t.forceSinglePass?(t.side=p,t.needsUpdate=!0,Ht(t,e,n),t.side=d,t.needsUpdate=!0,Ht(t,e,n),t.side=f):Ht(t,e,n)}g=st.get(t),g.init(),v.push(g),t.traverseVisible((function(t){t.isLight&&t.layers.test(e.layers)&&(g.pushLight(t),t.castShadow&&g.pushShadow(t))})),g.setupLights(y.physicallyCorrectLights),t.traverse((function(e){const i=e.material;if(i)if(Array.isArray(i))for(let r=0;r<i.length;r++){const o=i[r];n(o,t,e)}else n(i,t,e)})),v.pop(),g=null};let It=null;function Dt(t){It&&It(t)}function Ot(){Nt.stop()}function zt(){Nt.start()}const Nt=new Yr;function kt(t,e,n,i){if(!1===t.visible)return;const r=t.layers.test(e.layers);if(r)if(t.isGroup)n=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(e);else if(t.isLight)g.pushLight(t),t.castShadow&&g.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||k.intersectsSprite(t)){i&&W.setFromMatrixPosition(t.matrixWorld).applyMatrix4(V);const e=it.update(t),r=t.material;r.visible&&m.push(t,e,r,n,W.z,null)}}else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.frame!==K.render.frame&&(t.skeleton.update(),t.skeleton.frame=K.render.frame),!t.frustumCulled||k.intersectsObject(t))){i&&W.setFromMatrixPosition(t.matrixWorld).applyMatrix4(V);const e=it.update(t),r=t.material;if(Array.isArray(r)){const i=e.groups;for(let o=0,a=i.length;o<a;o++){const a=i[o],s=r[a.materialIndex];s&&s.visible&&m.push(t,e,s,n,W.z,a)}}else r.visible&&m.push(t,e,r,n,W.z,null)}const o=t.children;for(let a=0,s=o.length;a<s;a++)kt(o[a],e,n,i)}function Ut(t,e,n,i){const r=t.opaque,o=t.transmissive,a=t.transparent;g.setupLightsView(n),!0===U&<.setGlobalState(y.clippingPlanes,n),o.length>0&&Bt(r,e,n),i&&Y.viewport(E.copy(i)),r.length>0&&Ft(r,e,n),o.length>0&&Ft(o,e,n),a.length>0&&Ft(a,e,n),Y.buffers.depth.setTest(!0),Y.buffers.depth.setMask(!0),Y.buffers.color.setMask(!0),Y.setPolygonOffset(!1)}function Bt(t,e,n){const i=q.isWebGL2;null===F&&(F=new Cn(1,1,{generateMipmaps:!0,type:Z.has("EXT_color_buffer_half_float")?Mt:mt,minFilter:ft,samples:i&&!0===a?4:0})),y.getDrawingBufferSize(H),i?F.setSize(H.x,H.y):F.setSize(en(H.x),en(H.y));const r=y.getRenderTarget();y.setRenderTarget(F),y.clear();const o=y.toneMapping;y.toneMapping=X,Ft(t,e,n),y.toneMapping=o,$.updateMultisampleRenderTarget(F),$.updateRenderTargetMipmap(F),y.setRenderTarget(r)}function Ft(t,e,n){const i=!0===e.isScene?e.overrideMaterial:null;for(let r=0,o=t.length;r<o;r++){const o=t[r],a=o.object,s=o.geometry,l=null===i?o.material:i,u=o.group;a.layers.test(n.layers)&&Vt(a,e,n,s,l,u)}}function Vt(t,e,n,i,r,o){t.onBeforeRender(y,e,n,i,r,o),t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),r.onBeforeRender(y,e,n,i,t,o),!0===r.transparent&&r.side===f&&!1===r.forceSinglePass?(r.side=p,r.needsUpdate=!0,y.renderBufferDirect(n,e,i,r,t,o),r.side=d,r.needsUpdate=!0,y.renderBufferDirect(n,e,i,r,t,o),r.side=f):y.renderBufferDirect(n,e,i,r,t,o),t.onAfterRender(y,e,n,i,r,o)}function Ht(t,e,n){!0!==e.isScene&&(e=G);const i=J.get(t),r=g.state.lights,o=g.state.shadowsArray,a=r.state.version,s=rt.getParameters(t,r.state,o,e,n),l=rt.getProgramCacheKey(s);let u=i.programs;i.environment=t.isMeshStandardMaterial?e.environment:null,i.fog=e.fog,i.envMap=(t.isMeshStandardMaterial?tt:Q).get(t.envMap||i.environment),void 0===u&&(t.addEventListener("dispose",At),u=new Map,i.programs=u);let h=u.get(l);if(void 0!==h){if(i.currentProgram===h&&i.lightsStateVersion===a)return Wt(t,s),h}else s.uniforms=rt.getUniforms(t),t.onBuild(n,s,y),t.onBeforeCompile(s,y),h=rt.acquireProgram(s,l),u.set(l,h),i.uniforms=s.uniforms;const c=i.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(c.clippingPlanes=lt.uniform),Wt(t,s),i.needsLights=Zt(t),i.lightsStateVersion=a,i.needsLights&&(c.ambientLightColor.value=r.state.ambient,c.lightProbe.value=r.state.probe,c.directionalLights.value=r.state.directional,c.directionalLightShadows.value=r.state.directionalShadow,c.spotLights.value=r.state.spot,c.spotLightShadows.value=r.state.spotShadow,c.rectAreaLights.value=r.state.rectArea,c.ltc_1.value=r.state.rectAreaLTC1,c.ltc_2.value=r.state.rectAreaLTC2,c.pointLights.value=r.state.point,c.pointLightShadows.value=r.state.pointShadow,c.hemisphereLights.value=r.state.hemi,c.directionalShadowMap.value=r.state.directionalShadowMap,c.directionalShadowMatrix.value=r.state.directionalShadowMatrix,c.spotShadowMap.value=r.state.spotShadowMap,c.spotLightMatrix.value=r.state.spotLightMatrix,c.spotLightMap.value=r.state.spotLightMap,c.pointShadowMap.value=r.state.pointShadowMap,c.pointShadowMatrix.value=r.state.pointShadowMatrix);const d=h.getUniforms(),p=yu.seqWithValue(d.seq,c);return i.currentProgram=h,i.uniformsList=p,h}function Wt(t,e){const n=J.get(t);n.outputEncoding=e.outputEncoding,n.instancing=e.instancing,n.skinning=e.skinning,n.morphTargets=e.morphTargets,n.morphNormals=e.morphNormals,n.morphColors=e.morphColors,n.morphTargetsCount=e.morphTargetsCount,n.numClippingPlanes=e.numClippingPlanes,n.numIntersection=e.numClipIntersection,n.vertexAlphas=e.vertexAlphas,n.vertexTangents=e.vertexTangents,n.toneMapping=e.toneMapping}function Gt(t,e,n,i,r){!0!==e.isScene&&(e=G),$.resetTextureUnits();const o=e.fog,a=i.isMeshStandardMaterial?e.environment:null,s=null===w?y.outputEncoding:!0===w.isXRRenderTarget?w.texture.encoding:ye,l=(i.isMeshStandardMaterial?tt:Q).get(i.envMap||a),u=!0===i.vertexColors&&!!n.attributes.color&&4===n.attributes.color.itemSize,h=!!i.normalMap&&!!n.attributes.tangent,c=!!n.morphAttributes.position,d=!!n.morphAttributes.normal,p=!!n.morphAttributes.color,f=i.toneMapped?y.toneMapping:X,m=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,_=void 0!==m?m.length:0,v=J.get(i),x=g.state.lights;if(!0===U&&(!0===B||t!==T)){const e=t===T&&i.id===S;lt.setState(i,t,e)}let b=!1;i.version===v.__version?v.needsLights&&v.lightsStateVersion!==x.state.version||v.outputEncoding!==s||r.isInstancedMesh&&!1===v.instancing?b=!0:r.isInstancedMesh||!0!==v.instancing?r.isSkinnedMesh&&!1===v.skinning?b=!0:r.isSkinnedMesh||!0!==v.skinning?v.envMap!==l||!0===i.fog&&v.fog!==o?b=!0:void 0===v.numClippingPlanes||v.numClippingPlanes===lt.numPlanes&&v.numIntersection===lt.numIntersection?(v.vertexAlphas!==u||v.vertexTangents!==h||v.morphTargets!==c||v.morphNormals!==d||v.morphColors!==p||v.toneMapping!==f||!0===q.isWebGL2&&v.morphTargetsCount!==_)&&(b=!0):b=!0:b=!0:b=!0:(b=!0,v.__version=i.version);let M=v.currentProgram;!0===b&&(M=Ht(i,e,r));let E=!1,P=!1,L=!1;const A=M.getUniforms(),I=v.uniforms;if(Y.useProgram(M.program)&&(E=!0,P=!0,L=!0),i.id!==S&&(S=i.id,P=!0),E||T!==t){if(A.setValue(yt,"projectionMatrix",t.projectionMatrix),q.logarithmicDepthBuffer&&A.setValue(yt,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),T!==t&&(T=t,P=!0,L=!0),i.isShaderMaterial||i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshStandardMaterial||i.envMap){const e=A.map.cameraPosition;void 0!==e&&e.setValue(yt,W.setFromMatrixPosition(t.matrixWorld))}(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial)&&A.setValue(yt,"isOrthographic",!0===t.isOrthographicCamera),(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial||i.isShadowMaterial||r.isSkinnedMesh)&&A.setValue(yt,"viewMatrix",t.matrixWorldInverse)}if(r.isSkinnedMesh){A.setOptional(yt,r,"bindMatrix"),A.setOptional(yt,r,"bindMatrixInverse");const t=r.skeleton;t&&(q.floatVertexTextures?(null===t.boneTexture&&t.computeBoneTexture(),A.setValue(yt,"boneTexture",t.boneTexture,$),A.setValue(yt,"boneTextureSize",t.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}const D=n.morphAttributes;if((void 0!==D.position||void 0!==D.normal||void 0!==D.color&&!0===q.isWebGL2)&&ct.update(r,n,i,M),(P||v.receiveShadow!==r.receiveShadow)&&(v.receiveShadow=r.receiveShadow,A.setValue(yt,"receiveShadow",r.receiveShadow)),i.isMeshGouraudMaterial&&null!==i.envMap&&(I.envMap.value=l,I.flipEnvMap.value=l.isCubeTexture&&!1===l.isRenderTargetTexture?-1:1),P&&(A.setValue(yt,"toneMappingExposure",y.toneMappingExposure),v.needsLights&&jt(I,L),o&&!0===i.fog&&ot.refreshFogUniforms(I,o),ot.refreshMaterialUniforms(I,i,R,C,F),yu.upload(yt,v.uniformsList,I,$)),i.isShaderMaterial&&!0===i.uniformsNeedUpdate&&(yu.upload(yt,v.uniformsList,I,$),i.uniformsNeedUpdate=!1),i.isSpriteMaterial&&A.setValue(yt,"center",r.center),A.setValue(yt,"modelViewMatrix",r.modelViewMatrix),A.setValue(yt,"normalMatrix",r.normalMatrix),A.setValue(yt,"modelMatrix",r.matrixWorld),i.isShaderMaterial||i.isRawShaderMaterial){const t=i.uniformsGroups;for(let e=0,n=t.length;e<n;e++)if(q.isWebGL2){const n=t[e];vt.update(n,M),vt.bind(n,M)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return M}function jt(t,e){t.ambientLightColor.needsUpdate=e,t.lightProbe.needsUpdate=e,t.directionalLights.needsUpdate=e,t.directionalLightShadows.needsUpdate=e,t.pointLights.needsUpdate=e,t.pointLightShadows.needsUpdate=e,t.spotLights.needsUpdate=e,t.spotLightShadows.needsUpdate=e,t.rectAreaLights.needsUpdate=e,t.hemisphereLights.needsUpdate=e}function Zt(t){return t.isMeshLambertMaterial||t.isMeshToonMaterial||t.isMeshPhongMaterial||t.isMeshStandardMaterial||t.isShadowMaterial||t.isShaderMaterial&&!0===t.lights}Nt.setAnimationLoop(Dt),"undefined"!==typeof self&&Nt.setContext(self),this.setAnimationLoop=function(t){It=t,St.setAnimationLoop(t),null===t?Nt.stop():Nt.start()},St.addEventListener("sessionstart",Ot),St.addEventListener("sessionend",zt),this.render=function(t,e){if(void 0!==e&&!0!==e.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===x)return;!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),null===e.parent&&!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),!0===St.enabled&&!0===St.isPresenting&&(!0===St.cameraAutoUpdate&&St.updateCamera(e),e=St.getCamera()),!0===t.isScene&&t.onBeforeRender(y,t,e,w),g=st.get(t,v.length),g.init(),v.push(g),V.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),k.setFromProjectionMatrix(V),B=this.localClippingEnabled,U=lt.init(this.clippingPlanes,B),m=at.get(t,_.length),m.init(),_.push(m),kt(t,e,0,y.sortObjects),m.finish(),!0===y.sortObjects&&m.sort(I,D),!0===U&<.beginShadows();const n=g.state.shadowsArray;if(ut.render(n,t,e),!0===U&<.endShadows(),!0===this.info.autoReset&&this.info.reset(),ht.render(m,t),g.setupLights(y.physicallyCorrectLights),e.isArrayCamera){const n=e.cameras;for(let e=0,i=n.length;e<i;e++){const i=n[e];Ut(m,t,i,i.viewport)}}else Ut(m,t,e);null!==w&&($.updateMultisampleRenderTarget(w),$.updateRenderTargetMipmap(w)),!0===t.isScene&&t.onAfterRender(y,t,e),_t.resetDefaultState(),S=-1,T=null,v.pop(),g=v.length>0?v[v.length-1]:null,_.pop(),m=_.length>0?_[_.length-1]:null},this.getActiveCubeFace=function(){return b},this.getActiveMipmapLevel=function(){return M},this.getRenderTarget=function(){return w},this.setRenderTargetTextures=function(t,e,n){J.get(t.texture).__webglTexture=e,J.get(t.depthTexture).__webglTexture=n;const i=J.get(t);i.__hasExternalTextures=!0,i.__hasExternalTextures&&(i.__autoAllocateDepthBuffer=void 0===n,i.__autoAllocateDepthBuffer||!0===Z.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),i.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(t,e){const n=J.get(t);n.__webglFramebuffer=e,n.__useDefaultFramebuffer=void 0===e},this.setRenderTarget=function(t,e=0,n=0){w=t,b=e,M=n;let i=!0,r=null,o=!1,a=!1;if(t){const n=J.get(t);void 0!==n.__useDefaultFramebuffer?(Y.bindFramebuffer(36160,null),i=!1):void 0===n.__webglFramebuffer?$.setupRenderTarget(t):n.__hasExternalTextures&&$.rebindTextures(t,J.get(t.texture).__webglTexture,J.get(t.depthTexture).__webglTexture);const s=t.texture;(s.isData3DTexture||s.isDataArrayTexture||s.isCompressedArrayTexture)&&(a=!0);const l=J.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(r=l[e],o=!0):r=q.isWebGL2&&t.samples>0&&!1===$.useMultisampledRTT(t)?J.get(t).__webglMultisampledFramebuffer:l,E.copy(t.viewport),P.copy(t.scissor),L=t.scissorTest}else E.copy(O).multiplyScalar(R).floor(),P.copy(z).multiplyScalar(R).floor(),L=N;const s=Y.bindFramebuffer(36160,r);if(s&&q.drawBuffers&&i&&Y.drawBuffers(t,r),Y.viewport(E),Y.scissor(P),Y.setScissorTest(L),o){const i=J.get(t.texture);yt.framebufferTexture2D(36160,36064,34069+e,i.__webglTexture,n)}else if(a){const i=J.get(t.texture),r=e||0;yt.framebufferTextureLayer(36160,36064,i.__webglTexture,n||0,r)}S=-1},this.readRenderTargetPixels=function(t,e,n,i,r,o,a){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let s=J.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==a&&(s=s[a]),s){Y.bindFramebuffer(36160,s);try{const a=t.texture,s=a.format,l=a.type;if(s!==Pt&>.convert(s)!==yt.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const u=l===Mt&&(Z.has("EXT_color_buffer_half_float")||q.isWebGL2&&Z.has("EXT_color_buffer_float"));if(l!==mt&>.convert(l)!==yt.getParameter(35738)&&(l!==bt||!(q.isWebGL2||Z.has("OES_texture_float")||Z.has("WEBGL_color_buffer_float")))&&!u)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");e>=0&&e<=t.width-i&&n>=0&&n<=t.height-r&&yt.readPixels(e,n,i,r,gt.convert(s),gt.convert(l),o)}finally{const t=null!==w?J.get(w).__webglFramebuffer:null;Y.bindFramebuffer(36160,t)}}},this.copyFramebufferToTexture=function(t,e,n=0){const i=Math.pow(2,-n),r=Math.floor(e.image.width*i),o=Math.floor(e.image.height*i);$.setTexture2D(e,0),yt.copyTexSubImage2D(3553,n,0,0,t.x,t.y,r,o),Y.unbindTexture()},this.copyTextureToTexture=function(t,e,n,i=0){const r=e.image.width,o=e.image.height,a=gt.convert(n.format),s=gt.convert(n.type);$.setTexture2D(n,0),yt.pixelStorei(37440,n.flipY),yt.pixelStorei(37441,n.premultiplyAlpha),yt.pixelStorei(3317,n.unpackAlignment),e.isDataTexture?yt.texSubImage2D(3553,i,t.x,t.y,r,o,a,s,e.image.data):e.isCompressedTexture?yt.compressedTexSubImage2D(3553,i,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,a,e.mipmaps[0].data):yt.texSubImage2D(3553,i,t.x,t.y,a,s,e.image),0===i&&n.generateMipmaps&&yt.generateMipmap(3553),Y.unbindTexture()},this.copyTextureToTexture3D=function(t,e,n,i,r=0){if(y.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const o=t.max.x-t.min.x+1,a=t.max.y-t.min.y+1,s=t.max.z-t.min.z+1,l=gt.convert(i.format),u=gt.convert(i.type);let h;if(i.isData3DTexture)$.setTexture3D(i,0),h=32879;else{if(!i.isDataArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");$.setTexture2DArray(i,0),h=35866}yt.pixelStorei(37440,i.flipY),yt.pixelStorei(37441,i.premultiplyAlpha),yt.pixelStorei(3317,i.unpackAlignment);const c=yt.getParameter(3314),d=yt.getParameter(32878),p=yt.getParameter(3316),f=yt.getParameter(3315),m=yt.getParameter(32877),g=n.isCompressedTexture?n.mipmaps[0]:n.image;yt.pixelStorei(3314,g.width),yt.pixelStorei(32878,g.height),yt.pixelStorei(3316,t.min.x),yt.pixelStorei(3315,t.min.y),yt.pixelStorei(32877,t.min.z),n.isDataTexture||n.isData3DTexture?yt.texSubImage3D(h,r,e.x,e.y,e.z,o,a,s,l,u,g.data):n.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),yt.compressedTexSubImage3D(h,r,e.x,e.y,e.z,o,a,s,l,g.data)):yt.texSubImage3D(h,r,e.x,e.y,e.z,o,a,s,l,u,g),yt.pixelStorei(3314,c),yt.pixelStorei(32878,d),yt.pixelStorei(3316,p),yt.pixelStorei(3315,f),yt.pixelStorei(32877,m),0===r&&i.generateMipmaps&&yt.generateMipmap(h),Y.unbindTexture()},this.initTexture=function(t){t.isCubeTexture?$.setTextureCube(t,0):t.isData3DTexture?$.setTexture3D(t,0):t.isDataArrayTexture||t.isCompressedArrayTexture?$.setTexture2DArray(t,0):$.setTexture2D(t,0),Y.unbindTexture()},this.resetState=function(){b=0,M=0,w=null,Y.reset(),_t.reset()},"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class Eh extends Th{}Eh.prototype.isWebGL1Renderer=!0;class Ph extends zi{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return null!==this.fog&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(e.object.backgroundIntensity=this.backgroundIntensity),e}get autoUpdate(){return console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate}set autoUpdate(t){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate=t}}class Lh extends Xi{constructor(t){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Mn(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,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.fog=t.fog,this}}const Ah=new hi,Ch=new ui,Rh=new ei,Ih=new On;class Dh extends zi{constructor(t=new ur,e=new Lh){super(),this.isPoints=!0,this.type="Points",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=t.material,this.geometry=t.geometry,this}raycast(t,e){const n=this.geometry,i=this.matrixWorld,r=t.params.Points.threshold,o=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),Rh.copy(n.boundingSphere),Rh.applyMatrix4(i),Rh.radius+=r,!1===t.ray.intersectsSphere(Rh))return;Ah.copy(i).invert(),Ch.copy(t.ray).applyMatrix4(Ah);const a=r/((this.scale.x+this.scale.y+this.scale.z)/3),s=a*a,l=n.index,u=n.attributes,h=u.position;if(null!==l){const n=Math.max(0,o.start),r=Math.min(l.count,o.start+o.count);for(let o=n,a=r;o<a;o++){const n=l.getX(o);Ih.fromBufferAttribute(h,n),Oh(Ih,n,s,i,t,e,this)}}else{const n=Math.max(0,o.start),r=Math.min(h.count,o.start+o.count);for(let o=n,a=r;o<a;o++)Ih.fromBufferAttribute(h,o),Oh(Ih,o,s,i,t,e,this)}}updateMorphTargets(){const t=this.geometry,e=t.morphAttributes,n=Object.keys(e);if(n.length>0){const t=e[n[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,n=t.length;e<n;e++){const n=t[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}}}}function Oh(t,e,n,i,r,o,a){const s=Ch.distanceSqToPoint(t);if(s<n){const n=new On;Ch.closestPointToPoint(t,n),n.applyMatrix4(i);const l=r.ray.origin.distanceTo(n);if(l<r.near||l>r.far)return;o.push({distance:l,distanceToRay:Math.sqrt(s),point:n,index:e,face:null,object:a})}}class zh extends Ln{constructor(t,e,n,i,r,o,a,s,l){super(t,e,n,i,r,o,a,s,l),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Nh extends ur{constructor(t=1,e=1,n=1,i=32,r=1,o=!1,a=0,s=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:i,heightSegments:r,openEnded:o,thetaStart:a,thetaLength:s};const l=this;i=Math.floor(i),r=Math.floor(r);const u=[],h=[],c=[],d=[];let p=0;const f=[],m=n/2;let g=0;function _(){const o=new On,_=new On;let v=0;const y=(e-t)/n;for(let l=0;l<=r;l++){const u=[],g=l/r,v=g*(e-t)+t;for(let t=0;t<=i;t++){const e=t/i,r=e*s+a,l=Math.sin(r),f=Math.cos(r);_.x=v*l,_.y=-g*n+m,_.z=v*f,h.push(_.x,_.y,_.z),o.set(l,y,f).normalize(),c.push(o.x,o.y,o.z),d.push(e,1-g),u.push(p++)}f.push(u)}for(let t=0;t<i;t++)for(let e=0;e<r;e++){const n=f[e][t],i=f[e+1][t],r=f[e+1][t+1],o=f[e][t+1];u.push(n,i,o),u.push(i,r,o),v+=6}l.addGroup(g,v,0),g+=v}function v(n){const r=p,o=new sn,f=new On;let _=0;const v=!0===n?t:e,y=!0===n?1:-1;for(let t=1;t<=i;t++)h.push(0,m*y,0),c.push(0,y,0),d.push(.5,.5),p++;const x=p;for(let t=0;t<=i;t++){const e=t/i,n=e*s+a,r=Math.cos(n),l=Math.sin(n);f.x=v*l,f.y=m*y,f.z=v*r,h.push(f.x,f.y,f.z),c.push(0,y,0),o.x=.5*r+.5,o.y=.5*l*y+.5,d.push(o.x,o.y),p++}for(let t=0;t<i;t++){const e=r+t,i=x+t;!0===n?u.push(i,i+1,e):u.push(i+1,i,e),_+=3}l.addGroup(g,_,!0===n?1:2),g+=_}_(),!1===o&&(t>0&&v(!0),e>0&&v(!1)),this.setIndex(u),this.setAttribute("position",new er(h,3)),this.setAttribute("normal",new er(c,3)),this.setAttribute("uv",new er(d,2))}static fromJSON(t){return new Nh(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class kh extends Xi{constructor(t){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Mn(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 Mn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=we,this.normalScale=new sn(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.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,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.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class Uh extends kh{constructor(t){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new sn(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Ue(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Mn(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Mn(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Mn(1,1,1),this.specularColorMap=null,this._sheen=0,this._clearcoat=0,this._iridescence=0,this._transmission=0,this.setValues(t)}get sheen(){return this._sheen}set sheen(t){this._sheen>0!==t>0&&this.version++,this._sheen=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!==t>0&&this.version++,this._clearcoat=t}get iridescence(){return this._iridescence}set iridescence(t){this._iridescence>0!==t>0&&this.version++,this._iridescence=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!==t>0&&this.version++,this._transmission=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.ior=t.ior,this.iridescence=t.iridescence,this.iridescenceMap=t.iridescenceMap,this.iridescenceIOR=t.iridescenceIOR,this.iridescenceThicknessRange=[...t.iridescenceThicknessRange],this.iridescenceThicknessMap=t.iridescenceThicknessMap,this.sheen=t.sheen,this.sheenColor.copy(t.sheenColor),this.sheenColorMap=t.sheenColorMap,this.sheenRoughness=t.sheenRoughness,this.sheenRoughnessMap=t.sheenRoughnessMap,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.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularColor.copy(t.specularColor),this.specularColorMap=t.specularColorMap,this}}class Bh extends Xi{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Mn(16777215),this.specular=new Mn(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Mn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=we,this.normalScale=new sn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=j,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,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.flatShading=t.flatShading,this.fog=t.fog,this}}class Fh extends Xi{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Mn(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Mn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=we,this.normalScale=new sn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=j,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,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.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.flatShading=t.flatShading,this.fog=t.fog,this}}function Vh(t,e,n){return Wh(t)?new t.constructor(t.subarray(e,void 0!==n?n:t.length)):t.slice(e,n)}function Hh(t,e,n){return!t||!n&&t.constructor===e?t:"number"===typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)}function Wh(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}class Gh{constructor(t,e,n,i){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==i?i: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,i=e[n],r=e[n-1];t:{e:{let o;n:{i:if(!(t<i)){for(let o=n+2;;){if(void 0===i){if(t<r)break i;return n=e.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===o)break;if(r=i,i=e[++n],t<i)break e}o=e.length;break n}if(t>=r)break t;{const a=e[1];t<a&&(n=2,r=a);for(let o=n-2;;){if(void 0===r)return this._cachedIndex=0,this.copySampleValue_(0);if(n===o)break;if(i=r,r=e[--n-1],t>=r)break e}o=n,n=0}}while(n<o){const i=n+o>>>1;t<e[i]?o=i:n=i+1}if(i=e[n],r=e[n-1],void 0===r)return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===i)return n=e.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,t,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){const e=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=t*i;for(let o=0;o!==i;++o)e[o]=n[r+o];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class jh extends Gh{constructor(t,e,n,i){super(t,e,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:ge,endingEnd:ge}}intervalChanged_(t,e,n){const i=this.parameterPositions;let r=t-2,o=t+1,a=i[r],s=i[o];if(void 0===a)switch(this.getSettings_().endingStart){case _e:r=t,a=2*e-n;break;case ve:r=i.length-2,a=e+i[r]-i[r+1];break;default:r=t,a=n}if(void 0===s)switch(this.getSettings_().endingEnd){case _e:o=t,s=2*n-e;break;case ve:o=1,s=n+i[1]-i[0];break;default:o=t-1,s=e}const l=.5*(n-e),u=this.valueSize;this._weightPrev=l/(e-a),this._weightNext=l/(s-n),this._offsetPrev=r*u,this._offsetNext=o*u}interpolate_(t,e,n,i){const r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,l=s-a,u=this._offsetPrev,h=this._offsetNext,c=this._weightPrev,d=this._weightNext,p=(n-e)/(i-e),f=p*p,m=f*p,g=-c*m+2*c*f-c*p,_=(1+c)*m+(-1.5-2*c)*f+(-.5+c)*p+1,v=(-1-d)*m+(1.5+d)*f+.5*p,y=d*m-d*f;for(let x=0;x!==a;++x)r[x]=g*o[u+x]+_*o[l+x]+v*o[s+x]+y*o[h+x];return r}}class Zh extends Gh{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){const r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,l=s-a,u=(n-e)/(i-e),h=1-u;for(let c=0;c!==a;++c)r[c]=o[l+c]*h+o[s+c]*u;return r}}class qh extends Gh{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t){return this.copySampleValue_(t-1)}}class Xh{constructor(t,e,n,i){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=Hh(e,this.TimeBufferType),this.values=Hh(n,this.ValueBufferType),this.setInterpolation(i||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:Hh(t.times,Array),values:Hh(t.values,Array)};const e=t.getInterpolation();e!==t.DefaultInterpolation&&(n.interpolation=e)}return n.type=t.ValueTypeName,n}InterpolantFactoryMethodDiscrete(t){return new qh(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new Zh(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new jh(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case pe:e=this.InterpolantFactoryMethodDiscrete;break;case fe:e=this.InterpolantFactoryMethodLinear;break;case me:e=this.InterpolantFactoryMethodSmooth;break}if(void 0===e){const e="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(e);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",e),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return pe;case this.InterpolantFactoryMethodLinear:return fe;case this.InterpolantFactoryMethodSmooth:return me}}getValueSize(){return this.values.length/this.times.length}shift(t){if(0!==t){const e=this.times;for(let n=0,i=e.length;n!==i;++n)e[n]+=t}return this}scale(t){if(1!==t){const e=this.times;for(let n=0,i=e.length;n!==i;++n)e[n]*=t}return this}trim(t,e){const n=this.times,i=n.length;let r=0,o=i-1;while(r!==i&&n[r]<t)++r;while(-1!==o&&n[o]>e)--o;if(++o,0!==r||o!==i){r>=o&&(o=Math.max(o,1),r=o-1);const t=this.getValueSize();this.times=Vh(n,r,o),this.values=Vh(this.values,r*t,o*t)}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,i=this.values,r=n.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let o=null;for(let a=0;a!==r;a++){const e=n[a];if("number"===typeof e&&isNaN(e)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,e),t=!1;break}if(null!==o&&o>e){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,e,o),t=!1;break}o=e}if(void 0!==i&&Wh(i))for(let a=0,s=i.length;a!==s;++a){const e=i[a];if(isNaN(e)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,e),t=!1;break}}return t}optimize(){const t=Vh(this.times),e=Vh(this.values),n=this.getValueSize(),i=this.getInterpolation()===me,r=t.length-1;let o=1;for(let a=1;a<r;++a){let r=!1;const s=t[a],l=t[a+1];if(s!==l&&(1!==a||s!==t[0]))if(i)r=!0;else{const t=a*n,i=t-n,o=t+n;for(let a=0;a!==n;++a){const n=e[t+a];if(n!==e[i+a]||n!==e[o+a]){r=!0;break}}}if(r){if(a!==o){t[o]=t[a];const i=a*n,r=o*n;for(let t=0;t!==n;++t)e[r+t]=e[i+t]}++o}}if(r>0){t[o]=t[r];for(let t=r*n,i=o*n,a=0;a!==n;++a)e[i+a]=e[t+a];++o}return o!==t.length?(this.times=Vh(t,0,o),this.values=Vh(e,0,o*n)):(this.times=t,this.values=e),this}clone(){const t=Vh(this.times,0),e=Vh(this.values,0),n=this.constructor,i=new n(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}}Xh.prototype.TimeBufferType=Float32Array,Xh.prototype.ValueBufferType=Float32Array,Xh.prototype.DefaultInterpolation=fe;class Yh extends Xh{}Yh.prototype.ValueTypeName="bool",Yh.prototype.ValueBufferType=Array,Yh.prototype.DefaultInterpolation=pe,Yh.prototype.InterpolantFactoryMethodLinear=void 0,Yh.prototype.InterpolantFactoryMethodSmooth=void 0;class Kh extends Xh{}Kh.prototype.ValueTypeName="color";class Jh extends Xh{}Jh.prototype.ValueTypeName="number";class $h extends Gh{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){const r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=(n-e)/(i-e);let l=t*a;for(let u=l+a;l!==u;l+=4)Dn.slerpFlat(r,0,o,l-a,o,l,s);return r}}class Qh extends Xh{InterpolantFactoryMethodLinear(t){return new $h(this.times,this.values,this.getValueSize(),t)}}Qh.prototype.ValueTypeName="quaternion",Qh.prototype.DefaultInterpolation=fe,Qh.prototype.InterpolantFactoryMethodSmooth=void 0;class tc extends Xh{}tc.prototype.ValueTypeName="string",tc.prototype.ValueBufferType=Array,tc.prototype.DefaultInterpolation=pe,tc.prototype.InterpolantFactoryMethodLinear=void 0,tc.prototype.InterpolantFactoryMethodSmooth=void 0;class ec extends Xh{}ec.prototype.ValueTypeName="vector";const nc={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};class ic{constructor(t,e,n){const i=this;let r,o=!1,a=0,s=0;const l=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(t){s++,!1===o&&void 0!==i.onStart&&i.onStart(t,a,s),o=!0},this.itemEnd=function(t){a++,void 0!==i.onProgress&&i.onProgress(t,a,s),a===s&&(o=!1,void 0!==i.onLoad&&i.onLoad())},this.itemError=function(t){void 0!==i.onError&&i.onError(t)},this.resolveURL=function(t){return r?r(t):t},this.setURLModifier=function(t){return r=t,this},this.addHandler=function(t,e){return l.push(t,e),this},this.removeHandler=function(t){const e=l.indexOf(t);return-1!==e&&l.splice(e,2),this},this.getHandler=function(t){for(let e=0,n=l.length;e<n;e+=2){const n=l[e],i=l[e+1];if(n.global&&(n.lastIndex=0),n.test(t))return i}return null}}}const rc=new ic;class oc{constructor(t){this.manager=void 0!==t?t:rc,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){const n=this;return new Promise((function(i,r){n.load(t,i,e,r)}))}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}}Error;class ac extends oc{constructor(t){super(t)}load(t,e,n,i){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,o=nc.get(t);if(void 0!==o)return r.manager.itemStart(t),setTimeout((function(){e&&e(o),r.manager.itemEnd(t)}),0),o;const a=cn("img");function s(){u(),nc.add(t,this),e&&e(this),r.manager.itemEnd(t)}function l(e){u(),i&&i(e),r.manager.itemError(t),r.manager.itemEnd(t)}function u(){a.removeEventListener("load",s,!1),a.removeEventListener("error",l,!1)}return a.addEventListener("load",s,!1),a.addEventListener("error",l,!1),"data:"!==t.slice(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),r.manager.itemStart(t),a.src=t,a}}class sc extends oc{constructor(t){super(t)}load(t,e,n,i){const r=new Ln,o=new ac(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(t,(function(t){r.image=t,r.needsUpdate=!0,void 0!==e&&e(r)}),n,i),r}}class lc extends zi{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new Mn(t),this.intensity=e}dispose(){}copy(t,e){return super.copy(t,e),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,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}const uc=new hi,hc=new On,cc=new On;class dc{constructor(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new sn(512,512),this.map=null,this.mapPass=null,this.matrix=new hi,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Xr,this._frameExtents=new sn(1,1),this._viewportCount=1,this._viewports=[new An(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const e=this.camera,n=this.matrix;hc.setFromMatrixPosition(t.matrixWorld),e.position.copy(hc),cc.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(cc),e.updateMatrixWorld(),uc.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(uc),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(uc)}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 0!==this.bias&&(t.bias=this.bias),0!==this.normalBias&&(t.normalBias=this.normalBias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}class pc extends dc{constructor(){super(new Vs(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class fc extends lc{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(zi.DEFAULT_UP),this.updateMatrix(),this.target=new zi,this.shadow=new pc}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}class mc extends lc{constructor(t,e){super(t,e),this.isAmbientLight=!0,this.type="AmbientLight"}}const gc="\\[\\]\\.:\\/",_c=new RegExp("["+gc+"]","g"),vc="[^"+gc+"]",yc="[^"+gc.replace("\\.","")+"]",xc=/((?:WC+[\/:])*)/.source.replace("WC",vc),bc=/(WCOD+)?/.source.replace("WCOD",yc),Mc=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",vc),wc=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",vc),Sc=new RegExp("^"+xc+bc+Mc+wc+"$"),Tc=["material","materials","bones","map"];class Ec{constructor(t,e,n){const i=n||Pc.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,i)}getValue(t,e){this.bind();const n=this._targetGroup.nCachedObjects_,i=this._bindings[n];void 0!==i&&i.getValue(t,e)}setValue(t,e){const n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].setValue(t,e)}bind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()}unbind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}}class Pc{constructor(t,e,n){this.path=e,this.parsedPath=n||Pc.parseTrackName(e),this.node=Pc.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 Pc.Composite(t,e,n):new Pc(t,e,n)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(_c,"")}static parseTrackName(t){const e=Sc.exec(t);if(null===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]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){const t=n.nodeName.substring(i+1);-1!==Tc.indexOf(t)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=t)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}static findNode(t,e){if(void 0===e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){const n=t.skeleton.getBoneByName(e);if(void 0!==n)return n}if(t.children){const n=function(t){for(let i=0;i<t.length;i++){const r=t[i];if(r.name===e||r.uuid===e)return r;const o=n(r.children);if(o)return o}return null},i=n(t.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)t[e++]=n[i]}_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 i=0,r=n.length;i!==r;++i)n[i]=t[e++]}_setValue_array_setNeedsUpdate(t,e){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=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,i=e.propertyName;let r=e.propertyIndex;if(t||(t=Pc.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 i=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 e=0;e<t.length;e++)if(t[e].name===i){i=e;break}break;case"map":if("map"in t){t=t.map;break}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.map)return void console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);t=t.material.map;break;default:if(void 0===t[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[n]}if(void 0!==i){if(void 0===t[i])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[i]}}const o=t[i];if(void 0===o){const n=e.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+n+"."+i+" but it wasn't found.",t)}let a=this.Versioning.None;this.targetObject=t,void 0!==t.needsUpdate?a=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(a=this.Versioning.MatrixWorldNeedsUpdate);let s=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===i){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.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==t.morphTargetDictionary[r]&&(r=t.morphTargetDictionary[r])}s=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=r}else void 0!==o.fromArray&&void 0!==o.toArray?(s=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(s=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=i;this.getValue=this.GetterByBindingType[s],this.setValue=this.SetterByBindingTypeAndVersioning[s][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Pc.Composite=Ec,Pc.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Pc.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},Pc.prototype.GetterByBindingType=[Pc.prototype._getValue_direct,Pc.prototype._getValue_array,Pc.prototype._getValue_arrayElement,Pc.prototype._getValue_toArray],Pc.prototype.SetterByBindingTypeAndVersioning=[[Pc.prototype._setValue_direct,Pc.prototype._setValue_direct_setNeedsUpdate,Pc.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Pc.prototype._setValue_array,Pc.prototype._setValue_array_setNeedsUpdate,Pc.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Pc.prototype._setValue_arrayElement,Pc.prototype._setValue_arrayElement_setNeedsUpdate,Pc.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Pc.prototype._setValue_fromArray,Pc.prototype._setValue_fromArray_setNeedsUpdate,Pc.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];new Float32Array(1);class Lc{constructor(t,e,n=0,i=1/0){this.ray=new ui(t,e),this.near=n,this.far=i,this.camera=null,this.layers=new bi,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(t,e){this.ray.set(t,e)}setFromCamera(t,e){e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster: Unsupported camera type: "+e.type)}intersectObject(t,e=!0,n=[]){return Cc(t,this,n,e),n.sort(Ac),n}intersectObjects(t,e=!0,n=[]){for(let i=0,r=t.length;i<r;i++)Cc(t[i],this,n,e);return n.sort(Ac),n}}function Ac(t,e){return t.distance-e.distance}function Cc(t,e,n,i){if(t.layers.test(e.layers)&&t.raycast(e,n),!0===i){const i=t.children;for(let t=0,r=i.length;t<r;t++)Cc(i[t],e,n,!0)}}class Rc{constructor(t=1,e=0,n=0){return this.radius=t,this.phi=e,this.theta=n,this}set(t,e,n){return this.radius=t,this.phi=e,this.theta=n,this}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this}makeSafe(){const t=1e-6;return this.phi=Math.max(t,Math.min(Math.PI-t,this.phi)),this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,n){return this.radius=Math.sqrt(t*t+e*e+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,n),this.phi=Math.acos(Ue(e/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}}"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:i}})),"undefined"!==typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=i)},24:function(t,e,n){"use strict";n.d(e,{N:function(){return s}});var i=n(437);const r={type:"change"},o={type:"start"},a={type:"end"};class s extends i.Qev{constructor(t,e){super(),this.object=t,this.domElement=e,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new i.Pq0,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:i.kBv.ROTATE,MIDDLE:i.kBv.DOLLY,RIGHT:i.kBv.PAN},this.touches={ONE:i.wtR.ROTATE,TWO:i.wtR.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return h.phi},this.getAzimuthalAngle=function(){return h.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(t){t.addEventListener("keydown",at),this._domElementKeyEvents=t},this.saveState=function(){n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=function(){n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(r),n.update(),l=s.NONE},this.update=function(){const e=new i.Pq0,o=(new i.PTz).setFromUnitVectors(t.up,new i.Pq0(0,1,0)),a=o.clone().invert(),m=new i.Pq0,g=new i.PTz,_=2*Math.PI;return function(){const t=n.object.position;e.copy(t).sub(n.target),e.applyQuaternion(o),h.setFromVector3(e),n.autoRotate&&l===s.NONE&&L(E()),n.enableDamping?(h.theta+=c.theta*n.dampingFactor,h.phi+=c.phi*n.dampingFactor):(h.theta+=c.theta,h.phi+=c.phi);let i=n.minAzimuthAngle,v=n.maxAzimuthAngle;return isFinite(i)&&isFinite(v)&&(i<-Math.PI?i+=_:i>Math.PI&&(i-=_),v<-Math.PI?v+=_:v>Math.PI&&(v-=_),h.theta=i<=v?Math.max(i,Math.min(v,h.theta)):h.theta>(i+v)/2?Math.max(i,h.theta):Math.min(v,h.theta)),h.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,h.phi)),h.makeSafe(),h.radius*=d,h.radius=Math.max(n.minDistance,Math.min(n.maxDistance,h.radius)),!0===n.enableDamping?n.target.addScaledVector(p,n.dampingFactor):n.target.add(p),e.setFromSpherical(h),e.applyQuaternion(a),t.copy(n.target).add(e),n.object.lookAt(n.target),!0===n.enableDamping?(c.theta*=1-n.dampingFactor,c.phi*=1-n.dampingFactor,p.multiplyScalar(1-n.dampingFactor)):(c.set(0,0,0),p.set(0,0,0)),d=1,!!(f||m.distanceToSquared(n.object.position)>u||8*(1-g.dot(n.object.quaternion))>u)&&(n.dispatchEvent(r),m.copy(n.object.position),g.copy(n.object.quaternion),f=!1,!0)}}(),this.dispose=function(){n.domElement.removeEventListener("contextmenu",ut),n.domElement.removeEventListener("pointerdown",Q),n.domElement.removeEventListener("pointercancel",nt),n.domElement.removeEventListener("wheel",ot),n.domElement.removeEventListener("pointermove",tt),n.domElement.removeEventListener("pointerup",et),null!==n._domElementKeyEvents&&n._domElementKeyEvents.removeEventListener("keydown",at)};const n=this,s={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=s.NONE;const u=1e-6,h=new i.YHV,c=new i.YHV;let d=1;const p=new i.Pq0;let f=!1;const m=new i.I9Y,g=new i.I9Y,_=new i.I9Y,v=new i.I9Y,y=new i.I9Y,x=new i.I9Y,b=new i.I9Y,M=new i.I9Y,w=new i.I9Y,S=[],T={};function E(){return 2*Math.PI/60/60*n.autoRotateSpeed}function P(){return Math.pow(.95,n.zoomSpeed)}function L(t){c.theta-=t}function A(t){c.phi-=t}const C=function(){const t=new i.Pq0;return function(e,n){t.setFromMatrixColumn(n,0),t.multiplyScalar(-e),p.add(t)}}(),R=function(){const t=new i.Pq0;return function(e,i){!0===n.screenSpacePanning?t.setFromMatrixColumn(i,1):(t.setFromMatrixColumn(i,0),t.crossVectors(n.object.up,t)),t.multiplyScalar(e),p.add(t)}}(),I=function(){const t=new i.Pq0;return function(e,i){const r=n.domElement;if(n.object.isPerspectiveCamera){const o=n.object.position;t.copy(o).sub(n.target);let a=t.length();a*=Math.tan(n.object.fov/2*Math.PI/180),C(2*e*a/r.clientHeight,n.object.matrix),R(2*i*a/r.clientHeight,n.object.matrix)}else n.object.isOrthographicCamera?(C(e*(n.object.right-n.object.left)/n.object.zoom/r.clientWidth,n.object.matrix),R(i*(n.object.top-n.object.bottom)/n.object.zoom/r.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}}();function D(t){n.object.isPerspectiveCamera?d/=t:n.object.isOrthographicCamera?(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom*t)),n.object.updateProjectionMatrix(),f=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function O(t){n.object.isPerspectiveCamera?d*=t:n.object.isOrthographicCamera?(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/t)),n.object.updateProjectionMatrix(),f=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function z(t){m.set(t.clientX,t.clientY)}function N(t){b.set(t.clientX,t.clientY)}function k(t){v.set(t.clientX,t.clientY)}function U(t){g.set(t.clientX,t.clientY),_.subVectors(g,m).multiplyScalar(n.rotateSpeed);const e=n.domElement;L(2*Math.PI*_.x/e.clientHeight),A(2*Math.PI*_.y/e.clientHeight),m.copy(g),n.update()}function B(t){M.set(t.clientX,t.clientY),w.subVectors(M,b),w.y>0?D(P()):w.y<0&&O(P()),b.copy(M),n.update()}function F(t){y.set(t.clientX,t.clientY),x.subVectors(y,v).multiplyScalar(n.panSpeed),I(x.x,x.y),v.copy(y),n.update()}function V(t){t.deltaY<0?O(P()):t.deltaY>0&&D(P()),n.update()}function H(t){let e=!1;switch(t.code){case n.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?A(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):I(0,n.keyPanSpeed),e=!0;break;case n.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?A(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):I(0,-n.keyPanSpeed),e=!0;break;case n.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?L(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):I(n.keyPanSpeed,0),e=!0;break;case n.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?L(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):I(-n.keyPanSpeed,0),e=!0;break}e&&(t.preventDefault(),n.update())}function W(){if(1===S.length)m.set(S[0].pageX,S[0].pageY);else{const t=.5*(S[0].pageX+S[1].pageX),e=.5*(S[0].pageY+S[1].pageY);m.set(t,e)}}function G(){if(1===S.length)v.set(S[0].pageX,S[0].pageY);else{const t=.5*(S[0].pageX+S[1].pageX),e=.5*(S[0].pageY+S[1].pageY);v.set(t,e)}}function j(){const t=S[0].pageX-S[1].pageX,e=S[0].pageY-S[1].pageY,n=Math.sqrt(t*t+e*e);b.set(0,n)}function Z(){n.enableZoom&&j(),n.enablePan&&G()}function q(){n.enableZoom&&j(),n.enableRotate&&W()}function X(t){if(1==S.length)g.set(t.pageX,t.pageY);else{const e=pt(t),n=.5*(t.pageX+e.x),i=.5*(t.pageY+e.y);g.set(n,i)}_.subVectors(g,m).multiplyScalar(n.rotateSpeed);const e=n.domElement;L(2*Math.PI*_.x/e.clientHeight),A(2*Math.PI*_.y/e.clientHeight),m.copy(g)}function Y(t){if(1===S.length)y.set(t.pageX,t.pageY);else{const e=pt(t),n=.5*(t.pageX+e.x),i=.5*(t.pageY+e.y);y.set(n,i)}x.subVectors(y,v).multiplyScalar(n.panSpeed),I(x.x,x.y),v.copy(y)}function K(t){const e=pt(t),i=t.pageX-e.x,r=t.pageY-e.y,o=Math.sqrt(i*i+r*r);M.set(0,o),w.set(0,Math.pow(M.y/b.y,n.zoomSpeed)),D(w.y),b.copy(M)}function J(t){n.enableZoom&&K(t),n.enablePan&&Y(t)}function $(t){n.enableZoom&&K(t),n.enableRotate&&X(t)}function Q(t){!1!==n.enabled&&(0===S.length&&(n.domElement.setPointerCapture(t.pointerId),n.domElement.addEventListener("pointermove",tt),n.domElement.addEventListener("pointerup",et)),ht(t),"touch"===t.pointerType?st(t):it(t))}function tt(t){!1!==n.enabled&&("touch"===t.pointerType?lt(t):rt(t))}function et(t){ct(t),0===S.length&&(n.domElement.releasePointerCapture(t.pointerId),n.domElement.removeEventListener("pointermove",tt),n.domElement.removeEventListener("pointerup",et)),n.dispatchEvent(a),l=s.NONE}function nt(t){ct(t)}function it(t){let e;switch(t.button){case 0:e=n.mouseButtons.LEFT;break;case 1:e=n.mouseButtons.MIDDLE;break;case 2:e=n.mouseButtons.RIGHT;break;default:e=-1}switch(e){case i.kBv.DOLLY:if(!1===n.enableZoom)return;N(t),l=s.DOLLY;break;case i.kBv.ROTATE:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===n.enablePan)return;k(t),l=s.PAN}else{if(!1===n.enableRotate)return;z(t),l=s.ROTATE}break;case i.kBv.PAN:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===n.enableRotate)return;z(t),l=s.ROTATE}else{if(!1===n.enablePan)return;k(t),l=s.PAN}break;default:l=s.NONE}l!==s.NONE&&n.dispatchEvent(o)}function rt(t){switch(l){case s.ROTATE:if(!1===n.enableRotate)return;U(t);break;case s.DOLLY:if(!1===n.enableZoom)return;B(t);break;case s.PAN:if(!1===n.enablePan)return;F(t);break}}function ot(t){!1!==n.enabled&&!1!==n.enableZoom&&l===s.NONE&&(t.preventDefault(),n.dispatchEvent(o),V(t),n.dispatchEvent(a))}function at(t){!1!==n.enabled&&!1!==n.enablePan&&H(t)}function st(t){switch(dt(t),S.length){case 1:switch(n.touches.ONE){case i.wtR.ROTATE:if(!1===n.enableRotate)return;W(),l=s.TOUCH_ROTATE;break;case i.wtR.PAN:if(!1===n.enablePan)return;G(),l=s.TOUCH_PAN;break;default:l=s.NONE}break;case 2:switch(n.touches.TWO){case i.wtR.DOLLY_PAN:if(!1===n.enableZoom&&!1===n.enablePan)return;Z(),l=s.TOUCH_DOLLY_PAN;break;case i.wtR.DOLLY_ROTATE:if(!1===n.enableZoom&&!1===n.enableRotate)return;q(),l=s.TOUCH_DOLLY_ROTATE;break;default:l=s.NONE}break;default:l=s.NONE}l!==s.NONE&&n.dispatchEvent(o)}function lt(t){switch(dt(t),l){case s.TOUCH_ROTATE:if(!1===n.enableRotate)return;X(t),n.update();break;case s.TOUCH_PAN:if(!1===n.enablePan)return;Y(t),n.update();break;case s.TOUCH_DOLLY_PAN:if(!1===n.enableZoom&&!1===n.enablePan)return;J(t),n.update();break;case s.TOUCH_DOLLY_ROTATE:if(!1===n.enableZoom&&!1===n.enableRotate)return;$(t),n.update();break;default:l=s.NONE}}function ut(t){!1!==n.enabled&&t.preventDefault()}function ht(t){S.push(t)}function ct(t){delete T[t.pointerId];for(let e=0;e<S.length;e++)if(S[e].pointerId==t.pointerId)return void S.splice(e,1)}function dt(t){let e=T[t.pointerId];void 0===e&&(e=new i.I9Y,T[t.pointerId]=e),e.set(t.pageX,t.pageY)}function pt(t){const e=t.pointerId===S[0].pointerId?S[1]:S[0];return T[e.pointerId]}n.domElement.addEventListener("contextmenu",ut),n.domElement.addEventListener("pointerdown",Q),n.domElement.addEventListener("pointercancel",nt),n.domElement.addEventListener("wheel",ot,{passive:!1}),this.update()}}},509:function(t,e,n){"use strict";n.d(e,{m:function(){return r}});var i=n(437);class r extends i.eaF{constructor(){const t=r.SkyShader,e=new i.BKk({name:"SkyShader",fragmentShader:t.fragmentShader,vertexShader:t.vertexShader,uniforms:i.LlO.clone(t.uniforms),side:i.hsX,depthWrite:!1});super(new i.iNn(1,1,1),e),this.isSky=!0}}r.SkyShader={uniforms:{turbidity:{value:2},rayleigh:{value:1},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new i.Pq0},up:{value:new i.Pq0(0,1,0)}},vertexShader:"\n\t\tuniform vec3 sunPosition;\n\t\tuniform float rayleigh;\n\t\tuniform float turbidity;\n\t\tuniform float mieCoefficient;\n\t\tuniform vec3 up;\n\n\t\tvarying vec3 vWorldPosition;\n\t\tvarying vec3 vSunDirection;\n\t\tvarying float vSunfade;\n\t\tvarying vec3 vBetaR;\n\t\tvarying vec3 vBetaM;\n\t\tvarying float vSunE;\n\n\t\t// constants for atmospheric scattering\n\t\tconst float e = 2.71828182845904523536028747135266249775724709369995957;\n\t\tconst float pi = 3.141592653589793238462643383279502884197169;\n\n\t\t// wavelength of used primaries, according to preetham\n\t\tconst vec3 lambda = vec3( 680E-9, 550E-9, 450E-9 );\n\t\t// this pre-calcuation replaces older TotalRayleigh(vec3 lambda) function:\n\t\t// (8.0 * pow(pi, 3.0) * pow(pow(n, 2.0) - 1.0, 2.0) * (6.0 + 3.0 * pn)) / (3.0 * N * pow(lambda, vec3(4.0)) * (6.0 - 7.0 * pn))\n\t\tconst vec3 totalRayleigh = vec3( 5.804542996261093E-6, 1.3562911419845635E-5, 3.0265902468824876E-5 );\n\n\t\t// mie stuff\n\t\t// K coefficient for the primaries\n\t\tconst float v = 4.0;\n\t\tconst vec3 K = vec3( 0.686, 0.678, 0.666 );\n\t\t// MieConst = pi * pow( ( 2.0 * pi ) / lambda, vec3( v - 2.0 ) ) * K\n\t\tconst vec3 MieConst = vec3( 1.8399918514433978E14, 2.7798023919660528E14, 4.0790479543861094E14 );\n\n\t\t// earth shadow hack\n\t\t// cutoffAngle = pi / 1.95;\n\t\tconst float cutoffAngle = 1.6110731556870734;\n\t\tconst float steepness = 1.5;\n\t\tconst float EE = 1000.0;\n\n\t\tfloat sunIntensity( float zenithAngleCos ) {\n\t\t\tzenithAngleCos = clamp( zenithAngleCos, -1.0, 1.0 );\n\t\t\treturn EE * max( 0.0, 1.0 - pow( e, -( ( cutoffAngle - acos( zenithAngleCos ) ) / steepness ) ) );\n\t\t}\n\n\t\tvec3 totalMie( float T ) {\n\t\t\tfloat c = ( 0.2 * T ) * 10E-18;\n\t\t\treturn 0.434 * c * MieConst;\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n\t\t\tvWorldPosition = worldPosition.xyz;\n\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\tgl_Position.z = gl_Position.w; // set z to camera.far\n\n\t\t\tvSunDirection = normalize( sunPosition );\n\n\t\t\tvSunE = sunIntensity( dot( vSunDirection, up ) );\n\n\t\t\tvSunfade = 1.0 - clamp( 1.0 - exp( ( sunPosition.y / 450000.0 ) ), 0.0, 1.0 );\n\n\t\t\tfloat rayleighCoefficient = rayleigh - ( 1.0 * ( 1.0 - vSunfade ) );\n\n\t\t\t// extinction (absorbtion + out scattering)\n\t\t\t// rayleigh coefficients\n\t\t\tvBetaR = totalRayleigh * rayleighCoefficient;\n\n\t\t\t// mie coefficients\n\t\t\tvBetaM = totalMie( turbidity ) * mieCoefficient;\n\n\t\t}",fragmentShader:"\n\t\tvarying vec3 vWorldPosition;\n\t\tvarying vec3 vSunDirection;\n\t\tvarying float vSunfade;\n\t\tvarying vec3 vBetaR;\n\t\tvarying vec3 vBetaM;\n\t\tvarying float vSunE;\n\n\t\tuniform float mieDirectionalG;\n\t\tuniform vec3 up;\n\n\t\tconst vec3 cameraPos = vec3( 0.0, 0.0, 0.0 );\n\n\t\t// constants for atmospheric scattering\n\t\tconst float pi = 3.141592653589793238462643383279502884197169;\n\n\t\tconst float n = 1.0003; // refractive index of air\n\t\tconst float N = 2.545E25; // number of molecules per unit volume for air at 288.15K and 1013mb (sea level -45 celsius)\n\n\t\t// optical length at zenith for molecules\n\t\tconst float rayleighZenithLength = 8.4E3;\n\t\tconst float mieZenithLength = 1.25E3;\n\t\t// 66 arc seconds -> degrees, and the cosine of that\n\t\tconst float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324;\n\n\t\t// 3.0 / ( 16.0 * pi )\n\t\tconst float THREE_OVER_SIXTEENPI = 0.05968310365946075;\n\t\t// 1.0 / ( 4.0 * pi )\n\t\tconst float ONE_OVER_FOURPI = 0.07957747154594767;\n\n\t\tfloat rayleighPhase( float cosTheta ) {\n\t\t\treturn THREE_OVER_SIXTEENPI * ( 1.0 + pow( cosTheta, 2.0 ) );\n\t\t}\n\n\t\tfloat hgPhase( float cosTheta, float g ) {\n\t\t\tfloat g2 = pow( g, 2.0 );\n\t\t\tfloat inverse = 1.0 / pow( 1.0 - 2.0 * g * cosTheta + g2, 1.5 );\n\t\t\treturn ONE_OVER_FOURPI * ( ( 1.0 - g2 ) * inverse );\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvec3 direction = normalize( vWorldPosition - cameraPos );\n\n\t\t\t// optical length\n\t\t\t// cutoff angle at 90 to avoid singularity in next formula.\n\t\t\tfloat zenithAngle = acos( max( 0.0, dot( up, direction ) ) );\n\t\t\tfloat inverse = 1.0 / ( cos( zenithAngle ) + 0.15 * pow( 93.885 - ( ( zenithAngle * 180.0 ) / pi ), -1.253 ) );\n\t\t\tfloat sR = rayleighZenithLength * inverse;\n\t\t\tfloat sM = mieZenithLength * inverse;\n\n\t\t\t// combined extinction factor\n\t\t\tvec3 Fex = exp( -( vBetaR * sR + vBetaM * sM ) );\n\n\t\t\t// in scattering\n\t\t\tfloat cosTheta = dot( direction, vSunDirection );\n\n\t\t\tfloat rPhase = rayleighPhase( cosTheta * 0.5 + 0.5 );\n\t\t\tvec3 betaRTheta = vBetaR * rPhase;\n\n\t\t\tfloat mPhase = hgPhase( cosTheta, mieDirectionalG );\n\t\t\tvec3 betaMTheta = vBetaM * mPhase;\n\n\t\t\tvec3 Lin = pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * ( 1.0 - Fex ), vec3( 1.5 ) );\n\t\t\tLin *= mix( vec3( 1.0 ), pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * Fex, vec3( 1.0 / 2.0 ) ), clamp( pow( 1.0 - dot( up, vSunDirection ), 5.0 ), 0.0, 1.0 ) );\n\n\t\t\t// nightsky\n\t\t\tfloat theta = acos( direction.y ); // elevation --\x3e y-axis, [-pi/2, pi/2]\n\t\t\tfloat phi = atan( direction.z, direction.x ); // azimuth --\x3e x-axis [-pi/2, pi/2]\n\t\t\tvec2 uv = vec2( phi, theta ) / vec2( 2.0 * pi, pi ) + vec2( 0.5, 0.0 );\n\t\t\tvec3 L0 = vec3( 0.1 ) * Fex;\n\n\t\t\t// composition + solar disc\n\t\t\tfloat sundisk = smoothstep( sunAngularDiameterCos, sunAngularDiameterCos + 0.00002, cosTheta );\n\t\t\tL0 += ( vSunE * 19000.0 * Fex ) * sundisk;\n\n\t\t\tvec3 texColor = ( Lin + L0 ) * 0.04 + vec3( 0.0, 0.0003, 0.00075 );\n\n\t\t\tvec3 retColor = pow( texColor, vec3( 1.0 / ( 1.2 + ( 1.2 * vSunfade ) ) ) );\n\n\t\t\tgl_FragColor = vec4( retColor, 1.0 );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <encodings_fragment>\n\n\t\t}"}}}]);
|
|
41
|
-
//# sourceMappingURL=chunk-vendors-legacy.9bb3863d.js.map
|