diff --git a/itowns/dev/dist/itowns.js b/itowns/dev/dist/itowns.js index da3d5aba..038fbe01 100644 --- a/itowns/dev/dist/itowns.js +++ b/itowns/dev/dist/itowns.js @@ -1,3 +1,3 @@ /*! For license information please see itowns.js.LICENSE.txt */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("itowns",[],t):"object"==typeof exports?exports.itowns=t():e.itowns=t()}(self,(()=>(()=>{var e,t={86406:(e,t,r)=>{"use strict";r.r(t),r.d(t,{UNIT:()=>s,axisOrder:()=>f,defs:()=>m,getUnit:()=>l,is4326:()=>o,isGeocentric:()=>h,isGeographic:()=>u,isMetricUnit:()=>c,isValid:()=>d,reasonableEpsilon:()=>p});var n=r(68721);function i(e){if(!("string"==typeof(t=e)||t instanceof String))throw new Error(`Crs parameter value must be a string: '${e}'`);var t}n.A.defs("EPSG:4978","+proj=geocent +datum=WGS84 +units=m +no_defs"),n.A.defs("EPSG:4326").axis="neu",n.A.defs("EPSG:4269").axis="neu",n.A.defs("WGS84").axis="neu";const s={DEGREE:1,METER:2};function o(e){return"EPSG:4326"===e}function a(e){return"degrees"===e.units?s.DEGREE:"m"===e.units||void 0===e.units&&void 0===e.to_meter?s.METER:void 0}function l(e){i(e);const t=n.A.defs(e);if(t)return a(t)}function c(e){return l(e)===s.METER}function u(e){return l(e)===s.DEGREE}function h(e){i(e);const t=n.A.defs(e);return!!t&&"geocent"==t.projName}function d(e){const t=n.A.defs(e);if(!t)throw new Error(`Undefined crs '${e}'. Add it with proj4.defs('${e}', string)`);if(!a(t))throw new Error(`No valid unit found for crs '${e}', found ${t.units}`)}function p(e){return o(e)?.01:.001}function f(e){i(e);const t=n.A.defs(e);return t?t.axis:void 0}const m=(e,t)=>n.A.defs(e,t)},28611:(e,t,r)=>{"use strict";r.d(t,{r:()=>f});var n=r(39437),i=r(52404),s=r(86215);const o=Math.PI/4,a=1/(2*Math.PI),l=new n.Vector3(0,0,1),c=new n.Vector3(0,1,0),u=new n.Quaternion,h=new n.Quaternion,d=new n.Quaternion;function p(e){return 1-(.5-Math.log(Math.tan(o+.5*n.MathUtils.degToRad(e)))*a)}class f{static _crs="EPSG:4978";static _computeExtraOffset(e){const t=p(e.coordinates.latitude)*e.nbRow;return(isFinite(t)?t:0)-e.deltaUV1}get crs(){return f._crs}constructor(e){this._transform={coords:[new i.A("EPSG:4326",0,0),new i.A("EPSG:4326",0,0)],position:new n.Vector3,dimension:new n.Vector2},e.uvCount>1&&(this.computeExtraOffset=f._computeExtraOffset)}prepare(e){const t=2**(e.level+1);let r=p(e.extent.south);isFinite(r)||(r=0);const s={nbRow:t,deltaUV1:(r-r%(1/t))*t,quatNormalToZ:d.setFromAxisAngle(c,-(.5*Math.PI-n.MathUtils.degToRad(e.extent.center().latitude))),coordinates:new i.A(this.crs)};return e.extent.planarDimensions(this._transform.dimension),{...e,...s}}center(e){return e.center(this._transform.coords[0]).as(this.crs,this._transform.coords[1]).toVector3()}vertexPosition(e){return this._transform.coords[0].setFromValues(e.x,e.y).as(this.crs,this._transform.coords[1]).toVector3(this._transform.position)}vertexNormal(){return this._transform.coords[1].geodesicNormal}uProject(e,t){return t.west+e*this._transform.dimension.x}vProject(e,t){return t.south+e*this._transform.dimension.y}computeShareableExtent(e){const t=Math.abs(e.west-e.east)/2,r=new s.A(e.crs,-t,t,e.south,e.north),i=n.MathUtils.degToRad(e.west-r.west),o=n.MathUtils.degToRad(90-e.center(this._transform.coords[0]).latitude);return u.setFromAxisAngle(l,i),h.setFromAxisAngle(c,o),u.multiply(h),{shareableExtent:r,quaternion:u.clone(),position:this.center(e)}}}},22598:(e,t,r)=>{"use strict";r.d(t,{g:()=>i,t:()=>a});var n=r(39437);function i(e,t){return 3*(e*e*2+(t?0:4*e*2))}function s(e,t,r,n){e[2*t+0]=r,e[2*t+1]=n}function o(e){return(t,r)=>{t[r]=e}}function a(e,t){const r=Math.max(2,t.segments),a=r+1,l=a**2,c=l+(t.disableSkirt?0:4*r);if(c>2**32)throw new Error("Tile segments count is too big");const u=function(e,t,r,n){const{index:s,skirt:o}=function(e,t,r){if(!r.buildIndexAndUv_0)return;const n=i(t,r.disableSkirt),s=function(e){let t=null;if(e<256)t=Uint8Array;else if(e<65536)t=Uint16Array;else{if(!(e<2**32))throw new Error("Value is too high");t=Uint32Array}return t}(e),o=n,a=4*t,l=new s(new ArrayBuffer((o+(r.disableSkirt?0:a))*s.BYTES_PER_ELEMENT)),c=r.disableSkirt?void 0:l.subarray(o,o+a);return{index:l,skirt:c}}(e,t,n)??{};return{index:s,skirt:o,position:new Float32Array(3*e),normal:new Float32Array(3*e),uvs:[n.buildIndexAndUv_0?new Float32Array(2*e):void 0,void 0!==r.computeExtraOffset?new Float32Array(e):void 0]}}(c,r,e,t),h=[t.buildIndexAndUv_0?s:()=>{}];t=e.prepare(t);for(let n=0;n<=r;n++){const i=n/r;t.coordinates.y=e.vProject(i,t.extent),void 0!==e.computeExtraOffset&&(h[1]=o(e.computeExtraOffset(t)));for(let s=0;s<=r;s++){const o=s/r,l=3*(n*a+s);t.coordinates.x=e.uProject(o,t.extent);const c=e.vertexPosition(t.coordinates),d=e.vertexNormal();if(c.sub(t.center),"quatNormalToZ"in t){const e=t.quatNormalToZ;c.applyQuaternion(e),d.applyQuaternion(e)}c.toArray(u.position,l),d.toArray(u.normal,l);for(const[e,t]of h.entries())void 0!==t&&t(u.uvs[e],n*a+s,o,i)}}if(t.buildIndexAndUv_0&&!t.disableSkirt){for(let e=0;e(d(e,t,r,n),d(e+3,t,n,i),e+6),uv:(e,t,r)=>{e[2*t+0]=e[2*r+0],e[2*t+1]=e[2*r+1]}},i=l;for(let n=0;n{"use strict";r.d(t,{p:()=>o});var n=r(39437),i=r(22598),s=r(52404);class o extends n.BufferGeometry{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(e,t){const r={disableSkirt:!1,hideSkirt:!1,buildIndexAndUv_0:!0,segments:16,coordinates:new s.A(e.crs),center:e.center(t.extent).clone(),...t},o=(0,i.t)(e,r);return{index:o.index?new n.BufferAttribute(o.index,1):null,uvs:[...o.uvs[0]?[new n.BufferAttribute(o.uvs[0],2)]:[],...o.uvs[1]?[new n.BufferAttribute(o.uvs[1],1)]:[]],position:new n.BufferAttribute(o.position,3),normal:new n.BufferAttribute(o.normal,3)}}(e,t);super(),this.extent=t.extent,this.segments=t.segments,this.setIndex(r.index),this.setAttribute("position",r.position),this.setAttribute("normal",r.normal),this.setAttribute("uv",r.uvs[0]);for(let e=1;e{this._refCount.count--,this._refCount.count<=0&&(this.index=null,delete this.attributes.uv,e.delete(...t),super.dispose())}})}increaseRefCount(){if(null===this._refCount)throw new Error("[TileGeometry::increaseRefCount] Tried to increment an unitialized reference count.");this._refCount.count++}get refCount(){return this._refCount?.count}dispose(){null==this._refCount?super.dispose():this._refCount.fn()}}},50329:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hierarchyItemLength=t.infoLength=void 0,t.infoLength=160,t.hierarchyItemLength=32},86601:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Copc=void 0;const o=s(r(30549)),a=r(876),l=r(98363),c=r(15690);async function u(e,{pointDataRecordFormat:t,pointDataRecordLength:r},n,i){const s=await async function(e,{pointDataOffset:t,pointDataLength:r}){return a.Getter.create(e)(t,t+r)}(e,n),{pointCount:l}=n;return o.PointData.decompressChunk(s,{pointCount:l,pointDataRecordFormat:t,pointDataRecordLength:r},i)}t.Copc={create:async function(e){const t=a.Getter.create(e),r=t(0,65536);async function n(e,n){return n>=65536?t(e,n):(await r).slice(e,n)}const i=o.Header.parse(await n(0,o.Constants.minHeaderLength)),s=await o.Vlr.walk(n,i),l=o.Vlr.find(s,"copc",1);if(!l)throw new Error("COPC info VLR is required");const u=c.Info.parse(await o.Vlr.fetch(n,l));let h;const d=o.Vlr.find(s,"LASF_Projection",2112);d&&d.contentLength&&(h=a.Binary.toCString(await o.Vlr.fetch(n,d)),""===h&&(h=void 0));let p=[];const f=o.Vlr.find(s,"LASF_Spec",4);return f&&(p=o.ExtraBytes.parse(await o.Vlr.fetch(n,f))),{header:i,vlrs:s,info:u,wkt:h,eb:p}},loadHierarchyPage:async function(e,t){const r=a.Getter.create(e);return l.Hierarchy.load(r,t)},loadPointDataBuffer:u,loadPointDataView:async function(e,t,r,{lazPerf:n,include:i}={}){const s=await u(e,t.header,r,n);return o.View.create(s,t.header,t.eb,i)}}},98363:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Hierarchy=void 0;const n=r(876),i=r(50329);function s(e){const t=n.Binary.toDataView(e);if(t.byteLength%i.hierarchyItemLength!=0)throw new Error(`Invalid hierarchy page length: ${t.byteLength}`);const r={},s={};for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Info=void 0;const n=r(876),i=r(50329);t.Info={parse:function(e){const t=n.Binary.toDataView(e);if(t.byteLength!==i.infoLength)throw new Error(`Invalid COPC info VLR length (should be ${i.infoLength}): ${t.byteLength}`);const r=[t.getFloat64(0,!0),t.getFloat64(8,!0),t.getFloat64(16,!0)],s=t.getFloat64(24,!0);return{cube:[r[0]-s,r[1]-s,r[2]-s,r[0]+s,r[1]+s,r[2]+s],spacing:t.getFloat64(32,!0),rootHierarchyPage:{pageOffset:(0,n.parseBigInt)((0,n.getBigUint64)(t,40,!0)),pageLength:(0,n.parseBigInt)((0,n.getBigUint64)(t,48,!0))},gpsTimeRange:[t.getFloat64(56,!0),t.getFloat64(64,!0)]}}}},69545:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},24305:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Hierarchy=void 0,t.Hierarchy={parse:function(e){return Object.entries(e).reduce(((e,[t,r])=>(-1===r?e.pages[t]={}:r&&(e.nodes[t]={pointCount:r}),e)),{nodes:{},pages:{}})}}},68962:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(69545),t),i(r(24305),t)},15234:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.Las=t.Ept=void 0,t.Ept=s(r(68962)),o(r(36564),t),t.Las=s(r(30549)),o(r(876),t)},48300:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.evlrHeaderLength=t.vlrHeaderLength=t.minHeaderLength=void 0,t.minHeaderLength=375,t.vlrHeaderLength=54,t.evlrHeaderLength=60},51652:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Dimensions=void 0;const n=r(876),i=r(94553);t.Dimensions={create:function(e,t=[]){return Object.keys(e).reduce(((e,r)=>{const n=o[r];if(n)return{...e,[r]:n};const s=t.find((e=>e.name===r)),a=s&&i.ExtraBytes.getDimension(s);if(a)return{...e,[r]:a};throw new Error(`Failed to look up LAS type: ${r}`)}),{})}};const{Type:s}=n.Dimension,o={X:s.float64,Y:s.float64,Z:s.float64,Intensity:s.uint16,ReturnNumber:s.uint8,NumberOfReturns:s.uint8,ScanDirectionFlag:s.boolean,EdgeOfFlightLine:s.boolean,Classification:s.uint8,Synthetic:s.boolean,KeyPoint:s.boolean,Withheld:s.boolean,Overlap:s.boolean,ScanAngle:s.float32,UserData:s.uint8,PointSourceId:s.uint16,GpsTime:s.float64,Red:s.uint16,Green:s.uint16,Blue:s.uint16,ScannerChannel:s.uint8,Infrared:s.uint16}},94553:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtraBytes=void 0;const n=r(876);t.ExtraBytes={getDimension:function({type:e,length:t}){switch(e){case"signed":case"unsigned":switch(t){case 1:case 2:case 4:case 8:return{type:e,size:t}}case"float":switch(t){case 4:case 8:return{type:e,size:t}}}},parse:function(e){if(e.byteLength%i!=0)throw new Error(`Invalid extra bytes VLR length: ${e.byteLength}`);const t=[];for(let r=0;r=11)throw new Error(`Invalid extra bytes "type" value: ${o}`);if(0===o)return{name:r,description:s,length:a};const l=(c=a,{hasNodata:Boolean(1&c),hasMin:Boolean(c>>1&1),hasMax:Boolean(c>>2&1),hasScale:Boolean(c>>3&1),hasOffset:Boolean(c>>4&1)});var c;const u=function(e){switch(e){case 1:return n.Dimension.Type.uint8;case 2:return n.Dimension.Type.int8;case 3:return n.Dimension.Type.uint16;case 4:return n.Dimension.Type.int16;case 5:return n.Dimension.Type.uint32;case 6:return n.Dimension.Type.int32;case 7:return n.Dimension.Type.uint64;case 8:return n.Dimension.Type.int64;case 9:return n.Dimension.Type.float32;case 10:return n.Dimension.Type.float64}}(o);if(!u)throw new Error(`Failed to extract dimension type: ${o}`);const{type:h,size:d}=u;function p(e){switch(h){case"signed":return(0,n.parseBigInt)(t.getBigInt64(e,!0));case"unsigned":return(0,n.parseBigInt)((0,n.getBigUint64)(t,e,!0));case"float":return t.getFloat64(e,!0)}}const f={name:r,description:s,type:h,length:d};return l.hasNodata&&(f.nodata=p(40)),l.hasMin&&(f.min=p(64)),l.hasMax&&(f.max=p(88)),l.hasScale&&(f.scale=t.getFloat64(112)),l.hasOffset&&(f.offset=t.getFloat64(136)),f}},11677:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Extractor=void 0;const n=r(876);function i(e){const{scale:t,offset:r}=e,i=a(e);function s(e,t){return e.getUint8(i(t)+14)}function o(e,t){return e.getUint8(i(t)+15)}function l(e,t){return 31&o(e,t)}return{X:(e,s)=>n.Scale.unapply(e.getInt32(i(s),!0),t[0],r[0]),Y:(e,s)=>n.Scale.unapply(e.getInt32(i(s)+4,!0),t[1],r[1]),Z:(e,s)=>n.Scale.unapply(e.getInt32(i(s)+8,!0),t[2],r[2]),Intensity:(e,t)=>e.getUint16(i(t)+12,!0),ReturnNumber:(e,t)=>7&s(e,t),NumberOfReturns:(e,t)=>(56&s(e,t))>>3,ScanDirectionFlag:(e,t)=>(64&s(e,t))>>6,EdgeOfFlightLine:(e,t)=>(128&s(e,t))>>7,Classification:(e,t)=>{const r=l(e,t);return 12===r?0:r},Synthetic:(e,t)=>(32&o(e,t))>>5,KeyPoint:(e,t)=>(64&o(e,t))>>6,Withheld:(e,t)=>(128&o(e,t))>>7,Overlap:(e,t)=>12===l(e,t)?1:0,ScanAngle:(e,t)=>e.getInt8(i(t)+16),UserData:(e,t)=>e.getUint8(i(t)+17),PointSourceId:(e,t)=>e.getUint16(i(t)+18,!0)}}function s(e){const{scale:t,offset:r}=e,i=a(e);function s(e,t){return e.getUint8(i(t)+15)}return{X:(e,s)=>n.Scale.unapply(e.getInt32(i(s),!0),t[0],r[0]),Y:(e,s)=>n.Scale.unapply(e.getInt32(i(s)+4,!0),t[1],r[1]),Z:(e,s)=>n.Scale.unapply(e.getInt32(i(s)+8,!0),t[2],r[2]),Intensity:(e,t)=>e.getUint16(i(t)+12,!0),ReturnNumber:(e,t)=>15&e.getUint16(i(t)+14,!0),NumberOfReturns:(e,t)=>(240&e.getUint16(i(t)+14,!0))>>4,Synthetic:(e,t)=>1&s(e,t),KeyPoint:(e,t)=>(2&s(e,t))>>1,Withheld:(e,t)=>(4&s(e,t))>>2,Overlap:(e,t)=>(8&s(e,t))>>3,ScannerChannel:(e,t)=>(48&s(e,t))>>4,ScanDirectionFlag:(e,t)=>(64&s(e,t))>>6,EdgeOfFlightLine:(e,t)=>(128&s(e,t))>>7,Classification:(e,t)=>e.getUint8(i(t)+16),UserData:(e,t)=>e.getUint8(i(t)+17),ScanAngle:(e,t)=>.006*e.getInt16(i(t)+18,!0),PointSourceId:(e,t)=>e.getUint16(i(t)+20,!0),GpsTime:(e,t)=>e.getFloat64(i(t)+22,!0)}}function o(e){const t=a(e);return{...s(e),Red:(e,r)=>e.getUint16(t(r)+30,!0),Green:(e,r)=>e.getUint16(t(r)+32,!0),Blue:(e,r)=>e.getUint16(t(r)+34,!0)}}function a(e){const{pointDataRecordLength:t}=e;return function(e){return e*t}}t.Extractor={create:function(e,t=[]){const r=function(e,t){let r=function(e){switch(e){case 0:return 20;case 1:return 28;case 2:return 26;case 3:return 34;case 6:return 30;case 7:return 36;case 8:return 38;default:throw new Error(`Unsupported point data record format: ${e}`)}}(e.pointDataRecordFormat);return t.reduce(((t,i)=>{const s=r;r+=i.length;const o=function(e,t,{type:r,length:i}){const s=a(e);switch(r){case"signed":switch(i){case 1:return(e,r)=>e.getInt8(s(r)+t);case 2:return(e,r)=>e.getInt16(s(r)+t,!0);case 4:return(e,r)=>e.getInt32(s(r)+t,!0);case 8:return(e,r)=>(0,n.parseBigInt)(e.getBigInt64(s(r)+t,!0))}case"unsigned":switch(i){case 1:return(e,r)=>e.getUint8(s(r)+t);case 2:return(e,r)=>e.getUint16(s(r)+t,!0);case 4:return(e,r)=>e.getUint32(s(r)+t,!0);case 8:return(e,r)=>(0,n.parseBigInt)((0,n.getBigUint64)(e,s(r)+t,!0))}case"float":switch(i){case 4:return(e,r)=>e.getFloat32(s(r)+t,!0);case 8:return(e,r)=>e.getFloat64(s(r)+t,!0)}}}(e,s,i);if(!o)return t;return{...t,[i.name]:(e,t)=>n.Scale.unapply(o(e,t),i.scale,i.offset)}}),{})}(e,t);return{...(()=>{const{pointDataRecordFormat:t}=e;switch(t){case 0:return i(e);case 1:return function(e){const t=a(e);return{...i(e),GpsTime:(e,r)=>e.getFloat64(t(r)+20,!0)}}(e);case 2:return function(e){const t=a(e);return{...i(e),Red:(e,r)=>e.getUint16(t(r)+20,!0),Green:(e,r)=>e.getUint16(t(r)+22,!0),Blue:(e,r)=>e.getUint16(t(r)+24,!0)}}(e);case 3:return function(e){const t=a(e);return{...i(e),GpsTime:(e,r)=>e.getFloat64(t(r)+20,!0),Red:(e,r)=>e.getUint16(t(r)+28,!0),Green:(e,r)=>e.getUint16(t(r)+30,!0),Blue:(e,r)=>e.getUint16(t(r)+32,!0)}}(e);case 6:return s(e);case 7:return o(e);case 8:return function(e){const t=a(e);return{...o(e),Infrared:(e,r)=>e.getUint16(t(r)+36,!0)}}(e);default:throw new Error(`Unsupported point data record format: ${t}`)}})(),...r}}}},68916:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Header=void 0;const n=r(876),i=r(48300),s=r(47952);function o(e){const t=n.Binary.toDataView(e),r=[];for(let e=0;e<120;e+=8)r.push((0,n.getBigUint64)(t,e,!0));return r.map((e=>(0,n.parseBigInt)(e)))}function a(e){const t=n.Binary.toDataView(e),r=[];for(let e=0;e<20;e+=4)r.push(t.getUint32(e,!0));return r}t.Header={parse:function(e){if(e.byteLength{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decompressFile=t.decompressChunk=t.PointData=void 0;const n=r(26977),i=r(68916);let s;async function o(e){return e||(s||(s=(0,n.createLazPerf)()),s)}async function a(e,{pointCount:t,pointDataRecordFormat:r,pointDataRecordLength:n},i){const s=await o(i),a=new Uint8Array(t*n),l=s._malloc(e.byteLength),c=s._malloc(n),u=new s.ChunkDecoder;try{s.HEAPU8.set(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),l),u.open(r,n,l);for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatGuid=t.parsePoint=void 0;const n=r(876);t.parsePoint=function(e){const t=n.Binary.toDataView(e);if(24!==t.byteLength)throw new Error(`Invalid tuple buffer length: ${t.byteLength}`);return[t.getFloat64(0,!0),t.getFloat64(8,!0),t.getFloat64(16,!0)]},t.formatGuid=function(e){const t=n.Binary.toDataView(e);if(16!==t.byteLength)throw new Error(`Invalid GUID buffer length: ${t.byteLength}`);let r="";for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.View=void 0;const n=r(876),i=r(51652),s=r(11677);t.View={create:function(e,t,r=[],o){let a=s.Extractor.create(t,r);if(o){const e=new Set([...o]);a=Object.entries(a).reduce(((t,[r,n])=>(e.has(r)&&(t[r]=n),t)),{})}const l=i.Dimensions.create(a,r),c=n.Binary.toDataView(e),u=t.pointDataRecordLength;if(c.byteLength%u!=0)throw new Error(`Invalid buffer length (${c.byteLength}) for point length ${u}`);const h=c.byteLength/t.pointDataRecordLength;return{pointCount:h,dimensions:l,getter:function(e){const t=a[e];if(!t)throw new Error(`No extractor for dimension: ${e}`);return function(e){if(e>=h)throw new RangeError(`View index (${e}) out of range: ${h}`);return t(c,e)}}}}}},32101:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Vlr=void 0;const n=r(876),i=r(48300);function s(e,t,r){return e.find((e=>e.userId===t&&e.recordId===r))}function o(e,t){return(t?l:a)(e)}function a(e){const t=n.Binary.toDataView(e);if(t.byteLength!==i.vlrHeaderLength)throw new Error(`Invalid VLR header length (must be ${i.vlrHeaderLength}): ${t.byteLength}`);return{userId:n.Binary.toCString(e.slice(2,18)),recordId:t.getUint16(18,!0),contentLength:t.getUint16(20,!0),description:n.Binary.toCString(e.slice(22,54)),isExtended:!1}}function l(e){const t=n.Binary.toDataView(e);if(t.byteLength!==i.evlrHeaderLength)throw new Error(`Invalid EVLR header length (must be ${i.evlrHeaderLength}): ${t.byteLength}`);return{userId:n.Binary.toCString(e.slice(2,18)),recordId:t.getUint16(18,!0),contentLength:(0,n.parseBigInt)((0,n.getBigUint64)(t,20,!0)),description:n.Binary.toCString(e.slice(28,60)),isExtended:!0}}async function c({get:e,startOffset:t,count:r,isExtended:n}){const s=[];let a=t;const l=n?i.evlrHeaderLength:i.vlrHeaderLength;for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBigUint64=t.parseBigInt=void 0,t.parseBigInt=function(e){if(e>BigInt(Number.MAX_SAFE_INTEGER)||e{"use strict";function r(e){return new DataView(e.buffer,e.byteOffset,e.length)}function n(e){const t=r(e);let n="";for(let e=0;e{"use strict";function r([e,t,r,n,i,s]){return[e+(n-e)/2,t+(i-t)/2,r+(s-r)/2]}function n(e){return e[3]-e[0]}function i(e){return e[4]-e[1]}function s(e){return e[5]-e[2]}function o(e,[t,n,i]){const[s,o,a,l,c,u]=e,[h,d,p]=r(e);return[t?h:s,n?d:o,i?p:a,t?l:h,n?c:d,i?u:p]}Object.defineProperty(t,"__esModule",{value:!0}),t.Bounds=void 0,t.Bounds={min:function(e){return[e[0],e[1],e[2]]},max:function(e){return[e[3],e[4],e[5]]},mid:r,width:n,depth:i,height:s,cube:function(e){const t=r(e),o=Math.max(n(e),i(e),s(e))/2;return[t[0]-o,t[1]-o,t[2]-o,t[0]+o,t[1]+o,t[2]+o]},step:o,stepTo:function(e,[t,r,n,i]){for(let s=t-1;s>=0;--s)e=o(e,[r>>s&1,n>>s&1,i>>s&1]);return e},intersection:function(e,t){return[Math.max(e[0],t[0]),Math.max(e[1],t[1]),Math.max(e[2],t[2]),Math.min(e[3],t[3]),Math.min(e[4],t[4]),Math.min(e[5],t[5])]}}},44324:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Dimension=void 0,t.Dimension={Type:{int8:{type:"signed",size:1},int16:{type:"signed",size:2},int32:{type:"signed",size:4},int64:{type:"signed",size:8},uint8:{type:"unsigned",size:1},uint16:{type:"unsigned",size:2},uint32:{type:"unsigned",size:4},uint64:{type:"unsigned",size:8},float32:{type:"float",size:4},float64:{type:"float",size:8},float:{type:"float",size:4},double:{type:"float",size:8},bool:{type:"unsigned",size:1},boolean:{type:"unsigned",size:1}},ctype:function({type:e,size:t}){switch(e){case"signed":switch(t){case 1:return"int8";case 2:return"int16";case 4:return"int32";case 8:return"int64"}case"unsigned":switch(t){case 1:return"uint8";case 2:return"uint16";case 4:return"uint32";case 8:return"uint64"}case"float":switch(t){case 4:return"float";case 8:return"double"}}throw new Error(`Invalid dimension type/size: ${e}/${t}`)}}},27201:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Getter=void 0;const a=o(r(74945));function l(e){return async function(t,r){if(t<0||r<0||t>r)throw new Error("Invalid range");const n=await(0,a.default)(e,{headers:{Range:`bytes=${t}-${r-1}`}}),i=await n.arrayBuffer();return new Uint8Array(i)}}function c(e){return async function(t,n){const i=await Promise.resolve().then((()=>s(r(10539))));return async function(t=0,r=1/0){if(t<0||r<0||t>r)throw new Error("Invalid range");return await i.promises.access(e),async function(e){return await new Promise(((t,r)=>{const n=[];e.on("data",(e=>n.push(e))),e.on("error",r),e.on("end",(()=>t(Buffer.concat(n))))}))}(i.createReadStream(e,{start:t,end:r-1,autoClose:!0}))}(t,n)}}t.Getter={create:function(e){return"function"==typeof e?e:e.startsWith("http://")||e.startsWith("https://")?l(e):c(e)},http:l,file:c}},876:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.Step=t.Scale=t.Key=t.Getter=t.Dimension=t.Bounds=t.Binary=void 0,i(r(16882),t);var s=r(33359);Object.defineProperty(t,"Binary",{enumerable:!0,get:function(){return s.Binary}});var o=r(19459);Object.defineProperty(t,"Bounds",{enumerable:!0,get:function(){return o.Bounds}});var a=r(44324);Object.defineProperty(t,"Dimension",{enumerable:!0,get:function(){return a.Dimension}});var l=r(27201);Object.defineProperty(t,"Getter",{enumerable:!0,get:function(){return l.Getter}});var c=r(54623);Object.defineProperty(t,"Key",{enumerable:!0,get:function(){return c.Key}});var u=r(66838);Object.defineProperty(t,"Scale",{enumerable:!0,get:function(){return u.Scale}});var h=r(95192);Object.defineProperty(t,"Step",{enumerable:!0,get:function(){return h.Step}})},54623:(e,t)=>{"use strict";function r(e){if("string"!=typeof e)return e;const[t,r,n,i,...s]=e.split("-").map((e=>parseInt(e,10))),o=[t,r,n,i];if(0!==s.length||o.some((e=>"number"!=typeof e||Number.isNaN(e))))throw new Error(`Invalid key: ${e}`);return o}Object.defineProperty(t,"__esModule",{value:!0}),t.Key=void 0,t.Key={create:function(e,t=0,n=0,i=0){return"number"!=typeof e?r(e):[e,t,n,i]},parse:r,toString:function(e){return"string"==typeof e?e:e.join("-")},step:function(e,[r,n,i]){const[s,o,a,l]=t.Key.create(e);return[s+1,2*o+r,2*a+n,2*l+i]},up:function(e,r=1){const[n,i,s,o]=t.Key.create(e);return[n-r,i>>r,s>>r,o>>r]},compare:function(e,t){for(let r=0;rt[r])return 1}return 0},depth:function(e){return e[0]}}},66838:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Scale=void 0,t.Scale={apply:(e,t=1,r=0)=>(e-r)/t,unapply:(e,t=1,r=0)=>e*t+r}},95192:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Step=void 0,t.Step={fromIndex:function(e){if(e<0||e>=8)throw new Error(`Invalid step index: ${e}`);return[1&e?1:0,e>>1&1?1:0,e>>2&1?1:0]},list:function(){return[[0,0,0],[0,0,1],[0,1,0],[0,1,1],[1,0,0],[1,0,1],[1,1,0],[1,1,1]]}}},74945:function(e,t){var r="undefined"!=typeof self?self:this,n=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var r="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),s="FormData"in e,o="ArrayBuffer"in e;if(o)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(e){return e&&a.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function u(e){return"string"!=typeof e&&(e=String(e)),e}function h(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function d(e){this.map={},e instanceof d?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function p(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function f(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function m(e){var t=new FileReader,r=f(t);return t.readAsArrayBuffer(e),r}function g(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function A(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:s&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():o&&i&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=g(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o&&(ArrayBuffer.prototype.isPrototypeOf(e)||l(e))?this._bodyArrayBuffer=g(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=p(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(m)}),this.text=function(){var e,t,r,n=p(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=f(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function x(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function _(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new d(t.headers),this.url=t.url||"",this._initBody(e)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},A.call(v.prototype),A.call(_.prototype),_.prototype.clone=function(){return new _(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},_.error=function(){var e=new _(null,{status:0,statusText:""});return e.type="error",e};var b=[301,302,303,307,308];_.redirect=function(e,t){if(-1===b.indexOf(t))throw new RangeError("Invalid status code");return new _(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function w(e,r){return new Promise((function(n,s){var o=new v(e,r);if(o.signal&&o.signal.aborted)return s(new t.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function l(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new d,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}})),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var i="response"in a?a.response:a.responseText;n(new _(i,r))},a.onerror=function(){s(new TypeError("Network request failed"))},a.ontimeout=function(){s(new TypeError("Network request failed"))},a.onabort=function(){s(new t.DOMException("Aborted","AbortError"))},a.open(o.method,o.url,!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&i&&(a.responseType="blob"),o.headers.forEach((function(e,t){a.setRequestHeader(t,e)})),o.signal&&(o.signal.addEventListener("abort",l),a.onreadystatechange=function(){4===a.readyState&&o.signal.removeEventListener("abort",l)}),a.send(void 0===o._bodyInit?null:o._bodyInit)}))}w.polyfill=!0,e.fetch||(e.fetch=w,e.Headers=d,e.Request=v,e.Response=_),t.Headers=d,t.Request=v,t.Response=_,t.fetch=w,Object.defineProperty(t,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},17833:(e,t,r)=>{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))})),t.splice(i,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=r(40736)(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},40736:(e,t,r)=>{e.exports=function(e){function t(e){let r,i,s,o=null;function a(...e){if(!a.enabled)return;const n=a,i=Number(new Date),s=i-(r||i);n.diff=s,n.prev=r,n.curr=i,r=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let o=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,i)=>{if("%%"===r)return"%";o++;const s=t.formatters[i];if("function"==typeof s){const t=e[o];r=s.call(n,t),e.splice(o,1),o--}return r})),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(i!==t.namespaces&&(i=t.namespaces,s=t.enabled(e)),s),set:e=>{o=e}}),"function"==typeof t.init&&t.init(a),a}function n(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(i),...t.skips.map(i).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length;for(r=0;r{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t{"use strict";e.exports=e=>!!e&&("symbol"==typeof Symbol.observable&&"function"==typeof e[Symbol.observable]?e===e[Symbol.observable]():"function"==typeof e["@@observable"]&&e===e["@@observable"]())},80061:e=>{e.exports=function e(t,r,n){function i(o,a){if(!r[o]){if(!t[o]){if(s)return s(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[o]={exports:{}};t[o][0].call(c.exports,(function(e){return i(t[o][1][e]||e)}),c,c.exports,e,t,r,n)}return r[o].exports}for(var s=void 0,o=0;o>>1],t)>=0?i=s+1:n=s;return i},t.exports=function(){function e(e){var t;this.options=e,this.comparator=this.options.comparator,this.data=(null!=(t=this.options.initialValues)?t.slice(0):void 0)||[],this.data.sort(this.comparator).reverse()}return e.prototype.queue=function(e){var t;t=n(this.data,e,this.comparator),this.data.splice(t,0,e)},e.prototype.dequeue=function(){return this.data.pop()},e.prototype.peek=function(){return this.data[this.data.length-1]},e.prototype.clear=function(){this.data.length=0},e}()},{}],4:[function(e,t,r){t.exports=function(){function e(e){var t,r,n,i,s,o,a,l;for(this.comparator=(null!=e?e.comparator:void 0)||function(e,t){return e-t},this.pageSize=(null!=e?e.pageSize:void 0)||512,this.length=0,a=0;1<s;0<=s?++r:--r)t.push(null);if(this._memory=[],this._mask=this.pageSize-1,e.initialValues)for(n=0,i=(o=e.initialValues).length;n0&&(this._write(1,t),this._bubbleDown(1,t)),e},e.prototype.peek=function(){return this._read(1)},e.prototype.clear=function(){this.length=0,this._memory.length=0},e.prototype._write=function(e,t){var r;for(r=e>>this._shift;r>=this._memory.length;)this._memory.push(this._emptyMemoryPageTemplate.slice(0));return this._memory[r][e&this._mask]=t},e.prototype._read=function(e){return this._memory[e>>this._shift][e&this._mask]},e.prototype._bubbleUp=function(e,t){var r,n,i,s;for(r=this.comparator;e>1&&(n=e&this._mask,e3?i=e&~this._mask|n>>1:n<2?(i=e-this.pageSize>>this._shift,i+=i&~(this._mask>>1),i|=this.pageSize>>1):i=e-2,!(r(s=this._read(i),t)<0));)this._write(i,t),this._write(e,s),e=i},e.prototype._bubbleDown=function(e,t){var r,n,i,s,o;for(o=this.comparator;ethis._mask&&!(e&this._mask-1)?r=n=e+2:e&this.pageSize>>1?(r=(e&~this._mask)>>1,n=1+(r=1+(r|=e&this._mask>>1)<0)for(e=t=1,r=this.data.length;1<=r?tr;e=1<=r?++t:--t)this._bubbleUp(e)},e.prototype.queue=function(e){this.data.push(e),this._bubbleUp(this.data.length-1)},e.prototype.dequeue=function(){var e,t;return t=this.data[0],e=this.data.pop(),this.data.length>0&&(this.data[0]=e,this._bubbleDown(0)),t},e.prototype.peek=function(){return this.data[0]},e.prototype.clear=function(){this.length=0,this.data.length=0},e.prototype._bubbleUp=function(e){for(var t,r;e>0&&(t=e-1>>>1,this.comparator(this.data[e],this.data[t])<0);)r=this.data[t],this.data[t]=this.data[e],this.data[e]=r,e=t},e.prototype._bubbleDown=function(e){var t,r,n,i,s;for(t=this.data.length-1;i=1+(r=1+(e<<1)),n=e,r<=t&&this.comparator(this.data[r],this.data[n])<0&&(n=r),i<=t&&this.comparator(this.data[i],this.data[n])<0&&(n=i),n!==e;)s=this.data[n],this.data[n]=this.data[e],this.data[e]=s,e=n},e}()},{}]},{},[1])(1)},26977:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LazPerf=t.create=t.createLazPerf=void 0;const i=n(r(67316));t.createLazPerf=i.default,t.create=i.default,t.LazPerf={create:i.default}},67316:e=>{var t,r=(t="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(e){var r,n,i=void 0!==(e=e||{})?e:{};i.ready=new Promise((function(e,t){r=e,n=t})),["_main","___getTypeName","__embind_initialize_bindings","_fflush","onRuntimeInitialized"].forEach((e=>{Object.getOwnPropertyDescriptor(i.ready,e)||Object.defineProperty(i.ready,e,{get:()=>j("You are getting "+e+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js"),set:()=>j("You are setting "+e+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")})}));var s=Object.assign({},i),o=[],a="./this.program";if(i.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");var l="";if("undefined"!=typeof document&&document.currentScript&&(l=document.currentScript.src),t&&(l=t),l=0!==l.indexOf("blob:")?l.substr(0,l.replace(/[?#].*/,"").lastIndexOf("/")+1):"","object"!=typeof window&&"function"!=typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");var c,u,h,d=i.print||console.log.bind(console),p=i.printErr||console.warn.bind(console);function f(e,t){Object.getOwnPropertyDescriptor(i,e)||Object.defineProperty(i,e,{configurable:!0,get:function(){j("Module."+e+" has been replaced with plain "+t+" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}})}function m(e){return"FS_createPath"===e||"FS_createDataFile"===e||"FS_createPreloadedFile"===e||"FS_unlink"===e||"addRunDependency"===e||"FS_createLazyFile"===e||"FS_createDevice"===e||"removeRunDependency"===e}Object.assign(i,s),s=null,c="fetchSettings",Object.getOwnPropertyDescriptor(i,c)&&j("`Module."+c+"` was supplied but `"+c+"` not included in INCOMING_MODULE_JS_API"),i.arguments&&(o=i.arguments),f("arguments","arguments_"),i.thisProgram&&(a=i.thisProgram),f("thisProgram","thisProgram"),i.quit&&i.quit,f("quit","quit_"),A(void 0===i.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),A(void 0===i.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),A(void 0===i.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),A(void 0===i.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),A(void 0===i.read,"Module.read option was removed (modify read_ in JS)"),A(void 0===i.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),A(void 0===i.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),A(void 0===i.setWindowTitle,"Module.setWindowTitle option was removed (modify setWindowTitle in JS)"),A(void 0===i.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),f("read","read_"),f("readAsync","readAsync"),f("readBinary","readBinary"),f("setWindowTitle","setWindowTitle"),A(!0,"worker environment detected but not enabled at build time. Add 'worker' to `-sENVIRONMENT` to enable."),A(!0,"node environment detected but not enabled at build time. Add 'node' to `-sENVIRONMENT` to enable."),A(!0,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),i.wasmBinary&&(u=i.wasmBinary),f("wasmBinary","wasmBinary"),i.noExitRuntime,f("noExitRuntime","noExitRuntime"),"object"!=typeof WebAssembly&&j("no native wasm support detected");var g=!1;function A(e,t){e||j("Assertion failed"+(t?": "+t:""))}var y,v,x,_,b,w,E,M,S,C="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function T(e,t,r){for(var n=t+r,i=t;e[i]&&!(i>=n);)++i;if(i-t>16&&e.buffer&&C)return C.decode(e.subarray(t,i));for(var s="";t>10,56320|1023&c)}}else s+=String.fromCharCode((31&o)<<6|a)}else s+=String.fromCharCode(o)}return s}function I(e,t){return e?T(x,e,t):""}function R(e,t,r,n){if(!(n>0))return 0;for(var i=r,s=r+n-1,o=0;o=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++o)),a<=127){if(r>=s)break;t[r++]=a}else if(a<=2047){if(r+1>=s)break;t[r++]=192|a>>6,t[r++]=128|63&a}else if(a<=65535){if(r+2>=s)break;t[r++]=224|a>>12,t[r++]=128|a>>6&63,t[r++]=128|63&a}else{if(r+3>=s)break;a>1114111&&Z("Invalid Unicode code point 0x"+a.toString(16)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."),t[r++]=240|a>>18,t[r++]=128|a>>12&63,t[r++]=128|a>>6&63,t[r++]=128|63&a}}return t[r]=0,r-i}function B(e){for(var t=0,r=0;r=55296&&n<=57343?(t+=4,++r):t+=3}return t}function P(e){y=e,i.HEAP8=v=new Int8Array(e),i.HEAP16=_=new Int16Array(e),i.HEAP32=w=new Int32Array(e),i.HEAPU8=x=new Uint8Array(e),i.HEAPU16=b=new Uint16Array(e),i.HEAPU32=E=new Uint32Array(e),i.HEAPF32=M=new Float32Array(e),i.HEAPF64=S=new Float64Array(e)}var L=65536;i.TOTAL_STACK&&A(L===i.TOTAL_STACK,"the stack size can no longer be determined at runtime");var D,O=i.INITIAL_MEMORY||262144;function N(){if(!g){var e=_t(),t=E[e>>2],r=E[e+4>>2];34821223==t&&2310721022==r||j("Stack overflow! Stack cookie has been overwritten at 0x"+e.toString(16)+", expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+r.toString(16)+" 0x"+t.toString(16)),1668509029!==E[0]&&j("Runtime error: The application has corrupted its heap memory area (address zero)!")}}f("INITIAL_MEMORY","INITIAL_MEMORY"),A(O>=L,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+O+"! (TOTAL_STACK="+L+")"),A("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,"JS engine does not provide full typed array support"),A(!i.wasmMemory,"Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally"),A(262144==O,"Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically"),function(){var e=new Int16Array(1),t=new Int8Array(e.buffer);if(e[0]=25459,115!==t[0]||99!==t[1])throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"}();var U=[],F=[],k=[],z=!1;A(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),A(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),A(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),A(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var G=0,Q=null,V=null,H={};function j(e){i.onAbort&&i.onAbort(e),p(e="Aborted("+e+")"),g=!0;var t=new WebAssembly.RuntimeError(e);throw n(t),t}var q,W,Y={error:function(){j("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM")},init:function(){Y.error()},createDataFile:function(){Y.error()},createPreloadedFile:function(){Y.error()},createLazyFile:function(){Y.error()},open:function(){Y.error()},mkdev:function(){Y.error()},registerDevice:function(){Y.error()},analyzePath:function(){Y.error()},loadFilesFromDB:function(){Y.error()},ErrnoError:function(){Y.error()}};function X(e){return e.startsWith("data:application/octet-stream;base64,")}function K(e,t){return function(){var r=e,n=t;return t||(n=i.asm),A(z,"native function `"+r+"` called before runtime initialization"),n[e]||A(n[e],"exported native function `"+r+"` not found"),n[e].apply(null,arguments)}}function $(e){try{if(e==q&&u)return new Uint8Array(u);throw"both async and sync fetching of the wasm failed"}catch(e){j(e)}}function J(e){for(;e.length>0;)e.shift()(i)}function Z(e){Z.shown||(Z.shown={}),Z.shown[e]||(Z.shown[e]=1,p(e))}function ee(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){E[this.ptr+4>>2]=e},this.get_type=function(){return E[this.ptr+4>>2]},this.set_destructor=function(e){E[this.ptr+8>>2]=e},this.get_destructor=function(){return E[this.ptr+8>>2]},this.set_refcount=function(e){w[this.ptr>>2]=e},this.set_caught=function(e){e=e?1:0,v[this.ptr+12|0]=e},this.get_caught=function(){return 0!=v[this.ptr+12|0]},this.set_rethrown=function(e){e=e?1:0,v[this.ptr+13|0]=e},this.get_rethrown=function(){return 0!=v[this.ptr+13|0]},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var e=w[this.ptr>>2];w[this.ptr>>2]=e+1},this.release_ref=function(){var e=w[this.ptr>>2];return w[this.ptr>>2]=e-1,A(e>0),1===e},this.set_adjusted_ptr=function(e){E[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return E[this.ptr+16>>2]},this.get_exception_ptr=function(){if(bt(this.get_type()))return E[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}function te(e){switch(e){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+e)}}i.FS_createDataFile=Y.createDataFile,i.FS_createPreloadedFile=Y.createPreloadedFile,X(q="laz-perf.wasm")||(W=q,q=i.locateFile?i.locateFile(W,l):l+W);var re=void 0;function ne(e){for(var t="",r=e;x[r];)t+=re[x[r++]];return t}var ie={},se={},oe={};function ae(e){if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=48&&t<=57?"_"+e:e}function le(e,t){return e=ae(e),new Function("body","return function "+e+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(t)}function ce(e,t){var r=le(t,(function(e){this.name=t,this.message=e;var r=new Error(e).stack;void 0!==r&&(this.stack=this.toString()+"\n"+r.replace(/^Error(:[^\n]*)?\n/,""))}));return r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},r}var ue=void 0;function he(e){throw new ue(e)}var de=void 0;function pe(e){throw new de(e)}function fe(e,t,r){function n(t){var n=r(t);n.length!==e.length&&pe("Mismatched type converter count");for(var i=0;i{se.hasOwnProperty(e)?i[t]=se[e]:(s.push(e),ie.hasOwnProperty(e)||(ie[e]=[]),ie[e].push((()=>{i[t]=se[e],++o===s.length&&n(i)})))})),0===s.length&&n(i)}function me(e,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");var n=t.name;if(e||he('type "'+n+'" must have a positive integer typeid pointer'),se.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;he("Cannot register type '"+n+"' twice")}if(se[e]=t,delete oe[e],ie.hasOwnProperty(e)){var i=ie[e];delete ie[e],i.forEach((e=>e()))}}function ge(e){he(e.$$.ptrType.registeredClass.name+" instance already deleted")}var Ae=!1;function ye(e){}function ve(e){e.count.value-=1,0===e.count.value&&function(e){e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)}(e)}function xe(e,t,r){if(t===r)return e;if(void 0===r.baseClass)return null;var n=xe(e,t,r.baseClass);return null===n?null:r.downcast(n)}var _e={};var be=[];function we(){for(;be.length;){var e=be.pop();e.$$.deleteScheduled=!1,e.delete()}}var Ee=void 0;var Me={};function Se(e,t){return t.ptrType&&t.ptr||pe("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&pe("Both smartPtrType and smartPtr must be specified"),t.count={value:1},Te(Object.create(e,{$$:{value:t}}))}function Ce(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=function(e,t){return t=function(e,t){for(void 0===t&&he("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t}(e,t),Me[t]}(this.registeredClass,t);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function i(){return this.isSmartPointer?Se(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):Se(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var s,o=this.registeredClass.getActualType(t),a=_e[o];if(!a)return i.call(this);s=this.isConst?a.constPointerType:a.pointerType;var l=xe(t,this.registeredClass,s.registeredClass);return null===l?i.call(this):this.isSmartPointer?Se(s.registeredClass.instancePrototype,{ptrType:s,ptr:l,smartPtrType:this,smartPtr:e}):Se(s.registeredClass.instancePrototype,{ptrType:s,ptr:l})}function Te(e){return"undefined"==typeof FinalizationRegistry?(Te=e=>e,e):(Ae=new FinalizationRegistry((e=>{console.warn(e.leakWarning.stack.replace(/^Error: /,"")),ve(e.$$)})),Te=e=>{var t=e.$$;if(t.smartPtr){var r={$$:t},n=t.ptrType.registeredClass;r.leakWarning=new Error("Embind found a leaked C++ instance "+n.name+" <0x"+t.ptr.toString(16)+">.\nWe'll free it automatically in this case, but this functionality is not reliable across various environments.\nMake sure to invoke .delete() manually once you're done with the instance instead.\nOriginally allocated"),"captureStackTrace"in Error&&Error.captureStackTrace(r.leakWarning,Ce),Ae.register(e,r,e)}return e},ye=e=>Ae.unregister(e),Te(e))}function Ie(){}function Re(e,t,r){if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||he("Function '"+r+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+e[t].overloadTable+")!"),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}}function Be(e,t,r,n,i,s,o,a){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=i,this.getActualType=s,this.upcast=o,this.downcast=a,this.pureVirtualFunctions=[]}function Pe(e,t,r){for(;t!==r;)t.upcast||he("Expected null or instance of "+r.name+", got an instance of "+t.name),e=t.upcast(e),t=t.baseClass;return e}function Le(e,t){if(null===t)return this.isReference&&he("null is not a valid "+this.name),0;t.$$||he('Cannot pass "'+Ke(t)+'" as a '+this.name),t.$$.ptr||he("Cannot pass deleted object as a pointer of type "+this.name);var r=t.$$.ptrType.registeredClass;return Pe(t.$$.ptr,r,this.registeredClass)}function De(e,t){var r;if(null===t)return this.isReference&&he("null is not a valid "+this.name),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t.$$||he('Cannot pass "'+Ke(t)+'" as a '+this.name),t.$$.ptr||he("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&t.$$.ptrType.isConst&&he("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);var n=t.$$.ptrType.registeredClass;if(r=Pe(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&he("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:he("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var i=t.clone();r=this.rawShare(r,Xe.toHandle((function(){i.delete()}))),null!==e&&e.push(this.rawDestructor,r)}break;default:he("Unsupporting sharing policy")}return r}function Oe(e,t){if(null===t)return this.isReference&&he("null is not a valid "+this.name),0;t.$$||he('Cannot pass "'+Ke(t)+'" as a '+this.name),t.$$.ptr||he("Cannot pass deleted object as a pointer of type "+this.name),t.$$.ptrType.isConst&&he("Cannot convert argument of type "+t.$$.ptrType.name+" to parameter type "+this.name);var r=t.$$.ptrType.registeredClass;return Pe(t.$$.ptr,r,this.registeredClass)}function Ne(e){return this.fromWireType(w[e>>2])}function Ue(e,t,r,n,i,s,o,a,l,c,u){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=i,this.pointeeType=s,this.sharingPolicy=o,this.rawGetPointee=a,this.rawConstructor=l,this.rawShare=c,this.rawDestructor=u,i||void 0!==t.baseClass?this.toWireType=De:n?(this.toWireType=Le,this.destructorFunction=null):(this.toWireType=Oe,this.destructorFunction=null)}var Fe=[];function ke(e){var t=Fe[e];return t||(e>=Fe.length&&(Fe.length=e+1),Fe[e]=t=D.get(e)),A(D.get(e)==t,"JavaScript-side Wasm function table mirror is out of date!"),t}function ze(e,t){var r=(e=ne(e)).includes("j")?function(e,t){A(e.includes("j")||e.includes("p"),"getDynCaller should only be called with i64 sigs");var r=[];return function(){return r.length=0,Object.assign(r,arguments),function(e,t,r){return e.includes("j")?function(e,t,r){A("dynCall_"+e in i,"bad function pointer type - no table for sig '"+e+"'"),r&&r.length?A(r.length===e.substring(1).replace(/j/g,"--").length):A(1==e.length);var n=i["dynCall_"+e];return r&&r.length?n.apply(null,[t].concat(r)):n.call(null,t)}(e,t,r):(A(ke(t),"missing table entry in dynCall: "+t),ke(t).apply(null,r))}(e,t,r)}}(e,t):ke(t);return"function"!=typeof r&&he("unknown function pointer with signature "+e+": "+t),r}var Ge=void 0;function Qe(e){var t=vt(e),r=ne(t);return yt(t),r}function Ve(e,t){var r=[],n={};throw t.forEach((function e(t){n[t]||se[t]||(oe[t]?oe[t].forEach(e):(r.push(t),n[t]=!0))})),new Ge(e+": "+r.map(Qe).join([", "]))}function He(e,t){for(var r=[],n=0;n>2]);return r}function je(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function qe(e,t,r,n,i){var s=t.length;s<2&&he("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var o=null!==t[1]&&null!==r,a=!1,l=1;l0?", ":"")+h),d+=(c?"var rv = ":"")+"invoker(fn"+(h.length>0?", ":"")+h+");\n",a)d+="runDestructors(destructors);\n";else for(l=o?1:2;l(e||he("Cannot use deleted val. handle = "+e),Ye[e].value),toHandle:e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var t=We.length?We.pop():Ye.length;return Ye[t]={refcount:1,value:e},t}}};function Ke(e){if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e}function $e(e,t){switch(t){case 2:return function(e){return this.fromWireType(M[e>>2])};case 3:return function(e){return this.fromWireType(S[e>>3])};default:throw new TypeError("Unknown float type: "+e)}}function Je(e,t,r){switch(t){case 0:return r?function(e){return v[e]}:function(e){return x[e]};case 1:return r?function(e){return _[e>>1]}:function(e){return b[e>>1]};case 2:return r?function(e){return w[e>>2]}:function(e){return E[e>>2]};default:throw new TypeError("Unknown integer type: "+e)}}var Ze="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function et(e,t){A(e%2==0,"Pointer passed to UTF16ToString must be aligned to two bytes!");for(var r=e,n=r>>1,i=n+t/2;!(n>=i)&&b[n];)++n;if((r=n<<1)-e>32&&Ze)return Ze.decode(x.subarray(e,r));for(var s="",o=0;!(o>=t/2);++o){var a=_[e+2*o>>1];if(0==a)break;s+=String.fromCharCode(a)}return s}function tt(e,t,r){if(A(t%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!"),A("number"==typeof r,"stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===r&&(r=2147483647),r<2)return 0;for(var n=t,i=(r-=2)<2*e.length?r/2:e.length,s=0;s>1]=o,t+=2}return _[t>>1]=0,t-n}function rt(e){return 2*e.length}function nt(e,t){A(e%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var r=0,n="";!(r>=t/4);){var i=w[e+4*r>>2];if(0==i)break;if(++r,i>=65536){var s=i-65536;n+=String.fromCharCode(55296|s>>10,56320|1023&s)}else n+=String.fromCharCode(i)}return n}function it(e,t,r){if(A(t%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!"),A("number"==typeof r,"stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===r&&(r=2147483647),r<4)return 0;for(var n=t,i=n+r-4,s=0;s=55296&&o<=57343&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++s)),w[t>>2]=o,(t+=4)+4>i)break}return w[t>>2]=0,t-n}function st(e){for(var t=0,r=0;r=55296&&n<=57343&&++r,t+=4}return t}function ot(e){try{return h.grow(e-y.byteLength+65535>>>16),P(h.buffer),1}catch(t){p("emscripten_realloc_buffer: Attempted to grow heap from "+y.byteLength+" bytes to "+e+" bytes, but got error: "+t)}}var at={};function lt(){if(!lt.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:a||"./this.program"};for(var t in at)void 0===at[t]?delete e[t]:e[t]=at[t];var r=[];for(var t in e)r.push(t+"="+e[t]);lt.strings=r}return lt.strings}var ct=[null,[],[]];function ut(e,t){var r=ct[e];A(r),0===t||10===t?((1===e?d:p)(T(r,0)),r.length=0):r.push(t)}function ht(e){return e%4==0&&(e%100!=0||e%400==0)}var dt=[31,29,31,30,31,30,31,31,30,31,30,31],pt=[31,28,31,30,31,30,31,31,30,31,30,31];function ft(e,t,r,n){var i=w[n+40>>2],s={tm_sec:w[n>>2],tm_min:w[n+4>>2],tm_hour:w[n+8>>2],tm_mday:w[n+12>>2],tm_mon:w[n+16>>2],tm_year:w[n+20>>2],tm_wday:w[n+24>>2],tm_yday:w[n+28>>2],tm_isdst:w[n+32>>2],tm_gmtoff:w[n+36>>2],tm_zone:i?I(i):""},o=I(r),a={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var l in a)o=o.replace(new RegExp(l,"g"),a[l]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],u=["January","February","March","April","May","June","July","August","September","October","November","December"];function h(e,t,r){for(var n="number"==typeof e?e.toString():e||"";n.length0?1:0}var n;return 0===(n=r(e.getFullYear()-t.getFullYear()))&&0===(n=r(e.getMonth()-t.getMonth()))&&(n=r(e.getDate()-t.getDate())),n}function f(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function m(e){var t=function(e,t){for(var r=new Date(e.getTime());t>0;){var n=ht(r.getFullYear()),i=r.getMonth(),s=(n?dt:pt)[i];if(!(t>s-r.getDate()))return r.setDate(r.getDate()+t),r;t-=s-r.getDate()+1,r.setDate(1),i<11?r.setMonth(i+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1))}return r}(new Date(e.tm_year+1900,0,1),e.tm_yday),r=new Date(t.getFullYear(),0,4),n=new Date(t.getFullYear()+1,0,4),i=f(r),s=f(n);return p(i,t)<=0?p(s,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var g={"%a":function(e){return c[e.tm_wday].substring(0,3)},"%A":function(e){return c[e.tm_wday]},"%b":function(e){return u[e.tm_mon].substring(0,3)},"%B":function(e){return u[e.tm_mon]},"%C":function(e){return d((e.tm_year+1900)/100|0,2)},"%d":function(e){return d(e.tm_mday,2)},"%e":function(e){return h(e.tm_mday,2," ")},"%g":function(e){return m(e).toString().substring(2)},"%G":function(e){return m(e)},"%H":function(e){return d(e.tm_hour,2)},"%I":function(e){var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),d(t,2)},"%j":function(e){return d(e.tm_mday+function(e,t){for(var r=0,n=0;n<=t;r+=e[n++]);return r}(ht(e.tm_year+1900)?dt:pt,e.tm_mon-1),3)},"%m":function(e){return d(e.tm_mon+1,2)},"%M":function(e){return d(e.tm_min,2)},"%n":function(){return"\n"},"%p":function(e){return e.tm_hour>=0&&e.tm_hour<12?"AM":"PM"},"%S":function(e){return d(e.tm_sec,2)},"%t":function(){return"\t"},"%u":function(e){return e.tm_wday||7},"%U":function(e){var t=e.tm_yday+7-e.tm_wday;return d(Math.floor(t/7),2)},"%V":function(e){var t=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&t++,t){if(53==t){var r=(e.tm_wday+371-e.tm_yday)%7;4==r||3==r&&ht(e.tm_year)||(t=1)}}else{t=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&ht(e.tm_year%400-1))&&t++}return d(t,2)},"%w":function(e){return e.tm_wday},"%W":function(e){var t=e.tm_yday+7-(e.tm_wday+6)%7;return d(Math.floor(t/7),2)},"%y":function(e){return(e.tm_year+1900).toString().substring(2)},"%Y":function(e){return e.tm_year+1900},"%z":function(e){var t=e.tm_gmtoff,r=t>=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(r?"+":"-")+String("0000"+t).slice(-4)},"%Z":function(e){return e.tm_zone},"%%":function(){return"%"}};for(var l in o=o.replace(/%%/g,"\0\0"),g)o.includes(l)&&(o=o.replace(new RegExp(l,"g"),g[l](s)));var y,x,_,b=(x=B(y=o=o.replace(/\0\0/g,"%"))+1,R(y,_=new Array(x),0,_.length),_);return b.length>t?0:(function(e,t){A(e.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),v.set(e,t)}(b,e),b.length-1)}!function(){for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);re=e}(),ue=i.BindingError=ce(Error,"BindingError"),de=i.InternalError=ce(Error,"InternalError"),Ie.prototype.isAliasOf=function(e){if(!(this instanceof Ie))return!1;if(!(e instanceof Ie))return!1;for(var t=this.$$.ptrType.registeredClass,r=this.$$.ptr,n=e.$$.ptrType.registeredClass,i=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)i=n.upcast(i),n=n.baseClass;return t===n&&r===i},Ie.prototype.clone=function(){if(this.$$.ptr||ge(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=Te(Object.create(Object.getPrototypeOf(this),{$$:{value:(e=this.$$,{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType})}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t},Ie.prototype.delete=function(){this.$$.ptr||ge(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&he("Object already scheduled for deletion"),ye(this),ve(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},Ie.prototype.isDeleted=function(){return!this.$$.ptr},Ie.prototype.deleteLater=function(){return this.$$.ptr||ge(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&he("Object already scheduled for deletion"),be.push(this),1===be.length&&Ee&&Ee(we),this.$$.deleteScheduled=!0,this},i.getInheritedInstanceCount=function(){return Object.keys(Me).length},i.getLiveInheritedInstances=function(){var e=[];for(var t in Me)Me.hasOwnProperty(t)&&e.push(Me[t]);return e},i.flushPendingDeletes=we,i.setDelayFunction=function(e){Ee=e,be.length&&Ee&&Ee(we)},Ue.prototype.getPointee=function(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},Ue.prototype.destructor=function(e){this.rawDestructor&&this.rawDestructor(e)},Ue.prototype.argPackAdvance=8,Ue.prototype.readValueFromPointer=Ne,Ue.prototype.deleteObject=function(e){null!==e&&e.delete()},Ue.prototype.fromWireType=Ce,Ge=i.UnboundTypeError=ce(Error,"UnboundTypeError"),i.count_emval_handles=function(){for(var e=0,t=5;t>s])},destructorFunction:null})},_embind_register_class:function(e,t,r,n,s,o,a,l,c,u,h,d,p){h=ne(h),o=ze(s,o),l&&(l=ze(a,l)),u&&(u=ze(c,u)),p=ze(d,p);var f=ae(h);!function(e,t,r){i.hasOwnProperty(e)?(he("Cannot register public name '"+e+"' twice"),Re(i,e,e),i.hasOwnProperty(r)&&he("Cannot register multiple overloads of a function with the same number of arguments ("+r+")!"),i[e].overloadTable[void 0]=t):i[e]=t}(f,(function(){Ve("Cannot construct "+h+" due to unbound types",[n])})),fe([e,t,r],n?[n]:[],(function(t){var r,s;t=t[0],s=n?(r=t.registeredClass).instancePrototype:Ie.prototype;var a=le(f,(function(){if(Object.getPrototypeOf(this)!==c)throw new ue("Use 'new' to construct "+h);if(void 0===d.constructor_body)throw new ue(h+" has no accessible constructor");var e=d.constructor_body[arguments.length];if(void 0===e)throw new ue("Tried to invoke ctor of "+h+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(d.constructor_body).toString()+") parameters instead!");return e.apply(this,arguments)})),c=Object.create(s,{constructor:{value:a}});a.prototype=c;var d=new Be(h,a,c,p,r,o,l,u),m=new Ue(h,d,!0,!1,!1),g=new Ue(h+"*",d,!1,!1,!1),A=new Ue(h+" const*",d,!1,!0,!1);return _e[e]={pointerType:g,constPointerType:A},function(e,t,r){i.hasOwnProperty(e)||pe("Replacing nonexistant public symbol"),i[e].overloadTable,i[e]=t,i[e].argCount=r}(f,a),[m,g,A]}))},_embind_register_class_constructor:function(e,t,r,n,i,s){A(t>0);var o=He(t,r);i=ze(n,i),fe([],[e],(function(e){var r="constructor "+(e=e[0]).name;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[t-1])throw new ue("Cannot register multiple constructors with identical number of parameters ("+(t-1)+") for class '"+e.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return e.registeredClass.constructor_body[t-1]=()=>{Ve("Cannot construct "+e.name+" due to unbound types",o)},fe([],o,(function(n){return n.splice(1,0,null),e.registeredClass.constructor_body[t-1]=qe(r,n,null,i,s),[]})),[]}))},_embind_register_class_function:function(e,t,r,n,i,s,o,a){var l=He(r,n);t=ne(t),s=ze(i,s),fe([],[e],(function(e){var n=(e=e[0]).name+"."+t;function i(){Ve("Cannot call "+n+" due to unbound types",l)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),a&&e.registeredClass.pureVirtualFunctions.push(t);var c=e.registeredClass.instancePrototype,u=c[t];return void 0===u||void 0===u.overloadTable&&u.className!==e.name&&u.argCount===r-2?(i.argCount=r-2,i.className=e.name,c[t]=i):(Re(c,t,n),c[t].overloadTable[r-2]=i),fe([],l,(function(i){var a=qe(n,i,e,s,o);return void 0===c[t].overloadTable?(a.argCount=r-2,c[t]=a):c[t].overloadTable[r-2]=a,[]})),[]}))},_embind_register_emval:function(e,t){me(e,{name:t=ne(t),fromWireType:function(e){var t=Xe.toValue(e);return function(e){e>4&&0==--Ye[e].refcount&&(Ye[e]=void 0,We.push(e))}(e),t},toWireType:function(e,t){return Xe.toHandle(t)},argPackAdvance:8,readValueFromPointer:Ne,destructorFunction:null})},_embind_register_float:function(e,t,r){var n=te(r);me(e,{name:t=ne(t),fromWireType:function(e){return e},toWireType:function(e,t){if("number"!=typeof t&&"boolean"!=typeof t)throw new TypeError('Cannot convert "'+Ke(t)+'" to '+this.name);return t},argPackAdvance:8,readValueFromPointer:$e(t,n),destructorFunction:null})},_embind_register_integer:function(e,t,r,n,i){t=ne(t),-1===i&&(i=4294967295);var s=te(r),o=e=>e;if(0===n){var a=32-8*r;o=e=>e<>>a}var l=t.includes("unsigned"),c=(e,r)=>{if("number"!=typeof e&&"boolean"!=typeof e)throw new TypeError('Cannot convert "'+Ke(e)+'" to '+r);if(ei)throw new TypeError('Passing a number "'+Ke(e)+'" from JS side to C/C++ side to an argument of type "'+t+'", which is outside the valid range ['+n+", "+i+"]!")};me(e,{name:t,fromWireType:o,toWireType:l?function(e,t){return c(t,this.name),t>>>0}:function(e,t){return c(t,this.name),t},argPackAdvance:8,readValueFromPointer:Je(t,s,0!==n),destructorFunction:null})},_embind_register_memory_view:function(e,t,r){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];function i(e){var t=E,r=t[e>>=2],i=t[e+1];return new n(y,i,r)}me(e,{name:r=ne(r),fromWireType:i,argPackAdvance:8,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})},_embind_register_std_string:function(e,t){var r="std::string"===(t=ne(t));me(e,{name:t,fromWireType:function(e){var t,n=E[e>>2],i=e+4;if(r)for(var s=i,o=0;o<=n;++o){var a=i+o;if(o==n||0==x[a]){var l=I(s,a-s);void 0===t?t=l:(t+=String.fromCharCode(0),t+=l),s=a+1}}else{var c=new Array(n);for(o=0;o>2]=n,r&&i)s=t,o=c,A("number"==typeof(a=n+1),"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),R(s,x,o,a);else if(i)for(var u=0;u255&&(yt(c),he("String has UTF-16 code units that do not fit in 8 bits")),x[c+u]=h}else for(u=0;ub,a=1):4===t&&(n=nt,i=it,o=st,s=()=>E,a=2),me(e,{name:r,fromWireType:function(e){for(var r,i=E[e>>2],o=s(),l=e+4,c=0;c<=i;++c){var u=e+4+c*t;if(c==i||0==o[u>>a]){var h=n(l,u-l);void 0===r?r=h:(r+=String.fromCharCode(0),r+=h),l=u+t}}return yt(e),r},toWireType:function(e,n){"string"!=typeof n&&he("Cannot pass non-string to C++ string type "+r);var s=o(n),l=At(4+s+t);return E[l>>2]=s>>a,i(n,l+4,s+t),null!==e&&e.push(yt,l),l},argPackAdvance:8,readValueFromPointer:Ne,destructorFunction:function(e){yt(e)}})},_embind_register_void:function(e,t){me(e,{isVoid:!0,name:t=ne(t),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,t){}})},abort:function(){j("native code called abort()")},emscripten_memcpy_big:function(e,t,r){x.copyWithin(e,t,t+r)},emscripten_resize_heap:function(e){var t=x.length;A((e>>>=0)>t);var r,n=2147483648;if(e>n)return p("Cannot enlarge memory, asked to go up to "+e+" bytes, but the limit is "+n+" bytes!"),!1;for(var i=1;i<=4;i*=2){var s=t*(1+.2/i);s=Math.min(s,e+100663296);var o=Math.min(n,(r=Math.max(e,s))+(65536-r%65536)%65536);if(ot(o))return!0}return p("Failed to grow the heap from "+t+" bytes to "+o+" bytes, not enough memory!"),!1},environ_get:function(e,t){var r=0;return lt().forEach((function(n,i){var s=t+r;E[e+4*i>>2]=s,function(e,t){for(var r=0;r>2]=r.length;var n=0;return r.forEach((function(e){n+=e.length+1})),E[t>>2]=n,0},fd_close:function(e){j("fd_close called without SYSCALLS_REQUIRE_FILESYSTEM")},fd_seek:function(e,t,r,n,i){return 70},fd_write:function(e,t,r,n){for(var i=0,s=0;s>2],a=E[t+4>>2];t+=8;for(var l=0;l>2]=i,0},strftime_l:function(e,t,r,n){return ft(e,t,r,n)}},At=(function(){var e,t={env:gt,wasi_snapshot_preview1:gt};function r(e,t){var r,n=e.exports;i.asm=n,A(h=i.asm.memory,"memory not found in wasm exports"),P(h.buffer),A(D=i.asm.__indirect_function_table,"table not found in wasm exports"),r=i.asm.__wasm_call_ctors,F.unshift(r),function(e){if(G--,i.monitorRunDependencies&&i.monitorRunDependencies(G),e?(A(H[e]),delete H[e]):p("warning: run dependency removed without ID"),0==G&&(null!==Q&&(clearInterval(Q),Q=null),V)){var t=V;V=null,t()}}("wasm-instantiate")}e="wasm-instantiate",G++,i.monitorRunDependencies&&i.monitorRunDependencies(G),e?(A(!H[e]),H[e]=1,null===Q&&"undefined"!=typeof setInterval&&(Q=setInterval((function(){if(g)return clearInterval(Q),void(Q=null);var e=!1;for(var t in H)e||(e=!0,p("still waiting on run dependencies:")),p("dependency: "+t);e&&p("(end of list)")}),1e4))):p("warning: run dependency added without ID");var s=i;function o(e){A(i===s,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),s=null,r(e.instance)}function a(e){return(u||"function"!=typeof fetch?Promise.resolve().then((function(){return $(q)})):fetch(q,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+q+"'";return e.arrayBuffer()})).catch((function(){return $(q)}))).then((function(e){return WebAssembly.instantiate(e,t)})).then((function(e){return e})).then(e,(function(e){p("failed to asynchronously prepare wasm: "+e),q.startsWith("file://")&&p("warning: Loading from a file URI ("+q+") is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing"),j(e)}))}if(i.instantiateWasm)try{return i.instantiateWasm(t,r)}catch(e){return p("Module.instantiateWasm callback failed with error: "+e),!1}(u||"function"!=typeof WebAssembly.instantiateStreaming||X(q)||"function"!=typeof fetch?a(o):fetch(q,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,t).then(o,(function(e){return p("wasm streaming compile failed: "+e),p("falling back to ArrayBuffer instantiation"),a(o)}))}))).catch(n)}(),i.___wasm_call_ctors=K("__wasm_call_ctors"),i._malloc=K("malloc")),yt=i._free=K("free"),vt=i.___getTypeName=K("__getTypeName"),xt=(i.__embind_initialize_bindings=K("_embind_initialize_bindings"),i.___errno_location=K("__errno_location"),i._fflush=K("fflush"),i._emscripten_stack_init=function(){return(xt=i._emscripten_stack_init=i.asm.emscripten_stack_init).apply(null,arguments)}),_t=(i._emscripten_stack_get_free=function(){return(i._emscripten_stack_get_free=i.asm.emscripten_stack_get_free).apply(null,arguments)},i._emscripten_stack_get_base=function(){return(i._emscripten_stack_get_base=i.asm.emscripten_stack_get_base).apply(null,arguments)},i._emscripten_stack_get_end=function(){return(_t=i._emscripten_stack_get_end=i.asm.emscripten_stack_get_end).apply(null,arguments)}),bt=(i.stackSave=K("stackSave"),i.stackRestore=K("stackRestore"),i.stackAlloc=K("stackAlloc"),i.___cxa_is_pointer_type=K("__cxa_is_pointer_type"));function wt(e){function t(){mt||(mt=!0,i.calledRun=!0,g||(A(!z),z=!0,N(),J(F),r(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),A(!i._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(N(),i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)e=i.postRun.shift(),k.unshift(e);var e;J(k)}()))}var n;e=e||o,G>0||(xt(),A(!(3&(n=_t()))),E[n>>2]=34821223,E[n+4>>2]=2310721022,E[0]=1668509029,function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)e=i.preRun.shift(),U.unshift(e);var e;J(U)}(),G>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),t()}),1)):t(),N()))}if(i.dynCall_viijii=K("dynCall_viijii"),i.dynCall_ji=K("dynCall_ji"),i.dynCall_jiji=K("dynCall_jiji"),i.dynCall_iiiiij=K("dynCall_iiiiij"),i.dynCall_iiiiijj=K("dynCall_iiiiijj"),i.dynCall_iiiiiijj=K("dynCall_iiiiiijj"),["run","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","addOnPreRun","addOnInit","addOnPreMain","addOnExit","addOnPostRun","addRunDependency","removeRunDependency","FS_createFolder","FS_createPath","FS_createDataFile","FS_createPreloadedFile","FS_createLazyFile","FS_createLink","FS_createDevice","FS_unlink","getLEB","getFunctionTables","alignFunctionTables","registerFunctions","prettyPrint","getCompilerSetting","print","printErr","callMain","abort","keepRuntimeAlive","wasmMemory","stackAlloc","stackSave","stackRestore","getTempRet0","setTempRet0","writeStackCookie","checkStackCookie","ptrToString","zeroMemory","stringToNewUTF8","exitJS","getHeapMax","emscripten_realloc_buffer","ENV","ERRNO_CODES","ERRNO_MESSAGES","setErrNo","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","DNS","getHostByName","Protocols","Sockets","getRandomDevice","warnOnce","traverseStack","UNWIND_CACHE","convertPCtoSourceLocation","readAsmConstArgsArray","readAsmConstArgs","mainThreadEM_ASM","jstoi_q","jstoi_s","getExecutableName","listenOnce","autoResumeAudioContext","dynCallLegacy","getDynCaller","dynCall","handleException","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","safeSetTimeout","asmjsMangle","asyncLoad","alignMemory","mmapAlloc","writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","convertI32PairToI53","convertI32PairToI53Checked","convertU32PairToI53","getCFunc","ccall","cwrap","uleb128Encode","sigToWasmTypes","convertJsFunctionToWasm","freeTableIndexes","functionsInTableMap","getEmptyTableSlot","updateTableMap","addFunction","removeFunction","reallyNegative","unSign","strLen","reSign","formatString","setValue","getValue","PATH","PATH_FS","intArrayFromString","intArrayToString","AsciiToString","stringToAscii","UTF16Decoder","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","allocateUTF8","allocateUTF8OnStack","writeStringToMemory","writeArrayToMemory","writeAsciiToMemory","SYSCALLS","getSocketFromFD","getSocketAddress","JSEvents","registerKeyEventCallback","specialHTMLTargets","maybeCStringToJsString","findEventTarget","findCanvasEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","currentFullscreenStrategy","restoreOldWindowedStyle","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","demangle","demangleAll","jsStackTrace","stackTrace","ExitStatus","getEnvStrings","checkWasiClock","flush_NO_FILESYSTEM","dlopenMissingError","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","uncaughtExceptionCount","exceptionLast","exceptionCaught","ExceptionInfo","exception_addRef","exception_decRef","Browser","setMainLoop","wget","FS","MEMFS","TTY","PIPEFS","SOCKFS","_setNetworkCallback","tempFixedLengthArray","miniTempWebGLFloatBuffers","heapObjectForWebGLType","heapAccessShiftForWebGLHeap","GL","emscriptenWebGLGet","computeUnpackAlignedImageSize","emscriptenWebGLGetTexPixelData","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","writeGLArray","AL","SDL_unicode","SDL_ttfContext","SDL_audio","SDL","SDL_gfx","GLUT","EGL","GLFW_Window","GLFW","GLEW","IDBStore","runAndAbortIfError","ALLOC_NORMAL","ALLOC_STACK","allocate","InternalError","BindingError","UnboundTypeError","PureVirtualError","init_embind","throwInternalError","throwBindingError","throwUnboundTypeError","ensureOverloadTable","exposePublicSymbol","replacePublicSymbol","extendError","createNamedFunction","embindRepr","registeredInstances","getBasestPointer","registerInheritedInstance","unregisterInheritedInstance","getInheritedInstance","getInheritedInstanceCount","getLiveInheritedInstances","registeredTypes","awaitingDependencies","typeDependencies","registeredPointers","registerType","whenDependentTypesAreResolved","embind_charCodes","embind_init_charCodes","readLatin1String","getTypeName","heap32VectorToArray","requireRegisteredType","getShiftFromSize","integerReadValueFromPointer","enumReadValueFromPointer","floatReadValueFromPointer","simpleReadValueFromPointer","runDestructors","new_","craftInvokerFunction","embind__requireFunction","tupleRegistrations","structRegistrations","genericPointerToWireType","constNoSmartPtrRawPointerToWireType","nonConstNoSmartPtrRawPointerToWireType","init_RegisteredPointer","RegisteredPointer","RegisteredPointer_getPointee","RegisteredPointer_destructor","RegisteredPointer_deleteObject","RegisteredPointer_fromWireType","runDestructor","releaseClassHandle","finalizationRegistry","detachFinalizer_deps","detachFinalizer","attachFinalizer","makeClassHandle","init_ClassHandle","ClassHandle","ClassHandle_isAliasOf","throwInstanceAlreadyDeleted","ClassHandle_clone","ClassHandle_delete","deletionQueue","ClassHandle_isDeleted","ClassHandle_deleteLater","flushPendingDeletes","delayFunction","setDelayFunction","RegisteredClass","shallowCopyInternalPointer","downcastPointer","upcastPointer","validateThis","char_0","char_9","makeLegalFunctionName","emval_handle_array","emval_free_list","emval_symbols","init_emval","count_emval_handles","get_first_emval","getStringOrSymbol","Emval","emval_newers","craftEmvalAllocator","emval_get_global","emval_lookupTypes","emval_allocateDestructors","emval_methodCallers","emval_addMethodCaller","emval_registeredMethods"].forEach((function(e){Object.getOwnPropertyDescriptor(i,e)||Object.defineProperty(i,e,{configurable:!0,get:function(){var t="'"+e+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";m(e)&&(t+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),j(t)}})})),["ptrToString","zeroMemory","stringToNewUTF8","exitJS","setErrNo","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","getHostByName","getRandomDevice","traverseStack","convertPCtoSourceLocation","readAsmConstArgs","mainThreadEM_ASM","jstoi_q","jstoi_s","listenOnce","autoResumeAudioContext","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","safeSetTimeout","asmjsMangle","asyncLoad","alignMemory","mmapAlloc","writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","convertI32PairToI53","convertU32PairToI53","reallyNegative","unSign","strLen","reSign","formatString","getSocketFromFD","getSocketAddress","registerKeyEventCallback","maybeCStringToJsString","findEventTarget","findCanvasEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","checkWasiClock","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","exception_addRef","exception_decRef","setMainLoop","_setNetworkCallback","heapObjectForWebGLType","heapAccessShiftForWebGLHeap","emscriptenWebGLGet","computeUnpackAlignedImageSize","emscriptenWebGLGetTexPixelData","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","writeGLArray","SDL_unicode","SDL_ttfContext","SDL_audio","GLFW_Window","runAndAbortIfError","registerInheritedInstance","unregisterInheritedInstance","requireRegisteredType","enumReadValueFromPointer","validateThis","getStringOrSymbol","craftEmvalAllocator","emval_get_global","emval_lookupTypes","emval_allocateDestructors","emval_addMethodCaller"].forEach((function(e){"undefined"==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,e)||Object.defineProperty(globalThis,e,{configurable:!0,get:function(){var t="`"+e+"` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line";m(e)&&(t+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),Z(t)}})})),V=function e(){mt||wt(),mt||(V=e)},i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return wt(),e.ready});e.exports=r},6585:e=>{var t=1e3,r=60*t,n=60*r,i=24*n,s=7*i;function o(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}e.exports=function(e,a){a=a||{};var l,c,u=typeof e;if("string"===u&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(o){var a=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*a;case"weeks":case"week":case"w":return a*s;case"days":case"day":case"d":return a*i;case"hours":case"hour":case"hrs":case"hr":case"h":return a*n;case"minutes":case"minute":case"mins":case"min":case"m":return a*r;case"seconds":case"second":case"secs":case"sec":case"s":return a*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}(e);if("number"===u&&isFinite(e))return a.long?(l=e,(c=Math.abs(l))>=i?o(l,c,i,"day"):c>=n?o(l,c,n,"hour"):c>=r?o(l,c,r,"minute"):c>=t?o(l,c,t,"second"):l+" ms"):function(e){var s=Math.abs(e);return s>=i?Math.round(e/i)+"d":s>=n?Math.round(e/n)+"h":s>=r?Math.round(e/r)+"m":s>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},54527:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Observable:()=>_,Subject:()=>T,filter:()=>w,flatMap:()=>E,interval:()=>M,map:()=>S,merge:()=>C,multicast:()=>I,scan:()=>R,unsubscribe:()=>b});class n{constructor(e){this._baseObserver=e,this._pendingPromises=new Set}complete(){Promise.all(this._pendingPromises).then((()=>this._baseObserver.complete())).catch((e=>this._baseObserver.error(e)))}error(e){this._baseObserver.error(e)}schedule(e){const t=Promise.all(this._pendingPromises),r=[],n=e=>r.push(e),i=Promise.resolve().then((()=>{return s=this,o=void 0,l=function*(){yield t,yield e(n),this._pendingPromises.delete(i);for(const e of r)this._baseObserver.next(e)},new((a=void 0)||(a=Promise))((function(e,t){function r(e){try{i(l.next(e))}catch(e){t(e)}}function n(e){try{i(l.throw(e))}catch(e){t(e)}}function i(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(r,n)}i((l=l.apply(s,o||[])).next())}));var s,o,a,l})).catch((e=>{this._pendingPromises.delete(i),this._baseObserver.error(e)}));this._pendingPromises.add(i)}}const i=()=>"function"==typeof Symbol,s=e=>i()&&Boolean(Symbol[e]),o=e=>s(e)?Symbol[e]:"@@"+e;s("asyncIterator")||(Symbol.asyncIterator=Symbol.asyncIterator||Symbol.for("Symbol.asyncIterator"));const a=o("iterator"),l=o("observable"),c=o("species");function u(e,t){const r=e[t];if(null!=r){if("function"!=typeof r)throw new TypeError(r+" is not a function");return r}}function h(e){let t=e.constructor;return void 0!==t&&(t=t[c],null===t&&(t=void 0)),void 0!==t?t:x}function d(e){d.log?d.log(e):setTimeout((()=>{throw e}),0)}function p(e){Promise.resolve().then((()=>{try{e()}catch(e){d(e)}}))}function f(e){const t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{const e=u(t,"unsubscribe");e&&e.call(t)}}catch(e){d(e)}}function m(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function g(e,t,r){e._state="running";const n=e._observer;try{const i=n?u(n,t):void 0;switch(t){case"next":i&&i.call(n,r);break;case"error":if(m(e),!i)throw r;i.call(n,r);break;case"complete":m(e),i&&i.call(n)}}catch(e){d(e)}"closed"===e._state?f(e):"running"===e._state&&(e._state="ready")}function A(e,t,r){if("closed"!==e._state)return"buffering"===e._state?(e._queue=e._queue||[],void e._queue.push({type:t,value:r})):"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:r}],void p((()=>function(e){const t=e._queue;if(t){e._queue=void 0,e._state="ready";for(const r of t)if(g(e,r.type,r.value),"closed"===e._state)break}}(e)))):void g(e,t,r)}class y{constructor(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";const r=new v(this);try{this._cleanup=t.call(void 0,r)}catch(e){r.error(e)}"initializing"===this._state&&(this._state="ready")}get closed(){return"closed"===this._state}unsubscribe(){"closed"!==this._state&&(m(this),f(this))}}class v{constructor(e){this._subscription=e}get closed(){return"closed"===this._subscription._state}next(e){A(this._subscription,"next",e)}error(e){A(this._subscription,"error",e)}complete(){A(this._subscription,"complete")}}class x{constructor(e){if(!(this instanceof x))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof e)throw new TypeError("Observable initializer must be a function");this._subscriber=e}subscribe(e,t,r){return"object"==typeof e&&null!==e||(e={next:e,error:t,complete:r}),new y(e,this._subscriber)}pipe(e,...t){let r=this;for(const n of[e,...t])r=n(r);return r}tap(e,t,r){const n="object"!=typeof e||null===e?{next:e,error:t,complete:r}:e;return new x((e=>this.subscribe({next(t){n.next&&n.next(t),e.next(t)},error(t){n.error&&n.error(t),e.error(t)},complete(){n.complete&&n.complete(),e.complete()},start(e){n.start&&n.start(e)}})))}forEach(e){return new Promise(((t,r)=>{if("function"!=typeof e)return void r(new TypeError(e+" is not a function"));function n(){i.unsubscribe(),t(void 0)}const i=this.subscribe({next(t){try{e(t,n)}catch(e){r(e),i.unsubscribe()}},error(e){r(e)},complete(){t(void 0)}})}))}map(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(h(this))((t=>this.subscribe({next(r){let n=r;try{n=e(r)}catch(e){return t.error(e)}t.next(n)},error(e){t.error(e)},complete(){t.complete()}})))}filter(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(h(this))((t=>this.subscribe({next(r){try{if(!e(r))return}catch(e){return t.error(e)}t.next(r)},error(e){t.error(e)},complete(){t.complete()}})))}reduce(e,t){if("function"!=typeof e)throw new TypeError(e+" is not a function");const r=h(this),n=arguments.length>1;let i=!1,s=t;return new r((t=>this.subscribe({next(r){const o=!i;if(i=!0,!o||n)try{s=e(s,r)}catch(e){return t.error(e)}else s=r},error(e){t.error(e)},complete(){if(!i&&!n)return t.error(new TypeError("Cannot reduce an empty sequence"));t.next(s),t.complete()}})))}concat(...e){const t=h(this);return new t((r=>{let n,i=0;return function s(o){n=o.subscribe({next(e){r.next(e)},error(e){r.error(e)},complete(){i===e.length?(n=void 0,r.complete()):s(t.from(e[i++]))}})}(this),()=>{n&&(n.unsubscribe(),n=void 0)}}))}flatMap(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");const t=h(this);return new t((r=>{const n=[],i=this.subscribe({next(i){let o;if(e)try{o=e(i)}catch(e){return r.error(e)}else o=i;const a=t.from(o).subscribe({next(e){r.next(e)},error(e){r.error(e)},complete(){const e=n.indexOf(a);e>=0&&n.splice(e,1),s()}});n.push(a)},error(e){r.error(e)},complete(){s()}});function s(){i.closed&&0===n.length&&r.complete()}return()=>{n.forEach((e=>e.unsubscribe())),i.unsubscribe()}}))}[(Symbol.observable,l)](){return this}static from(e){const t="function"==typeof this?this:x;if(null==e)throw new TypeError(e+" is not an object");const r=u(e,l);if(r){const n=r.call(e);if(Object(n)!==n)throw new TypeError(n+" is not an object");return function(e){return e instanceof x}(n)&&n.constructor===t?n:new t((e=>n.subscribe(e)))}if(s("iterator")){const r=u(e,a);if(r)return new t((t=>{p((()=>{if(!t.closed){for(const n of r.call(e))if(t.next(n),t.closed)return;t.complete()}}))}))}if(Array.isArray(e))return new t((t=>{p((()=>{if(!t.closed){for(const r of e)if(t.next(r),t.closed)return;t.complete()}}))}));throw new TypeError(e+" is not observable")}static of(...e){return new("function"==typeof this?this:x)((t=>{p((()=>{if(!t.closed){for(const r of e)if(t.next(r),t.closed)return;t.complete()}}))}))}static get[c](){return this}}i()&&Object.defineProperty(x,Symbol("extensions"),{value:{symbol:l,hostReportError:d},configurable:!0});const _=x,b=function(e){"function"==typeof e?e():e&&"function"==typeof e.unsubscribe&&e.unsubscribe()};const w=function(e){return t=>new _((r=>{const i=new n(r),s=t.subscribe({complete(){i.complete()},error(e){i.error(e)},next(t){i.schedule((r=>{return n=this,i=void 0,o=function*(){(yield e(t))&&r(t)},new((s=void 0)||(s=Promise))((function(e,t){function r(e){try{l(o.next(e))}catch(e){t(e)}}function a(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof s?n:new s((function(e){e(n)}))).then(r,a)}l((o=o.apply(n,i||[])).next())}));var n,i,s,o}))}});return()=>b(s)}))};const E=function(e){return t=>new _((r=>{const i=new n(r),o=t.subscribe({complete(){i.complete()},error(e){i.error(e)},next(t){i.schedule((r=>{return n=this,i=void 0,a=function*(){var n,i;const o=yield e(t);if((c=o)&&s("iterator")&&c[Symbol.iterator]||function(e){return e&&s("asyncIterator")&&e[Symbol.asyncIterator]}(o))try{for(var a,l=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){!function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)}(n,i,(t=e[r](t)).done,t.value)}))}}}(o);!(a=yield l.next()).done;){const e=a.value;r(e)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=l.return)&&(yield i.call(l))}finally{if(n)throw n.error}}else o.map((e=>r(e)));var c},new((o=void 0)||(o=Promise))((function(e,t){function r(e){try{l(a.next(e))}catch(e){t(e)}}function s(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(r,s)}l((a=a.apply(n,i||[])).next())}));var n,i,o,a}))}});return()=>b(o)}))};function M(e){return new x((t=>{let r=0;const n=setInterval((()=>{t.next(r++)}),e);return()=>clearInterval(n)}))}const S=function(e){return t=>new _((r=>{const i=new n(r),s=t.subscribe({complete(){i.complete()},error(e){i.error(e)},next(t){i.schedule((r=>{return n=this,i=void 0,o=function*(){const n=yield e(t);r(n)},new((s=void 0)||(s=Promise))((function(e,t){function r(e){try{l(o.next(e))}catch(e){t(e)}}function a(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof s?n:new s((function(e){e(n)}))).then(r,a)}l((o=o.apply(n,i||[])).next())}));var n,i,s,o}))}});return()=>b(s)}))},C=function(...e){return 0===e.length?x.from([]):new x((t=>{let r=0;const n=e.map((n=>n.subscribe({error(e){t.error(e),i()},next(e){t.next(e)},complete(){++r===e.length&&(t.complete(),i())}}))),i=()=>{n.forEach((e=>b(e)))};return i}))},T=class extends _{constructor(){super((e=>(this._observers.add(e),()=>this._observers.delete(e)))),this._observers=new Set}next(e){for(const t of this._observers)t.next(e)}error(e){for(const t of this._observers)t.error(e)}complete(){for(const e of this._observers)e.complete()}},I=function(e){const t=new T;let r,n=0;return new _((i=>{r||(r=e.subscribe(t));const s=t.subscribe(i);return n++,()=>{n--,s.unsubscribe(),0===n&&(b(r),r=void 0)}}))};const R=function(e,t){return r=>new _((i=>{let s,o=0;const a=new n(i),l=r.subscribe({complete(){a.complete()},error(e){a.error(e)},next(r){a.schedule((n=>{return i=this,a=void 0,c=function*(){const i=0===o?void 0===t?r:t:s;s=yield e(i,r,o++),n(s)},new((l=void 0)||(l=Promise))((function(e,t){function r(e){try{s(c.next(e))}catch(e){t(e)}}function n(e){try{s(c.throw(e))}catch(e){t(e)}}function s(t){var i;t.done?e(t.value):(i=t.value,i instanceof l?i:new l((function(e){e(i)}))).then(r,n)}s((c=c.apply(i,a||[])).next())}));var i,a,l,c}))}});return()=>b(l)}))}},68721:(e,t,r)=>{"use strict";r.d(t,{A:()=>er});var n=6378137,i=.0066943799901413165,s=484813681109536e-20,o=Math.PI/2,a=1e-10,l=.017453292519943295,c=57.29577951308232,u=Math.PI/4,h=2*Math.PI,d=3.14159265359,p={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667};const f={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}};var m=/[\s_\-\/\(\)]/g;function g(e,t){if(e[t])return e[t];for(var r,n=Object.keys(e),i=t.toLowerCase().replace(m,""),s=-1;++s0?90:-90)):(e.lat0=C(e.lat1>0?90:-90),e.lat_ts=e.lat1)}(i),i}function I(e){var t=this;if(2===arguments.length){var r=arguments[1];"string"==typeof r?"+"===r.charAt(0)?I[e]=A(arguments[1]):I[e]=T(arguments[1]):I[e]=r}else if(1===arguments.length){if(Array.isArray(e))return e.map((function(e){Array.isArray(e)?I.apply(t,e):I(e)}));if("string"==typeof e){if(e in I)return I[e]}else"EPSG"in e?I["EPSG:"+e.EPSG]=e:"ESRI"in e?I["ESRI:"+e.ESRI]=e:"IAU2000"in e?I["IAU2000:"+e.IAU2000]=e:console.log(e);return}}E.prototype.readCharicter=function(){var e=this.text[this.place++];if(4!==this.state)for(;v.test(e);){if(this.place>=this.text.length)return;e=this.text[this.place++]}switch(this.state){case y:return this.neutral(e);case 2:return this.keyword(e);case 4:return this.quoted(e);case 5:return this.afterquote(e);case 3:return this.number(e);case-1:return}},E.prototype.afterquote=function(e){if('"'===e)return this.word+='"',void(this.state=4);if(b.test(e))return this.word=this.word.trim(),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in afterquote yet, index '+this.place)},E.prototype.afterItem=function(e){return","===e?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=y)):"]"===e?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=y,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},E.prototype.number=function(e){if(!w.test(e)){if(b.test(e))return this.word=parseFloat(this.word),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in number yet, index '+this.place)}this.word+=e},E.prototype.quoted=function(e){'"'!==e?this.word+=e:this.state=5},E.prototype.keyword=function(e){if(_.test(e))this.word+=e;else{if("["===e){var t=[];return t.push(this.word),this.level++,null===this.root?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,void(this.state=y)}if(!b.test(e))throw new Error("havn't handled \""+e+'" in keyword yet, index '+this.place);this.afterItem(e)}},E.prototype.neutral=function(e){if(x.test(e))return this.word=e,void(this.state=2);if('"'===e)return this.word="",void(this.state=4);if(w.test(e))return this.word=e,void(this.state=3);if(!b.test(e))throw new Error("havn't handled \""+e+'" in neutral yet, index '+this.place);this.afterItem(e)},E.prototype.output=function(){for(;this.place90&&i*c<-90&&n*c>180&&n*c<-180)return null;if(Math.abs(Math.abs(i)-o)<=a)return null;if(this.sphere)t=this.x0+this.a*this.k0*N(n-this.long0),r=this.y0+this.a*this.k0*Math.log(Math.tan(u+.5*i));else{var s=Math.sin(i),l=U(this.e,i,s);t=this.x0+this.a*this.k0*N(n-this.long0),r=this.y0-this.a*this.k0*Math.log(l)}return e.x=t,e.y=r,e},inverse:function(e){var t,r,n=e.x-this.x0,i=e.y-this.y0;if(this.sphere)r=o-2*Math.atan(Math.exp(-i/(this.a*this.k0)));else{var s=Math.exp(-i/(this.a*this.k0));if(-9999===(r=F(this.e,s)))return null}return t=N(this.long0+n/(this.a*this.k0)),e.x=t,e.y=r,e},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:k,inverse:k,names:["longlat","identity"]}],G={},Q=[];function V(e,t){var r=Q.length;return e.names?(Q[r]=e,e.names.forEach((function(e){G[e.toLowerCase()]=r})),this):(console.log(t),!0)}const H={start:function(){z.forEach(V)},add:V,get:function(e){if(!e)return!1;var t=e.toLowerCase();return void 0!==G[t]&&Q[G[t]]?Q[G[t]]:void 0}};var j={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},q=j.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};j.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var W={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},militargeographische_institut:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}};var Y={};function X(e){if(0===e.length)return null;var t="@"===e[0];return t&&(e=e.slice(1)),"null"===e?{name:"null",mandatory:!t,grid:null,isNull:!0}:{name:e,mandatory:!t,grid:Y[e]||null,isNull:!1}}function K(e){return e/3600*Math.PI/180}function $(e,t,r){return String.fromCharCode.apply(null,new Uint8Array(e.buffer.slice(t,r)))}function J(e){return e.map((function(e){return[K(e.longitudeShift),K(e.latitudeShift)]}))}function Z(e,t,r){return{name:$(e,t+8,t+16).trim(),parent:$(e,t+24,t+24+8).trim(),lowerLatitude:e.getFloat64(t+72,r),upperLatitude:e.getFloat64(t+88,r),lowerLongitude:e.getFloat64(t+104,r),upperLongitude:e.getFloat64(t+120,r),latitudeInterval:e.getFloat64(t+136,r),longitudeInterval:e.getFloat64(t+152,r),gridNodeCount:e.getInt32(t+168,r)}}function ee(e,t,r,n){for(var i=t+176,s=[],o=0;o-1}))}(e)){var t=T(e);if(function(e){var t=g(e,"authority");if(t){var r=g(t,"epsg");return r&&P.indexOf(r)>-1}}(t))return R["EPSG:3857"];var r=function(e){var t=g(e,"extension");if(t)return g(t,"proj4")}(t);return r?A(r):t}return function(e){return"+"===e[0]}(e)?A(e):void 0}(e);if("object"==typeof r){var n=te.projections.get(r.projName);if(n){if(r.datumCode&&"none"!==r.datumCode){var i=g(W,r.datumCode);i&&(r.datum_params=r.datum_params||(i.towgs84?i.towgs84.split(","):null),r.ellps=i.ellipse,r.datumName=i.datumName?i.datumName:r.datumCode)}r.k0=r.k0||1,r.axis=r.axis||"enu",r.ellps=r.ellps||"wgs84",r.lat1=r.lat1||r.lat0;var o,l,c,u,h,d,p=function(e,t,r,n,i){if(!e){var s=g(j,n);s||(s=q),e=s.a,t=s.b,r=s.rf}return r&&!t&&(t=(1-1/r)*e),(0===r||Math.abs(e-t)3&&(0===l.datum_params[3]&&0===l.datum_params[4]&&0===l.datum_params[5]&&0===l.datum_params[6]||(l.datum_type=2,l.datum_params[3]*=s,l.datum_params[4]*=s,l.datum_params[5]*=s,l.datum_params[6]=l.datum_params[6]/1e6+1))),a&&(l.datum_type=3,l.grids=a),l.a=r,l.b=n,l.es=i,l.ep2=o,l}(r.datumCode,r.datum_params,p.a,p.b,f.es,f.ep2,m);L(this,r),L(this,n),this.a=p.a,this.b=p.b,this.rf=p.rf,this.sphere=p.sphere,this.es=f.es,this.e=f.e,this.ep2=f.ep2,this.datum=y,this.init(),t(null,this)}else t("Could not get projection name from: "+e)}else t("Could not parse to valid json: "+e)}te.projections=H,te.projections.start();const re=te;function ne(e,t,r){var n,i,s,a,l=e.x,c=e.y,u=e.z?e.z:0;if(c<-o&&c>-1.001*o)c=-o;else if(c>o&&c<1.001*o)c=o;else{if(c<-o)return{x:-1/0,y:-1/0,z:e.z};if(c>o)return{x:1/0,y:1/0,z:e.z}}return l>Math.PI&&(l-=2*Math.PI),i=Math.sin(c),a=Math.cos(c),s=i*i,{x:((n=r/Math.sqrt(1-t*s))+u)*a*Math.cos(l),y:(n+u)*a*Math.sin(l),z:(n*(1-t)+u)*i}}function ie(e,t,r,n){var i,s,o,a,l,c,u,h,d,p,f,m,g,A,y,v=e.x,x=e.y,_=e.z?e.z:0;if(i=Math.sqrt(v*v+x*x),s=Math.sqrt(v*v+x*x+_*_),i/r<1e-12){if(A=0,s/r<1e-12)return y=-n,{x:e.x,y:e.y,z:e.z}}else A=Math.atan2(x,v);o=_/s,h=(a=i/s)*(1-t)*(l=1/Math.sqrt(1-t*(2-t)*a*a)),d=o*l,g=0;do{g++,c=t*(u=r/Math.sqrt(1-t*d*d))/(u+(y=i*h+_*d-u*(1-t*d*d))),m=(f=o*(l=1/Math.sqrt(1-c*(2-c)*a*a)))*h-(p=a*(1-c)*l)*d,h=p,d=f}while(m*m>1e-24&&g<30);return{x:A,y:Math.atan(f/Math.abs(p)),z:y}}function se(e){return 1===e||2===e}function oe(e,t,r){if(null===e.grids||0===e.grids.length)return console.log("Grid shift grids not found"),-1;var n={x:-r.x,y:r.y},i={x:Number.NaN,y:Number.NaN},s=[];e:for(var o=0;on.y||f>n.x||A1e-12&&Math.abs(o.y)>1e-12);if(l<0)return console.log("Inverse grid shift iterator failed to converge."),n;n.x=N(s.x+r.ll[0]),n.y=s.y+r.ll[1]}else isNaN(s.x)||(n.x=e.x+s.x,n.y=e.y+s.y);return n}function le(e,t){var r,n={x:e.x/t.del[0],y:e.y/t.del[1]},i=Math.floor(n.x),s=Math.floor(n.y),o=n.x-1*i,a=n.y-1*s,l={x:Number.NaN,y:Number.NaN};if(i<0||i>=t.lim[0])return l;if(s<0||s>=t.lim[1])return l;r=s*t.lim[0]+i;var c=t.cvs[r][0],u=t.cvs[r][1];r++;var h=t.cvs[r][0],d=t.cvs[r][1];r+=t.lim[0];var p=t.cvs[r][0],f=t.cvs[r][1];r--;var m=t.cvs[r][0],g=t.cvs[r][1],A=o*a,y=o*(1-a),v=(1-o)*(1-a),x=(1-o)*a;return l.x=v*c+y*h+x*m+A*p,l.y=v*u+y*d+x*g+A*f,l}function ce(e,t,r){var n,i,s,o=r.x,a=r.y,l=r.z||0,c={};for(s=0;s<3;s++)if(!t||2!==s||void 0!==r.z)switch(0===s?(n=o,i=-1!=="ew".indexOf(e.axis[s])?"x":"y"):1===s?(n=a,i=-1!=="ns".indexOf(e.axis[s])?"y":"x"):(n=l,i="z"),e.axis[s]){case"e":case"n":c[i]=n;break;case"w":case"s":c[i]=-n;break;case"u":void 0!==r[i]&&(c.z=n);break;case"d":void 0!==r[i]&&(c.z=-n);break;default:return null}return c}function ue(e){var t={x:e[0],y:e[1]};return e.length>2&&(t.z=e[2]),e.length>3&&(t.m=e[3]),t}function he(e){if("function"==typeof Number.isFinite){if(Number.isFinite(e))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof e||e!=e||!isFinite(e))throw new TypeError("coordinates must be finite numbers")}function de(e,t,r,s){var o,a=void 0!==(r=Array.isArray(r)?ue(r):{x:r.x,y:r.y,z:r.z,m:r.m}).z;if(function(e){he(e.x),he(e.y)}(r),e.datum&&t.datum&&function(e,t){return(1===e.datum.datum_type||2===e.datum.datum_type||3===e.datum.datum_type)&&"WGS84"!==t.datumCode||(1===t.datum.datum_type||2===t.datum.datum_type||3===t.datum.datum_type)&&"WGS84"!==e.datumCode}(e,t)&&(r=de(e,o=new re("WGS84"),r,s),e=o),s&&"enu"!==e.axis&&(r=ce(e,!1,r)),"longlat"===e.projName)r={x:r.x*l,y:r.y*l,z:r.z||0};else if(e.to_meter&&(r={x:r.x*e.to_meter,y:r.y*e.to_meter,z:r.z||0}),!(r=e.inverse(r)))return;if(e.from_greenwich&&(r.x+=e.from_greenwich),r=function(e,t,r){if(function(e,t){return e.datum_type===t.datum_type&&!(e.a!==t.a||Math.abs(e.es-t.es)>5e-11)&&(1===e.datum_type?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]:2!==e.datum_type||e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]&&e.datum_params[3]===t.datum_params[3]&&e.datum_params[4]===t.datum_params[4]&&e.datum_params[5]===t.datum_params[5]&&e.datum_params[6]===t.datum_params[6])}(e,t))return r;if(5===e.datum_type||5===t.datum_type)return r;var s=e.a,o=e.es;if(3===e.datum_type){if(0!==oe(e,!1,r))return;s=n,o=i}var a=t.a,l=t.b,c=t.es;return 3===t.datum_type&&(a=n,l=6356752.314,c=i),o!==c||s!==a||se(e.datum_type)||se(t.datum_type)?(r=ne(r,o,s),se(e.datum_type)&&(r=function(e,t,r){if(1===t)return{x:e.x+r[0],y:e.y+r[1],z:e.z+r[2]};if(2===t){var n=r[0],i=r[1],s=r[2],o=r[3],a=r[4],l=r[5],c=r[6];return{x:c*(e.x-l*e.y+a*e.z)+n,y:c*(l*e.x+e.y-o*e.z)+i,z:c*(-a*e.x+o*e.y+e.z)+s}}}(r,e.datum_type,e.datum_params)),se(t.datum_type)&&(r=function(e,t,r){if(1===t)return{x:e.x-r[0],y:e.y-r[1],z:e.z-r[2]};if(2===t){var n=r[0],i=r[1],s=r[2],o=r[3],a=r[4],l=r[5],c=r[6],u=(e.x-n)/c,h=(e.y-i)/c,d=(e.z-s)/c;return{x:u+l*h-a*d,y:-l*u+h+o*d,z:a*u-o*h+d}}}(r,t.datum_type,t.datum_params)),r=ie(r,c,a,l),3!==t.datum_type||0===oe(t,!0,r)?r:void 0):r}(e.datum,t.datum,r))return t.from_greenwich&&(r={x:r.x-t.from_greenwich,y:r.y,z:r.z||0}),"longlat"===t.projName?r={x:r.x*c,y:r.y*c,z:r.z||0}:(r=t.forward(r),t.to_meter&&(r={x:r.x/t.to_meter,y:r.y/t.to_meter,z:r.z||0})),s&&"enu"!==t.axis?ce(t,!0,r):(r&&!a&&delete r.z,r)}var pe=re("WGS84");function fe(e,t,r,n){var i,s,o;return Array.isArray(r)?(i=de(e,t,r,n)||{x:NaN,y:NaN},r.length>2?void 0!==e.name&&"geocent"===e.name||void 0!==t.name&&"geocent"===t.name?"number"==typeof i.z?[i.x,i.y,i.z].concat(r.slice(3)):[i.x,i.y,r[2]].concat(r.slice(3)):[i.x,i.y].concat(r.slice(2)):[i.x,i.y]):(s=de(e,t,r,n),2===(o=Object.keys(r)).length||o.forEach((function(n){if(void 0!==e.name&&"geocent"===e.name||void 0!==t.name&&"geocent"===t.name){if("x"===n||"y"===n||"z"===n)return}else if("x"===n||"y"===n)return;s[n]=r[n]})),s)}function me(e){return e instanceof re?e:e.oProj?e.oProj:re(e)}const ge=function(e,t,r){e=me(e);var n,i=!1;return void 0===t?(t=e,e=pe,i=!0):(void 0!==t.x||Array.isArray(t))&&(r=t,t=e,e=pe,i=!0),t=me(t),r?fe(e,t,r):(n={forward:function(r,n){return fe(e,t,r,n)},inverse:function(r,n){return fe(t,e,r,n)}},i&&(n.oProj=t),n)};var Ae="AJSAJS",ye="AFAFAF",ve=65,xe=73,_e=79;const be={forward:we,inverse:function(e){var t=Ce(Ie(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat,t.lon,t.lat]:[t.left,t.bottom,t.right,t.top]},toPoint:Ee};function we(e,t){return t=t||5,function(e,t){var r,n,i,s,o,a,l,c,u,h,d,p="00000"+e.easting,f="00000"+e.northing;return e.zoneNumber+e.zoneLetter+(u=e.easting,h=e.northing,d=Te(e.zoneNumber),r=Math.floor(u/1e5),n=Math.floor(h/1e5)%20,s=Ae.charCodeAt(i=d-1),o=ye.charCodeAt(i),c=!1,(a=s+r-1)>90&&(a=a-90+ve-1,c=!0),(a===xe||sxe||(a>xe||s_e||(a>_e||s<_e)&&c)&&++a===xe&&a++,a>90&&(a=a-90+ve-1),(l=o+n)>86?(l=l-86+ve-1,c=!0):c=!1,(l===xe||oxe||(l>xe||o_e||(l>_e||o<_e)&&c)&&++l===xe&&l++,l>86&&(l=l-86+ve-1),String.fromCharCode(a)+String.fromCharCode(l))+p.substr(p.length-5,t)+f.substr(f.length-5,t)}(function(e){var t,r,n,i,s,o,a,l=e.lat,c=e.lon,u=6378137,h=.00669438,d=.9996,p=Me(l),f=Me(c);a=Math.floor((c+180)/6)+1,180===c&&(a=60),l>=56&&l<64&&c>=3&&c<12&&(a=32),l>=72&&l<84&&(c>=0&&c<9?a=31:c>=9&&c<21?a=33:c>=21&&c<33?a=35:c>=33&&c<42&&(a=37)),o=Me(6*(a-1)-180+3),t=.006739496752268451,r=u/Math.sqrt(1-h*Math.sin(p)*Math.sin(p)),n=Math.tan(p)*Math.tan(p),i=t*Math.cos(p)*Math.cos(p);var m,g,A=d*r*((s=Math.cos(p)*(f-o))+(1-n+i)*s*s*s/6+(5-18*n+n*n+72*i-58*t)*s*s*s*s*s/120)+5e5,y=d*(u*(.9983242984503243*p-.002514607064228144*Math.sin(2*p)+2639046602129982e-21*Math.sin(4*p)-3.418046101696858e-9*Math.sin(6*p))+r*Math.tan(p)*(s*s/2+(5-n+9*i+4*i*i)*s*s*s*s/24+(61-58*n+n*n+600*i-2.2240339282485886)*s*s*s*s*s*s/720));return l<0&&(y+=1e7),{northing:Math.round(y),easting:Math.round(A),zoneNumber:a,zoneLetter:(m=l,g="Z",84>=m&&m>=72?g="X":72>m&&m>=64?g="W":64>m&&m>=56?g="V":56>m&&m>=48?g="U":48>m&&m>=40?g="T":40>m&&m>=32?g="S":32>m&&m>=24?g="R":24>m&&m>=16?g="Q":16>m&&m>=8?g="P":8>m&&m>=0?g="N":0>m&&m>=-8?g="M":-8>m&&m>=-16?g="L":-16>m&&m>=-24?g="K":-24>m&&m>=-32?g="J":-32>m&&m>=-40?g="H":-40>m&&m>=-48?g="G":-48>m&&m>=-56?g="F":-56>m&&m>=-64?g="E":-64>m&&m>=-72?g="D":-72>m&&m>=-80&&(g="C"),g)}}({lat:e[1],lon:e[0]}),t)}function Ee(e){var t=Ce(Ie(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function Me(e){return e*(Math.PI/180)}function Se(e){return e/Math.PI*180}function Ce(e){var t=e.northing,r=e.easting,n=e.zoneLetter,i=e.zoneNumber;if(i<0||i>60)return null;var s,o,a,l,c,u,h,d,p,f=.9996,m=6378137,g=.00669438,A=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),y=r-5e5,v=t;n<"N"&&(v-=1e7),h=6*(i-1)-180+3,s=.006739496752268451,p=(d=v/f/6367449.145945056)+(3*A/2-27*A*A*A/32)*Math.sin(2*d)+(21*A*A/16-55*A*A*A*A/32)*Math.sin(4*d)+151*A*A*A/96*Math.sin(6*d),o=m/Math.sqrt(1-g*Math.sin(p)*Math.sin(p)),a=Math.tan(p)*Math.tan(p),l=s*Math.cos(p)*Math.cos(p),c=.99330562*m/Math.pow(1-g*Math.sin(p)*Math.sin(p),1.5),u=y/(o*f);var x=p-o*Math.tan(p)/c*(u*u/2-(5+3*a+10*l-4*l*l-9*s)*u*u*u*u/24+(61+90*a+298*l+45*a*a-1.6983531815716497-3*l*l)*u*u*u*u*u*u/720);x=Se(x);var _,b=(u-(1+2*a+l)*u*u*u/6+(5-2*l+28*a-3*l*l+8*s+24*a*a)*u*u*u*u*u/120)/Math.cos(p);if(b=h+Se(b),e.accuracy){var w=Ce({northing:e.northing+e.accuracy,easting:e.easting+e.accuracy,zoneLetter:e.zoneLetter,zoneNumber:e.zoneNumber});_={top:w.lat,right:w.lon,bottom:x,left:b}}else _={lat:x,lon:b};return _}function Te(e){var t=e%6;return 0===t&&(t=6),t}function Ie(e){if(e&&0===e.length)throw"MGRSPoint coverting from nothing";for(var t,r=e.length,n=null,i="",s=0;!/[A-Z]/.test(t=e.charAt(s));){if(s>=2)throw"MGRSPoint bad conversion from: "+e;i+=t,s++}var o=parseInt(i,10);if(0===s||s+3>r)throw"MGRSPoint bad conversion from: "+e;var a=e.charAt(s++);if(a<="A"||"B"===a||"Y"===a||a>="Z"||"I"===a||"O"===a)throw"MGRSPoint zone letter "+a+" not handled: "+e;n=e.substring(s,s+=2);for(var l=Te(o),c=function(e,t){for(var r=Ae.charCodeAt(t-1),n=1e5,i=!1;r!==e.charCodeAt(0);){if(++r===xe&&r++,r===_e&&r++,r>90){if(i)throw"Bad character: "+e;r=ve,i=!0}n+=1e5}return n}(n.charAt(0),l),u=function(e,t){if(e>"V")throw"MGRSPoint given invalid Northing "+e;for(var r=ye.charCodeAt(t-1),n=0,i=!1;r!==e.charCodeAt(0);){if(++r===xe&&r++,r===_e&&r++,r>86){if(i)throw"Bad character: "+e;r=ve,i=!0}n+=1e5}return n}(n.charAt(1),l);u0&&(d=1e5/Math.pow(10,m),p=e.substring(s,s+m),g=parseFloat(p)*d,f=e.substring(s+m),A=parseFloat(f)*d),{easting:g+c,northing:A+u,zoneLetter:a,zoneNumber:o,accuracy:d}}function Re(e){var t;switch(e){case"C":t=11e5;break;case"D":t=2e6;break;case"E":t=28e5;break;case"F":t=37e5;break;case"G":t=46e5;break;case"H":t=55e5;break;case"J":t=64e5;break;case"K":t=73e5;break;case"L":t=82e5;break;case"M":t=91e5;break;case"N":t=0;break;case"P":t=8e5;break;case"Q":t=17e5;break;case"R":t=26e5;break;case"S":t=35e5;break;case"T":t=44e5;break;case"U":t=53e5;break;case"V":t=62e5;break;case"W":t=7e6;break;case"X":t=79e5;break;default:t=-1}if(t>=0)return t;throw"Invalid zone letter: "+e}function Be(e,t,r){if(!(this instanceof Be))return new Be(e,t,r);if(Array.isArray(e))this.x=e[0],this.y=e[1],this.z=e[2]||0;else if("object"==typeof e)this.x=e.x,this.y=e.y,this.z=e.z||0;else if("string"==typeof e&&void 0===t){var n=e.split(",");this.x=parseFloat(n[0],10),this.y=parseFloat(n[1],10),this.z=parseFloat(n[2],10)||0}else this.x=e,this.y=t,this.z=r||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Be.fromMGRS=function(e){return new Be(Ee(e))},Be.prototype.toMGRS=function(e){return we([this.x,this.y],e)};const Pe=Be;var Le=.046875,De=.01953125,Oe=.01068115234375;function Ne(e){var t=[];t[0]=1-e*(.25+e*(Le+e*(De+e*Oe))),t[1]=e*(.75-e*(Le+e*(De+e*Oe)));var r=e*e;return t[2]=r*(.46875-e*(.013020833333333334+.007120768229166667*e)),r*=e,t[3]=r*(.3645833333333333-.005696614583333333*e),t[4]=r*e*.3076171875,t}function Ue(e,t,r,n){return r*=t,t*=t,n[0]*e-r*(n[1]+t*(n[2]+t*(n[3]+t*n[4])))}function Fe(e,t,r){for(var n=1/(1-t),i=e,s=20;s;--s){var o=Math.sin(i),l=1-t*o*o;if(i-=l=(Ue(i,o,Math.cos(i),r)-e)*(l*Math.sqrt(l))*n,Math.abs(l)a?Math.tan(s):0,m=Math.pow(f,2),g=Math.pow(m,2);t=1-this.es*Math.pow(l,2),u/=Math.sqrt(t);var A=Ue(s,l,c,this.en);r=this.a*(this.k0*u*(1+h/6*(1-m+d+h/20*(5-18*m+g+14*d-58*m*d+h/42*(61+179*g-g*m-479*m)))))+this.x0,n=this.a*(this.k0*(A-this.ml0+l*o*u/2*(1+h/12*(5-m+9*d+4*p+h/30*(61+g-58*m+270*d-330*m*d+h/56*(1385+543*g-g*m-3111*m))))))+this.y0}else{var y=c*Math.sin(o);if(Math.abs(Math.abs(y)-1)=1){if(y-1>a)return 93;n=0}else n=Math.acos(n);s<0&&(n=-n),n=this.a*this.k0*(n-this.lat0)+this.y0}return e.x=r,e.y=n,e},inverse:function(e){var t,r,n,i,s=(e.x-this.x0)*(1/this.a),l=(e.y-this.y0)*(1/this.a);if(this.es)if(r=Fe(t=this.ml0+l/this.k0,this.es,this.en),Math.abs(r)a?Math.tan(r):0,d=this.ep2*Math.pow(u,2),p=Math.pow(d,2),f=Math.pow(h,2),m=Math.pow(f,2);t=1-this.es*Math.pow(c,2);var g=s*Math.sqrt(t)/this.k0,A=Math.pow(g,2);n=r-(t*=h)*A/(1-this.es)*.5*(1-A/12*(5+3*f-9*d*f+d-4*p-A/30*(61+90*f-252*d*f+45*m+46*d-A/56*(1385+3633*f+4095*m+1574*m*f)))),i=N(this.long0+g*(1-A/6*(1+2*f+d-A/20*(5+28*f+24*m+8*d*f+6*d-A/42*(61+662*f+1320*m+720*m*f))))/u)}else n=o*O(l),i=0;else{var y=Math.exp(s/this.k0),v=.5*(y-1/y),x=this.lat0+l/this.k0,_=Math.cos(x);t=Math.sqrt((1-Math.pow(_,2))/(1+Math.pow(v,2))),n=Math.asin(t),l<0&&(n=-n),i=0===v&&0===_?0:N(Math.atan2(v,_)+this.long0)}return e.x=i,e.y=n,e},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]};function ze(e){var t=Math.exp(e);return(t-1/t)/2}function Ge(e,t){e=Math.abs(e),t=Math.abs(t);var r=Math.max(e,t),n=Math.min(e,t)/(r||1);return r*Math.sqrt(1+Math.pow(n,2))}function Qe(e,t){for(var r,n=2*Math.cos(2*t),i=e.length-1,s=e[i],o=0;--i>=0;)r=n*s-o+e[i],o=s,s=r;return t+r*Math.sin(2*t)}function Ve(e,t,r){for(var n,i,s=Math.sin(t),o=Math.cos(t),a=ze(r),l=function(e){var t=Math.exp(e);return(t+1/t)/2}(r),c=2*o*l,u=-2*s*a,h=e.length-1,d=e[h],p=0,f=0,m=0;--h>=0;)n=f,i=p,d=c*(f=d)-n-u*(p=m)+e[h],m=u*f-i+c*p;return[(c=s*l)*d-(u=o*a)*m,c*m+u*d]}const He={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(ke.init.apply(this),this.forward=ke.forward,this.inverse=ke.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var e=this.es/(1+Math.sqrt(1-this.es)),t=e/(2-e),r=t;this.cgb[0]=t*(2+t*(-2/3+t*(t*(116/45+t*(26/45+t*(-2854/675)))-2))),this.cbg[0]=t*(t*(2/3+t*(4/3+t*(-82/45+t*(32/45+t*(4642/4725)))))-2),r*=t,this.cgb[1]=r*(7/3+t*(t*(-227/45+t*(2704/315+t*(2323/945)))-1.6)),this.cbg[1]=r*(5/3+t*(-16/15+t*(-13/9+t*(904/315+t*(-1522/945))))),r*=t,this.cgb[2]=r*(56/15+t*(-136/35+t*(-1262/105+t*(73814/2835)))),this.cbg[2]=r*(-26/15+t*(34/21+t*(1.6+t*(-12686/2835)))),r*=t,this.cgb[3]=r*(4279/630+t*(-332/35+t*(-399572/14175))),this.cbg[3]=r*(1237/630+t*(t*(-24832/14175)-2.4)),r*=t,this.cgb[4]=r*(4174/315+t*(-144838/6237)),this.cbg[4]=r*(-734/315+t*(109598/31185)),r*=t,this.cgb[5]=r*(601676/22275),this.cbg[5]=r*(444337/155925),r=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+r*(1/4+r*(1/64+r/256))),this.utg[0]=t*(t*(2/3+t*(-37/96+t*(1/360+t*(81/512+t*(-96199/604800)))))-.5),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+t*(7891/37800)))))),this.utg[1]=r*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+t*(1118711/3870720))))),this.gtu[1]=r*(13/48+t*(t*(557/1440+t*(281/630+t*(-1983433/1935360)))-.6)),r*=t,this.utg[2]=r*(-17/480+t*(37/840+t*(209/4480+t*(-5569/90720)))),this.gtu[2]=r*(61/240+t*(-103/140+t*(15061/26880+t*(167603/181440)))),r*=t,this.utg[3]=r*(-4397/161280+t*(11/504+t*(830251/7257600))),this.gtu[3]=r*(49561/161280+t*(-179/168+t*(6601661/7257600))),r*=t,this.utg[4]=r*(-4583/161280+t*(108847/3991680)),this.gtu[4]=r*(34729/80640+t*(-3418889/1995840)),r*=t,this.utg[5]=r*(-20648693/638668800),this.gtu[5]=.6650675310896665*r;var n=Qe(this.cbg,this.lat0);this.Zb=-this.Qn*(n+function(e,t){for(var r,n=2*Math.cos(t),i=e.length-1,s=e[i],o=0;--i>=0;)r=n*s-o+e[i],o=s,s=r;return Math.sin(t)*r}(this.gtu,2*n))},forward:function(e){var t=N(e.x-this.long0),r=e.y;r=Qe(this.cbg,r);var n=Math.sin(r),i=Math.cos(r),s=Math.sin(t),o=Math.cos(t);r=Math.atan2(n,o*i),t=Math.atan2(s*i,Ge(n,i*o)),t=function(e){var t=Math.abs(e);return t=function(e){var t=1+e,r=t-1;return 0===r?e:e*Math.log(t)/r}(t*(1+t/(Ge(1,t)+1))),e<0?-t:t}(Math.tan(t));var a,l,c=Ve(this.gtu,2*r,2*t);return r+=c[0],t+=c[1],Math.abs(t)<=2.623395162778?(a=this.a*(this.Qn*t)+this.x0,l=this.a*(this.Qn*r+this.Zb)+this.y0):(a=1/0,l=1/0),e.x=a,e.y=l,e},inverse:function(e){var t,r,n=(e.x-this.x0)*(1/this.a),i=(e.y-this.y0)*(1/this.a);if(i=(i-this.Zb)/this.Qn,n/=this.Qn,Math.abs(n)<=2.623395162778){var s=Ve(this.utg,2*i,2*n);i+=s[0],n+=s[1],n=Math.atan(ze(n));var o=Math.sin(i),a=Math.cos(i),l=Math.sin(n),c=Math.cos(n);i=Math.atan2(o*c,Ge(l,c*a)),t=N((n=Math.atan2(l,c*a))+this.long0),r=Qe(this.cgb,i)}else t=1/0,r=1/0;return e.x=t,e.y=r,e},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"]},je={init:function(){var e=function(e,t){if(void 0===e){if((e=Math.floor(30*(N(t)+Math.PI)/Math.PI)+1)<0)return 0;if(e>60)return 60}return e}(this.zone,this.long0);if(void 0===e)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(e)-183)*l,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,He.init.apply(this),this.forward=He.forward,this.inverse=He.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function qe(e,t){return Math.pow((1-e)/(1+e),t)}const We={init:function(){var e=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*e*e),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(e/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+u)/(Math.pow(Math.tan(.5*this.lat0+u),this.C)*qe(this.e*e,this.ratexp))},forward:function(e){var t=e.x,r=e.y;return e.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*r+u),this.C)*qe(this.e*Math.sin(r),this.ratexp))-o,e.x=this.C*t,e},inverse:function(e){for(var t=e.x/this.C,r=e.y,n=Math.pow(Math.tan(.5*r+u)/this.K,1/this.C),i=20;i>0&&(r=2*Math.atan(n*qe(this.e*Math.sin(e.y),-.5*this.e))-o,!(Math.abs(r-e.y)<1e-14));--i)e.y=r;return i?(e.x=t,e.y=r,e):null},names:["gauss"]},Ye={init:function(){We.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(e){var t,r,n,i;return e.x=N(e.x-this.long0),We.forward.apply(this,[e]),t=Math.sin(e.y),r=Math.cos(e.y),n=Math.cos(e.x),i=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*r*n),e.x=i*r*Math.sin(e.x),e.y=i*(this.cosc0*t-this.sinc0*r*n),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e},inverse:function(e){var t,r,n,i,s;if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,s=Ge(e.x,e.y)){var o=2*Math.atan2(s,this.R2);t=Math.sin(o),r=Math.cos(o),i=Math.asin(r*this.sinc0+e.y*t*this.cosc0/s),n=Math.atan2(e.x*t,s*this.cosc0*r-e.y*this.sinc0*t)}else i=this.phic0,n=0;return e.x=n,e.y=i,We.inverse.apply(this,[e]),e.x=N(e.x+this.long0),e},names:["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]},Xe={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=a&&(this.k0=.5*(1+O(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=a&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=a&&Math.abs(Math.cos(this.lat_ts))>a&&(this.k0=.5*this.cons*D(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/U(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=D(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-o,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(e){var t,r,n,i,s,l,c=e.x,u=e.y,h=Math.sin(u),d=Math.cos(u),p=N(c-this.long0);return Math.abs(Math.abs(c-this.long0)-Math.PI)<=a&&Math.abs(u+this.lat0)<=a?(e.x=NaN,e.y=NaN,e):this.sphere?(t=2*this.k0/(1+this.sinlat0*h+this.coslat0*d*Math.cos(p)),e.x=this.a*t*d*Math.sin(p)+this.x0,e.y=this.a*t*(this.coslat0*h-this.sinlat0*d*Math.cos(p))+this.y0,e):(r=2*Math.atan(this.ssfn_(u,h,this.e))-o,i=Math.cos(r),n=Math.sin(r),Math.abs(this.coslat0)<=a?(s=U(this.e,u*this.con,this.con*h),l=2*this.a*this.k0*s/this.cons,e.x=this.x0+l*Math.sin(c-this.long0),e.y=this.y0-this.con*l*Math.cos(c-this.long0),e):(Math.abs(this.sinlat0)0?N(this.long0+Math.atan2(e.x,-1*e.y)):N(this.long0+Math.atan2(e.x,e.y)):N(this.long0+Math.atan2(e.x*Math.sin(c),l*this.coslat0*Math.cos(c)-e.y*this.sinlat0*Math.sin(c))),e.x=t,e.y=r,e)}if(Math.abs(this.coslat0)<=a){if(l<=a)return r=this.lat0,t=this.long0,e.x=t,e.y=r,e;e.x*=this.con,e.y*=this.con,n=l*this.cons/(2*this.a*this.k0),r=this.con*F(this.e,n),t=this.con*N(this.con*this.long0+Math.atan2(e.x,-1*e.y))}else i=2*Math.atan(l*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,l<=a?s=this.X0:(s=Math.asin(Math.cos(i)*this.sinX0+e.y*Math.sin(i)*this.cosX0/l),t=N(this.long0+Math.atan2(e.x*Math.sin(i),l*this.cosX0*Math.cos(i)-e.y*this.sinX0*Math.sin(i)))),r=-1*F(this.e,Math.tan(.5*(o+s)));return e.x=t,e.y=r,e},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"],ssfn_:function(e,t,r){return t*=r,Math.tan(.5*(o+e))*Math.pow((1-t)/(1+t),.5*r)}},Ke={init:function(){var e=this.lat0;this.lambda0=this.long0;var t=Math.sin(e),r=this.a,n=1/this.rf,i=2*n-Math.pow(n,2),s=this.e=Math.sqrt(i);this.R=this.k0*r*Math.sqrt(1-i)/(1-i*Math.pow(t,2)),this.alpha=Math.sqrt(1+i/(1-i)*Math.pow(Math.cos(e),4)),this.b0=Math.asin(t/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),a=Math.log(Math.tan(Math.PI/4+e/2)),l=Math.log((1+s*t)/(1-s*t));this.K=o-this.alpha*a+this.alpha*s/2*l},forward:function(e){var t=Math.log(Math.tan(Math.PI/4-e.y/2)),r=this.e/2*Math.log((1+this.e*Math.sin(e.y))/(1-this.e*Math.sin(e.y))),n=-this.alpha*(t+r)+this.K,i=2*(Math.atan(Math.exp(n))-Math.PI/4),s=this.alpha*(e.x-this.lambda0),o=Math.atan(Math.sin(s)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(s))),a=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(s));return e.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0,e.x=this.R*o+this.x0,e},inverse:function(e){for(var t=e.x-this.x0,r=e.y-this.y0,n=t/this.R,i=2*(Math.atan(Math.exp(r/this.R))-Math.PI/4),s=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(n)),o=Math.atan(Math.sin(n)/(Math.cos(this.b0)*Math.cos(n)-Math.sin(this.b0)*Math.tan(i))),a=this.lambda0+o/this.alpha,l=0,c=s,u=-1e3,h=0;Math.abs(c-u)>1e-7;){if(++h>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+s/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(c))/2)),u=c,c=2*Math.atan(Math.exp(l))-Math.PI/2}return e.x=a,e.y=c,e},names:["somerc"]};var $e=1e-7;const Je={init:function(){var e,t,r,n,i,s,c,d,p,f,m,g,A,y=0,v=0,x=0,_=0,b=0,w=0,E=0;this.no_off=(A="object"==typeof(g=this).PROJECTION?Object.keys(g.PROJECTION)[0]:g.PROJECTION,"no_uoff"in g||"no_off"in g||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(A)),this.no_rot="no_rot"in this;var M=!1;"alpha"in this&&(M=!0);var S=!1;if("rectified_grid_angle"in this&&(S=!0),M&&(E=this.alpha),S&&(y=this.rectified_grid_angle*l),M||S)v=this.longc;else if(x=this.long1,b=this.lat1,_=this.long2,w=this.lat2,Math.abs(b-w)<=$e||(e=Math.abs(b))<=$e||Math.abs(e-o)<=$e||Math.abs(Math.abs(this.lat0)-o)<=$e||Math.abs(Math.abs(w)-o)<=$e)throw new Error;var C=1-this.es;t=Math.sqrt(C),Math.abs(this.lat0)>a?(d=Math.sin(this.lat0),r=Math.cos(this.lat0),e=1-this.es*d*d,this.B=r*r,this.B=Math.sqrt(1+this.es*this.B*this.B/C),this.A=this.B*this.k0*t/e,(i=(n=this.B*t/(r*Math.sqrt(e)))*n-1)<=0?i=0:(i=Math.sqrt(i),this.lat0<0&&(i=-i)),this.E=i+=n,this.E*=Math.pow(U(this.e,this.lat0,d),this.B)):(this.B=1/t,this.A=this.k0,this.E=n=i=1),M||S?(M?(m=Math.asin(Math.sin(E)/n),S||(y=E)):(m=y,E=Math.asin(n*Math.sin(m))),this.lam0=v-Math.asin(.5*(i-1/i)*Math.tan(m))/this.B):(s=Math.pow(U(this.e,b,Math.sin(b)),this.B),c=Math.pow(U(this.e,w,Math.sin(w)),this.B),i=this.E/s,p=(c-s)/(c+s),f=((f=this.E*this.E)-c*s)/(f+c*s),(e=x-_)<-Math.pi?_-=h:e>Math.pi&&(_+=h),this.lam0=N(.5*(x+_)-Math.atan(f*Math.tan(.5*this.B*(x-_))/p)/this.B),m=Math.atan(2*Math.sin(this.B*N(x-this.lam0))/(i-1/i)),y=E=Math.asin(n*Math.sin(m))),this.singam=Math.sin(m),this.cosgam=Math.cos(m),this.sinrot=Math.sin(y),this.cosrot=Math.cos(y),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A,this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(n*n-1)/Math.cos(E))),this.lat0<0&&(this.u_0=-this.u_0)),i=.5*m,this.v_pole_n=this.ArB*Math.log(Math.tan(u-i)),this.v_pole_s=this.ArB*Math.log(Math.tan(u+i))},forward:function(e){var t,r,n,i,s,l,c,u,h={};if(e.x=e.x-this.lam0,Math.abs(Math.abs(e.y)-o)>a){if(t=.5*((s=this.E/Math.pow(U(this.e,e.y,Math.sin(e.y)),this.B))-(l=1/s)),r=.5*(s+l),i=Math.sin(this.B*e.x),n=(t*this.singam-i*this.cosgam)/r,Math.abs(Math.abs(n)-1)0?this.v_pole_n:this.v_pole_s,c=this.ArB*e.y;return this.no_rot?(h.x=c,h.y=u):(c-=this.u_0,h.x=u*this.cosrot+c*this.sinrot,h.y=c*this.cosrot-u*this.sinrot),h.x=this.a*h.x+this.x0,h.y=this.a*h.y+this.y0,h},inverse:function(e){var t,r,n,i,s,l,c,u={};if(e.x=(e.x-this.x0)*(1/this.a),e.y=(e.y-this.y0)*(1/this.a),this.no_rot?(r=e.y,t=e.x):(r=e.x*this.cosrot-e.y*this.sinrot,t=e.y*this.cosrot+e.x*this.sinrot+this.u_0),i=.5*((n=Math.exp(-this.BrA*r))-1/n),s=.5*(n+1/n),c=((l=Math.sin(this.BrA*t))*this.cosgam+i*this.singam)/s,Math.abs(Math.abs(c)-1)a?this.ns=Math.log(n/l)/Math.log(i/c):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=n/(this.ns*Math.pow(i,this.ns)),this.rh=this.a*this.f0*Math.pow(u,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(e){var t=e.x,r=e.y;Math.abs(2*Math.abs(r)-Math.PI)<=a&&(r=O(r)*(o-2e-10));var n,i,s=Math.abs(Math.abs(r)-o);if(s>a)n=U(this.e,r,Math.sin(r)),i=this.a*this.f0*Math.pow(n,this.ns);else{if((s=r*this.ns)<=0)return null;i=0}var l=this.ns*N(t-this.long0);return e.x=this.k0*(i*Math.sin(l))+this.x0,e.y=this.k0*(this.rh-i*Math.cos(l))+this.y0,e},inverse:function(e){var t,r,n,i,s,a=(e.x-this.x0)/this.k0,l=this.rh-(e.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(a*a+l*l),r=1):(t=-Math.sqrt(a*a+l*l),r=-1);var c=0;if(0!==t&&(c=Math.atan2(r*a,r*l)),0!==t||this.ns>0){if(r=1/this.ns,n=Math.pow(t/(this.a*this.f0),r),-9999===(i=F(this.e,n)))return null}else i=-o;return s=N(c/this.ns+this.long0),e.x=s,e.y=i,e},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]},et={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(e){var t,r,n,i,s,o,a,l=e.x,c=e.y,u=N(l-this.long0);return t=Math.pow((1+this.e*Math.sin(c))/(1-this.e*Math.sin(c)),this.alfa*this.e/2),r=2*(Math.atan(this.k*Math.pow(Math.tan(c/2+this.s45),this.alfa)/t)-this.s45),n=-u*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(r)+Math.sin(this.ad)*Math.cos(r)*Math.cos(n)),s=Math.asin(Math.cos(r)*Math.sin(n)/Math.cos(i)),o=this.n*s,a=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(i/2+this.s45),this.n),e.y=a*Math.cos(o)/1,e.x=a*Math.sin(o)/1,this.czech||(e.y*=-1,e.x*=-1),e},inverse:function(e){var t,r,n,i,s,o,a,l=e.x;e.x=e.y,e.y=l,this.czech||(e.y*=-1,e.x*=-1),s=Math.sqrt(e.x*e.x+e.y*e.y),i=Math.atan2(e.y,e.x)/Math.sin(this.s0),n=2*(Math.atan(Math.pow(this.ro0/s,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(n)-Math.sin(this.ad)*Math.cos(n)*Math.cos(i)),r=Math.asin(Math.cos(n)*Math.sin(i)/Math.cos(t)),e.x=this.long0-r/this.alfa,o=t,a=0;var c=0;do{e.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(t/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-e.y)<1e-10&&(a=1),o=e.y,c+=1}while(0===a&&c<15);return c>=15?null:e},names:["Krovak","krovak"]};function tt(e,t,r,n,i){return e*i-t*Math.sin(2*i)+r*Math.sin(4*i)-n*Math.sin(6*i)}function rt(e){return 1-.25*e*(1+e/16*(3+1.25*e))}function nt(e){return.375*e*(1+.25*e*(1+.46875*e))}function it(e){return.05859375*e*e*(1+.75*e)}function st(e){return e*e*e*(35/3072)}function ot(e,t,r){var n=t*r;return e/Math.sqrt(1-n*n)}function at(e){return Math.abs(e)1e-7?(1-e*e)*(t/(1-(r=e*t)*r)-.5/e*Math.log((1-r)/(1+r))):2*t}const ht={init:function(){var e,t=Math.abs(this.lat0);if(Math.abs(t-o)0)switch(this.qp=ut(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(e){var t,r=[];return r[0]=.3333333333333333*e,t=e*e,r[0]+=.17222222222222222*t,r[1]=.06388888888888888*t,t*=e,r[0]+=.10257936507936508*t,r[1]+=.0664021164021164*t,r[2]=.016415012942191543*t,r}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=ut(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(e){var t,r,n,i,s,l,c,h,d,p,f=e.x,m=e.y;if(f=N(f-this.long0),this.sphere){if(s=Math.sin(m),p=Math.cos(m),n=Math.cos(f),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((r=this.mode===this.EQUIT?1+p*n:1+this.sinph0*s+this.cosph0*p*n)<=a)return null;t=(r=Math.sqrt(2/r))*p*Math.sin(f),r*=this.mode===this.EQUIT?s:this.cosph0*s-this.sinph0*p*n}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(n=-n),Math.abs(m+this.lat0)=0?(t=(d=Math.sqrt(l))*i,r=n*(this.mode===this.S_POLE?d:-d)):t=r=0}}return e.x=this.a*t+this.x0,e.y=this.a*r+this.y0,e},inverse:function(e){e.x-=this.x0,e.y-=this.y0;var t,r,n,i,s,l,c,u,h,d,p=e.x/this.a,f=e.y/this.a;if(this.sphere){var m,g=0,A=0;if((r=.5*(m=Math.sqrt(p*p+f*f)))>1)return null;switch(r=2*Math.asin(r),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(A=Math.sin(r),g=Math.cos(r)),this.mode){case this.EQUIT:r=Math.abs(m)<=a?0:Math.asin(f*A/m),p*=A,f=g*m;break;case this.OBLIQ:r=Math.abs(m)<=a?this.lat0:Math.asin(g*this.sinph0+f*A*this.cosph0/m),p*=A*this.cosph0,f=(g-Math.sin(r)*this.sinph0)*m;break;case this.N_POLE:f=-f,r=o-r;break;case this.S_POLE:r-=o}t=0!==f||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(p,f):0}else{if(c=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(p/=this.dd,f*=this.dd,(l=Math.sqrt(p*p+f*f))1&&(e=e>1?1:-1),Math.asin(e)}const pt={init:function(){Math.abs(this.lat1+this.lat2)a?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(e){var t=e.x,r=e.y;this.sin_phi=Math.sin(r),this.cos_phi=Math.cos(r);var n=ut(this.e3,this.sin_phi),i=this.a*Math.sqrt(this.c-this.ns0*n)/this.ns0,s=this.ns0*N(t-this.long0),o=i*Math.sin(s)+this.x0,a=this.rh-i*Math.cos(s)+this.y0;return e.x=o,e.y=a,e},inverse:function(e){var t,r,n,i,s,o;return e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns0>=0?(t=Math.sqrt(e.x*e.x+e.y*e.y),n=1):(t=-Math.sqrt(e.x*e.x+e.y*e.y),n=-1),i=0,0!==t&&(i=Math.atan2(n*e.x,n*e.y)),n=t*this.ns0/this.a,this.sphere?o=Math.asin((this.c-n*n)/(2*this.ns0)):(r=(this.c-n*n)/this.ns0,o=this.phi1z(this.e3,r)),s=N(i/this.ns0+this.long0),e.x=s,e.y=o,e},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(e,t){var r,n,i,s,o=dt(.5*t);if(e0||Math.abs(s)<=a?(o=this.x0+1*this.a*r*Math.sin(n)/s,l=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*r*i)/s):(o=this.x0+this.infinity_dist*r*Math.sin(n),l=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*r*i)),e.x=o,e.y=l,e},inverse:function(e){var t,r,n,i,s,o;return e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,(t=Math.sqrt(e.x*e.x+e.y*e.y))?(i=Math.atan2(t,this.rc),r=Math.sin(i),o=dt((n=Math.cos(i))*this.sin_p14+e.y*r*this.cos_p14/t),s=Math.atan2(e.x*r,t*this.cos_p14*n-e.y*this.sin_p14*r),s=N(this.long0+s)):(o=this.phic0,s=0),e.x=s,e.y=o,e},names:["gnom"]},mt={init:function(){this.sphere||(this.k0=D(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(e){var t,r,n=e.x,i=e.y,s=N(n-this.long0);if(this.sphere)t=this.x0+this.a*s*Math.cos(this.lat_ts),r=this.y0+this.a*Math.sin(i)/Math.cos(this.lat_ts);else{var o=ut(this.e,Math.sin(i));t=this.x0+this.a*this.k0*s,r=this.y0+this.a*o*.5/this.k0}return e.x=t,e.y=r,e},inverse:function(e){var t,r;return e.x-=this.x0,e.y-=this.y0,this.sphere?(t=N(this.long0+e.x/this.a/Math.cos(this.lat_ts)),r=Math.asin(e.y/this.a*Math.cos(this.lat_ts))):(r=function(e,t){var r=1-(1-e*e)/(2*e)*Math.log((1-e)/(1+e));if(Math.abs(Math.abs(t)-r)<1e-6)return t<0?-1*o:o;for(var n,i,s,a,l=Math.asin(.5*t),c=0;c<30;c++)if(i=Math.sin(l),s=Math.cos(l),a=e*i,l+=n=Math.pow(1-a*a,2)/(2*s)*(t/(1-e*e)-i/(1-a*a)+.5/e*Math.log((1-a)/(1+a))),Math.abs(n)<=1e-10)return l;return NaN}(this.e,2*e.y*this.k0/this.a),t=N(this.long0+e.x/(this.a*this.k0))),e.x=t,e.y=r,e},names:["cea"]},gt={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(e){var t=e.x,r=e.y,n=N(t-this.long0),i=at(r-this.lat0);return e.x=this.x0+this.a*n*this.rc,e.y=this.y0+this.a*i,e},inverse:function(e){var t=e.x,r=e.y;return e.x=N(this.long0+(t-this.x0)/(this.a*this.rc)),e.y=at(this.lat0+(r-this.y0)/this.a),e},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},At={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=rt(this.es),this.e1=nt(this.es),this.e2=it(this.es),this.e3=st(this.es),this.ml0=this.a*tt(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(e){var t,r,n,i=e.x,s=e.y,o=N(i-this.long0);if(n=o*Math.sin(s),this.sphere)Math.abs(s)<=a?(t=this.a*o,r=-1*this.a*this.lat0):(t=this.a*Math.sin(n)/Math.tan(s),r=this.a*(at(s-this.lat0)+(1-Math.cos(n))/Math.tan(s)));else if(Math.abs(s)<=a)t=this.a*o,r=-1*this.ml0;else{var l=ot(this.a,this.e,Math.sin(s))/Math.tan(s);t=l*Math.sin(n),r=this.a*tt(this.e0,this.e1,this.e2,this.e3,s)-this.ml0+l*(1-Math.cos(n))}return e.x=t+this.x0,e.y=r+this.y0,e},inverse:function(e){var t,r,n,i,s,o,l,c,u;if(n=e.x-this.x0,i=e.y-this.y0,this.sphere)if(Math.abs(i+this.a*this.lat0)<=a)t=N(n/this.a+this.long0),r=0;else{var h;for(o=this.lat0+i/this.a,l=n*n/this.a/this.a+o*o,c=o,s=20;s;--s)if(c+=u=-1*(o*(c*(h=Math.tan(c))+1)-c-.5*(c*c+l)*h)/((c-o)/h-1),Math.abs(u)<=a){r=c;break}t=N(this.long0+Math.asin(n*Math.tan(c)/this.a)/Math.sin(r))}else if(Math.abs(i+this.ml0)<=a)r=0,t=N(this.long0+n/this.a);else{var d,p,f,m,g;for(o=(this.ml0+i)/this.a,l=n*n/this.a/this.a+o*o,c=o,s=20;s;--s)if(g=this.e*Math.sin(c),d=Math.sqrt(1-g*g)*Math.tan(c),p=this.a*tt(this.e0,this.e1,this.e2,this.e3,c),f=this.e0-2*this.e1*Math.cos(2*c)+4*this.e2*Math.cos(4*c)-6*this.e3*Math.cos(6*c),c-=u=(o*(d*(m=p/this.a)+1)-m-.5*d*(m*m+l))/(this.es*Math.sin(2*c)*(m*m+l-2*o*m)/(4*d)+(o-m)*(d*f-2/Math.sin(2*c))-f),Math.abs(u)<=a){r=c;break}d=Math.sqrt(1-this.es*Math.pow(Math.sin(r),2))*Math.tan(r),t=N(this.long0+Math.asin(n*d/this.a)/Math.sin(r))}return e.x=t,e.y=r,e},names:["Polyconic","poly"]},yt={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(e){var t,r=e.x,n=e.y-this.lat0,i=r-this.long0,o=n/s*1e-5,a=i,l=1,c=0;for(t=1;t<=10;t++)l*=o,c+=this.A[t]*l;var u,h=c,d=a,p=1,f=0,m=0,g=0;for(t=1;t<=6;t++)u=f*h+p*d,p=p*h-f*d,f=u,m=m+this.B_re[t]*p-this.B_im[t]*f,g=g+this.B_im[t]*p+this.B_re[t]*f;return e.x=g*this.a+this.x0,e.y=m*this.a+this.y0,e},inverse:function(e){var t,r,n=e.x,i=e.y,o=n-this.x0,a=(i-this.y0)/this.a,l=o/this.a,c=1,u=0,h=0,d=0;for(t=1;t<=6;t++)r=u*a+c*l,c=c*a-u*l,u=r,h=h+this.C_re[t]*c-this.C_im[t]*u,d=d+this.C_im[t]*c+this.C_re[t]*u;for(var p=0;p.999999999999&&(r=.999999999999),t=Math.asin(r);var n=N(this.long0+e.x/(.900316316158*this.a*Math.cos(t)));n<-Math.PI&&(n=-Math.PI),n>Math.PI&&(n=Math.PI),r=(2*t+Math.sin(2*t))/Math.PI,Math.abs(r)>1&&(r=1);var i=Math.asin(r);return e.x=n,e.y=i,e},names:["Mollweide","moll"]},bt={init:function(){Math.abs(this.lat1+this.lat2)=0?(r=Math.sqrt(e.x*e.x+e.y*e.y),t=1):(r=-Math.sqrt(e.x*e.x+e.y*e.y),t=-1);var s=0;return 0!==r&&(s=Math.atan2(t*e.x,t*e.y)),this.sphere?(i=N(this.long0+s/this.ns),n=at(this.g-r/this.a),e.x=i,e.y=n,e):(n=lt(this.g-r/this.a,this.e0,this.e1,this.e2,this.e3),i=N(this.long0+s/this.ns),e.x=i,e.y=n,e)},names:["Equidistant_Conic","eqdc"]},wt={init:function(){this.R=this.a},forward:function(e){var t,r,n=e.x,i=e.y,s=N(n-this.long0);Math.abs(i)<=a&&(t=this.x0+this.R*s,r=this.y0);var l=dt(2*Math.abs(i/Math.PI));(Math.abs(s)<=a||Math.abs(Math.abs(i)-o)<=a)&&(t=this.x0,r=i>=0?this.y0+Math.PI*this.R*Math.tan(.5*l):this.y0+Math.PI*this.R*-Math.tan(.5*l));var c=.5*Math.abs(Math.PI/s-s/Math.PI),u=c*c,h=Math.sin(l),d=Math.cos(l),p=d/(h+d-1),f=p*p,m=p*(2/h-1),g=m*m,A=Math.PI*this.R*(c*(p-g)+Math.sqrt(u*(p-g)*(p-g)-(g+u)*(f-g)))/(g+u);s<0&&(A=-A),t=this.x0+A;var y=u+p;return A=Math.PI*this.R*(m*y-c*Math.sqrt((g+u)*(u+1)-y*y))/(g+u),r=i>=0?this.y0+A:this.y0-A,e.x=t,e.y=r,e},inverse:function(e){var t,r,n,i,s,o,l,c,u,h,d,p;return e.x-=this.x0,e.y-=this.y0,d=Math.PI*this.R,s=(n=e.x/d)*n+(i=e.y/d)*i,d=3*(i*i/(c=-2*(o=-Math.abs(i)*(1+s))+1+2*i*i+s*s)+(2*(l=o-2*i*i+n*n)*l*l/c/c/c-9*o*l/c/c)/27)/(u=(o-l*l/3/c)/c)/(h=2*Math.sqrt(-u/3)),Math.abs(d)>1&&(d=d>=0?1:-1),p=Math.acos(d)/3,r=e.y>=0?(-h*Math.cos(p+Math.PI/3)-l/3/c)*Math.PI:-(-h*Math.cos(p+Math.PI/3)-l/3/c)*Math.PI,t=Math.abs(n)2*o*this.a)return;return r=t/this.a,n=Math.sin(r),i=Math.cos(r),s=this.long0,Math.abs(t)<=a?l=this.lat0:(l=dt(i*this.sin_p12+e.y*n*this.cos_p12/t),c=Math.abs(this.lat0)-o,s=Math.abs(c)<=a?this.lat0>=0?N(this.long0+Math.atan2(e.x,-e.y)):N(this.long0-Math.atan2(-e.x,e.y)):N(this.long0+Math.atan2(e.x*n,t*this.cos_p12*i-e.y*this.sin_p12*n))),e.x=s,e.y=l,e}return u=rt(this.es),h=nt(this.es),d=it(this.es),p=st(this.es),Math.abs(this.sin_p12-1)<=a?(l=lt(((f=this.a*tt(u,h,d,p,o))-(t=Math.sqrt(e.x*e.x+e.y*e.y)))/this.a,u,h,d,p),s=N(this.long0+Math.atan2(e.x,-1*e.y)),e.x=s,e.y=l,e):Math.abs(this.sin_p12+1)<=a?(f=this.a*tt(u,h,d,p,o),l=lt(((t=Math.sqrt(e.x*e.x+e.y*e.y))-f)/this.a,u,h,d,p),s=N(this.long0+Math.atan2(e.x,e.y)),e.x=s,e.y=l,e):(t=Math.sqrt(e.x*e.x+e.y*e.y),A=Math.atan2(e.x,e.y),m=ot(this.a,this.e,this.sin_p12),y=Math.cos(A),x=-(v=this.e*this.cos_p12*y)*v/(1-this.es),_=3*this.es*(1-x)*this.sin_p12*this.cos_p12*y/(1-this.es),E=1-x*(w=(b=t/m)-x*(1+x)*Math.pow(b,3)/6-_*(1+3*x)*Math.pow(b,4)/24)*w/2-b*w*w*w/6,g=Math.asin(this.sin_p12*Math.cos(w)+this.cos_p12*Math.sin(w)*y),s=N(this.long0+Math.asin(Math.sin(A)*Math.sin(w)/Math.cos(g))),M=Math.sin(g),l=Math.atan2((M-this.es*E*this.sin_p12)*Math.tan(g),M*(1-this.es)),e.x=s,e.y=l,e)},names:["Azimuthal_Equidistant","aeqd"]},Mt={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(e){var t,r,n,i,s,o,l,c=e.x,u=e.y;return n=N(c-this.long0),t=Math.sin(u),r=Math.cos(u),i=Math.cos(n),((s=this.sin_p14*t+this.cos_p14*r*i)>0||Math.abs(s)<=a)&&(o=1*this.a*r*Math.sin(n),l=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*r*i)),e.x=o,e.y=l,e},inverse:function(e){var t,r,n,i,s,l,c;return e.x-=this.x0,e.y-=this.y0,r=dt((t=Math.sqrt(e.x*e.x+e.y*e.y))/this.a),n=Math.sin(r),i=Math.cos(r),l=this.long0,Math.abs(t)<=a?(c=this.lat0,e.x=l,e.y=c,e):(c=dt(i*this.sin_p14+e.y*n*this.cos_p14/t),s=Math.abs(this.lat0)-o,Math.abs(s)<=a?(l=this.lat0>=0?N(this.long0+Math.atan2(e.x,-e.y)):N(this.long0-Math.atan2(-e.x,e.y)),e.x=l,e.y=c,e):(l=N(this.long0+Math.atan2(e.x*n,t*this.cos_p14*i-e.y*this.sin_p14*n)),e.x=l,e.y=c,e))},names:["ortho"]};function St(e,t,r,n){var i;return eu&&i<=o+u?(n.value=2,i-=o):i>o+u||i<=-(o+u)?(n.value=3,i=i>=0?i-d:i+d):(n.value=4,i+=o)),i}function Ct(e,t){var r=e+t;return r<-d?r+=h:r>+d&&(r-=h),r}const Tt={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=o-u/2?this.face=5:this.lat0<=-(o-u/2)?this.face=6:Math.abs(this.long0)<=u?this.face=1:Math.abs(this.long0)<=o+u?this.face=this.long0>0?2:4:this.face=3,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(e){var t,r,n,i,s,a,l={x:0,y:0},c={value:0};if(e.x-=this.long0,t=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(e.y)):e.y,r=e.x,5===this.face)i=o-t,r>=u&&r<=o+u?(c.value=1,n=r-o):r>o+u||r<=-(o+u)?(c.value=2,n=r>0?r-d:r+d):r>-(o+u)&&r<=-u?(c.value=3,n=r+o):(c.value=4,n=r);else if(6===this.face)i=o+t,r>=u&&r<=o+u?(c.value=1,n=-r+o):r=-u?(c.value=2,n=-r):r<-u&&r>=-(o+u)?(c.value=3,n=-r-o):(c.value=4,n=r>0?-r+d:-r-d);else{var h,p,f,m,g,A;2===this.face?r=Ct(r,+o):3===this.face?r=Ct(r,+d):4===this.face&&(r=Ct(r,-o)),m=Math.sin(t),g=Math.cos(t),A=Math.sin(r),h=g*Math.cos(r),p=g*A,f=m,1===this.face?n=St(i=Math.acos(h),f,p,c):2===this.face?n=St(i=Math.acos(p),f,-h,c):3===this.face?n=St(i=Math.acos(-h),f,-p,c):4===this.face?n=St(i=Math.acos(-p),f,h,c):(i=n=0,c.value=1)}return a=Math.atan(12/d*(n+Math.acos(Math.sin(n)*Math.cos(u))-o)),s=Math.sqrt((1-Math.cos(i))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(n))))),2===c.value?a+=o:3===c.value?a+=d:4===c.value&&(a+=1.5*d),l.x=s*Math.cos(a),l.y=s*Math.sin(a),l.x=l.x*this.a+this.x0,l.y=l.y*this.a+this.y0,e.x=l.x,e.y=l.y,e},inverse:function(e){var t,r,n,i,s,a,l,c,u,h,p,f,m={lam:0,phi:0},g={value:0};if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,r=Math.atan(Math.sqrt(e.x*e.x+e.y*e.y)),t=Math.atan2(e.y,e.x),e.x>=0&&e.x>=Math.abs(e.y)?g.value=1:e.y>=0&&e.y>=Math.abs(e.x)?(g.value=2,t-=o):e.x<0&&-e.x>=Math.abs(e.y)?(g.value=3,t=t<0?t+d:t-d):(g.value=4,t+=o),u=d/12*Math.tan(t),s=Math.sin(u)/(Math.cos(u)-1/Math.sqrt(2)),a=Math.atan(s),(l=1-(n=Math.cos(t))*n*(i=Math.tan(r))*i*(1-Math.cos(Math.atan(1/Math.cos(a)))))<-1?l=-1:l>1&&(l=1),5===this.face)c=Math.acos(l),m.phi=o-c,1===g.value?m.lam=a+o:2===g.value?m.lam=a<0?a+d:a-d:3===g.value?m.lam=a-o:m.lam=a;else if(6===this.face)c=Math.acos(l),m.phi=c-o,1===g.value?m.lam=-a+o:2===g.value?m.lam=-a:3===g.value?m.lam=-a-o:m.lam=a<0?-a-d:-a+d;else{var A,y,v;u=(A=l)*A,y=(u+=(v=u>=1?0:Math.sqrt(1-u)*Math.sin(a))*v)>=1?0:Math.sqrt(1-u),2===g.value?(u=y,y=-v,v=u):3===g.value?(y=-y,v=-v):4===g.value&&(u=y,y=v,v=-u),2===this.face?(u=A,A=-y,y=u):3===this.face?(A=-A,y=-y):4===this.face&&(u=A,A=y,y=-u),m.phi=Math.acos(-v)-o,m.lam=Math.atan2(y,A),2===this.face?m.lam=Ct(m.lam,-o):3===this.face?m.lam=Ct(m.lam,-d):4===this.face&&(m.lam=Ct(m.lam,+o))}return 0!==this.es&&(h=m.phi<0?1:0,p=Math.tan(m.phi),f=this.b/Math.sqrt(p*p+this.one_minus_f_squared),m.phi=Math.atan(Math.sqrt(this.a*this.a-f*f)/(this.one_minus_f*f)),h&&(m.phi=-m.phi)),m.lam+=this.long0,e.x=m.lam,e.y=m.phi,e},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]};var It=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Rt=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],Bt=.8487,Pt=1.3523,Lt=c/5,Dt=1/Lt,Ot=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))};const Nt={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(e){var t=N(e.x-this.long0),r=Math.abs(e.y),n=Math.floor(r*Lt);n<0?n=0:n>=18&&(n=17);var i={x:Ot(It[n],r=c*(r-Dt*n))*t,y:Ot(Rt[n],r)};return e.y<0&&(i.y=-i.y),i.x=i.x*this.a*Bt+this.x0,i.y=i.y*this.a*Pt+this.y0,i},inverse:function(e){var t={x:(e.x-this.x0)/(this.a*Bt),y:Math.abs(e.y-this.y0)/(this.a*Pt)};if(t.y>=1)t.x/=It[18][0],t.y=e.y<0?-o:o;else{var r=Math.floor(18*t.y);for(r<0?r=0:r>=18&&(r=17);;)if(Rt[r][0]>t.y)--r;else{if(!(Rt[r+1][0]<=t.y))break;++r}var n=Rt[r],i=5*(t.y-n[0])/(Rt[r+1][0]-n[0]);i=function(e,t,r,n){for(var i=t;n;--n){var s=e(i);if(i-=s,Math.abs(s)<1e-10)break}return i}((function(e){return(Ot(n,e)-t.y)/function(e,t){return e[1]+t*(2*e[2]+3*t*e[3])}(n,e)}),i,0,100),t.x/=Ot(It[r],i),t.y=(5*r+i)*l,e.y<0&&(t.y=-t.y)}return t.x=N(t.x+this.long0),t},names:["Robinson","robin"]},Ut={init:function(){this.name="geocent"},forward:function(e){return ne(e,this.es,this.a)},inverse:function(e){return ie(e,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]};var Ft={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};const kt={init:function(){if(Object.keys(Ft).forEach(function(e){if(void 0===this[e])this[e]=Ft[e].def;else{if(Ft[e].num&&isNaN(this[e]))throw new Error("Invalid parameter value, must be numeric "+e+" = "+this[e]);Ft[e].num&&(this[e]=parseFloat(this[e]))}Ft[e].degrees&&(this[e]=this[e]*l)}.bind(this)),Math.abs(Math.abs(this.lat0)-o)1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var e=this.tilt,t=this.azi;this.cg=Math.cos(t),this.sg=Math.sin(t),this.cw=Math.cos(e),this.sw=Math.sin(e)},forward:function(e){e.x-=this.long0;var t,r,n,i,s=Math.sin(e.y),o=Math.cos(e.y),a=Math.cos(e.x);switch(this.mode){case 3:r=this.sinph0*s+this.cosph0*o*a;break;case 2:r=o*a;break;case 1:r=-s;break;case 0:r=s}switch(t=(r=this.pn1/(this.p-r))*o*Math.sin(e.x),this.mode){case 3:r*=this.cosph0*s-this.sinph0*o*a;break;case 2:r*=s;break;case 0:r*=-o*a;break;case 1:r*=o*a}return i=1/((n=r*this.cg+t*this.sg)*this.sw*this.h1+this.cw),t=(t*this.cg-r*this.sg)*this.cw*i,r=n*i,e.x=t*this.a,e.y=r*this.a,e},inverse:function(e){e.x/=this.a,e.y/=this.a;var t,r,n,i={x:e.x,y:e.y};n=1/(this.pn1-e.y*this.sw),t=this.pn1*e.x*n,r=this.pn1*e.y*this.cw*n,e.x=t*this.cg+r*this.sg,e.y=r*this.cg-t*this.sg;var s=Ge(e.x,e.y);if(Math.abs(s)1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var e=1-this.es,t=1/e;this.radius_p=Math.sqrt(e),this.radius_p2=e,this.radius_p_inv2=t,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")},forward:function(e){var t,r,n,i,s=e.x,o=e.y;if(s-=this.long0,"ellipse"===this.shape){o=Math.atan(this.radius_p2*Math.tan(o));var a=this.radius_p/Ge(this.radius_p*Math.cos(o),Math.sin(o));if(r=a*Math.cos(s)*Math.cos(o),n=a*Math.sin(s)*Math.cos(o),i=a*Math.sin(o),(this.radius_g-r)*r-n*n-i*i*this.radius_p_inv2<0)return e.x=Number.NaN,e.y=Number.NaN,e;t=this.radius_g-r,this.flip_axis?(e.x=this.radius_g_1*Math.atan(n/Ge(i,t)),e.y=this.radius_g_1*Math.atan(i/t)):(e.x=this.radius_g_1*Math.atan(n/t),e.y=this.radius_g_1*Math.atan(i/Ge(n,t)))}else"sphere"===this.shape&&(t=Math.cos(o),r=Math.cos(s)*t,n=Math.sin(s)*t,i=Math.sin(o),t=this.radius_g-r,this.flip_axis?(e.x=this.radius_g_1*Math.atan(n/Ge(i,t)),e.y=this.radius_g_1*Math.atan(i/t)):(e.x=this.radius_g_1*Math.atan(n/t),e.y=this.radius_g_1*Math.atan(i/Ge(n,t))));return e.x=e.x*this.a,e.y=e.y*this.a,e},inverse:function(e){var t,r,n,i,s=-1,o=0,a=0;if(e.x=e.x/this.a,e.y=e.y/this.a,"ellipse"===this.shape){this.flip_axis?(a=Math.tan(e.y/this.radius_g_1),o=Math.tan(e.x/this.radius_g_1)*Ge(1,a)):(o=Math.tan(e.x/this.radius_g_1),a=Math.tan(e.y/this.radius_g_1)*Ge(1,o));var l=a/this.radius_p;if(t=o*o+l*l+s*s,(n=(r=2*this.radius_g*s)*r-4*t*this.C)<0)return e.x=Number.NaN,e.y=Number.NaN,e;i=(-r-Math.sqrt(n))/(2*t),s=this.radius_g+i*s,o*=i,a*=i,e.x=Math.atan2(o,s),e.y=Math.atan(a*Math.cos(e.x)/s),e.y=Math.atan(this.radius_p_inv2*Math.tan(e.y))}else if("sphere"===this.shape){if(this.flip_axis?(a=Math.tan(e.y/this.radius_g_1),o=Math.tan(e.x/this.radius_g_1)*Math.sqrt(1+a*a)):(o=Math.tan(e.x/this.radius_g_1),a=Math.tan(e.y/this.radius_g_1)*Math.sqrt(1+o*o)),t=o*o+a*a+s*s,(n=(r=2*this.radius_g*s)*r-4*t*this.C)<0)return e.x=Number.NaN,e.y=Number.NaN,e;i=(-r-Math.sqrt(n))/(2*t),s=this.radius_g+i*s,o*=i,a*=i,e.x=Math.atan2(o,s),e.y=Math.atan(a*Math.cos(e.x)/s)}return e.x=e.x+this.long0,e},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]};var Gt=1.340264,Qt=-.081106,Vt=893e-6,Ht=.003796,jt=Math.sqrt(3)/2;const qt={init:function(){this.es=0,this.long0=void 0!==this.long0?this.long0:0},forward:function(e){var t=N(e.x-this.long0),r=e.y,n=Math.asin(jt*Math.sin(r)),i=n*n,s=i*i*i;return e.x=t*Math.cos(n)/(jt*(Gt+3*Qt*i+s*(7*Vt+9*Ht*i))),e.y=n*(Gt+Qt*i+s*(Vt+Ht*i)),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e},inverse:function(e){e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a;var t,r,n,i,s=e.y;for(i=0;i<12&&(s-=n=(s*(Gt+Qt*(t=s*s)+(r=t*t*t)*(Vt+Ht*t))-e.y)/(Gt+3*Qt*t+r*(7*Vt+9*Ht*t)),!(Math.abs(n)<1e-9));++i);return r=(t=s*s)*t*t,e.x=jt*e.x*(Gt+3*Qt*t+r*(7*Vt+9*Ht*t))/Math.cos(s),e.y=Math.asin(Math.sin(s)/jt),e.x=N(e.x+this.long0),e},names:["eqearth","Equal Earth","Equal_Earth"]};var Wt=1e-10;function Yt(e){var t,r,n,i=N(e.x-(this.long0||0)),s=e.y;return t=this.am1+this.m1-Ue(s,r=Math.sin(s),n=Math.cos(s),this.en),r=n*i/(t*Math.sqrt(1-this.es*r*r)),e.x=t*Math.sin(r),e.y=this.am1-t*Math.cos(r),e.x=this.a*e.x+(this.x0||0),e.y=this.a*e.y+(this.y0||0),e}function Xt(e){var t,r,n,i;if(e.x=(e.x-(this.x0||0))/this.a,e.y=(e.y-(this.y0||0))/this.a,r=Ge(e.x,e.y=this.am1-e.y),i=Fe(this.am1+this.m1-r,this.es,this.en),(t=Math.abs(i))Wt?(e.x=r*Math.sin(t=n*Math.cos(i)/r),e.y=this.cphi1-r*Math.cos(t)):e.x=e.y=0,e.x=this.a*e.x+(this.x0||0),e.y=this.a*e.y+(this.y0||0),e}function $t(e){var t,r;e.x=(e.x-(this.x0||0))/this.a,e.y=(e.y-(this.y0||0))/this.a;var n=Ge(e.x,e.y=this.cphi1-e.y);if(r=this.cphi1+this.phi1-n,Math.abs(r)>o)throw new Error;return t=Math.abs(Math.abs(r)-o)<=Wt?0:n*Math.atan2(e.x,e.y)/Math.cos(r),e.x=N(t+(this.long0||0)),e.y=at(r),e}const Jt={init:function(){var e;if(this.phi1=this.lat1,Math.abs(this.phi1)=o?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=$t,this.forward=Kt)},names:["bonne","Bonne (Werner lat_1=90)"]};var Zt;ge.defaultDatum="WGS84",ge.Proj=re,ge.WGS84=new ge.Proj("WGS84"),ge.Point=Pe,ge.toPoint=ue,ge.defs=R,ge.nadgrid=function(e,t){var r=new DataView(t),n=function(e){var t=e.getInt32(8,!1);return 11!==t&&(11!==(t=e.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}(r),i=function(e,t){return{nFields:e.getInt32(8,t),nSubgridFields:e.getInt32(24,t),nSubgrids:e.getInt32(40,t),shiftType:$(e,56,64).trim(),fromSemiMajorAxis:e.getFloat64(120,t),fromSemiMinorAxis:e.getFloat64(136,t),toSemiMajorAxis:e.getFloat64(152,t),toSemiMinorAxis:e.getFloat64(168,t)}}(r,n),s=function(e,t,r){for(var n=176,i=[],s=0;s{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serialize=t.deserialize=t.registerSerializer=void 0;const n=r(25914);let i=n.DefaultSerializer;t.registerSerializer=function(e){i=n.extendSerializer(i,e)},t.deserialize=function(e){return i.deserialize(e)},t.serialize=function(e){return i.serialize(e)}},40447:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.Transfer=t.DefaultSerializer=t.expose=t.registerSerializer=void 0;var s=r(99278);Object.defineProperty(t,"registerSerializer",{enumerable:!0,get:function(){return s.registerSerializer}}),i(r(26838),t);var o=r(11854);Object.defineProperty(t,"expose",{enumerable:!0,get:function(){return o.expose}});var a=r(25914);Object.defineProperty(t,"DefaultSerializer",{enumerable:!0,get:function(){return a.DefaultSerializer}});var l=r(66712);Object.defineProperty(t,"Transfer",{enumerable:!0,get:function(){return l.Transfer}})},11029:(e,t)=>{"use strict";let r;function n(e){return(""+e).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\/\/.+)?\/[^/]+(?:\?.*)?$/,"$1")+"/"}Object.defineProperty(t,"__esModule",{value:!0}),t.getBundleURL=t.getBaseURL=void 0,t.getBundleURL=function(){return r||(r=function(){try{throw new Error}catch(e){const t=(""+e.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\/\/[^)\n]+/g);if(t)return n(t[0])}return"/"}()),r},t.getBaseURL=n},81592:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isWorkerRuntime=t.getWorkerImplementation=t.defaultPoolSize=void 0;const n=r(11029);t.defaultPoolSize="undefined"!=typeof navigator&&navigator.hardwareConcurrency?navigator.hardwareConcurrency:4;const i=e=>/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e);function s(e){const t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}let o;t.getWorkerImplementation=function(){return o||(o=function(){if("undefined"==typeof Worker)return class{constructor(){throw Error("No web worker implementation available. You might have tried to spawn a worker within a worker in a browser that doesn't support workers in workers.")}};class e extends Worker{constructor(e,t){var r,o;"string"==typeof e&&t&&t._baseURL?e=new URL(e,t._baseURL):"string"==typeof e&&!i(e)&&n.getBundleURL().match(/^file:\/\//i)&&(e=new URL(e,n.getBundleURL().replace(/\/[^\/]+$/,"/")),(null===(r=null==t?void 0:t.CORSWorkaround)||void 0===r||r)&&(e=s(`importScripts(${JSON.stringify(e)});`))),"string"==typeof e&&i(e)&&(null===(o=null==t?void 0:t.CORSWorkaround)||void 0===o||o)&&(e=s(`importScripts(${JSON.stringify(e)});`)),super(e,t)}}class t extends e{constructor(e,t){super(window.URL.createObjectURL(e),t)}static fromText(e,r){const n=new window.Blob([e],{type:"text/javascript"});return new t(n,r)}}return{blob:t,default:e}}()),o},t.isWorkerRuntime=function(){const e="undefined"!=typeof self&&"undefined"!=typeof Window&&self instanceof Window;return!("undefined"==typeof self||!self.postMessage||e)}},26838:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Worker=t.BlobWorker=t.isWorkerRuntime=t.Thread=t.spawn=t.Pool=void 0;const n=r(81592);Object.defineProperty(t,"isWorkerRuntime",{enumerable:!0,get:function(){return n.isWorkerRuntime}});var i=r(52734);Object.defineProperty(t,"Pool",{enumerable:!0,get:function(){return i.Pool}});var s=r(24949);Object.defineProperty(t,"spawn",{enumerable:!0,get:function(){return s.spawn}});var o=r(62996);Object.defineProperty(t,"Thread",{enumerable:!0,get:function(){return o.Thread}}),t.BlobWorker=n.getWorkerImplementation().blob,t.Worker=n.getWorkerImplementation().default},48215:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createProxyModule=t.createProxyFunction=void 0;const i=n(r(17833)),s=r(54527),o=r(99278),a=r(41898),l=r(66712),c=r(12781),u=i.default("threads:master:messages");let h=1;function d(e,t){return(...r)=>{const n=h++,{args:i,transferables:d}=function(e){if(0===e.length)return{args:[],transferables:[]};const t=[],r=[];for(const n of e)l.isTransferDescriptor(n)?(t.push(o.serialize(n.send)),r.push(...n.transferables)):t.push(o.serialize(n));return{args:t,transferables:0===r.length?r:(n=r,Array.from(new Set(n)))};var n}(r),p={type:c.MasterMessageType.run,uid:n,method:t,args:i};u("Sending command to run function to worker:",p);try{e.postMessage(p,d)}catch(e){return a.ObservablePromise.from(Promise.reject(e))}return a.ObservablePromise.from(s.multicast(function(e,t){return new s.Observable((r=>{let n;const i=s=>{var a;if(u("Message from worker:",s.data),s.data&&s.data.uid===t)if((a=s.data)&&a.type===c.WorkerMessageType.running)n=s.data.resultType;else if((e=>e&&e.type===c.WorkerMessageType.result)(s.data))"promise"===n?(void 0!==s.data.payload&&r.next(o.deserialize(s.data.payload)),r.complete(),e.removeEventListener("message",i)):(s.data.payload&&r.next(o.deserialize(s.data.payload)),s.data.complete&&(r.complete(),e.removeEventListener("message",i)));else if((e=>e&&e.type===c.WorkerMessageType.error)(s.data)){const t=o.deserialize(s.data.error);r.error(t),e.removeEventListener("message",i)}};return e.addEventListener("message",i),()=>{if("observable"===n||!n){const r={type:c.MasterMessageType.cancel,uid:t};e.postMessage(r)}e.removeEventListener("message",i)}}))}(e,n)))}}t.createProxyFunction=d,t.createProxyModule=function(e,t){const r={};for(const n of t)r[n]=d(e,n);return r}},72882:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.PoolEventType=void 0,(r=t.PoolEventType||(t.PoolEventType={})).initialized="initialized",r.taskCanceled="taskCanceled",r.taskCompleted="taskCompleted",r.taskFailed="taskFailed",r.taskQueued="taskQueued",r.taskQueueDrained="taskQueueDrained",r.taskStart="taskStart",r.terminated="terminated"},52734:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}l((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Pool=t.Thread=t.PoolEventType=void 0;const s=i(r(17833)),o=r(54527),a=r(7709),l=r(81592),c=r(72882);Object.defineProperty(t,"PoolEventType",{enumerable:!0,get:function(){return c.PoolEventType}});const u=r(62996);Object.defineProperty(t,"Thread",{enumerable:!0,get:function(){return u.Thread}});let h=1;class d{constructor(e,t){this.eventSubject=new o.Subject,this.initErrors=[],this.isClosing=!1,this.nextTaskID=1,this.taskQueue=[];const r="number"==typeof t?{size:t}:t||{},{size:n=l.defaultPoolSize}=r;var i;this.debug=s.default(`threads:pool:${i=r.name||String(h++),i.replace(/\W/g," ").trim().replace(/\s+/g,"-")}`),this.options=r,this.workers=function(e,t){return function(e){const t=[];for(let r=0;r({init:e(),runningTasks:[]})))}(e,n),this.eventObservable=o.multicast(o.Observable.from(this.eventSubject)),Promise.all(this.workers.map((e=>e.init))).then((()=>this.eventSubject.next({type:c.PoolEventType.initialized,size:this.workers.length})),(e=>{this.debug("Error while initializing pool worker:",e),this.eventSubject.error(e),this.initErrors.push(e)}))}findIdlingWorker(){const{concurrency:e=1}=this.options;return this.workers.find((t=>t.runningTasks.lengthn(this,void 0,void 0,(function*(){yield new Promise((e=>setTimeout(e,0)));try{yield this.runPoolTask(e,t)}finally{e.runningTasks=e.runningTasks.filter((e=>e!==r)),this.isClosing||this.scheduleWork()}})))();e.runningTasks.push(r)}))}scheduleWork(){this.debug("Attempt de-queueing a task in order to run it...");const e=this.findIdlingWorker();if(!e)return;const t=this.taskQueue.shift();if(!t)return this.debug("Task queue is empty"),void this.eventSubject.next({type:c.PoolEventType.taskQueueDrained});this.run(e,t)}taskCompletion(e){return new Promise(((t,r)=>{const n=this.events().subscribe((i=>{i.type===c.PoolEventType.taskCompleted&&i.taskID===e?(n.unsubscribe(),t(i.returnValue)):i.type===c.PoolEventType.taskFailed&&i.taskID===e?(n.unsubscribe(),r(i.error)):i.type===c.PoolEventType.terminated&&(n.unsubscribe(),r(Error("Pool has been terminated before task was run.")))}))}))}settled(e=!1){return n(this,void 0,void 0,(function*(){const t=()=>{return e=this.workers,t=e=>e.runningTasks,e.reduce(((e,r)=>[...e,...t(r)]),[]);var e,t},r=[],n=this.eventObservable.subscribe((e=>{e.type===c.PoolEventType.taskFailed&&r.push(e.error)}));return this.initErrors.length>0?Promise.reject(this.initErrors[0]):e&&0===this.taskQueue.length?(yield a.allSettled(t()),r):(yield new Promise(((e,t)=>{const r=this.eventObservable.subscribe({next(t){t.type===c.PoolEventType.taskQueueDrained&&(r.unsubscribe(),e(void 0))},error:t})})),yield a.allSettled(t()),n.unsubscribe(),r)}))}completed(e=!1){return n(this,void 0,void 0,(function*(){const t=this.settled(e),r=new Promise(((e,r)=>{const n=this.eventObservable.subscribe({next(i){i.type===c.PoolEventType.taskQueueDrained?(n.unsubscribe(),e(t)):i.type===c.PoolEventType.taskFailed&&(n.unsubscribe(),r(i.error))},error:r})})),n=yield Promise.race([t,r]);if(n.length>0)throw n[0]}))}events(){return this.eventObservable}queue(e){const{maxQueuedJobs:t=1/0}=this.options;if(this.isClosing)throw Error("Cannot schedule pool tasks after terminate() has been called.");if(this.initErrors.length>0)throw this.initErrors[0];const r=this.nextTaskID++,n=this.taskCompletion(r);n.catch((e=>{this.debug(`Task #${r} errored:`,e)}));const i={id:r,run:e,cancel:()=>{-1!==this.taskQueue.indexOf(i)&&(this.taskQueue=this.taskQueue.filter((e=>e!==i)),this.eventSubject.next({type:c.PoolEventType.taskCanceled,taskID:i.id}))},then:n.then.bind(n)};if(this.taskQueue.length>=t)throw Error("Maximum number of pool tasks queued. Refusing to queue another one.\nThis usually happens for one of two reasons: We are either at peak workload right now or some tasks just won't finish, thus blocking the pool.");return this.debug(`Queueing task #${i.id}...`),this.taskQueue.push(i),this.eventSubject.next({type:c.PoolEventType.taskQueued,taskID:i.id}),this.scheduleWork(),i}terminate(e){return n(this,void 0,void 0,(function*(){this.isClosing=!0,e||(yield this.completed(!0)),this.eventSubject.next({type:c.PoolEventType.terminated,remainingQueue:[...this.taskQueue]}),this.eventSubject.complete(),yield Promise.all(this.workers.map((e=>n(this,void 0,void 0,(function*(){return u.Thread.terminate(yield e.init)})))))}))}}function p(e,t){return new d(e,t)}d.EventType=c.PoolEventType,p.EventType=c.PoolEventType,t.Pool=p},24949:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}l((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.spawn=void 0;const s=i(r(17833)),o=r(54527),a=r(99278),l=r(54238),c=r(83682),u=r(72931),h=r(48215),d=s.default("threads:master:messages"),p=s.default("threads:master:spawn"),f=s.default("threads:master:thread-utils"),m="undefined"!=typeof process&&process.env.THREADS_WORKER_INIT_TIMEOUT?Number.parseInt(process.env.THREADS_WORKER_INIT_TIMEOUT,10):1e4;function g(e,t,r,n){const i=r.filter((e=>e.type===u.WorkerEventType.internalError)).map((e=>e.error));return Object.assign(e,{[c.$errors]:i,[c.$events]:r,[c.$terminate]:n,[c.$worker]:t})}t.spawn=function(e,t){return n(this,void 0,void 0,(function*(){p("Initializing new thread");const r=t&&t.timeout?t.timeout:m,i=yield function(e,t,r){return n(this,void 0,void 0,(function*(){let n;const i=new Promise(((e,i)=>{n=setTimeout((()=>i(Error(r))),t)})),s=yield Promise.race([e,i]);return clearTimeout(n),s}))}(function(e){return new Promise(((t,r)=>{const n=i=>{var s;d("Message from worker before finishing initialization:",i.data),(s=i.data)&&"init"===s.type?(e.removeEventListener("message",n),t(i.data)):(e=>e&&"uncaughtError"===e.type)(i.data)&&(e.removeEventListener("message",n),r(a.deserialize(i.data.error)))};e.addEventListener("message",n)}))}(e),r,`Timeout: Did not receive an init message from worker after ${r}ms. Make sure the worker calls expose().`),s=i.exposed,{termination:c,terminate:A}=function(e){const[t,r]=l.createPromiseWithResolver();return{terminate:()=>n(this,void 0,void 0,(function*(){f("Terminating worker"),yield e.terminate(),r()})),termination:t}}(e),y=function(e,t){return new o.Observable((r=>{const n=e=>{const t={type:u.WorkerEventType.message,data:e.data};r.next(t)},i=e=>{f("Unhandled promise rejection event in thread:",e);const t={type:u.WorkerEventType.internalError,error:Error(e.reason)};r.next(t)};e.addEventListener("message",n),e.addEventListener("unhandledrejection",i),t.then((()=>{const t={type:u.WorkerEventType.termination};e.removeEventListener("message",n),e.removeEventListener("unhandledrejection",i),r.next(t),r.complete()}))}))}(e,c);if("function"===s.type)return g(h.createProxyFunction(e),e,y,A);if("module"===s.type)return g(h.createProxyModule(e,s.methods),e,y,A);{const e=s.type;throw Error(`Worker init message states unexpected type of expose(): ${e}`)}}))}},62996:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Thread=void 0;const n=r(83682);function i(e){throw Error(e)}t.Thread={errors:e=>e[n.$errors]||i("Error observable not found. Make sure to pass a thread instance as returned by the spawn() promise."),events:e=>e[n.$events]||i("Events observable not found. Make sure to pass a thread instance as returned by the spawn() promise."),terminate:e=>e[n.$terminate]()}},41898:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObservablePromise=void 0;const n=r(54527),i=()=>{},s=e=>e,o=e=>Promise.resolve().then(e);function a(e){throw e}class l extends n.Observable{constructor(e){super((t=>{const r=this,n=Object.assign(Object.assign({},t),{complete(){t.complete(),r.onCompletion()},error(e){t.error(e),r.onError(e)},next(e){t.next(e),r.onNext(e)}});try{return this.initHasRun=!0,e(n)}catch(e){n.error(e)}})),this.initHasRun=!1,this.fulfillmentCallbacks=[],this.rejectionCallbacks=[],this.firstValueSet=!1,this.state="pending"}onNext(e){this.firstValueSet||(this.firstValue=e,this.firstValueSet=!0)}onError(e){this.state="rejected",this.rejection=e;for(const t of this.rejectionCallbacks)o((()=>t(e)))}onCompletion(){this.state="fulfilled";for(const e of this.fulfillmentCallbacks)o((()=>e(this.firstValue)))}then(e,t){const r=e||s,n=t||a;let i=!1;return new Promise(((e,t)=>{const s=r=>{if(!i){i=!0;try{e(n(r))}catch(e){t(e)}}};return this.initHasRun||this.subscribe({error:s}),"fulfilled"===this.state?e(r(this.firstValue)):"rejected"===this.state?(i=!0,e(n(this.rejection))):(this.fulfillmentCallbacks.push((t=>{try{e(r(t))}catch(e){s(e)}})),void this.rejectionCallbacks.push(s))}))}catch(e){return this.then(void 0,e)}finally(e){const t=e||i;return this.then((e=>(t(),e)),(()=>t()))}static from(e){return function(e){return e&&"function"==typeof e.then}(e)?new l((t=>{e.then((e=>{t.next(e),t.complete()}),(e=>{t.error(e)}))})):super.from(e)}}t.ObservablePromise=l},7709:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.allSettled=void 0,t.allSettled=function(e){return Promise.all(e.map((e=>{const t=e=>({status:"fulfilled",value:e}),r=e=>({status:"rejected",reason:e}),n=Promise.resolve(e);try{return n.then(t,r)}catch(e){return Promise.reject(e)}})))}},54238:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPromiseWithResolver=void 0;const r=()=>{};t.createPromiseWithResolver=function(){let e,t=!1,n=r;return[new Promise((r=>{t?r(e):n=r})),r=>{t=!0,e=r,n(e)}]}},25914:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultSerializer=t.extendSerializer=void 0,t.extendSerializer=function(e,t){const r=e.deserialize.bind(e),n=e.serialize.bind(e);return{deserialize:e=>t.deserialize(e,r),serialize:e=>t.serialize(e,n)}};const r=e=>Object.assign(Error(e.message),{name:e.name,stack:e.stack}),n=e=>({__error_marker:"$$error",message:e.message,name:e.name,stack:e.stack});t.DefaultSerializer={deserialize(e){return(t=e)&&"object"==typeof t&&"__error_marker"in t&&"$$error"===t.__error_marker?r(e):e;var t},serialize:e=>e instanceof Error?n(e):e}},83682:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.$worker=t.$transferable=t.$terminate=t.$events=t.$errors=void 0,t.$errors=Symbol("thread.errors"),t.$events=Symbol("thread.events"),t.$terminate=Symbol("thread.terminate"),t.$transferable=Symbol("thread.transferable"),t.$worker=Symbol("thread.worker")},66712:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Transfer=t.isTransferDescriptor=void 0;const n=r(83682);t.isTransferDescriptor=function(e){return e&&"object"==typeof e&&e[n.$transferable]},t.Transfer=function(e,t){if(!t){if(!(r=e)||"object"!=typeof r)throw Error();t=[e]}var r;return{[n.$transferable]:!0,send:e,transferables:t}}},72931:(e,t,r)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerEventType=void 0,r(83682),(n=t.WorkerEventType||(t.WorkerEventType={})).internalError="internalError",n.message="message",n.termination="termination"},12781:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerMessageType=t.MasterMessageType=void 0,(n=t.MasterMessageType||(t.MasterMessageType={})).cancel="cancel",n.run="run",(r=t.WorkerMessageType||(t.WorkerMessageType={})).error="error",r.init="init",r.result="result",r.running="running",r.uncaughtError="uncaughtError"},64304:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={isWorkerRuntime:function(){const e="undefined"!=typeof self&&"undefined"!=typeof Window&&self instanceof Window;return!("undefined"==typeof self||!self.postMessage||e)},postMessageToMaster:function(e,t){self.postMessage(e,t)},subscribeToMasterMessages:function(e){const t=t=>{e(t.data)};return self.addEventListener("message",t),()=>{self.removeEventListener("message",t)}}}},11854:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}l((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.expose=t.isWorkerRuntime=t.Transfer=t.registerSerializer=void 0;const s=i(r(95409)),o=r(99278),a=r(66712),l=r(12781),c=i(r(64304));var u=r(99278);Object.defineProperty(t,"registerSerializer",{enumerable:!0,get:function(){return u.registerSerializer}});var h=r(66712);Object.defineProperty(t,"Transfer",{enumerable:!0,get:function(){return h.Transfer}}),t.isWorkerRuntime=c.default.isWorkerRuntime;let d=!1;const p=new Map,f=e=>e&&e.type===l.MasterMessageType.run,m=e=>s.default(e)||function(e){return e&&"object"==typeof e&&"function"==typeof e.subscribe}(e);function g(e){return a.isTransferDescriptor(e)?{payload:e.send,transferables:e.transferables}:{payload:e,transferables:void 0}}function A(e,t){const{payload:r,transferables:n}=g(t),i={type:l.WorkerMessageType.error,uid:e,error:o.serialize(r)};c.default.postMessageToMaster(i,n)}function y(e,t,r){const{payload:n,transferables:i}=g(r),s={type:l.WorkerMessageType.result,uid:e,complete:!!t||void 0,payload:n};c.default.postMessageToMaster(s,i)}function v(e){try{const t={type:l.WorkerMessageType.uncaughtError,error:o.serialize(e)};c.default.postMessageToMaster(t)}catch(t){console.error("Not reporting uncaught error back to master thread as it occured while reporting an uncaught error already.\nLatest error:",t,"\nOriginal error:",e)}}function x(e,t,r){return n(this,void 0,void 0,(function*(){let n;try{n=t(...r)}catch(t){return A(e,t)}const i=m(n)?"observable":"promise";if(function(e,t){const r={type:l.WorkerMessageType.running,uid:e,resultType:t};c.default.postMessageToMaster(r)}(e,i),m(n)){const t=n.subscribe((t=>y(e,!1,o.serialize(t))),(t=>{A(e,o.serialize(t)),p.delete(e)}),(()=>{y(e,!0),p.delete(e)}));p.set(e,t)}else try{const t=yield n;y(e,!0,o.serialize(t))}catch(t){A(e,o.serialize(t))}}))}t.expose=function(e){if(!c.default.isWorkerRuntime())throw Error("expose() called in the master thread.");if(d)throw Error("expose() called more than once. This is not possible. Pass an object to expose() if you want to expose multiple functions.");if(d=!0,"function"==typeof e)c.default.subscribeToMasterMessages((t=>{f(t)&&!t.method&&x(t.uid,e,t.args.map(o.deserialize))})),function(){const e={type:l.WorkerMessageType.init,exposed:{type:"function"}};c.default.postMessageToMaster(e)}();else{if("object"!=typeof e||!e)throw Error(`Invalid argument passed to expose(). Expected a function or an object, got: ${e}`);c.default.subscribeToMasterMessages((t=>{f(t)&&t.method&&x(t.uid,e[t.method],t.args.map(o.deserialize))})),function(e){const t={type:l.WorkerMessageType.init,exposed:{type:"module",methods:e}};c.default.postMessageToMaster(t)}(Object.keys(e).filter((t=>"function"==typeof e[t])))}c.default.subscribeToMasterMessages((e=>{if((t=e)&&t.type===l.MasterMessageType.cancel){const t=e.uid,r=p.get(t);r&&(r.unsubscribe(),p.delete(t))}var t}))},"undefined"!=typeof self&&"function"==typeof self.addEventListener&&c.default.isWorkerRuntime()&&(self.addEventListener("error",(e=>{setTimeout((()=>v(e.error||e)),250)})),self.addEventListener("unhandledrejection",(e=>{const t=e.reason;t&&"string"==typeof t.message&&setTimeout((()=>v(t)),250)}))),"undefined"!=typeof process&&"function"==typeof process.on&&c.default.isWorkerRuntime()&&(process.on("uncaughtException",(e=>{setTimeout((()=>v(e)),250)})),process.on("unhandledRejection",(e=>{e&&"string"==typeof e.message&&setTimeout((()=>v(e)),250)})))},10539:()=>{},11025:(e,t,r)=>{"use strict";r(52675),r(89463),r(66412),r(60193),r(92168),r(2259),r(86964),r(83142),r(83237),r(61833),r(67947),r(31073),r(45700),r(78125),r(20326),r(16280),r(76918),r(30067),r(4294),r(18107),r(28706),r(26835),r(88431),r(33771),r(2008),r(50113),r(48980),r(10838),r(13451),r(46449),r(78350),r(51629),r(23418),r(74423),r(25276),r(64346),r(23792),r(48598),r(8921),r(62062),r(31051),r(44114),r(72712),r(18863),r(94490),r(34782),r(15086),r(26910),r(87478),r(54554),r(9678),r(57145),r(71658),r(93514),r(30237),r(13609),r(11558),r(54743),r(46761),r(11745),r(38309),r(16573),r(78100),r(77936),r(61699),r(59089),r(91191),r(93515),r(1688),r(60739),r(89572),r(23288),r(36456),r(94170),r(48957),r(62010),r(55081),r(33110),r(4731),r(36033),r(47072),r(93153),r(82326),r(36389),r(64444),r(8085),r(77762),r(65070),r(60605),r(39469),r(72152),r(75376),r(56624),r(11367),r(5914),r(78553),r(98690),r(60479),r(70761),r(2892),r(45374),r(25428),r(32637),r(40150),r(59149),r(64601),r(44435),r(87220),r(25843),r(62337),r(9868),r(80630),r(69085),r(59904),r(17427),r(67945),r(84185),r(87607),r(5506),r(52811),r(53921),r(83851),r(81278),r(1480),r(40875),r(77691),r(78347),r(29908),r(94052),r(94003),r(221),r(79432),r(9220),r(7904),r(93967),r(63548),r(93941),r(10287),r(26099),r(16034),r(78459),r(58940),r(3362),r(96167),r(93518),r(9391),r(14628),r(39796),r(60825),r(87411),r(21211),r(40888),r(9065),r(86565),r(32812),r(84634),r(71137),r(30985),r(34268),r(34873),r(15472),r(84864),r(57465),r(27495),r(69479),r(87745),r(90906),r(38781),r(31415),r(17642),r(58004),r(33853),r(45876),r(32475),r(15024),r(31698),r(67357),r(23860),r(99449),r(27337),r(21699),r(42043),r(47764),r(71761),r(28543),r(35701),r(68156),r(85906),r(42781),r(25440),r(79978),r(5746),r(90744),r(11392),r(50375),r(67438),r(42762),r(39202),r(43359),r(89907),r(11898),r(35490),r(5745),r(94298),r(60268),r(69546),r(20781),r(50778),r(89195),r(46276),r(48718),r(16308),r(34594),r(29833),r(46594),r(72107),r(95477),r(21489),r(22134),r(3690),r(61740),r(48140),r(81630),r(72170),r(75044),r(69539),r(31694),r(89955),r(21903),r(91134),r(33206),r(48345),r(44496),r(66651),r(12887),r(19369),r(66812),r(8995),r(52568),r(31575),r(36072),r(88747),r(28845),r(29423),r(57301),r(373),r(86614),r(41405),r(37467),r(44732),r(33684),r(79577),r(88267),r(73772),r(30958),r(49806),r(39687),r(26148),r(34504),r(87370),r(31659),r(95115),r(17978),r(46058),r(6986),r(88177),r(80081),r(45490),r(17656),r(55105),r(54151),r(72400),r(73677),r(61938),r(85901),r(26280),r(27913),r(47801),r(82750),r(33811),r(84847),r(74147),r(29150),r(74648),r(17333),r(3064),r(32679),r(9920),r(46967),r(45182),r(41393),r(14905),r(8159),r(39320),r(86994),r(24964),r(7467),r(10586),r(47390),r(81332),r(9730),r(56192),r(66557),r(83354),r(98225),r(37998),r(16401),r(18640),r(62480),r(98992),r(51098),r(16037),r(64743),r(23215),r(54520),r(72577),r(30670),r(3949),r(45882),r(76913),r(81454),r(75289),r(8872),r(37550),r(27413),r(41795),r(81730),r(67296),r(58335),r(33981),r(71517),r(11379),r(93777),r(14190),r(12359),r(86097),r(39172),r(57019),r(17273),r(81723),r(27415),r(19929),r(37583),r(55122),r(16385),r(20230),r(57268),r(79733),r(19717),r(52231),r(58179),r(30456),r(74017),r(79310),r(16453),r(83062),r(96369),r(15637),r(2848),r(24842),r(24746),r(33454),r(6660),r(4235),r(15941),r(82101),r(79926),r(84208),r(91550),r(9156),r(48918),r(66090),r(2917),r(35874),r(47575),r(47628),r(43799),r(65186),r(42978),r(72527),r(79852),r(42376),r(40617),r(73067),r(66820),r(8288),r(37108),r(25509),r(65223),r(43375),r(60321),r(41927),r(11632),r(64377),r(49522),r(39225),r(66771),r(13972),r(12516),r(99209),r(68931),r(25714),r(52514),r(35694),r(52774),r(23283),r(49536),r(21926),r(17561),r(16864),r(66197),r(16215),r(78898),r(84114),r(74176),r(66337),r(44590),r(38344),r(12041),r(51755),r(81202),r(49604),r(43275),r(13070),r(87153),r(53032),r(53803),r(13976),r(30465),r(18999),r(42793),r(77208),r(73440),r(13195),r(51839),r(14037),r(47350),r(91706),r(96847),r(23241),r(43250),r(10149),r(67302),r(55871),r(24082),r(57051),r(27650),r(41549),r(49797),r(49631),r(35623),r(67348),r(26957),r(79732),r(35644),r(49634),r(83742),r(56422),r(82451),r(46270),r(2945),r(42207),r(23500),r(62953),r(55815),r(64979),r(79739),r(59848),r(122),r(13611),r(71678),r(76031),r(3296),r(2222),r(45781),r(27208),r(48408),r(14603),r(47566),r(98721),r(19167)},44847:(e,t,r)=>{"use strict";r(11025)},79306:(e,t,r)=>{"use strict";var n=r(94901),i=r(16823),s=TypeError;e.exports=function(e){if(n(e))return e;throw new s(i(e)+" is not a function")}},35548:(e,t,r)=>{"use strict";var n=r(33517),i=r(16823),s=TypeError;e.exports=function(e){if(n(e))return e;throw new s(i(e)+" is not a constructor")}},24194:(e,t,r)=>{"use strict";var n=r(36955),i=TypeError;e.exports=function(e){if("DataView"===n(e))return e;throw new i("Argument is not a DataView")}},36194:(e,t,r)=>{"use strict";var n=r(72248).has;e.exports=function(e){return n(e),e}},73506:(e,t,r)=>{"use strict";var n=r(13925),i=String,s=TypeError;e.exports=function(e){if(n(e))return e;throw new s("Can't set "+i(e)+" as a prototype")}},97080:(e,t,r)=>{"use strict";var n=r(94402).has;e.exports=function(e){return n(e),e}},63463:e=>{"use strict";var t=TypeError;e.exports=function(e){if("string"==typeof e)return e;throw new t("Argument is not a string")}},76557:(e,t,r)=>{"use strict";var n=r(44995).has;e.exports=function(e){return n(e),e}},23755:(e,t,r)=>{"use strict";var n=r(88205).has;e.exports=function(e){return n(e),e}},91021:(e,t,r)=>{"use strict";var n=r(69565),i=r(79504),s=r(76080),o=r(28551),a=r(79306),l=r(64117),c=r(55966),u=r(78227),h=u("asyncDispose"),d=u("dispose"),p=i([].push),f=function(e,t,r){return arguments.length<3&&!l(e)&&(r=a(function(e,t){if("async-dispose"===t){var r=c(e,h);return void 0!==r||void 0===(r=c(e,d))?r:function(){n(r,this)}}return c(e,d)}(o(e),t))),void 0===r?function(){}:s(r,e)};e.exports=function(e,t,r,n){var i;if(arguments.length<4){if(l(t)&&"sync-dispose"===r)return;i=f(t,r)}else i=f(void 0,r,n);p(e.stack,i)}},6469:(e,t,r)=>{"use strict";var n=r(78227),i=r(2360),s=r(24913).f,o=n("unscopables"),a=Array.prototype;void 0===a[o]&&s(a,o,{configurable:!0,value:i(null)}),e.exports=function(e){a[o][e]=!0}},57829:(e,t,r)=>{"use strict";var n=r(68183).charAt;e.exports=function(e,t,r){return t+(r?n(e,t).length:1)}},90679:(e,t,r)=>{"use strict";var n=r(1625),i=TypeError;e.exports=function(e,t){if(n(t,e))return e;throw new i("Incorrect invocation")}},83972:(e,t,r)=>{"use strict";var n=r(20034),i=String,s=TypeError;e.exports=function(e){if(void 0===e||n(e))return e;throw new s(i(e)+" is not an object or undefined")}},28551:(e,t,r)=>{"use strict";var n=r(20034),i=String,s=TypeError;e.exports=function(e){if(n(e))return e;throw new s(i(e)+" is not an object")}},34154:(e,t,r)=>{"use strict";var n=r(36955),i=TypeError;e.exports=function(e){if("Uint8Array"===n(e))return e;throw new i("Argument is not an Uint8Array")}},77811:e=>{"use strict";e.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},67394:(e,t,r)=>{"use strict";var n=r(44576),i=r(46706),s=r(22195),o=n.ArrayBuffer,a=n.TypeError;e.exports=o&&i(o.prototype,"byteLength","get")||function(e){if("ArrayBuffer"!==s(e))throw new a("ArrayBuffer expected");return e.byteLength}},3238:(e,t,r)=>{"use strict";var n=r(44576),i=r(27476),s=r(67394),o=n.ArrayBuffer,a=o&&o.prototype,l=a&&i(a.slice);e.exports=function(e){if(0!==s(e))return!1;if(!l)return!1;try{return l(e,0,0),!1}catch(e){return!0}}},15652:(e,t,r)=>{"use strict";var n=r(79039);e.exports=n((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}))},55169:(e,t,r)=>{"use strict";var n=r(3238),i=TypeError;e.exports=function(e){if(n(e))throw new i("ArrayBuffer is detached");return e}},95636:(e,t,r)=>{"use strict";var n=r(44576),i=r(79504),s=r(46706),o=r(57696),a=r(55169),l=r(67394),c=r(94483),u=r(1548),h=n.structuredClone,d=n.ArrayBuffer,p=n.DataView,f=Math.min,m=d.prototype,g=p.prototype,A=i(m.slice),y=s(m,"resizable","get"),v=s(m,"maxByteLength","get"),x=i(g.getInt8),_=i(g.setInt8);e.exports=(u||c)&&function(e,t,r){var n,i=l(e),s=void 0===t?i:o(t),m=!y||!y(e);if(a(e),u&&(e=h(e,{transfer:[e]}),i===s&&(r||m)))return e;if(i>=s&&(!r||m))n=A(e,0,s);else{var g=r&&!m&&v?{maxByteLength:v(e)}:void 0;n=new d(s,g);for(var b=new p(e),w=new p(n),E=f(s,i),M=0;M{"use strict";var n,i,s,o=r(77811),a=r(43724),l=r(44576),c=r(94901),u=r(20034),h=r(39297),d=r(36955),p=r(16823),f=r(66699),m=r(36840),g=r(62106),A=r(1625),y=r(42787),v=r(52967),x=r(78227),_=r(33392),b=r(91181),w=b.enforce,E=b.get,M=l.Int8Array,S=M&&M.prototype,C=l.Uint8ClampedArray,T=C&&C.prototype,I=M&&y(M),R=S&&y(S),B=Object.prototype,P=l.TypeError,L=x("toStringTag"),D=_("TYPED_ARRAY_TAG"),O="TypedArrayConstructor",N=o&&!!v&&"Opera"!==d(l.opera),U=!1,F={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},k={BigInt64Array:8,BigUint64Array:8},z=function(e){var t=y(e);if(u(t)){var r=E(t);return r&&h(r,O)?r[O]:z(t)}},G=function(e){if(!u(e))return!1;var t=d(e);return h(F,t)||h(k,t)};for(n in F)(s=(i=l[n])&&i.prototype)?w(s)[O]=i:N=!1;for(n in k)(s=(i=l[n])&&i.prototype)&&(w(s)[O]=i);if((!N||!c(I)||I===Function.prototype)&&(I=function(){throw new P("Incorrect invocation")},N))for(n in F)l[n]&&v(l[n],I);if((!N||!R||R===B)&&(R=I.prototype,N))for(n in F)l[n]&&v(l[n].prototype,R);if(N&&y(T)!==R&&v(T,R),a&&!h(R,L))for(n in U=!0,g(R,L,{configurable:!0,get:function(){return u(this)?this[D]:void 0}}),F)l[n]&&f(l[n],D,n);e.exports={NATIVE_ARRAY_BUFFER_VIEWS:N,TYPED_ARRAY_TAG:U&&D,aTypedArray:function(e){if(G(e))return e;throw new P("Target is not a typed array")},aTypedArrayConstructor:function(e){if(c(e)&&(!v||A(I,e)))return e;throw new P(p(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r,n){if(a){if(r)for(var i in F){var s=l[i];if(s&&h(s.prototype,e))try{delete s.prototype[e]}catch(r){try{s.prototype[e]=t}catch(e){}}}R[e]&&!r||m(R,e,r?t:N&&S[e]||t,n)}},exportTypedArrayStaticMethod:function(e,t,r){var n,i;if(a){if(v){if(r)for(n in F)if((i=l[n])&&h(i,e))try{delete i[e]}catch(e){}if(I[e]&&!r)return;try{return m(I,e,r?t:N&&I[e]||t)}catch(e){}}for(n in F)!(i=l[n])||i[e]&&!r||m(i,e,t)}},getTypedArrayConstructor:z,isView:function(e){if(!u(e))return!1;var t=d(e);return"DataView"===t||h(F,t)||h(k,t)},isTypedArray:G,TypedArray:I,TypedArrayPrototype:R}},66346:(e,t,r)=>{"use strict";var n=r(44576),i=r(79504),s=r(43724),o=r(77811),a=r(10350),l=r(66699),c=r(62106),u=r(56279),h=r(79039),d=r(90679),p=r(91291),f=r(18014),m=r(57696),g=r(15617),A=r(88490),y=r(42787),v=r(52967),x=r(84373),_=r(67680),b=r(23167),w=r(77740),E=r(10687),M=r(91181),S=a.PROPER,C=a.CONFIGURABLE,T="ArrayBuffer",I="DataView",R="prototype",B="Wrong index",P=M.getterFor(T),L=M.getterFor(I),D=M.set,O=n[T],N=O,U=N&&N[R],F=n[I],k=F&&F[R],z=Object.prototype,G=n.Array,Q=n.RangeError,V=i(x),H=i([].reverse),j=A.pack,q=A.unpack,W=function(e){return[255&e]},Y=function(e){return[255&e,e>>8&255]},X=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},K=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},$=function(e){return j(g(e),23,4)},J=function(e){return j(e,52,8)},Z=function(e,t,r){c(e[R],t,{configurable:!0,get:function(){return r(this)[t]}})},ee=function(e,t,r,n){var i=L(e),s=m(r),o=!!n;if(s+t>i.byteLength)throw new Q(B);var a=i.bytes,l=s+i.byteOffset,c=_(a,l,l+t);return o?c:H(c)},te=function(e,t,r,n,i,s){var o=L(e),a=m(r),l=n(+i),c=!!s;if(a+t>o.byteLength)throw new Q(B);for(var u=o.bytes,h=a+o.byteOffset,d=0;d>24)},setUint8:function(e,t){ie(this,e,t<<24>>24)}},{unsafe:!0})}else U=(N=function(e){d(this,U);var t=m(e);D(this,{type:T,bytes:V(G(t),0),byteLength:t}),s||(this.byteLength=t,this.detached=!1)})[R],k=(F=function(e,t,r){d(this,k),d(e,U);var n=P(e),i=n.byteLength,o=p(t);if(o<0||o>i)throw new Q("Wrong offset");if(o+(r=void 0===r?i-o:f(r))>i)throw new Q("Wrong length");D(this,{type:I,buffer:e,byteLength:r,byteOffset:o,bytes:n.bytes}),s||(this.buffer=e,this.byteLength=r,this.byteOffset=o)})[R],s&&(Z(N,"byteLength",P),Z(F,"buffer",L),Z(F,"byteLength",L),Z(F,"byteOffset",L)),u(k,{getInt8:function(e){return ee(this,1,e)[0]<<24>>24},getUint8:function(e){return ee(this,1,e)[0]},getInt16:function(e){var t=ee(this,2,e,arguments.length>1&&arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=ee(this,2,e,arguments.length>1&&arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return K(ee(this,4,e,arguments.length>1&&arguments[1]))},getUint32:function(e){return K(ee(this,4,e,arguments.length>1&&arguments[1]))>>>0},getFloat32:function(e){return q(ee(this,4,e,arguments.length>1&&arguments[1]),23)},getFloat64:function(e){return q(ee(this,8,e,arguments.length>1&&arguments[1]),52)},setInt8:function(e,t){te(this,1,e,W,t)},setUint8:function(e,t){te(this,1,e,W,t)},setInt16:function(e,t){te(this,2,e,Y,t,arguments.length>2&&arguments[2])},setUint16:function(e,t){te(this,2,e,Y,t,arguments.length>2&&arguments[2])},setInt32:function(e,t){te(this,4,e,X,t,arguments.length>2&&arguments[2])},setUint32:function(e,t){te(this,4,e,X,t,arguments.length>2&&arguments[2])},setFloat32:function(e,t){te(this,4,e,$,t,arguments.length>2&&arguments[2])},setFloat64:function(e,t){te(this,8,e,J,t,arguments.length>2&&arguments[2])}});E(N,T),E(F,I),e.exports={ArrayBuffer:N,DataView:F}},57029:(e,t,r)=>{"use strict";var n=r(48981),i=r(35610),s=r(26198),o=r(84606),a=Math.min;e.exports=[].copyWithin||function(e,t){var r=n(this),l=s(r),c=i(e,l),u=i(t,l),h=arguments.length>2?arguments[2]:void 0,d=a((void 0===h?l:i(h,l))-u,l-c),p=1;for(u0;)u in r?r[c]=r[u]:o(r,c),c+=p,u+=p;return r}},84373:(e,t,r)=>{"use strict";var n=r(48981),i=r(35610),s=r(26198);e.exports=function(e){for(var t=n(this),r=s(t),o=arguments.length,a=i(o>1?arguments[1]:void 0,r),l=o>2?arguments[2]:void 0,c=void 0===l?r:i(l,r);c>a;)t[a++]=e;return t}},90235:(e,t,r)=>{"use strict";var n=r(59213).forEach,i=r(34598)("forEach");e.exports=i?[].forEach:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}},8045:(e,t,r)=>{"use strict";var n=r(76080),i=r(79504),s=r(48981),o=r(33517),a=r(1886),l=r(70081),c=r(1767),u=r(50851),h=r(55966),d=r(97751),p=r(44124),f=r(78227),m=r(24074),g=r(36639).toArray,A=f("asyncIterator"),y=i(p("Array","values")),v=i(y([]).next),x=function(){return new _(this)},_=function(e){this.iterator=y(e)};_.prototype.next=function(){return v(this.iterator)},e.exports=function(e){var t=this,r=arguments.length,i=r>1?arguments[1]:void 0,p=r>2?arguments[2]:void 0;return new(d("Promise"))((function(r){var d=s(e);void 0!==i&&(i=n(i,p));var f=h(d,A),y=f?void 0:u(d)||x,v=o(t)?new t:[],_=f?a(d,f):new m(c(l(d,y)));r(g(_,i,v))}))}},35370:(e,t,r)=>{"use strict";var n=r(26198);e.exports=function(e,t,r){for(var i=0,s=arguments.length>2?r:n(t),o=new e(s);s>i;)o[i]=t[i++];return o}},97916:(e,t,r)=>{"use strict";var n=r(76080),i=r(69565),s=r(48981),o=r(96319),a=r(44209),l=r(33517),c=r(26198),u=r(97040),h=r(70081),d=r(50851),p=Array;e.exports=function(e){var t=s(e),r=l(this),f=arguments.length,m=f>1?arguments[1]:void 0,g=void 0!==m;g&&(m=n(m,f>2?arguments[2]:void 0));var A,y,v,x,_,b,w=d(t),E=0;if(!w||this===p&&a(w))for(A=c(t),y=r?new this(A):p(A);A>E;E++)b=g?m(t[E],E):t[E],u(y,E,b);else for(y=r?new this:[],_=(x=h(t,w)).next;!(v=i(_,x)).done;E++)b=g?o(x,m,[v.value,E],!0):v.value,u(y,E,b);return y.length=E,y}},2952:(e,t,r)=>{"use strict";var n=r(76080),i=r(79504),s=r(47055),o=r(48981),a=r(26198),l=r(72248),c=l.Map,u=l.get,h=l.has,d=l.set,p=i([].push);e.exports=function(e){for(var t,r,i=o(this),l=s(i),f=n(e,arguments.length>1?arguments[1]:void 0),m=new c,g=a(l),A=0;g>A;A++)t=f(r=l[A],A,i),h(m,t)?p(u(m,t),r):d(m,t,[r]);return m}},77957:(e,t,r)=>{"use strict";var n=r(76080),i=r(79504),s=r(47055),o=r(48981),a=r(56969),l=r(26198),c=r(2360),u=r(35370),h=Array,d=i([].push);e.exports=function(e,t,r,i){for(var p,f,m,g=o(e),A=s(g),y=n(t,r),v=c(null),x=l(A),_=0;x>_;_++)m=A[_],(f=a(y(m,_,g)))in v?d(v[f],m):v[f]=[m];if(i&&(p=i(g))!==h)for(f in v)v[f]=u(p,v[f]);return v}},19617:(e,t,r)=>{"use strict";var n=r(25397),i=r(35610),s=r(26198),o=function(e){return function(t,r,o){var a=n(t),l=s(a);if(0===l)return!e&&-1;var c,u=i(o,l);if(e&&r!=r){for(;l>u;)if((c=a[u++])!=c)return!0}else for(;l>u;u++)if((e||u in a)&&a[u]===r)return e||u||0;return!e&&-1}};e.exports={includes:o(!0),indexOf:o(!1)}},43839:(e,t,r)=>{"use strict";var n=r(76080),i=r(47055),s=r(48981),o=r(26198),a=function(e){var t=1===e;return function(r,a,l){for(var c,u=s(r),h=i(u),d=o(h),p=n(a,l);d-- >0;)if(p(c=h[d],d,u))switch(e){case 0:return c;case 1:return d}return t?-1:void 0}};e.exports={findLast:a(0),findLastIndex:a(1)}},59213:(e,t,r)=>{"use strict";var n=r(76080),i=r(79504),s=r(47055),o=r(48981),a=r(26198),l=r(1469),c=i([].push),u=function(e){var t=1===e,r=2===e,i=3===e,u=4===e,h=6===e,d=7===e,p=5===e||h;return function(f,m,g,A){for(var y,v,x=o(f),_=s(x),b=a(_),w=n(m,g),E=0,M=A||l,S=t?M(f,b):r||d?M(f,0):void 0;b>E;E++)if((p||E in _)&&(v=w(y=_[E],E,x),e))if(t)S[E]=v;else if(v)switch(e){case 3:return!0;case 5:return y;case 6:return E;case 2:c(S,y)}else switch(e){case 4:return!1;case 7:c(S,y)}return h?-1:i||u?u:S}};e.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6),filterReject:u(7)}},8379:(e,t,r)=>{"use strict";var n=r(18745),i=r(25397),s=r(91291),o=r(26198),a=r(34598),l=Math.min,c=[].lastIndexOf,u=!!c&&1/[1].lastIndexOf(1,-0)<0,h=a("lastIndexOf"),d=u||!h;e.exports=d?function(e){if(u)return n(c,this,arguments)||0;var t=i(this),r=o(t);if(0===r)return-1;var a=r-1;for(arguments.length>1&&(a=l(a,s(arguments[1]))),a<0&&(a=r+a);a>=0;a--)if(a in t&&t[a]===e)return a||0;return-1}:c},70597:(e,t,r)=>{"use strict";var n=r(79039),i=r(78227),s=r(39519),o=i("species");e.exports=function(e){return s>=51||!n((function(){var t=[];return(t.constructor={})[o]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},34598:(e,t,r)=>{"use strict";var n=r(79039);e.exports=function(e,t){var r=[][e];return!!r&&n((function(){r.call(null,t||function(){return 1},1)}))}},80926:(e,t,r)=>{"use strict";var n=r(79306),i=r(48981),s=r(47055),o=r(26198),a=TypeError,l="Reduce of empty array with no initial value",c=function(e){return function(t,r,c,u){var h=i(t),d=s(h),p=o(h);if(n(r),0===p&&c<2)throw new a(l);var f=e?p-1:0,m=e?-1:1;if(c<2)for(;;){if(f in d){u=d[f],f+=m;break}if(f+=m,e?f<0:p<=f)throw new a(l)}for(;e?f>=0:p>f;f+=m)f in d&&(u=r(u,d[f],f,h));return u}};e.exports={left:c(!1),right:c(!0)}},34527:(e,t,r)=>{"use strict";var n=r(43724),i=r(34376),s=TypeError,o=Object.getOwnPropertyDescriptor,a=n&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=a?function(e,t){if(i(e)&&!o(e,"length").writable)throw new s("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},67680:(e,t,r)=>{"use strict";var n=r(79504);e.exports=n([].slice)},74488:(e,t,r)=>{"use strict";var n=r(67680),i=Math.floor,s=function(e,t){var r=e.length;if(r<8)for(var o,a,l=1;l0;)e[a]=e[--a];a!==l++&&(e[a]=o)}else for(var c=i(r/2),u=s(n(e,0,c),t),h=s(n(e,c),t),d=u.length,p=h.length,f=0,m=0;f{"use strict";var n=r(34376),i=r(33517),s=r(20034),o=r(78227)("species"),a=Array;e.exports=function(e){var t;return n(e)&&(t=e.constructor,(i(t)&&(t===a||n(t.prototype))||s(t)&&null===(t=t[o]))&&(t=void 0)),void 0===t?a:t}},1469:(e,t,r)=>{"use strict";var n=r(87433);e.exports=function(e,t){return new(n(e))(0===t?0:t)}},37628:(e,t,r)=>{"use strict";var n=r(26198);e.exports=function(e,t){for(var r=n(e),i=new t(r),s=0;s{"use strict";var n=r(79504),i=r(79306),s=r(64117),o=r(26198),a=r(48981),l=r(72248),c=r(26223),u=l.Map,h=l.has,d=l.set,p=n([].push);e.exports=function(e){var t,r,n,l=a(this),f=o(l),m=[],g=new u,A=s(e)?function(e){return e}:i(e);for(t=0;t{"use strict";var n=r(26198),i=r(91291),s=RangeError;e.exports=function(e,t,r,o){var a=n(e),l=i(r),c=l<0?a+l:l;if(c>=a||c<0)throw new s("Incorrect index");for(var u=new t(a),h=0;h{"use strict";var n=r(69565),i=r(28551),s=r(2360),o=r(55966),a=r(56279),l=r(91181),c=r(97751),u=r(53982),h=r(62529),d=c("Promise"),p="AsyncFromSyncIterator",f=l.set,m=l.getterFor(p),g=function(e,t,r){var n=e.done;d.resolve(e.value).then((function(e){t(h(e,n))}),r)},A=function(e){e.type=p,f(this,e)};A.prototype=a(s(u),{next:function(){var e=m(this);return new d((function(t,r){var s=i(n(e.next,e.iterator));g(s,t,r)}))},return:function(){var e=m(this).iterator;return new d((function(t,r){var s=o(e,"return");if(void 0===s)return t(h(void 0,!0));var a=i(n(s,e));g(a,t,r)}))}}),e.exports=A},20772:(e,t,r)=>{"use strict";var n=r(69565),i=r(97751),s=r(55966);e.exports=function(e,t,r,o){try{var a=s(e,"return");if(a)return i("Promise").resolve(n(a,e)).then((function(){t(r)}),(function(e){o(e)}))}catch(e){return o(e)}t(r)}},92059:(e,t,r)=>{"use strict";var n=r(69565),i=r(1103),s=r(28551),o=r(2360),a=r(66699),l=r(56279),c=r(78227),u=r(91181),h=r(97751),d=r(55966),p=r(53982),f=r(62529),m=r(9539),g=h("Promise"),A=c("toStringTag"),y="AsyncIteratorHelper",v="WrapForValidAsyncIterator",x=u.set,_=function(e){var t=!e,r=u.getterFor(e?v:y),a=function(e){var n=i((function(){return r(e)})),s=n.error,o=n.value;return s||t&&o.done?{exit:!0,value:s?g.reject(o):g.resolve(f(void 0,!0))}:{exit:!1,value:o}};return l(o(p),{next:function(){var e=a(this),t=e.value;if(e.exit)return t;var r=i((function(){return s(t.nextHandler(g))})),n=r.error,o=r.value;return n&&(t.done=!0),n?g.reject(o):g.resolve(o)},return:function(){var t=a(this),r=t.value;if(t.exit)return r;r.done=!0;var o,l,c=r.iterator,u=i((function(){if(r.inner)try{m(r.inner.iterator,"normal")}catch(e){return m(c,"throw",e)}return d(c,"return")}));return o=l=u.value,u.error?g.reject(l):void 0===o?g.resolve(f(void 0,!0)):(l=(u=i((function(){return n(o,c)}))).value,u.error?g.reject(l):e?g.resolve(l):g.resolve(l).then((function(e){return s(e),f(void 0,!0)})))}})},b=_(!0),w=_(!1);a(w,A,"Async Iterator Helper"),e.exports=function(e,t){var r=function(r,n){n?(n.iterator=r.iterator,n.next=r.next):n=r,n.type=t?v:y,n.nextHandler=e,n.counter=0,n.done=!1,x(this,n)};return r.prototype=t?b:w,r}},87481:(e,t,r)=>{"use strict";var n=r(69565),i=r(41750),s=function(e,t){return[t,e]};e.exports=function(){return n(i,this,s)}},36639:(e,t,r)=>{"use strict";var n=r(69565),i=r(79306),s=r(28551),o=r(20034),a=r(96837),l=r(97751),c=r(1767),u=r(20772),h=function(e){var t=0===e,r=1===e,h=2===e,d=3===e;return function(e,p,f){s(e);var m=void 0!==p;!m&&t||i(p);var g=c(e),A=l("Promise"),y=g.iterator,v=g.next,x=0;return new A((function(e,i){var l=function(e){u(y,i,e,i)},c=function(){try{if(m)try{a(x)}catch(e){l(e)}A.resolve(s(n(v,y))).then((function(n){try{if(s(n).done)t?(f.length=x,e(f)):e(!d&&(h||void 0));else{var a=n.value;try{if(m){var g=p(a,x),v=function(n){if(r)c();else if(h)n?c():u(y,e,!1,i);else if(t)try{f[x++]=n,c()}catch(e){l(e)}else n?u(y,e,d||a,i):c()};o(g)?A.resolve(g).then(v,l):v(g)}else f[x++]=a,c()}catch(e){l(e)}}}catch(e){i(e)}}),i)}catch(e){i(e)}};c()}))}};e.exports={toArray:h(0),forEach:h(1),every:h(2),some:h(3),find:h(4)}},41750:(e,t,r)=>{"use strict";var n=r(69565),i=r(79306),s=r(28551),o=r(20034),a=r(1767),l=r(92059),c=r(62529),u=r(20772),h=l((function(e){var t=this,r=t.iterator,i=t.mapper;return new e((function(a,l){var h=function(e){t.done=!0,l(e)},d=function(e){u(r,h,e,h)};e.resolve(s(n(t.next,r))).then((function(r){try{if(s(r).done)t.done=!0,a(c(void 0,!0));else{var n=r.value;try{var l=i(n,t.counter++),u=function(e){a(c(e,!1))};o(l)?e.resolve(l).then(u,d):u(l)}catch(e){d(e)}}}catch(e){h(e)}}),h)}))}));e.exports=function(e){return s(this),i(e),new h(a(this),{mapper:e})}},53982:(e,t,r)=>{"use strict";var n,i,s=r(44576),o=r(77629),a=r(94901),l=r(2360),c=r(42787),u=r(36840),h=r(78227),d=r(96395),p="USE_FUNCTION_CONSTRUCTOR",f=h("asyncIterator"),m=s.AsyncIterator,g=o.AsyncIteratorPrototype;if(g)n=g;else if(a(m))n=m.prototype;else if(o[p]||s[p])try{i=c(c(c(Function("return async function*(){}()")()))),c(i)===Object.prototype&&(n=i)}catch(e){}n?d&&(n=l(n)):n={},a(n[f])||u(n,f,(function(){return this})),e.exports=n},44690:(e,t,r)=>{"use strict";var n=r(69565),i=r(92059);e.exports=i((function(){return n(this.next,this.iterator)}),!0)},92804:e=>{"use strict";var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=t+"+/",n=t+"-_",i=function(e){for(var t={},r=0;r<64;r++)t[e.charAt(r)]=r;return t};e.exports={i2c:r,c2i:i(r),i2cUrl:n,c2iUrl:i(n)}},96319:(e,t,r)=>{"use strict";var n=r(28551),i=r(9539);e.exports=function(e,t,r,s){try{return s?t(n(r)[0],r[1]):t(r)}catch(t){i(e,"throw",t)}}},84428:(e,t,r)=>{"use strict";var n=r(78227)("iterator"),i=!1;try{var s=0,o={next:function(){return{done:!!s++}},return:function(){i=!0}};o[n]=function(){return this},Array.from(o,(function(){throw 2}))}catch(e){}e.exports=function(e,t){try{if(!t&&!i)return!1}catch(e){return!1}var r=!1;try{var s={};s[n]=function(){return{next:function(){return{done:r=!0}}}},e(s)}catch(e){}return r}},22195:(e,t,r)=>{"use strict";var n=r(79504),i=n({}.toString),s=n("".slice);e.exports=function(e){return s(i(e),8,-1)}},36955:(e,t,r)=>{"use strict";var n=r(92140),i=r(94901),s=r(22195),o=r(78227)("toStringTag"),a=Object,l="Arguments"===s(function(){return arguments}());e.exports=n?s:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=a(e),o))?r:l?s(t):"Object"===(n=s(t))&&i(t.callee)?"Arguments":n}},70933:(e,t,r)=>{"use strict";var n=r(76080),i=r(28551),s=r(48981),o=r(72652);e.exports=function(e,t,r){return function(a){var l=s(a),c=arguments.length,u=c>1?arguments[1]:void 0,h=void 0!==u,d=h?n(u,c>2?arguments[2]:void 0):void 0,p=new e,f=0;return o(l,(function(e){var n=h?d(e,f++):e;r?t(p,i(n)[0],n[1]):t(p,n)})),p}}},87500:(e,t,r)=>{"use strict";var n=r(28551);e.exports=function(e,t,r){return function(){for(var i=new e,s=arguments.length,o=0;o{"use strict";var n=r(2360),i=r(62106),s=r(56279),o=r(76080),a=r(90679),l=r(64117),c=r(72652),u=r(51088),h=r(62529),d=r(87633),p=r(43724),f=r(3451).fastKey,m=r(91181),g=m.set,A=m.getterFor;e.exports={getConstructor:function(e,t,r,u){var h=e((function(e,i){a(e,d),g(e,{type:t,index:n(null),first:null,last:null,size:0}),p||(e.size=0),l(i)||c(i,e[u],{that:e,AS_ENTRIES:r})})),d=h.prototype,m=A(t),y=function(e,t,r){var n,i,s=m(e),o=v(e,t);return o?o.value=r:(s.last=o={index:i=f(t,!0),key:t,value:r,previous:n=s.last,next:null,removed:!1},s.first||(s.first=o),n&&(n.next=o),p?s.size++:e.size++,"F"!==i&&(s.index[i]=o)),e},v=function(e,t){var r,n=m(e),i=f(t);if("F"!==i)return n.index[i];for(r=n.first;r;r=r.next)if(r.key===t)return r};return s(d,{clear:function(){for(var e=m(this),t=e.first;t;)t.removed=!0,t.previous&&(t.previous=t.previous.next=null),t=t.next;e.first=e.last=null,e.index=n(null),p?e.size=0:this.size=0},delete:function(e){var t=this,r=m(t),n=v(t,e);if(n){var i=n.next,s=n.previous;delete r.index[n.index],n.removed=!0,s&&(s.next=i),i&&(i.previous=s),r.first===n&&(r.first=i),r.last===n&&(r.last=s),p?r.size--:t.size--}return!!n},forEach:function(e){for(var t,r=m(this),n=o(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:r.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!v(this,e)}}),s(d,r?{get:function(e){var t=v(this,e);return t&&t.value},set:function(e,t){return y(this,0===e?0:e,t)}}:{add:function(e){return y(this,e=0===e?0:e,e)}}),p&&i(d,"size",{configurable:!0,get:function(){return m(this).size}}),h},setStrong:function(e,t,r){var n=t+" Iterator",i=A(t),s=A(n);u(e,t,(function(e,t){g(this,{type:n,target:e,state:i(e),kind:t,last:null})}),(function(){for(var e=s(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?h("keys"===t?r.key:"values"===t?r.value:[r.key,r.value],!1):(e.target=null,h(void 0,!0))}),r?"entries":"values",!r,!0),d(t)}}},91625:(e,t,r)=>{"use strict";var n=r(79504),i=r(56279),s=r(3451).getWeakData,o=r(90679),a=r(28551),l=r(64117),c=r(20034),u=r(72652),h=r(59213),d=r(39297),p=r(91181),f=p.set,m=p.getterFor,g=h.find,A=h.findIndex,y=n([].splice),v=0,x=function(e){return e.frozen||(e.frozen=new _)},_=function(){this.entries=[]},b=function(e,t){return g(e.entries,(function(e){return e[0]===t}))};_.prototype={get:function(e){var t=b(this,e);if(t)return t[1]},has:function(e){return!!b(this,e)},set:function(e,t){var r=b(this,e);r?r[1]=t:this.entries.push([e,t])},delete:function(e){var t=A(this.entries,(function(t){return t[0]===e}));return~t&&y(this.entries,t,1),!!~t}},e.exports={getConstructor:function(e,t,r,n){var h=e((function(e,i){o(e,p),f(e,{type:t,id:v++,frozen:null}),l(i)||u(i,e[n],{that:e,AS_ENTRIES:r})})),p=h.prototype,g=m(t),A=function(e,t,r){var n=g(e),i=s(a(t),!0);return!0===i?x(n).set(t,r):i[n.id]=r,e};return i(p,{delete:function(e){var t=g(this);if(!c(e))return!1;var r=s(e);return!0===r?x(t).delete(e):r&&d(r,t.id)&&delete r[t.id]},has:function(e){var t=g(this);if(!c(e))return!1;var r=s(e);return!0===r?x(t).has(e):r&&d(r,t.id)}}),i(p,r?{get:function(e){var t=g(this);if(c(e)){var r=s(e);if(!0===r)return x(t).get(e);if(r)return r[t.id]}},set:function(e,t){return A(this,e,t)}}:{add:function(e){return A(this,e,!0)}}),h}}},16468:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(79504),o=r(92796),a=r(36840),l=r(3451),c=r(72652),u=r(90679),h=r(94901),d=r(64117),p=r(20034),f=r(79039),m=r(84428),g=r(10687),A=r(23167);e.exports=function(e,t,r){var y=-1!==e.indexOf("Map"),v=-1!==e.indexOf("Weak"),x=y?"set":"add",_=i[e],b=_&&_.prototype,w=_,E={},M=function(e){var t=s(b[e]);a(b,e,"add"===e?function(e){return t(this,0===e?0:e),this}:"delete"===e?function(e){return!(v&&!p(e))&&t(this,0===e?0:e)}:"get"===e?function(e){return v&&!p(e)?void 0:t(this,0===e?0:e)}:"has"===e?function(e){return!(v&&!p(e))&&t(this,0===e?0:e)}:function(e,r){return t(this,0===e?0:e,r),this})};if(o(e,!h(_)||!(v||b.forEach&&!f((function(){(new _).entries().next()})))))w=r.getConstructor(t,e,y,x),l.enable();else if(o(e,!0)){var S=new w,C=S[x](v?{}:-0,1)!==S,T=f((function(){S.has(1)})),I=m((function(e){new _(e)})),R=!v&&f((function(){for(var e=new _,t=5;t--;)e[x](t,t);return!e.has(-0)}));I||((w=t((function(e,t){u(e,b);var r=A(new _,e,w);return d(t)||c(t,r[x],{that:r,AS_ENTRIES:y}),r}))).prototype=b,b.constructor=w),(T||R)&&(M("delete"),M("has"),y&&M("get")),(R||C)&&M(x),v&&b.clear&&delete b.clear}return E[e]=w,n({global:!0,constructor:!0,forced:w!==_},E),g(w,e),v||r.setStrong(w,e,y),w}},59323:(e,t,r)=>{"use strict";r(36033),r(73772);var n=r(97751),i=r(2360),s=r(20034),o=Object,a=TypeError,l=n("Map"),c=n("WeakMap"),u=function(){this.object=null,this.symbol=null,this.primitives=null,this.objectsByIndex=i(null)};u.prototype.get=function(e,t){return this[e]||(this[e]=t())},u.prototype.next=function(e,t,r){var n=r?this.objectsByIndex[e]||(this.objectsByIndex[e]=new c):this.primitives||(this.primitives=new l),i=n.get(t);return i||n.set(t,i=new u),i};var h=new u;e.exports=function(){var e,t,r=h,n=arguments.length;for(e=0;e{"use strict";var n=r(39297),i=r(35031),s=r(77347),o=r(24913);e.exports=function(e,t,r){for(var a=i(t),l=o.f,c=s.f,u=0;u{"use strict";var n=r(78227)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[n]=!1,"/./"[e](t)}catch(e){}}return!1}},12211:(e,t,r)=>{"use strict";var n=r(79039);e.exports=!n((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},77240:(e,t,r)=>{"use strict";var n=r(79504),i=r(67750),s=r(655),o=/"/g,a=n("".replace);e.exports=function(e,t,r,n){var l=s(i(e)),c="<"+t;return""!==r&&(c+=" "+r+'="'+a(s(n),o,""")+'"'),c+">"+l+""}},62529:e=>{"use strict";e.exports=function(e,t){return{value:e,done:t}}},66699:(e,t,r)=>{"use strict";var n=r(43724),i=r(24913),s=r(6980);e.exports=n?function(e,t,r){return i.f(e,t,s(1,r))}:function(e,t,r){return e[t]=r,e}},6980:e=>{"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},97040:(e,t,r)=>{"use strict";var n=r(43724),i=r(24913),s=r(6980);e.exports=function(e,t,r){n?i.f(e,t,s(0,r)):e[t]=r}},70380:(e,t,r)=>{"use strict";var n=r(79504),i=r(79039),s=r(60533).start,o=RangeError,a=isFinite,l=Math.abs,c=Date.prototype,u=c.toISOString,h=n(c.getTime),d=n(c.getUTCDate),p=n(c.getUTCFullYear),f=n(c.getUTCHours),m=n(c.getUTCMilliseconds),g=n(c.getUTCMinutes),A=n(c.getUTCMonth),y=n(c.getUTCSeconds);e.exports=i((function(){return"0385-07-25T07:06:39.999Z"!==u.call(new Date(-50000000000001))}))||!i((function(){u.call(new Date(NaN))}))?function(){if(!a(h(this)))throw new o("Invalid time value");var e=this,t=p(e),r=m(e),n=t<0?"-":t>9999?"+":"";return n+s(l(t),n?6:4,0)+"-"+s(A(e)+1,2,0)+"-"+s(d(e),2,0)+"T"+s(f(e),2,0)+":"+s(g(e),2,0)+":"+s(y(e),2,0)+"."+s(r,3,0)+"Z"}:u},53640:(e,t,r)=>{"use strict";var n=r(28551),i=r(84270),s=TypeError;e.exports=function(e){if(n(this),"string"===e||"default"===e)e="string";else if("number"!==e)throw new s("Incorrect hint");return i(this,e)}},62106:(e,t,r)=>{"use strict";var n=r(50283),i=r(24913);e.exports=function(e,t,r){return r.get&&n(r.get,t,{getter:!0}),r.set&&n(r.set,t,{setter:!0}),i.f(e,t,r)}},36840:(e,t,r)=>{"use strict";var n=r(94901),i=r(24913),s=r(50283),o=r(39433);e.exports=function(e,t,r,a){a||(a={});var l=a.enumerable,c=void 0!==a.name?a.name:t;if(n(r)&&s(r,c,a),a.global)l?e[t]=r:o(t,r);else{try{a.unsafe?e[t]&&(l=!0):delete e[t]}catch(e){}l?e[t]=r:i.f(e,t,{value:r,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return e}},56279:(e,t,r)=>{"use strict";var n=r(36840);e.exports=function(e,t,r){for(var i in t)n(e,i,t[i],r);return e}},39433:(e,t,r)=>{"use strict";var n=r(44576),i=Object.defineProperty;e.exports=function(e,t){try{i(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}},84606:(e,t,r)=>{"use strict";var n=r(16823),i=TypeError;e.exports=function(e,t){if(!delete e[t])throw new i("Cannot delete property "+n(t)+" of "+n(e))}},43724:(e,t,r)=>{"use strict";var n=r(79039);e.exports=!n((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},94483:(e,t,r)=>{"use strict";var n,i,s,o,a=r(44576),l=r(89429),c=r(1548),u=a.structuredClone,h=a.ArrayBuffer,d=a.MessageChannel,p=!1;if(c)p=function(e){u(e,{transfer:[e]})};else if(h)try{d||(n=l("worker_threads"))&&(d=n.MessageChannel),d&&(i=new d,s=new h(2),o=function(e){i.port1.postMessage(null,[e])},2===s.byteLength&&(o(s),0===s.byteLength&&(p=o)))}catch(e){}e.exports=p},4055:(e,t,r)=>{"use strict";var n=r(44576),i=r(20034),s=n.document,o=i(s)&&i(s.createElement);e.exports=function(e){return o?s.createElement(e):{}}},96837:e=>{"use strict";var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},55002:e=>{"use strict";e.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},67400:e=>{"use strict";e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},79296:(e,t,r)=>{"use strict";var n=r(4055)("span").classList,i=n&&n.constructor&&n.constructor.prototype;e.exports=i===Object.prototype?void 0:i},88727:e=>{"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},13709:(e,t,r)=>{"use strict";var n=r(82839).match(/firefox\/(\d+)/i);e.exports=!!n&&+n[1]},13763:(e,t,r)=>{"use strict";var n=r(82839);e.exports=/MSIE|Trident/.test(n)},44265:(e,t,r)=>{"use strict";var n=r(82839);e.exports=/ipad|iphone|ipod/i.test(n)&&"undefined"!=typeof Pebble},89544:(e,t,r)=>{"use strict";var n=r(82839);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},38574:(e,t,r)=>{"use strict";var n=r(84215);e.exports="NODE"===n},7860:(e,t,r)=>{"use strict";var n=r(82839);e.exports=/web0s(?!.*chrome)/i.test(n)},82839:(e,t,r)=>{"use strict";var n=r(44576).navigator,i=n&&n.userAgent;e.exports=i?String(i):""},39519:(e,t,r)=>{"use strict";var n,i,s=r(44576),o=r(82839),a=s.process,l=s.Deno,c=a&&a.versions||l&&l.version,u=c&&c.v8;u&&(i=(n=u.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!i&&o&&(!(n=o.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=o.match(/Chrome\/(\d+)/))&&(i=+n[1]),e.exports=i},3607:(e,t,r)=>{"use strict";var n=r(82839).match(/AppleWebKit\/(\d+)\./);e.exports=!!n&&+n[1]},84215:(e,t,r)=>{"use strict";var n=r(44576),i=r(82839),s=r(22195),o=function(e){return i.slice(0,e.length)===e};e.exports=o("Bun/")?"BUN":o("Cloudflare-Workers")?"CLOUDFLARE":o("Deno/")?"DENO":o("Node.js/")?"NODE":n.Bun&&"string"==typeof Bun.version?"BUN":n.Deno&&"object"==typeof Deno.version?"DENO":"process"===s(n.process)?"NODE":n.window&&n.document?"BROWSER":"REST"},16193:(e,t,r)=>{"use strict";var n=r(79504),i=Error,s=n("".replace),o=String(new i("zxcasd").stack),a=/\n\s*at [^:]*:[^\n]*/,l=a.test(o);e.exports=function(e,t){if(l&&"string"==typeof e&&!i.prepareStackTrace)for(;t--;)e=s(e,a,"");return e}},80747:(e,t,r)=>{"use strict";var n=r(66699),i=r(16193),s=r(24659),o=Error.captureStackTrace;e.exports=function(e,t,r,a){s&&(o?o(e,t):n(e,"stack",i(r,a)))}},24659:(e,t,r)=>{"use strict";var n=r(79039),i=r(6980);e.exports=!n((function(){var e=new Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",i(1,7)),7!==e.stack)}))},77536:(e,t,r)=>{"use strict";var n=r(43724),i=r(79039),s=r(28551),o=r(32603),a=Error.prototype.toString,l=i((function(){if(n){var e=Object.create(Object.defineProperty({},"name",{get:function(){return this===e}}));if("true"!==a.call(e))return!0}return"2: 1"!==a.call({message:1,name:2})||"Error"!==a.call({})}));e.exports=l?function(){var e=s(this),t=o(e.name,"Error"),r=o(e.message);return t?r?t+": "+r:t:r}:a},46518:(e,t,r)=>{"use strict";var n=r(44576),i=r(77347).f,s=r(66699),o=r(36840),a=r(39433),l=r(77740),c=r(92796);e.exports=function(e,t){var r,u,h,d,p,f=e.target,m=e.global,g=e.stat;if(r=m?n:g?n[f]||a(f,{}):n[f]&&n[f].prototype)for(u in t){if(d=t[u],h=e.dontCallGetSet?(p=i(r,u))&&p.value:r[u],!c(m?u:f+(g?".":"#")+u,e.forced)&&void 0!==h){if(typeof d==typeof h)continue;l(d,h)}(e.sham||h&&h.sham)&&s(d,"sham",!0),o(r,u,d,e)}}},79039:e=>{"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},89228:(e,t,r)=>{"use strict";r(27495);var n=r(69565),i=r(36840),s=r(57323),o=r(79039),a=r(78227),l=r(66699),c=a("species"),u=RegExp.prototype;e.exports=function(e,t,r,h){var d=a(e),p=!o((function(){var t={};return t[d]=function(){return 7},7!==""[e](t)})),f=p&&!o((function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[c]=function(){return r},r.flags="",r[d]=/./[d]),r.exec=function(){return t=!0,null},r[d](""),!t}));if(!p||!f||r){var m=/./[d],g=t(d,""[e],(function(e,t,r,i,o){var a=t.exec;return a===s||a===u.exec?p&&!o?{done:!0,value:n(m,t,r,i)}:{done:!0,value:n(e,r,t,i)}:{done:!1}}));i(String.prototype,e,g[0]),i(u,d,g[1])}h&&l(u[d],"sham",!0)}},70259:(e,t,r)=>{"use strict";var n=r(34376),i=r(26198),s=r(96837),o=r(76080),a=function(e,t,r,l,c,u,h,d){for(var p,f,m=c,g=0,A=!!h&&o(h,d);g0&&n(p)?(f=i(p),m=a(e,t,p,f,m,u-1)-1):(s(m+1),e[m]=p),m++),g++;return m};e.exports=a},92744:(e,t,r)=>{"use strict";var n=r(79039);e.exports=!n((function(){return Object.isExtensible(Object.preventExtensions({}))}))},18745:(e,t,r)=>{"use strict";var n=r(40616),i=Function.prototype,s=i.apply,o=i.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?o.bind(s):function(){return o.apply(s,arguments)})},76080:(e,t,r)=>{"use strict";var n=r(27476),i=r(79306),s=r(40616),o=n(n.bind);e.exports=function(e,t){return i(e),void 0===t?e:s?o(e,t):function(){return e.apply(t,arguments)}}},40616:(e,t,r)=>{"use strict";var n=r(79039);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},30566:(e,t,r)=>{"use strict";var n=r(79504),i=r(79306),s=r(20034),o=r(39297),a=r(67680),l=r(40616),c=Function,u=n([].concat),h=n([].join),d={};e.exports=l?c.bind:function(e){var t=i(this),r=t.prototype,n=a(arguments,1),l=function(){var r=u(n,a(arguments));return this instanceof l?function(e,t,r){if(!o(d,t)){for(var n=[],i=0;i{"use strict";var n=r(40616),i=Function.prototype.call;e.exports=n?i.bind(i):function(){return i.apply(i,arguments)}},12865:(e,t,r)=>{"use strict";var n=r(79504),i=r(79306);e.exports=function(){return n(i(this))}},10350:(e,t,r)=>{"use strict";var n=r(43724),i=r(39297),s=Function.prototype,o=n&&Object.getOwnPropertyDescriptor,a=i(s,"name"),l=a&&"something"===function(){}.name,c=a&&(!n||n&&o(s,"name").configurable);e.exports={EXISTS:a,PROPER:l,CONFIGURABLE:c}},46706:(e,t,r)=>{"use strict";var n=r(79504),i=r(79306);e.exports=function(e,t,r){try{return n(i(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}}},27476:(e,t,r)=>{"use strict";var n=r(22195),i=r(79504);e.exports=function(e){if("Function"===n(e))return i(e)}},79504:(e,t,r)=>{"use strict";var n=r(40616),i=Function.prototype,s=i.call,o=n&&i.bind.bind(s,s);e.exports=n?o:function(e){return function(){return s.apply(e,arguments)}}},944:e=>{"use strict";var t=TypeError;e.exports=function(e){var r=e&&e.alphabet;if(void 0===r||"base64"===r||"base64url"===r)return r||"base64";throw new t("Incorrect `alphabet` option")}},50133:(e,t,r)=>{"use strict";var n=r(69565),i=r(94901),s=r(28551),o=r(1767),a=r(50851),l=r(55966),c=r(78227),u=r(24074),h=c("asyncIterator");e.exports=function(e){var t,r=s(e),c=!0,d=l(r,h);return i(d)||(d=a(r),c=!1),void 0!==d?t=n(d,r):(t=r,c=!0),s(t),o(c?t:new u(o(t)))}},1886:(e,t,r)=>{"use strict";var n=r(69565),i=r(24074),s=r(28551),o=r(70081),a=r(1767),l=r(55966),c=r(78227)("asyncIterator");e.exports=function(e,t){var r=arguments.length<2?l(e,c):t;return r?s(n(r,e)):new i(a(o(e)))}},89429:(e,t,r)=>{"use strict";var n=r(44576),i=r(38574);e.exports=function(e){if(i){try{return n.process.getBuiltinModule(e)}catch(e){}try{return Function('return require("'+e+'")')()}catch(e){}}}},44124:(e,t,r)=>{"use strict";var n=r(44576);e.exports=function(e,t){var r=n[e],i=r&&r.prototype;return i&&i[t]}},97751:(e,t,r)=>{"use strict";var n=r(44576),i=r(94901);e.exports=function(e,t){return arguments.length<2?(r=n[e],i(r)?r:void 0):n[e]&&n[e][t];var r}},1767:e=>{"use strict";e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},48646:(e,t,r)=>{"use strict";var n=r(69565),i=r(28551),s=r(1767),o=r(50851);e.exports=function(e,t){t&&"string"==typeof e||i(e);var r=o(e);return s(i(void 0!==r?n(r,e):e))}},50851:(e,t,r)=>{"use strict";var n=r(36955),i=r(55966),s=r(64117),o=r(26269),a=r(78227)("iterator");e.exports=function(e){if(!s(e))return i(e,a)||i(e,"@@iterator")||o[n(e)]}},70081:(e,t,r)=>{"use strict";var n=r(69565),i=r(79306),s=r(28551),o=r(16823),a=r(50851),l=TypeError;e.exports=function(e,t){var r=arguments.length<2?a(e):t;if(i(r))return s(n(r,e));throw new l(o(e)+" is not iterable")}},66933:(e,t,r)=>{"use strict";var n=r(79504),i=r(34376),s=r(94901),o=r(22195),a=r(655),l=n([].push);e.exports=function(e){if(s(e))return e;if(i(e)){for(var t=e.length,r=[],n=0;n{"use strict";var n=r(79306),i=r(64117);e.exports=function(e,t){var r=e[t];return i(r)?void 0:n(r)}},83789:(e,t,r)=>{"use strict";var n=r(79306),i=r(28551),s=r(69565),o=r(91291),a=r(1767),l="Invalid size",c=RangeError,u=TypeError,h=Math.max,d=function(e,t){this.set=e,this.size=h(t,0),this.has=n(e.has),this.keys=n(e.keys)};d.prototype={getIterator:function(){return a(i(s(this.keys,this.set)))},includes:function(e){return s(this.has,this.set,e)}},e.exports=function(e){i(e);var t=+e.size;if(t!=t)throw new u(l);var r=o(t);if(r<0)throw new c(l);return new d(e,r)}},2478:(e,t,r)=>{"use strict";var n=r(79504),i=r(48981),s=Math.floor,o=n("".charAt),a=n("".replace),l=n("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,u=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,r,n,h,d){var p=r+e.length,f=n.length,m=u;return void 0!==h&&(h=i(h),m=c),a(d,m,(function(i,a){var c;switch(o(a,0)){case"$":return"$";case"&":return e;case"`":return l(t,0,r);case"'":return l(t,p);case"<":c=h[l(a,1,-1)];break;default:var u=+a;if(0===u)return i;if(u>f){var d=s(u/10);return 0===d?i:d<=f?void 0===n[d-1]?o(a,1):n[d-1]+o(a,1):i}c=n[u-1]}return void 0===c?"":c}))}},44576:function(e,t,r){"use strict";var n=function(e){return e&&e.Math===Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||n("object"==typeof this&&this)||function(){return this}()||Function("return this")()},39297:(e,t,r)=>{"use strict";var n=r(79504),i=r(48981),s=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return s(i(e),t)}},30421:e=>{"use strict";e.exports={}},90757:e=>{"use strict";e.exports=function(e,t){try{1===arguments.length?console.error(e):console.error(e,t)}catch(e){}}},20397:(e,t,r)=>{"use strict";var n=r(97751);e.exports=n("document","documentElement")},35917:(e,t,r)=>{"use strict";var n=r(43724),i=r(79039),s=r(4055);e.exports=!n&&!i((function(){return 7!==Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a}))},88490:e=>{"use strict";var t=Array,r=Math.abs,n=Math.pow,i=Math.floor,s=Math.log,o=Math.LN2;e.exports={pack:function(e,a,l){var c,u,h,d=t(l),p=8*l-a-1,f=(1<>1,g=23===a?n(2,-24)-n(2,-77):0,A=e<0||0===e&&1/e<0?1:0,y=0;for((e=r(e))!=e||e===1/0?(u=e!=e?1:0,c=f):(c=i(s(e)/o),e*(h=n(2,-c))<1&&(c--,h*=2),(e+=c+m>=1?g/h:g*n(2,1-m))*h>=2&&(c++,h/=2),c+m>=f?(u=0,c=f):c+m>=1?(u=(e*h-1)*n(2,a),c+=m):(u=e*n(2,m-1)*n(2,a),c=0));a>=8;)d[y++]=255&u,u/=256,a-=8;for(c=c<0;)d[y++]=255&c,c/=256,p-=8;return d[y-1]|=128*A,d},unpack:function(e,t){var r,i=e.length,s=8*i-t-1,o=(1<>1,l=s-7,c=i-1,u=e[c--],h=127&u;for(u>>=7;l>0;)h=256*h+e[c--],l-=8;for(r=h&(1<<-l)-1,h>>=-l,l+=t;l>0;)r=256*r+e[c--],l-=8;if(0===h)h=1-a;else{if(h===o)return r?NaN:u?-1/0:1/0;r+=n(2,t),h-=a}return(u?-1:1)*r*n(2,h-t)}}},47055:(e,t,r)=>{"use strict";var n=r(79504),i=r(79039),s=r(22195),o=Object,a=n("".split);e.exports=i((function(){return!o("z").propertyIsEnumerable(0)}))?function(e){return"String"===s(e)?a(e,""):o(e)}:o},23167:(e,t,r)=>{"use strict";var n=r(94901),i=r(20034),s=r(52967);e.exports=function(e,t,r){var o,a;return s&&n(o=t.constructor)&&o!==r&&i(a=o.prototype)&&a!==r.prototype&&s(e,a),e}},33706:(e,t,r)=>{"use strict";var n=r(79504),i=r(94901),s=r(77629),o=n(Function.toString);i(s.inspectSource)||(s.inspectSource=function(e){return o(e)}),e.exports=s.inspectSource},77584:(e,t,r)=>{"use strict";var n=r(20034),i=r(66699);e.exports=function(e,t){n(t)&&"cause"in t&&i(e,"cause",t.cause)}},3451:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(30421),o=r(20034),a=r(39297),l=r(24913).f,c=r(38480),u=r(10298),h=r(34124),d=r(33392),p=r(92744),f=!1,m=d("meta"),g=0,A=function(e){l(e,m,{value:{objectID:"O"+g++,weakData:{}}})},y=e.exports={enable:function(){y.enable=function(){},f=!0;var e=c.f,t=i([].splice),r={};r[m]=1,e(r).length&&(c.f=function(r){for(var n=e(r),i=0,s=n.length;i{"use strict";var n,i,s,o=r(58622),a=r(44576),l=r(20034),c=r(66699),u=r(39297),h=r(77629),d=r(66119),p=r(30421),f="Object already initialized",m=a.TypeError,g=a.WeakMap;if(o||h.state){var A=h.state||(h.state=new g);A.get=A.get,A.has=A.has,A.set=A.set,n=function(e,t){if(A.has(e))throw new m(f);return t.facade=e,A.set(e,t),t},i=function(e){return A.get(e)||{}},s=function(e){return A.has(e)}}else{var y=d("state");p[y]=!0,n=function(e,t){if(u(e,y))throw new m(f);return t.facade=e,c(e,y,t),t},i=function(e){return u(e,y)?e[y]:{}},s=function(e){return u(e,y)}}e.exports={set:n,get:i,has:s,enforce:function(e){return s(e)?i(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!l(t)||(r=i(t)).type!==e)throw new m("Incompatible receiver, "+e+" required");return r}}}},44209:(e,t,r)=>{"use strict";var n=r(78227),i=r(26269),s=n("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||o[s]===e)}},34376:(e,t,r)=>{"use strict";var n=r(22195);e.exports=Array.isArray||function(e){return"Array"===n(e)}},18727:(e,t,r)=>{"use strict";var n=r(36955);e.exports=function(e){var t=n(e);return"BigInt64Array"===t||"BigUint64Array"===t}},94901:e=>{"use strict";var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},33517:(e,t,r)=>{"use strict";var n=r(79504),i=r(79039),s=r(94901),o=r(36955),a=r(97751),l=r(33706),c=function(){},u=a("Reflect","construct"),h=/^\s*(?:class|function)\b/,d=n(h.exec),p=!h.test(c),f=function(e){if(!s(e))return!1;try{return u(c,[],e),!0}catch(e){return!1}},m=function(e){if(!s(e))return!1;switch(o(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return p||!!d(h,l(e))}catch(e){return!0}};m.sham=!0,e.exports=!u||i((function(){var e;return f(f.call)||!f(Object)||!f((function(){e=!0}))||e}))?m:f},16575:(e,t,r)=>{"use strict";var n=r(39297);e.exports=function(e){return void 0!==e&&(n(e,"value")||n(e,"writable"))}},92796:(e,t,r)=>{"use strict";var n=r(79039),i=r(94901),s=/#|\.prototype\./,o=function(e,t){var r=l[a(e)];return r===u||r!==c&&(i(t)?n(t):!!t)},a=o.normalize=function(e){return String(e).replace(s,".").toLowerCase()},l=o.data={},c=o.NATIVE="N",u=o.POLYFILL="P";e.exports=o},2087:(e,t,r)=>{"use strict";var n=r(20034),i=Math.floor;e.exports=Number.isInteger||function(e){return!n(e)&&isFinite(e)&&i(e)===e}},31563:(e,t,r)=>{"use strict";var n=r(36955),i=r(39297),s=r(64117),o=r(78227),a=r(26269),l=o("iterator"),c=Object;e.exports=function(e){if(s(e))return!1;var t=c(e);return void 0!==t[l]||"@@iterator"in t||i(a,n(t))}},64117:e=>{"use strict";e.exports=function(e){return null==e}},20034:(e,t,r)=>{"use strict";var n=r(94901);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},13925:(e,t,r)=>{"use strict";var n=r(20034);e.exports=function(e){return n(e)||null===e}},96395:e=>{"use strict";e.exports=!1},65810:(e,t,r)=>{"use strict";var n=r(20034),i=r(91181).get;e.exports=function(e){if(!n(e))return!1;var t=i(e);return!!t&&"RawJSON"===t.type}},60788:(e,t,r)=>{"use strict";var n=r(20034),i=r(22195),s=r(78227)("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[s])?!!t:"RegExp"===i(e))}},10757:(e,t,r)=>{"use strict";var n=r(97751),i=r(94901),s=r(1625),o=r(7040),a=Object;e.exports=o?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return i(t)&&s(t.prototype,a(e))}},40507:(e,t,r)=>{"use strict";var n=r(69565);e.exports=function(e,t,r){for(var i,s,o=r?e:e.iterator,a=e.next;!(i=n(a,o)).done;)if(void 0!==(s=t(i.value)))return s}},72652:(e,t,r)=>{"use strict";var n=r(76080),i=r(69565),s=r(28551),o=r(16823),a=r(44209),l=r(26198),c=r(1625),u=r(70081),h=r(50851),d=r(9539),p=TypeError,f=function(e,t){this.stopped=e,this.result=t},m=f.prototype;e.exports=function(e,t,r){var g,A,y,v,x,_,b,w=r&&r.that,E=!(!r||!r.AS_ENTRIES),M=!(!r||!r.IS_RECORD),S=!(!r||!r.IS_ITERATOR),C=!(!r||!r.INTERRUPTED),T=n(t,w),I=function(e){return g&&d(g,"normal",e),new f(!0,e)},R=function(e){return E?(s(e),C?T(e[0],e[1],I):T(e[0],e[1])):C?T(e,I):T(e)};if(M)g=e.iterator;else if(S)g=e;else{if(!(A=h(e)))throw new p(o(e)+" is not iterable");if(a(A)){for(y=0,v=l(e);v>y;y++)if((x=R(e[y]))&&c(m,x))return x;return new f(!1)}g=u(e,A)}for(_=M?e.next:g.next;!(b=i(_,g)).done;){try{x=R(b.value)}catch(e){d(g,"throw",e)}if("object"==typeof x&&x&&c(m,x))return x}return new f(!1)}},9539:(e,t,r)=>{"use strict";var n=r(69565),i=r(28551),s=r(55966);e.exports=function(e,t,r){var o,a;i(e);try{if(!(o=s(e,"return"))){if("throw"===t)throw r;return r}o=n(o,e)}catch(e){a=!0,o=e}if("throw"===t)throw r;if(a)throw o;return i(o),r}},33994:(e,t,r)=>{"use strict";var n=r(57657).IteratorPrototype,i=r(2360),s=r(6980),o=r(10687),a=r(26269),l=function(){return this};e.exports=function(e,t,r,c){var u=t+" Iterator";return e.prototype=i(n,{next:s(+!c,r)}),o(e,u,!1,!0),a[u]=l,e}},19462:(e,t,r)=>{"use strict";var n=r(69565),i=r(2360),s=r(66699),o=r(56279),a=r(78227),l=r(91181),c=r(55966),u=r(57657).IteratorPrototype,h=r(62529),d=r(9539),p=a("toStringTag"),f="IteratorHelper",m="WrapForValidIterator",g=l.set,A=function(e){var t=l.getterFor(e?m:f);return o(i(u),{next:function(){var r=t(this);if(e)return r.nextHandler();try{var n=r.done?void 0:r.nextHandler();return h(n,r.done)}catch(e){throw r.done=!0,e}},return:function(){var r=t(this),i=r.iterator;if(r.done=!0,e){var s=c(i,"return");return s?n(s,i):h(void 0,!0)}if(r.inner)try{d(r.inner.iterator,"normal")}catch(e){return d(i,"throw",e)}return d(i,"normal"),h(void 0,!0)}})},y=A(!0),v=A(!1);s(v,p,"Iterator Helper"),e.exports=function(e,t){var r=function(r,n){n?(n.iterator=r.iterator,n.next=r.next):n=r,n.type=t?m:f,n.nextHandler=e,n.counter=0,n.done=!1,g(this,n)};return r.prototype=t?y:v,r}},51088:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(96395),o=r(10350),a=r(94901),l=r(33994),c=r(42787),u=r(52967),h=r(10687),d=r(66699),p=r(36840),f=r(78227),m=r(26269),g=r(57657),A=o.PROPER,y=o.CONFIGURABLE,v=g.IteratorPrototype,x=g.BUGGY_SAFARI_ITERATORS,_=f("iterator"),b="keys",w="values",E="entries",M=function(){return this};e.exports=function(e,t,r,o,f,g,S){l(r,t,o);var C,T,I,R=function(e){if(e===f&&O)return O;if(!x&&e&&e in L)return L[e];switch(e){case b:case w:case E:return function(){return new r(this,e)}}return function(){return new r(this)}},B=t+" Iterator",P=!1,L=e.prototype,D=L[_]||L["@@iterator"]||f&&L[f],O=!x&&D||R(f),N="Array"===t&&L.entries||D;if(N&&(C=c(N.call(new e)))!==Object.prototype&&C.next&&(s||c(C)===v||(u?u(C,v):a(C[_])||p(C,_,M)),h(C,B,!0,!0),s&&(m[B]=M)),A&&f===w&&D&&D.name!==w&&(!s&&y?d(L,"name",w):(P=!0,O=function(){return i(D,this)})),f)if(T={values:R(w),keys:g?O:R(b),entries:R(E)},S)for(I in T)(x||P||!(I in L))&&p(L,I,T[I]);else n({target:t,proto:!0,forced:x||P},T);return s&&!S||L[_]===O||p(L,_,O,{name:f}),m[t]=O,T}},47958:(e,t,r)=>{"use strict";var n=r(69565),i=r(20713),s=function(e,t){return[t,e]};e.exports=function(){return n(i,this,s)}},20713:(e,t,r)=>{"use strict";var n=r(69565),i=r(79306),s=r(28551),o=r(1767),a=r(19462),l=r(96319),c=a((function(){var e=this.iterator,t=s(n(this.next,e));if(!(this.done=!!t.done))return l(e,this.mapper,[t.value,this.counter++],!0)}));e.exports=function(e){return s(this),i(e),new c(o(this),{mapper:e})}},57657:(e,t,r)=>{"use strict";var n,i,s,o=r(79039),a=r(94901),l=r(20034),c=r(2360),u=r(42787),h=r(36840),d=r(78227),p=r(96395),f=d("iterator"),m=!1;[].keys&&("next"in(s=[].keys())?(i=u(u(s)))!==Object.prototype&&(n=i):m=!0),!l(n)||o((function(){var e={};return n[f].call(e)!==e}))?n={}:p&&(n=c(n)),a(n[f])||h(n,f,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:m}},26269:e=>{"use strict";e.exports={}},26198:(e,t,r)=>{"use strict";var n=r(18014);e.exports=function(e){return n(e.length)}},50283:(e,t,r)=>{"use strict";var n=r(79504),i=r(79039),s=r(94901),o=r(39297),a=r(43724),l=r(10350).CONFIGURABLE,c=r(33706),u=r(91181),h=u.enforce,d=u.get,p=String,f=Object.defineProperty,m=n("".slice),g=n("".replace),A=n([].join),y=a&&!i((function(){return 8!==f((function(){}),"length",{value:8}).length})),v=String(String).split("String"),x=e.exports=function(e,t,r){"Symbol("===m(p(t),0,7)&&(t="["+g(p(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!o(e,"name")||l&&e.name!==t)&&(a?f(e,"name",{value:t,configurable:!0}):e.name=t),y&&r&&o(r,"arity")&&e.length!==r.arity&&f(e,"length",{value:r.arity});try{r&&o(r,"constructor")&&r.constructor?a&&f(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=h(e);return o(n,"source")||(n.source=A(v,"string"==typeof t?t:"")),e};Function.prototype.toString=x((function(){return s(this)&&d(this).source||c(this)}),"toString")},72248:(e,t,r)=>{"use strict";var n=r(79504),i=Map.prototype;e.exports={Map,set:n(i.set),get:n(i.get),has:n(i.has),remove:n(i.delete),proto:i}},26223:(e,t,r)=>{"use strict";var n=r(79504),i=r(40507),s=r(72248),o=s.Map,a=s.proto,l=n(a.forEach),c=n(a.entries),u=c(new o).next;e.exports=function(e,t,r){return r?i({iterator:c(e),next:u},(function(e){return t(e[1],e[0])})):l(e,t)}},162:(e,t,r)=>{"use strict";var n=r(69565),i=r(79306),s=r(94901),o=r(28551),a=TypeError;e.exports=function(e,t){var r,l=o(this),c=i(l.get),u=i(l.has),h=i(l.set),d=arguments.length>2?arguments[2]:void 0;if(!s(t)&&!s(d))throw new a("At least one callback required");return n(u,l,e)?(r=n(c,l,e),s(t)&&(r=t(r),n(h,l,e,r))):s(d)&&(r=d(),n(h,l,e,r)),r}},53250:e=>{"use strict";var t=Math.expm1,r=Math.exp;e.exports=!t||t(10)>22025.465794806718||t(10)<22025.465794806718||-2e-17!==t(-2e-17)?function(e){var t=+e;return 0===t?t:t>-1e-6&&t<1e-6?t+t*t/2:r(t)-1}:t},62724:(e,t,r)=>{"use strict";var n=r(33164);e.exports=Math.f16round||function(e){return n(e,.0009765625,65504,6103515625e-14)}},33164:(e,t,r)=>{"use strict";var n=r(77782),i=Math.abs,s=2220446049250313e-31,o=1/s;e.exports=function(e,t,r,a){var l=+e,c=i(l),u=n(l);if(cr||d!=d?u*(1/0):u*d}},15617:(e,t,r)=>{"use strict";var n=r(33164);e.exports=Math.fround||function(e){return n(e,1.1920928955078125e-7,34028234663852886e22,11754943508222875e-54)}},49340:e=>{"use strict";var t=Math.log,r=Math.LOG10E;e.exports=Math.log10||function(e){return t(e)*r}},7740:e=>{"use strict";var t=Math.log;e.exports=Math.log1p||function(e){var r=+e;return r>-1e-8&&r<1e-8?r-r*r/2:t(1+r)}},77905:e=>{"use strict";e.exports=Math.scale||function(e,t,r,n,i){var s=+e,o=+t,a=+r,l=+n,c=+i;return s!=s||o!=o||a!=a||l!=l||c!=c?NaN:s===1/0||s===-1/0?s:(s-o)*(c-l)/(a-o)+l}},77782:e=>{"use strict";e.exports=Math.sign||function(e){var t=+e;return 0===t||t!=t?t:t<0?-1:1}},80741:e=>{"use strict";var t=Math.ceil,r=Math.floor;e.exports=Math.trunc||function(e){var n=+e;return(n>0?r:t)(n)}},91955:(e,t,r)=>{"use strict";var n,i,s,o,a,l=r(44576),c=r(93389),u=r(76080),h=r(59225).set,d=r(18265),p=r(89544),f=r(44265),m=r(7860),g=r(38574),A=l.MutationObserver||l.WebKitMutationObserver,y=l.document,v=l.process,x=l.Promise,_=c("queueMicrotask");if(!_){var b=new d,w=function(){var e,t;for(g&&(e=v.domain)&&e.exit();t=b.get();)try{t()}catch(e){throw b.head&&n(),e}e&&e.enter()};p||g||m||!A||!y?!f&&x&&x.resolve?((o=x.resolve(void 0)).constructor=x,a=u(o.then,o),n=function(){a(w)}):g?n=function(){v.nextTick(w)}:(h=u(h,l),n=function(){h(w)}):(i=!0,s=y.createTextNode(""),new A(w).observe(s,{characterData:!0}),n=function(){s.data=i=!i}),_=function(e){b.head||n(),b.add(e)}}e.exports=_},27819:(e,t,r)=>{"use strict";var n=r(79039);e.exports=!n((function(){var e="9007199254740993",t=JSON.rawJSON(e);return!JSON.isRawJSON(t)||JSON.stringify(t)!==e}))},36043:(e,t,r)=>{"use strict";var n=r(79306),i=TypeError,s=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw new i("Bad Promise constructor");t=e,r=n})),this.resolve=n(t),this.reject=n(r)};e.exports.f=function(e){return new s(e)}},32603:(e,t,r)=>{"use strict";var n=r(655);e.exports=function(e,t){return void 0===e?arguments.length<2?"":t:n(e)}},24149:e=>{"use strict";var t=RangeError;e.exports=function(e){if(e==e)return e;throw new t("NaN is not allowed")}},60511:(e,t,r)=>{"use strict";var n=r(60788),i=TypeError;e.exports=function(e){if(n(e))throw new i("The method doesn't accept regular expressions");return e}},50360:(e,t,r)=>{"use strict";var n=r(44576).isFinite;e.exports=Number.isFinite||function(e){return"number"==typeof e&&n(e)}},33904:(e,t,r)=>{"use strict";var n=r(44576),i=r(79039),s=r(79504),o=r(655),a=r(43802).trim,l=r(47452),c=s("".charAt),u=n.parseFloat,h=n.Symbol,d=h&&h.iterator,p=1/u(l+"-0")!=-1/0||d&&!i((function(){u(Object(d))}));e.exports=p?function(e){var t=a(o(e)),r=u(t);return 0===r&&"-"===c(t,0)?-0:r}:u},52703:(e,t,r)=>{"use strict";var n=r(44576),i=r(79039),s=r(79504),o=r(655),a=r(43802).trim,l=r(47452),c=n.parseInt,u=n.Symbol,h=u&&u.iterator,d=/^[+-]?0x/i,p=s(d.exec),f=8!==c(l+"08")||22!==c(l+"0x16")||h&&!i((function(){c(Object(h))}));e.exports=f?function(e,t){var r=a(o(e));return c(r,t>>>0||(p(d,r)?16:10))}:c},14468:(e,t,r)=>{"use strict";var n=r(91181),i=r(33994),s=r(62529),o=r(64117),a=r(20034),l=r(62106),c=r(43724),u="Incorrect Iterator.range arguments",h="NumericRangeIterator",d=n.set,p=n.getterFor(h),f=RangeError,m=TypeError,g=i((function(e,t,r,n,i,s){if(typeof e!=n||t!==1/0&&t!==-1/0&&typeof t!=n)throw new m(u);if(e===1/0||e===-1/0)throw new f(u);var l,p=t>e,g=!1;if(void 0===r)l=void 0;else if(a(r))l=r.step,g=!!r.inclusive;else{if(typeof r!=n)throw new m(u);l=r}if(o(l)&&(l=p?s:-s),typeof l!=n)throw new m(u);if(l===1/0||l===-1/0||l===i&&e!==t)throw new f(u);d(this,{type:h,start:e,end:t,step:l,inclusive:g,hitsEnd:e!=e||t!=t||l!=l||t>e!=l>i,currentCount:i,zero:i}),c||(this.start=e,this.end=t,this.step=l,this.inclusive=g)}),h,(function(){var e=p(this);if(e.hitsEnd)return s(void 0,!0);var t=e.start,r=e.end,n=t+e.step*e.currentCount++;n===r&&(e.hitsEnd=!0);var i=e.inclusive;return(r>t?i?n>r:n>=r:i?r>n:r>=n)?(e.hitsEnd=!0,s(void 0,!0)):s(n,!1)})),A=function(e){l(g.prototype,e,{get:function(){return p(this)[e]},set:function(){},configurable:!0,enumerable:!1})};c&&(A("start"),A("end"),A("inclusive"),A("step")),e.exports=g},44213:(e,t,r)=>{"use strict";var n=r(43724),i=r(79504),s=r(69565),o=r(79039),a=r(71072),l=r(33717),c=r(48773),u=r(48981),h=r(47055),d=Object.assign,p=Object.defineProperty,f=i([].concat);e.exports=!d||o((function(){if(n&&1!==d({b:1},d(p({},"a",{enumerable:!0,get:function(){p(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol("assign detection"),i="abcdefghijklmnopqrst";return e[r]=7,i.split("").forEach((function(e){t[e]=e})),7!==d({},e)[r]||a(d({},t)).join("")!==i}))?function(e,t){for(var r=u(e),i=arguments.length,o=1,d=l.f,p=c.f;i>o;)for(var m,g=h(arguments[o++]),A=d?f(a(g),d(g)):a(g),y=A.length,v=0;y>v;)m=A[v++],n&&!s(p,g,m)||(r[m]=g[m]);return r}:d},2360:(e,t,r)=>{"use strict";var n,i=r(28551),s=r(96801),o=r(88727),a=r(30421),l=r(20397),c=r(4055),u=r(66119),h="prototype",d="script",p=u("IE_PROTO"),f=function(){},m=function(e){return"<"+d+">"+e+""},g=function(e){e.write(m("")),e.close();var t=e.parentWindow.Object;return e=null,t},A=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t,r;A="undefined"!=typeof document?document.domain&&n?g(n):(t=c("iframe"),r="java"+d+":",t.style.display="none",l.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(m("document.F=Object")),e.close(),e.F):g(n);for(var i=o.length;i--;)delete A[h][o[i]];return A()};a[p]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(f[h]=i(e),r=new f,f[h]=null,r[p]=e):r=A(),void 0===t?r:s.f(r,t)}},96801:(e,t,r)=>{"use strict";var n=r(43724),i=r(48686),s=r(24913),o=r(28551),a=r(25397),l=r(71072);t.f=n&&!i?Object.defineProperties:function(e,t){o(e);for(var r,n=a(t),i=l(t),c=i.length,u=0;c>u;)s.f(e,r=i[u++],n[r]);return e}},24913:(e,t,r)=>{"use strict";var n=r(43724),i=r(35917),s=r(48686),o=r(28551),a=r(56969),l=TypeError,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,h="enumerable",d="configurable",p="writable";t.f=n?s?function(e,t,r){if(o(e),t=a(t),o(r),"function"==typeof e&&"prototype"===t&&"value"in r&&p in r&&!r[p]){var n=u(e,t);n&&n[p]&&(e[t]=r.value,r={configurable:d in r?r[d]:n[d],enumerable:h in r?r[h]:n[h],writable:!1})}return c(e,t,r)}:c:function(e,t,r){if(o(e),t=a(t),o(r),i)try{return c(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new l("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},77347:(e,t,r)=>{"use strict";var n=r(43724),i=r(69565),s=r(48773),o=r(6980),a=r(25397),l=r(56969),c=r(39297),u=r(35917),h=Object.getOwnPropertyDescriptor;t.f=n?h:function(e,t){if(e=a(e),t=l(t),u)try{return h(e,t)}catch(e){}if(c(e,t))return o(!i(s.f,e,t),e[t])}},10298:(e,t,r)=>{"use strict";var n=r(22195),i=r(25397),s=r(38480).f,o=r(67680),a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"Window"===n(e)?function(e){try{return s(e)}catch(e){return o(a)}}(e):s(i(e))}},38480:(e,t,r)=>{"use strict";var n=r(61828),i=r(88727).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,i)}},33717:(e,t)=>{"use strict";t.f=Object.getOwnPropertySymbols},42787:(e,t,r)=>{"use strict";var n=r(39297),i=r(94901),s=r(48981),o=r(66119),a=r(12211),l=o("IE_PROTO"),c=Object,u=c.prototype;e.exports=a?c.getPrototypeOf:function(e){var t=s(e);if(n(t,l))return t[l];var r=t.constructor;return i(r)&&t instanceof r?r.prototype:t instanceof c?u:null}},34124:(e,t,r)=>{"use strict";var n=r(79039),i=r(20034),s=r(22195),o=r(15652),a=Object.isExtensible,l=n((function(){a(1)}));e.exports=l||o?function(e){return!!i(e)&&(!o||"ArrayBuffer"!==s(e))&&(!a||a(e))}:a},1625:(e,t,r)=>{"use strict";var n=r(79504);e.exports=n({}.isPrototypeOf)},91354:(e,t,r)=>{"use strict";var n=r(91181),i=r(33994),s=r(62529),o=r(39297),a=r(71072),l=r(48981),c="Object Iterator",u=n.set,h=n.getterFor(c);e.exports=i((function(e,t){var r=l(e);u(this,{type:c,mode:t,object:r,keys:a(r),index:0})}),"Object",(function(){for(var e=h(this),t=e.keys;;){if(null===t||e.index>=t.length)return e.object=e.keys=null,s(void 0,!0);var r=t[e.index++],n=e.object;if(o(n,r)){switch(e.mode){case"keys":return s(r,!1);case"values":return s(n[r],!1)}return s([r,n[r]],!1)}}}))},61828:(e,t,r)=>{"use strict";var n=r(79504),i=r(39297),s=r(25397),o=r(19617).indexOf,a=r(30421),l=n([].push);e.exports=function(e,t){var r,n=s(e),c=0,u=[];for(r in n)!i(a,r)&&i(n,r)&&l(u,r);for(;t.length>c;)i(n,r=t[c++])&&(~o(u,r)||l(u,r));return u}},71072:(e,t,r)=>{"use strict";var n=r(61828),i=r(88727);e.exports=Object.keys||function(e){return n(e,i)}},48773:(e,t)=>{"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,i=n&&!r.call({1:2},1);t.f=i?function(e){var t=n(this,e);return!!t&&t.enumerable}:r},42551:(e,t,r)=>{"use strict";var n=r(96395),i=r(44576),s=r(79039),o=r(3607);e.exports=n||!s((function(){if(!(o&&o<535)){var e=Math.random();__defineSetter__.call(null,e,(function(){})),delete i[e]}}))},52967:(e,t,r)=>{"use strict";var n=r(46706),i=r(20034),s=r(67750),o=r(73506);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=n(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return s(r),o(n),i(r)?(t?e(r,n):r.__proto__=n,r):r}}():void 0)},32357:(e,t,r)=>{"use strict";var n=r(43724),i=r(79039),s=r(79504),o=r(42787),a=r(71072),l=r(25397),c=s(r(48773).f),u=s([].push),h=n&&i((function(){var e=Object.create(null);return e[2]=2,!c(e,2)})),d=function(e){return function(t){for(var r,i=l(t),s=a(i),d=h&&null===o(i),p=s.length,f=0,m=[];p>f;)r=s[f++],n&&!(d?r in i:c(i,r))||u(m,e?[r,i[r]]:i[r]);return m}};e.exports={entries:d(!0),values:d(!1)}},53179:(e,t,r)=>{"use strict";var n=r(92140),i=r(36955);e.exports=n?{}.toString:function(){return"[object "+i(this)+"]"}},84270:(e,t,r)=>{"use strict";var n=r(69565),i=r(94901),s=r(20034),o=TypeError;e.exports=function(e,t){var r,a;if("string"===t&&i(r=e.toString)&&!s(a=n(r,e)))return a;if(i(r=e.valueOf)&&!s(a=n(r,e)))return a;if("string"!==t&&i(r=e.toString)&&!s(a=n(r,e)))return a;throw new o("Can't convert object to primitive value")}},35031:(e,t,r)=>{"use strict";var n=r(97751),i=r(79504),s=r(38480),o=r(33717),a=r(28551),l=i([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=s.f(a(e)),r=o.f;return r?l(t,r(e)):t}},616:(e,t,r)=>{"use strict";var n=r(79504),i=r(39297),s=SyntaxError,o=parseInt,a=String.fromCharCode,l=n("".charAt),c=n("".slice),u=n(/./.exec),h={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":"\n","\\r":"\r","\\t":"\t"},d=/^[\da-f]{4}$/i,p=/^[\u0000-\u001F]$/;e.exports=function(e,t){for(var r=!0,n="";t{"use strict";var n=r(44576);e.exports=n},1103:e=>{"use strict";e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},10916:(e,t,r)=>{"use strict";var n=r(44576),i=r(80550),s=r(94901),o=r(92796),a=r(33706),l=r(78227),c=r(84215),u=r(96395),h=r(39519),d=i&&i.prototype,p=l("species"),f=!1,m=s(n.PromiseRejectionEvent),g=o("Promise",(function(){var e=a(i),t=e!==String(i);if(!t&&66===h)return!0;if(u&&(!d.catch||!d.finally))return!0;if(!h||h<51||!/native code/.test(e)){var r=new i((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};if((r.constructor={})[p]=n,!(f=r.then((function(){}))instanceof n))return!0}return!(t||"BROWSER"!==c&&"DENO"!==c||m)}));e.exports={CONSTRUCTOR:g,REJECTION_EVENT:m,SUBCLASSING:f}},80550:(e,t,r)=>{"use strict";var n=r(44576);e.exports=n.Promise},93438:(e,t,r)=>{"use strict";var n=r(28551),i=r(20034),s=r(36043);e.exports=function(e,t){if(n(e),i(t)&&t.constructor===e)return t;var r=s.f(e);return(0,r.resolve)(t),r.promise}},90537:(e,t,r)=>{"use strict";var n=r(80550),i=r(84428),s=r(10916).CONSTRUCTOR;e.exports=s||!i((function(e){n.all(e).then(void 0,(function(){}))}))},11056:(e,t,r)=>{"use strict";var n=r(24913).f;e.exports=function(e,t,r){r in e||n(e,r,{configurable:!0,get:function(){return t[r]},set:function(e){t[r]=e}})}},18265:e=>{"use strict";var t=function(){this.head=null,this.tail=null};t.prototype={add:function(e){var t={item:e,next:null},r=this.tail;r?r.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}},e.exports=t},18449:(e,t,r)=>{"use strict";r(36033),r(73772);var n=r(97751),i=r(79504),s=r(25745),o=n("Map"),a=n("WeakMap"),l=i([].push),c=s("metadata"),u=c.store||(c.store=new a),h=function(e,t,r){var n=u.get(e);if(!n){if(!r)return;u.set(e,n=new o)}var i=n.get(t);if(!i){if(!r)return;n.set(t,i=new o)}return i};e.exports={store:u,getMap:h,has:function(e,t,r){var n=h(t,r,!1);return void 0!==n&&n.has(e)},get:function(e,t,r){var n=h(t,r,!1);return void 0===n?void 0:n.get(e)},set:function(e,t,r,n){h(r,n,!0).set(e,t)},keys:function(e,t){var r=h(e,t,!1),n=[];return r&&r.forEach((function(e,t){l(n,t)})),n},toKey:function(e){return void 0===e||"symbol"==typeof e?e:String(e)}}},56682:(e,t,r)=>{"use strict";var n=r(69565),i=r(28551),s=r(94901),o=r(22195),a=r(57323),l=TypeError;e.exports=function(e,t){var r=e.exec;if(s(r)){var c=n(r,e,t);return null!==c&&i(c),c}if("RegExp"===o(e))return n(a,e,t);throw new l("RegExp#exec called on incompatible receiver")}},57323:(e,t,r)=>{"use strict";var n,i,s=r(69565),o=r(79504),a=r(655),l=r(67979),c=r(58429),u=r(25745),h=r(2360),d=r(91181).get,p=r(83635),f=r(18814),m=u("native-string-replace",String.prototype.replace),g=RegExp.prototype.exec,A=g,y=o("".charAt),v=o("".indexOf),x=o("".replace),_=o("".slice),b=(i=/b*/g,s(g,n=/a/,"a"),s(g,i,"a"),0!==n.lastIndex||0!==i.lastIndex),w=c.BROKEN_CARET,E=void 0!==/()??/.exec("")[1];(b||E||w||p||f)&&(A=function(e){var t,r,n,i,o,c,u,p=this,f=d(p),M=a(e),S=f.raw;if(S)return S.lastIndex=p.lastIndex,t=s(A,S,M),p.lastIndex=S.lastIndex,t;var C=f.groups,T=w&&p.sticky,I=s(l,p),R=p.source,B=0,P=M;if(T&&(I=x(I,"y",""),-1===v(I,"g")&&(I+="g"),P=_(M,p.lastIndex),p.lastIndex>0&&(!p.multiline||p.multiline&&"\n"!==y(M,p.lastIndex-1))&&(R="(?: "+R+")",P=" "+P,B++),r=new RegExp("^(?:"+R+")",I)),E&&(r=new RegExp("^"+R+"$(?!\\s)",I)),b&&(n=p.lastIndex),i=s(g,T?r:p,P),T?i?(i.input=_(i.input,B),i[0]=_(i[0],B),i.index=p.lastIndex,p.lastIndex+=i[0].length):p.lastIndex=0:b&&i&&(p.lastIndex=p.global?i.index+i[0].length:n),E&&i&&i.length>1&&s(m,i[0],r,(function(){for(o=1;o{"use strict";var n=r(28551);e.exports=function(){var e=n(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},61034:(e,t,r)=>{"use strict";var n=r(69565),i=r(39297),s=r(1625),o=r(67979),a=RegExp.prototype;e.exports=function(e){var t=e.flags;return void 0!==t||"flags"in a||i(e,"flags")||!s(a,e)?t:n(o,e)}},58429:(e,t,r)=>{"use strict";var n=r(79039),i=r(44576).RegExp,s=n((function(){var e=i("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),o=s||n((function(){return!i("a","y").sticky})),a=s||n((function(){var e=i("^r","gy");return e.lastIndex=2,null!==e.exec("str")}));e.exports={BROKEN_CARET:a,MISSED_STICKY:o,UNSUPPORTED_Y:s}},83635:(e,t,r)=>{"use strict";var n=r(79039),i=r(44576).RegExp;e.exports=n((function(){var e=i(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)}))},18814:(e,t,r)=>{"use strict";var n=r(79039),i=r(44576).RegExp;e.exports=n((function(){var e=i("(?b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$c")}))},67750:(e,t,r)=>{"use strict";var n=r(64117),i=TypeError;e.exports=function(e){if(n(e))throw new i("Can't call method on "+e);return e}},93389:(e,t,r)=>{"use strict";var n=r(44576),i=r(43724),s=Object.getOwnPropertyDescriptor;e.exports=function(e){if(!i)return n[e];var t=s(n,e);return t&&t.value}},33317:e=>{"use strict";e.exports=function(e,t){return e===t||e!=e&&t!=t}},3470:e=>{"use strict";e.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},79472:(e,t,r)=>{"use strict";var n,i=r(44576),s=r(18745),o=r(94901),a=r(84215),l=r(82839),c=r(67680),u=r(22812),h=i.Function,d=/MSIE .\./.test(l)||"BUN"===a&&((n=i.Bun.version.split(".")).length<3||"0"===n[0]&&(n[1]<3||"3"===n[1]&&"0"===n[2]));e.exports=function(e,t){var r=t?2:1;return d?function(n,i){var a=u(arguments.length,1)>r,l=o(n)?n:h(n),d=a?c(arguments,r):[],p=a?function(){s(l,this,d)}:l;return t?e(p,i):e(p)}:e}},89286:(e,t,r)=>{"use strict";var n=r(94402),i=r(38469),s=n.Set,o=n.add;e.exports=function(e){var t=new s;return i(e,(function(e){o(t,e)})),t}},83440:(e,t,r)=>{"use strict";var n=r(97080),i=r(94402),s=r(89286),o=r(25170),a=r(83789),l=r(38469),c=r(40507),u=i.has,h=i.remove;e.exports=function(e){var t=n(this),r=a(e),i=s(t);return o(t)<=r.size?l(t,(function(e){r.includes(e)&&h(i,e)})):c(r.getIterator(),(function(e){u(t,e)&&h(i,e)})),i}},94402:(e,t,r)=>{"use strict";var n=r(79504),i=Set.prototype;e.exports={Set,add:n(i.add),has:n(i.has),remove:n(i.delete),proto:i}},68750:(e,t,r)=>{"use strict";var n=r(97080),i=r(94402),s=r(25170),o=r(83789),a=r(38469),l=r(40507),c=i.Set,u=i.add,h=i.has;e.exports=function(e){var t=n(this),r=o(e),i=new c;return s(t)>r.size?l(r.getIterator(),(function(e){h(t,e)&&u(i,e)})):a(t,(function(e){r.includes(e)&&u(i,e)})),i}},64449:(e,t,r)=>{"use strict";var n=r(97080),i=r(94402).has,s=r(25170),o=r(83789),a=r(38469),l=r(40507),c=r(9539);e.exports=function(e){var t=n(this),r=o(e);if(s(t)<=r.size)return!1!==a(t,(function(e){if(r.includes(e))return!1}),!0);var u=r.getIterator();return!1!==l(u,(function(e){if(i(t,e))return c(u,"normal",!1)}))}},53838:(e,t,r)=>{"use strict";var n=r(97080),i=r(25170),s=r(38469),o=r(83789);e.exports=function(e){var t=n(this),r=o(e);return!(i(t)>r.size)&&!1!==s(t,(function(e){if(!r.includes(e))return!1}),!0)}},28527:(e,t,r)=>{"use strict";var n=r(97080),i=r(94402).has,s=r(25170),o=r(83789),a=r(40507),l=r(9539);e.exports=function(e){var t=n(this),r=o(e);if(s(t){"use strict";var n=r(79504),i=r(40507),s=r(94402),o=s.Set,a=s.proto,l=n(a.forEach),c=n(a.keys),u=c(new o).next;e.exports=function(e,t,r){return r?i({iterator:c(e),next:u},t):l(e,t)}},84916:(e,t,r)=>{"use strict";var n=r(97751),i=function(e){return{size:e,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};e.exports=function(e){var t=n("Set");try{(new t)[e](i(0));try{return(new t)[e](i(-1)),!1}catch(e){return!0}}catch(e){return!1}}},25170:(e,t,r)=>{"use strict";var n=r(46706),i=r(94402);e.exports=n(i.proto,"size","get")||function(e){return e.size}},87633:(e,t,r)=>{"use strict";var n=r(97751),i=r(62106),s=r(78227),o=r(43724),a=s("species");e.exports=function(e){var t=n(e);o&&t&&!t[a]&&i(t,a,{configurable:!0,get:function(){return this}})}},83650:(e,t,r)=>{"use strict";var n=r(97080),i=r(94402),s=r(89286),o=r(83789),a=r(40507),l=i.add,c=i.has,u=i.remove;e.exports=function(e){var t=n(this),r=o(e).getIterator(),i=s(t);return a(r,(function(e){c(t,e)?u(i,e):l(i,e)})),i}},10687:(e,t,r)=>{"use strict";var n=r(24913).f,i=r(39297),s=r(78227)("toStringTag");e.exports=function(e,t,r){e&&!r&&(e=e.prototype),e&&!i(e,s)&&n(e,s,{configurable:!0,value:t})}},44204:(e,t,r)=>{"use strict";var n=r(97080),i=r(94402).add,s=r(89286),o=r(83789),a=r(40507);e.exports=function(e){var t=n(this),r=o(e).getIterator(),l=s(t);return a(r,(function(e){i(l,e)})),l}},66119:(e,t,r)=>{"use strict";var n=r(25745),i=r(33392),s=n("keys");e.exports=function(e){return s[e]||(s[e]=i(e))}},77629:(e,t,r)=>{"use strict";var n=r(96395),i=r(44576),s=r(39433),o="__core-js_shared__",a=e.exports=i[o]||s(o,{});(a.versions||(a.versions=[])).push({version:"3.38.1",mode:n?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE",source:"https://github.com/zloirock/core-js"})},25745:(e,t,r)=>{"use strict";var n=r(77629);e.exports=function(e,t){return n[e]||(n[e]=t||{})}},2293:(e,t,r)=>{"use strict";var n=r(28551),i=r(35548),s=r(64117),o=r(78227)("species");e.exports=function(e,t){var r,a=n(e).constructor;return void 0===a||s(r=n(a)[o])?t:i(r)}},74615:(e,t,r)=>{"use strict";var n=r(79504),i=r(25397),s=r(655),o=r(26198),a=TypeError,l=n([].push),c=n([].join);e.exports=function(e){var t=i(e),r=o(t);if(!r)return"";for(var n=arguments.length,u=[],h=0;;){var d=t[h++];if(void 0===d)throw new a("Incorrect template");if(l(u,s(d)),h===r)return c(u,"");h{"use strict";var n=r(79039);e.exports=function(e){return n((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}))}},68183:(e,t,r)=>{"use strict";var n=r(79504),i=r(91291),s=r(655),o=r(67750),a=n("".charAt),l=n("".charCodeAt),c=n("".slice),u=function(e){return function(t,r){var n,u,h=s(o(t)),d=i(r),p=h.length;return d<0||d>=p?e?"":void 0:(n=l(h,d))<55296||n>56319||d+1===p||(u=l(h,d+1))<56320||u>57343?e?a(h,d):n:e?c(h,d,d+2):u-56320+(n-55296<<10)+65536}};e.exports={codeAt:u(!1),charAt:u(!0)}},83063:(e,t,r)=>{"use strict";var n=r(82839);e.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(n)},60533:(e,t,r)=>{"use strict";var n=r(79504),i=r(18014),s=r(655),o=r(72333),a=r(67750),l=n(o),c=n("".slice),u=Math.ceil,h=function(e){return function(t,r,n){var o,h,d=s(a(t)),p=i(r),f=d.length,m=void 0===n?" ":s(n);return p<=f||""===m?d:((h=l(m,u((o=p-f)/m.length))).length>o&&(h=c(h,0,o)),e?d+h:h+d)}};e.exports={start:h(!1),end:h(!0)}},58523:(e,t,r)=>{"use strict";var n=r(97751),i=r(79504),s=String.fromCharCode,o=n("String","fromCodePoint"),a=i("".charAt),l=i("".charCodeAt),c=i("".indexOf),u=i("".slice),h=function(e,t){var r=l(e,t);return r>=48&&r<=57},d=function(e,t,r){if(r>=e.length)return-1;for(var n=0;t=48&&e<=57?e-48:e>=97&&e<=102?e-97+10:e>=65&&e<=70?e-65+10:-1};e.exports=function(e){for(var t,r="",n=0,i=0;(i=c(e,"\\",i))>-1;){if(r+=u(e,n,i),++i===e.length)return;var l=a(e,i++);switch(l){case"b":r+="\b";break;case"t":r+="\t";break;case"n":r+="\n";break;case"v":r+="\v";break;case"f":r+="\f";break;case"r":r+="\r";break;case"\r":i1114111)return;r+=o(t);break;default:if(h(l,0))return;r+=l}n=i}return r+u(e,n)}},3717:(e,t,r)=>{"use strict";var n=r(79504),i=2147483647,s=/[^\0-\u007E]/,o=/[.\u3002\uFF0E\uFF61]/g,a="Overflow: input needs wider integers to process",l=RangeError,c=n(o.exec),u=Math.floor,h=String.fromCharCode,d=n("".charCodeAt),p=n([].join),f=n([].push),m=n("".replace),g=n("".split),A=n("".toLowerCase),y=function(e){return e+22+75*(e<26)},v=function(e,t,r){var n=0;for(e=r?u(e/700):e>>1,e+=u(e/t);e>455;)e=u(e/35),n+=36;return u(n+36*e/(e+38))},x=function(e){var t=[];e=function(e){for(var t=[],r=0,n=e.length;r=55296&&i<=56319&&r=o&&nu((i-c)/_))throw new l(a);for(c+=(x-o)*_,o=x,r=0;ri)throw new l(a);if(n===o){for(var b=c,w=36;;){var E=w<=m?1:w>=m+26?26:w-m;if(b{"use strict";var n=r(91291),i=r(655),s=r(67750),o=RangeError;e.exports=function(e){var t=i(s(this)),r="",a=n(e);if(a<0||a===1/0)throw new o("Wrong number of repetitions");for(;a>0;(a>>>=1)&&(t+=t))1&a&&(r+=t);return r}},18866:(e,t,r)=>{"use strict";var n=r(43802).end,i=r(60706);e.exports=i("trimEnd")?function(){return n(this)}:"".trimEnd},60706:(e,t,r)=>{"use strict";var n=r(10350).PROPER,i=r(79039),s=r(47452);e.exports=function(e){return i((function(){return!!s[e]()||"​…᠎"!=="​…᠎"[e]()||n&&s[e].name!==e}))}},53487:(e,t,r)=>{"use strict";var n=r(43802).start,i=r(60706);e.exports=i("trimStart")?function(){return n(this)}:"".trimStart},43802:(e,t,r)=>{"use strict";var n=r(79504),i=r(67750),s=r(655),o=r(47452),a=n("".replace),l=RegExp("^["+o+"]+"),c=RegExp("(^|[^"+o+"])["+o+"]+$"),u=function(e){return function(t){var r=s(i(t));return 1&e&&(r=a(r,l,"")),2&e&&(r=a(r,c,"$1")),r}};e.exports={start:u(1),end:u(2),trim:u(3)}},1548:(e,t,r)=>{"use strict";var n=r(44576),i=r(79039),s=r(39519),o=r(84215),a=n.structuredClone;e.exports=!!a&&!i((function(){if("DENO"===o&&s>92||"NODE"===o&&s>94||"BROWSER"===o&&s>97)return!1;var e=new ArrayBuffer(8),t=a(e,{transfer:[e]});return 0!==e.byteLength||8!==t.byteLength}))},4495:(e,t,r)=>{"use strict";var n=r(39519),i=r(79039),s=r(44576).String;e.exports=!!Object.getOwnPropertySymbols&&!i((function(){var e=Symbol("symbol detection");return!s(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},58242:(e,t,r)=>{"use strict";var n=r(69565),i=r(97751),s=r(78227),o=r(36840);e.exports=function(){var e=i("Symbol"),t=e&&e.prototype,r=t&&t.valueOf,a=s("toPrimitive");t&&!t[a]&&o(t,a,(function(e){return n(r,this)}),{arity:1})}},12586:(e,t,r)=>{"use strict";var n=r(97751),i=r(79504),s=n("Symbol"),o=s.keyFor,a=i(s.prototype.valueOf);e.exports=s.isRegisteredSymbol||function(e){try{return void 0!==o(a(e))}catch(e){return!1}}},52104:(e,t,r)=>{"use strict";for(var n=r(25745),i=r(97751),s=r(79504),o=r(10757),a=r(78227),l=i("Symbol"),c=l.isWellKnownSymbol,u=i("Object","getOwnPropertyNames"),h=s(l.prototype.valueOf),d=n("wks"),p=0,f=u(l),m=f.length;p{"use strict";var n=r(4495);e.exports=n&&!!Symbol.for&&!!Symbol.keyFor},59225:(e,t,r)=>{"use strict";var n,i,s,o,a=r(44576),l=r(18745),c=r(76080),u=r(94901),h=r(39297),d=r(79039),p=r(20397),f=r(67680),m=r(4055),g=r(22812),A=r(89544),y=r(38574),v=a.setImmediate,x=a.clearImmediate,_=a.process,b=a.Dispatch,w=a.Function,E=a.MessageChannel,M=a.String,S=0,C={},T="onreadystatechange";d((function(){n=a.location}));var I=function(e){if(h(C,e)){var t=C[e];delete C[e],t()}},R=function(e){return function(){I(e)}},B=function(e){I(e.data)},P=function(e){a.postMessage(M(e),n.protocol+"//"+n.host)};v&&x||(v=function(e){g(arguments.length,1);var t=u(e)?e:w(e),r=f(arguments,1);return C[++S]=function(){l(t,void 0,r)},i(S),S},x=function(e){delete C[e]},y?i=function(e){_.nextTick(R(e))}:b&&b.now?i=function(e){b.now(R(e))}:E&&!A?(o=(s=new E).port2,s.port1.onmessage=B,i=c(o.postMessage,o)):a.addEventListener&&u(a.postMessage)&&!a.importScripts&&n&&"file:"!==n.protocol&&!d(P)?(i=P,a.addEventListener("message",B,!1)):i=T in m("script")?function(e){p.appendChild(m("script"))[T]=function(){p.removeChild(this),I(e)}}:function(e){setTimeout(R(e),0)}),e.exports={set:v,clear:x}},31240:(e,t,r)=>{"use strict";var n=r(79504);e.exports=n(1..valueOf)},35610:(e,t,r)=>{"use strict";var n=r(91291),i=Math.max,s=Math.min;e.exports=function(e,t){var r=n(e);return r<0?i(r+t,0):s(r,t)}},75854:(e,t,r)=>{"use strict";var n=r(72777),i=TypeError;e.exports=function(e){var t=n(e,"number");if("number"==typeof t)throw new i("Can't convert number to bigint");return BigInt(t)}},57696:(e,t,r)=>{"use strict";var n=r(91291),i=r(18014),s=RangeError;e.exports=function(e){if(void 0===e)return 0;var t=n(e),r=i(t);if(t!==r)throw new s("Wrong length or index");return r}},25397:(e,t,r)=>{"use strict";var n=r(47055),i=r(67750);e.exports=function(e){return n(i(e))}},91291:(e,t,r)=>{"use strict";var n=r(80741);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},18014:(e,t,r)=>{"use strict";var n=r(91291),i=Math.min;e.exports=function(e){var t=n(e);return t>0?i(t,9007199254740991):0}},48981:(e,t,r)=>{"use strict";var n=r(67750),i=Object;e.exports=function(e){return i(n(e))}},58229:(e,t,r)=>{"use strict";var n=r(99590),i=RangeError;e.exports=function(e,t){var r=n(e);if(r%t)throw new i("Wrong offset");return r}},99590:(e,t,r)=>{"use strict";var n=r(91291),i=RangeError;e.exports=function(e){var t=n(e);if(t<0)throw new i("The argument can't be less than 0");return t}},72777:(e,t,r)=>{"use strict";var n=r(69565),i=r(20034),s=r(10757),o=r(55966),a=r(84270),l=r(78227),c=TypeError,u=l("toPrimitive");e.exports=function(e,t){if(!i(e)||s(e))return e;var r,l=o(e,u);if(l){if(void 0===t&&(t="default"),r=n(l,e,t),!i(r)||s(r))return r;throw new c("Can't convert object to primitive value")}return void 0===t&&(t="number"),a(e,t)}},56969:(e,t,r)=>{"use strict";var n=r(72777),i=r(10757);e.exports=function(e){var t=n(e,"string");return i(t)?t:t+""}},47650:(e,t,r)=>{"use strict";var n=r(97751),i=r(94901),s=r(31563),o=r(20034),a=n("Set");e.exports=function(e){return function(e){return o(e)&&"number"==typeof e.size&&i(e.has)&&i(e.keys)}(e)?e:s(e)?new a(e):e}},92140:(e,t,r)=>{"use strict";var n={};n[r(78227)("toStringTag")]="z",e.exports="[object z]"===String(n)},655:(e,t,r)=>{"use strict";var n=r(36955),i=String;e.exports=function(e){if("Symbol"===n(e))throw new TypeError("Cannot convert a Symbol value to a string");return i(e)}},58319:e=>{"use strict";var t=Math.round;e.exports=function(e){var r=t(e);return r<0?0:r>255?255:255&r}},16823:e=>{"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},15823:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(69565),o=r(43724),a=r(72805),l=r(94644),c=r(66346),u=r(90679),h=r(6980),d=r(66699),p=r(2087),f=r(18014),m=r(57696),g=r(58229),A=r(58319),y=r(56969),v=r(39297),x=r(36955),_=r(20034),b=r(10757),w=r(2360),E=r(1625),M=r(52967),S=r(38480).f,C=r(43251),T=r(59213).forEach,I=r(87633),R=r(62106),B=r(24913),P=r(77347),L=r(35370),D=r(91181),O=r(23167),N=D.get,U=D.set,F=D.enforce,k=B.f,z=P.f,G=i.RangeError,Q=c.ArrayBuffer,V=Q.prototype,H=c.DataView,j=l.NATIVE_ARRAY_BUFFER_VIEWS,q=l.TYPED_ARRAY_TAG,W=l.TypedArray,Y=l.TypedArrayPrototype,X=l.isTypedArray,K="BYTES_PER_ELEMENT",$="Wrong length",J=function(e,t){R(e,t,{configurable:!0,get:function(){return N(this)[t]}})},Z=function(e){var t;return E(V,e)||"ArrayBuffer"===(t=x(e))||"SharedArrayBuffer"===t},ee=function(e,t){return X(e)&&!b(t)&&t in e&&p(+t)&&t>=0},te=function(e,t){return t=y(t),ee(e,t)?h(2,e[t]):z(e,t)},re=function(e,t,r){return t=y(t),!(ee(e,t)&&_(r)&&v(r,"value"))||v(r,"get")||v(r,"set")||r.configurable||v(r,"writable")&&!r.writable||v(r,"enumerable")&&!r.enumerable?k(e,t,r):(e[t]=r.value,e)};o?(j||(P.f=te,B.f=re,J(Y,"buffer"),J(Y,"byteOffset"),J(Y,"byteLength"),J(Y,"length")),n({target:"Object",stat:!0,forced:!j},{getOwnPropertyDescriptor:te,defineProperty:re}),e.exports=function(e,t,r){var o=e.match(/\d+/)[0]/8,l=e+(r?"Clamped":"")+"Array",c="get"+e,h="set"+e,p=i[l],y=p,v=y&&y.prototype,x={},b=function(e,t){k(e,t,{get:function(){return function(e,t){var r=N(e);return r.view[c](t*o+r.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,n){var i=N(e);i.view[h](t*o+i.byteOffset,r?A(n):n,!0)}(this,t,e)},enumerable:!0})};j?a&&(y=t((function(e,t,r,n){return u(e,v),O(_(t)?Z(t)?void 0!==n?new p(t,g(r,o),n):void 0!==r?new p(t,g(r,o)):new p(t):X(t)?L(y,t):s(C,y,t):new p(m(t)),e,y)})),M&&M(y,W),T(S(p),(function(e){e in y||d(y,e,p[e])})),y.prototype=v):(y=t((function(e,t,r,n){u(e,v);var i,a,l,c=0,h=0;if(_(t)){if(!Z(t))return X(t)?L(y,t):s(C,y,t);i=t,h=g(r,o);var d=t.byteLength;if(void 0===n){if(d%o)throw new G($);if((a=d-h)<0)throw new G($)}else if((a=f(n)*o)+h>d)throw new G($);l=a/o}else l=m(t),i=new Q(a=l*o);for(U(e,{buffer:i,byteOffset:h,byteLength:a,length:l,view:new H(i)});c{"use strict";var n=r(44576),i=r(79039),s=r(84428),o=r(94644).NATIVE_ARRAY_BUFFER_VIEWS,a=n.ArrayBuffer,l=n.Int8Array;e.exports=!o||!i((function(){l(1)}))||!i((function(){new l(-1)}))||!s((function(e){new l,new l(null),new l(1.5),new l(e)}),!0)||i((function(){return 1!==new l(new a(2),1,void 0).length}))},26357:(e,t,r)=>{"use strict";var n=r(35370),i=r(61412);e.exports=function(e,t){return n(i(e),t)}},43251:(e,t,r)=>{"use strict";var n=r(76080),i=r(69565),s=r(35548),o=r(48981),a=r(26198),l=r(70081),c=r(50851),u=r(44209),h=r(18727),d=r(94644).aTypedArrayConstructor,p=r(75854);e.exports=function(e){var t,r,f,m,g,A,y,v,x=s(this),_=o(e),b=arguments.length,w=b>1?arguments[1]:void 0,E=void 0!==w,M=c(_);if(M&&!u(M))for(v=(y=l(_,M)).next,_=[];!(A=i(v,y)).done;)_.push(A.value);for(E&&b>2&&(w=n(w,arguments[2])),r=a(_),f=new(d(x))(r),m=h(f),t=0;r>t;t++)g=E?w(_[t],t):_[t],f[t]=m?p(g):+g;return f}},61412:(e,t,r)=>{"use strict";var n=r(94644),i=r(2293),s=n.aTypedArrayConstructor,o=n.getTypedArrayConstructor;e.exports=function(e){return s(i(e,o(e)))}},33392:(e,t,r)=>{"use strict";var n=r(79504),i=0,s=Math.random(),o=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+o(++i+s,36)}},59143:(e,t,r)=>{"use strict";var n=r(44576),i=r(79504),s=r(83972),o=r(63463),a=r(39297),l=r(92804),c=r(944),u=r(55169),h=l.c2i,d=l.c2iUrl,p=n.SyntaxError,f=n.TypeError,m=i("".charAt),g=function(e,t){for(var r=e.length;t>16&255,i>>8&255,255&i];if(2===n){if(r&&0!==s[1])throw new p("Extra bits");return[s[0]]}if(3===n){if(r&&0!==s[2])throw new p("Extra bits");return[s[0],s[1]]}return s},y=function(e,t,r){for(var n=t.length,i=0;i0){if("stop-before-partial"===l)break;if("loose"!==l)throw new p("Missing padding");if(1===b.length)throw new p("Malformed padding: exactly one additional character");x=y(v,A(b,i,!1),x)}_=e.length;break}var E=m(e,w);if(++w,"="===E){if(b.length<2)throw new p("Padding is too early");if(w=g(e,w),2===b.length){if(w===e.length){if("stop-before-partial"===l)break;throw new p("Malformed padding: only one =")}"="===m(e,w)&&(++w,w=g(e,w))}if(w{"use strict";var n=r(44576),i=r(79504),s=n.Uint8Array,o=n.SyntaxError,a=n.parseInt,l=Math.min,c=/[^\da-f]/i,u=i(c.exec),h=i("".slice);e.exports=function(e,t){var r=e.length;if(r%2!=0)throw new o("String should be an even number of characters");for(var n=t?l(t.length,r/2):r/2,i=t||new s(n),d=0,p=0;p{"use strict";var n=r(79039),i=r(78227),s=r(43724),o=r(96395),a=i("iterator");e.exports=!n((function(){var e=new URL("b?a=1&b=2&c=3","https://a"),t=e.searchParams,r=new URLSearchParams("a=1&a=2&b=3"),n="";return e.pathname="c%20d",t.forEach((function(e,r){t.delete("b"),n+=r+e})),r.delete("a",2),r.delete("b",void 0),o&&(!e.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!t.size&&(o||!s)||!t.sort||"https://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[a]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("https://тест").host||"#%D0%B1"!==new URL("https://a#б").hash||"a1c3"!==n||"x"!==new URL("https://x",void 0).host}))},7040:(e,t,r)=>{"use strict";var n=r(4495);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},48686:(e,t,r)=>{"use strict";var n=r(43724),i=r(79039);e.exports=n&&i((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},22812:e=>{"use strict";var t=TypeError;e.exports=function(e,r){if(e{"use strict";var n=r(44576),i=r(94901),s=n.WeakMap;e.exports=i(s)&&/native code/.test(String(s))},44995:(e,t,r)=>{"use strict";var n=r(79504),i=WeakMap.prototype;e.exports={WeakMap,set:n(i.set),get:n(i.get),has:n(i.has),remove:n(i.delete)}},88205:(e,t,r)=>{"use strict";var n=r(79504),i=WeakSet.prototype;e.exports={WeakSet,add:n(i.add),has:n(i.has),remove:n(i.delete)}},70511:(e,t,r)=>{"use strict";var n=r(19167),i=r(39297),s=r(1951),o=r(24913).f;e.exports=function(e){var t=n.Symbol||(n.Symbol={});i(t,e)||o(t,e,{value:s.f(e)})}},1951:(e,t,r)=>{"use strict";var n=r(78227);t.f=n},78227:(e,t,r)=>{"use strict";var n=r(44576),i=r(25745),s=r(39297),o=r(33392),a=r(4495),l=r(7040),c=n.Symbol,u=i("wks"),h=l?c.for||c:c&&c.withoutSetter||o;e.exports=function(e){return s(u,e)||(u[e]=a&&s(c,e)?c[e]:h("Symbol."+e)),u[e]}},47452:e=>{"use strict";e.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},14601:(e,t,r)=>{"use strict";var n=r(97751),i=r(39297),s=r(66699),o=r(1625),a=r(52967),l=r(77740),c=r(11056),u=r(23167),h=r(32603),d=r(77584),p=r(80747),f=r(43724),m=r(96395);e.exports=function(e,t,r,g){var A="stackTraceLimit",y=g?2:1,v=e.split("."),x=v[v.length-1],_=n.apply(null,v);if(_){var b=_.prototype;if(!m&&i(b,"cause")&&delete b.cause,!r)return _;var w=n("Error"),E=t((function(e,t){var r=h(g?t:e,void 0),n=g?new _(e):new _;return void 0!==r&&s(n,"message",r),p(n,E,n.stack,2),this&&o(b,this)&&u(n,this,E),arguments.length>y&&d(n,arguments[y]),n}));if(E.prototype=b,"Error"!==x?a?a(E,w):l(E,w,{name:!0}):f&&A in _&&(c(E,_,A),c(E,_,"prepareStackTrace")),l(E,_),!m)try{b.name!==x&&s(b,"name",x),b.constructor=E}catch(e){}return E}}},4294:(e,t,r)=>{"use strict";var n=r(46518),i=r(97751),s=r(18745),o=r(79039),a=r(14601),l="AggregateError",c=i(l),u=!o((function(){return 1!==c([1]).errors[0]}))&&o((function(){return 7!==c([1],l,{cause:7}).cause}));n({global:!0,constructor:!0,arity:2,forced:u},{AggregateError:a(l,(function(e){return function(t,r){return s(e,this,arguments)}}),u,!0)})},17145:(e,t,r)=>{"use strict";var n=r(46518),i=r(1625),s=r(42787),o=r(52967),a=r(77740),l=r(2360),c=r(66699),u=r(6980),h=r(77584),d=r(80747),p=r(72652),f=r(32603),m=r(78227)("toStringTag"),g=Error,A=[].push,y=function(e,t){var r,n=i(v,this);o?r=o(new g,n?s(this):v):(r=n?this:l(v),c(r,m,"Error")),void 0!==t&&c(r,"message",f(t)),d(r,y,r.stack,1),arguments.length>2&&h(r,arguments[2]);var a=[];return p(e,A,{that:a}),c(r,"errors",a),r};o?o(y,g):a(y,g,{name:!0});var v=y.prototype=l(g.prototype,{constructor:u(1,y),message:u(1,""),name:u(1,"AggregateError")});n({global:!0,constructor:!0,arity:2},{AggregateError:y})},30067:(e,t,r)=>{"use strict";r(17145)},54743:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(66346),o=r(87633),a="ArrayBuffer",l=s[a];n({global:!0,constructor:!0,forced:i[a]!==l},{ArrayBuffer:l}),o(a)},16573:(e,t,r)=>{"use strict";var n=r(43724),i=r(62106),s=r(3238),o=ArrayBuffer.prototype;n&&!("detached"in o)&&i(o,"detached",{configurable:!0,get:function(){return s(this)}})},46761:(e,t,r)=>{"use strict";var n=r(46518),i=r(94644);n({target:"ArrayBuffer",stat:!0,forced:!i.NATIVE_ARRAY_BUFFER_VIEWS},{isView:i.isView})},11745:(e,t,r)=>{"use strict";var n=r(46518),i=r(27476),s=r(79039),o=r(66346),a=r(28551),l=r(35610),c=r(18014),u=r(2293),h=o.ArrayBuffer,d=o.DataView,p=d.prototype,f=i(h.prototype.slice),m=i(p.getUint8),g=i(p.setUint8);n({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:s((function(){return!new h(2).slice(1,void 0).byteLength}))},{slice:function(e,t){if(f&&void 0===t)return f(a(this),e);for(var r=a(this).byteLength,n=l(e,r),i=l(void 0===t?r:t,r),s=new(u(this,h))(c(i-n)),o=new d(this),p=new d(s),A=0;n{"use strict";var n=r(46518),i=r(95636);i&&n({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return i(this,arguments.length?arguments[0]:void 0,!1)}})},78100:(e,t,r)=>{"use strict";var n=r(46518),i=r(95636);i&&n({target:"ArrayBuffer",proto:!0},{transfer:function(){return i(this,arguments.length?arguments[0]:void 0,!0)}})},18107:(e,t,r)=>{"use strict";var n=r(46518),i=r(48981),s=r(26198),o=r(91291),a=r(6469);n({target:"Array",proto:!0},{at:function(e){var t=i(this),r=s(t),n=o(e),a=n>=0?n:r+n;return a<0||a>=r?void 0:t[a]}}),a("at")},28706:(e,t,r)=>{"use strict";var n=r(46518),i=r(79039),s=r(34376),o=r(20034),a=r(48981),l=r(26198),c=r(96837),u=r(97040),h=r(1469),d=r(70597),p=r(78227),f=r(39519),m=p("isConcatSpreadable"),g=f>=51||!i((function(){var e=[];return e[m]=!1,e.concat()[0]!==e})),A=function(e){if(!o(e))return!1;var t=e[m];return void 0!==t?!!t:s(e)};n({target:"Array",proto:!0,arity:1,forced:!g||!d("concat")},{concat:function(e){var t,r,n,i,s,o=a(this),d=h(o,0),p=0;for(t=-1,n=arguments.length;t{"use strict";var n=r(46518),i=r(57029),s=r(6469);n({target:"Array",proto:!0},{copyWithin:i}),s("copyWithin")},88431:(e,t,r)=>{"use strict";var n=r(46518),i=r(59213).every;n({target:"Array",proto:!0,forced:!r(34598)("every")},{every:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},33771:(e,t,r)=>{"use strict";var n=r(46518),i=r(84373),s=r(6469);n({target:"Array",proto:!0},{fill:i}),s("fill")},2008:(e,t,r)=>{"use strict";var n=r(46518),i=r(59213).filter;n({target:"Array",proto:!0,forced:!r(70597)("filter")},{filter:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},48980:(e,t,r)=>{"use strict";var n=r(46518),i=r(59213).findIndex,s=r(6469),o="findIndex",a=!0;o in[]&&Array(1)[o]((function(){a=!1})),n({target:"Array",proto:!0,forced:a},{findIndex:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),s(o)},13451:(e,t,r)=>{"use strict";var n=r(46518),i=r(43839).findLastIndex,s=r(6469);n({target:"Array",proto:!0},{findLastIndex:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),s("findLastIndex")},10838:(e,t,r)=>{"use strict";var n=r(46518),i=r(43839).findLast,s=r(6469);n({target:"Array",proto:!0},{findLast:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),s("findLast")},50113:(e,t,r)=>{"use strict";var n=r(46518),i=r(59213).find,s=r(6469),o="find",a=!0;o in[]&&Array(1)[o]((function(){a=!1})),n({target:"Array",proto:!0,forced:a},{find:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),s(o)},78350:(e,t,r)=>{"use strict";var n=r(46518),i=r(70259),s=r(79306),o=r(48981),a=r(26198),l=r(1469);n({target:"Array",proto:!0},{flatMap:function(e){var t,r=o(this),n=a(r);return s(e),(t=l(r,0)).length=i(t,r,r,n,0,1,e,arguments.length>1?arguments[1]:void 0),t}})},46449:(e,t,r)=>{"use strict";var n=r(46518),i=r(70259),s=r(48981),o=r(26198),a=r(91291),l=r(1469);n({target:"Array",proto:!0},{flat:function(){var e=arguments.length?arguments[0]:void 0,t=s(this),r=o(t),n=l(t,0);return n.length=i(n,t,t,r,0,void 0===e?1:a(e)),n}})},51629:(e,t,r)=>{"use strict";var n=r(46518),i=r(90235);n({target:"Array",proto:!0,forced:[].forEach!==i},{forEach:i})},23418:(e,t,r)=>{"use strict";var n=r(46518),i=r(97916);n({target:"Array",stat:!0,forced:!r(84428)((function(e){Array.from(e)}))},{from:i})},74423:(e,t,r)=>{"use strict";var n=r(46518),i=r(19617).includes,s=r(79039),o=r(6469);n({target:"Array",proto:!0,forced:s((function(){return!Array(1).includes()}))},{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),o("includes")},25276:(e,t,r)=>{"use strict";var n=r(46518),i=r(27476),s=r(19617).indexOf,o=r(34598),a=i([].indexOf),l=!!a&&1/a([1],1,-0)<0;n({target:"Array",proto:!0,forced:l||!o("indexOf")},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return l?a(this,e,t)||0:s(this,e,t)}})},64346:(e,t,r)=>{"use strict";r(46518)({target:"Array",stat:!0},{isArray:r(34376)})},23792:(e,t,r)=>{"use strict";var n=r(25397),i=r(6469),s=r(26269),o=r(91181),a=r(24913).f,l=r(51088),c=r(62529),u=r(96395),h=r(43724),d="Array Iterator",p=o.set,f=o.getterFor(d);e.exports=l(Array,"Array",(function(e,t){p(this,{type:d,target:n(e),index:0,kind:t})}),(function(){var e=f(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,c(void 0,!0);switch(e.kind){case"keys":return c(r,!1);case"values":return c(t[r],!1)}return c([r,t[r]],!1)}),"values");var m=s.Arguments=s.Array;if(i("keys"),i("values"),i("entries"),!u&&h&&"values"!==m.name)try{a(m,"name",{value:"values"})}catch(e){}},48598:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(47055),o=r(25397),a=r(34598),l=i([].join);n({target:"Array",proto:!0,forced:s!==Object||!a("join",",")},{join:function(e){return l(o(this),void 0===e?",":e)}})},8921:(e,t,r)=>{"use strict";var n=r(46518),i=r(8379);n({target:"Array",proto:!0,forced:i!==[].lastIndexOf},{lastIndexOf:i})},62062:(e,t,r)=>{"use strict";var n=r(46518),i=r(59213).map;n({target:"Array",proto:!0,forced:!r(70597)("map")},{map:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},31051:(e,t,r)=>{"use strict";var n=r(46518),i=r(79039),s=r(33517),o=r(97040),a=Array;n({target:"Array",stat:!0,forced:i((function(){function e(){}return!(a.of.call(e)instanceof e)}))},{of:function(){for(var e=0,t=arguments.length,r=new(s(this)?this:a)(t);t>e;)o(r,e,arguments[e++]);return r.length=t,r}})},44114:(e,t,r)=>{"use strict";var n=r(46518),i=r(48981),s=r(26198),o=r(34527),a=r(96837);n({target:"Array",proto:!0,arity:1,forced:r(79039)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=i(this),r=s(t),n=arguments.length;a(r+n);for(var l=0;l{"use strict";var n=r(46518),i=r(80926).right,s=r(34598),o=r(39519);n({target:"Array",proto:!0,forced:!r(38574)&&o>79&&o<83||!s("reduceRight")},{reduceRight:function(e){return i(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}})},72712:(e,t,r)=>{"use strict";var n=r(46518),i=r(80926).left,s=r(34598),o=r(39519);n({target:"Array",proto:!0,forced:!r(38574)&&o>79&&o<83||!s("reduce")},{reduce:function(e){var t=arguments.length;return i(this,e,t,t>1?arguments[1]:void 0)}})},94490:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(34376),o=i([].reverse),a=[1,2];n({target:"Array",proto:!0,forced:String(a)===String(a.reverse())},{reverse:function(){return s(this)&&(this.length=this.length),o(this)}})},34782:(e,t,r)=>{"use strict";var n=r(46518),i=r(34376),s=r(33517),o=r(20034),a=r(35610),l=r(26198),c=r(25397),u=r(97040),h=r(78227),d=r(70597),p=r(67680),f=d("slice"),m=h("species"),g=Array,A=Math.max;n({target:"Array",proto:!0,forced:!f},{slice:function(e,t){var r,n,h,d=c(this),f=l(d),y=a(e,f),v=a(void 0===t?f:t,f);if(i(d)&&(r=d.constructor,(s(r)&&(r===g||i(r.prototype))||o(r)&&null===(r=r[m]))&&(r=void 0),r===g||void 0===r))return p(d,y,v);for(n=new(void 0===r?g:r)(A(v-y,0)),h=0;y{"use strict";var n=r(46518),i=r(59213).some;n({target:"Array",proto:!0,forced:!r(34598)("some")},{some:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},26910:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(79306),o=r(48981),a=r(26198),l=r(84606),c=r(655),u=r(79039),h=r(74488),d=r(34598),p=r(13709),f=r(13763),m=r(39519),g=r(3607),A=[],y=i(A.sort),v=i(A.push),x=u((function(){A.sort(void 0)})),_=u((function(){A.sort(null)})),b=d("sort"),w=!u((function(){if(m)return m<70;if(!(p&&p>3)){if(f)return!0;if(g)return g<603;var e,t,r,n,i="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)A.push({k:t+n,v:r})}for(A.sort((function(e,t){return t.v-e.v})),n=0;nc(r)?1:-1}}(e)),r=a(i),n=0;n{"use strict";r(87633)("Array")},54554:(e,t,r)=>{"use strict";var n=r(46518),i=r(48981),s=r(35610),o=r(91291),a=r(26198),l=r(34527),c=r(96837),u=r(1469),h=r(97040),d=r(84606),p=r(70597)("splice"),f=Math.max,m=Math.min;n({target:"Array",proto:!0,forced:!p},{splice:function(e,t){var r,n,p,g,A,y,v=i(this),x=a(v),_=s(e,x),b=arguments.length;for(0===b?r=n=0:1===b?(r=0,n=x-_):(r=b-2,n=m(f(o(t),0),x-_)),c(x+r-n),p=u(v,n),g=0;gx-n+r;g--)d(v,g-1)}else if(r>n)for(g=x-n;g>_;g--)y=g+r-1,(A=g+n-1)in v?v[y]=v[A]:d(v,y);for(g=0;g{"use strict";var n=r(46518),i=r(37628),s=r(25397),o=r(6469),a=Array;n({target:"Array",proto:!0},{toReversed:function(){return i(s(this),a)}}),o("toReversed")},57145:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(79306),o=r(25397),a=r(35370),l=r(44124),c=r(6469),u=Array,h=i(l("Array","sort"));n({target:"Array",proto:!0},{toSorted:function(e){void 0!==e&&s(e);var t=o(this),r=a(u,t);return h(r,e)}}),c("toSorted")},71658:(e,t,r)=>{"use strict";var n=r(46518),i=r(6469),s=r(96837),o=r(26198),a=r(35610),l=r(25397),c=r(91291),u=Array,h=Math.max,d=Math.min;n({target:"Array",proto:!0},{toSpliced:function(e,t){var r,n,i,p,f=l(this),m=o(f),g=a(e,m),A=arguments.length,y=0;for(0===A?r=n=0:1===A?(r=0,n=m-g):(r=A-2,n=d(h(c(t),0),m-g)),i=s(m+r-n),p=u(i);y{"use strict";r(6469)("flatMap")},93514:(e,t,r)=>{"use strict";r(6469)("flat")},13609:(e,t,r)=>{"use strict";var n=r(46518),i=r(48981),s=r(26198),o=r(34527),a=r(84606),l=r(96837);n({target:"Array",proto:!0,arity:1,forced:1!==[].unshift(0)||!function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(e){return e instanceof TypeError}}()},{unshift:function(e){var t=i(this),r=s(t),n=arguments.length;if(n){l(r+n);for(var c=r;c--;){var u=c+n;c in t?t[u]=t[c]:a(t,u)}for(var h=0;h{"use strict";var n=r(46518),i=r(39928),s=r(25397),o=Array;n({target:"Array",proto:!0},{with:function(e,t){return i(s(this),o,e,t)}})},24359:(e,t,r)=>{"use strict";var n=r(46518),i=r(66346);n({global:!0,constructor:!0,forced:!r(77811)},{DataView:i.DataView})},38309:(e,t,r)=>{"use strict";r(24359)},61699:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(79039)((function(){return 120!==new Date(16e11).getYear()})),o=i(Date.prototype.getFullYear);n({target:"Date",proto:!0,forced:s},{getYear:function(){return o(this)-1900}})},59089:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=Date,o=i(s.prototype.getTime);n({target:"Date",stat:!0},{now:function(){return o(new s)}})},91191:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(91291),o=Date.prototype,a=i(o.getTime),l=i(o.setFullYear);n({target:"Date",proto:!0},{setYear:function(e){a(this);var t=s(e);return l(this,t>=0&&t<=99?t+1900:t)}})},93515:(e,t,r)=>{"use strict";r(46518)({target:"Date",proto:!0},{toGMTString:Date.prototype.toUTCString})},1688:(e,t,r)=>{"use strict";var n=r(46518),i=r(70380);n({target:"Date",proto:!0,forced:Date.prototype.toISOString!==i},{toISOString:i})},60739:(e,t,r)=>{"use strict";var n=r(46518),i=r(79039),s=r(48981),o=r(72777);n({target:"Date",proto:!0,arity:1,forced:i((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}))},{toJSON:function(e){var t=s(this),r=o(t,"number");return"number"!=typeof r||isFinite(r)?t.toISOString():null}})},89572:(e,t,r)=>{"use strict";var n=r(39297),i=r(36840),s=r(53640),o=r(78227)("toPrimitive"),a=Date.prototype;n(a,o)||i(a,o,s)},23288:(e,t,r)=>{"use strict";var n=r(79504),i=r(36840),s=Date.prototype,o="Invalid Date",a="toString",l=n(s[a]),c=n(s.getTime);String(new Date(NaN))!==o&&i(s,a,(function(){var e=c(this);return e==e?l(this):o}))},16280:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(18745),o=r(14601),a="WebAssembly",l=i[a],c=7!==new Error("e",{cause:7}).cause,u=function(e,t){var r={};r[e]=o(e,t,c),n({global:!0,constructor:!0,arity:1,forced:c},r)},h=function(e,t){if(l&&l[e]){var r={};r[e]=o(a+"."+e,t,c),n({target:a,stat:!0,constructor:!0,arity:1,forced:c},r)}};u("Error",(function(e){return function(t){return s(e,this,arguments)}})),u("EvalError",(function(e){return function(t){return s(e,this,arguments)}})),u("RangeError",(function(e){return function(t){return s(e,this,arguments)}})),u("ReferenceError",(function(e){return function(t){return s(e,this,arguments)}})),u("SyntaxError",(function(e){return function(t){return s(e,this,arguments)}})),u("TypeError",(function(e){return function(t){return s(e,this,arguments)}})),u("URIError",(function(e){return function(t){return s(e,this,arguments)}})),h("CompileError",(function(e){return function(t){return s(e,this,arguments)}})),h("LinkError",(function(e){return function(t){return s(e,this,arguments)}})),h("RuntimeError",(function(e){return function(t){return s(e,this,arguments)}}))},76918:(e,t,r)=>{"use strict";var n=r(36840),i=r(77536),s=Error.prototype;s.toString!==i&&n(s,"toString",i)},36456:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(655),o=i("".charAt),a=i("".charCodeAt),l=i(/./.exec),c=i(1..toString),u=i("".toUpperCase),h=/[\w*+\-./@]/,d=function(e,t){for(var r=c(e,16);r.length{"use strict";var n=r(46518),i=r(30566);n({target:"Function",proto:!0,forced:Function.bind!==i},{bind:i})},48957:(e,t,r)=>{"use strict";var n=r(94901),i=r(20034),s=r(24913),o=r(1625),a=r(78227),l=r(50283),c=a("hasInstance"),u=Function.prototype;c in u||s.f(u,c,{value:l((function(e){if(!n(this)||!i(e))return!1;var t=this.prototype;return i(t)?o(t,e):e instanceof this}),c)})},62010:(e,t,r)=>{"use strict";var n=r(43724),i=r(10350).EXISTS,s=r(79504),o=r(62106),a=Function.prototype,l=s(a.toString),c=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,u=s(c.exec);n&&!i&&o(a,"name",{configurable:!0,get:function(){try{return u(c,l(this))[1]}catch(e){return""}}})},55081:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576);n({global:!0,forced:i.globalThis!==i},{globalThis:i})},33110:(e,t,r)=>{"use strict";var n=r(46518),i=r(97751),s=r(18745),o=r(69565),a=r(79504),l=r(79039),c=r(94901),u=r(10757),h=r(67680),d=r(66933),p=r(4495),f=String,m=i("JSON","stringify"),g=a(/./.exec),A=a("".charAt),y=a("".charCodeAt),v=a("".replace),x=a(1..toString),_=/[\uD800-\uDFFF]/g,b=/^[\uD800-\uDBFF]$/,w=/^[\uDC00-\uDFFF]$/,E=!p||l((function(){var e=i("Symbol")("stringify detection");return"[null]"!==m([e])||"{}"!==m({a:e})||"{}"!==m(Object(e))})),M=l((function(){return'"\\udf06\\ud834"'!==m("\udf06\ud834")||'"\\udead"'!==m("\udead")})),S=function(e,t){var r=h(arguments),n=d(t);if(c(n)||void 0!==e&&!u(e))return r[1]=function(e,t){if(c(n)&&(t=o(n,this,f(e),t)),!u(t))return t},s(m,null,r)},C=function(e,t,r){var n=A(r,t-1),i=A(r,t+1);return g(b,e)&&!g(w,i)||g(w,e)&&!g(b,n)?"\\u"+x(y(e,0),16):e};m&&n({target:"JSON",stat:!0,arity:3,forced:E||M},{stringify:function(e,t,r){var n=h(arguments),i=s(E?S:m,null,n);return M&&"string"==typeof i?v(i,_,C):i}})},4731:(e,t,r)=>{"use strict";var n=r(44576);r(10687)(n.JSON,"JSON",!0)},48523:(e,t,r)=>{"use strict";r(16468)("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),r(86938))},47072:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(79306),o=r(67750),a=r(72652),l=r(72248),c=r(96395),u=r(79039),h=l.Map,d=l.has,p=l.get,f=l.set,m=i([].push),g=c||u((function(){return 1!==h.groupBy("ab",(function(e){return e})).get("a").length}));n({target:"Map",stat:!0,forced:c||g},{groupBy:function(e,t){o(e),s(t);var r=new h,n=0;return a(e,(function(e){var i=t(e,n++);d(r,i)?m(p(r,i),e):f(r,i,[e])})),r}})},36033:(e,t,r)=>{"use strict";r(48523)},93153:(e,t,r)=>{"use strict";var n=r(46518),i=r(7740),s=Math.acosh,o=Math.log,a=Math.sqrt,l=Math.LN2;n({target:"Math",stat:!0,forced:!s||710!==Math.floor(s(Number.MAX_VALUE))||s(1/0)!==1/0},{acosh:function(e){var t=+e;return t<1?NaN:t>94906265.62425156?o(t)+l:i(t-1+a(t-1)*a(t+1))}})},82326:(e,t,r)=>{"use strict";var n=r(46518),i=Math.asinh,s=Math.log,o=Math.sqrt;n({target:"Math",stat:!0,forced:!(i&&1/i(0)>0)},{asinh:function e(t){var r=+t;return isFinite(r)&&0!==r?r<0?-e(-r):s(r+o(r*r+1)):r}})},36389:(e,t,r)=>{"use strict";var n=r(46518),i=Math.atanh,s=Math.log;n({target:"Math",stat:!0,forced:!(i&&1/i(-0)<0)},{atanh:function(e){var t=+e;return 0===t?t:s((1+t)/(1-t))/2}})},64444:(e,t,r)=>{"use strict";var n=r(46518),i=r(77782),s=Math.abs,o=Math.pow;n({target:"Math",stat:!0},{cbrt:function(e){var t=+e;return i(t)*o(s(t),1/3)}})},8085:(e,t,r)=>{"use strict";var n=r(46518),i=Math.floor,s=Math.log,o=Math.LOG2E;n({target:"Math",stat:!0},{clz32:function(e){var t=e>>>0;return t?31-i(s(t+.5)*o):32}})},77762:(e,t,r)=>{"use strict";var n=r(46518),i=r(53250),s=Math.cosh,o=Math.abs,a=Math.E;n({target:"Math",stat:!0,forced:!s||s(710)===1/0},{cosh:function(e){var t=i(o(e)-1)+1;return(t+1/(t*a*a))*(a/2)}})},65070:(e,t,r)=>{"use strict";var n=r(46518),i=r(53250);n({target:"Math",stat:!0,forced:i!==Math.expm1},{expm1:i})},60605:(e,t,r)=>{"use strict";r(46518)({target:"Math",stat:!0},{fround:r(15617)})},39469:(e,t,r)=>{"use strict";var n=r(46518),i=Math.hypot,s=Math.abs,o=Math.sqrt;n({target:"Math",stat:!0,arity:2,forced:!!i&&i(1/0,NaN)!==1/0},{hypot:function(e,t){for(var r,n,i=0,a=0,l=arguments.length,c=0;a0?(n=r/c)*n:r;return c===1/0?1/0:c*o(i)}})},72152:(e,t,r)=>{"use strict";var n=r(46518),i=r(79039),s=Math.imul;n({target:"Math",stat:!0,forced:i((function(){return-5!==s(4294967295,5)||2!==s.length}))},{imul:function(e,t){var r=65535,n=+e,i=+t,s=r&n,o=r&i;return 0|s*o+((r&n>>>16)*o+s*(r&i>>>16)<<16>>>0)}})},75376:(e,t,r)=>{"use strict";r(46518)({target:"Math",stat:!0},{log10:r(49340)})},56624:(e,t,r)=>{"use strict";r(46518)({target:"Math",stat:!0},{log1p:r(7740)})},11367:(e,t,r)=>{"use strict";var n=r(46518),i=Math.log,s=Math.LN2;n({target:"Math",stat:!0},{log2:function(e){return i(e)/s}})},5914:(e,t,r)=>{"use strict";r(46518)({target:"Math",stat:!0},{sign:r(77782)})},78553:(e,t,r)=>{"use strict";var n=r(46518),i=r(79039),s=r(53250),o=Math.abs,a=Math.exp,l=Math.E;n({target:"Math",stat:!0,forced:i((function(){return-2e-17!==Math.sinh(-2e-17)}))},{sinh:function(e){var t=+e;return o(t)<1?(s(t)-s(-t))/2:(a(t-1)-a(-t-1))*(l/2)}})},98690:(e,t,r)=>{"use strict";var n=r(46518),i=r(53250),s=Math.exp;n({target:"Math",stat:!0},{tanh:function(e){var t=+e,r=i(t),n=i(-t);return r===1/0?1:n===1/0?-1:(r-n)/(s(t)+s(-t))}})},60479:(e,t,r)=>{"use strict";r(10687)(Math,"Math",!0)},70761:(e,t,r)=>{"use strict";r(46518)({target:"Math",stat:!0},{trunc:r(80741)})},2892:(e,t,r)=>{"use strict";var n=r(46518),i=r(96395),s=r(43724),o=r(44576),a=r(19167),l=r(79504),c=r(92796),u=r(39297),h=r(23167),d=r(1625),p=r(10757),f=r(72777),m=r(79039),g=r(38480).f,A=r(77347).f,y=r(24913).f,v=r(31240),x=r(43802).trim,_="Number",b=o[_],w=a[_],E=b.prototype,M=o.TypeError,S=l("".slice),C=l("".charCodeAt),T=c(_,!b(" 0o1")||!b("0b1")||b("+0x1")),I=function(e){var t,r=arguments.length<1?0:b(function(e){var t=f(e,"number");return"bigint"==typeof t?t:function(e){var t,r,n,i,s,o,a,l,c=f(e,"number");if(p(c))throw new M("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(c=x(c),43===(t=C(c,0))||45===t){if(88===(r=C(c,2))||120===r)return NaN}else if(48===t){switch(C(c,1)){case 66:case 98:n=2,i=49;break;case 79:case 111:n=8,i=55;break;default:return+c}for(o=(s=S(c,2)).length,a=0;ai)return NaN;return parseInt(s,n)}return+c}(t)}(e));return d(E,t=this)&&m((function(){v(t)}))?h(Object(r),this,I):r};I.prototype=E,T&&!i&&(E.constructor=I),n({global:!0,constructor:!0,wrap:!0,forced:T},{Number:I});var R=function(e,t){for(var r,n=s?g(t):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),i=0;n.length>i;i++)u(t,r=n[i])&&!u(e,r)&&y(e,r,A(t,r))};i&&w&&R(a[_],w),(T||i)&&R(a[_],b)},45374:(e,t,r)=>{"use strict";r(46518)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{EPSILON:Math.pow(2,-52)})},25428:(e,t,r)=>{"use strict";r(46518)({target:"Number",stat:!0},{isFinite:r(50360)})},32637:(e,t,r)=>{"use strict";r(46518)({target:"Number",stat:!0},{isInteger:r(2087)})},40150:(e,t,r)=>{"use strict";r(46518)({target:"Number",stat:!0},{isNaN:function(e){return e!=e}})},59149:(e,t,r)=>{"use strict";var n=r(46518),i=r(2087),s=Math.abs;n({target:"Number",stat:!0},{isSafeInteger:function(e){return i(e)&&s(e)<=9007199254740991}})},64601:(e,t,r)=>{"use strict";r(46518)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MAX_SAFE_INTEGER:9007199254740991})},44435:(e,t,r)=>{"use strict";r(46518)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MIN_SAFE_INTEGER:-9007199254740991})},87220:(e,t,r)=>{"use strict";var n=r(46518),i=r(33904);n({target:"Number",stat:!0,forced:Number.parseFloat!==i},{parseFloat:i})},25843:(e,t,r)=>{"use strict";var n=r(46518),i=r(52703);n({target:"Number",stat:!0,forced:Number.parseInt!==i},{parseInt:i})},62337:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(91291),o=r(31240),a=r(72333),l=r(49340),c=r(79039),u=RangeError,h=String,d=isFinite,p=Math.abs,f=Math.floor,m=Math.pow,g=Math.round,A=i(1..toExponential),y=i(a),v=i("".slice),x="-6.9000e-11"===A(-69e-12,4)&&"1.25e+0"===A(1.255,2)&&"1.235e+4"===A(12345,3)&&"3e+1"===A(25,0);n({target:"Number",proto:!0,forced:!x||!(c((function(){A(1,1/0)}))&&c((function(){A(1,-1/0)})))||!!c((function(){A(1/0,1/0),A(NaN,1/0)}))},{toExponential:function(e){var t=o(this);if(void 0===e)return A(t);var r=s(e);if(!d(t))return String(t);if(r<0||r>20)throw new u("Incorrect fraction digits");if(x)return A(t,r);var n,i,a,c,_="";if(t<0&&(_="-",t=-t),0===t)i=0,n=y("0",r+1);else{var b=l(t);i=f(b);var w=m(10,i-r),E=g(t/w);2*t>=(2*E+1)*w&&(E+=1),E>=m(10,r+1)&&(E/=10,i+=1),n=h(E)}return 0!==r&&(n=v(n,0,1)+"."+v(n,1)),0===i?(a="+",c="0"):(a=i>0?"+":"-",c=h(p(i))),_+(n+"e")+a+c}})},9868:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(91291),o=r(31240),a=r(72333),l=r(79039),c=RangeError,u=String,h=Math.floor,d=i(a),p=i("".slice),f=i(1..toFixed),m=function(e,t,r){return 0===t?r:t%2==1?m(e,t-1,r*e):m(e*e,t/2,r)},g=function(e,t,r){for(var n=-1,i=r;++n<6;)i+=t*e[n],e[n]=i%1e7,i=h(i/1e7)},A=function(e,t){for(var r=6,n=0;--r>=0;)n+=e[r],e[r]=h(n/t),n=n%t*1e7},y=function(e){for(var t=6,r="";--t>=0;)if(""!==r||0===t||0!==e[t]){var n=u(e[t]);r=""===r?n:r+d("0",7-n.length)+n}return r};n({target:"Number",proto:!0,forced:l((function(){return"0.000"!==f(8e-5,3)||"1"!==f(.9,0)||"1.25"!==f(1.255,2)||"1000000000000000128"!==f(0xde0b6b3a7640080,0)}))||!l((function(){f({})}))},{toFixed:function(e){var t,r,n,i,a=o(this),l=s(e),h=[0,0,0,0,0,0],f="",v="0";if(l<0||l>20)throw new c("Incorrect fraction digits");if(a!=a)return"NaN";if(a<=-1e21||a>=1e21)return u(a);if(a<0&&(f="-",a=-a),a>1e-21)if(r=(t=function(e){for(var t=0,r=e;r>=4096;)t+=12,r/=4096;for(;r>=2;)t+=1,r/=2;return t}(a*m(2,69,1))-69)<0?a*m(2,-t,1):a/m(2,t,1),r*=4503599627370496,(t=52-t)>0){for(g(h,0,r),n=l;n>=7;)g(h,1e7,0),n-=7;for(g(h,m(10,n,1),0),n=t-1;n>=23;)A(h,1<<23),n-=23;A(h,1<0?f+((i=v.length)<=l?"0."+d("0",l-i)+v:p(v,0,i-l)+"."+p(v,i-l)):f+v}})},80630:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(79039),o=r(31240),a=i(1..toPrecision);n({target:"Number",proto:!0,forced:s((function(){return"1"!==a(1,void 0)}))||!s((function(){a({})}))},{toPrecision:function(e){return void 0===e?a(o(this)):a(o(this),e)}})},69085:(e,t,r)=>{"use strict";var n=r(46518),i=r(44213);n({target:"Object",stat:!0,arity:2,forced:Object.assign!==i},{assign:i})},59904:(e,t,r)=>{"use strict";r(46518)({target:"Object",stat:!0,sham:!r(43724)},{create:r(2360)})},17427:(e,t,r)=>{"use strict";var n=r(46518),i=r(43724),s=r(42551),o=r(79306),a=r(48981),l=r(24913);i&&n({target:"Object",proto:!0,forced:s},{__defineGetter__:function(e,t){l.f(a(this),e,{get:o(t),enumerable:!0,configurable:!0})}})},67945:(e,t,r)=>{"use strict";var n=r(46518),i=r(43724),s=r(96801).f;n({target:"Object",stat:!0,forced:Object.defineProperties!==s,sham:!i},{defineProperties:s})},84185:(e,t,r)=>{"use strict";var n=r(46518),i=r(43724),s=r(24913).f;n({target:"Object",stat:!0,forced:Object.defineProperty!==s,sham:!i},{defineProperty:s})},87607:(e,t,r)=>{"use strict";var n=r(46518),i=r(43724),s=r(42551),o=r(79306),a=r(48981),l=r(24913);i&&n({target:"Object",proto:!0,forced:s},{__defineSetter__:function(e,t){l.f(a(this),e,{set:o(t),enumerable:!0,configurable:!0})}})},5506:(e,t,r)=>{"use strict";var n=r(46518),i=r(32357).entries;n({target:"Object",stat:!0},{entries:function(e){return i(e)}})},52811:(e,t,r)=>{"use strict";var n=r(46518),i=r(92744),s=r(79039),o=r(20034),a=r(3451).onFreeze,l=Object.freeze;n({target:"Object",stat:!0,forced:s((function(){l(1)})),sham:!i},{freeze:function(e){return l&&o(e)?l(a(e)):e}})},53921:(e,t,r)=>{"use strict";var n=r(46518),i=r(72652),s=r(97040);n({target:"Object",stat:!0},{fromEntries:function(e){var t={};return i(e,(function(e,r){s(t,e,r)}),{AS_ENTRIES:!0}),t}})},83851:(e,t,r)=>{"use strict";var n=r(46518),i=r(79039),s=r(25397),o=r(77347).f,a=r(43724);n({target:"Object",stat:!0,forced:!a||i((function(){o(1)})),sham:!a},{getOwnPropertyDescriptor:function(e,t){return o(s(e),t)}})},81278:(e,t,r)=>{"use strict";var n=r(46518),i=r(43724),s=r(35031),o=r(25397),a=r(77347),l=r(97040);n({target:"Object",stat:!0,sham:!i},{getOwnPropertyDescriptors:function(e){for(var t,r,n=o(e),i=a.f,c=s(n),u={},h=0;c.length>h;)void 0!==(r=i(n,t=c[h++]))&&l(u,t,r);return u}})},1480:(e,t,r)=>{"use strict";var n=r(46518),i=r(79039),s=r(10298).f;n({target:"Object",stat:!0,forced:i((function(){return!Object.getOwnPropertyNames(1)}))},{getOwnPropertyNames:s})},49773:(e,t,r)=>{"use strict";var n=r(46518),i=r(4495),s=r(79039),o=r(33717),a=r(48981);n({target:"Object",stat:!0,forced:!i||s((function(){o.f(1)}))},{getOwnPropertySymbols:function(e){var t=o.f;return t?t(a(e)):[]}})},40875:(e,t,r)=>{"use strict";var n=r(46518),i=r(79039),s=r(48981),o=r(42787),a=r(12211);n({target:"Object",stat:!0,forced:i((function(){o(1)})),sham:!a},{getPrototypeOf:function(e){return o(s(e))}})},77691:(e,t,r)=>{"use strict";var n=r(46518),i=r(97751),s=r(79504),o=r(79306),a=r(67750),l=r(56969),c=r(72652),u=r(79039),h=Object.groupBy,d=i("Object","create"),p=s([].push);n({target:"Object",stat:!0,forced:!h||u((function(){return 1!==h("ab",(function(e){return e})).a.length}))},{groupBy:function(e,t){a(e),o(t);var r=d(null),n=0;return c(e,(function(e){var i=l(t(e,n++));i in r?p(r[i],e):r[i]=[e]})),r}})},78347:(e,t,r)=>{"use strict";r(46518)({target:"Object",stat:!0},{hasOwn:r(39297)})},94052:(e,t,r)=>{"use strict";var n=r(46518),i=r(34124);n({target:"Object",stat:!0,forced:Object.isExtensible!==i},{isExtensible:i})},94003:(e,t,r)=>{"use strict";var n=r(46518),i=r(79039),s=r(20034),o=r(22195),a=r(15652),l=Object.isFrozen;n({target:"Object",stat:!0,forced:a||i((function(){l(1)}))},{isFrozen:function(e){return!s(e)||!(!a||"ArrayBuffer"!==o(e))||!!l&&l(e)}})},221:(e,t,r)=>{"use strict";var n=r(46518),i=r(79039),s=r(20034),o=r(22195),a=r(15652),l=Object.isSealed;n({target:"Object",stat:!0,forced:a||i((function(){l(1)}))},{isSealed:function(e){return!s(e)||!(!a||"ArrayBuffer"!==o(e))||!!l&&l(e)}})},29908:(e,t,r)=>{"use strict";r(46518)({target:"Object",stat:!0},{is:r(3470)})},79432:(e,t,r)=>{"use strict";var n=r(46518),i=r(48981),s=r(71072);n({target:"Object",stat:!0,forced:r(79039)((function(){s(1)}))},{keys:function(e){return s(i(e))}})},9220:(e,t,r)=>{"use strict";var n=r(46518),i=r(43724),s=r(42551),o=r(48981),a=r(56969),l=r(42787),c=r(77347).f;i&&n({target:"Object",proto:!0,forced:s},{__lookupGetter__:function(e){var t,r=o(this),n=a(e);do{if(t=c(r,n))return t.get}while(r=l(r))}})},7904:(e,t,r)=>{"use strict";var n=r(46518),i=r(43724),s=r(42551),o=r(48981),a=r(56969),l=r(42787),c=r(77347).f;i&&n({target:"Object",proto:!0,forced:s},{__lookupSetter__:function(e){var t,r=o(this),n=a(e);do{if(t=c(r,n))return t.set}while(r=l(r))}})},93967:(e,t,r)=>{"use strict";var n=r(46518),i=r(20034),s=r(3451).onFreeze,o=r(92744),a=r(79039),l=Object.preventExtensions;n({target:"Object",stat:!0,forced:a((function(){l(1)})),sham:!o},{preventExtensions:function(e){return l&&i(e)?l(s(e)):e}})},63548:(e,t,r)=>{"use strict";var n=r(43724),i=r(62106),s=r(20034),o=r(13925),a=r(48981),l=r(67750),c=Object.getPrototypeOf,u=Object.setPrototypeOf,h=Object.prototype,d="__proto__";if(n&&c&&u&&!(d in h))try{i(h,d,{configurable:!0,get:function(){return c(a(this))},set:function(e){var t=l(this);o(e)&&s(t)&&u(t,e)}})}catch(e){}},93941:(e,t,r)=>{"use strict";var n=r(46518),i=r(20034),s=r(3451).onFreeze,o=r(92744),a=r(79039),l=Object.seal;n({target:"Object",stat:!0,forced:a((function(){l(1)})),sham:!o},{seal:function(e){return l&&i(e)?l(s(e)):e}})},10287:(e,t,r)=>{"use strict";r(46518)({target:"Object",stat:!0},{setPrototypeOf:r(52967)})},26099:(e,t,r)=>{"use strict";var n=r(92140),i=r(36840),s=r(53179);n||i(Object.prototype,"toString",s,{unsafe:!0})},16034:(e,t,r)=>{"use strict";var n=r(46518),i=r(32357).values;n({target:"Object",stat:!0},{values:function(e){return i(e)}})},78459:(e,t,r)=>{"use strict";var n=r(46518),i=r(33904);n({global:!0,forced:parseFloat!==i},{parseFloat:i})},58940:(e,t,r)=>{"use strict";var n=r(46518),i=r(52703);n({global:!0,forced:parseInt!==i},{parseInt:i})},96167:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(79306),o=r(36043),a=r(1103),l=r(72652);n({target:"Promise",stat:!0,forced:r(90537)},{allSettled:function(e){var t=this,r=o.f(t),n=r.resolve,c=r.reject,u=a((function(){var r=s(t.resolve),o=[],a=0,c=1;l(e,(function(e){var s=a++,l=!1;c++,i(r,t,e).then((function(e){l||(l=!0,o[s]={status:"fulfilled",value:e},--c||n(o))}),(function(e){l||(l=!0,o[s]={status:"rejected",reason:e},--c||n(o))}))})),--c||n(o)}));return u.error&&c(u.value),r.promise}})},16499:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(79306),o=r(36043),a=r(1103),l=r(72652);n({target:"Promise",stat:!0,forced:r(90537)},{all:function(e){var t=this,r=o.f(t),n=r.resolve,c=r.reject,u=a((function(){var r=s(t.resolve),o=[],a=0,u=1;l(e,(function(e){var s=a++,l=!1;u++,i(r,t,e).then((function(e){l||(l=!0,o[s]=e,--u||n(o))}),c)})),--u||n(o)}));return u.error&&c(u.value),r.promise}})},93518:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(79306),o=r(97751),a=r(36043),l=r(1103),c=r(72652),u=r(90537),h="No one promise resolved";n({target:"Promise",stat:!0,forced:u},{any:function(e){var t=this,r=o("AggregateError"),n=a.f(t),u=n.resolve,d=n.reject,p=l((function(){var n=s(t.resolve),o=[],a=0,l=1,p=!1;c(e,(function(e){var s=a++,c=!1;l++,i(n,t,e).then((function(e){c||p||(p=!0,u(e))}),(function(e){c||p||(c=!0,o[s]=e,--l||d(new r(o,h)))}))})),--l||d(new r(o,h))}));return p.error&&d(p.value),n.promise}})},82003:(e,t,r)=>{"use strict";var n=r(46518),i=r(96395),s=r(10916).CONSTRUCTOR,o=r(80550),a=r(97751),l=r(94901),c=r(36840),u=o&&o.prototype;if(n({target:"Promise",proto:!0,forced:s,real:!0},{catch:function(e){return this.then(void 0,e)}}),!i&&l(o)){var h=a("Promise").prototype.catch;u.catch!==h&&c(u,"catch",h,{unsafe:!0})}},10436:(e,t,r)=>{"use strict";var n,i,s,o=r(46518),a=r(96395),l=r(38574),c=r(44576),u=r(69565),h=r(36840),d=r(52967),p=r(10687),f=r(87633),m=r(79306),g=r(94901),A=r(20034),y=r(90679),v=r(2293),x=r(59225).set,_=r(91955),b=r(90757),w=r(1103),E=r(18265),M=r(91181),S=r(80550),C=r(10916),T=r(36043),I="Promise",R=C.CONSTRUCTOR,B=C.REJECTION_EVENT,P=C.SUBCLASSING,L=M.getterFor(I),D=M.set,O=S&&S.prototype,N=S,U=O,F=c.TypeError,k=c.document,z=c.process,G=T.f,Q=G,V=!!(k&&k.createEvent&&c.dispatchEvent),H="unhandledrejection",j=function(e){var t;return!(!A(e)||!g(t=e.then))&&t},q=function(e,t){var r,n,i,s=t.value,o=1===t.state,a=o?e.ok:e.fail,l=e.resolve,c=e.reject,h=e.domain;try{a?(o||(2===t.rejection&&$(t),t.rejection=1),!0===a?r=s:(h&&h.enter(),r=a(s),h&&(h.exit(),i=!0)),r===e.promise?c(new F("Promise-chain cycle")):(n=j(r))?u(n,r,l,c):l(r)):c(s)}catch(e){h&&!i&&h.exit(),c(e)}},W=function(e,t){e.notified||(e.notified=!0,_((function(){for(var r,n=e.reactions;r=n.get();)q(r,e);e.notified=!1,t&&!e.rejection&&X(e)})))},Y=function(e,t,r){var n,i;V?((n=k.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),c.dispatchEvent(n)):n={promise:t,reason:r},!B&&(i=c["on"+e])?i(n):e===H&&b("Unhandled promise rejection",r)},X=function(e){u(x,c,(function(){var t,r=e.facade,n=e.value;if(K(e)&&(t=w((function(){l?z.emit("unhandledRejection",n,r):Y(H,r,n)})),e.rejection=l||K(e)?2:1,t.error))throw t.value}))},K=function(e){return 1!==e.rejection&&!e.parent},$=function(e){u(x,c,(function(){var t=e.facade;l?z.emit("rejectionHandled",t):Y("rejectionhandled",t,e.value)}))},J=function(e,t,r){return function(n){e(t,n,r)}},Z=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,W(e,!0))},ee=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw new F("Promise can't be resolved itself");var n=j(t);n?_((function(){var r={done:!1};try{u(n,t,J(ee,r,e),J(Z,r,e))}catch(t){Z(r,t,e)}})):(e.value=t,e.state=1,W(e,!1))}catch(t){Z({done:!1},t,e)}}};if(R&&(U=(N=function(e){y(this,U),m(e),u(n,this);var t=L(this);try{e(J(ee,t),J(Z,t))}catch(e){Z(t,e)}}).prototype,(n=function(e){D(this,{type:I,done:!1,notified:!1,parent:!1,reactions:new E,rejection:!1,state:0,value:null})}).prototype=h(U,"then",(function(e,t){var r=L(this),n=G(v(this,N));return r.parent=!0,n.ok=!g(e)||e,n.fail=g(t)&&t,n.domain=l?z.domain:void 0,0===r.state?r.reactions.add(n):_((function(){q(n,r)})),n.promise})),i=function(){var e=new n,t=L(e);this.promise=e,this.resolve=J(ee,t),this.reject=J(Z,t)},T.f=G=function(e){return e===N||void 0===e?new i(e):Q(e)},!a&&g(S)&&O!==Object.prototype)){s=O.then,P||h(O,"then",(function(e,t){var r=this;return new N((function(e,t){u(s,r,e,t)})).then(e,t)}),{unsafe:!0});try{delete O.constructor}catch(e){}d&&d(O,U)}o({global:!0,constructor:!0,wrap:!0,forced:R},{Promise:N}),p(N,I,!1,!0),f(I)},9391:(e,t,r)=>{"use strict";var n=r(46518),i=r(96395),s=r(80550),o=r(79039),a=r(97751),l=r(94901),c=r(2293),u=r(93438),h=r(36840),d=s&&s.prototype;if(n({target:"Promise",proto:!0,real:!0,forced:!!s&&o((function(){d.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=c(this,a("Promise")),r=l(e);return this.then(r?function(r){return u(t,e()).then((function(){return r}))}:e,r?function(r){return u(t,e()).then((function(){throw r}))}:e)}}),!i&&l(s)){var p=a("Promise").prototype.finally;d.finally!==p&&h(d,"finally",p,{unsafe:!0})}},3362:(e,t,r)=>{"use strict";r(10436),r(16499),r(82003),r(7743),r(51481),r(40280)},7743:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(79306),o=r(36043),a=r(1103),l=r(72652);n({target:"Promise",stat:!0,forced:r(90537)},{race:function(e){var t=this,r=o.f(t),n=r.reject,c=a((function(){var o=s(t.resolve);l(e,(function(e){i(o,t,e).then(r.resolve,n)}))}));return c.error&&n(c.value),r.promise}})},51481:(e,t,r)=>{"use strict";var n=r(46518),i=r(36043);n({target:"Promise",stat:!0,forced:r(10916).CONSTRUCTOR},{reject:function(e){var t=i.f(this);return(0,t.reject)(e),t.promise}})},40280:(e,t,r)=>{"use strict";var n=r(46518),i=r(97751),s=r(96395),o=r(80550),a=r(10916).CONSTRUCTOR,l=r(93438),c=i("Promise"),u=s&&!a;n({target:"Promise",stat:!0,forced:s||a},{resolve:function(e){return l(u&&this===c?o:this,e)}})},14628:(e,t,r)=>{"use strict";var n=r(46518),i=r(36043);n({target:"Promise",stat:!0},{withResolvers:function(){var e=i.f(this);return{promise:e.promise,resolve:e.resolve,reject:e.reject}}})},39796:(e,t,r)=>{"use strict";var n=r(46518),i=r(18745),s=r(79306),o=r(28551);n({target:"Reflect",stat:!0,forced:!r(79039)((function(){Reflect.apply((function(){}))}))},{apply:function(e,t,r){return i(s(e),t,o(r))}})},60825:(e,t,r)=>{"use strict";var n=r(46518),i=r(97751),s=r(18745),o=r(30566),a=r(35548),l=r(28551),c=r(20034),u=r(2360),h=r(79039),d=i("Reflect","construct"),p=Object.prototype,f=[].push,m=h((function(){function e(){}return!(d((function(){}),[],e)instanceof e)})),g=!h((function(){d((function(){}))})),A=m||g;n({target:"Reflect",stat:!0,forced:A,sham:A},{construct:function(e,t){a(e),l(t);var r=arguments.length<3?e:a(arguments[2]);if(g&&!m)return d(e,t,r);if(e===r){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var n=[null];return s(f,n,t),new(s(o,e,n))}var i=r.prototype,h=u(c(i)?i:p),A=s(e,h,t);return c(A)?A:h}})},87411:(e,t,r)=>{"use strict";var n=r(46518),i=r(43724),s=r(28551),o=r(56969),a=r(24913);n({target:"Reflect",stat:!0,forced:r(79039)((function(){Reflect.defineProperty(a.f({},1,{value:1}),1,{value:2})})),sham:!i},{defineProperty:function(e,t,r){s(e);var n=o(t);s(r);try{return a.f(e,n,r),!0}catch(e){return!1}}})},21211:(e,t,r)=>{"use strict";var n=r(46518),i=r(28551),s=r(77347).f;n({target:"Reflect",stat:!0},{deleteProperty:function(e,t){var r=s(i(e),t);return!(r&&!r.configurable)&&delete e[t]}})},9065:(e,t,r)=>{"use strict";var n=r(46518),i=r(43724),s=r(28551),o=r(77347);n({target:"Reflect",stat:!0,sham:!i},{getOwnPropertyDescriptor:function(e,t){return o.f(s(e),t)}})},86565:(e,t,r)=>{"use strict";var n=r(46518),i=r(28551),s=r(42787);n({target:"Reflect",stat:!0,sham:!r(12211)},{getPrototypeOf:function(e){return s(i(e))}})},40888:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(20034),o=r(28551),a=r(16575),l=r(77347),c=r(42787);n({target:"Reflect",stat:!0},{get:function e(t,r){var n,u,h=arguments.length<3?t:arguments[2];return o(t)===h?t[r]:(n=l.f(t,r))?a(n)?n.value:void 0===n.get?void 0:i(n.get,h):s(u=c(t))?e(u,r,h):void 0}})},32812:(e,t,r)=>{"use strict";r(46518)({target:"Reflect",stat:!0},{has:function(e,t){return t in e}})},84634:(e,t,r)=>{"use strict";var n=r(46518),i=r(28551),s=r(34124);n({target:"Reflect",stat:!0},{isExtensible:function(e){return i(e),s(e)}})},71137:(e,t,r)=>{"use strict";r(46518)({target:"Reflect",stat:!0},{ownKeys:r(35031)})},30985:(e,t,r)=>{"use strict";var n=r(46518),i=r(97751),s=r(28551);n({target:"Reflect",stat:!0,sham:!r(92744)},{preventExtensions:function(e){s(e);try{var t=i("Object","preventExtensions");return t&&t(e),!0}catch(e){return!1}}})},34873:(e,t,r)=>{"use strict";var n=r(46518),i=r(28551),s=r(73506),o=r(52967);o&&n({target:"Reflect",stat:!0},{setPrototypeOf:function(e,t){i(e),s(t);try{return o(e,t),!0}catch(e){return!1}}})},34268:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(28551),o=r(20034),a=r(16575),l=r(79039),c=r(24913),u=r(77347),h=r(42787),d=r(6980);n({target:"Reflect",stat:!0,forced:l((function(){var e=function(){},t=c.f(new e,"a",{configurable:!0});return!1!==Reflect.set(e.prototype,"a",1,t)}))},{set:function e(t,r,n){var l,p,f,m=arguments.length<4?t:arguments[3],g=u.f(s(t),r);if(!g){if(o(p=h(t)))return e(p,r,n,m);g=d(0)}if(a(g)){if(!1===g.writable||!o(m))return!1;if(l=u.f(m,r)){if(l.get||l.set||!1===l.writable)return!1;l.value=n,c.f(m,r,l)}else c.f(m,r,d(0,n))}else{if(void 0===(f=g.set))return!1;i(f,m,n)}return!0}})},15472:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(10687);n({global:!0},{Reflect:{}}),s(i.Reflect,"Reflect",!0)},84864:(e,t,r)=>{"use strict";var n=r(43724),i=r(44576),s=r(79504),o=r(92796),a=r(23167),l=r(66699),c=r(2360),u=r(38480).f,h=r(1625),d=r(60788),p=r(655),f=r(61034),m=r(58429),g=r(11056),A=r(36840),y=r(79039),v=r(39297),x=r(91181).enforce,_=r(87633),b=r(78227),w=r(83635),E=r(18814),M=b("match"),S=i.RegExp,C=S.prototype,T=i.SyntaxError,I=s(C.exec),R=s("".charAt),B=s("".replace),P=s("".indexOf),L=s("".slice),D=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,O=/a/g,N=/a/g,U=new S(O)!==O,F=m.MISSED_STICKY,k=m.UNSUPPORTED_Y;if(o("RegExp",n&&(!U||F||w||E||y((function(){return N[M]=!1,S(O)!==O||S(N)===N||"/a/i"!==String(S(O,"i"))}))))){for(var z=function(e,t){var r,n,i,s,o,u,m=h(C,this),g=d(e),A=void 0===t,y=[],_=e;if(!m&&g&&A&&e.constructor===z)return e;if((g||h(C,e))&&(e=e.source,A&&(t=f(_))),e=void 0===e?"":p(e),t=void 0===t?"":p(t),_=e,w&&"dotAll"in O&&(n=!!t&&P(t,"s")>-1)&&(t=B(t,/s/g,"")),r=t,F&&"sticky"in O&&(i=!!t&&P(t,"y")>-1)&&k&&(t=B(t,/y/g,"")),E&&(s=function(e){for(var t,r=e.length,n=0,i="",s=[],o=c(null),a=!1,l=!1,u=0,h="";n<=r;n++){if("\\"===(t=R(e,n)))t+=R(e,++n);else if("]"===t)a=!1;else if(!a)switch(!0){case"["===t:a=!0;break;case"("===t:if(i+=t,"?:"===L(e,n+1,n+3))continue;I(D,L(e,n+1))&&(n+=2,l=!0),u++;continue;case">"===t&&l:if(""===h||v(o,h))throw new T("Invalid capture group name");o[h]=!0,s[s.length]=[h,u],l=!1,h="";continue}l?h+=t:i+=t}return[i,s]}(e),e=s[0],y=s[1]),o=a(S(e,t),m?this:C,z),(n||i||y.length)&&(u=x(o),n&&(u.dotAll=!0,u.raw=z(function(e){for(var t,r=e.length,n=0,i="",s=!1;n<=r;n++)"\\"!==(t=R(e,n))?s||"."!==t?("["===t?s=!0:"]"===t&&(s=!1),i+=t):i+="[\\s\\S]":i+=t+R(e,++n);return i}(e),r)),i&&(u.sticky=!0),y.length&&(u.groups=y)),e!==_)try{l(o,"source",""===_?"(?:)":_)}catch(e){}return o},G=u(S),Q=0;G.length>Q;)g(z,S,G[Q++]);C.constructor=z,z.prototype=C,A(i,"RegExp",z,{constructor:!0})}_("RegExp")},57465:(e,t,r)=>{"use strict";var n=r(43724),i=r(83635),s=r(22195),o=r(62106),a=r(91181).get,l=RegExp.prototype,c=TypeError;n&&i&&o(l,"dotAll",{configurable:!0,get:function(){if(this!==l){if("RegExp"===s(this))return!!a(this).dotAll;throw new c("Incompatible receiver, RegExp required")}}})},27495:(e,t,r)=>{"use strict";var n=r(46518),i=r(57323);n({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},69479:(e,t,r)=>{"use strict";var n=r(44576),i=r(43724),s=r(62106),o=r(67979),a=r(79039),l=n.RegExp,c=l.prototype;i&&a((function(){var e=!0;try{l(".","d")}catch(t){e=!1}var t={},r="",n=e?"dgimsy":"gimsy",i=function(e,n){Object.defineProperty(t,e,{get:function(){return r+=n,!0}})},s={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var o in e&&(s.hasIndices="d"),s)i(o,s[o]);return Object.getOwnPropertyDescriptor(c,"flags").get.call(t)!==n||r!==n}))&&s(c,"flags",{configurable:!0,get:o})},87745:(e,t,r)=>{"use strict";var n=r(43724),i=r(58429).MISSED_STICKY,s=r(22195),o=r(62106),a=r(91181).get,l=RegExp.prototype,c=TypeError;n&&i&&o(l,"sticky",{configurable:!0,get:function(){if(this!==l){if("RegExp"===s(this))return!!a(this).sticky;throw new c("Incompatible receiver, RegExp required")}}})},90906:(e,t,r)=>{"use strict";r(27495);var n,i,s=r(46518),o=r(69565),a=r(94901),l=r(28551),c=r(655),u=(n=!1,(i=/[ac]/).exec=function(){return n=!0,/./.exec.apply(this,arguments)},!0===i.test("abc")&&n),h=/./.test;s({target:"RegExp",proto:!0,forced:!u},{test:function(e){var t=l(this),r=c(e),n=t.exec;if(!a(n))return o(h,t,r);var i=o(n,t,r);return null!==i&&(l(i),!0)}})},38781:(e,t,r)=>{"use strict";var n=r(10350).PROPER,i=r(36840),s=r(28551),o=r(655),a=r(79039),l=r(61034),c="toString",u=RegExp.prototype,h=u[c],d=a((function(){return"/a/b"!==h.call({source:"a",flags:"b"})})),p=n&&h.name!==c;(d||p)&&i(u,c,(function(){var e=s(this);return"/"+o(e.source)+"/"+o(l(e))}),{unsafe:!0})},92405:(e,t,r)=>{"use strict";r(16468)("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),r(86938))},17642:(e,t,r)=>{"use strict";var n=r(46518),i=r(83440);n({target:"Set",proto:!0,real:!0,forced:!r(84916)("difference")},{difference:i})},58004:(e,t,r)=>{"use strict";var n=r(46518),i=r(79039),s=r(68750);n({target:"Set",proto:!0,real:!0,forced:!r(84916)("intersection")||i((function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))}))},{intersection:s})},33853:(e,t,r)=>{"use strict";var n=r(46518),i=r(64449);n({target:"Set",proto:!0,real:!0,forced:!r(84916)("isDisjointFrom")},{isDisjointFrom:i})},45876:(e,t,r)=>{"use strict";var n=r(46518),i=r(53838);n({target:"Set",proto:!0,real:!0,forced:!r(84916)("isSubsetOf")},{isSubsetOf:i})},32475:(e,t,r)=>{"use strict";var n=r(46518),i=r(28527);n({target:"Set",proto:!0,real:!0,forced:!r(84916)("isSupersetOf")},{isSupersetOf:i})},31415:(e,t,r)=>{"use strict";r(92405)},15024:(e,t,r)=>{"use strict";var n=r(46518),i=r(83650);n({target:"Set",proto:!0,real:!0,forced:!r(84916)("symmetricDifference")},{symmetricDifference:i})},31698:(e,t,r)=>{"use strict";var n=r(46518),i=r(44204);n({target:"Set",proto:!0,real:!0,forced:!r(84916)("union")},{union:i})},89907:(e,t,r)=>{"use strict";var n=r(46518),i=r(77240);n({target:"String",proto:!0,forced:r(23061)("anchor")},{anchor:function(e){return i(this,"a","name",e)}})},67357:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(67750),o=r(91291),a=r(655),l=r(79039),c=i("".charAt);n({target:"String",proto:!0,forced:l((function(){return"\ud842"!=="𠮷".at(-2)}))},{at:function(e){var t=a(s(this)),r=t.length,n=o(e),i=n>=0?n:r+n;return i<0||i>=r?void 0:c(t,i)}})},11898:(e,t,r)=>{"use strict";var n=r(46518),i=r(77240);n({target:"String",proto:!0,forced:r(23061)("big")},{big:function(){return i(this,"big","","")}})},35490:(e,t,r)=>{"use strict";var n=r(46518),i=r(77240);n({target:"String",proto:!0,forced:r(23061)("blink")},{blink:function(){return i(this,"blink","","")}})},5745:(e,t,r)=>{"use strict";var n=r(46518),i=r(77240);n({target:"String",proto:!0,forced:r(23061)("bold")},{bold:function(){return i(this,"b","","")}})},23860:(e,t,r)=>{"use strict";var n=r(46518),i=r(68183).codeAt;n({target:"String",proto:!0},{codePointAt:function(e){return i(this,e)}})},99449:(e,t,r)=>{"use strict";var n,i=r(46518),s=r(27476),o=r(77347).f,a=r(18014),l=r(655),c=r(60511),u=r(67750),h=r(41436),d=r(96395),p=s("".slice),f=Math.min,m=h("endsWith");i({target:"String",proto:!0,forced:!(!d&&!m&&(n=o(String.prototype,"endsWith"),n&&!n.writable)||m)},{endsWith:function(e){var t=l(u(this));c(e);var r=arguments.length>1?arguments[1]:void 0,n=t.length,i=void 0===r?n:f(a(r),n),s=l(e);return p(t,i-s.length,i)===s}})},94298:(e,t,r)=>{"use strict";var n=r(46518),i=r(77240);n({target:"String",proto:!0,forced:r(23061)("fixed")},{fixed:function(){return i(this,"tt","","")}})},60268:(e,t,r)=>{"use strict";var n=r(46518),i=r(77240);n({target:"String",proto:!0,forced:r(23061)("fontcolor")},{fontcolor:function(e){return i(this,"font","color",e)}})},69546:(e,t,r)=>{"use strict";var n=r(46518),i=r(77240);n({target:"String",proto:!0,forced:r(23061)("fontsize")},{fontsize:function(e){return i(this,"font","size",e)}})},27337:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(35610),o=RangeError,a=String.fromCharCode,l=String.fromCodePoint,c=i([].join);n({target:"String",stat:!0,arity:1,forced:!!l&&1!==l.length},{fromCodePoint:function(e){for(var t,r=[],n=arguments.length,i=0;n>i;){if(t=+arguments[i++],s(t,1114111)!==t)throw new o(t+" is not a valid code point");r[i]=t<65536?a(t):a(55296+((t-=65536)>>10),t%1024+56320)}return c(r,"")}})},21699:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(60511),o=r(67750),a=r(655),l=r(41436),c=i("".indexOf);n({target:"String",proto:!0,forced:!l("includes")},{includes:function(e){return!!~c(a(o(this)),a(s(e)),arguments.length>1?arguments[1]:void 0)}})},42043:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(67750),o=r(655),a=i("".charCodeAt);n({target:"String",proto:!0},{isWellFormed:function(){for(var e=o(s(this)),t=e.length,r=0;r=56320||++r>=t||56320!=(64512&a(e,r))))return!1}return!0}})},20781:(e,t,r)=>{"use strict";var n=r(46518),i=r(77240);n({target:"String",proto:!0,forced:r(23061)("italics")},{italics:function(){return i(this,"i","","")}})},47764:(e,t,r)=>{"use strict";var n=r(68183).charAt,i=r(655),s=r(91181),o=r(51088),a=r(62529),l="String Iterator",c=s.set,u=s.getterFor(l);o(String,"String",(function(e){c(this,{type:l,string:i(e),index:0})}),(function(){var e,t=u(this),r=t.string,i=t.index;return i>=r.length?a(void 0,!0):(e=n(r,i),t.index+=e.length,a(e,!1))}))},50778:(e,t,r)=>{"use strict";var n=r(46518),i=r(77240);n({target:"String",proto:!0,forced:r(23061)("link")},{link:function(e){return i(this,"a","href",e)}})},28543:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(27476),o=r(33994),a=r(62529),l=r(67750),c=r(18014),u=r(655),h=r(28551),d=r(64117),p=r(22195),f=r(60788),m=r(61034),g=r(55966),A=r(36840),y=r(79039),v=r(78227),x=r(2293),_=r(57829),b=r(56682),w=r(91181),E=r(96395),M=v("matchAll"),S="RegExp String",C=S+" Iterator",T=w.set,I=w.getterFor(C),R=RegExp.prototype,B=TypeError,P=s("".indexOf),L=s("".matchAll),D=!!L&&!y((function(){L("a",/./)})),O=o((function(e,t,r,n){T(this,{type:C,regexp:e,string:t,global:r,unicode:n,done:!1})}),S,(function(){var e=I(this);if(e.done)return a(void 0,!0);var t=e.regexp,r=e.string,n=b(t,r);return null===n?(e.done=!0,a(void 0,!0)):e.global?(""===u(n[0])&&(t.lastIndex=_(r,c(t.lastIndex),e.unicode)),a(n,!1)):(e.done=!0,a(n,!1))})),N=function(e){var t,r,n,i=h(this),s=u(e),o=x(i,RegExp),a=u(m(i));return t=new o(o===RegExp?i.source:i,a),r=!!~P(a,"g"),n=!!~P(a,"u"),t.lastIndex=c(i.lastIndex),new O(t,s,r,n)};n({target:"String",proto:!0,forced:D},{matchAll:function(e){var t,r,n,s,o=l(this);if(d(e)){if(D)return L(o,e)}else{if(f(e)&&(t=u(l(m(e))),!~P(t,"g")))throw new B("`.matchAll` does not allow non-global regexes");if(D)return L(o,e);if(void 0===(n=g(e,M))&&E&&"RegExp"===p(e)&&(n=N),n)return i(n,e,o)}return r=u(o),s=new RegExp(e,"g"),E?i(N,s,r):s[M](r)}}),E||M in R||A(R,M,N)},71761:(e,t,r)=>{"use strict";var n=r(69565),i=r(89228),s=r(28551),o=r(64117),a=r(18014),l=r(655),c=r(67750),u=r(55966),h=r(57829),d=r(56682);i("match",(function(e,t,r){return[function(t){var r=c(this),i=o(t)?void 0:u(t,e);return i?n(i,t,r):new RegExp(t)[e](l(r))},function(e){var n=s(this),i=l(e),o=r(t,n,i);if(o.done)return o.value;if(!n.global)return d(n,i);var c=n.unicode;n.lastIndex=0;for(var u,p=[],f=0;null!==(u=d(n,i));){var m=l(u[0]);p[f]=m,""===m&&(n.lastIndex=h(i,a(n.lastIndex),c)),f++}return 0===f?null:p}]}))},35701:(e,t,r)=>{"use strict";var n=r(46518),i=r(60533).end;n({target:"String",proto:!0,forced:r(83063)},{padEnd:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},68156:(e,t,r)=>{"use strict";var n=r(46518),i=r(60533).start;n({target:"String",proto:!0,forced:r(83063)},{padStart:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},85906:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(25397),o=r(48981),a=r(655),l=r(26198),c=i([].push),u=i([].join);n({target:"String",stat:!0},{raw:function(e){var t=s(o(e).raw),r=l(t);if(!r)return"";for(var n=arguments.length,i=[],h=0;;){if(c(i,a(t[h++])),h===r)return u(i,"");h{"use strict";r(46518)({target:"String",proto:!0},{repeat:r(72333)})},79978:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(79504),o=r(67750),a=r(94901),l=r(64117),c=r(60788),u=r(655),h=r(55966),d=r(61034),p=r(2478),f=r(78227),m=r(96395),g=f("replace"),A=TypeError,y=s("".indexOf),v=s("".replace),x=s("".slice),_=Math.max;n({target:"String",proto:!0},{replaceAll:function(e,t){var r,n,s,f,b,w,E,M,S,C,T=o(this),I=0,R="";if(!l(e)){if((r=c(e))&&(n=u(o(d(e))),!~y(n,"g")))throw new A("`.replaceAll` does not allow non-global regexes");if(s=h(e,g))return i(s,e,T,t);if(m&&r)return v(u(T),e,t)}for(f=u(T),b=u(e),(w=a(t))||(t=u(t)),E=b.length,M=_(1,E),S=y(f,b);-1!==S;)C=w?u(t(b,S,f)):p(b,f,S,[],void 0,t),R+=x(f,I,S)+C,I=S+E,S=S+M>f.length?-1:y(f,b,S+M);return I{"use strict";var n=r(18745),i=r(69565),s=r(79504),o=r(89228),a=r(79039),l=r(28551),c=r(94901),u=r(64117),h=r(91291),d=r(18014),p=r(655),f=r(67750),m=r(57829),g=r(55966),A=r(2478),y=r(56682),v=r(78227)("replace"),x=Math.max,_=Math.min,b=s([].concat),w=s([].push),E=s("".indexOf),M=s("".slice),S="$0"==="a".replace(/./,"$0"),C=!!/./[v]&&""===/./[v]("a","$0");o("replace",(function(e,t,r){var s=C?"$":"$0";return[function(e,r){var n=f(this),s=u(e)?void 0:g(e,v);return s?i(s,e,n,r):i(t,p(n),e,r)},function(e,i){var o=l(this),a=p(e);if("string"==typeof i&&-1===E(i,s)&&-1===E(i,"$<")){var u=r(t,o,a,i);if(u.done)return u.value}var f=c(i);f||(i=p(i));var g,v=o.global;v&&(g=o.unicode,o.lastIndex=0);for(var S,C=[];null!==(S=y(o,a))&&(w(C,S),v);)""===p(S[0])&&(o.lastIndex=m(a,d(o.lastIndex),g));for(var T,I="",R=0,B=0;B=R&&(I+=M(a,R,D)+P,R=D+L.length)}return I+M(a,R)}]}),!!a((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")}))||!S||C)},5746:(e,t,r)=>{"use strict";var n=r(69565),i=r(89228),s=r(28551),o=r(64117),a=r(67750),l=r(3470),c=r(655),u=r(55966),h=r(56682);i("search",(function(e,t,r){return[function(t){var r=a(this),i=o(t)?void 0:u(t,e);return i?n(i,t,r):new RegExp(t)[e](c(r))},function(e){var n=s(this),i=c(e),o=r(t,n,i);if(o.done)return o.value;var a=n.lastIndex;l(a,0)||(n.lastIndex=0);var u=h(n,i);return l(n.lastIndex,a)||(n.lastIndex=a),null===u?-1:u.index}]}))},89195:(e,t,r)=>{"use strict";var n=r(46518),i=r(77240);n({target:"String",proto:!0,forced:r(23061)("small")},{small:function(){return i(this,"small","","")}})},90744:(e,t,r)=>{"use strict";var n=r(69565),i=r(79504),s=r(89228),o=r(28551),a=r(64117),l=r(67750),c=r(2293),u=r(57829),h=r(18014),d=r(655),p=r(55966),f=r(56682),m=r(58429),g=r(79039),A=m.UNSUPPORTED_Y,y=Math.min,v=i([].push),x=i("".slice),_=!g((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return 2!==r.length||"a"!==r[0]||"b"!==r[1]})),b="c"==="abbc".split(/(b)*/)[1]||4!=="test".split(/(?:)/,-1).length||2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length;s("split",(function(e,t,r){var i="0".split(void 0,0).length?function(e,r){return void 0===e&&0===r?[]:n(t,this,e,r)}:t;return[function(t,r){var s=l(this),o=a(t)?void 0:p(t,e);return o?n(o,t,s,r):n(i,d(s),t,r)},function(e,n){var s=o(this),a=d(e);if(!b){var l=r(i,s,a,n,i!==t);if(l.done)return l.value}var p=c(s,RegExp),m=s.unicode,g=(s.ignoreCase?"i":"")+(s.multiline?"m":"")+(s.unicode?"u":"")+(A?"g":"y"),_=new p(A?"^(?:"+s.source+")":s,g),w=void 0===n?4294967295:n>>>0;if(0===w)return[];if(0===a.length)return null===f(_,a)?[a]:[];for(var E=0,M=0,S=[];M{"use strict";var n,i=r(46518),s=r(27476),o=r(77347).f,a=r(18014),l=r(655),c=r(60511),u=r(67750),h=r(41436),d=r(96395),p=s("".slice),f=Math.min,m=h("startsWith");i({target:"String",proto:!0,forced:!(!d&&!m&&(n=o(String.prototype,"startsWith"),n&&!n.writable)||m)},{startsWith:function(e){var t=l(u(this));c(e);var r=a(f(arguments.length>1?arguments[1]:void 0,t.length)),n=l(e);return p(t,r,r+n.length)===n}})},46276:(e,t,r)=>{"use strict";var n=r(46518),i=r(77240);n({target:"String",proto:!0,forced:r(23061)("strike")},{strike:function(){return i(this,"strike","","")}})},48718:(e,t,r)=>{"use strict";var n=r(46518),i=r(77240);n({target:"String",proto:!0,forced:r(23061)("sub")},{sub:function(){return i(this,"sub","","")}})},50375:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(67750),o=r(91291),a=r(655),l=i("".slice),c=Math.max,u=Math.min;n({target:"String",proto:!0,forced:!"".substr||"b"!=="ab".substr(-1)},{substr:function(e,t){var r,n,i=a(s(this)),h=i.length,d=o(e);return d===1/0&&(d=0),d<0&&(d=c(h+d,0)),(r=void 0===t?h:o(t))<=0||r===1/0||d>=(n=u(d+r,h))?"":l(i,d,n)}})},16308:(e,t,r)=>{"use strict";var n=r(46518),i=r(77240);n({target:"String",proto:!0,forced:r(23061)("sup")},{sup:function(){return i(this,"sup","","")}})},67438:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(79504),o=r(67750),a=r(655),l=r(79039),c=Array,u=s("".charAt),h=s("".charCodeAt),d=s([].join),p="".toWellFormed,f=p&&l((function(){return"1"!==i(p,1)}));n({target:"String",proto:!0,forced:f},{toWellFormed:function(){var e=a(o(this));if(f)return i(p,e);for(var t=e.length,r=c(t),n=0;n=56320||n+1>=t||56320!=(64512&h(e,n+1))?r[n]="�":(r[n]=u(e,n),r[++n]=u(e,n))}return d(r,"")}})},39202:(e,t,r)=>{"use strict";r(33313);var n=r(46518),i=r(18866);n({target:"String",proto:!0,name:"trimEnd",forced:"".trimEnd!==i},{trimEnd:i})},58934:(e,t,r)=>{"use strict";var n=r(46518),i=r(53487);n({target:"String",proto:!0,name:"trimStart",forced:"".trimLeft!==i},{trimLeft:i})},33313:(e,t,r)=>{"use strict";var n=r(46518),i=r(18866);n({target:"String",proto:!0,name:"trimEnd",forced:"".trimRight!==i},{trimRight:i})},43359:(e,t,r)=>{"use strict";r(58934);var n=r(46518),i=r(53487);n({target:"String",proto:!0,name:"trimStart",forced:"".trimStart!==i},{trimStart:i})},42762:(e,t,r)=>{"use strict";var n=r(46518),i=r(43802).trim;n({target:"String",proto:!0,forced:r(60706)("trim")},{trim:function(){return i(this)}})},66412:(e,t,r)=>{"use strict";r(70511)("asyncIterator")},6761:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(69565),o=r(79504),a=r(96395),l=r(43724),c=r(4495),u=r(79039),h=r(39297),d=r(1625),p=r(28551),f=r(25397),m=r(56969),g=r(655),A=r(6980),y=r(2360),v=r(71072),x=r(38480),_=r(10298),b=r(33717),w=r(77347),E=r(24913),M=r(96801),S=r(48773),C=r(36840),T=r(62106),I=r(25745),R=r(66119),B=r(30421),P=r(33392),L=r(78227),D=r(1951),O=r(70511),N=r(58242),U=r(10687),F=r(91181),k=r(59213).forEach,z=R("hidden"),G="Symbol",Q="prototype",V=F.set,H=F.getterFor(G),j=Object[Q],q=i.Symbol,W=q&&q[Q],Y=i.RangeError,X=i.TypeError,K=i.QObject,$=w.f,J=E.f,Z=_.f,ee=S.f,te=o([].push),re=I("symbols"),ne=I("op-symbols"),ie=I("wks"),se=!K||!K[Q]||!K[Q].findChild,oe=function(e,t,r){var n=$(j,t);n&&delete j[t],J(e,t,r),n&&e!==j&&J(j,t,n)},ae=l&&u((function(){return 7!==y(J({},"a",{get:function(){return J(this,"a",{value:7}).a}})).a}))?oe:J,le=function(e,t){var r=re[e]=y(W);return V(r,{type:G,tag:e,description:t}),l||(r.description=t),r},ce=function(e,t,r){e===j&&ce(ne,t,r),p(e);var n=m(t);return p(r),h(re,n)?(r.enumerable?(h(e,z)&&e[z][n]&&(e[z][n]=!1),r=y(r,{enumerable:A(0,!1)})):(h(e,z)||J(e,z,A(1,y(null))),e[z][n]=!0),ae(e,n,r)):J(e,n,r)},ue=function(e,t){p(e);var r=f(t),n=v(r).concat(fe(r));return k(n,(function(t){l&&!s(he,r,t)||ce(e,t,r[t])})),e},he=function(e){var t=m(e),r=s(ee,this,t);return!(this===j&&h(re,t)&&!h(ne,t))&&(!(r||!h(this,t)||!h(re,t)||h(this,z)&&this[z][t])||r)},de=function(e,t){var r=f(e),n=m(t);if(r!==j||!h(re,n)||h(ne,n)){var i=$(r,n);return!i||!h(re,n)||h(r,z)&&r[z][n]||(i.enumerable=!0),i}},pe=function(e){var t=Z(f(e)),r=[];return k(t,(function(e){h(re,e)||h(B,e)||te(r,e)})),r},fe=function(e){var t=e===j,r=Z(t?ne:f(e)),n=[];return k(r,(function(e){!h(re,e)||t&&!h(j,e)||te(n,re[e])})),n};c||(C(W=(q=function(){if(d(W,this))throw new X("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?g(arguments[0]):void 0,t=P(e),r=function(e){var n=void 0===this?i:this;n===j&&s(r,ne,e),h(n,z)&&h(n[z],t)&&(n[z][t]=!1);var o=A(1,e);try{ae(n,t,o)}catch(e){if(!(e instanceof Y))throw e;oe(n,t,o)}};return l&&se&&ae(j,t,{configurable:!0,set:r}),le(t,e)})[Q],"toString",(function(){return H(this).tag})),C(q,"withoutSetter",(function(e){return le(P(e),e)})),S.f=he,E.f=ce,M.f=ue,w.f=de,x.f=_.f=pe,b.f=fe,D.f=function(e){return le(L(e),e)},l&&(T(W,"description",{configurable:!0,get:function(){return H(this).description}}),a||C(j,"propertyIsEnumerable",he,{unsafe:!0}))),n({global:!0,constructor:!0,wrap:!0,forced:!c,sham:!c},{Symbol:q}),k(v(ie),(function(e){O(e)})),n({target:G,stat:!0,forced:!c},{useSetter:function(){se=!0},useSimple:function(){se=!1}}),n({target:"Object",stat:!0,forced:!c,sham:!l},{create:function(e,t){return void 0===t?y(e):ue(y(e),t)},defineProperty:ce,defineProperties:ue,getOwnPropertyDescriptor:de}),n({target:"Object",stat:!0,forced:!c},{getOwnPropertyNames:pe}),N(),U(q,G),B[z]=!0},89463:(e,t,r)=>{"use strict";var n=r(46518),i=r(43724),s=r(44576),o=r(79504),a=r(39297),l=r(94901),c=r(1625),u=r(655),h=r(62106),d=r(77740),p=s.Symbol,f=p&&p.prototype;if(i&&l(p)&&(!("description"in f)||void 0!==p().description)){var m={},g=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:u(arguments[0]),t=c(f,this)?new p(e):void 0===e?p():p(e);return""===e&&(m[t]=!0),t};d(g,p),g.prototype=f,f.constructor=g;var A="Symbol(description detection)"===String(p("description detection")),y=o(f.valueOf),v=o(f.toString),x=/^Symbol\((.*)\)[^)]+$/,_=o("".replace),b=o("".slice);h(f,"description",{configurable:!0,get:function(){var e=y(this);if(a(m,e))return"";var t=v(e),r=A?b(t,7,-1):_(t,x,"$1");return""===r?void 0:r}}),n({global:!0,constructor:!0,forced:!0},{Symbol:g})}},81510:(e,t,r)=>{"use strict";var n=r(46518),i=r(97751),s=r(39297),o=r(655),a=r(25745),l=r(91296),c=a("string-to-symbol-registry"),u=a("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!l},{for:function(e){var t=o(e);if(s(c,t))return c[t];var r=i("Symbol")(t);return c[t]=r,u[r]=t,r}})},60193:(e,t,r)=>{"use strict";r(70511)("hasInstance")},92168:(e,t,r)=>{"use strict";r(70511)("isConcatSpreadable")},2259:(e,t,r)=>{"use strict";r(70511)("iterator")},52675:(e,t,r)=>{"use strict";r(6761),r(81510),r(97812),r(33110),r(49773)},97812:(e,t,r)=>{"use strict";var n=r(46518),i=r(39297),s=r(10757),o=r(16823),a=r(25745),l=r(91296),c=a("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!l},{keyFor:function(e){if(!s(e))throw new TypeError(o(e)+" is not a symbol");if(i(c,e))return c[e]}})},83142:(e,t,r)=>{"use strict";r(70511)("matchAll")},86964:(e,t,r)=>{"use strict";r(70511)("match")},83237:(e,t,r)=>{"use strict";r(70511)("replace")},61833:(e,t,r)=>{"use strict";r(70511)("search")},67947:(e,t,r)=>{"use strict";r(70511)("species")},31073:(e,t,r)=>{"use strict";r(70511)("split")},45700:(e,t,r)=>{"use strict";var n=r(70511),i=r(58242);n("toPrimitive"),i()},78125:(e,t,r)=>{"use strict";var n=r(97751),i=r(70511),s=r(10687);i("toStringTag"),s(n("Symbol"),"Symbol")},20326:(e,t,r)=>{"use strict";r(70511)("unscopables")},48140:(e,t,r)=>{"use strict";var n=r(94644),i=r(26198),s=r(91291),o=n.aTypedArray;(0,n.exportTypedArrayMethod)("at",(function(e){var t=o(this),r=i(t),n=s(e),a=n>=0?n:r+n;return a<0||a>=r?void 0:t[a]}))},81630:(e,t,r)=>{"use strict";var n=r(79504),i=r(94644),s=n(r(57029)),o=i.aTypedArray;(0,i.exportTypedArrayMethod)("copyWithin",(function(e,t){return s(o(this),e,t,arguments.length>2?arguments[2]:void 0)}))},72170:(e,t,r)=>{"use strict";var n=r(94644),i=r(59213).every,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("every",(function(e){return i(s(this),e,arguments.length>1?arguments[1]:void 0)}))},75044:(e,t,r)=>{"use strict";var n=r(94644),i=r(84373),s=r(75854),o=r(36955),a=r(69565),l=r(79504),c=r(79039),u=n.aTypedArray,h=n.exportTypedArrayMethod,d=l("".slice);h("fill",(function(e){var t=arguments.length;u(this);var r="Big"===d(o(this),0,3)?s(e):+e;return a(i,this,r,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)}),c((function(){var e=0;return new Int8Array(2).fill({valueOf:function(){return e++}}),1!==e})))},69539:(e,t,r)=>{"use strict";var n=r(94644),i=r(59213).filter,s=r(26357),o=n.aTypedArray;(0,n.exportTypedArrayMethod)("filter",(function(e){var t=i(o(this),e,arguments.length>1?arguments[1]:void 0);return s(this,t)}))},89955:(e,t,r)=>{"use strict";var n=r(94644),i=r(59213).findIndex,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("findIndex",(function(e){return i(s(this),e,arguments.length>1?arguments[1]:void 0)}))},91134:(e,t,r)=>{"use strict";var n=r(94644),i=r(43839).findLastIndex,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("findLastIndex",(function(e){return i(s(this),e,arguments.length>1?arguments[1]:void 0)}))},21903:(e,t,r)=>{"use strict";var n=r(94644),i=r(43839).findLast,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("findLast",(function(e){return i(s(this),e,arguments.length>1?arguments[1]:void 0)}))},31694:(e,t,r)=>{"use strict";var n=r(94644),i=r(59213).find,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("find",(function(e){return i(s(this),e,arguments.length>1?arguments[1]:void 0)}))},34594:(e,t,r)=>{"use strict";r(15823)("Float32",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},29833:(e,t,r)=>{"use strict";r(15823)("Float64",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},33206:(e,t,r)=>{"use strict";var n=r(94644),i=r(59213).forEach,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("forEach",(function(e){i(s(this),e,arguments.length>1?arguments[1]:void 0)}))},48345:(e,t,r)=>{"use strict";var n=r(72805);(0,r(94644).exportTypedArrayStaticMethod)("from",r(43251),n)},44496:(e,t,r)=>{"use strict";var n=r(94644),i=r(19617).includes,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("includes",(function(e){return i(s(this),e,arguments.length>1?arguments[1]:void 0)}))},66651:(e,t,r)=>{"use strict";var n=r(94644),i=r(19617).indexOf,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("indexOf",(function(e){return i(s(this),e,arguments.length>1?arguments[1]:void 0)}))},72107:(e,t,r)=>{"use strict";r(15823)("Int16",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},95477:(e,t,r)=>{"use strict";r(15823)("Int32",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},46594:(e,t,r)=>{"use strict";r(15823)("Int8",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},12887:(e,t,r)=>{"use strict";var n=r(44576),i=r(79039),s=r(79504),o=r(94644),a=r(23792),l=r(78227)("iterator"),c=n.Uint8Array,u=s(a.values),h=s(a.keys),d=s(a.entries),p=o.aTypedArray,f=o.exportTypedArrayMethod,m=c&&c.prototype,g=!i((function(){m[l].call([1])})),A=!!m&&m.values&&m[l]===m.values&&"values"===m.values.name,y=function(){return u(p(this))};f("entries",(function(){return d(p(this))}),g),f("keys",(function(){return h(p(this))}),g),f("values",y,g||!A,{name:"values"}),f(l,y,g||!A,{name:"values"})},19369:(e,t,r)=>{"use strict";var n=r(94644),i=r(79504),s=n.aTypedArray,o=n.exportTypedArrayMethod,a=i([].join);o("join",(function(e){return a(s(this),e)}))},66812:(e,t,r)=>{"use strict";var n=r(94644),i=r(18745),s=r(8379),o=n.aTypedArray;(0,n.exportTypedArrayMethod)("lastIndexOf",(function(e){var t=arguments.length;return i(s,o(this),t>1?[e,arguments[1]]:[e])}))},8995:(e,t,r)=>{"use strict";var n=r(94644),i=r(59213).map,s=r(61412),o=n.aTypedArray;(0,n.exportTypedArrayMethod)("map",(function(e){return i(o(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(s(e))(t)}))}))},52568:(e,t,r)=>{"use strict";var n=r(94644),i=r(72805),s=n.aTypedArrayConstructor;(0,n.exportTypedArrayStaticMethod)("of",(function(){for(var e=0,t=arguments.length,r=new(s(this))(t);t>e;)r[e]=arguments[e++];return r}),i)},36072:(e,t,r)=>{"use strict";var n=r(94644),i=r(80926).right,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("reduceRight",(function(e){var t=arguments.length;return i(s(this),e,t,t>1?arguments[1]:void 0)}))},31575:(e,t,r)=>{"use strict";var n=r(94644),i=r(80926).left,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("reduce",(function(e){var t=arguments.length;return i(s(this),e,t,t>1?arguments[1]:void 0)}))},88747:(e,t,r)=>{"use strict";var n=r(94644),i=n.aTypedArray,s=n.exportTypedArrayMethod,o=Math.floor;s("reverse",(function(){for(var e,t=this,r=i(t).length,n=o(r/2),s=0;s{"use strict";var n=r(44576),i=r(69565),s=r(94644),o=r(26198),a=r(58229),l=r(48981),c=r(79039),u=n.RangeError,h=n.Int8Array,d=h&&h.prototype,p=d&&d.set,f=s.aTypedArray,m=s.exportTypedArrayMethod,g=!c((function(){var e=new Uint8ClampedArray(2);return i(p,e,{length:1,0:3},1),3!==e[1]})),A=g&&s.NATIVE_ARRAY_BUFFER_VIEWS&&c((function(){var e=new h(2);return e.set(1),e.set("2",1),0!==e[0]||2!==e[1]}));m("set",(function(e){f(this);var t=a(arguments.length>1?arguments[1]:void 0,1),r=l(e);if(g)return i(p,this,r,t);var n=this.length,s=o(r),c=0;if(s+t>n)throw new u("Wrong length");for(;c{"use strict";var n=r(94644),i=r(61412),s=r(79039),o=r(67680),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("slice",(function(e,t){for(var r=o(a(this),e,t),n=i(this),s=0,l=r.length,c=new n(l);l>s;)c[s]=r[s++];return c}),s((function(){new Int8Array(1).slice()})))},57301:(e,t,r)=>{"use strict";var n=r(94644),i=r(59213).some,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("some",(function(e){return i(s(this),e,arguments.length>1?arguments[1]:void 0)}))},373:(e,t,r)=>{"use strict";var n=r(44576),i=r(27476),s=r(79039),o=r(79306),a=r(74488),l=r(94644),c=r(13709),u=r(13763),h=r(39519),d=r(3607),p=l.aTypedArray,f=l.exportTypedArrayMethod,m=n.Uint16Array,g=m&&i(m.prototype.sort),A=!(!g||s((function(){g(new m(2),null)}))&&s((function(){g(new m(2),{})}))),y=!!g&&!s((function(){if(h)return h<74;if(c)return c<67;if(u)return!0;if(d)return d<602;var e,t,r=new m(516),n=Array(516);for(e=0;e<516;e++)t=e%4,r[e]=515-e,n[e]=e-2*t+3;for(g(r,(function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(r[e]!==n[e])return!0}));f("sort",(function(e){return void 0!==e&&o(e),y?g(this,e):a(p(this),function(e){return function(t,r){return void 0!==e?+e(t,r)||0:r!=r?-1:t!=t?1:0===t&&0===r?1/t>0&&1/r<0?1:-1:t>r}}(e))}),!y||A)},86614:(e,t,r)=>{"use strict";var n=r(94644),i=r(18014),s=r(35610),o=r(61412),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("subarray",(function(e,t){var r=a(this),n=r.length,l=s(e,n);return new(o(r))(r.buffer,r.byteOffset+l*r.BYTES_PER_ELEMENT,i((void 0===t?n:s(t,n))-l))}))},41405:(e,t,r)=>{"use strict";var n=r(44576),i=r(18745),s=r(94644),o=r(79039),a=r(67680),l=n.Int8Array,c=s.aTypedArray,u=s.exportTypedArrayMethod,h=[].toLocaleString,d=!!l&&o((function(){h.call(new l(1))}));u("toLocaleString",(function(){return i(h,d?a(c(this)):c(this),a(arguments))}),o((function(){return[1,2].toLocaleString()!==new l([1,2]).toLocaleString()}))||!o((function(){l.prototype.toLocaleString.call([1,2])})))},37467:(e,t,r)=>{"use strict";var n=r(37628),i=r(94644),s=i.aTypedArray,o=i.exportTypedArrayMethod,a=i.getTypedArrayConstructor;o("toReversed",(function(){return n(s(this),a(this))}))},44732:(e,t,r)=>{"use strict";var n=r(94644),i=r(79504),s=r(79306),o=r(35370),a=n.aTypedArray,l=n.getTypedArrayConstructor,c=n.exportTypedArrayMethod,u=i(n.TypedArrayPrototype.sort);c("toSorted",(function(e){void 0!==e&&s(e);var t=a(this),r=o(l(t),t);return u(r,e)}))},33684:(e,t,r)=>{"use strict";var n=r(94644).exportTypedArrayMethod,i=r(79039),s=r(44576),o=r(79504),a=s.Uint8Array,l=a&&a.prototype||{},c=[].toString,u=o([].join);i((function(){c.call({})}))&&(c=function(){return u(this)});var h=l.toString!==c;n("toString",c,h)},3690:(e,t,r)=>{"use strict";r(15823)("Uint16",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},61740:(e,t,r)=>{"use strict";r(15823)("Uint32",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},21489:(e,t,r)=>{"use strict";r(15823)("Uint8",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},22134:(e,t,r)=>{"use strict";r(15823)("Uint8",(function(e){return function(t,r,n){return e(this,t,r,n)}}),!0)},79577:(e,t,r)=>{"use strict";var n=r(39928),i=r(94644),s=r(18727),o=r(91291),a=r(75854),l=i.aTypedArray,c=i.getTypedArrayConstructor,u=i.exportTypedArrayMethod,h=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(e){return 8===e}}();u("with",{with:function(e,t){var r=l(this),i=o(e),u=s(r)?a(t):+t;return n(r,c(r),i,u)}}.with,!h)},88267:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(655),o=String.fromCharCode,a=i("".charAt),l=i(/./.exec),c=i("".slice),u=/^[\da-f]{2}$/i,h=/^[\da-f]{4}$/i;n({global:!0},{unescape:function(e){for(var t,r,n=s(e),i="",d=n.length,p=0;p{"use strict";var n,i=r(92744),s=r(44576),o=r(79504),a=r(56279),l=r(3451),c=r(16468),u=r(91625),h=r(20034),d=r(91181).enforce,p=r(79039),f=r(58622),m=Object,g=Array.isArray,A=m.isExtensible,y=m.isFrozen,v=m.isSealed,x=m.freeze,_=m.seal,b=!s.ActiveXObject&&"ActiveXObject"in s,w=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},E=c("WeakMap",w,u),M=E.prototype,S=o(M.set);if(f)if(b){n=u.getConstructor(w,"WeakMap",!0),l.enable();var C=o(M.delete),T=o(M.has),I=o(M.get);a(M,{delete:function(e){if(h(e)&&!A(e)){var t=d(this);return t.frozen||(t.frozen=new n),C(this,e)||t.frozen.delete(e)}return C(this,e)},has:function(e){if(h(e)&&!A(e)){var t=d(this);return t.frozen||(t.frozen=new n),T(this,e)||t.frozen.has(e)}return T(this,e)},get:function(e){if(h(e)&&!A(e)){var t=d(this);return t.frozen||(t.frozen=new n),T(this,e)?I(this,e):t.frozen.get(e)}return I(this,e)},set:function(e,t){if(h(e)&&!A(e)){var r=d(this);r.frozen||(r.frozen=new n),T(this,e)?S(this,e,t):r.frozen.set(e,t)}else S(this,e,t);return this}})}else i&&p((function(){var e=x([]);return S(new E,e,1),!y(e)}))&&a(M,{set:function(e,t){var r;return g(e)&&(y(e)?r=x:v(e)&&(r=_)),S(this,e,t),r&&r(e),this}})},73772:(e,t,r)=>{"use strict";r(65746)},5240:(e,t,r)=>{"use strict";r(16468)("WeakSet",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),r(91625))},30958:(e,t,r)=>{"use strict";r(5240)},49806:(e,t,r)=>{"use strict";r(30067)},26280:(e,t,r)=>{"use strict";r(16573)},47801:(e,t,r)=>{"use strict";r(77936)},27913:(e,t,r)=>{"use strict";r(78100)},34504:(e,t,r)=>{"use strict";r(18107)},87370:(e,t,r)=>{"use strict";var n=r(46518),i=r(59213).filterReject,s=r(6469);n({target:"Array",proto:!0,forced:!0},{filterOut:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),s("filterOut")},31659:(e,t,r)=>{"use strict";var n=r(46518),i=r(59213).filterReject,s=r(6469);n({target:"Array",proto:!0,forced:!0},{filterReject:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),s("filterReject")},17978:(e,t,r)=>{"use strict";r(13451)},95115:(e,t,r)=>{"use strict";r(10838)},26148:(e,t,r)=>{"use strict";var n=r(46518),i=r(8045),s=r(79039),o=Array.fromAsync;n({target:"Array",stat:!0,forced:!o||s((function(){var e=0;return o.call((function(){return e++,[]}),{length:0}),1!==e}))},{fromAsync:i})},88177:(e,t,r)=>{"use strict";var n=r(46518),i=r(34598),s=r(6469),o=r(2952);n({target:"Array",proto:!0,name:"groupToMap",forced:r(96395)||!i("groupByToMap")},{groupByToMap:o}),s("groupByToMap")},6986:(e,t,r)=>{"use strict";var n=r(46518),i=r(77957),s=r(34598),o=r(6469);n({target:"Array",proto:!0,forced:!s("groupBy")},{groupBy:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),o("groupBy")},80081:(e,t,r)=>{"use strict";var n=r(46518),i=r(6469),s=r(2952);n({target:"Array",proto:!0,forced:r(96395)},{groupToMap:s}),i("groupToMap")},46058:(e,t,r)=>{"use strict";var n=r(46518),i=r(77957),s=r(6469);n({target:"Array",proto:!0},{group:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),s("group")},45490:(e,t,r)=>{"use strict";var n=r(46518),i=r(34376),s=Object.isFrozen,o=function(e,t){if(!s||!i(e)||!s(e))return!1;for(var r,n=0,o=e.length;n{"use strict";var n=r(43724),i=r(6469),s=r(48981),o=r(26198),a=r(62106);n&&(a(Array.prototype,"lastIndex",{configurable:!0,get:function(){var e=s(this),t=o(e);return 0===t?0:t-1}}),i("lastIndex"))},55105:(e,t,r)=>{"use strict";var n=r(43724),i=r(6469),s=r(48981),o=r(26198),a=r(62106);n&&(a(Array.prototype,"lastItem",{configurable:!0,get:function(){var e=s(this),t=o(e);return 0===t?void 0:e[t-1]},set:function(e){var t=s(this),r=o(t);return t[0===r?0:r-1]=e}}),i("lastItem"))},54151:(e,t,r)=>{"use strict";r(9678)},72400:(e,t,r)=>{"use strict";r(57145)},73677:(e,t,r)=>{"use strict";r(71658)},61938:(e,t,r)=>{"use strict";var n=r(46518),i=r(6469);n({target:"Array",proto:!0,forced:!0},{uniqueBy:r(79565)}),i("uniqueBy")},85901:(e,t,r)=>{"use strict";r(11558)},82750:(e,t,r)=>{"use strict";var n=r(46518),i=r(43724),s=r(97751),o=r(79306),a=r(90679),l=r(36840),c=r(56279),u=r(62106),h=r(78227),d=r(91181),p=r(91021),f=s("Promise"),m=s("SuppressedError"),g=ReferenceError,A=h("asyncDispose"),y=h("toStringTag"),v="AsyncDisposableStack",x=d.set,_=d.getterFor(v),b="async-dispose",w="disposed",E=function(e){var t=_(e);if(t.state===w)throw new g(v+" already disposed");return t},M=function(){x(a(this,S),{type:v,state:"pending",stack:[]}),i||(this.disposed=!1)},S=M.prototype;c(S,{disposeAsync:function(){var e=this;return new f((function(t,r){var n=_(e);if(n.state===w)return t(void 0);n.state=w,i||(e.disposed=!0);var s,o=n.stack,a=o.length,l=!1,c=function(e){l?s=new m(e,s):(l=!0,s=e),u()},u=function(){if(a){var e=o[--a];o[a]=null;try{f.resolve(e()).then(u,c)}catch(e){c(e)}}else n.stack=null,l?r(s):t(void 0)};u()}))},use:function(e){return p(E(this),e,b),e},adopt:function(e,t){var r=E(this);return o(t),p(r,void 0,b,(function(){return t(e)})),e},defer:function(e){var t=E(this);o(e),p(t,void 0,b,e)},move:function(){var e=E(this),t=new M;return _(t).stack=e.stack,e.stack=[],e.state=w,i||(this.disposed=!0),t}}),i&&u(S,"disposed",{configurable:!0,get:function(){return _(this).state===w}}),l(S,A,S.disposeAsync,{name:"disposeAsync"}),l(S,y,v,{nonWritable:!0}),n({global:!0,constructor:!0},{AsyncDisposableStack:M})},84847:(e,t,r)=>{"use strict";r(46518)({target:"AsyncIterator",name:"indexed",proto:!0,real:!0,forced:!0},{asIndexedPairs:r(87481)})},74147:(e,t,r)=>{"use strict";var n=r(69565),i=r(36840),s=r(97751),o=r(55966),a=r(39297),l=r(78227),c=r(53982),u=l("asyncDispose"),h=s("Promise");a(c,u)||i(c,u,(function(){var e=this;return new h((function(t,r){var i=o(e,"return");i?h.resolve(n(i,e)).then((function(){t(void 0)}),r):t(void 0)}))}))},33811:(e,t,r)=>{"use strict";var n=r(46518),i=r(90679),s=r(42787),o=r(66699),a=r(39297),l=r(78227),c=r(53982),u=r(96395),h=l("toStringTag"),d=TypeError,p=function(){if(i(this,c),s(this)===c)throw new d("Abstract class AsyncIterator not directly constructable")};p.prototype=c,a(c,h)||o(c,h,"AsyncIterator"),!u&&a(c,"constructor")&&c.constructor!==Object||o(c,"constructor",p),n({global:!0,constructor:!0,forced:u},{AsyncIterator:p})},29150:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(28551),o=r(1767),a=r(24149),l=r(99590),c=r(92059),u=r(62529),h=r(96395),d=c((function(e){var t=this;return new e((function(r,n){var o=function(e){t.done=!0,n(e)},a=function(){try{e.resolve(s(i(t.next,t.iterator))).then((function(e){try{s(e).done?(t.done=!0,r(u(void 0,!0))):t.remaining?(t.remaining--,a()):r(u(e.value,!1))}catch(e){o(e)}}),o)}catch(e){o(e)}};a()}))}));n({target:"AsyncIterator",proto:!0,real:!0,forced:h},{drop:function(e){s(this);var t=l(a(+e));return new d(o(this),{remaining:t})}})},74648:(e,t,r)=>{"use strict";var n=r(46518),i=r(36639).every;n({target:"AsyncIterator",proto:!0,real:!0},{every:function(e){return i(this,e)}})},17333:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(79306),o=r(28551),a=r(20034),l=r(1767),c=r(92059),u=r(62529),h=r(20772),d=r(96395),p=c((function(e){var t=this,r=t.iterator,n=t.predicate;return new e((function(s,l){var c=function(e){t.done=!0,l(e)},d=function(e){h(r,c,e,c)},p=function(){try{e.resolve(o(i(t.next,r))).then((function(r){try{if(o(r).done)t.done=!0,s(u(void 0,!0));else{var i=r.value;try{var l=n(i,t.counter++),h=function(e){e?s(u(i,!1)):p()};a(l)?e.resolve(l).then(h,d):h(l)}catch(e){d(e)}}}catch(e){c(e)}}),c)}catch(e){c(e)}};p()}))}));n({target:"AsyncIterator",proto:!0,real:!0,forced:d},{filter:function(e){return o(this),s(e),new p(l(this),{predicate:e})}})},3064:(e,t,r)=>{"use strict";var n=r(46518),i=r(36639).find;n({target:"AsyncIterator",proto:!0,real:!0},{find:function(e){return i(this,e)}})},32679:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(79306),o=r(28551),a=r(20034),l=r(1767),c=r(92059),u=r(62529),h=r(50133),d=r(20772),p=r(96395),f=c((function(e){var t=this,r=t.iterator,n=t.mapper;return new e((function(s,l){var c=function(e){t.done=!0,l(e)},p=function(e){d(r,c,e,c)},f=function(){try{e.resolve(o(i(t.next,r))).then((function(r){try{if(o(r).done)t.done=!0,s(u(void 0,!0));else{var i=r.value;try{var l=n(i,t.counter++),d=function(e){try{t.inner=h(e),m()}catch(e){p(e)}};a(l)?e.resolve(l).then(d,p):d(l)}catch(e){p(e)}}}catch(e){c(e)}}),c)}catch(e){c(e)}},m=function(){var r=t.inner;if(r)try{e.resolve(o(i(r.next,r.iterator))).then((function(e){try{o(e).done?(t.inner=null,f()):s(u(e.value,!1))}catch(e){p(e)}}),p)}catch(e){p(e)}else f()};m()}))}));n({target:"AsyncIterator",proto:!0,real:!0,forced:p},{flatMap:function(e){return o(this),s(e),new f(l(this),{mapper:e,inner:null})}})},9920:(e,t,r)=>{"use strict";var n=r(46518),i=r(36639).forEach;n({target:"AsyncIterator",proto:!0,real:!0},{forEach:function(e){return i(this,e)}})},46967:(e,t,r)=>{"use strict";var n=r(46518),i=r(48981),s=r(1625),o=r(50133),a=r(53982),l=r(44690);n({target:"AsyncIterator",stat:!0,forced:r(96395)},{from:function(e){var t=o("string"==typeof e?i(e):e);return s(a,t.iterator)?t.iterator:new l(t)}})},45182:(e,t,r)=>{"use strict";r(46518)({target:"AsyncIterator",proto:!0,real:!0,forced:!0},{indexed:r(87481)})},41393:(e,t,r)=>{"use strict";var n=r(46518),i=r(41750);n({target:"AsyncIterator",proto:!0,real:!0,forced:r(96395)},{map:i})},14905:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(79306),o=r(28551),a=r(20034),l=r(97751),c=r(1767),u=r(20772),h=l("Promise"),d=TypeError;n({target:"AsyncIterator",proto:!0,real:!0},{reduce:function(e){o(this),s(e);var t=c(this),r=t.iterator,n=t.next,l=arguments.length<2,p=l?void 0:arguments[1],f=0;return new h((function(t,s){var c=function(e){u(r,s,e,s)},m=function(){try{h.resolve(o(i(n,r))).then((function(r){try{if(o(r).done)l?s(new d("Reduce of empty iterator with no initial value")):t(p);else{var n=r.value;if(l)l=!1,p=n,m();else try{var i=e(p,n,f),u=function(e){p=e,m()};a(i)?h.resolve(i).then(u,c):u(i)}catch(e){c(e)}}f++}catch(e){s(e)}}),s)}catch(e){s(e)}};m()}))}})},8159:(e,t,r)=>{"use strict";var n=r(46518),i=r(36639).some;n({target:"AsyncIterator",proto:!0,real:!0},{some:function(e){return i(this,e)}})},39320:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(28551),o=r(1767),a=r(24149),l=r(99590),c=r(92059),u=r(62529),h=r(96395),d=c((function(e){var t,r=this,n=r.iterator;if(!r.remaining--){var o=u(void 0,!0);return r.done=!0,void 0!==(t=n.return)?e.resolve(i(t,n,void 0)).then((function(){return o})):o}return e.resolve(i(r.next,n)).then((function(e){return s(e).done?(r.done=!0,u(void 0,!0)):u(e.value,!1)})).then(null,(function(e){throw r.done=!0,e}))}));n({target:"AsyncIterator",proto:!0,real:!0,forced:h},{take:function(e){s(this);var t=l(a(+e));return new d(o(this),{remaining:t})}})},86994:(e,t,r)=>{"use strict";var n=r(46518),i=r(36639).toArray;n({target:"AsyncIterator",proto:!0,real:!0},{toArray:function(){return i(this,void 0,[])}})},24964:(e,t,r)=>{"use strict";var n=r(46518),i=r(14468);"function"==typeof BigInt&&n({target:"BigInt",stat:!0,forced:!0},{range:function(e,t,r){return new i(e,t,r,"bigint",BigInt(0),BigInt(1))}})},7467:(e,t,r)=>{"use strict";var n=r(46518),i=r(18745),s=r(59323),o=r(97751),a=r(2360),l=Object,c=function(){var e=o("Object","freeze");return e?e(a(null)):a(null)};n({global:!0,forced:!0},{compositeKey:function(){return i(s,l,arguments).get("object",c)}})},10586:(e,t,r)=>{"use strict";var n=r(46518),i=r(59323),s=r(97751),o=r(18745);n({global:!0,forced:!0},{compositeSymbol:function(){return 1===arguments.length&&"string"==typeof arguments[0]?s("Symbol").for(arguments[0]):o(i,null,arguments).get("symbol",s("Symbol"))}})},47390:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(88490).unpack,o=i(DataView.prototype.getUint16);n({target:"DataView",proto:!0},{getFloat16:function(e){var t=o(this,e,arguments.length>1&&arguments[1]);return s([255&t,t>>8&255],10)}})},81332:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504)(DataView.prototype.getUint8);n({target:"DataView",proto:!0,forced:!0},{getUint8Clamped:function(e){return i(this,e)}})},9730:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(24194),o=r(57696),a=r(88490).pack,l=r(62724),c=i(DataView.prototype.setUint16);n({target:"DataView",proto:!0},{setFloat16:function(e,t){s(this);var r=o(e),n=a(l(t),10,2);return c(this,r,n[1]<<8|n[0],arguments.length>2&&arguments[2])}})},56192:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(24194),o=r(57696),a=r(58319),l=i(DataView.prototype.setUint8);n({target:"DataView",proto:!0,forced:!0},{setUint8Clamped:function(e,t){s(this);var r=o(e);return l(this,r,a(t))}})},66557:(e,t,r)=>{"use strict";var n=r(46518),i=r(43724),s=r(97751),o=r(79306),a=r(90679),l=r(36840),c=r(56279),u=r(62106),h=r(78227),d=r(91181),p=r(91021),f=s("SuppressedError"),m=ReferenceError,g=h("dispose"),A=h("toStringTag"),y="DisposableStack",v=d.set,x=d.getterFor(y),_="sync-dispose",b="disposed",w=function(e){var t=x(e);if(t.state===b)throw new m(y+" already disposed");return t},E=function(){v(a(this,M),{type:y,state:"pending",stack:[]}),i||(this.disposed=!1)},M=E.prototype;c(M,{dispose:function(){var e=x(this);if(e.state!==b){e.state=b,i||(this.disposed=!0);for(var t,r=e.stack,n=r.length,s=!1;n;){var o=r[--n];r[n]=null;try{o()}catch(e){s?t=new f(e,t):(s=!0,t=e)}}if(e.stack=null,s)throw t}},use:function(e){return p(w(this),e,_),e},adopt:function(e,t){var r=w(this);return o(t),p(r,void 0,_,(function(){t(e)})),e},defer:function(e){var t=w(this);o(e),p(t,void 0,_,e)},move:function(){var e=w(this),t=new E;return x(t).stack=e.stack,e.stack=[],e.state=b,i||(this.disposed=!0),t}}),i&&u(M,"disposed",{configurable:!0,get:function(){return x(this).state===b}}),l(M,g,M.dispose,{name:"dispose"}),l(M,A,y,{nonWritable:!0}),n({global:!0,constructor:!0},{DisposableStack:E})},83354:(e,t,r)=>{"use strict";r(46518)({target:"Function",proto:!0,forced:!0},{demethodize:r(12865)})},98225:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(94901),o=r(33706),a=r(39297),l=r(43724),c=Object.getOwnPropertyDescriptor,u=/^\s*class\b/,h=i(u.exec);n({target:"Function",stat:!0,sham:!0,forced:!0},{isCallable:function(e){return s(e)&&!function(e){try{if(!l||!h(u,o(e)))return!1}catch(e){}var t=c(e,"prototype");return!!t&&a(t,"writable")&&!t.writable}(e)}})},37998:(e,t,r)=>{"use strict";r(46518)({target:"Function",stat:!0,forced:!0},{isConstructor:r(33517)})},16401:(e,t,r)=>{"use strict";var n=r(78227),i=r(24913).f,s=n("metadata"),o=Function.prototype;void 0===o[s]&&i(o,s,{value:null})},18640:(e,t,r)=>{"use strict";r(46518)({target:"Function",proto:!0,forced:!0,name:"demethodize"},{unThis:r(12865)})},62480:(e,t,r)=>{"use strict";r(55081)},51098:(e,t,r)=>{"use strict";r(46518)({target:"Iterator",name:"indexed",proto:!0,real:!0,forced:!0},{asIndexedPairs:r(47958)})},98992:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(90679),o=r(28551),a=r(94901),l=r(42787),c=r(62106),u=r(97040),h=r(79039),d=r(39297),p=r(78227),f=r(57657).IteratorPrototype,m=r(43724),g=r(96395),A="constructor",y="Iterator",v=p("toStringTag"),x=TypeError,_=i[y],b=g||!a(_)||_.prototype!==f||!h((function(){_({})})),w=function(){if(s(this,f),l(this)===f)throw new x("Abstract class Iterator not directly constructable")},E=function(e,t){m?c(f,e,{configurable:!0,get:function(){return t},set:function(t){if(o(this),this===f)throw new x("You can't redefine this property");d(this,e)?this[e]=t:u(this,e,t)}}):f[e]=t};d(f,v)||E(v,y),!b&&d(f,A)&&f[A]!==Object||E(A,w),w.prototype=f,n({global:!0,constructor:!0,forced:b},{Iterator:w})},16037:(e,t,r)=>{"use strict";var n=r(69565),i=r(36840),s=r(55966),o=r(39297),a=r(78227),l=r(57657).IteratorPrototype,c=a("dispose");o(l,c)||i(l,c,(function(){var e=s(this,"return");e&&n(e,this)}))},64743:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(28551),o=r(1767),a=r(24149),l=r(99590),c=r(19462),u=r(96395),h=c((function(){for(var e,t=this.iterator,r=this.next;this.remaining;)if(this.remaining--,e=s(i(r,t)),this.done=!!e.done)return;if(e=s(i(r,t)),!(this.done=!!e.done))return e.value}));n({target:"Iterator",proto:!0,real:!0,forced:u},{drop:function(e){s(this);var t=l(a(+e));return new h(o(this),{remaining:t})}})},23215:(e,t,r)=>{"use strict";var n=r(46518),i=r(72652),s=r(79306),o=r(28551),a=r(1767);n({target:"Iterator",proto:!0,real:!0},{every:function(e){o(this),s(e);var t=a(this),r=0;return!i(t,(function(t,n){if(!e(t,r++))return n()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},54520:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(79306),o=r(28551),a=r(1767),l=r(19462),c=r(96319),u=r(96395),h=l((function(){for(var e,t,r=this.iterator,n=this.predicate,s=this.next;;){if(e=o(i(s,r)),this.done=!!e.done)return;if(t=e.value,c(r,n,[t,this.counter++],!0))return t}}));n({target:"Iterator",proto:!0,real:!0,forced:u},{filter:function(e){return o(this),s(e),new h(a(this),{predicate:e})}})},72577:(e,t,r)=>{"use strict";var n=r(46518),i=r(72652),s=r(79306),o=r(28551),a=r(1767);n({target:"Iterator",proto:!0,real:!0},{find:function(e){o(this),s(e);var t=a(this),r=0;return i(t,(function(t,n){if(e(t,r++))return n(t)}),{IS_RECORD:!0,INTERRUPTED:!0}).result}})},30670:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(79306),o=r(28551),a=r(1767),l=r(48646),c=r(19462),u=r(9539),h=r(96395),d=c((function(){for(var e,t,r=this.iterator,n=this.mapper;;){if(t=this.inner)try{if(!(e=o(i(t.next,t.iterator))).done)return e.value;this.inner=null}catch(e){u(r,"throw",e)}if(e=o(i(this.next,r)),this.done=!!e.done)return;try{this.inner=l(n(e.value,this.counter++),!1)}catch(e){u(r,"throw",e)}}}));n({target:"Iterator",proto:!0,real:!0,forced:h},{flatMap:function(e){return o(this),s(e),new d(a(this),{mapper:e,inner:null})}})},3949:(e,t,r)=>{"use strict";var n=r(46518),i=r(72652),s=r(79306),o=r(28551),a=r(1767);n({target:"Iterator",proto:!0,real:!0},{forEach:function(e){o(this),s(e);var t=a(this),r=0;i(t,(function(t){e(t,r++)}),{IS_RECORD:!0})}})},45882:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(48981),o=r(1625),a=r(57657).IteratorPrototype,l=r(19462),c=r(48646),u=r(96395),h=l((function(){return i(this.next,this.iterator)}),!0);n({target:"Iterator",stat:!0,forced:u},{from:function(e){var t=c("string"==typeof e?s(e):e,!0);return o(a,t.iterator)?t.iterator:new h(t)}})},76913:(e,t,r)=>{"use strict";r(46518)({target:"Iterator",proto:!0,real:!0,forced:!0},{indexed:r(47958)})},81454:(e,t,r)=>{"use strict";var n=r(46518),i=r(20713);n({target:"Iterator",proto:!0,real:!0,forced:r(96395)},{map:i})},75289:(e,t,r)=>{"use strict";var n=r(46518),i=r(14468),s=TypeError;n({target:"Iterator",stat:!0,forced:!0},{range:function(e,t,r){if("number"==typeof e)return new i(e,t,r,"number",0,1);if("bigint"==typeof e)return new i(e,t,r,"bigint",BigInt(0),BigInt(1));throw new s("Incorrect Iterator.range arguments")}})},8872:(e,t,r)=>{"use strict";var n=r(46518),i=r(72652),s=r(79306),o=r(28551),a=r(1767),l=TypeError;n({target:"Iterator",proto:!0,real:!0},{reduce:function(e){o(this),s(e);var t=a(this),r=arguments.length<2,n=r?void 0:arguments[1],c=0;if(i(t,(function(t){r?(r=!1,n=t):n=e(n,t,c),c++}),{IS_RECORD:!0}),r)throw new l("Reduce of empty iterator with no initial value");return n}})},37550:(e,t,r)=>{"use strict";var n=r(46518),i=r(72652),s=r(79306),o=r(28551),a=r(1767);n({target:"Iterator",proto:!0,real:!0},{some:function(e){o(this),s(e);var t=a(this),r=0;return i(t,(function(t,n){if(e(t,r++))return n()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},27413:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(28551),o=r(1767),a=r(24149),l=r(99590),c=r(19462),u=r(9539),h=r(96395),d=c((function(){var e=this.iterator;if(!this.remaining--)return this.done=!0,u(e,"normal",void 0);var t=s(i(this.next,e));return(this.done=!!t.done)?void 0:t.value}));n({target:"Iterator",proto:!0,real:!0,forced:h},{take:function(e){s(this);var t=l(a(+e));return new d(o(this),{remaining:t})}})},41795:(e,t,r)=>{"use strict";var n=r(46518),i=r(28551),s=r(72652),o=r(1767),a=[].push;n({target:"Iterator",proto:!0,real:!0},{toArray:function(){var e=[];return s(o(i(this)),a,{that:e,IS_RECORD:!0}),e}})},81730:(e,t,r)=>{"use strict";var n=r(46518),i=r(28551),s=r(24074),o=r(44690),a=r(1767);n({target:"Iterator",proto:!0,real:!0,forced:r(96395)},{toAsync:function(){return new o(a(new s(a(i(this)))))}})},67296:(e,t,r)=>{"use strict";r(46518)({target:"JSON",stat:!0,forced:!r(27819)},{isRawJSON:r(65810)})},58335:(e,t,r)=>{"use strict";var n=r(46518),i=r(43724),s=r(44576),o=r(97751),a=r(79504),l=r(69565),c=r(94901),u=r(20034),h=r(34376),d=r(39297),p=r(655),f=r(26198),m=r(97040),g=r(79039),A=r(616),y=r(4495),v=s.JSON,x=s.Number,_=s.SyntaxError,b=v&&v.parse,w=o("Object","keys"),E=Object.getOwnPropertyDescriptor,M=a("".charAt),S=a("".slice),C=a(/./.exec),T=a([].push),I=/^\d$/,R=/^[1-9]$/,B=/^[\d-]$/,P=/^[\t\n\r ]$/,L=function(e,t,r,n){var i,s,o,a,c,p=e[t],m=n&&p===n.value,g=m&&"string"==typeof n.source?{source:n.source}:{};if(u(p)){var A=h(p),y=m?n.nodes:A?[]:{};if(A)for(i=y.length,o=f(p),a=0;a{"use strict";var n=r(46518),i=r(92744),s=r(27819),o=r(97751),a=r(69565),l=r(79504),c=r(94901),u=r(65810),h=r(655),d=r(97040),p=r(616),f=r(66933),m=r(33392),g=r(91181).set,A=String,y=SyntaxError,v=o("JSON","parse"),x=o("JSON","stringify"),_=o("Object","create"),b=o("Object","freeze"),w=l("".charAt),E=l("".slice),M=l([].push),S=m(),C=S.length,T="Unacceptable as raw JSON",I=function(e){return" "===e||"\t"===e||"\n"===e||"\r"===e};n({target:"JSON",stat:!0,forced:!s},{rawJSON:function(e){var t=h(e);if(""===t||I(w(t,0))||I(w(t,t.length-1)))throw new y(T);var r=v(t);if("object"==typeof r&&null!==r)throw new y(T);var n=_(null);return g(n,{type:"RawJSON"}),d(n,"rawJSON",t),i?b(n):n}}),x&&n({target:"JSON",stat:!0,arity:3,forced:!s},{stringify:function(e,t,r){var n=f(t),i=[],s=x(e,(function(e,t){var r=c(n)?a(n,this,A(e),t):t;return u(r)?S+(M(i,r.rawJSON)-1):r}),r);if("string"!=typeof s)return s;for(var o="",l=s.length,h=0;h{"use strict";var n=r(46518),i=r(36194),s=r(72248).remove;n({target:"Map",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var e,t=i(this),r=!0,n=0,o=arguments.length;n{"use strict";var n=r(46518),i=r(36194),s=r(72248),o=s.get,a=s.has,l=s.set;n({target:"Map",proto:!0,real:!0,forced:!0},{emplace:function(e,t){var r,n,s=i(this);return a(s,e)?(r=o(s,e),"update"in t&&(r=t.update(r,e,s),l(s,e,r)),r):(n=t.insert(e,s),l(s,e,n),n)}})},93777:(e,t,r)=>{"use strict";var n=r(46518),i=r(76080),s=r(36194),o=r(26223);n({target:"Map",proto:!0,real:!0,forced:!0},{every:function(e){var t=s(this),r=i(e,arguments.length>1?arguments[1]:void 0);return!1!==o(t,(function(e,n){if(!r(e,n,t))return!1}),!0)}})},14190:(e,t,r)=>{"use strict";var n=r(46518),i=r(76080),s=r(36194),o=r(72248),a=r(26223),l=o.Map,c=o.set;n({target:"Map",proto:!0,real:!0,forced:!0},{filter:function(e){var t=s(this),r=i(e,arguments.length>1?arguments[1]:void 0),n=new l;return a(t,(function(e,i){r(e,i,t)&&c(n,i,e)})),n}})},86097:(e,t,r)=>{"use strict";var n=r(46518),i=r(76080),s=r(36194),o=r(26223);n({target:"Map",proto:!0,real:!0,forced:!0},{findKey:function(e){var t=s(this),r=i(e,arguments.length>1?arguments[1]:void 0),n=o(t,(function(e,n){if(r(e,n,t))return{key:n}}),!0);return n&&n.key}})},12359:(e,t,r)=>{"use strict";var n=r(46518),i=r(76080),s=r(36194),o=r(26223);n({target:"Map",proto:!0,real:!0,forced:!0},{find:function(e){var t=s(this),r=i(e,arguments.length>1?arguments[1]:void 0),n=o(t,(function(e,n){if(r(e,n,t))return{value:e}}),!0);return n&&n.value}})},39172:(e,t,r)=>{"use strict";var n=r(46518),i=r(72248);n({target:"Map",stat:!0,forced:!0},{from:r(70933)(i.Map,i.set,!0)})},57019:(e,t,r)=>{"use strict";r(47072)},17273:(e,t,r)=>{"use strict";var n=r(46518),i=r(33317),s=r(36194),o=r(26223);n({target:"Map",proto:!0,real:!0,forced:!0},{includes:function(e){return!0===o(s(this),(function(t){if(i(t,e))return!0}),!0)}})},81723:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(72652),o=r(94901),a=r(79306),l=r(72248).Map;n({target:"Map",stat:!0,forced:!0},{keyBy:function(e,t){var r=new(o(this)?this:l);a(t);var n=a(r.set);return s(e,(function(e){i(n,r,t(e),e)})),r}})},27415:(e,t,r)=>{"use strict";var n=r(46518),i=r(36194),s=r(26223);n({target:"Map",proto:!0,real:!0,forced:!0},{keyOf:function(e){var t=s(i(this),(function(t,r){if(t===e)return{key:r}}),!0);return t&&t.key}})},19929:(e,t,r)=>{"use strict";var n=r(46518),i=r(76080),s=r(36194),o=r(72248),a=r(26223),l=o.Map,c=o.set;n({target:"Map",proto:!0,real:!0,forced:!0},{mapKeys:function(e){var t=s(this),r=i(e,arguments.length>1?arguments[1]:void 0),n=new l;return a(t,(function(e,i){c(n,r(e,i,t),e)})),n}})},37583:(e,t,r)=>{"use strict";var n=r(46518),i=r(76080),s=r(36194),o=r(72248),a=r(26223),l=o.Map,c=o.set;n({target:"Map",proto:!0,real:!0,forced:!0},{mapValues:function(e){var t=s(this),r=i(e,arguments.length>1?arguments[1]:void 0),n=new l;return a(t,(function(e,i){c(n,i,r(e,i,t))})),n}})},55122:(e,t,r)=>{"use strict";var n=r(46518),i=r(36194),s=r(72652),o=r(72248).set;n({target:"Map",proto:!0,real:!0,arity:1,forced:!0},{merge:function(e){for(var t=i(this),r=arguments.length,n=0;n{"use strict";var n=r(46518),i=r(72248);n({target:"Map",stat:!0,forced:!0},{of:r(87500)(i.Map,i.set,!0)})},20230:(e,t,r)=>{"use strict";var n=r(46518),i=r(79306),s=r(36194),o=r(26223),a=TypeError;n({target:"Map",proto:!0,real:!0,forced:!0},{reduce:function(e){var t=s(this),r=arguments.length<2,n=r?void 0:arguments[1];if(i(e),o(t,(function(i,s){r?(r=!1,n=i):n=e(n,i,s,t)})),r)throw new a("Reduce of empty map with no initial value");return n}})},57268:(e,t,r)=>{"use strict";var n=r(46518),i=r(76080),s=r(36194),o=r(26223);n({target:"Map",proto:!0,real:!0,forced:!0},{some:function(e){var t=s(this),r=i(e,arguments.length>1?arguments[1]:void 0);return!0===o(t,(function(e,n){if(r(e,n,t))return!0}),!0)}})},19717:(e,t,r)=>{"use strict";r(46518)({target:"Map",proto:!0,real:!0,name:"upsert",forced:!0},{updateOrInsert:r(162)})},79733:(e,t,r)=>{"use strict";var n=r(46518),i=r(79306),s=r(36194),o=r(72248),a=TypeError,l=o.get,c=o.has,u=o.set;n({target:"Map",proto:!0,real:!0,forced:!0},{update:function(e,t){var r=s(this),n=arguments.length;i(t);var o=c(r,e);if(!o&&n<3)throw new a("Updating absent value");var h=o?l(r,e):i(n>2?arguments[2]:void 0)(e,r);return u(r,e,t(h,e,r)),r}})},52231:(e,t,r)=>{"use strict";r(46518)({target:"Map",proto:!0,real:!0,forced:!0},{upsert:r(162)})},58179:(e,t,r)=>{"use strict";var n=r(46518),i=Math.min,s=Math.max;n({target:"Math",stat:!0,forced:!0},{clamp:function(e,t,r){return i(r,s(t,e))}})},30456:(e,t,r)=>{"use strict";r(46518)({target:"Math",stat:!0,nonConfigurable:!0,nonWritable:!0},{DEG_PER_RAD:Math.PI/180})},74017:(e,t,r)=>{"use strict";var n=r(46518),i=180/Math.PI;n({target:"Math",stat:!0,forced:!0},{degrees:function(e){return e*i}})},16453:(e,t,r)=>{"use strict";r(46518)({target:"Math",stat:!0},{f16round:r(62724)})},79310:(e,t,r)=>{"use strict";var n=r(46518),i=r(77905),s=r(15617);n({target:"Math",stat:!0,forced:!0},{fscale:function(e,t,r,n,o){return s(i(e,t,r,n,o))}})},83062:(e,t,r)=>{"use strict";r(46518)({target:"Math",stat:!0,forced:!0},{iaddh:function(e,t,r,n){var i=e>>>0,s=r>>>0;return(t>>>0)+(n>>>0)+((i&s|(i|s)&~(i+s>>>0))>>>31)|0}})},96369:(e,t,r)=>{"use strict";r(46518)({target:"Math",stat:!0,forced:!0},{imulh:function(e,t){var r=65535,n=+e,i=+t,s=n&r,o=i&r,a=n>>16,l=i>>16,c=(a*o>>>0)+(s*o>>>16);return a*l+(c>>16)+((s*l>>>0)+(c&r)>>16)}})},15637:(e,t,r)=>{"use strict";r(46518)({target:"Math",stat:!0,forced:!0},{isubh:function(e,t,r,n){var i=e>>>0,s=r>>>0;return(t>>>0)-(n>>>0)-((~i&s|(i^~s)&i-s>>>0)>>>31)|0}})},2848:(e,t,r)=>{"use strict";r(46518)({target:"Math",stat:!0,nonConfigurable:!0,nonWritable:!0},{RAD_PER_DEG:180/Math.PI})},24842:(e,t,r)=>{"use strict";var n=r(46518),i=Math.PI/180;n({target:"Math",stat:!0,forced:!0},{radians:function(e){return e*i}})},24746:(e,t,r)=>{"use strict";r(46518)({target:"Math",stat:!0,forced:!0},{scale:r(77905)})},33454:(e,t,r)=>{"use strict";var n=r(46518),i=r(28551),s=r(50360),o=r(33994),a=r(62529),l=r(91181),c="Seeded Random",u=c+" Generator",h=l.set,d=l.getterFor(u),p=TypeError,f=o((function(e){h(this,{type:u,seed:e%2147483647})}),c,(function(){var e=d(this),t=e.seed=(1103515245*e.seed+12345)%2147483647;return a((1073741823&t)/1073741823,!1)}));n({target:"Math",stat:!0,forced:!0},{seededPRNG:function(e){var t=i(e).seed;if(!s(t))throw new p('Math.seededPRNG() argument should have a "seed" field with a finite value.');return new f(t)}})},6660:(e,t,r)=>{"use strict";r(46518)({target:"Math",stat:!0,forced:!0},{signbit:function(e){var t=+e;return t==t&&0===t?1/t==-1/0:t<0}})},4235:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(72652),o=RangeError,a=TypeError,l=1/0,c=Math.abs,u=Math.pow,h=i([].push),d=u(2,1023),p=u(2,53)-1,f=Number.MAX_VALUE,m=u(2,971),g={},A={},y={},v={},x={},_=function(e,t){var r=e+t;return{hi:r,lo:t-(r-e)}};n({target:"Math",stat:!0,forced:!0},{sumPrecise:function(e){var t=[],r=0,n=v;switch(s(e,(function(e){if(++r>=p)throw new o("Maximum allowed index exceeded");if("number"!=typeof e)throw new a("Value is not a number");n!==g&&(e!=e?n=g:e===l?n=n===A?g:y:e===-1/0?n=n===y?g:A:0===e&&1/e!==l||n!==v&&n!==x||(n=x,h(t,e)))})),n){case g:return NaN;case A:return-1/0;case y:return l;case v:return-0}for(var i,u,b,w,E,M,S=[],C=0,T=0;T=0?S[P]:0;if(P--,c(C)>1||C>0&&L>0||C<0&&L<0)return C>0?l:-1/0;if(w=(b=_(C*d,L/2)).hi,E=b.lo,E*=2,c(2*w)===l)return w>0?w===d&&E===-m/2&&P>=0&&S[P]<0?f:l:w===-d&&E===m/2&&P>=0&&S[P]>0?-f:-1/0;0!==E&&(S[++P]=E,E=0),w*=2}for(;P>=0&&(w=(b=_(w,S[P--])).hi,0===(E=b.lo)););return P>=0&&(E<0&&S[P]<0||E>0&&S[P]>0)&&(u=2*E)==(i=w+u)-w&&(w=i),w}})},15941:(e,t,r)=>{"use strict";r(46518)({target:"Math",stat:!0,forced:!0},{umulh:function(e,t){var r=65535,n=+e,i=+t,s=n&r,o=i&r,a=n>>>16,l=i>>>16,c=(a*o>>>0)+(s*o>>>16);return a*l+(c>>>16)+((s*l>>>0)+(c&r)>>>16)}})},82101:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(91291),o="Invalid number representation",a=RangeError,l=SyntaxError,c=TypeError,u=parseInt,h=Math.pow,d=/^[\d.a-z]+$/,p=i("".charAt),f=i(d.exec),m=i(1..toString),g=i("".slice),A=i("".split);n({target:"Number",stat:!0,forced:!0},{fromString:function(e,t){var r=1;if("string"!=typeof e)throw new c(o);if(!e.length)throw new l(o);if("-"===p(e,0)&&(r=-1,!(e=g(e,1)).length))throw new l(o);var n=void 0===t?10:s(t);if(n<2||n>36)throw new a("Invalid radix");if(!f(d,e))throw new l(o);var i=A(e,"."),y=u(i[0],n);if(i.length>1&&(y+=u(i[1],n)/h(n,i[1].length)),10===n&&m(y,n)!==e)throw new l(o);return r*y}})},79926:(e,t,r)=>{"use strict";var n=r(46518),i=r(14468);n({target:"Number",stat:!0,forced:!0},{range:function(e,t,r){return new i(e,t,r,"number",0,1)}})},66090:(e,t,r)=>{"use strict";r(77691)},84208:(e,t,r)=>{"use strict";r(78347)},91550:(e,t,r)=>{"use strict";var n=r(46518),i=r(91354);n({target:"Object",stat:!0,forced:!0},{iterateEntries:function(e){return new i(e,"entries")}})},9156:(e,t,r)=>{"use strict";var n=r(46518),i=r(91354);n({target:"Object",stat:!0,forced:!0},{iterateKeys:function(e){return new i(e,"keys")}})},48918:(e,t,r)=>{"use strict";var n=r(46518),i=r(91354);n({target:"Object",stat:!0,forced:!0},{iterateValues:function(e){return new i(e,"values")}})},15239:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(43724),o=r(87633),a=r(79306),l=r(28551),c=r(90679),u=r(94901),h=r(64117),d=r(20034),p=r(55966),f=r(36840),m=r(56279),g=r(62106),A=r(90757),y=r(78227),v=r(91181),x=y("observable"),_="Observable",b="Subscription",w="SubscriptionObserver",E=v.getterFor,M=v.set,S=E(_),C=E(b),T=E(w),I=function(e){this.observer=l(e),this.cleanup=null,this.subscriptionObserver=null};I.prototype={type:b,clean:function(){var e=this.cleanup;if(e){this.cleanup=null;try{e()}catch(e){A(e)}}},close:function(){if(!s){var e=this.facade,t=this.subscriptionObserver;e.closed=!0,t&&(t.closed=!0)}this.observer=null},isClosed:function(){return null===this.observer}};var R=function(e,t){var r,n=M(this,new I(e));s||(this.closed=!1);try{(r=p(e,"start"))&&i(r,e,this)}catch(e){A(e)}if(!n.isClosed()){var o=n.subscriptionObserver=new B(n);try{var l=t(o),c=l;h(l)||(n.cleanup=u(l.unsubscribe)?function(){c.unsubscribe()}:a(l))}catch(e){return void o.error(e)}n.isClosed()&&n.clean()}};R.prototype=m({},{unsubscribe:function(){var e=C(this);e.isClosed()||(e.close(),e.clean())}}),s&&g(R.prototype,"closed",{configurable:!0,get:function(){return C(this).isClosed()}});var B=function(e){M(this,{type:w,subscriptionState:e}),s||(this.closed=!1)};B.prototype=m({},{next:function(e){var t=T(this).subscriptionState;if(!t.isClosed()){var r=t.observer;try{var n=p(r,"next");n&&i(n,r,e)}catch(e){A(e)}}},error:function(e){var t=T(this).subscriptionState;if(!t.isClosed()){var r=t.observer;t.close();try{var n=p(r,"error");n?i(n,r,e):A(e)}catch(e){A(e)}t.clean()}},complete:function(){var e=T(this).subscriptionState;if(!e.isClosed()){var t=e.observer;e.close();try{var r=p(t,"complete");r&&i(r,t)}catch(e){A(e)}e.clean()}}}),s&&g(B.prototype,"closed",{configurable:!0,get:function(){return T(this).subscriptionState.isClosed()}});var P=function(e){c(this,L),M(this,{type:_,subscriber:a(e)})},L=P.prototype;m(L,{subscribe:function(e){var t=arguments.length;return new R(u(e)?{next:e,error:t>1?arguments[1]:void 0,complete:t>2?arguments[2]:void 0}:d(e)?e:{},S(this).subscriber)}}),f(L,x,(function(){return this})),n({global:!0,constructor:!0,forced:!0},{Observable:P}),o(_)},9035:(e,t,r)=>{"use strict";var n=r(46518),i=r(97751),s=r(69565),o=r(28551),a=r(33517),l=r(70081),c=r(55966),u=r(72652),h=r(78227)("observable");n({target:"Observable",stat:!0,forced:!0},{from:function(e){var t=a(this)?this:i("Observable"),r=c(o(e),h);if(r){var n=o(s(r,e));return n.constructor===t?n:new t((function(e){return n.subscribe(e)}))}var d=l(e);return new t((function(e){u(d,(function(t,r){if(e.next(t),e.closed)return r()}),{IS_ITERATOR:!0,INTERRUPTED:!0}),e.complete()}))}})},2917:(e,t,r)=>{"use strict";r(15239),r(9035),r(78662)},78662:(e,t,r)=>{"use strict";var n=r(46518),i=r(97751),s=r(33517),o=i("Array");n({target:"Observable",stat:!0,forced:!0},{of:function(){for(var e=s(this)?this:i("Observable"),t=arguments.length,r=o(t),n=0;n{"use strict";r(96167)},47575:(e,t,r)=>{"use strict";r(93518)},47628:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(18745),o=r(67680),a=r(36043),l=r(79306),c=r(1103),u=i.Promise,h=!1;n({target:"Promise",stat:!0,forced:!u||!u.try||c((function(){u.try((function(e){h=8===e}),8)})).error||!h},{try:function(e){var t=arguments.length>1?o(arguments,1):[],r=a.f(this),n=c((function(){return s(l(e),void 0,t)}));return(n.error?r.reject:r.resolve)(n.value),r.promise}})},43799:(e,t,r)=>{"use strict";r(14628)},65186:(e,t,r)=>{"use strict";var n=r(46518),i=r(18449),s=r(28551),o=i.toKey,a=i.set;n({target:"Reflect",stat:!0},{defineMetadata:function(e,t,r){var n=arguments.length<4?void 0:o(arguments[3]);a(e,t,s(r),n)}})},42978:(e,t,r)=>{"use strict";var n=r(46518),i=r(18449),s=r(28551),o=i.toKey,a=i.getMap,l=i.store;n({target:"Reflect",stat:!0},{deleteMetadata:function(e,t){var r=arguments.length<3?void 0:o(arguments[2]),n=a(s(t),r,!1);if(void 0===n||!n.delete(e))return!1;if(n.size)return!0;var i=l.get(t);return i.delete(r),!!i.size||l.delete(t)}})},79852:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(18449),o=r(28551),a=r(42787),l=i(r(79565)),c=i([].concat),u=s.keys,h=s.toKey,d=function(e,t){var r=u(e,t),n=a(e);if(null===n)return r;var i=d(n,t);return i.length?r.length?l(c(r,i)):i:r};n({target:"Reflect",stat:!0},{getMetadataKeys:function(e){var t=arguments.length<2?void 0:h(arguments[1]);return d(o(e),t)}})},72527:(e,t,r)=>{"use strict";var n=r(46518),i=r(18449),s=r(28551),o=r(42787),a=i.has,l=i.get,c=i.toKey,u=function(e,t,r){if(a(e,t,r))return l(e,t,r);var n=o(t);return null!==n?u(e,n,r):void 0};n({target:"Reflect",stat:!0},{getMetadata:function(e,t){var r=arguments.length<3?void 0:c(arguments[2]);return u(e,s(t),r)}})},40617:(e,t,r)=>{"use strict";var n=r(46518),i=r(18449),s=r(28551),o=i.keys,a=i.toKey;n({target:"Reflect",stat:!0},{getOwnMetadataKeys:function(e){var t=arguments.length<2?void 0:a(arguments[1]);return o(s(e),t)}})},42376:(e,t,r)=>{"use strict";var n=r(46518),i=r(18449),s=r(28551),o=i.get,a=i.toKey;n({target:"Reflect",stat:!0},{getOwnMetadata:function(e,t){var r=arguments.length<3?void 0:a(arguments[2]);return o(e,s(t),r)}})},73067:(e,t,r)=>{"use strict";var n=r(46518),i=r(18449),s=r(28551),o=r(42787),a=i.has,l=i.toKey,c=function(e,t,r){if(a(e,t,r))return!0;var n=o(t);return null!==n&&c(e,n,r)};n({target:"Reflect",stat:!0},{hasMetadata:function(e,t){var r=arguments.length<3?void 0:l(arguments[2]);return c(e,s(t),r)}})},66820:(e,t,r)=>{"use strict";var n=r(46518),i=r(18449),s=r(28551),o=i.has,a=i.toKey;n({target:"Reflect",stat:!0},{hasOwnMetadata:function(e,t){var r=arguments.length<3?void 0:a(arguments[2]);return o(e,s(t),r)}})},8288:(e,t,r)=>{"use strict";var n=r(46518),i=r(18449),s=r(28551),o=i.toKey,a=i.set;n({target:"Reflect",stat:!0},{metadata:function(e,t){return function(r,n){a(e,t,s(r),o(n))}}})},37108:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(63463),o=r(39297),a=r(60533).start,l=r(47452),c=Array,u=RegExp.escape,h=i("".charAt),d=i("".charCodeAt),p=i(1.1.toString),f=i([].join),m=/^[0-9a-z]/i,g=/^[$()*+./?[\\\]^{|}]/,A=RegExp("^[!\"#%&',\\-:;<=>@`~"+l+"]"),y=i(m.exec),v={"\t":"t","\n":"n","\v":"v","\f":"f","\r":"r"},x=function(e){var t=p(d(e,0),16);return t.length<3?"\\x"+a(t,2,"0"):"\\u"+a(t,4,"0")};n({target:"RegExp",stat:!0,forced:!u||"\\x61b"!==u("ab")},{escape:function(e){s(e);for(var t=e.length,r=c(t),n=0;n=56320||n+1>=t||56320!=(64512&d(e,n+1))?r[n]=x(i):(r[n]=i,r[++n]=h(e,n))}}return f(r,"")}})},25509:(e,t,r)=>{"use strict";var n=r(46518),i=r(97080),s=r(94402).add;n({target:"Set",proto:!0,real:!0,forced:!0},{addAll:function(){for(var e=i(this),t=0,r=arguments.length;t{"use strict";var n=r(46518),i=r(97080),s=r(94402).remove;n({target:"Set",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var e,t=i(this),r=!0,n=0,o=arguments.length;n{"use strict";var n=r(46518),i=r(69565),s=r(47650),o=r(83440);n({target:"Set",proto:!0,real:!0,forced:!0},{difference:function(e){return i(o,this,s(e))}})},43375:(e,t,r)=>{"use strict";r(17642)},41927:(e,t,r)=>{"use strict";var n=r(46518),i=r(76080),s=r(97080),o=r(38469);n({target:"Set",proto:!0,real:!0,forced:!0},{every:function(e){var t=s(this),r=i(e,arguments.length>1?arguments[1]:void 0);return!1!==o(t,(function(e){if(!r(e,e,t))return!1}),!0)}})},11632:(e,t,r)=>{"use strict";var n=r(46518),i=r(76080),s=r(97080),o=r(94402),a=r(38469),l=o.Set,c=o.add;n({target:"Set",proto:!0,real:!0,forced:!0},{filter:function(e){var t=s(this),r=i(e,arguments.length>1?arguments[1]:void 0),n=new l;return a(t,(function(e){r(e,e,t)&&c(n,e)})),n}})},64377:(e,t,r)=>{"use strict";var n=r(46518),i=r(76080),s=r(97080),o=r(38469);n({target:"Set",proto:!0,real:!0,forced:!0},{find:function(e){var t=s(this),r=i(e,arguments.length>1?arguments[1]:void 0),n=o(t,(function(e){if(r(e,e,t))return{value:e}}),!0);return n&&n.value}})},49522:(e,t,r)=>{"use strict";var n=r(46518),i=r(94402);n({target:"Set",stat:!0,forced:!0},{from:r(70933)(i.Set,i.add,!1)})},66771:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(47650),o=r(68750);n({target:"Set",proto:!0,real:!0,forced:!0},{intersection:function(e){return i(o,this,s(e))}})},39225:(e,t,r)=>{"use strict";r(58004)},12516:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(47650),o=r(64449);n({target:"Set",proto:!0,real:!0,forced:!0},{isDisjointFrom:function(e){return i(o,this,s(e))}})},13972:(e,t,r)=>{"use strict";r(33853)},68931:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(47650),o=r(53838);n({target:"Set",proto:!0,real:!0,forced:!0},{isSubsetOf:function(e){return i(o,this,s(e))}})},99209:(e,t,r)=>{"use strict";r(45876)},52514:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(47650),o=r(28527);n({target:"Set",proto:!0,real:!0,forced:!0},{isSupersetOf:function(e){return i(o,this,s(e))}})},25714:(e,t,r)=>{"use strict";r(32475)},35694:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(97080),o=r(38469),a=r(655),l=i([].join),c=i([].push);n({target:"Set",proto:!0,real:!0,forced:!0},{join:function(e){var t=s(this),r=void 0===e?",":a(e),n=[];return o(t,(function(e){c(n,e)})),l(n,r)}})},52774:(e,t,r)=>{"use strict";var n=r(46518),i=r(76080),s=r(97080),o=r(94402),a=r(38469),l=o.Set,c=o.add;n({target:"Set",proto:!0,real:!0,forced:!0},{map:function(e){var t=s(this),r=i(e,arguments.length>1?arguments[1]:void 0),n=new l;return a(t,(function(e){c(n,r(e,e,t))})),n}})},23283:(e,t,r)=>{"use strict";var n=r(46518),i=r(94402);n({target:"Set",stat:!0,forced:!0},{of:r(87500)(i.Set,i.add,!1)})},49536:(e,t,r)=>{"use strict";var n=r(46518),i=r(79306),s=r(97080),o=r(38469),a=TypeError;n({target:"Set",proto:!0,real:!0,forced:!0},{reduce:function(e){var t=s(this),r=arguments.length<2,n=r?void 0:arguments[1];if(i(e),o(t,(function(i){r?(r=!1,n=i):n=e(n,i,i,t)})),r)throw new a("Reduce of empty set with no initial value");return n}})},21926:(e,t,r)=>{"use strict";var n=r(46518),i=r(76080),s=r(97080),o=r(38469);n({target:"Set",proto:!0,real:!0,forced:!0},{some:function(e){var t=s(this),r=i(e,arguments.length>1?arguments[1]:void 0);return!0===o(t,(function(e){if(r(e,e,t))return!0}),!0)}})},16864:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(47650),o=r(83650);n({target:"Set",proto:!0,real:!0,forced:!0},{symmetricDifference:function(e){return i(o,this,s(e))}})},17561:(e,t,r)=>{"use strict";r(15024)},16215:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(47650),o=r(44204);n({target:"Set",proto:!0,real:!0,forced:!0},{union:function(e){return i(o,this,s(e))}})},66197:(e,t,r)=>{"use strict";r(31698)},78898:(e,t,r)=>{"use strict";var n=r(46518),i=r(68183).charAt,s=r(67750),o=r(91291),a=r(655);n({target:"String",proto:!0,forced:!0},{at:function(e){var t=a(s(this)),r=t.length,n=o(e),l=n>=0?n:r+n;return l<0||l>=r?void 0:i(t,l)}})},74176:(e,t,r)=>{"use strict";var n=r(46518),i=r(33994),s=r(62529),o=r(67750),a=r(655),l=r(91181),c=r(68183),u=c.codeAt,h=c.charAt,d="String Iterator",p=l.set,f=l.getterFor(d),m=i((function(e){p(this,{type:d,string:e,index:0})}),"String",(function(){var e,t=f(this),r=t.string,n=t.index;return n>=r.length?s(void 0,!0):(e=h(r,n),t.index+=e.length,s({codePoint:u(e,0),position:n},!1))}));n({target:"String",proto:!0,forced:!0},{codePoints:function(){return new m(a(o(this)))}})},84114:(e,t,r)=>{"use strict";r(46518)({target:"String",stat:!0,forced:!0},{cooked:r(74615)})},66337:(e,t,r)=>{"use strict";var n=r(92744),i=r(46518),s=r(50283),o=r(79504),a=r(18745),l=r(28551),c=r(48981),u=r(94901),h=r(26198),d=r(24913).f,p=r(67680),f=r(44995),m=r(74615),g=r(58523),A=r(47452),y=new f.WeakMap,v=f.get,x=f.has,_=f.set,b=Array,w=TypeError,E=Object.freeze||Object,M=Object.isFrozen,S=Math.min,C=o("".charAt),T=o("".slice),I=o("".split),R=o(/./.exec),B=/([\n\u2028\u2029]|\r\n?)/g,P=RegExp("^["+A+"]*"),L=RegExp("[^"+A+"]"),D="Invalid tag",O=function(e,t){if(void 0===t||e===t)return e;for(var r=0,n=S(e.length,t.length);r0)throw new w("Invalid opening line");t[1]=""}if(p){if(1===t.length||R(L,t[t.length-1]))throw new w("Invalid closing line");t[t.length-2]="",t[t.length-1]=""}for(var f=2;f{"use strict";r(42043)},38344:(e,t,r)=>{"use strict";r(28543)},12041:(e,t,r)=>{"use strict";r(79978)},51755:(e,t,r)=>{"use strict";r(67438)},39687:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(1625),o=r(42787),a=r(52967),l=r(77740),c=r(2360),u=r(66699),h=r(6980),d=r(80747),p=r(32603),f=r(78227),m=r(79039),g=r(96395),A=i.SuppressedError,y=f("toStringTag"),v=Error,x=!!A&&3!==A.length,_=!!A&&m((function(){return 4===new A(1,2,3,{cause:4}).cause})),b=x||_,w=function(e,t,r){var n,i=s(E,this);return a?n=!b||i&&o(this)!==E?a(new v,i?o(this):E):new A:(n=i?this:c(E),u(n,y,"Error")),void 0!==r&&u(n,"message",p(r)),d(n,w,n.stack,1),u(n,"error",e),u(n,"suppressed",t),n};a?a(w,v):l(w,v,{name:!0});var E=w.prototype=b?A.prototype:c(v.prototype,{constructor:h(1,w),message:h(1,""),name:h(1,"SuppressedError")});b&&!g&&(E.constructor=w),n({global:!0,constructor:!0,arity:3,forced:b},{SuppressedError:w})},81202:(e,t,r)=>{"use strict";var n=r(44576),i=r(70511),s=r(24913).f,o=r(77347).f,a=n.Symbol;if(i("asyncDispose"),a){var l=o(a,"asyncDispose");l.enumerable&&l.configurable&&l.writable&&s(a,"asyncDispose",{value:l.value,enumerable:!1,configurable:!1,writable:!1})}},49604:(e,t,r)=>{"use strict";r(70511)("customMatcher")},43275:(e,t,r)=>{"use strict";var n=r(44576),i=r(70511),s=r(24913).f,o=r(77347).f,a=n.Symbol;if(i("dispose"),a){var l=o(a,"dispose");l.enumerable&&l.configurable&&l.writable&&s(a,"dispose",{value:l.value,enumerable:!1,configurable:!1,writable:!1})}},13070:(e,t,r)=>{"use strict";r(46518)({target:"Symbol",stat:!0},{isRegisteredSymbol:r(12586)})},87153:(e,t,r)=>{"use strict";r(46518)({target:"Symbol",stat:!0,name:"isRegisteredSymbol"},{isRegistered:r(12586)})},53032:(e,t,r)=>{"use strict";r(46518)({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:r(52104)})},53803:(e,t,r)=>{"use strict";r(46518)({target:"Symbol",stat:!0,name:"isWellKnownSymbol",forced:!0},{isWellKnown:r(52104)})},13976:(e,t,r)=>{"use strict";r(70511)("matcher")},18999:(e,t,r)=>{"use strict";r(70511)("metadataKey")},30465:(e,t,r)=>{"use strict";r(70511)("metadata")},42793:(e,t,r)=>{"use strict";r(70511)("observable")},77208:(e,t,r)=>{"use strict";r(70511)("patternMatch")},73440:(e,t,r)=>{"use strict";r(70511)("replaceAll")},51839:(e,t,r)=>{"use strict";r(48140)},14037:(e,t,r)=>{"use strict";var n=r(94644),i=r(59213).filterReject,s=r(26357),o=n.aTypedArray;(0,n.exportTypedArrayMethod)("filterOut",(function(e){var t=i(o(this),e,arguments.length>1?arguments[1]:void 0);return s(this,t)}),!0)},47350:(e,t,r)=>{"use strict";var n=r(94644),i=r(59213).filterReject,s=r(26357),o=n.aTypedArray;(0,n.exportTypedArrayMethod)("filterReject",(function(e){var t=i(o(this),e,arguments.length>1?arguments[1]:void 0);return s(this,t)}),!0)},96847:(e,t,r)=>{"use strict";r(91134)},91706:(e,t,r)=>{"use strict";r(21903)},13195:(e,t,r)=>{"use strict";var n=r(97751),i=r(35548),s=r(8045),o=r(94644),a=r(35370),l=o.aTypedArrayConstructor;(0,o.exportTypedArrayStaticMethod)("fromAsync",(function(e){var t=this,r=arguments.length,o=r>1?arguments[1]:void 0,c=r>2?arguments[2]:void 0;return new(n("Promise"))((function(r){i(t),r(s(e,o,c))})).then((function(e){return a(l(t),e)}))}),!0)},23241:(e,t,r)=>{"use strict";var n=r(94644),i=r(77957),s=r(61412),o=n.aTypedArray;(0,n.exportTypedArrayMethod)("groupBy",(function(e){var t=arguments.length>1?arguments[1]:void 0;return i(o(this),e,t,s)}),!0)},43250:(e,t,r)=>{"use strict";r(37467)},10149:(e,t,r)=>{"use strict";r(44732)},67302:(e,t,r)=>{"use strict";var n=r(94644),i=r(26198),s=r(18727),o=r(35610),a=r(75854),l=r(91291),c=r(79039),u=n.aTypedArray,h=n.getTypedArrayConstructor,d=n.exportTypedArrayMethod,p=Math.max,f=Math.min;d("toSpliced",(function(e,t){var r,n,c,d,m,g,A,y=u(this),v=h(y),x=i(y),_=o(e,x),b=arguments.length,w=0;if(0===b)r=n=0;else if(1===b)r=0,n=x-_;else if(n=f(p(l(t),0),x-_),r=b-2){d=new v(r),c=s(d);for(var E=2;E{"use strict";var n=r(79504),i=r(94644),s=r(35370),o=r(79565),a=i.aTypedArray,l=i.getTypedArrayConstructor,c=i.exportTypedArrayMethod,u=n(o);c("uniqueBy",(function(e){return a(this),s(l(this),u(this,e))}),!0)},24082:(e,t,r)=>{"use strict";r(79577)},57051:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(35370),o=r(59143),a=i.Uint8Array;a&&n({target:"Uint8Array",stat:!0},{fromBase64:function(e){var t=o(e,arguments.length>1?arguments[1]:void 0,null,9007199254740991);return s(a,t.bytes)}})},27650:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(63463),o=r(42303);i.Uint8Array&&n({target:"Uint8Array",stat:!0},{fromHex:function(e){return o(s(e)).bytes}})},41549:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(59143),o=r(34154);i.Uint8Array&&n({target:"Uint8Array",proto:!0},{setFromBase64:function(e){o(this);var t=s(e,arguments.length>1?arguments[1]:void 0,this,this.length);return{read:t.read,written:t.written}}})},49797:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(63463),o=r(34154),a=r(55169),l=r(42303);i.Uint8Array&&n({target:"Uint8Array",proto:!0},{setFromHex:function(e){o(this),s(e),a(this.buffer);var t=l(e,this).read;return{read:t,written:t/2}}})},49631:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(79504),o=r(83972),a=r(34154),l=r(55169),c=r(92804),u=r(944),h=c.i2c,d=c.i2cUrl,p=s("".charAt);i.Uint8Array&&n({target:"Uint8Array",proto:!0},{toBase64:function(){var e=a(this),t=arguments.length?o(arguments[0]):void 0,r="base64"===u(t)?h:d,n=!!t&&!!t.omitPadding;l(this.buffer);for(var i,s="",c=0,f=e.length,m=function(e){return p(r,i>>6*e&63)};c+2{"use strict";var n=r(46518),i=r(44576),s=r(79504),o=r(34154),a=r(55169),l=s(1..toString);i.Uint8Array&&n({target:"Uint8Array",proto:!0},{toHex:function(){o(this),a(this.buffer);for(var e="",t=0,r=this.length;t{"use strict";var n=r(46518),i=r(76557),s=r(44995).remove;n({target:"WeakMap",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var e,t=i(this),r=!0,n=0,o=arguments.length;n{"use strict";var n=r(46518),i=r(76557),s=r(44995),o=s.get,a=s.has,l=s.set;n({target:"WeakMap",proto:!0,real:!0,forced:!0},{emplace:function(e,t){var r,n,s=i(this);return a(s,e)?(r=o(s,e),"update"in t&&(r=t.update(r,e,s),l(s,e,r)),r):(n=t.insert(e,s),l(s,e,n),n)}})},26957:(e,t,r)=>{"use strict";var n=r(46518),i=r(44995);n({target:"WeakMap",stat:!0,forced:!0},{from:r(70933)(i.WeakMap,i.set,!0)})},79732:(e,t,r)=>{"use strict";var n=r(46518),i=r(44995);n({target:"WeakMap",stat:!0,forced:!0},{of:r(87500)(i.WeakMap,i.set,!0)})},49634:(e,t,r)=>{"use strict";r(46518)({target:"WeakMap",proto:!0,real:!0,forced:!0},{upsert:r(162)})},83742:(e,t,r)=>{"use strict";var n=r(46518),i=r(23755),s=r(88205).add;n({target:"WeakSet",proto:!0,real:!0,forced:!0},{addAll:function(){for(var e=i(this),t=0,r=arguments.length;t{"use strict";var n=r(46518),i=r(23755),s=r(88205).remove;n({target:"WeakSet",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var e,t=i(this),r=!0,n=0,o=arguments.length;n{"use strict";var n=r(46518),i=r(88205);n({target:"WeakSet",stat:!0,forced:!0},{from:r(70933)(i.WeakSet,i.add,!1)})},46270:(e,t,r)=>{"use strict";var n=r(46518),i=r(88205);n({target:"WeakSet",stat:!0,forced:!0},{of:r(87500)(i.WeakSet,i.add,!1)})},2945:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(97751),o=r(79504),a=r(69565),l=r(79039),c=r(655),u=r(22812),h=r(92804).c2i,d=/[^\d+/a-z]/i,p=/[\t\n\f\r ]+/g,f=/[=]{1,2}$/,m=s("atob"),g=String.fromCharCode,A=o("".charAt),y=o("".replace),v=o(d.exec),x=!!m&&!l((function(){return"hi"!==m("aGk=")})),_=x&&l((function(){return""!==m(" ")})),b=x&&!l((function(){m("a")})),w=x&&!l((function(){m()})),E=x&&1!==m.length;n({global:!0,bind:!0,enumerable:!0,forced:!x||_||b||w||E},{atob:function(e){if(u(arguments.length,1),x&&!_&&!b)return a(m,i,e);var t,r,n,o=y(c(e),p,""),l="",w=0,E=0;if(o.length%4==0&&(o=y(o,f,"")),(t=o.length)%4==1||v(d,o))throw new(s("DOMException"))("The string is not correctly encoded","InvalidCharacterError");for(;w>(-2*E&6)));return l}})},42207:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(97751),o=r(79504),a=r(69565),l=r(79039),c=r(655),u=r(22812),h=r(92804).i2c,d=s("btoa"),p=o("".charAt),f=o("".charCodeAt),m=!!d&&!l((function(){return"aGk="!==d("hi")})),g=m&&!l((function(){d()})),A=m&&l((function(){return"bnVsbA=="!==d(null)})),y=m&&1!==d.length;n({global:!0,bind:!0,enumerable:!0,forced:!m||g||A||y},{btoa:function(e){if(u(arguments.length,1),m)return a(d,i,c(e));for(var t,r,n=c(e),o="",l=0,g=h;p(n,l)||(g="=",l%1);){if((r=f(n,l+=3/4))>255)throw new(s("DOMException"))("The string contains characters outside of the Latin1 range","InvalidCharacterError");o+=p(g,63&(t=t<<8|r)>>8-l%1*8)}return o}})},86368:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(59225).clear;n({global:!0,bind:!0,enumerable:!0,forced:i.clearImmediate!==s},{clearImmediate:s})},23500:(e,t,r)=>{"use strict";var n=r(44576),i=r(67400),s=r(79296),o=r(90235),a=r(66699),l=function(e){if(e&&e.forEach!==o)try{a(e,"forEach",o)}catch(t){e.forEach=o}};for(var c in i)i[c]&&l(n[c]&&n[c].prototype);l(s)},62953:(e,t,r)=>{"use strict";var n=r(44576),i=r(67400),s=r(79296),o=r(23792),a=r(66699),l=r(10687),c=r(78227)("iterator"),u=o.values,h=function(e,t){if(e){if(e[c]!==u)try{a(e,c,u)}catch(t){e[c]=u}if(l(e,t,!0),i[t])for(var r in o)if(e[r]!==o[r])try{a(e,r,o[r])}catch(t){e[r]=o[r]}}};for(var d in i)h(n[d]&&n[d].prototype,d);h(s,"DOMTokenList")},55815:(e,t,r)=>{"use strict";var n=r(46518),i=r(97751),s=r(89429),o=r(79039),a=r(2360),l=r(6980),c=r(24913).f,u=r(36840),h=r(62106),d=r(39297),p=r(90679),f=r(28551),m=r(77536),g=r(32603),A=r(55002),y=r(16193),v=r(91181),x=r(43724),_=r(96395),b="DOMException",w="DATA_CLONE_ERR",E=i("Error"),M=i(b)||function(){try{(new(i("MessageChannel")||s("worker_threads").MessageChannel)).port1.postMessage(new WeakMap)}catch(e){if(e.name===w&&25===e.code)return e.constructor}}(),S=M&&M.prototype,C=E.prototype,T=v.set,I=v.getterFor(b),R="stack"in new E(b),B=function(e){return d(A,e)&&A[e].m?A[e].c:0},P=function(){p(this,L);var e=arguments.length,t=g(e<1?void 0:arguments[0]),r=g(e<2?void 0:arguments[1],"Error"),n=B(r);if(T(this,{type:b,name:r,message:t,code:n}),x||(this.name=r,this.message=t,this.code=n),R){var i=new E(t);i.name=b,c(this,"stack",l(1,y(i.stack,1)))}},L=P.prototype=a(C),D=function(e){return{enumerable:!0,configurable:!0,get:e}},O=function(e){return D((function(){return I(this)[e]}))};x&&(h(L,"code",O("code")),h(L,"message",O("message")),h(L,"name",O("name"))),c(L,"constructor",l(1,P));var N=o((function(){return!(new M instanceof E)})),U=N||o((function(){return C.toString!==m||"2: 1"!==String(new M(1,2))})),F=N||o((function(){return 25!==new M(1,"DataCloneError").code})),k=N||25!==M[w]||25!==S[w],z=_?U||F||k:N;n({global:!0,constructor:!0,forced:z},{DOMException:z?P:M});var G=i(b),Q=G.prototype;for(var V in U&&(_||M===G)&&u(Q,"toString",m),F&&x&&M===G&&h(Q,"code",D((function(){return B(f(this).name)}))),A)if(d(A,V)){var H=A[V],j=H.s,q=l(6,H.c);d(G,j)||c(G,j,q),d(Q,j)||c(Q,j,q)}},64979:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(97751),o=r(6980),a=r(24913).f,l=r(39297),c=r(90679),u=r(23167),h=r(32603),d=r(55002),p=r(16193),f=r(43724),m=r(96395),g="DOMException",A=s("Error"),y=s(g),v=function(){c(this,x);var e=arguments.length,t=h(e<1?void 0:arguments[0]),r=h(e<2?void 0:arguments[1],"Error"),n=new y(t,r),i=new A(t);return i.name=g,a(n,"stack",o(1,p(i.stack,1))),u(n,this,v),n},x=v.prototype=y.prototype,_="stack"in new A(g),b="stack"in new y(1,2),w=y&&f&&Object.getOwnPropertyDescriptor(i,g),E=!(!w||w.writable&&w.configurable),M=_&&!E&&!b;n({global:!0,constructor:!0,forced:m||M},{DOMException:M?v:y});var S=s(g),C=S.prototype;if(C.constructor!==S)for(var T in m||a(C,"constructor",o(1,S)),d)if(l(d,T)){var I=d[T],R=I.s;l(S,R)||a(S,R,o(6,I.c))}},79739:(e,t,r)=>{"use strict";var n=r(97751),i="DOMException";r(10687)(n(i),i)},59848:(e,t,r)=>{"use strict";r(86368),r(29309)},122:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(91955),o=r(79306),a=r(22812),l=r(79039),c=r(43724);n({global:!0,enumerable:!0,dontCallGetSet:!0,forced:l((function(){return c&&1!==Object.getOwnPropertyDescriptor(i,"queueMicrotask").value.length}))},{queueMicrotask:function(e){a(arguments.length,1),s(o(e))}})},13611:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(62106),o=r(43724),a=TypeError,l=Object.defineProperty,c=i.self!==i;try{if(o){var u=Object.getOwnPropertyDescriptor(i,"self");!c&&u&&u.get&&u.enumerable||s(i,"self",{get:function(){return i},set:function(e){if(this!==i)throw new a("Illegal invocation");l(i,"self",{value:e,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}else n({global:!0,simple:!0,forced:c},{self:i})}catch(e){}},29309:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(59225).set,o=r(79472),a=i.setImmediate?o(s,!1):s;n({global:!0,bind:!0,enumerable:!0,forced:i.setImmediate!==a},{setImmediate:a})},15575:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(79472)(i.setInterval,!0);n({global:!0,bind:!0,forced:i.setInterval!==s},{setInterval:s})},24599:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(79472)(i.setTimeout,!0);n({global:!0,bind:!0,forced:i.setTimeout!==s},{setTimeout:s})},71678:(e,t,r)=>{"use strict";var n,i=r(96395),s=r(46518),o=r(44576),a=r(97751),l=r(79504),c=r(79039),u=r(33392),h=r(94901),d=r(33517),p=r(64117),f=r(20034),m=r(10757),g=r(72652),A=r(28551),y=r(36955),v=r(39297),x=r(97040),_=r(66699),b=r(26198),w=r(22812),E=r(61034),M=r(72248),S=r(94402),C=r(38469),T=r(94483),I=r(24659),R=r(1548),B=o.Object,P=o.Array,L=o.Date,D=o.Error,O=o.TypeError,N=o.PerformanceMark,U=a("DOMException"),F=M.Map,k=M.has,z=M.get,G=M.set,Q=S.Set,V=S.add,H=S.has,j=a("Object","keys"),q=l([].push),W=l((!0).valueOf),Y=l(1..valueOf),X=l("".valueOf),K=l(L.prototype.getTime),$=u("structuredClone"),J="DataCloneError",Z="Transferring",ee=function(e){return!c((function(){var t=new o.Set([7]),r=e(t),n=e(B(7));return r===t||!r.has(7)||!f(n)||7!=+n}))&&e},te=function(e,t){return!c((function(){var r=new t,n=e({a:r,b:r});return!(n&&n.a===n.b&&n.a instanceof t&&n.a.stack===r.stack)}))},re=o.structuredClone,ne=i||!te(re,D)||!te(re,U)||(n=re,!!c((function(){var e=n(new o.AggregateError([1],$,{cause:3}));return"AggregateError"!==e.name||1!==e.errors[0]||e.message!==$||3!==e.cause}))),ie=!re&&ee((function(e){return new N($,{detail:e}).detail})),se=ee(re)||ie,oe=function(e){throw new U("Uncloneable type: "+e,J)},ae=function(e,t){throw new U((t||"Cloning")+" of "+e+" cannot be properly polyfilled in this engine",J)},le=function(e,t){return se||ae(t),se(e)},ce=function(e,t,r){if(k(t,e))return z(t,e);var n,i,s,a,l,c;if("SharedArrayBuffer"===(r||y(e)))n=se?se(e):e;else{var u=o.DataView;u||h(e.slice)||ae("ArrayBuffer");try{if(h(e.slice)&&!e.resizable)n=e.slice(0);else{i=e.byteLength,s="maxByteLength"in e?{maxByteLength:e.maxByteLength}:void 0,n=new ArrayBuffer(i,s),a=new u(e),l=new u(n);for(c=0;c1&&!p(arguments[1])?A(arguments[1]):void 0,i=n?n.transfer:void 0;void 0!==i&&(r=function(e,t){if(!f(e))throw new O("Transfer option cannot be converted to a sequence");var r=[];g(e,(function(e){q(r,A(e))}));for(var n,i,s,a,l,c=0,u=b(r),p=new Q;c{"use strict";r(15575),r(24599)},98406:(e,t,r)=>{"use strict";r(23792),r(27337);var n=r(46518),i=r(44576),s=r(93389),o=r(97751),a=r(69565),l=r(79504),c=r(43724),u=r(67416),h=r(36840),d=r(62106),p=r(56279),f=r(10687),m=r(33994),g=r(91181),A=r(90679),y=r(94901),v=r(39297),x=r(76080),_=r(36955),b=r(28551),w=r(20034),E=r(655),M=r(2360),S=r(6980),C=r(70081),T=r(50851),I=r(62529),R=r(22812),B=r(78227),P=r(74488),L=B("iterator"),D="URLSearchParams",O=D+"Iterator",N=g.set,U=g.getterFor(D),F=g.getterFor(O),k=s("fetch"),z=s("Request"),G=s("Headers"),Q=z&&z.prototype,V=G&&G.prototype,H=i.TypeError,j=i.encodeURIComponent,q=String.fromCharCode,W=o("String","fromCodePoint"),Y=parseInt,X=l("".charAt),K=l([].join),$=l([].push),J=l("".replace),Z=l([].shift),ee=l([].splice),te=l("".split),re=l("".slice),ne=l(/./.exec),ie=/\+/g,se=/^[0-9a-f]+$/i,oe=function(e,t){var r=re(e,t,t+2);return ne(se,r)?Y(r,16):NaN},ae=function(e){for(var t=0,r=128;r>0&&e&r;r>>=1)t++;return t},le=function(e){var t=null;switch(e.length){case 1:t=e[0];break;case 2:t=(31&e[0])<<6|63&e[1];break;case 3:t=(15&e[0])<<12|(63&e[1])<<6|63&e[2];break;case 4:t=(7&e[0])<<18|(63&e[1])<<12|(63&e[2])<<6|63&e[3]}return t>1114111?null:t},ce=function(e){for(var t=(e=J(e,ie," ")).length,r="",n=0;nt){r+="%",n++;continue}var s=oe(e,n+1);if(s!=s){r+=i,n++;continue}n+=2;var o=ae(s);if(0===o)i=q(s);else{if(1===o||o>4){r+="�",n++;continue}for(var a=[s],l=1;lt||"%"!==X(e,n));){var c=oe(e,n+1);if(c!=c){n+=3;break}if(c>191||c<128)break;$(a,c),n+=2,l++}if(a.length!==o){r+="�";continue}var u=le(a);null===u?r+="�":i=W(u)}}r+=i,n++}return r},ue=/[!'()~]|%20/g,he={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},de=function(e){return he[e]},pe=function(e){return J(j(e),ue,de)},fe=m((function(e,t){N(this,{type:O,target:U(e).entries,index:0,kind:t})}),D,(function(){var e=F(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,I(void 0,!0);var n=t[r];switch(e.kind){case"keys":return I(n.key,!1);case"values":return I(n.value,!1)}return I([n.key,n.value],!1)}),!0),me=function(e){this.entries=[],this.url=null,void 0!==e&&(w(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===X(e,0)?re(e,1):e:E(e)))};me.prototype={type:D,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,r,n,i,s,o,l,c=this.entries,u=T(e);if(u)for(r=(t=C(e,u)).next;!(n=a(r,t)).done;){if(s=(i=C(b(n.value))).next,(o=a(s,i)).done||(l=a(s,i)).done||!a(s,i).done)throw new H("Expected sequence with length 2");$(c,{key:E(o.value),value:E(l.value)})}else for(var h in e)v(e,h)&&$(c,{key:h,value:E(e[h])})},parseQuery:function(e){if(e)for(var t,r,n=this.entries,i=te(e,"&"),s=0;s0?arguments[0]:void 0));c||(this.size=e.entries.length)},Ae=ge.prototype;if(p(Ae,{append:function(e,t){var r=U(this);R(arguments.length,2),$(r.entries,{key:E(e),value:E(t)}),c||this.length++,r.updateURL()},delete:function(e){for(var t=U(this),r=R(arguments.length,1),n=t.entries,i=E(e),s=r<2?void 0:arguments[1],o=void 0===s?s:E(s),a=0;at.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,r=U(this).entries,n=x(e,arguments.length>1?arguments[1]:void 0),i=0;i1?xe(arguments[1]):{})}}),y(z)){var _e=function(e){return A(this,Q),new z(e,arguments.length>1?xe(arguments[1]):{})};Q.constructor=_e,_e.prototype=Q,n({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:_e})}}e.exports={URLSearchParams:ge,getState:U}},14603:(e,t,r)=>{"use strict";var n=r(36840),i=r(79504),s=r(655),o=r(22812),a=URLSearchParams,l=a.prototype,c=i(l.append),u=i(l.delete),h=i(l.forEach),d=i([].push),p=new a("a=1&a=2&b=3");p.delete("a",1),p.delete("b",void 0),p+""!="a=2"&&n(l,"delete",(function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&void 0===r)return u(this,e);var n=[];h(this,(function(e,t){d(n,{key:t,value:e})})),o(t,1);for(var i,a=s(e),l=s(r),p=0,f=0,m=!1,g=n.length;p{"use strict";var n=r(36840),i=r(79504),s=r(655),o=r(22812),a=URLSearchParams,l=a.prototype,c=i(l.getAll),u=i(l.has),h=new a("a=1");!h.has("a",2)&&h.has("a",void 0)||n(l,"has",(function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&void 0===r)return u(this,e);var n=c(this,e);o(t,1);for(var i=s(r),a=0;a{"use strict";r(98406)},98721:(e,t,r)=>{"use strict";var n=r(43724),i=r(79504),s=r(62106),o=URLSearchParams.prototype,a=i(o.forEach);n&&!("size"in o)&&s(o,"size",{get:function(){var e=0;return a(this,(function(){e++})),e},configurable:!0,enumerable:!0})},2222:(e,t,r)=>{"use strict";var n=r(46518),i=r(97751),s=r(79039),o=r(22812),a=r(655),l=r(67416),c=i("URL"),u=l&&s((function(){c.canParse()})),h=s((function(){return 1!==c.canParse.length}));n({target:"URL",stat:!0,forced:!u||h},{canParse:function(e){var t=o(arguments.length,1),r=a(e),n=t<2||void 0===arguments[1]?void 0:a(arguments[1]);try{return!!new c(r,n)}catch(e){return!1}}})},45806:(e,t,r)=>{"use strict";r(47764);var n,i=r(46518),s=r(43724),o=r(67416),a=r(44576),l=r(76080),c=r(79504),u=r(36840),h=r(62106),d=r(90679),p=r(39297),f=r(44213),m=r(97916),g=r(67680),A=r(68183).codeAt,y=r(3717),v=r(655),x=r(10687),_=r(22812),b=r(98406),w=r(91181),E=w.set,M=w.getterFor("URL"),S=b.URLSearchParams,C=b.getState,T=a.URL,I=a.TypeError,R=a.parseInt,B=Math.floor,P=Math.pow,L=c("".charAt),D=c(/./.exec),O=c([].join),N=c(1..toString),U=c([].pop),F=c([].push),k=c("".replace),z=c([].shift),G=c("".split),Q=c("".slice),V=c("".toLowerCase),H=c([].unshift),j="Invalid scheme",q="Invalid host",W="Invalid port",Y=/[a-z]/i,X=/[\d+-.a-z]/i,K=/\d/,$=/^0x/i,J=/^[0-7]+$/,Z=/^\d+$/,ee=/^[\da-f]+$/i,te=/[\0\t\n\r #%/:<>?@[\\\]^|]/,re=/[\0\t\n\r #/:<>?@[\\\]^|]/,ne=/^[\u0000-\u0020]+/,ie=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,se=/[\t\n\r]/g,oe=function(e){var t,r,n,i;if("number"==typeof e){for(t=[],r=0;r<4;r++)H(t,e%256),e=B(e/256);return O(t,".")}if("object"==typeof e){for(t="",n=function(e){for(var t=null,r=1,n=null,i=0,s=0;s<8;s++)0!==e[s]?(i>r&&(t=n,r=i),n=null,i=0):(null===n&&(n=s),++i);return i>r?n:t}(e),r=0;r<8;r++)i&&0===e[r]||(i&&(i=!1),n===r?(t+=r?":":"::",i=!0):(t+=N(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},ae={},le=f({},ae,{" ":1,'"':1,"<":1,">":1,"`":1}),ce=f({},le,{"#":1,"?":1,"{":1,"}":1}),ue=f({},ce,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),he=function(e,t){var r=A(e,0);return r>32&&r<127&&!p(t,e)?e:encodeURIComponent(e)},de={ftp:21,file:null,http:80,https:443,ws:80,wss:443},pe=function(e,t){var r;return 2===e.length&&D(Y,L(e,0))&&(":"===(r=L(e,1))||!t&&"|"===r)},fe=function(e){var t;return e.length>1&&pe(Q(e,0,2))&&(2===e.length||"/"===(t=L(e,2))||"\\"===t||"?"===t||"#"===t)},me=function(e){return"."===e||"%2e"===V(e)},ge={},Ae={},ye={},ve={},xe={},_e={},be={},we={},Ee={},Me={},Se={},Ce={},Te={},Ie={},Re={},Be={},Pe={},Le={},De={},Oe={},Ne={},Ue=function(e,t,r){var n,i,s,o=v(e);if(t){if(i=this.parse(o))throw new I(i);this.searchParams=null}else{if(void 0!==r&&(n=new Ue(r,!0)),i=this.parse(o,null,n))throw new I(i);(s=C(new S)).bindURL(this),this.searchParams=s}};Ue.prototype={type:"URL",parse:function(e,t,r){var i,s,o,a,l,c=this,u=t||ge,h=0,d="",f=!1,A=!1,y=!1;for(e=v(e),t||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,e=k(e,ne,""),e=k(e,ie,"$1")),e=k(e,se,""),i=m(e);h<=i.length;){switch(s=i[h],u){case ge:if(!s||!D(Y,s)){if(t)return j;u=ye;continue}d+=V(s),u=Ae;break;case Ae:if(s&&(D(X,s)||"+"===s||"-"===s||"."===s))d+=V(s);else{if(":"!==s){if(t)return j;d="",u=ye,h=0;continue}if(t&&(c.isSpecial()!==p(de,d)||"file"===d&&(c.includesCredentials()||null!==c.port)||"file"===c.scheme&&!c.host))return;if(c.scheme=d,t)return void(c.isSpecial()&&de[c.scheme]===c.port&&(c.port=null));d="","file"===c.scheme?u=Ie:c.isSpecial()&&r&&r.scheme===c.scheme?u=ve:c.isSpecial()?u=we:"/"===i[h+1]?(u=xe,h++):(c.cannotBeABaseURL=!0,F(c.path,""),u=De)}break;case ye:if(!r||r.cannotBeABaseURL&&"#"!==s)return j;if(r.cannotBeABaseURL&&"#"===s){c.scheme=r.scheme,c.path=g(r.path),c.query=r.query,c.fragment="",c.cannotBeABaseURL=!0,u=Ne;break}u="file"===r.scheme?Ie:_e;continue;case ve:if("/"!==s||"/"!==i[h+1]){u=_e;continue}u=Ee,h++;break;case xe:if("/"===s){u=Me;break}u=Le;continue;case _e:if(c.scheme=r.scheme,s===n)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=g(r.path),c.query=r.query;else if("/"===s||"\\"===s&&c.isSpecial())u=be;else if("?"===s)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=g(r.path),c.query="",u=Oe;else{if("#"!==s){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=g(r.path),c.path.length--,u=Le;continue}c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=g(r.path),c.query=r.query,c.fragment="",u=Ne}break;case be:if(!c.isSpecial()||"/"!==s&&"\\"!==s){if("/"!==s){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,u=Le;continue}u=Me}else u=Ee;break;case we:if(u=Ee,"/"!==s||"/"!==L(d,h+1))continue;h++;break;case Ee:if("/"!==s&&"\\"!==s){u=Me;continue}break;case Me:if("@"===s){f&&(d="%40"+d),f=!0,o=m(d);for(var x=0;x65535)return W;c.port=c.isSpecial()&&w===de[c.scheme]?null:w,d=""}if(t)return;u=Pe;continue}return W}d+=s;break;case Ie:if(c.scheme="file","/"===s||"\\"===s)u=Re;else{if(!r||"file"!==r.scheme){u=Le;continue}switch(s){case n:c.host=r.host,c.path=g(r.path),c.query=r.query;break;case"?":c.host=r.host,c.path=g(r.path),c.query="",u=Oe;break;case"#":c.host=r.host,c.path=g(r.path),c.query=r.query,c.fragment="",u=Ne;break;default:fe(O(g(i,h),""))||(c.host=r.host,c.path=g(r.path),c.shortenPath()),u=Le;continue}}break;case Re:if("/"===s||"\\"===s){u=Be;break}r&&"file"===r.scheme&&!fe(O(g(i,h),""))&&(pe(r.path[0],!0)?F(c.path,r.path[0]):c.host=r.host),u=Le;continue;case Be:if(s===n||"/"===s||"\\"===s||"?"===s||"#"===s){if(!t&&pe(d))u=Le;else if(""===d){if(c.host="",t)return;u=Pe}else{if(a=c.parseHost(d))return a;if("localhost"===c.host&&(c.host=""),t)return;d="",u=Pe}continue}d+=s;break;case Pe:if(c.isSpecial()){if(u=Le,"/"!==s&&"\\"!==s)continue}else if(t||"?"!==s)if(t||"#"!==s){if(s!==n&&(u=Le,"/"!==s))continue}else c.fragment="",u=Ne;else c.query="",u=Oe;break;case Le:if(s===n||"/"===s||"\\"===s&&c.isSpecial()||!t&&("?"===s||"#"===s)){if(".."===(l=V(l=d))||"%2e."===l||".%2e"===l||"%2e%2e"===l?(c.shortenPath(),"/"===s||"\\"===s&&c.isSpecial()||F(c.path,"")):me(d)?"/"===s||"\\"===s&&c.isSpecial()||F(c.path,""):("file"===c.scheme&&!c.path.length&&pe(d)&&(c.host&&(c.host=""),d=L(d,0)+":"),F(c.path,d)),d="","file"===c.scheme&&(s===n||"?"===s||"#"===s))for(;c.path.length>1&&""===c.path[0];)z(c.path);"?"===s?(c.query="",u=Oe):"#"===s&&(c.fragment="",u=Ne)}else d+=he(s,ce);break;case De:"?"===s?(c.query="",u=Oe):"#"===s?(c.fragment="",u=Ne):s!==n&&(c.path[0]+=he(s,ae));break;case Oe:t||"#"!==s?s!==n&&("'"===s&&c.isSpecial()?c.query+="%27":c.query+="#"===s?"%23":he(s,ae)):(c.fragment="",u=Ne);break;case Ne:s!==n&&(c.fragment+=he(s,le))}h++}},parseHost:function(e){var t,r,n;if("["===L(e,0)){if("]"!==L(e,e.length-1))return q;if(t=function(e){var t,r,n,i,s,o,a,l=[0,0,0,0,0,0,0,0],c=0,u=null,h=0,d=function(){return L(e,h)};if(":"===d()){if(":"!==L(e,1))return;h+=2,u=++c}for(;d();){if(8===c)return;if(":"!==d()){for(t=r=0;r<4&&D(ee,d());)t=16*t+R(d(),16),h++,r++;if("."===d()){if(0===r)return;if(h-=r,c>6)return;for(n=0;d();){if(i=null,n>0){if(!("."===d()&&n<4))return;h++}if(!D(K,d()))return;for(;D(K,d());){if(s=R(d(),10),null===i)i=s;else{if(0===i)return;i=10*i+s}if(i>255)return;h++}l[c]=256*l[c]+i,2!=++n&&4!==n||c++}if(4!==n)return;break}if(":"===d()){if(h++,!d())return}else if(d())return;l[c++]=t}else{if(null!==u)return;h++,u=++c}}if(null!==u)for(o=c-u,c=7;0!==c&&o>0;)a=l[c],l[c--]=l[u+o-1],l[u+--o]=a;else if(8!==c)return;return l}(Q(e,1,-1)),!t)return q;this.host=t}else if(this.isSpecial()){if(e=y(e),D(te,e))return q;if(t=function(e){var t,r,n,i,s,o,a,l=G(e,".");if(l.length&&""===l[l.length-1]&&l.length--,(t=l.length)>4)return e;for(r=[],n=0;n1&&"0"===L(i,0)&&(s=D($,i)?16:8,i=Q(i,8===s?1:2)),""===i)o=0;else{if(!D(10===s?Z:8===s?J:ee,i))return e;o=R(i,s)}F(r,o)}for(n=0;n=P(256,5-t))return null}else if(o>255)return null;for(a=U(r),n=0;n1?arguments[1]:void 0,n=E(t,new Ue(e,!1,r));s||(t.href=n.serialize(),t.origin=n.getOrigin(),t.protocol=n.getProtocol(),t.username=n.getUsername(),t.password=n.getPassword(),t.host=n.getHost(),t.hostname=n.getHostname(),t.port=n.getPort(),t.pathname=n.getPathname(),t.search=n.getSearch(),t.searchParams=n.getSearchParams(),t.hash=n.getHash())},ke=Fe.prototype,ze=function(e,t){return{get:function(){return M(this)[e]()},set:t&&function(e){return M(this)[t](e)},configurable:!0,enumerable:!0}};if(s&&(h(ke,"href",ze("serialize","setHref")),h(ke,"origin",ze("getOrigin")),h(ke,"protocol",ze("getProtocol","setProtocol")),h(ke,"username",ze("getUsername","setUsername")),h(ke,"password",ze("getPassword","setPassword")),h(ke,"host",ze("getHost","setHost")),h(ke,"hostname",ze("getHostname","setHostname")),h(ke,"port",ze("getPort","setPort")),h(ke,"pathname",ze("getPathname","setPathname")),h(ke,"search",ze("getSearch","setSearch")),h(ke,"searchParams",ze("getSearchParams")),h(ke,"hash",ze("getHash","setHash"))),u(ke,"toJSON",(function(){return M(this).serialize()}),{enumerable:!0}),u(ke,"toString",(function(){return M(this).serialize()}),{enumerable:!0}),T){var Ge=T.createObjectURL,Qe=T.revokeObjectURL;Ge&&u(Fe,"createObjectURL",l(Ge,T)),Qe&&u(Fe,"revokeObjectURL",l(Qe,T))}x(Fe,"URL"),i({global:!0,constructor:!0,forced:!o,sham:!s},{URL:Fe})},3296:(e,t,r)=>{"use strict";r(45806)},45781:(e,t,r)=>{"use strict";var n=r(46518),i=r(97751),s=r(22812),o=r(655),a=r(67416),l=i("URL");n({target:"URL",stat:!0,forced:!a},{parse:function(e){var t=s(arguments.length,1),r=o(e),n=t<2||void 0===arguments[1]?void 0:o(arguments[1]);try{return new l(r,n)}catch(e){return null}}})},27208:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565);n({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return i(URL.prototype.toString,this)}})},52219:(e,t,r)=>{"use strict";r.d(t,{C1:()=>y});var n=r(39437);new n.Spherical,new n.Vector3;const i=new n.Spherical,s=new n.Vector3,o=new n.Vector3,a=new n.Vector3,l=new n.Vector3,c=new n.Matrix4,u=new n.Matrix4,h=new n.Sphere,d=new n.Euler,p=new n.Vector3,f=new n.Vector3,m=new n.Vector3,g=new n.Vector3,A=new n.Ray;class y{constructor(e=1,t=1,r=1){this.radius=new n.Vector3(e,t,r)}intersectRay(e,t){return c.makeScale(...this.radius).invert(),h.center.set(0,0,0),h.radius=1,A.copy(e).applyMatrix4(c),A.intersectSphere(h,t)?(c.makeScale(...this.radius),t.applyMatrix4(c),t):null}getEastNorthUpFrame(e,t,r){return this.getEastNorthUpAxes(e,t,p,f,m,g),r.makeBasis(p,f,m).setPosition(g)}getEastNorthUpAxes(e,t,r,n,i,s=g){this.getCartographicToPosition(e,t,0,s),this.getCartographicToNormal(e,t,i),r.set(-s.y,s.x,0).normalize(),n.crossVectors(i,r).normalize()}getNorthernTangent(e,t,r,n=l){return console.log("Ellipsoid: getNorthernTangent has been deprecated. Use getEastNorthUpAxes instead."),this.getEastNorthUpAxes(e,t,n,r,m),n.multiplyScalar(-1),r}getAzElRollFromRotationMatrix(e,t,r,n,i=0){return 1===i?(d.set(-Math.PI/2,0,0,"XYZ"),u.makeRotationFromEuler(d).premultiply(r)):2===i?(d.set(-Math.PI/2,0,Math.PI,"XYZ"),u.makeRotationFromEuler(d).premultiply(r)):u.copy(r),this.getEastNorthUpFrame(e,t,c).invert(),u.premultiply(c),d.setFromRotationMatrix(u,"ZXY"),n.azimuth=-d.z,n.elevation=d.x,n.roll=d.y,n}getRotationMatrixFromAzElRoll(e,t,r,n,i,s,o=0){return this.getEastNorthUpFrame(e,t,c),d.set(n,i,-r,"ZXY"),s.makeRotationFromEuler(d).premultiply(c).setPosition(0,0,0),1===o?(d.set(Math.PI/2,0,0,"XYZ"),u.makeRotationFromEuler(d),s.multiply(u)):2===o&&(d.set(-Math.PI/2,0,Math.PI,"XYZ"),u.makeRotationFromEuler(d),s.multiply(u)),s}getCartographicToPosition(e,t,r,n){this.getCartographicToNormal(e,t,s);const i=this.radius;o.copy(s),o.x*=i.x**2,o.y*=i.y**2,o.z*=i.z**2;const a=Math.sqrt(s.dot(o));return o.divideScalar(a),n.copy(o).addScaledVector(s,r)}getPositionToCartographic(e,t){this.getPositionToSurfacePoint(e,o),this.getPositionToNormal(e,s);const r=a.subVectors(e,o);return t.lon=Math.atan2(s.y,s.x),t.lat=Math.asin(s.z),t.height=Math.sign(r.dot(e))*r.length(),t}getCartographicToNormal(e,t,r){return i.set(1,-e+Math.PI/2,t),r.setFromSpherical(i).normalize(),function(e){const{x:t,y:r,z:n}=e;e.x=n,e.y=t,e.z=r}(r),r}getPositionToNormal(e,t){const r=this.radius;return t.copy(e),t.x/=r.x**2,t.y/=r.y**2,t.z/=r.z**2,t.normalize(),t}getPositionToSurfacePoint(e,t){const r=this.radius,n=1/r.x**2,i=1/r.y**2,s=1/r.z**2,l=e.x*e.x*n,c=e.y*e.y*i,u=e.z*e.z*s,h=l+c+u,d=Math.sqrt(1/h),p=o.copy(e).multiplyScalar(d);if(h<.1)return isFinite(d)?t.copy(p):null;const f=a.set(p.x*n*2,p.y*i*2,p.z*s*2);let m,g,A,y,v,x,_,b,w,E,M,S=(1-d)*e.length()/(.5*f.length()),C=0;do{S-=C,A=1/(1+S*n),y=1/(1+S*i),v=1/(1+S*s),x=A*A,_=y*y,b=v*v,w=x*A,E=_*y,M=b*v,m=l*x+c*_+u*b-1,g=l*w*n+c*E*i+u*M*s,C=m/(-2*g)}while(Math.abs(m)>1e-12);return t.set(e.x*A,e.y*y,e.z*v)}calculateHorizonDistance(e,t){const r=this.calculateEffectiveRadius(e);return Math.sqrt(2*r*t+t**2)}calculateEffectiveRadius(e){const t=this.radius.x,r=1-this.radius.z**2/t**2,i=e*n.MathUtils.DEG2RAD,s=Math.sin(i)**2;return t/Math.sqrt(1-r*s)}getPositionElevation(e){this.getPositionToSurfacePoint(e,o);const t=a.subVectors(e,o);return Math.sign(t.dot(e))*t.length()}copy(e){return this.radius.copy(e.radius),this}clone(){return(new this.constructor).copy(this)}}},5247:(e,t,r)=>{"use strict";r.d(t,{M:()=>m});var n=r(39437),i=r(52219);const s=Math.PI,o=s/2,a=new n.Vector3,l=new n.Vector3,c=new n.Vector3,u=new n.Matrix4;let h=0;const d=[];function p(e=!1){return e?(d[h]||(d[h]=new n.Vector3),h++,d[h-1]):new n.Vector3}function f(){h=0}class m extends i.C1{constructor(e,t,r,n=-o,i=o,a=0,l=2*s,c=0,u=0){super(e,t,r),this.latStart=n,this.latEnd=i,this.lonStart=a,this.lonEnd=l,this.heightStart=c,this.heightEnd=u}_getPoints(e=!1){const{latStart:t,latEnd:r,lonStart:i,lonEnd:a,heightStart:l,heightEnd:c}=this,u=n.MathUtils.mapLinear(.5,0,1,t,r),h=n.MathUtils.mapLinear(.5,0,1,i,a),d=Math.floor(i/o)*o,f=[[-s/2,0],[s/2,0],[0,d],[0,d+s/2],[0,d+s],[0,d+3*s/2],[t,a],[r,a],[t,i],[r,i],[0,i],[0,a],[u,h],[t,h],[r,h],[u,i],[u,a]],m=[],g=f.length;for(let s=0;s<=1;s++){const o=n.MathUtils.mapLinear(s,0,1,l,c);for(let n=0,s=g;n=t&&s<=r&&l>=i&&l<=a){const t=p(e);m.push(t),this.getCartographicToPosition(s,l,o,t)}}}return m}getBoundingBox(e,t){f();const{latStart:r,latEnd:i,lonStart:o,lonEnd:h}=this;if(i-r{"use strict";r.d(t,{dn:()=>cn,fC:()=>Mr});var n={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};class i{constructor(e,t,r,n){this.message=(e?`${e}: `:"")+r,n&&(this.identifier=n),null!=t&&t.__line__&&(this.line=t.__line__)}}function s(e,...t){for(const r of t)for(const t in r)e[t]=r[t];return e}class o extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}class a{constructor(e,t=[]){this.parent=e,this.bindings={};for(const[e,r]of t)this.bindings[e]=r}concat(e){return new a(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}const l={kind:"null"},c={kind:"number"},u={kind:"string"},h={kind:"boolean"},d={kind:"color"},p={kind:"projectionDefinition"},f={kind:"object"},m={kind:"value"},g={kind:"collator"},A={kind:"formatted"},y={kind:"padding"},v={kind:"resolvedImage"},x={kind:"variableAnchorOffsetCollection"};function _(e,t){return{kind:"array",itemType:e,N:t}}function b(e){if("array"===e.kind){const t=b(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}const w=[l,c,u,h,d,p,A,f,_(m),y,v,x];function E(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!E(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(const e of w)if(!E(e,t))return null}return`Expected ${b(e)} but found ${b(t)} instead.`}function M(e,t){return t.some((t=>t.kind===e.kind))}function S(e,t){return t.some((t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e))}function C(e,t){return"array"===e.kind&&"array"===t.kind?e.itemType.kind===t.itemType.kind&&"number"==typeof e.N:e.kind===t.kind}const T=.96422,I=.82521,R=4/29,B=6/29,P=3*B*B,L=B*B*B,D=Math.PI/180,O=180/Math.PI;function N(e){return(e%=360)<0&&(e+=360),e}function U([e,t,r,n]){let i,s;const o=k((.2225045*(e=F(e))+.7168786*(t=F(t))+.0606169*(r=F(r)))/1);e===t&&t===r?i=s=o:(i=k((.4360747*e+.3850649*t+.1430804*r)/T),s=k((.0139322*e+.0971045*t+.7141733*r)/I));const a=116*o-16;return[a<0?0:a,500*(i-o),200*(o-s),n]}function F(e){return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function k(e){return e>L?Math.pow(e,1/3):e/P+R}function z([e,t,r,n]){let i=(e+16)/116,s=isNaN(t)?i:i+t/500,o=isNaN(r)?i:i-r/200;return i=1*Q(i),s=T*Q(s),o=I*Q(o),[G(3.1338561*s-1.6168667*i-.4906146*o),G(-.9787684*s+1.9161415*i+.033454*o),G(.0719453*s-.2289914*i+1.4052427*o),n]}function G(e){return(e=e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055)<0?0:e>1?1:e}function Q(e){return e>B?e*e*e:P*(e-R)}function V(e){return parseInt(e.padEnd(2,e),16)/255}function H(e,t){return j(t?e/100:e,0,1)}function j(e,t,r){return Math.min(Math.max(t,e),r)}function q(e){return!e.some(Number.isNaN)}const W={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function Y(e,t,r){return e+r*(t-e)}function X(e,t,r){return e.map(((e,n)=>Y(e,t[n],r)))}class K{constructor(e,t,r,n=1,i=!0){this.r=e,this.g=t,this.b=r,this.a=n,i||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter("rgb",[e,t,r,n]))}static parse(e){if(e instanceof K)return e;if("string"!=typeof e)return;const t=function(e){if("transparent"===(e=e.toLowerCase().trim()))return[0,0,0,0];const t=W[e];if(t){const[e,r,n]=t;return[e/255,r/255,n/255,1]}if(e.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e)){const t=e.length<6?1:2;let r=1;return[V(e.slice(r,r+=t)),V(e.slice(r,r+=t)),V(e.slice(r,r+=t)),V(e.slice(r,r+t)||"ff")]}if(e.startsWith("rgb")){const t=/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,r=e.match(t);if(r){const[e,t,n,i,s,o,a,l,c,u,h,d]=r,p=[i||" ",a||" ",u].join("");if(" "===p||" /"===p||",,"===p||",,,"===p){const e=[n,o,c].join(""),r="%%%"===e?100:""===e?255:0;if(r){const e=[j(+t/r,0,1),j(+s/r,0,1),j(+l/r,0,1),h?H(+h,d):1];if(q(e))return e}}return}}const r=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(r){const[e,t,n,i,s,o,a,l,c]=r,u=[n||" ",s||" ",a].join("");if(" "===u||" /"===u||",,"===u||",,,"===u){const e=[+t,j(+i,0,100),j(+o,0,100),l?H(+l,c):1];if(q(e))return function([e,t,r,n]){function i(n){const i=(n+e/30)%12,s=t*Math.min(r,1-r);return r-s*Math.max(-1,Math.min(i-3,9-i,1))}return e=N(e),t/=100,r/=100,[i(0),i(8),i(4),n]}(e)}}}(e);return t?new K(...t,!1):void 0}get rgb(){const{r:e,g:t,b:r,a:n}=this,i=n||1/0;return this.overwriteGetter("rgb",[e/i,t/i,r/i,n])}get hcl(){return this.overwriteGetter("hcl",function(e){const[t,r,n,i]=U(e),s=Math.sqrt(r*r+n*n);return[Math.round(1e4*s)?N(Math.atan2(n,r)*O):NaN,s,t,i]}(this.rgb))}get lab(){return this.overwriteGetter("lab",U(this.rgb))}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){const[e,t,r,n]=this.rgb;return`rgba(${[e,t,r].map((e=>Math.round(255*e))).join(",")},${n})`}static interpolate(e,t,r,n="rgb"){switch(n){case"rgb":{const[n,i,s,o]=X(e.rgb,t.rgb,r);return new K(n,i,s,o,!1)}case"hcl":{const[n,i,s,o]=e.hcl,[a,l,c,u]=t.hcl;let h,d;if(isNaN(n)||isNaN(a))isNaN(n)?isNaN(a)?h=NaN:(h=a,1!==s&&0!==s||(d=l)):(h=n,1!==c&&0!==c||(d=i));else{let e=a-n;a>n&&e>180?e-=360:a180&&(e+=360),h=n+r*e}const[p,f,m,g]=function([e,t,r,n]){return e=isNaN(e)?0:e*D,z([r,Math.cos(e)*t,Math.sin(e)*t,n])}([h,null!=d?d:Y(i,l,r),Y(s,c,r),Y(o,u,r)]);return new K(p,f,m,g,!1)}case"lab":{const[n,i,s,o]=z(X(e.lab,t.lab,r));return new K(n,i,s,o,!1)}}}}K.black=new K(0,0,0,1),K.white=new K(1,1,1,1),K.transparent=new K(0,0,0,0),K.red=new K(1,0,0,1);class ${constructor(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class J{constructor(e,t,r,n,i){this.text=e,this.image=t,this.scale=r,this.fontStack=n,this.textColor=i}}class Z{constructor(e){this.sections=e}static fromString(e){return new Z([new J(e,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((e=>0!==e.text.length||e.image&&0!==e.image.name.length))}static factory(e){return e instanceof Z?e:Z.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map((e=>e.text)).join("")}}class ee{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof ee)return e;if("number"==typeof e)return new ee([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const t of e)if("number"!=typeof t)return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new ee(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r){return new ee(X(e.values,t.values,r))}}class te{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const re=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class ne{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof ne)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let t=0;t=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[e,t,r,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof n?[e,t,r,n]:[e,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function ae(e){if(null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e||e instanceof se||e instanceof K||e instanceof $||e instanceof Z||e instanceof ee||e instanceof ne||e instanceof ie)return!0;if(Array.isArray(e)){for(const t of e)if(!ae(t))return!1;return!0}if("object"==typeof e){for(const t in e)if(!ae(e[t]))return!1;return!0}return!1}function le(e){if(null===e)return l;if("string"==typeof e)return u;if("boolean"==typeof e)return h;if("number"==typeof e)return c;if(e instanceof K)return d;if(e instanceof se)return p;if(e instanceof $)return g;if(e instanceof Z)return A;if(e instanceof ee)return y;if(e instanceof ne)return x;if(e instanceof ie)return v;if(Array.isArray(e)){const t=e.length;let r;for(const t of e){const e=le(t);if(r){if(r===e)continue;r=m;break}r=e}return _(r||m,t)}return f}function ce(e){const t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof K||e instanceof se||e instanceof Z||e instanceof ee||e instanceof ne||e instanceof ie?e.toString():JSON.stringify(e)}class ue{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(2!==e.length)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!ae(e[1]))return t.error("invalid value");const r=e[1];let n=le(r);const i=t.expectedType;return"array"!==n.kind||0!==n.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(n=i),new ue(n,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}const he={string:u,number:c,boolean:h,object:f};class de{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r,n=1;const i=e[0];if("array"===i){let i,s;if(e.length>2){const r=e[1];if("string"!=typeof r||!(r in he)||"object"===r)return t.error('The item type argument of "array" must be one of string, number, boolean',1);i=he[r],n++}else i=m;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);s=e[2],n++}r=_(i,s)}else{if(!he[i])throw new Error(`Types doesn't contain name = ${i}`);r=he[i]}const s=[];for(;ne.outputDefined()))}}const pe={"to-boolean":h,"to-color":d,"to-number":c,"to-string":u};class fe{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[0];if(!pe[r])throw new Error(`Can't parse ${r} as it is not part of the known types`);if(("to-boolean"===r||"to-string"===r)&&2!==e.length)return t.error("Expected one argument.");const n=pe[r],i=[];for(let r=1;r4?`Invalid rgba value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:oe(t[0],t[1],t[2],t[3]),!r))return new K(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new te(r||`Could not parse color from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"padding":{let t;for(const r of this.args){t=r.evaluate(e);const n=ee.parse(t);if(n)return n}throw new te(`Could not parse padding from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"variableAnchorOffsetCollection":{let t;for(const r of this.args){t=r.evaluate(e);const n=ne.parse(t);if(n)return n}throw new te(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"number":{let t=null;for(const r of this.args){if(t=r.evaluate(e),null===t)return 0;const n=Number(t);if(!isNaN(n))return n}throw new te(`Could not convert ${JSON.stringify(t)} to number.`)}case"formatted":return Z.fromString(ce(this.args[0].evaluate(e)));case"resolvedImage":return ie.fromString(ce(this.args[0].evaluate(e)));case"projectionDefinition":return this.args[0].evaluate(e);default:return ce(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}function me(e){let t=0;for(let r,n,i=0,s=e.length,o=s-1;i`[${e}]`)).join(""),this.scope=i,this.errors=s,this.expectedType=n,this._isConstant=t}parse(e,t,r,n,i={}){return t?this.concat(t,r,n)._parse(e,i):this._parse(e,i)}_parse(e,t){function r(e,t,r){return"assert"===r?new de(t,[e]):"coerce"===r?new fe(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const n=e[0];if("string"!=typeof n)return this.error(`Expression name must be a string, but found ${typeof n} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const i=this.registry[n];if(i){let n=i.parse(e,this);if(!n)return null;if(this.expectedType){const e=this.expectedType,i=n.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==i.kind)if("projectionDefinition"!==e.kind||"string"!==i.kind&&"array"!==i.kind)if("color"!==e.kind&&"formatted"!==e.kind&&"resolvedImage"!==e.kind||"value"!==i.kind&&"string"!==i.kind)if("padding"!==e.kind||"value"!==i.kind&&"number"!==i.kind&&"array"!==i.kind)if("variableAnchorOffsetCollection"!==e.kind||"value"!==i.kind&&"array"!==i.kind){if(this.checkSubtype(e,i))return null}else n=r(n,e,t.typeAnnotation||"coerce");else n=r(n,e,t.typeAnnotation||"coerce");else n=r(n,e,t.typeAnnotation||"coerce");else n=r(n,e,t.typeAnnotation||"coerce");else n=r(n,e,t.typeAnnotation||"assert")}if(!(n instanceof ue)&&"resolvedImage"!==n.type.kind&&this._isConstant(n)){const e=new ye;try{n=new ue(n.type,n.evaluate(e))}catch(e){return this.error(e.message),null}}return n}return this.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0)}return void 0===e?this.error("'undefined' value invalid. Use null instead."):"object"==typeof e?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(e,t,r){const n="number"==typeof e?this.path.concat(e):this.path,i=r?this.scope.concat(r):this.scope;return new ve(this.registry,this._isConstant,n,t||null,i,this.errors)}error(e,...t){const r=`${this.key}${t.map((e=>`[${e}]`)).join("")}`;this.errors.push(new o(r,e))}checkSubtype(e,t){const r=E(e,t);return r&&this.error(r),r}}class xe{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const r=[];for(let n=1;n=r.length)throw new te(`Array index out of bounds: ${t} > ${r.length-1}.`);if(t!==Math.floor(t))throw new te(`Array index must be an integer, but found ${t} instead.`);return r[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class we{constructor(e,t){this.type=h,this.needle=e,this.haystack=t}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,m),n=t.parse(e[2],2,m);return r&&n?M(r.type,[h,u,c,l,m])?new we(r,n):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${b(r.type)} instead`):null}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!S(t,["boolean","string","number","null"]))throw new te(`Expected first argument to be of type boolean, string, number or null, but found ${b(le(t))} instead.`);if(!S(r,["string","array"]))throw new te(`Expected second argument to be of type array or string, but found ${b(le(r))} instead.`);return r.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class Ee{constructor(e,t,r){this.type=c,this.needle=e,this.haystack=t,this.fromIndex=r}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,m),n=t.parse(e[2],2,m);if(!r||!n)return null;if(!M(r.type,[h,u,c,l,m]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${b(r.type)} instead`);if(4===e.length){const i=t.parse(e[3],3,c);return i?new Ee(r,n,i):null}return new Ee(r,n)}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!S(t,["boolean","string","number","null"]))throw new te(`Expected first argument to be of type boolean, string, number or null, but found ${b(le(t))} instead.`);let n;if(this.fromIndex&&(n=this.fromIndex.evaluate(e)),S(r,["string"])){const e=r.indexOf(t,n);return-1===e?-1:[...r.slice(0,e)].length}if(S(r,["array"]))return r.indexOf(t,n);throw new te(`Expected second argument to be of type array or string, but found ${b(le(r))} instead.`)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class Me{constructor(e,t,r,n,i,s){this.inputType=e,this.type=t,this.input=r,this.cases=n,this.outputs=i,this.otherwise=s}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return t.error("Expected an even number of arguments.");let r,n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);const i={},s=[];for(let o=2;oNumber.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof e&&Math.floor(e)!==e)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,le(e)))return null}else r=le(e);if(void 0!==i[String(e)])return c.error("Branch labels must be unique.");i[String(e)]=s.length}const u=t.parse(l,o,n);if(!u)return null;n=n||u.type,s.push(u)}const o=t.parse(e[1],1,m);if(!o)return null;const a=t.parse(e[e.length-1],e.length-1,n);return a?"value"!==o.type.kind&&t.concat(1).checkSubtype(r,o.type)?null:new Me(r,n,o,i,s,a):null}evaluate(e){const t=this.input.evaluate(e);return(le(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))&&this.otherwise.outputDefined()}}class Se{constructor(e,t,r){this.type=e,this.branches=t,this.otherwise=r}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return t.error("Expected an odd number of arguments.");let r;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);const n=[];for(let i=1;it.outputDefined()))&&this.otherwise.outputDefined()}}class Ce{constructor(e,t,r,n){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=n}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,m),n=t.parse(e[2],2,c);if(!r||!n)return null;if(!M(r.type,[_(m),u,m]))return t.error(`Expected first argument to be of type array or string, but found ${b(r.type)} instead`);if(4===e.length){const i=t.parse(e[3],3,c);return i?new Ce(r.type,r,n,i):null}return new Ce(r.type,r,n)}evaluate(e){const t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);let n;if(this.endIndex&&(n=this.endIndex.evaluate(e)),S(t,["string"]))return[...t].slice(r,n).join("");if(S(t,["array"]))return t.slice(r,n);throw new te(`Expected first argument to be of type array or string, but found ${b(le(t))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function Te(e,t){const r=e.length-1;let n,i,s=0,o=r,a=0;for(;s<=o;)if(a=Math.floor((s+o)/2),n=e[a],i=e[a+1],n<=t){if(a===r||tt))throw new te("Input is not a number.");o=a-1}return 0}class Ie{constructor(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[e,t]of r)this.labels.push(e),this.outputs.push(t)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");const r=t.parse(e[1],1,c);if(!r)return null;const n=[];let i=null;t.expectedType&&"value"!==t.expectedType.kind&&(i=t.expectedType);for(let r=1;r=s)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',a);const c=t.parse(o,l,i);if(!c)return null;i=i||c.type,n.push([s,c])}return new Ie(i,r,n)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const i=t.length;return n>=t[i-1]?r[i-1].evaluate(e):r[Te(t,n)].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function Re(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Be,Pe,Le=function(){if(Pe)return Be;function e(e,t,r,n){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=r,this.p2y=n}return Pe=1,Be=e,e.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(void 0===t&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var r=e,n=0;n<8;n++){var i=this.sampleCurveX(r)-e;if(Math.abs(i)i?o=r:a=r,r=.5*(a-o)+o;return r},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}},Be}(),De=Re(Le);class Oe{constructor(e,t,r,n,i){this.type=e,this.operator=t,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(const[e,t]of i)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,r,n){let i=0;if("exponential"===e.name)i=Ne(t,e.base,r,n);else if("linear"===e.name)i=Ne(t,1,r,n);else if("cubic-bezier"===e.name){const s=e.controlPoints;i=new De(s[0],s[1],s[2],s[3]).solve(Ne(t,1,r,n))}return i}static parse(e,t){let[r,n,i,...s]=e;if(!Array.isArray(n)||0===n.length)return t.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){const e=n[1];if("number"!=typeof e)return t.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:e}}else{if("cubic-bezier"!==n[0])return t.error(`Unknown interpolation type ${String(n[0])}`,1,0);{const e=n.slice(1);if(4!==e.length||e.some((e=>"number"!=typeof e||e<0||e>1)))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:e}}}if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(i=t.parse(i,2,c),!i)return null;const o=[];let a=null;"interpolate-hcl"===r||"interpolate-lab"===r?a=d:t.expectedType&&"value"!==t.expectedType.kind&&(a=t.expectedType);for(let e=0;e=r)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',i);const c=t.parse(n,l,a);if(!c)return null;a=a||c.type,o.push([r,c])}return C(a,c)||C(a,p)||C(a,d)||C(a,y)||C(a,x)||C(a,_(c))?new Oe(a,r,n,i,o):t.error(`Type ${b(a)} is not interpolatable.`)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const i=t.length;if(n>=t[i-1])return r[i-1].evaluate(e);const s=Te(t,n),o=t[s],a=t[s+1],l=Oe.interpolationFactor(this.interpolation,n,o,a),c=r[s].evaluate(e),u=r[s+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return Y(c,u,l);case"color":return K.interpolate(c,u,l);case"padding":return ee.interpolate(c,u,l);case"variableAnchorOffsetCollection":return ne.interpolate(c,u,l);case"array":return X(c,u,l);case"projectionDefinition":return se.interpolate(c,u,l)}case"interpolate-hcl":return K.interpolate(c,u,l,"hcl");case"interpolate-lab":return K.interpolate(c,u,l,"lab")}}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function Ne(e,t,r,n){const i=n-r,s=e-r;return 0===i?0:1===t?s/i:(Math.pow(t,s)-1)/(Math.pow(t,i)-1)}const Ue={color:K.interpolate,number:Y,padding:ee.interpolate,variableAnchorOffsetCollection:ne.interpolate,array:X};class Fe{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r=null;const n=t.expectedType;n&&"value"!==n.kind&&(r=n);const i=[];for(const n of e.slice(1)){const e=t.parse(n,1+i.length,r,void 0,{typeAnnotation:"omit"});if(!e)return null;r=r||e.type,i.push(e)}if(!r)throw new Error("No output type");const s=n&&i.some((e=>E(n,e.type)));return new Fe(s?m:r,i)}evaluate(e){let t,r=null,n=0;for(const i of this.args)if(n++,r=i.evaluate(e),r&&r instanceof ie&&!r.available&&(t||(t=r.name),r=null,n===this.args.length&&(r=t)),null!==r)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}function ke(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function ze(e,t,r,n){return 0===n.compare(t,r)}function Ge(e,t,r){const n="=="!==e&&"!="!==e;return class i{constructor(e,t,r){this.type=h,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}static parse(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");const r=e[0];let s=t.parse(e[1],1,m);if(!s)return null;if(!ke(r,s.type))return t.concat(1).error(`"${r}" comparisons are not supported for type '${b(s.type)}'.`);let o=t.parse(e[2],2,m);if(!o)return null;if(!ke(r,o.type))return t.concat(2).error(`"${r}" comparisons are not supported for type '${b(o.type)}'.`);if(s.type.kind!==o.type.kind&&"value"!==s.type.kind&&"value"!==o.type.kind)return t.error(`Cannot compare types '${b(s.type)}' and '${b(o.type)}'.`);n&&("value"===s.type.kind&&"value"!==o.type.kind?s=new de(o.type,[s]):"value"!==s.type.kind&&"value"===o.type.kind&&(o=new de(s.type,[o])));let a=null;if(4===e.length){if("string"!==s.type.kind&&"string"!==o.type.kind&&"value"!==s.type.kind&&"value"!==o.type.kind)return t.error("Cannot use collator to compare non-string types.");if(a=t.parse(e[3],3,g),!a)return null}return new i(s,o,a)}evaluate(i){const s=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){const t=le(s),r=le(o);if(t.kind!==r.kind||"string"!==t.kind&&"number"!==t.kind)throw new te(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${r.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const e=le(s),r=le(o);if("string"!==e.kind||"string"!==r.kind)return t(i,s,o)}return this.collator?r(i,s,o,this.collator.evaluate(i)):t(i,s,o)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}}}const Qe=Ge("==",(function(e,t,r){return t===r}),ze),Ve=Ge("!=",(function(e,t,r){return t!==r}),(function(e,t,r,n){return!ze(0,t,r,n)})),He=Ge("<",(function(e,t,r){return t",(function(e,t,r){return t>r}),(function(e,t,r,n){return n.compare(t,r)>0})),qe=Ge("<=",(function(e,t,r){return t<=r}),(function(e,t,r,n){return n.compare(t,r)<=0})),We=Ge(">=",(function(e,t,r){return t>=r}),(function(e,t,r,n){return n.compare(t,r)>=0}));class Ye{constructor(e,t,r){this.type=g,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(2!==e.length)return t.error("Expected one argument.");const r=e[1];if("object"!=typeof r||Array.isArray(r))return t.error("Collator options argument must be an object.");const n=t.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,h);if(!n)return null;const i=t.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,h);if(!i)return null;let s=null;return r.locale&&(s=t.parse(r.locale,1,u),!s)?null:new Ye(n,i,s)}evaluate(e){return new $(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}class Xe{constructor(e,t,r,n,i){this.type=u,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i}static parse(e,t){if(3!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,c);if(!r)return null;const n=e[2];if("object"!=typeof n||Array.isArray(n))return t.error("NumberFormat options argument must be an object.");let i=null;if(n.locale&&(i=t.parse(n.locale,1,u),!i))return null;let s=null;if(n.currency&&(s=t.parse(n.currency,1,u),!s))return null;let o=null;if(n["min-fraction-digits"]&&(o=t.parse(n["min-fraction-digits"],1,c),!o))return null;let a=null;return n["max-fraction-digits"]&&(a=t.parse(n["max-fraction-digits"],1,c),!a)?null:new Xe(r,i,s,o,a)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class Ke{constructor(e){this.type=A,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[1];if(!Array.isArray(r)&&"object"==typeof r)return t.error("First argument must be an image or text section.");const n=[];let i=!1;for(let r=1;r<=e.length-1;++r){const s=e[r];if(i&&"object"==typeof s&&!Array.isArray(s)){i=!1;let e=null;if(s["font-scale"]&&(e=t.parse(s["font-scale"],1,c),!e))return null;let r=null;if(s["text-font"]&&(r=t.parse(s["text-font"],1,_(u)),!r))return null;let o=null;if(s["text-color"]&&(o=t.parse(s["text-color"],1,d),!o))return null;const a=n[n.length-1];a.scale=e,a.font=r,a.textColor=o}else{const s=t.parse(e[r],1,m);if(!s)return null;const o=s.type.kind;if("string"!==o&&"value"!==o&&"null"!==o&&"resolvedImage"!==o)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:s,scale:null,font:null,textColor:null})}}return new Ke(n)}evaluate(e){return new Z(this.sections.map((t=>{const r=t.content.evaluate(e);return le(r)===v?new J("",r,null,null,null):new J(ce(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)})))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor)}outputDefined(){return!1}}class $e{constructor(e){this.type=v,this.input=e}static parse(e,t){if(2!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,u);return r?new $e(r):t.error("No image name provided.")}evaluate(e){const t=this.input.evaluate(e),r=ie.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r}eachChild(e){e(this.input)}outputDefined(){return!1}}class Je{constructor(e){this.type=c,this.input=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const r=t.parse(e[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?t.error(`Expected argument of type string or array, but found ${b(r.type)} instead.`):new Je(r):null}evaluate(e){const t=this.input.evaluate(e);if("string"==typeof t)return[...t].length;if(Array.isArray(t))return t.length;throw new te(`Expected value to be of type string or array, but found ${b(le(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const Ze=8192;function et(e,t){const r=(180+e[0])/360,n=(i=e[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360);var i;const s=Math.pow(2,t.z);return[Math.round(r*s*Ze),Math.round(n*s*Ze)]}function tt(e,t){const r=Math.pow(2,t.z);return[(i=(e[0]/Ze+t.x)/r,360*i-180),(n=(e[1]/Ze+t.y)/r,360/Math.PI*Math.atan(Math.exp((180-360*n)*Math.PI/180))-90)];var n,i}function rt(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function nt(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function it(e,t,r){const n=e[0]-t[0],i=e[1]-t[1],s=e[0]-r[0],o=e[1]-r[1];return n*o-s*i==0&&n*s<=0&&i*o<=0}function st(e,t,r,n){const i=[t[0]-e[0],t[1]-e[1]];return 0!=(s=[n[0]-r[0],n[1]-r[1]])[0]*(o=i)[1]-s[1]*o[0]&&!(!ht(e,t,r,n)||!ht(r,n,e,t));var s,o}function ot(e,t,r){for(const n of r)for(let r=0;ri[1]!=o[1]>i[1]&&i[0]<(o[0]-s[0])*(i[1]-s[1])/(o[1]-s[1])+s[0]&&(n=!n)}var i,s,o;return n}function lt(e,t){for(const r of t)if(at(e,r))return!0;return!1}function ct(e,t){for(const r of e)if(!at(r,t))return!1;for(let r=0;r0&&h<0||u<0&&h>0}function dt(e,t,r){const n=[];for(let i=0;ir[2]){const t=.5*n;let i=e[0]-r[0]>t?-n:r[0]-e[0]>t?n:0;0===i&&(i=e[0]-r[2]>t?-n:r[2]-e[0]>t?n:0),e[0]+=i}rt(t,e)}function mt(e,t,r,n){const i=Math.pow(2,n.z)*Ze,s=[n.x*Ze,n.y*Ze],o=[];for(const n of e)for(const e of n){const n=[e.x+s[0],e.y+s[1]];ft(n,t,r,i),o.push(n)}return o}function gt(e,t,r,n){const i=Math.pow(2,n.z)*Ze,s=[n.x*Ze,n.y*Ze],o=[];for(const r of e){const e=[];for(const n of r){const r=[n.x+s[0],n.y+s[1]];rt(t,r),e.push(r)}o.push(e)}if(t[2]-t[0]<=i/2){(a=t)[0]=a[1]=1/0,a[2]=a[3]=-1/0;for(const e of o)for(const n of e)ft(n,t,r,i)}var a;return o}class At{constructor(e,t){this.type=h,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(ae(e[1])){const t=e[1];if("FeatureCollection"===t.type){const e=[];for(const r of t.features){const{type:t,coordinates:n}=r.geometry;"Polygon"===t&&e.push(n),"MultiPolygon"===t&&e.push(...n)}if(e.length)return new At(t,{type:"MultiPolygon",coordinates:e})}else if("Feature"===t.type){const e=t.geometry.type;if("Polygon"===e||"MultiPolygon"===e)return new At(t,t.geometry)}else if("Polygon"===t.type||"MultiPolygon"===t.type)return new At(t,t)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryDollarType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if("Polygon"===t.type){const s=dt(t.coordinates,n,i),o=mt(e.geometry(),r,n,i);if(!nt(r,n))return!1;for(const e of o)if(!at(e,s))return!1}if("MultiPolygon"===t.type){const s=pt(t.coordinates,n,i),o=mt(e.geometry(),r,n,i);if(!nt(r,n))return!1;for(const e of o)if(!lt(e,s))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryDollarType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if("Polygon"===t.type){const s=dt(t.coordinates,n,i),o=gt(e.geometry(),r,n,i);if(!nt(r,n))return!1;for(const e of o)if(!ct(e,s))return!1}if("MultiPolygon"===t.type){const s=pt(t.coordinates,n,i),o=gt(e.geometry(),r,n,i);if(!nt(r,n))return!1;for(const e of o)if(!ut(e,s))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class yt{constructor(e=[],t=(e,t)=>et?1:0){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(0===this.length)return;const e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:r}=this,n=t[e];for(;e>0;){const i=e-1>>1,s=t[i];if(r(n,s)>=0)break;t[e]=s,e=i}t[e]=n}_down(e){const{data:t,compare:r}=this,n=this.length>>1,i=t[e];for(;e=0)break;t[e]=t[n],e=n}t[e]=i}}const vt=1/298.257223563,xt=vt*(2-vt),_t=Math.PI/180;class bt{constructor(e){const t=6378.137*_t*1e3,r=Math.cos(e*_t),n=1/(1-xt*(1-r*r)),i=Math.sqrt(n);this.kx=t*i*r,this.ky=t*i*n*(1-xt)}distance(e,t){const r=this.wrap(e[0]-t[0])*this.kx,n=(e[1]-t[1])*this.ky;return Math.sqrt(r*r+n*n)}pointOnLine(e,t){let r,n,i,s,o=1/0;for(let a=0;a1?(l=e[a+1][0],c=e[a+1][1]):d>0&&(l+=u/this.kx*d,c+=h/this.ky*d)),u=this.wrap(t[0]-l)*this.kx,h=(t[1]-c)*this.ky;const p=u*u+h*h;p180;)e-=360;return e}}function wt(e,t){return t[0]-e[0]}function Et(e){return e[1]-e[0]+1}function Mt(e,t){return e[1]>=e[0]&&e[1]e[1])return[null,null];const r=Et(e);if(t){if(2===r)return[e,null];const t=Math.floor(r/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}if(1===r)return[e,null];const n=Math.floor(r/2)-1;return[[e[0],e[0]+n],[e[0]+n+1,e[1]]]}function Ct(e,t){if(!Mt(t,e.length))return[1/0,1/0,-1/0,-1/0];const r=[1/0,1/0,-1/0,-1/0];for(let n=t[0];n<=t[1];++n)rt(r,e[n]);return r}function Tt(e){const t=[1/0,1/0,-1/0,-1/0];for(const r of e)for(const e of r)rt(t,e);return t}function It(e){return e[0]!==-1/0&&e[1]!==-1/0&&e[2]!==1/0&&e[3]!==1/0}function Rt(e,t,r){if(!It(e)||!It(t))return NaN;let n=0,i=0;return e[2]t[2]&&(n=e[0]-t[2]),e[1]>t[3]&&(i=e[1]-t[3]),e[3]=n)return n;if(nt(i,s)){if(Ut(e,t))return 0}else if(Ut(t,e))return 0;let o=1/0;for(const n of e)for(let e=0,i=n.length,s=i-1;e0;){const i=o.pop();if(i[0]>=s)continue;const l=i[1],c=t?50:100;if(Et(l)<=c){if(!Mt(l,e.length))return NaN;if(t){const t=Nt(e,l,r,n);if(isNaN(t)||0===t)return t;s=Math.min(s,t)}else for(let t=l[0];t<=l[1];++t){const i=Ot(e[t],r,n);if(s=Math.min(s,i),0===s)return 0}}else{const r=St(l,t);kt(o,s,n,e,a,r[0]),kt(o,s,n,e,a,r[1])}}return s}function Qt(e,t,r,n,i,s=1/0){let o=Math.min(s,i.distance(e[0],r[0]));if(0===o)return o;const a=new yt([[0,[0,e.length-1],[0,r.length-1]]],wt);for(;a.length>0;){const s=a.pop();if(s[0]>=o)continue;const l=s[1],c=s[2],u=t?50:100,h=n?50:100;if(Et(l)<=u&&Et(c)<=h){if(!Mt(l,e.length)&&Mt(c,r.length))return NaN;let s;if(t&&n)s=Lt(e,l,r,c,i),o=Math.min(o,s);else if(t&&!n){const t=e.slice(l[0],l[1]+1);for(let e=c[0];e<=c[1];++e)if(s=Bt(r[e],t,i),o=Math.min(o,s),0===o)return o}else if(!t&&n){const t=r.slice(c[0],c[1]+1);for(let r=l[0];r<=l[1];++r)if(s=Bt(e[r],t,i),o=Math.min(o,s),0===o)return o}else s=Dt(e,l,r,c,i),o=Math.min(o,s)}else{const s=St(l,t),u=St(c,n);zt(a,o,i,e,r,s[0],u[0]),zt(a,o,i,e,r,s[0],u[1]),zt(a,o,i,e,r,s[1],u[0]),zt(a,o,i,e,r,s[1],u[1])}}return o}function Vt(e){return"MultiPolygon"===e.type?e.coordinates.map((e=>({type:"Polygon",coordinates:e}))):"MultiLineString"===e.type?e.coordinates.map((e=>({type:"LineString",coordinates:e}))):"MultiPoint"===e.type?e.coordinates.map((e=>({type:"Point",coordinates:e}))):[e]}class Ht{constructor(e,t){this.type=c,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(ae(e[1])){const t=e[1];if("FeatureCollection"===t.type)return new Ht(t,t.features.map((e=>Vt(e.geometry))).flat());if("Feature"===t.type)return new Ht(t,Vt(t.geometry));if("type"in t&&"coordinates"in t)return new Ht(t,Vt(t))}return t.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){const r=e.geometry(),n=r.flat().map((t=>tt([t.x,t.y],e.canonical)));if(0===r.length)return NaN;const i=new bt(n[0][1]);let s=1/0;for(const e of t){switch(e.type){case"Point":s=Math.min(s,Qt(n,!1,[e.coordinates],!1,i,s));break;case"LineString":s=Math.min(s,Qt(n,!1,e.coordinates,!0,i,s));break;case"Polygon":s=Math.min(s,Gt(n,!1,e.coordinates,i,s))}if(0===s)return s}return s}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){const r=e.geometry(),n=r.flat().map((t=>tt([t.x,t.y],e.canonical)));if(0===r.length)return NaN;const i=new bt(n[0][1]);let s=1/0;for(const e of t){switch(e.type){case"Point":s=Math.min(s,Qt(n,!0,[e.coordinates],!1,i,s));break;case"LineString":s=Math.min(s,Qt(n,!0,e.coordinates,!0,i,s));break;case"Polygon":s=Math.min(s,Gt(n,!0,e.coordinates,i,s))}if(0===s)return s}return s}(e,this.geometries);if("Polygon"===e.geometryType())return function(e,t){const r=e.geometry();if(0===r.length||0===r[0].length)return NaN;const n=function(e){if(e.length<=1)return[e];const t=[];let r,n;for(const i of e){const e=me(i);0!==e&&(i.area=Math.abs(e),void 0===n&&(n=e<0),n===e<0?(r&&t.push(r),r=[i]):r.push(i))}return r&&t.push(r),t}(r).map((t=>t.map((t=>t.map((t=>tt([t.x,t.y],e.canonical))))))),i=new bt(n[0][0][0][1]);let s=1/0;for(const e of t)for(const t of n){switch(e.type){case"Point":s=Math.min(s,Gt([e.coordinates],!1,t,i,s));break;case"LineString":s=Math.min(s,Gt(e.coordinates,!0,t,i,s));break;case"Polygon":s=Math.min(s,Ft(t,e.coordinates,i,s))}if(0===s)return s}return s}(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const jt={"==":Qe,"!=":Ve,">":je,"<":He,">=":We,"<=":qe,array:de,at:be,boolean:de,case:Se,coalesce:Fe,collator:Ye,format:Ke,image:$e,in:we,"index-of":Ee,interpolate:Oe,"interpolate-hcl":Oe,"interpolate-lab":Oe,length:Je,let:xe,literal:ue,match:Me,number:de,"number-format":Xe,object:de,slice:Ce,step:Ie,string:de,"to-boolean":fe,"to-color":fe,"to-number":fe,"to-string":fe,var:_e,within:At,distance:Ht};class qt{constructor(e,t,r,n){this.name=e,this.type=t,this._evaluate=r,this.args=n}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,t){const r=e[0],n=qt.definitions[r];if(!n)return t.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);const i=Array.isArray(n)?n[0]:n.type,s=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,o=s.filter((([t])=>!Array.isArray(t)||t.length===e.length-1));let a=null;for(const[n,s]of o){a=new ve(t.registry,$t,t.path,null,t.scope);const o=[];let l=!1;for(let t=1;t{return t=e,Array.isArray(t)?`(${t.map(b).join(", ")})`:`(${b(t.type)}...)`;var t})).join(" | "),n=[];for(let r=1;r{r=t?r&&$t(e):r&&e instanceof ue})),!!r&&Jt(e)&&er(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Jt(e){if(e instanceof qt){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof At)return!1;if(e instanceof Ht)return!1;let t=!0;return e.eachChild((e=>{t&&!Jt(e)&&(t=!1)})),t}function Zt(e){if(e instanceof qt&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild((e=>{t&&!Zt(e)&&(t=!1)})),t}function er(e,t){if(e instanceof qt&&t.indexOf(e.name)>=0)return!1;let r=!0;return e.eachChild((e=>{r&&!er(e,t)&&(r=!1)})),r}function tr(e){return{result:"success",value:e}}function rr(e){return{result:"error",value:e}}function nr(e){return"data-driven"===e["property-type"]||"cross-faded-data-driven"===e["property-type"]}function ir(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function sr(e){return!!e.expression&&e.expression.interpolated}function or(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}function ar(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function lr(e){return e}function cr(e,t){const r="color"===t.type,n=e.stops&&"object"==typeof e.stops[0][0],i=n||void 0!==e.property,o=n||!i,a=e.type||(sr(t)?"exponential":"interval");if(r||"padding"===t.type){const n=r?K.parse:ee.parse;(e=s({},e)).stops&&(e.stops=e.stops.map((e=>[e[0],n(e[1])]))),e.default?e.default=n(e.default):e.default=n(t.default)}if(e.colorSpace&&"rgb"!==(l=e.colorSpace)&&"hcl"!==l&&"lab"!==l)throw new Error(`Unknown color space: "${e.colorSpace}"`);var l;let c,u,h;if("exponential"===a)c=pr;else if("interval"===a)c=dr;else if("categorical"===a){c=hr,u=Object.create(null);for(const t of e.stops)u[t[0]]=t[1];h=typeof e.stops[0][0]}else{if("identity"!==a)throw new Error(`Unknown function type "${a}"`);c=fr}if(n){const r={},n=[];for(let t=0;te[0])),evaluate:({zoom:r},n)=>pr({stops:i,base:e.base},t,r).evaluate(r,n)}}if(o){const r="exponential"===a?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:r,interpolationFactor:Oe.interpolationFactor.bind(void 0,r),zoomStops:e.stops.map((e=>e[0])),evaluate:({zoom:r})=>c(e,t,r,u,h)}}return{kind:"source",evaluate(r,n){const i=n&&n.properties?n.properties[e.property]:void 0;return void 0===i?ur(e.default,t.default):c(e,t,i,u,h)}}}function ur(e,t,r){return void 0!==e?e:void 0!==t?t:void 0!==r?r:void 0}function hr(e,t,r,n,i){return ur(typeof r===i?n[r]:void 0,e.default,t.default)}function dr(e,t,r){if("number"!==or(r))return ur(e.default,t.default);const n=e.stops.length;if(1===n)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[n-1][0])return e.stops[n-1][1];const i=Te(e.stops.map((e=>e[0])),r);return e.stops[i][1]}function pr(e,t,r){const n=void 0!==e.base?e.base:1;if("number"!==or(r))return ur(e.default,t.default);const i=e.stops.length;if(1===i)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[i-1][0])return e.stops[i-1][1];const s=Te(e.stops.map((e=>e[0])),r),o=function(e,t,r,n){const i=n-r,s=e-r;return 0===i?0:1===t?s/i:(Math.pow(t,s)-1)/(Math.pow(t,i)-1)}(r,n,e.stops[s][0],e.stops[s+1][0]),a=e.stops[s][1],l=e.stops[s+1][1],c=Ue[t.type]||lr;return"function"==typeof a.evaluate?{evaluate(...t){const r=a.evaluate.apply(void 0,t),n=l.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return c(r,n,o,e.colorSpace)}}:c(a,l,o,e.colorSpace)}function fr(e,t,r){switch(t.type){case"color":r=K.parse(r);break;case"formatted":r=Z.fromString(r.toString());break;case"resolvedImage":r=ie.fromString(r.toString());break;case"padding":r=ee.parse(r);break;default:or(r)===t.type||"enum"===t.type&&t.values[r]||(r=void 0)}return ur(r,e.default,t.default)}qt.register(jt,{error:[{kind:"error"},[u],(e,[t])=>{throw new te(t.evaluate(e))}],typeof:[u,[m],(e,[t])=>b(le(t.evaluate(e)))],"to-rgba":[_(c,4),[d],(e,[t])=>{const[r,n,i,s]=t.evaluate(e).rgb;return[255*r,255*n,255*i,s]}],rgb:[d,[c,c,c],Wt],rgba:[d,[c,c,c,c],Wt],has:{type:h,overloads:[[[u],(e,[t])=>Yt(t.evaluate(e),e.properties())],[[u,f],(e,[t,r])=>Yt(t.evaluate(e),r.evaluate(e))]]},get:{type:m,overloads:[[[u],(e,[t])=>Xt(t.evaluate(e),e.properties())],[[u,f],(e,[t,r])=>Xt(t.evaluate(e),r.evaluate(e))]]},"feature-state":[m,[u],(e,[t])=>Xt(t.evaluate(e),e.featureState||{})],properties:[f,[],e=>e.properties()],"geometry-type":[u,[],e=>e.geometryType()],id:[m,[],e=>e.id()],zoom:[c,[],e=>e.globals.zoom],"heatmap-density":[c,[],e=>e.globals.heatmapDensity||0],"line-progress":[c,[],e=>e.globals.lineProgress||0],accumulated:[m,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[c,Kt(c),(e,t)=>{let r=0;for(const n of t)r+=n.evaluate(e);return r}],"*":[c,Kt(c),(e,t)=>{let r=1;for(const n of t)r*=n.evaluate(e);return r}],"-":{type:c,overloads:[[[c,c],(e,[t,r])=>t.evaluate(e)-r.evaluate(e)],[[c],(e,[t])=>-t.evaluate(e)]]},"/":[c,[c,c],(e,[t,r])=>t.evaluate(e)/r.evaluate(e)],"%":[c,[c,c],(e,[t,r])=>t.evaluate(e)%r.evaluate(e)],ln2:[c,[],()=>Math.LN2],pi:[c,[],()=>Math.PI],e:[c,[],()=>Math.E],"^":[c,[c,c],(e,[t,r])=>Math.pow(t.evaluate(e),r.evaluate(e))],sqrt:[c,[c],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[c,[c],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[c,[c],(e,[t])=>Math.log(t.evaluate(e))],log2:[c,[c],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[c,[c],(e,[t])=>Math.sin(t.evaluate(e))],cos:[c,[c],(e,[t])=>Math.cos(t.evaluate(e))],tan:[c,[c],(e,[t])=>Math.tan(t.evaluate(e))],asin:[c,[c],(e,[t])=>Math.asin(t.evaluate(e))],acos:[c,[c],(e,[t])=>Math.acos(t.evaluate(e))],atan:[c,[c],(e,[t])=>Math.atan(t.evaluate(e))],min:[c,Kt(c),(e,t)=>Math.min(...t.map((t=>t.evaluate(e))))],max:[c,Kt(c),(e,t)=>Math.max(...t.map((t=>t.evaluate(e))))],abs:[c,[c],(e,[t])=>Math.abs(t.evaluate(e))],round:[c,[c],(e,[t])=>{const r=t.evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[c,[c],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[c,[c],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[h,[u,m],(e,[t,r])=>e.properties()[t.value]===r.value],"filter-id-==":[h,[m],(e,[t])=>e.id()===t.value],"filter-type-==":[h,[u],(e,[t])=>e.geometryDollarType()===t.value],"filter-<":[h,[u,m],(e,[t,r])=>{const n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n{const r=e.id(),n=t.value;return typeof r==typeof n&&r":[h,[u,m],(e,[t,r])=>{const n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n>i}],"filter-id->":[h,[m],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r>n}],"filter-<=":[h,[u,m],(e,[t,r])=>{const n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n<=i}],"filter-id-<=":[h,[m],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r<=n}],"filter->=":[h,[u,m],(e,[t,r])=>{const n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n>=i}],"filter-id->=":[h,[m],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r>=n}],"filter-has":[h,[m],(e,[t])=>t.value in e.properties()],"filter-has-id":[h,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[h,[_(u)],(e,[t])=>t.value.indexOf(e.geometryDollarType())>=0],"filter-id-in":[h,[_(m)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[h,[u,_(m)],(e,[t,r])=>r.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[h,[u,_(m)],(e,[t,r])=>function(e,t,r,n){for(;r<=n;){const i=r+n>>1;if(t[i]===e)return!0;t[i]>e?n=i-1:r=i+1}return!1}(e.properties()[t.value],r.value,0,r.value.length-1)],all:{type:h,overloads:[[[h,h],(e,[t,r])=>t.evaluate(e)&&r.evaluate(e)],[Kt(h),(e,t)=>{for(const r of t)if(!r.evaluate(e))return!1;return!0}]]},any:{type:h,overloads:[[[h,h],(e,[t,r])=>t.evaluate(e)||r.evaluate(e)],[Kt(h),(e,t)=>{for(const r of t)if(r.evaluate(e))return!0;return!1}]]},"!":[h,[h],(e,[t])=>!t.evaluate(e)],"is-supported-script":[h,[u],(e,[t])=>{const r=e.globals&&e.globals.isSupportedScript;return!r||r(t.evaluate(e))}],upcase:[u,[u],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[u,[u],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[u,Kt(m),(e,t)=>t.map((t=>ce(t.evaluate(e)))).join("")],"resolved-locale":[u,[g],(e,[t])=>t.evaluate(e).resolvedLocale()]});class mr{constructor(e,t){var r;this.expression=e,this._warningHistory={},this._evaluator=new ye,this._defaultValue=t?"color"===(r=t).type&&ar(r.default)?new K(0,0,0,0):"color"===r.type?K.parse(r.default)||null:"padding"===r.type?ee.parse(r.default)||null:"variableAnchorOffsetCollection"===r.type?ne.parse(r.default)||null:"projectionDefinition"===r.type?se.parse(r.default)||null:void 0===r.default?null:r.default:null,this._enumValues=t&&"enum"===t.type?t.values:null}evaluateWithoutErrorHandling(e,t,r,n,i,s){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=s,this.expression.evaluate(this._evaluator)}evaluate(e,t,r,n,i,s){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=s||null;try{const e=this.expression.evaluate(this._evaluator);if(null==e||"number"==typeof e&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new te(`Expected value to be one of ${Object.keys(this._enumValues).map((e=>JSON.stringify(e))).join(", ")}, but found ${JSON.stringify(e)} instead.`);return e}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,"undefined"!=typeof console&&console.warn(e.message)),this._defaultValue}}}function gr(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in jt}function Ar(e,t){const r=new ve(jt,$t,[],t?function(e){const t={color:d,string:u,number:c,enum:u,boolean:h,formatted:A,padding:y,projectionDefinition:p,resolvedImage:v,variableAnchorOffsetCollection:x};return"array"===e.type?_(t[e.value]||m,e.length):t[e.type]}(t):void 0),n=r.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return n?tr(new mr(n,t)):rr(r.errors)}class yr{constructor(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!Zt(t.expression)}evaluateWithoutErrorHandling(e,t,r,n,i,s){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,s)}evaluate(e,t,r,n,i,s){return this._styleExpression.evaluate(e,t,r,n,i,s)}}class vr{constructor(e,t,r,n){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!Zt(t.expression),this.interpolationType=n}evaluateWithoutErrorHandling(e,t,r,n,i,s){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,s)}evaluate(e,t,r,n,i,s){return this._styleExpression.evaluate(e,t,r,n,i,s)}interpolationFactor(e,t,r){return this.interpolationType?Oe.interpolationFactor(this.interpolationType,e,t,r):0}}function xr(e,t){const r=Ar(e,t);if("error"===r.result)return r;const n=r.value.expression,i=Jt(n);if(!i&&!nr(t))return rr([new o("","data expressions not supported")]);const s=er(n,["zoom"]);if(!s&&!ir(t))return rr([new o("","zoom expressions not supported")]);const a=br(n);if(!a&&!s)return rr([new o("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof o)return rr([a]);if(a instanceof Oe&&!sr(t))return rr([new o("",'"interpolate" expressions cannot be used with this property')]);if(!a)return tr(new yr(i?"constant":"source",r.value));const l=a instanceof Oe?a.interpolation:void 0;return tr(new vr(i?"camera":"composite",r.value,a.labels,l))}class _r{constructor(e,t){this._parameters=e,this._specification=t,s(this,cr(this._parameters,this._specification))}static deserialize(e){return new _r(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function br(e){let t=null;if(e instanceof xe)t=br(e.result);else if(e instanceof Fe){for(const r of e.args)if(t=br(r),t)break}else(e instanceof Ie||e instanceof Oe)&&e.input instanceof qt&&"zoom"===e.input.name&&(t=e);return t instanceof o||e.eachChild((e=>{const r=br(e);r instanceof o?t=r:!t&&r?t=new o("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&r&&t!==r&&(t=new o("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),t}function wr(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(const t of e.slice(1))if(!wr(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}}const Er={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Mr(e){if(null==e)return{filter:()=>!0,needGeometry:!1};wr(e)||(e=Tr(e));const t=Ar(e,Er);if("error"===t.result)throw new Error(t.value.map((e=>`${e.key}: ${e.message}`)).join(", "));return{filter:(e,r,n)=>t.value.evaluate(e,r,{},n),needGeometry:Cr(e)}}function Sr(e,t){return et?1:0}function Cr(e){if(!Array.isArray(e))return!1;if("within"===e[0]||"distance"===e[0])return!0;for(let t=1;t"===t||"<="===t||">="===t?Ir(e[1],e[2],t):"any"===t?(r=e.slice(1),["any"].concat(r.map(Tr))):"all"===t?["all"].concat(e.slice(1).map(Tr)):"none"===t?["all"].concat(e.slice(1).map(Tr).map(Pr)):"in"===t?Rr(e[1],e.slice(2)):"!in"===t?Pr(Rr(e[1],e.slice(2))):"has"===t?Br(e[1]):"!has"!==t||Pr(Br(e[1]));var r}function Ir(e,t,r){switch(e){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,e,t]}}function Rr(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((e=>typeof e!=typeof t[0]))?["filter-in-large",e,["literal",t.sort(Sr)]]:["filter-in-small",e,["literal",t]]}}function Br(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function Pr(e){return["!",e]}function Lr(e){const t=e.key,r=e.value;return r?[new i(t,r,"constants have been deprecated as of v8")]:[]}function Dr(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function Or(e){if(Array.isArray(e))return e.map(Or);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){const t={};for(const r in e)t[r]=Or(e[r]);return t}return Dr(e)}function Nr(e){const t=e.key,r=e.value,n=e.valueSpec||{},s=e.objectElementValidators||{},o=e.style,a=e.styleSpec,l=e.validateSpec;let c=[];const u=or(r);if("object"!==u)return[new i(t,r,`object expected, ${u} found`)];for(const e in r){const u=e.split(".")[0],h=n[u]||n["*"];let d;if(s[u])d=s[u];else if(n[u])d=l;else if(s["*"])d=s["*"];else{if(!n["*"]){c.push(new i(t,r[e],`unknown property "${e}"`));continue}d=l}c=c.concat(d({key:(t?`${t}.`:t)+e,value:r[e],valueSpec:h,style:o,styleSpec:a,object:r,objectKey:e,validateSpec:l},r))}for(const e in n)s[e]||n[e].required&&void 0===n[e].default&&void 0===r[e]&&c.push(new i(t,r,`missing required property "${e}"`));return c}function Ur(e){const t=e.value,r=e.valueSpec,n=e.validateSpec,s=e.style,o=e.styleSpec,a=e.key,l=e.arrayElementValidator||n;if("array"!==or(t))return[new i(a,t,`array expected, ${or(t)} found`)];if(r.length&&t.length!==r.length)return[new i(a,t,`array length ${r.length} expected, length ${t.length} found`)];if(r["min-length"]&&t.lengthn.maximum?[new i(t,r,`${r} is greater than the maximum value ${n.maximum}`)]:[]}function kr(e){const t=e.valueSpec,r=Dr(e.value.type);let n,s,o,a={};const l="categorical"!==r&&void 0===e.value.property,c=!l,u="array"===or(e.value.stops)&&"array"===or(e.value.stops[0])&&"object"===or(e.value.stops[0][0]),h=Nr({key:e.key,value:e.value,valueSpec:e.styleSpec.function,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(e){if("identity"===r)return[new i(e.key,e.value,'identity function may not have a "stops" property')];let t=[];const n=e.value;return t=t.concat(Ur({key:e.key,value:n,valueSpec:e.valueSpec,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:d})),"array"===or(n)&&0===n.length&&t.push(new i(e.key,n,"array must have at least one stop")),t},default:function(e){return e.validateSpec({key:e.key,value:e.value,valueSpec:t,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===r&&l&&h.push(new i(e.key,e.value,'missing required property "property"')),"identity"===r||e.value.stops||h.push(new i(e.key,e.value,'missing required property "stops"')),"exponential"===r&&e.valueSpec.expression&&!sr(e.valueSpec)&&h.push(new i(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(c&&!nr(e.valueSpec)?h.push(new i(e.key,e.value,"property functions not supported")):l&&!ir(e.valueSpec)&&h.push(new i(e.key,e.value,"zoom functions not supported"))),"categorical"!==r&&!u||void 0!==e.value.property||h.push(new i(e.key,e.value,'"property" property is required')),h;function d(e){let r=[];const n=e.value,l=e.key;if("array"!==or(n))return[new i(l,n,`array expected, ${or(n)} found`)];if(2!==n.length)return[new i(l,n,`array length 2 expected, length ${n.length} found`)];if(u){if("object"!==or(n[0]))return[new i(l,n,`object expected, ${or(n[0])} found`)];if(void 0===n[0].zoom)return[new i(l,n,"object stop key must have zoom")];if(void 0===n[0].value)return[new i(l,n,"object stop key must have value")];if(o&&o>Dr(n[0].zoom))return[new i(l,n[0].zoom,"stop zoom values must appear in ascending order")];Dr(n[0].zoom)!==o&&(o=Dr(n[0].zoom),s=void 0,a={}),r=r.concat(Nr({key:`${l}[0]`,value:n[0],valueSpec:{zoom:{}},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:Fr,value:p}}))}else r=r.concat(p({key:`${l}[0]`,value:n[0],valueSpec:{},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec},n));return gr(Or(n[1]))?r.concat([new i(`${l}[1]`,n[1],"expressions are not allowed in function stops.")]):r.concat(e.validateSpec({key:`${l}[1]`,value:n[1],valueSpec:t,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec}))}function p(e,o){const l=or(e.value),c=Dr(e.value),u=null!==e.value?e.value:o;if(n){if(l!==n)return[new i(e.key,u,`${l} stop domain type must match previous stop domain type ${n}`)]}else n=l;if("number"!==l&&"string"!==l&&"boolean"!==l)return[new i(e.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==l&&"categorical"!==r){let n=`number expected, ${l} found`;return nr(t)&&void 0===r&&(n+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new i(e.key,u,n)]}return"categorical"!==r||"number"!==l||isFinite(c)&&Math.floor(c)===c?"categorical"!==r&&"number"===l&&void 0!==s&&cnew i(`${e.key}${t.key}`,e.value,t.message)));const r=t.value.expression||t.value._styleExpression.expression;if("property"===e.expressionContext&&"text-font"===e.propertyKey&&!r.outputDefined())return[new i(e.key,e.value,`Invalid data expression for "${e.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===e.expressionContext&&"layout"===e.propertyType&&!Zt(r))return[new i(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===e.expressionContext&&!Zt(r))return[new i(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&0===e.expressionContext.indexOf("cluster")){if(!er(r,["zoom","feature-state"]))return[new i(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===e.expressionContext&&!Jt(r))return[new i(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Gr(e){const t=e.key,r=e.value,n=e.valueSpec,s=[];return Array.isArray(n.values)?-1===n.values.indexOf(Dr(r))&&s.push(new i(t,r,`expected one of [${n.values.join(", ")}], ${JSON.stringify(r)} found`)):-1===Object.keys(n.values).indexOf(Dr(r))&&s.push(new i(t,r,`expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(r)} found`)),s}function Qr(e){return wr(Or(e.value))?zr(s({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Vr(e)}function Vr(e){const t=e.value,r=e.key;if("array"!==or(t))return[new i(r,t,`array expected, ${or(t)} found`)];const n=e.styleSpec;let s,o=[];if(t.length<1)return[new i(r,t,"filter array must have at least 1 element")];switch(o=o.concat(Gr({key:`${r}[0]`,value:t[0],valueSpec:n.filter_operator,style:e.style,styleSpec:e.styleSpec})),Dr(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&"$type"===Dr(t[1])&&o.push(new i(r,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":3!==t.length&&o.push(new i(r,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(s=or(t[1]),"string"!==s&&o.push(new i(`${r}[1]`,t[1],`string expected, ${s} found`)));for(let a=2;a{e in r&&t.push(new i(n,r[e],`"${e}" is prohibited for ref layers`))})),o.layers.forEach((t=>{Dr(t.id)===c&&(e=t)})),e?e.ref?t.push(new i(n,r.ref,"ref cannot reference another ref layer")):l=Dr(e.type):t.push(new i(n,r.ref,`ref layer "${c}" not found`))}else if("background"!==l)if(r.source){const e=o.sources&&o.sources[r.source],s=e&&Dr(e.type);e?"vector"===s&&"raster"===l?t.push(new i(n,r.source,`layer "${r.id}" requires a raster source`)):"raster-dem"!==s&&"hillshade"===l?t.push(new i(n,r.source,`layer "${r.id}" requires a raster-dem source`)):"raster"===s&&"raster"!==l?t.push(new i(n,r.source,`layer "${r.id}" requires a vector source`)):"vector"!==s||r["source-layer"]?"raster-dem"===s&&"hillshade"!==l?t.push(new i(n,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==l||!r.paint||!r.paint["line-gradient"]||"geojson"===s&&e.lineMetrics||t.push(new i(n,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new i(n,r,`layer "${r.id}" must specify a "source-layer"`)):t.push(new i(n,r.source,`source "${r.source}" not found`))}else t.push(new i(n,r,'missing required property "source"'));return t=t.concat(Nr({key:n,value:r,valueSpec:a.layer,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":()=>[],type:()=>e.validateSpec({key:`${n}.type`,value:r.type,valueSpec:a.layer.type,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,object:r,objectKey:"type"}),filter:Qr,layout:e=>Nr({layer:r,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":e=>qr(s({layerType:l},e))}}),paint:e=>Nr({layer:r,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":e=>jr(s({layerType:l},e))}})}})),t}function Yr(e){const t=e.value,r=e.key,n=or(t);return"string"!==n?[new i(r,t,`string expected, ${n} found`)]:[]}const Xr={promoteId:function({key:e,value:t}){if("string"===or(t))return Yr({key:e,value:t});{const r=[];for(const n in t)r.push(...Yr({key:`${e}.${n}`,value:t[n]}));return r}}};function Kr(e){const t=e.value,r=e.key,n=e.styleSpec,s=e.style,o=e.validateSpec;if(!t.type)return[new i(r,t,'"type" is required')];const a=Dr(t.type);let l;switch(a){case"vector":case"raster":return l=Nr({key:r,value:t,valueSpec:n[`source_${a.replace("-","_")}`],style:e.style,styleSpec:n,objectElementValidators:Xr,validateSpec:o}),l;case"raster-dem":return l=function(e){var t;const r=null!==(t=e.sourceName)&&void 0!==t?t:"",n=e.value,s=e.styleSpec,o=s.source_raster_dem,a=e.style;let l=[];const c=or(n);if(void 0===n)return l;if("object"!==c)return l.push(new i("source_raster_dem",n,`object expected, ${c} found`)),l;const u="custom"===Dr(n.encoding),h=["redFactor","greenFactor","blueFactor","baseShift"],d=e.value.encoding?`"${e.value.encoding}"`:"Default";for(const t in n)!u&&h.includes(t)?l.push(new i(t,n[t],`In "${r}": "${t}" is only valid when "encoding" is set to "custom". ${d} encoding found`)):o[t]?l=l.concat(e.validateSpec({key:t,value:n[t],valueSpec:o[t],validateSpec:e.validateSpec,style:a,styleSpec:s})):l.push(new i(t,n[t],`unknown property "${t}"`));return l}({sourceName:r,value:t,style:e.style,styleSpec:n,validateSpec:o}),l;case"geojson":if(l=Nr({key:r,value:t,valueSpec:n.source_geojson,style:s,styleSpec:n,validateSpec:o,objectElementValidators:Xr}),t.cluster)for(const e in t.clusterProperties){const[n,i]=t.clusterProperties[e],s="string"==typeof n?[n,["accumulated"],["get",e]]:n;l.push(...zr({key:`${r}.${e}.map`,value:i,validateSpec:o,expressionContext:"cluster-map"})),l.push(...zr({key:`${r}.${e}.reduce`,value:s,validateSpec:o,expressionContext:"cluster-reduce"}))}return l;case"video":return Nr({key:r,value:t,valueSpec:n.source_video,style:s,validateSpec:o,styleSpec:n});case"image":return Nr({key:r,value:t,valueSpec:n.source_image,style:s,validateSpec:o,styleSpec:n});case"canvas":return[new i(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Gr({key:`${r}.type`,value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:s,validateSpec:o,styleSpec:n})}}function $r(e){const t=e.value,r=e.styleSpec,n=r.light,s=e.style;let o=[];const a=or(t);if(void 0===t)return o;if("object"!==a)return o=o.concat([new i("light",t,`object expected, ${a} found`)]),o;for(const a in t){const l=a.match(/^(.*)-transition$/);o=l&&n[l[1]]&&n[l[1]].transition?o.concat(e.validateSpec({key:a,value:t[a],valueSpec:r.transition,validateSpec:e.validateSpec,style:s,styleSpec:r})):n[a]?o.concat(e.validateSpec({key:a,value:t[a],valueSpec:n[a],validateSpec:e.validateSpec,style:s,styleSpec:r})):o.concat([new i(a,t[a],`unknown property "${a}"`)])}return o}function Jr(e){const t=e.value,r=e.styleSpec,n=r.sky,s=e.style,o=or(t);if(void 0===t)return[];if("object"!==o)return[new i("sky",t,`object expected, ${o} found`)];let a=[];for(const o in t)a=n[o]?a.concat(e.validateSpec({key:o,value:t[o],valueSpec:n[o],style:s,styleSpec:r})):a.concat([new i(o,t[o],`unknown property "${o}"`)]);return a}function Zr(e){const t=e.value,r=e.styleSpec,n=r.terrain,s=e.style;let o=[];const a=or(t);if(void 0===t)return o;if("object"!==a)return o=o.concat([new i("terrain",t,`object expected, ${a} found`)]),o;for(const a in t)o=n[a]?o.concat(e.validateSpec({key:a,value:t[a],valueSpec:n[a],validateSpec:e.validateSpec,style:s,styleSpec:r})):o.concat([new i(a,t[a],`unknown property "${a}"`)]);return o}function en(e){let t=[];const r=e.value,n=e.key;if(Array.isArray(r)){const s=[],o=[];for(const a in r){r[a].id&&s.includes(r[a].id)&&t.push(new i(n,r,`all the sprites' ids must be unique, but ${r[a].id} is duplicated`)),s.push(r[a].id),r[a].url&&o.includes(r[a].url)&&t.push(new i(n,r,`all the sprites' URLs must be unique, but ${r[a].url} is duplicated`)),o.push(r[a].url);const l={id:{type:"string",required:!0},url:{type:"string",required:!0}};t=t.concat(Nr({key:`${n}[${a}]`,value:r[a],valueSpec:l,validateSpec:e.validateSpec}))}return t}return Yr({key:n,value:r})}const tn={"*":()=>[],array:Ur,boolean:function(e){const t=e.value,r=e.key,n=or(t);return"boolean"!==n?[new i(r,t,`boolean expected, ${n} found`)]:[]},number:Fr,color:function(e){const t=e.key,r=e.value,n=or(r);return"string"!==n?[new i(t,r,`color expected, ${n} found`)]:K.parse(String(r))?[]:[new i(t,r,`color expected, "${r}" found`)]},constants:Lr,enum:Gr,filter:Qr,function:kr,layer:Wr,object:Nr,source:Kr,light:$r,sky:Jr,terrain:Zr,projection:function(e){const t=e.value,r=e.styleSpec,n=r.projection,s=e.style,o=or(t);if(void 0===t)return[];if("object"!==o)return[new i("projection",t,`object expected, ${o} found`)];let a=[];for(const o in t)a=n[o]?a.concat(e.validateSpec({key:o,value:t[o],valueSpec:n[o],style:s,styleSpec:r})):a.concat([new i(o,t[o],`unknown property "${o}"`)]);return a},projectionDefinition:function(e){const t=e.key;let r=e.value;r=r instanceof String?r.valueOf():r;const n=or(r);return"array"!==n||function(e){return Array.isArray(e)&&3===e.length&&"string"==typeof e[0]&&"string"==typeof e[1]&&"number"==typeof e[2]}(r)||function(e){return!!["interpolate","step","literal"].includes(e[0])}(r)?["array","string"].includes(n)?[]:[new i(t,r,`projection expected, invalid type "${n}" found`)]:[new i(t,r,`projection expected, invalid array ${JSON.stringify(r)} found`)]},string:Yr,formatted:function(e){return 0===Yr(e).length?[]:zr(e)},resolvedImage:function(e){return 0===Yr(e).length?[]:zr(e)},padding:function(e){const t=e.key,r=e.value;if("array"===or(r)){if(r.length<1||r.length>4)return[new i(t,r,`padding requires 1 to 4 values; ${r.length} values found`)];const n={type:"number"};let s=[];for(let i=0;i[]}})),e.constants&&(r=r.concat(Lr({key:"constants",value:e.constants,style:e,styleSpec:t,validateSpec:rn}))),an(r)}function on(e){return function(t){return e({...t,validateSpec:rn})}}function an(e){return[].concat(e).sort(((e,t)=>e.line-t.line))}function ln(e){return function(...t){return an(e.apply(this,t))}}sn.source=ln(on(Kr)),sn.sprite=ln(on(en)),sn.glyphs=ln(on(nn)),sn.light=ln(on($r)),sn.sky=ln(on(Jr)),sn.terrain=ln(on(Zr)),sn.layer=ln(on(Wr)),sn.filter=ln(on(Qr)),sn.paintProperty=ln(on(jr)),sn.layoutProperty=ln(on(qr));const cn={StyleExpression:mr,StylePropertyFunction:_r,ZoomConstantExpression:yr,ZoomDependentExpression:vr,createExpression:Ar,createPropertyExpression:xr,isExpression:gr,isExpressionFilter:wr,isZoomExpression:function(e){return void 0!==e._styleExpression},normalizePropertyExpression:function(e,t){if(ar(e))return new _r(e,t);if(gr(e)){const r=xr(e,t);if("error"===r.result)throw new Error(r.value.map((e=>`${e.key}: ${e.message}`)).join(", "));return r.value}{let r=e;return"color"===t.type&&"string"==typeof e?r=K.parse(e):"padding"!==t.type||"number"!=typeof e&&!Array.isArray(e)?"variableAnchorOffsetCollection"===t.type&&Array.isArray(e)?r=ne.parse(e):"projectionDefinition"===t.type&&"string"==typeof e&&(r=se.parse(e)):r=ee.parse(e),{kind:"constant",evaluate:()=>r}}}}},20992:(e,t,r)=>{"use strict";function n(e,t){return Array.from(e.getElementsByTagName(t))}function i(e){return"#"===e[0]?e:`#${e}`}function s(e){return e?.normalize(),e&&e.textContent||""}function o(e,t,r){const n=e.getElementsByTagName(t),i=n.length?n[0]:null;return i&&r&&r(i),i}function a(e,t,r){const n={};if(!e)return n;const i=e.getElementsByTagName(t),s=i.length?i[0]:null;return s&&r?r(s,n):n}function l(e,t,r){const n=s(o(e,t));return n&&r&&r(n)||{}}function c(e,t,r){const n=parseFloat(s(o(e,t)));if(!isNaN(n))return n&&r&&r(n)||{}}function u(e,t,r){const n=parseFloat(s(o(e,t)));if(!isNaN(n))return r&&r(n),n}function h(e,t){const r={};for(const n of t)l(e,n,(e=>{r[n]=e}));return r}function d(e){return 1===e?.nodeType}function p(e){return a(e,"line",(e=>Object.assign({},l(e,"color",(e=>({stroke:`#${e}`}))),c(e,"opacity",(e=>({"stroke-opacity":e}))),c(e,"width",(e=>({"stroke-width":96*e/25.4}))))))}function f(e){let t=[];if(null===e)return t;for(const r of Array.from(e.childNodes)){if(!d(r))continue;const e=m(r.nodeName);if("gpxtpx:TrackPointExtension"===e)t=t.concat(f(r));else{const n=s(r);t.push([e,g(n)])}}return t}function m(e){return["heart","gpxtpx:hr","hr"].includes(e)?"heart":e}function g(e){const t=parseFloat(e);return isNaN(t)?e:t}function A(e){const t=[parseFloat(e.getAttribute("lon")||""),parseFloat(e.getAttribute("lat")||"")];if(isNaN(t[0])||isNaN(t[1]))return null;u(e,"ele",(e=>{t.push(e)}));const r=o(e,"time");return{coordinates:t,time:r?s(r):null,extendedValues:f(o(e,"extensions"))}}function y(e){const t=h(e,["name","cmt","desc","type","time","keywords"]),r=Array.from(e.getElementsByTagNameNS("http://www.garmin.com/xmlschemas/GpxExtensions/v3","*"));for(const n of r)n.parentNode?.parentNode===e&&(t[n.tagName.replace(":","_")]=s(n));const i=n(e,"link");return i.length&&(t.links=i.map((e=>Object.assign({href:e.getAttribute("href")},h(e,["text","type"]))))),t}function v(e,t){const r=n(e,t),i=[],s=[],o={};for(let e=0;e1,l=Object.assign({_gpxType:"trk"},y(e),p(o(e,"extensions")),i.length?{coordinateProperties:{times:a?i:i[0]}}:{});for(const e of s){r.push(e.line),l.coordinateProperties||(l.coordinateProperties={});const t=l.coordinateProperties,n=Object.entries(e.extendedValues);for(let e=0;enew Array(e.line.length).fill(null)))),t[r][e]=i):t[r]=i}}return{type:"Feature",properties:l,geometry:a?{type:"MultiLineString",coordinates:r}:{type:"LineString",coordinates:r[0]}}}function b(e){const t=Object.assign(y(e),h(e,["sym"])),r=A(e);return r?{type:"Feature",properties:t,geometry:{type:"Point",coordinates:r.coordinates}}:null}function*w(e){for(const t of n(e,"trk")){const e=_(t);e&&(yield e)}for(const t of n(e,"rte")){const e=x(t);e&&(yield e)}for(const t of n(e,"wpt")){const e=b(t);e&&(yield e)}}function E(e){return{type:"FeatureCollection",features:Array.from(w(e))}}function M(e,t){const r={},n="stroke"==t||"fill"===t?t:t+"-color";return"#"===e[0]&&(e=e.substring(1)),6===e.length||3===e.length?r[n]="#"+e:8===e.length&&(r[t+"-opacity"]=parseInt(e.substring(0,2),16)/255,r[n]="#"+e.substring(6,8)+e.substring(4,6)+e.substring(2,4)),r}function S(e,t,r){const n={};return u(e,t,(e=>{n[r]=e})),n}function C(e,t){return a(e,"color",(e=>M(s(e),t)))}function T(e){return a(e,"Icon",((e,t)=>(l(e,"href",(e=>{t.icon=e})),t)))}function I(e){return Object.assign({},function(e){return a(e,"PolyStyle",((e,t)=>Object.assign(t,a(e,"color",(e=>M(s(e),"fill"))),l(e,"fill",(e=>{if("0"===e)return{"fill-opacity":0}})),l(e,"outline",(e=>{if("0"===e)return{"stroke-opacity":0}})))))}(e),function(e){return a(e,"LineStyle",(e=>Object.assign(C(e,"stroke"),S(e,"width","stroke-width"))))}(e),function(e){return a(e,"LabelStyle",(e=>Object.assign(C(e,"label"),S(e,"scale","label-scale"))))}(e),function(e){return a(e,"IconStyle",(e=>Object.assign(C(e,"icon"),S(e,"scale","icon-scale"),S(e,"heading","icon-heading"),a(e,"hotSpot",(e=>{const t=parseFloat(e.getAttribute("x")||""),r=parseFloat(e.getAttribute("y")||""),n=e.getAttribute("xunits")||"",i=e.getAttribute("yunits")||"";return isNaN(t)||isNaN(r)?{}:{"icon-offset":[t,r],"icon-offset-units":[n,i]}})),T(e))))}(e))}r.d(t,{GN:()=>E,bW:()=>$});const R=e=>Number(e),B={string:e=>e,int:R,uint:R,short:R,ushort:R,float:R,double:R,bool:e=>Boolean(e)};function P(e,t){return a(e,"ExtendedData",((e,r)=>{for(const t of n(e,"Data"))r[t.getAttribute("name")||""]=s(o(t,"value"));for(const i of n(e,"SimpleData")){const e=i.getAttribute("name")||"",n=t[e]||B.string;r[e]=n(s(i))}return r}))}function L(e){const t=o(e,"description");for(const e of Array.from(t?.childNodes||[]))if(4===e.nodeType)return{description:{"@type":"html",value:s(e)}};return{}}function D(e){return a(e,"TimeSpan",(e=>({timespan:{begin:s(o(e,"begin")),end:s(o(e,"end"))}})))}function O(e){return a(e,"TimeStamp",(e=>({timestamp:s(o(e,"when"))})))}function N(e,t){return l(e,"styleUrl",(e=>(e=i(e),t[e]?Object.assign({styleUrl:e},t[e]):{styleUrl:e})))}const U=/\s*/g,F=/^\s*|\s*$/g,k=/\s+/;function z(e){return e.replace(U,"").split(",").map(parseFloat).filter((e=>!isNaN(e))).slice(0,3)}function G(e){return e.replace(F,"").split(k).map(z).filter((e=>e.length>=2))}function Q(e){let t=n(e,"coord");var r;0===t.length&&(r=e,t=Array.from(r.getElementsByTagNameNS("*","coord")));const i=t.map((e=>s(e).split(" ").map(parseFloat)));return 0===i.length?null:{geometry:i.length>2?{type:"LineString",coordinates:i}:{type:"Point",coordinates:i[0]},times:n(e,"when").map((e=>s(e)))}}function V(e){if(0===e.length)return e;const t=e[0],r=e[e.length-1];let n=!0;for(let e=0;e=2&&t.push({type:"Point",coordinates:e});break}case"LinearRing":case"LineString":{const e=G(H(s));e.length>=2&&t.push({type:"LineString",coordinates:e});break}case"Polygon":{const e=[];for(const t of n(s,"LinearRing")){const r=V(G(H(t)));r.length>=4&&e.push(r)}e.length&&t.push({type:"Polygon",coordinates:e});break}case"Track":case"gx:Track":{const e=Q(s);if(!e)break;const{times:n,geometry:i}=e;t.push(i),n.length&&r.push(n);break}}}return{geometries:t,coordTimes:r}}function q(e,t,r,n){const{coordTimes:i,geometries:s}=j(e),o=function(e){return 0===e.length?null:1===e.length?e[0]:{type:"GeometryCollection",geometries:e}}(s);if(!o&&n.skipNullGeometry)return null;const a={type:"Feature",geometry:o,properties:Object.assign(h(e,["name","address","visibility","open","phoneNumber","description"]),L(e),N(e,t),I(e),P(e,r),D(e),O(e),i.length?{coordinateProperties:{times:1===i.length?i[0]:i}}:{})};void 0!==a.properties?.visibility&&(a.properties.visibility="0"!==a.properties.visibility);const l=e.getAttribute("id");return null!==l&&""!==l&&(a.id=l),a}const W=Math.PI/180;function Y(e,t,r,n){const i=function(e){return o(e,"gx:LatLonQuad")?{geometry:{type:"Polygon",coordinates:[V(G(H(e)))]}}:function(e){const t=o(e,"LatLonBox");if(t){const e=u(t,"north"),r=u(t,"west"),n=u(t,"east"),i=u(t,"south"),s=u(t,"rotation");if("number"==typeof e&&"number"==typeof i&&"number"==typeof r&&"number"==typeof n){const t=[r,i,n,e];let o=[[[r,e],[n,e],[n,i],[r,i],[r,e]]];return"number"==typeof s&&(o=function(e,t,r){const n=[(e[0]+e[2])/2,(e[1]+e[3])/2];return[t[0].map((e=>{const t=e[1]-n[1],i=e[0]-n[0],s=Math.sqrt(Math.pow(t,2)+Math.pow(i,2)),o=Math.atan2(t,i)+r*W;return[n[0]+Math.cos(o)*s,n[1]+Math.sin(o)*s]}))]}(t,o,s)),{bbox:t,geometry:{type:"Polygon",coordinates:o}}}}return null}(e)}(e),s=i?.geometry||null;if(!s&&n.skipNullGeometry)return null;const a={type:"Feature",geometry:s,properties:Object.assign({"@geometry-type":"groundoverlay"},h(e,["name","address","visibility","open","phoneNumber","description"]),L(e),N(e,t),I(e),T(e),P(e,r),D(e),O(e))};i?.bbox&&(a.bbox=i.bbox),void 0!==a.properties?.visibility&&(a.properties.visibility="0"!==a.properties.visibility);const l=e.getAttribute("id");return null!==l&&""!==l&&(a.id=l),a}function X(e){let t=e.getAttribute("id");const r=e.parentNode;return!t&&d(r)&&"CascadingStyle"===r.localName&&(t=r.getAttribute("kml:id")||r.getAttribute("id")),i(t||"")}function*K(e,t={skipNullGeometry:!1}){const r=function(e){const t={};for(const r of n(e,"Style"))t[X(r)]=I(r);for(const r of n(e,"StyleMap")){const e=i(r.getAttribute("id")||"");l(r,"styleUrl",(r=>{r=i(r),t[r]&&(t[e]=t[r])}))}return t}(e),s=function(e){const t={};for(const r of n(e,"SimpleField"))t[r.getAttribute("name")||""]=B[r.getAttribute("type")||""]||B.string;return t}(e);for(const i of n(e,"Placemark")){const e=q(i,r,s,t);e&&(yield e)}for(const i of n(e,"GroundOverlay")){const e=Y(i,r,s,t);e&&(yield e)}}function $(e,t={skipNullGeometry:!1}){return{type:"FeatureCollection",features:Array.from(K(e,t))}}},50040:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>y});var n,i=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return.5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return 0===e?0:Math.pow(1024,e-1)},Out:function(e){return 1===e?1:1-Math.pow(2,-10*e)},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return 0===e?0:1===e?1:-Math.pow(2,10*(e-1))*Math.sin(5*(e-1.1)*Math.PI)},Out:function(e){return 0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin(5*(e-.1)*Math.PI)+1},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?-.5*Math.pow(2,10*(e-1))*Math.sin(5*(e-1.1)*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin(5*(e-1.1)*Math.PI)+1}}),Back:Object.freeze({In:function(e){var t=1.70158;return 1===e?1:e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return 0===e?0:--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}}),Bounce:Object.freeze({In:function(e){return 1-i.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?.5*i.Bounce.In(2*e):.5*i.Bounce.Out(2*e-1)+.5}}),generatePow:function(e){return void 0===e&&(e=4),e=(e=e1e4?1e4:e,{In:function(t){return Math.pow(t,e)},Out:function(t){return 1-Math.pow(1-t,e)},InOut:function(t){return t<.5?Math.pow(2*t,e)/2:(1-Math.pow(2-2*t,e))/2+.5}}}}),s=function(){return performance.now()},o=function(){function e(){for(var e=[],t=0;t0;){this._tweensAddedDuringUpdate={};for(var n=0;n1?s(e[r],e[r-1],r-n):s(e[i],e[i+1>r?r:i+1],n-i)},Bezier:function(e,t){for(var r=0,n=e.length-1,i=Math.pow,s=a.Utils.Bernstein,o=0;o<=n;o++)r+=i(1-t,n-o)*i(t,o)*e[o]*s(n,o);return r},CatmullRom:function(e,t){var r=e.length-1,n=r*t,i=Math.floor(n),s=a.Utils.CatmullRom;return e[0]===e[r]?(t<0&&(i=Math.floor(n=r*(1+t))),s(e[(i-1+r)%r],e[i],e[(i+1)%r],e[(i+2)%r],n-i)):t<0?e[0]-(s(e[0],e[0],e[1],e[1],-n)-e[0]):t>1?e[r]-(s(e[r],e[r],e[r-1],e[r-1],n-r)-e[r]):s(e[i?i-1:0],e[i],e[r1;r--)t*=r;return n[e]=t,t}),CatmullRom:function(e,t,r,n,i){var s=.5*(r-e),o=.5*(n-t),a=i*i;return(2*t-2*r+s+o)*(i*a)+(-3*t+3*r-2*s-o)*a+s*i+t}}},l=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),c=new o,u=function(){function e(e,t){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=i.Linear.None,this._interpolationFunction=a.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=l.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=e,"object"==typeof t?(this._group=t,t.add(this)):!0===t&&(this._group=c,c.add(this))}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(e,t){if(void 0===t&&(t=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=e,this._propertiesAreSetUp=!1,this._duration=t<0?0:t,this},e.prototype.duration=function(e){return void 0===e&&(e=1e3),this._duration=e<0?0:e,this},e.prototype.dynamic=function(e){return void 0===e&&(e=!1),this._isDynamic=e,this},e.prototype.start=function(e,t){if(void 0===e&&(e=s()),void 0===t&&(t=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed)for(var r in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=e,this._startTime+=this._delayTime,!this._propertiesAreSetUp||t){if(this._propertiesAreSetUp=!0,!this._isDynamic){var n={};for(var i in this._valuesEnd)n[i]=this._valuesEnd[i];this._valuesEnd=n}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,t)}return this},e.prototype.startFromCurrentValues=function(e){return this.start(e,!0)},e.prototype._setupProperties=function(e,t,r,n,i){for(var s in r){var o=e[s],a=Array.isArray(o),l=a?"array":typeof o,c=!a&&Array.isArray(r[s]);if("undefined"!==l&&"function"!==l){if(c){if(0===(g=r[s]).length)continue;for(var u=[o],h=0,d=g.length;hc)return 1;var e=Math.trunc(a/l),t=a-e*l,r=Math.min(t/o._duration,1);return 0===r&&a===o._duration?1:r}(),h=this._easingFunction(u);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,h),this._onUpdateCallback&&this._onUpdateCallback(this._object,u),0===this._duration||a>=this._duration){if(this._repeat>0){var d=Math.min(Math.trunc((a-this._duration)/l)+1,this._repeat);for(i in isFinite(this._repeat)&&(this._repeat-=d),this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[i]||(this._valuesStartRepeat[i]=this._valuesStartRepeat[i]+parseFloat(this._valuesEnd[i])),this._yoyo&&this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=l*d,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var p=0,f=this._chainedTweens.length;p{"use strict";r.d(t,{W:()=>X,A:()=>le});var n=r(39437);const i=1e3/60,s=function(e){e.id&&(clearInterval(e.id),e.id=void 0),e.waitTimer&&(clearInterval(e.waitTimer),e.waitTimer=void 0),e.keyframe=0},o=function(e){s(e),e.isEnded()&&e.dispatchEvent({type:"animation-ended"}),e.dispatchEvent({type:"animation-stopped"}),e.duration=0};class a extends n.EventDispatcher{constructor(){super(),this.id=null,this.keyframe=0,this.duration=0,this.state=0,this.waitTimer=null,this.callback=()=>{}}isPlaying(){return 1===this.state}isStopped(){return 0===this.state}isEnded(){return 2===this.state}setCallback(e){this.callback=e}play(e){this.duration=e,this.dispatchEvent({type:"animation-started"}),this.state=1,s(this),this.id=setInterval(this.frame.bind(this),i)}playLater(e,t){const r=Math.floor(i*t);window.clearInterval(this.waitTimer);const n=this;this.waitTimer=window.setTimeout((()=>{n.play(e)}),r)}stop(){this.state=0,o(this)}frame(){this.keyframe1&&void 0!==arguments[1]?arguments[1]:{};super(),this._view=e,this._domElement=e.domElement;let r=!0;Object.defineProperty(this,"enabled",{get:()=>r,set:e=>{e||(this.onKeyUp(),this.onPointerUp()),r=e}});let i=!0;Object.defineProperty(this,"enableKeys",{get:()=>i,set:e=>{e||this.onKeyUp(),i=e}}),this.NONE={};let s=this.NONE;Object.defineProperty(this,"currentState",{get:()=>s,set:e=>{if(s!==e){const t=s;s=e,this.dispatchEvent({type:"state-changed",viewCoords:p,previous:t})}}}),this._clickTimeStamp=0,this._lastMousePressed={viewCoords:new n.Vector2},this._currentMousePressed=void 0,this._currentKeyPressed=void 0,this._onPointerDown=this.onPointerDown.bind(this),this._onPointerMove=this.onPointerMove.bind(this),this._onPointerUp=this.onPointerUp.bind(this),this._onMouseWheel=this.onMouseWheel.bind(this),this._onKeyDown=this.onKeyDown.bind(this),this._onKeyUp=this.onKeyUp.bind(this),this._onBlur=this.onBlur.bind(this),this._onContextMenu=this.onContextMenu.bind(this),this._domElement.addEventListener("pointerdown",this._onPointerDown,!1),this._domElement.addEventListener("wheel",this._onMouseWheel,!1),this._domElement.addEventListener("keydown",this._onKeyDown,!1),this._domElement.addEventListener("keyup",this._onKeyUp,!1),this._domElement.addEventListener("blur",this._onBlur),this._domElement.addEventListener("contextmenu",this._onContextMenu,!1),this.setFromOptions(t)}inputToState(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(const n of Object.keys(d)){const i=this[n];if(i.enable&&i.mouseButton===e&&i.keyboard===t&&i.double===r){if(!i._trigger)return i;this.dispatchEvent({type:i._event,viewCoords:void 0!==e&&p,direction:i._direction})}}return this.NONE}touchToState(e){for(const t of Object.keys(d)){const r=this[t];if(r.enable&&e===r.finger)return r}return this.NONE}setFromOptions(e){for(const t in d)if({}.hasOwnProperty.call(d,t)){let r={};r=e[t]||this[t]||Object.assign(r,d[t]),e[t]&&void 0===e[t].enable&&(r.enable=this[t].enable),r.double=!!r.double,r._event=d[t]._event,r._trigger=d[t]._trigger,r._direction=d[t]._direction,this[t]=r}}onPointerDown(e){this.enabled&&(p.copy(this._view.eventToViewCoords(e)),"mouse"===e.pointerType&&(this._currentMousePressed=e.button,void 0===this._currentKeyPressed&&(e.ctrlKey?this._currentKeyPressed=17:e.shiftKey?this._currentKeyPressed=16:e.metaKey&&(this._currentKeyPressed=91)),this.currentState=this.inputToState(this._currentMousePressed,this._currentKeyPressed,e.timeStamp-this._clickTimeStamp<500&&this._lastMousePressed.button===this._currentMousePressed&&this._lastMousePressed.viewCoords.distanceTo(p)<5),this._clickTimeStamp=e.timeStamp,this._lastMousePressed.button=this._currentMousePressed,this._lastMousePressed.viewCoords.copy(p)),this._domElement.addEventListener("pointermove",this._onPointerMove,!1),this._domElement.addEventListener("pointerup",this._onPointerUp,!1),this._domElement.addEventListener("mouseleave",this._onPointerUp,!1))}onPointerMove(e){e.preventDefault(),this.enabled&&(p.copy(this._view.eventToViewCoords(e)),"mouse"===e.pointerType)&&this.dispatchEvent({type:this.currentState._event,viewCoords:p})}onPointerUp(){this.enabled&&(this._currentMousePressed=void 0,this._domElement.removeEventListener("pointermove",this._onPointerMove,!1),this._domElement.removeEventListener("pointerup",this._onPointerUp,!1),this._domElement.removeEventListener("mouseleave",this._onPointerUp,!1),this.currentState=this.NONE)}onMouseWheel(e){e.preventDefault(),this.enabled&&this.ZOOM.enable&&(p.copy(this._view.eventToViewCoords(e)),this.currentState=this.ZOOM,this.dispatchEvent({type:this.ZOOM._event,delta:e.deltaY,viewCoords:p}))}onKeyDown(e){this.enabled&&this.enableKeys&&(this._currentKeyPressed=e.keyCode,this.inputToState(this._currentMousePressed,this._currentKeyPressed))}onKeyUp(){this.enabled&&this.enableKeys&&(this._currentKeyPressed=void 0,void 0===this._currentMousePressed&&(this.currentState=this.NONE))}onBlur(){this.onKeyUp(),this.onPointerUp()}onContextMenu(e){e.preventDefault()}dispose(){this._clickTimeStamp=0,this._lastMousePressed=void 0,this._currentKeyPressed=void 0,this._domElement.removeEventListener("pointerdown",this._onPointerDown,!1),this._domElement.removeEventListener("pointermove",this._onPointerMove,!1),this._domElement.removeEventListener("pointerup",this._onPointerUp,!1),this._domElement.removeEventListener("wheel",this._onMouseWheel,!1),this._domElement.removeEventListener("keydown",this._onKeyDown,!1),this._domElement.removeEventListener("keyup",this._onKeyUp,!1),this._domElement.removeEventListener("blur",this._onBlur),this._domElement.removeEventListener("contextmenu",this._onContextMenu,!1)}}const m=f;var g=r(84354);const A=1e-6,y={up:new n.Vector2(0,1),bottom:new n.Vector2(0,-1),left:new n.Vector2(1,0),right:new n.Vector2(-1,0)},v=new n.Vector2,x=new n.Vector2,_=new n.Vector2,b=new n.Spherical(1,.01,0),w=new n.Spherical(1,0,0);let E=1;const M=new n.Vector2,S=new n.Vector2,C=new n.Vector2,T=new n.Vector3,I=new n.Vector2,R=new n.Vector2,B=new n.Vector2;let P;const L=new n.Quaternion,D=new n.Object3D,O=new c.A("EPSG:4978");D.matrixWorldInverse=new n.Matrix4;const N=new c.A("EPSG:4978",0,0,0),U=new c.A("EPSG:4326",0,0,0);function F(e,t){N.setFromVector3(e).as("EPSG:4326",U),t.position.copy(e),t.lookAt(U.geodesicNormal.add(e)),t.rotateX(.5*Math.PI),t.updateMatrixWorld(!0)}let k=0,z=!0;const G=new n.Quaternion(0,0,0,1),Q=new n.Vector3,V=new n.Vector3,H=new n.Quaternion,j=new n.Sphere,q=new n.Vector3,W=new n.Vector3,Y={},X={PAN_CHANGED:"pan-changed",ORIENTATION_CHANGED:"orientation-changed",RANGE_CHANGED:"range-changed",CAMERA_TARGET_CHANGED:"camera-target-changed"},K=new n.Quaternion,$=new n.Quaternion,J=new n.Vector3(1,0,0);let Z=1/0;const ee=new n.Vector3,te=new n.Vector3,re=new n.Raycaster,ne=new n.Vector3,ie=new n.Vector3,se=new n.Sphere;let oe;class ae extends n.EventDispatcher{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(),this.player=new l,this.view=e,this.camera=e.camera3D,this.states=new m(this.view,r.stateControl),Object.defineProperty(this,"enabled",{get:()=>this.states.enabled,set:e=>{console.warn("GlobeControls.enabled property is deprecated. Use StateControl.enabled instead - which you can access with GlobeControls.states.enabled."),this.states.enabled=e}}),r.zoomSpeed&&(console.warn("Controls zoomSpeed parameter is deprecated. Use zoomFactor instead."),r.zoomFactor=r.zoomFactor||r.zoomSpeed),this.zoomFactor=r.zoomFactor||1.1,this.minDistance=r.minDistance||250,this.maxDistance=r.maxDistance||8*u.Q.x,this.minZoom=r.minZoom||0,this.maxZoom=r.maxZoom||1/0,this.rotateSpeed=r.rotateSpeed||.25,this.keyPanSpeed=r.keyPanSpeed||7,this.minPolarAngle=n.MathUtils.degToRad(r.minPolarAngle??.5),this.maxPolarAngle=n.MathUtils.degToRad(r.minPolarAngle??86),this.minAzimuthAngle=r.minAzimuthAngle?n.MathUtils.degToRad(r.minAzimuthAngle):-1/0,this.maxAzimuthAngle=r.maxAzimuthAngle?n.MathUtils.degToRad(r.maxAzimuthAngle):1/0,this.handleCollision=void 0===r.handleCollision||r.handleCollision,this.minDistanceCollision=60,Object.defineProperty(this,"enableKeys",{get:()=>this.states.enableKeys,set:e=>{console.warn("GlobeControls.enableKeys property is deprecated. Use StateControl.enableKeys instead - which you can access with GlobeControls.states.enableKeys."),this.states.enableKeys=e}}),this.enableDamping=!1!==r.enableDamping,this.dampingMoveFactor=null!=r.dampingMoveFactor?r.dampingMoveFactor:.25,this.startEvent={type:"start"},this.endEvent={type:"end"},this.updateHelper=function(){},this._onEndingMove=null,this._onTravel=this.travel.bind(this),this._onTouchStart=this.onTouchStart.bind(this),this._onTouchEnd=this.onTouchEnd.bind(this),this._onTouchMove=this.onTouchMove.bind(this),this._onStateChange=this.onStateChange.bind(this),this._onRotation=this.handleRotation.bind(this),this._onDrag=this.handleDrag.bind(this),this._onDolly=this.handleDolly.bind(this),this._onPan=this.handlePan.bind(this),this._onPanoramic=this.handlePanoramic.bind(this),this._onZoom=this.handleZoom.bind(this),this.states.addEventListener("state-changed",this._onStateChange,!1),this.states.addEventListener(this.states.ORBIT._event,this._onRotation,!1),this.states.addEventListener(this.states.MOVE_GLOBE._event,this._onDrag,!1),this.states.addEventListener(this.states.DOLLY._event,this._onDolly,!1),this.states.addEventListener(this.states.PAN._event,this._onPan,!1),this.states.addEventListener(this.states.PANORAMIC._event,this._onPanoramic,!1),this.states.addEventListener("zoom",this._onZoom,!1),this.view.domElement.addEventListener("touchstart",this._onTouchStart,!1),this.view.domElement.addEventListener("touchend",this._onTouchEnd,!1),this.view.domElement.addEventListener("touchmove",this._onTouchMove,!1),this.states.addEventListener(this.states.TRAVEL_IN._event,this._onTravel,!1),this.states.addEventListener(this.states.TRAVEL_OUT._event,this._onTravel,!1),e.scene.add(D),t.isExtent?t.center().as("EPSG:4978",N):(t.coord.as("EPSG:4978",N),t.tilt=t.tilt||89.5,t.heading=t.heading||0),F(N,D),this.lookAtCoordinate(t,!1),O.crs=this.view.referenceCrs}get zoomInScale(){return this.zoomFactor}get zoomOutScale(){return 1/this.zoomFactor}get isPaused(){return this.states.currentState===this.states.NONE&&!this.player.isPlaying()}onEndingMove(e){this._onEndingMove&&(this.player.removeEventListener("animation-stopped",this._onEndingMove),this._onEndingMove=null),this.handlingEvent(e)}rotateLeft(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;w.theta-=e}rotateUp(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;w.phi-=e}panLeft(e){const t=this.camera.matrix.elements;T.fromArray(t),T.multiplyScalar(-e),Q.add(T)}panUp(e){const t=this.camera.matrix.elements;T.fromArray(t,4),T.multiplyScalar(e),Q.add(T)}mouseToPan(e,t){const r=this.view.mainLoop.gfxEngine;if(this.camera.isPerspectiveCamera){let i=this.camera.position.distanceTo(this.getCameraTargetPosition());i*=2*Math.tan(n.MathUtils.degToRad(.5*this.camera.fov)),this.panLeft(e*i/r.width*this.camera.aspect),this.panUp(t*i/r.height)}else this.camera.isOrthographicCamera&&(this.panLeft(e*(this.camera.right-this.camera.left)/r.width),this.panUp(t*(this.camera.top-this.camera.bottom)/r.height))}dolly(e){0!==e&&(P=e>0?this.zoomInScale:this.zoomOutScale,this.camera.isPerspectiveCamera?E/=P:this.camera.isOrthographicCamera&&(this.camera.zoom=n.MathUtils.clamp(this.camera.zoom*P,this.minZoom,this.maxZoom),this.camera.updateProjectionMatrix(),this.view.notifyChange(this.camera)))}getMinDistanceCameraBoundingSphereObbsUp(e){if(e.level>10&&1==e.children.length&&e.geometry){const t=e.obb;se.center.copy(this.camera.position),se.radius=this.minDistanceCollision,t.isSphereAboveXYBox(se)&&(Z=Math.min(se.center.z-t.box3D.max.z,Z))}}update(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.states.currentState;if(Z=1/0,this.handleCollision&&this.view.tileLayer)for(const e of this.view.tileLayer.level0Nodes)e.traverse(this.getMinDistanceCameraBoundingSphereObbsUp.bind(this));switch(e){case this.states.MOVE_GLOBE:if(Z<0)D.translateY(-Z),this.camera.position.setLength(this.camera.position.length()-Z);else if(Zr&&w.phi>0){const e=t-r,n=1-(e-(Z-r))/e;w.phi*=n*n}else if(Z-r&&w.phi>i){let e=-Math.asin(.25*(r-Z)/b.radius);e=n.MathUtils.clamp(e,i,0);const t=1-(r-Z)/(2*r);w.phi=n.MathUtils.lerp(w.phi,e,t),Z-=Math.sin(w.phi)*b.radius}b.theta+=w.theta,b.phi+=w.phi,b.theta=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,b.theta)),b.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,b.phi)),b.radius=this.camera.position.length()*E,b.makeSafe(),b.radius=Math.max(this.minDistance,Math.min(this.maxDistance,b.radius)),this.camera.position.setFromSpherical(b),Z<0&&(this.camera.position.y-=Z,b.setFromVector3(this.camera.position),w.phi=0),D.localToWorld(this.camera.position)}}this.camera.up.copy(D.position).normalize(),this.camera.lookAt(D.position),this.enableDamping?(w.theta*=.75,w.phi*=.75,L.slerp(G,.2*this.dampingMoveFactor)):(w.theta=0,w.phi=0,L.set(0,0,0,1)),E=1,Q.set(0,0,0),(V.distanceToSquared(this.camera.position)>A||8*(1-H.dot(this.camera.quaternion))>A)&&(this.view.notifyChange(this.camera),V.copy(this.camera.position),H.copy(this.camera.quaternion)),this.enableDamping&&e===this.states.ORBIT&&this.player.isStopped()&&(w.theta>A||w.phi>A)&&(this.player.setCallback((()=>{this.update(this.states.ORBIT)})),this.player.playLater(60,2)),this.view.dispatchEvent({type:g.G.CAMERA_MOVED,coord:O.setFromVector3(D.position),range:b.radius,heading:-n.MathUtils.radToDeg(b.theta),tilt:90-n.MathUtils.radToDeg(b.phi)})}onStateChange(e){this.states.currentState!==this.states.NONE?(h.Ay.stop(this.view,this.camera),this.onEndingMove(),this.player.stop(),this.updateTarget(),oe=h.Ay.getTransformCameraLookingAtTarget(this.view,this.camera,ie),v.copy(e.viewCoords),this.view.getPickingPositionFromDepth(e.viewCoords,q)&&(j.radius=q.length(),ee.copy(q).normalize(),this.updateHelper(q,Y.picking)),I.copy(e.viewCoords),this.view.getPickingPositionFromDepth(e.viewCoords,ie),M.copy(e.viewCoords)):this.handleEndMovement(e)}handleRotation(e){this.player.stop(),this.handlePanoramic(e)}handleDrag(e){const t=this.view.viewToNormalizedCoords(e.viewCoords);this.camera.updateMatrixWorld(),re.setFromCamera(t,this.camera),re.ray.intersectSphere(j,W)?(te.copy(W).normalize(),L.setFromUnitVectors(te,ee),k=Date.now(),this.update()):this.states.onPointerUp()}handleDolly(e){R.copy(e.viewCoords),B.subVectors(R,I),I.copy(R),e.delta=B.y,0!=e.delta&&this.handleZoom(e)}handlePan(e){e.viewCoords?(S.copy(e.viewCoords),C.subVectors(S,M),M.copy(S)):e.direction&&C.copy(y[e.direction]).multiplyScalar(this.keyPanSpeed),this.mouseToPan(C.x,C.y),this.update(this.states.PAN)}handlePanoramic(e){x.copy(e.viewCoords),_.subVectors(x,v);const t=this.view.mainLoop.gfxEngine;w.theta-=2*Math.PI*_.x/t.width*this.rotateSpeed,w.phi-=2*Math.PI*_.y/t.height*this.rotateSpeed,v.copy(x),this.update()}handleEndMovement(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.dispatchEvent(this.endEvent),this.player.stop(),this.enableDamping?e.previous===this.states.ORBIT&&(w.theta>A||w.phi>A)?(this.player.setCallback((()=>{this.update(this.states.ORBIT)})),this.player.play(60),this._onEndingMove=()=>this.onEndingMove(),this.player.addEventListener("animation-stopped",this._onEndingMove)):e.previous===this.states.MOVE_GLOBE&&Date.now()-k<50?(this.player.setCallback((()=>{this.update(this.states.MOVE_GLOBE)})),this.player.play(120),this._onEndingMove=()=>this.onEndingMove(),this.player.addEventListener("animation-stopped",this._onEndingMove)):this.onEndingMove():this.onEndingMove()}updateTarget(){if(this.view.getPickingPositionFromDepth(null,ie)){const e=isNaN(ie.x)?100:this.camera.position.distanceTo(ie);ne.set(0,0,-e),this.camera.localToWorld(ne),F(ne,D),D.matrixWorldInverse.copy(D.matrixWorld).invert(),ne.copy(this.camera.position),ne.applyMatrix4(D.matrixWorldInverse),b.setFromVector3(ne)}}handlingEvent(e){e=e||h.Ay.getTransformCameraLookingAtTarget(this.view,this.camera);const t=h.Ay.getDiffParams(oe,e);if(t&&(t.range&&this.dispatchEvent({type:X.RANGE_CHANGED,previous:t.range.previous,new:t.range.new}),t.coord&&this.dispatchEvent({type:X.CAMERA_TARGET_CHANGED,previous:t.coord.previous,new:t.coord.new}),t.tilt||t.heading)){const e={type:X.ORIENTATION_CHANGED};t.tilt&&(e.previous={tilt:t.tilt.previous},e.new={tilt:t.tilt.new}),t.heading&&(e.previous=e.previous||{},e.new=e.new||{},e.new.heading=t.heading.new,e.previous.heading=t.heading.previous),this.dispatchEvent(e)}}travel(e){this.player.stop();const t=this.view.getPickingPositionFromDepth(e.viewCoords),r=this.getRange(t);if(t&&r>this.minDistance)return this.lookAtCoordinate({coord:new c.A("EPSG:4978",t),range:r*("out"===e.direction?1/.6:.6),time:1500})}handleZoom(e){this.player.stop(),h.Ay.stop(this.view,this.camera);const t=e.delta>0?this.zoomInScale:this.zoomOutScale;let r="dolly"===e.type?ie:this.view.getPickingPositionFromDepth(e.viewCoords),n=this.getRange();if(n*=t,r&&n>this.minDistance&&n180?r.x+=360:r.x-e.x>180&&(e.x+=360)),r.lerp(e,t),r=U.setFromVector3(r).as("EPSG:4978",N),this.lookAtCoordinate({coord:r,range:n},!1)}}onTouchStart(e){if(this.player.stop(),!1!==this.states.enabled&&(this.state=this.states.touchToState(e.touches.length),this.updateTarget(),this.state!==this.states.NONE)){switch(this.state){case this.states.MOVE_GLOBE:{const t=this.view.eventToViewCoords(e);this.view.getPickingPositionFromDepth(t,q)?(j.radius=q.length(),ee.copy(q).normalize(),this.updateHelper(q,Y.picking)):this.state=this.states.NONE;break}case this.states.ORBIT:case this.states.DOLLY:{const t=e.touches[0].pageX,r=e.touches[0].pageY,n=t-e.touches[1].pageX,i=r-e.touches[1].pageY,s=Math.sqrt(n*n+i*i);I.set(0,s),v.set(t,r);break}case this.states.PAN:M.set(e.touches[0].pageX,e.touches[0].pageY)}this.dispatchEvent(this.startEvent)}}onTouchMove(e){if(this.player.isPlaying()&&this.player.stop(),!1!==this.states.enabled){switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case this.states.MOVE_GLOBE.finger:{const t=this.view.eventToViewCoords(e),r=this.view.viewToNormalizedCoords(t);this.camera.updateMatrixWorld(),re.setFromCamera(r,this.camera),re.ray.intersectSphere(j,W)?(te.copy(W).normalize(),L.setFromUnitVectors(te,ee),k=Date.now()):this.onTouchEnd();break}case this.states.ORBIT.finger:case this.states.DOLLY.finger:{const t=this.view.mainLoop.gfxEngine;x.set(e.touches[0].pageX,e.touches[0].pageY),_.subVectors(x,v),this.rotateLeft(2*Math.PI*_.x/t.width*this.rotateSpeed),this.rotateUp(2*Math.PI*_.y/t.height*this.rotateSpeed),v.copy(x);const r=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,i=Math.sqrt(r*r+n*n);R.set(0,i),B.subVectors(R,I),this.dolly(B.y),I.copy(R);break}case this.states.PAN.finger:S.set(e.touches[0].pageX,e.touches[0].pageY),C.subVectors(S,M),this.mouseToPan(C.x,C.y),M.copy(S);break;default:this.state=this.states.NONE}this.state!==this.states.NONE&&this.update(this.state)}}onTouchEnd(){this.handleEndMovement({previous:this.state}),this.state=this.states.NONE}dispose(){this.view.domElement.removeEventListener("touchstart",this._onTouchStart,!1),this.view.domElement.removeEventListener("touchend",this._onTouchEnd,!1),this.view.domElement.removeEventListener("touchmove",this._onTouchMove,!1),this.states.dispose(),this.states.removeEventListener("state-changed",this._onStateChange,!1),this.states.removeEventListener(this.states.ORBIT._event,this._onRotation,!1),this.states.removeEventListener(this.states.MOVE_GLOBE._event,this._onDrag,!1),this.states.removeEventListener(this.states.DOLLY._event,this._onDolly,!1),this.states.removeEventListener(this.states.PAN._event,this._onPan,!1),this.states.removeEventListener(this.states.PANORAMIC._event,this._onPanoramic,!1),this.states.removeEventListener("zoom",this._onZoom,!1),this.states.removeEventListener(this.states.TRAVEL_IN._event,this._onTravel,!1),this.states.removeEventListener(this.states.TRAVEL_OUT._event,this._onTravel,!1),this.dispatchEvent({type:"dispose"})}setTilt(e,t){return this.lookAtCoordinate({tilt:e},t)}setHeading(e,t){return this.lookAtCoordinate({heading:e},t)}setRange(e,t){return this.lookAtCoordinate({range:e},t)}getCameraTargetPosition(){return D.position}getRange(e){return h.Ay.getTransformCameraLookingAtTarget(this.view,this.camera,e).range}getTilt(e){return h.Ay.getTransformCameraLookingAtTarget(this.view,this.camera,e).tilt}getHeading(e){return h.Ay.getTransformCameraLookingAtTarget(this.view,this.camera,e).heading}pan(e){return this.mouseToPan(e.x,e.y),this.update(this.states.PAN),Promise.resolve()}getCameraOrientation(){return this.view.getPickingPositionFromDepth(null,ie),[this.getTilt(ie),this.getHeading(ie)]}getCameraCoordinate(){return new c.A("EPSG:4978",this.camera.position).as("EPSG:4326")}getLookAtCoordinate(){return h.Ay.getTransformCameraLookingAtTarget(this.view,this.camera).coord}setAnimationEnabled(e){z=e}isAnimationEnabled(){return z}getZoom(){return this.view.tileLayer.computeTileZoomFromDistanceCamera(this.getRange(),this.view.camera)}setZoom(e,t){return this.lookAtCoordinate({zoom:e},t)}getScale(e){return console.warn("Deprecated, use View#getScale instead."),this.view.getScale(e)}pixelsToMeters(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.28;return console.warn("Deprecated use View#getPixelsToMeters instead."),e*t/this.getScale(t)/1e3}pixelsToDegrees(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.28;console.warn("Deprecated, use View#getPixelsToMeters and GlobeControls#getMetersToDegrees instead.");const r=this.pixelsToMeters(e,t);return n.MathUtils.radToDeg(2*Math.asin(r/(2*u.Q.x)))}metersToPixels(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.28;console.warn("Deprecated, use View#getMetersToPixels instead.");const r=this.getScale(t);return t/=1e3,e*r/t}setScale(e,t,r){return this.lookAtCoordinate({scale:e,pitch:t},r)}lookAtCoordinate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.isAnimationEnabled();if(this.player.stop(),!e.isExtent&&(e.zoom?e.range=this.view.tileLayer.computeDistanceCameraFromTileZoom(e.zoom,this.view.camera):e.scale&&(e.range=this.view.getScaleFromDistance(e.pitch,e.scale),(e.rangethis.maxDistance)&&(console.warn(`This scale ${e.scale} can not be reached`),e.range=n.MathUtils.clamp(e.range,this.minDistance,this.maxDistance))),void 0!==e.tilt)){const t=90-n.MathUtils.radToDeg(this.maxPolarAngle),r=90-n.MathUtils.radToDeg(this.minPolarAngle);(e.tiltr)&&(e.tilt=n.MathUtils.clamp(e.tilt,t,r),console.warn("Tilt was clamped to ",e.tilt,` the interval is between ${t} and ${r} degree`))}return oe=h.Ay.getTransformCameraLookingAtTarget(this.view,this.camera),t?(e.callback=e=>D.position.copy(e.targetWorldPosition),this.dispatchEvent({type:"animation-started"}),h.Ay.animateCameraToLookAtTarget(this.view,this.camera,e).then((e=>(this.dispatchEvent({type:"animation-ended"}),this.handlingEvent(e),e)))):h.Ay.transformCameraToLookAtTarget(this.view,this.camera,e).then((e=>(D.position.copy(e.targetWorldPosition),this.handlingEvent(e),e)))}pickGeoPosition(e){const t=this.view.getPickingPositionFromDepth(e);if(t)return new c.A("EPSG:4978",t).as("EPSG:4326")}}const le=ae},72682:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>Q,w7:()=>z});var n=r(39437),i=r(87196);const s=n.MOUSE.LEFT,o=n.MOUSE.MIDDLE,a=n.MOUSE.RIGHT;let l;const c=new n.Vector3,u=new n.Quaternion;let h=0;const d=new n.Vector3,p=-1,f={default:"auto",drag:"move",pan:"cell",travel:"wait",rotate:"move",ortho_zoom:"wait"},m=new n.Vector3,g=new n.Vector2,A=new n.Vector2,y=new n.Vector2(0,0),v=new n.Vector3,x=new n.Vector3,_=new n.Vector3,b=new n.Vector3(0,0,0);let w=0;const E=new n.Vector3,M=new n.Quaternion,S=new n.Vector2,C=new n.Vector3,T=new n.Vector3,I=new n.Quaternion,R=new n.Quaternion;let B=0,P=0,L=!1,D=!1,O=0,N=0;const U=new n.Raycaster,F=new n.Plane(new n.Vector3(0,0,-1)),k={enabled:!0,enableRotation:!0,rotateSpeed:2,minPanSpeed:.05,maxPanSpeed:15,zoomTravelTime:.2,zoomFactor:2,maxResolution:0,minResolution:1/0,maxAltitude:5e7,groundLevel:200,autoTravelTimeMin:1.5,autoTravelTimeMax:4,autoTravelTimeDist:5e4,smartTravelHeightMin:75,smartTravelHeightMax:500,instantTravel:!1,minZenithAngle:0,maxZenithAngle:82.5,handleCollision:!0,minDistanceCollision:30,enableSmartTravel:!0,enablePan:!0},z={MOVED:"moved"};class G extends n.EventDispatcher{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),this.view=e,this.camera=e.camera3D,this.enabled="boolean"==typeof t.enabled?t.enabled:k.enabled,this.camera.isOrthographicCamera?(h=this.camera.zoom,this.enableRotation=!1,this.enablePan=!1,this.maxAltitude=1/0,this.zoomTravelTime="number"==typeof t.zoomTravelTime?t.zoomTravelTime:k.zoomTravelTime):(this.enableRotation=void 0===t.enableRotation?k.enableRotation:t.enableRotation,this.rotateSpeed=t.rotateSpeed||k.rotateSpeed,this.enablePan=void 0===t.enablePan?k.enablePan:t.enablePan,this.minPanSpeed=t.minPanSpeed||k.minPanSpeed,this.maxPanSpeed=t.maxPanSpeed||k.maxPanSpeed,this.maxAltitude=t.maxAltitude||k.maxAltitude,this.zoomTravelTime=t.zoomTravelTime||k.zoomTravelTime),t.zoomInFactor&&(console.warn("Controls zoomInFactor parameter is deprecated. Use zoomFactor instead."),t.zoomFactor=t.zoomFactor||t.zoomInFactor),t.zoomOutFactor&&(console.warn("Controls zoomOutFactor parameter is deprecated. Use zoomFactor instead."),t.zoomFactor=t.zoomFactor||t.zoomInFactor||1/t.zoomOutFactor),0===t.zoomFactor&&(console.warn("Controls zoomFactor parameter can not be equal to 0. Its value will be set to default."),t.zoomFactor=k.zoomFactor),this.zoomInFactor=t.zoomFactor||k.zoomFactor,this.zoomOutFactor=1/(t.zoomFactor||k.zoomFactor),this.maxResolution=t.maxResolution||k.maxResolution,this.minResolution=t.minResolution||k.minResolution,this.groundLevel=t.groundLevel||k.groundLevel,this.autoTravelTimeMin=t.autoTravelTimeMin||k.autoTravelTimeMin,this.autoTravelTimeMax=t.autoTravelTimeMax||k.autoTravelTimeMax,this.autoTravelTimeDist=t.autoTravelTimeDist||k.autoTravelTimeDist,t.smartZoomHeightMin&&(console.warn("Controls smartZoomHeightMin parameter is deprecated. Use smartTravelHeightMin instead."),t.smartTravelHeightMin=t.smartTravelHeightMin||t.smartZoomHeightMin),t.smartZoomHeightMax&&(console.warn("Controls smartZoomHeightMax parameter is deprecated. Use smartTravelHeightMax instead."),t.smartTravelHeightMax=t.smartTravelHeightMax||t.smartZoomHeightMax),this.smartTravelHeightMin=t.smartTravelHeightMin||k.smartTravelHeightMin,this.smartTravelHeightMax=t.smartTravelHeightMax||k.smartTravelHeightMax,this.instantTravel=t.instantTravel||k.instantTravel,this.minZenithAngle=(t.minZenithAngle||k.minZenithAngle)*Math.PI/180,this.maxZenithAngle=(t.maxZenithAngle||k.maxZenithAngle)*Math.PI/180,t.focusOnMouseOver&&console.warn("Planar controls 'focusOnMouseOver' optional parameter has been removed."),t.focusOnMouseClick&&console.warn("Planar controls 'focusOnMouseClick' optional parameter has been removed."),this.handleCollision=void 0===t.handleCollision?k.handleCollision:t.handleCollision,this.minDistanceCollision=k.minDistanceCollision,this.enableSmartTravel=void 0===t.enableSmartTravel?k.enableSmartTravel:t.enableSmartTravel,c.copy(this.camera.position),u.copy(this.camera.quaternion),this.state=p,this.cursor=f,this.view.controls&&(console.warn("Deprecated use of PlanarControls. See examples to correct PlanarControls implementation."),this.view.controls.dispose()),this.view.controls=this,this._handlerOnKeyDown=this.onKeyDown.bind(this),this._handlerOnMouseDown=this.onMouseDown.bind(this),this._handlerOnMouseUp=this.onMouseUp.bind(this),this._handlerOnMouseMove=this.onMouseMove.bind(this),this._handlerOnMouseWheel=this.onMouseWheel.bind(this),this._handlerContextMenu=this.onContextMenu.bind(this),this._handlerUpdate=this.update.bind(this),this.view.addFrameRequester(i.n7.AFTER_CAMERA_UPDATE,this._handlerUpdate),this.addInputListeners()}dispose(){this.removeInputListeners(),this.view.removeFrameRequester(i.n7.AFTER_CAMERA_UPDATE,this._handlerUpdate)}update(e,t){t&&(e=16);const r=this.state!==p;switch(this.state){case 3:this.handleTravel(e),this.view.notifyChange(this.camera);break;case 4:this.handleZoomOrtho(e),this.view.notifyChange(this.camera);break;case 0:this.handleDragMovement(),this.view.notifyChange(this.camera);break;case 2:this.handleRotation(),this.view.notifyChange(this.camera);break;case 1:this.handlePanMovement(),this.view.notifyChange(this.camera)}this.handleCollision&&this.view.camera.adjustAltitudeToAvoidCollisionWithLayer(this.view,this.view.tileLayer,this.minDistanceCollision),r&&this.view.dispatchEvent({type:z.MOVED}),y.set(0,0)}initiateDrag(){this.state=0,v.copy(this.getWorldPointAtScreenXY(g)),_.set(0,0,0)}handleDragMovement(){this.getWorldPointFromMathPlaneAtScreenXY(g,v.z,x),_.subVectors(v,x),this.camera.position.add(_),_.set(0,0,0)}initiatePan(){this.state=1}handlePanMovement(){E.set(-y.x,y.y,0),this.camera.localToWorld(E),this.camera.position.copy(E)}initiateRotation(){this.state=2,b.copy(this.getWorldPointAtScreenXY(new n.Vector2(.5*this.view.mainLoop.gfxEngine.width,.5*this.view.mainLoop.gfxEngine.height)));const e=this.camera.position.distanceTo(b);w=Math.acos((this.camera.position.z-b.z)/e)}handleRotation(){const e=-this.rotateSpeed*y.x/this.view.mainLoop.gfxEngine.width,t=-this.rotateSpeed*y.y/this.view.mainLoop.gfxEngine.height,r=this.camera.position.clone().sub(b);0===e&&0===t||(w+t>=this.minZenithAngle&&w+t<=this.maxZenithAngle&&0!==t&&(w+=t,E.set(0,0,1),M.setFromUnitVectors(this.camera.up,E),r.applyQuaternion(M),E.setFromMatrixColumn(this.camera.matrix,0),M.setFromAxisAngle(E,t),r.applyQuaternion(M),E.set(0,0,1),M.setFromUnitVectors(this.camera.up,E).invert(),r.applyQuaternion(M)),0!==e&&(E.set(0,0,1),M.setFromAxisAngle(E,e),r.applyQuaternion(M))),this.camera.position.copy(r),this.camera.lookAt(m),this.camera.position.add(b),this.camera.updateMatrixWorld()}initiateZoom(e){const t=-e.deltaY;d.copy(this.getWorldPointAtScreenXY(g));const r=new n.Vector3;if(t>0||t<0&&this.maxAltitude>this.camera.position.z){const e=t>0?this.zoomInFactor:this.zoomOutFactor,n=this.view.getPixelsToMeters()/e;if(this.maxResolution>n||n>this.minResolution)return;this.camera.isOrthographicCamera?(this.state=4,this.view.notifyChange(this.camera),O=this.camera.zoom,N=O*e,d.z=this.camera.position.z,B=0,P=this.zoomTravelTime,this.updateMouseCursorType()):(r.lerpVectors(this.camera.position,d,1-1/e),this.initiateTravel(r,this.zoomTravelTime,null,!1))}}handleZoomOrtho(e){B=Math.min(B+e/1e3/P,1);const t=O+B*(N-O);this.camera.zoom!==t&&(this.camera.zoom=t,this.camera.updateProjectionMatrix(),this.view.viewToNormalizedCoords(g,E),E.z=0,E.unproject(this.camera),this.camera.position.x+=d.x-E.x,this.camera.position.y+=d.y-E.y,this.camera.updateMatrixWorld(!0)),this.testAnimationEnd()}initiateSmartTravel(){const e=this.getWorldPointAtScreenXY(g),t=new n.Vector3;t.copy(e).sub(this.camera.position),t.z=0,t.normalize();const r=this.camera.position.distanceTo(e),i=n.MathUtils.lerp(this.smartTravelHeightMin,this.smartTravelHeightMax,Math.min(r/5e3,1)),s=new n.Vector3;s.copy(e),this.enableRotation&&s.add(t.multiplyScalar(2*-i)),s.z=e.z+i,this.camera.isOrthographicCamera&&(O=this.camera.zoom,N=O*(1+Math.min(r/5e3,1)),s.z=this.camera.position.z),this.initiateTravel(s,"auto",e,!0)}initiateTravel(e,t,r,i){if(this.state=3,this.view.notifyChange(this.camera),B=0,this.updateMouseCursorType(),L=this.enableRotation&&r&&(r.isQuaternion||r.isVector3),D=i,T.copy(this.camera.position),I.copy(this.camera.quaternion),L&&(r.isQuaternion?R.copy(r):r.isVector3&&(e===r?(this.camera.lookAt(r),R.copy(this.camera.quaternion),this.camera.quaternion.copy(I)):(this.camera.position.copy(e),this.camera.lookAt(r),R.copy(this.camera.quaternion),this.camera.quaternion.copy(I),this.camera.position.copy(T)))),C.copy(e),this.instantTravel)P=0;else if("auto"===t){const t=Math.min(1,e.distanceTo(this.camera.position)/this.autoTravelTimeDist);if(P=n.MathUtils.lerp(this.autoTravelTimeMin,this.autoTravelTimeMax,t),L){const e=.5-.5*R.normalize().dot(this.camera.quaternion.normalize());P*=1+2*e,P=Math.min(P,this.autoTravelTimeMax)}}else P=t}handleTravel(e){B=Math.min(B+e/1e3/P,1);const t=D?this.smooth(B):B;this.camera.position.lerpVectors(T,C,t);const r=O+t*(N-O);this.camera.isOrthographicCamera&&this.camera.zoom!==r&&(this.camera.zoom=r,this.camera.updateProjectionMatrix()),!0===L&&this.camera.quaternion.slerpQuaternions(I,R,t),this.testAnimationEnd()}testAnimationEnd(){1===B&&(this.state=p,this.updateMouseCursorType())}goToTopView(){const e=new n.Vector3,t=new n.Quaternion;e.copy(this.getWorldPointAtScreenXY(new n.Vector2(.5*this.view.mainLoop.gfxEngine.width,.5*this.view.mainLoop.gfxEngine.height))),e.z+=Math.min(this.maxAltitude,this.camera.position.distanceTo(e)),t.setFromAxisAngle(new n.Vector3(1,0,0),0),this.initiateTravel(e,"auto",t,!0)}goToStartView(){this.camera.isOrthographicCamera&&(O=this.camera.zoom,N=h),this.initiateTravel(c,"auto",u,!0)}getWorldPointFromMathPlaneAtScreenXY(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new n.Vector3;return S.copy(this.view.viewToNormalizedCoords(e)),U.setFromCamera(S,this.camera),F.constant=t,U.ray.intersectPlane(F,r),r}getWorldPointAtScreenXY(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Vector3;return this.view.getPickingPositionFromDepth(e,t)||this.getWorldPointFromMathPlaneAtScreenXY(e,this.groundLevel,t),t}addInputListeners(){this.view.domElement.addEventListener("keydown",this._handlerOnKeyDown,!1),this.view.domElement.addEventListener("mousedown",this._handlerOnMouseDown,!1),this.view.domElement.addEventListener("mouseup",this._handlerOnMouseUp,!1),this.view.domElement.addEventListener("mouseleave",this._handlerOnMouseUp,!1),this.view.domElement.addEventListener("mousemove",this._handlerOnMouseMove,!1),this.view.domElement.addEventListener("wheel",this._handlerOnMouseWheel,!1),this.view.domElement.addEventListener("contextmenu",this._handlerContextMenu,!1)}removeInputListeners(){this.view.domElement.removeEventListener("keydown",this._handlerOnKeyDown,!0),this.view.domElement.removeEventListener("mousedown",this._handlerOnMouseDown,!1),this.view.domElement.removeEventListener("mouseup",this._handlerOnMouseUp,!1),this.view.domElement.removeEventListener("mouseleave",this._handlerOnMouseUp,!1),this.view.domElement.removeEventListener("mousemove",this._handlerOnMouseMove,!1),this.view.domElement.removeEventListener("wheel",this._handlerOnMouseWheel,!1),this.view.domElement.removeEventListener("contextmenu",this._handlerContextMenu,!1)}updateMouseCursorType(){switch(this.state){case p:this.view.domElement.style.cursor=this.cursor.default;break;case 0:this.view.domElement.style.cursor=this.cursor.drag;break;case 1:this.view.domElement.style.cursor=this.cursor.pan;break;case 3:this.view.domElement.style.cursor=this.cursor.travel;break;case 4:this.view.domElement.style.cursor=this.cursor.ortho_zoom;break;case 2:this.view.domElement.style.cursor=this.cursor.rotate}}updateMousePositionAndDelta(e){this.view.eventToViewCoords(e,g),y.copy(g).sub(A),A.copy(g)}setCursor(e,t){this.cursor[e]=t,this.updateMouseCursorType()}onMouseDown(e){if(this.enabled&&(e.preventDefault(),this.view.domElement.focus(),p===this.state)){if(l=e.button,this.updateMousePositionAndDelta(e),s===e.button)if(e.ctrlKey){if(!this.enableRotation)return;this.initiateRotation()}else this.initiateDrag();else if(o===e.button){if(!this.enableSmartTravel)return;this.initiateSmartTravel()}else if(a===e.button){if(!this.enablePan)return;this.initiatePan()}this.updateMouseCursorType()}}onMouseUp(e){e.preventDefault(),3!==this.state&&4!==this.state&&l===e.button&&(this.state=p),this.updateMouseCursorType()}onMouseMove(e){this.enabled&&(e.preventDefault(),this.updateMousePositionAndDelta(e),p!==this.state&&this.view.notifyChange())}onKeyDown(e){if(p===this.state&&this.enabled)switch(e.keyCode){case 84:this.camera.isOrthographicCamera||this.goToTopView();break;case 89:this.goToStartView();break;case 32:this.enableSmartTravel&&this.initiateSmartTravel(e)}}onMouseWheel(e){this.enabled&&(e.preventDefault(),e.stopPropagation(),p===this.state&&this.initiateZoom(e))}onContextMenu(e){e.preventDefault()}smooth(e){return(e**2*(3-2*e))**1.2}}const Q=G},34993:(e,t,r)=>{"use strict";r.d(t,{A:()=>h});var n=r(39437);const i={BYTE:1,UNSIGNED_BYTE:1,SHORT:2,UNSIGNED_SHORT:2,INT:4,UNSIGNED_INT:4,FLOAT:4,DOUBLE:8},s={BYTE:Int8Array,UNSIGNED_BYTE:Uint8Array,SHORT:Int16Array,UNSIGNED_SHORT:Uint16Array,INT:Int32Array,UNSIGNED_INT:Uint32Array,FLOAT:Float32Array,DOUBLE:Float64Array},o={SCALAR:1,VEC2:2,VEC3:3,VEC4:4},a={VEC2:n.Vector2,VEC3:n.Vector3,VEC4:n.Vector4},l=function(e,t,r,n,l){if(!e)throw new Error("Buffer is mandatory to parse binary property.");if(null==t)throw new Error("batchLength is mandatory to parse binary property.");if(null==r)throw new Error("byteOffset is mandatory to parse binary property.");if(!i[n])throw new Error(`Uknown component type: ${n}. Cannot access binary property.`);if(!o[l])throw new Error(`Uknown type: ${l}. Cannot access binary property.`);const c=o[l],u=new s[n](e,r,t*c);if("SCALAR"===l)return Array.from(u);{const e=[];for(let t=0;t<=u.length-c;t+=c){const r=new a[l];r.fromArray(u,t),e.push(r)}return e}};var c=r(25847);const u=new TextDecoder,h=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new ArrayBuffer,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4?arguments[4]:void 0;4!==arguments.length||"object"!=typeof n||Array.isArray(n)||null===n||console.warn("You most likely used a deprecated constructor of C3DTBatchTable."),t+r!==e.byteLength&&console.error("3DTiles batch table json length and binary length are not consistent with total buffer length. The batch table may be wrong."),this.type=c.A.batchtable,this.batchLength=n;const s=e.slice(0,t),o=u.decode(new Uint8Array(s)),a=""===o?null:JSON.parse(o);if(r>0){const n=e.slice(t,t+r);for(const e in a){if(!Object.prototype.hasOwnProperty.call(a,e))continue;const t=a[e];Array.isArray(t)||(void 0!==t?.byteOffset&&void 0!==t?.componentType&&void 0!==t?.type?a[e]=l(n,this.batchLength,t.byteOffset,t.componentType,t.type):console.error("Invalid 3D Tiles batch table property that is neither a JSON array nor a valid accessor to a binary body"))}}a&&a.extensions&&(this.extensions=i.parseExtensions(a.extensions,this.type),delete a.extensions),this.content=a}getInfoById(e){if(e<0&&e{"use strict";r.d(t,{A:()=>g});var n=r(39437),i=r(96027),s=r(52404),o=r(25847);const a=new i.A,l=new n.Vector3,c=new n.Vector3,u=new s.A("EPSG:4326"),h=new n.Vector3,d=new s.A("EPSG:4326"),p=new n.Vector3,f=new n.Vector3,m=new n.Vector3,g=class{constructor(e,t,r){if(this.type=o.A.boundingVolume,e.region)this.initialVolumeType=o.h.region,this.volume=function(e,t){const r=e[2],i=e[0],s=e[1],o=e[3],l=e[4],c=e[5],m=n.MathUtils.radToDeg(r),g=n.MathUtils.radToDeg(i),A=n.MathUtils.radToDeg(s),y=n.MathUtils.radToDeg(o);d.setFromValues(g,y,l),a.cartographicToCartesian(d,p),u.setFromValues(m,A,c),a.cartographicToCartesian(u,h);const v=new n.Vector3;v.lerpVectors(p,h,.5);const x=f.subVectors(p,h).length()/2,_=new n.Sphere(v,x);return _.applyMatrix4(t),_}(e.region,t);else if(e.box)this.initialVolumeType=o.h.box,this.volume=function(e){c.set(e[0],e[1],e[2]),l.set(e[3],e[7],e[11]).multiplyScalar(2);const t=new n.Box3;return t.setFromCenterAndSize(c,l),t}(e.box);else{if(!e.sphere)throw new Error(`Unknown bounding volume type: ${e}. 3D Tiles nodes must have a bounding volume of type\n region, box or sphere.`);this.initialVolumeType=o.h.sphere,this.volume=function(e){const t=new n.Vector3;return t.set(e[0],e[1],e[2]),new n.Sphere(t,e[3])}(e.sphere)}e.extensions&&(this.extensions=r.parseExtensions(e.extensions,this.type))}boundingVolumeCulling(e,t){if(this.initialVolumeType===o.h.box)return!e.isBox3Visible(this.volume,t);if(this.initialVolumeType===o.h.sphere||this.initialVolumeType===o.h.region)return!e.isSphereVisible(this.volume,t);throw new Error("Unknown bounding volume type.")}viewerRequestVolumeCulling(e,t){return this.initialVolumeType===o.h.region?(console.warn("Region viewerRequestVolume not yet supported"),!0):this.initialVolumeType===o.h.box?(console.warn("Bounding box viewerRequestVolume not yet supported"),!0):this.initialVolumeType===o.h.sphere&&(m.copy(this.volume.center),m.applyMatrix4(t),!(e.camera3D.position.distanceTo(m)<=this.volume.radius))}}},706:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});const n=class{registerExtension(e,t){this[e]=t}getExtension(e,t){if(this[e]&&this[e][t])return this[e][t];console.error(`No extension manager registered for extension ${e} and for class ${t}`)}isExtensionRegistered(e){return this[e]}parseExtensions(e,t){const r={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=new(this.getExtension(n,t))(e[n]));return r}}},55536:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n=r(39437);function i(e){return e.batchTable?e.batchTable:e.parent?i(e.parent):null}const s=class{#e;constructor(e,t,r,n,i){this.object3d=i,this.batchId=t,this.groups=r,this.userData=n,this.tileId=e,this.#e=null}computeWorldBox3(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new n.Box3;return e.max.x=-1/0,e.max.y=-1/0,e.max.z=-1/0,e.min.x=1/0,e.min.y=1/0,e.min.z=1/0,this.groups.forEach((t=>{const r=t.start*this.object3d.geometry.attributes.position.itemSize,n=(t.start+t.count)*this.object3d.geometry.attributes.position.itemSize;for(let t=r;t{"use strict";r.d(t,{A:()=>n,h:()=>i});const n={tileset:"tileset",batchtable:"batchtable",boundingVolume:"boundingVolume"},i={region:"region",box:"box",sphere:"sphere"}},80264:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(39437),i=r(34422),s=r(25847);const o=new n.Matrix4,a=class{constructor(e,t,r){this.type=s.A.tileset,this.asset=e.asset,this.properties=e.properties,this.geometricError=e.geometricError,this.extensionsUsed=e.extensionsUsed,this.extensionsRequired=e.extensionsRequired,this.tiles=[],this.parseTiles(e.root,t,void 0,r),e.extensions&&(this.extensions=r.parseExtensions(e.extensions,this.type))}parseTiles(e,t,r,s){if(e.transform=e.transform?(new n.Matrix4).fromArray(e.transform):void 0,e._worldFromLocalTransform=e.transform,r&&r._worldFromLocalTransform&&(e.transform?e._worldFromLocalTransform=(new n.Matrix4).multiplyMatrices(r._worldFromLocalTransform,e.transform):e._worldFromLocalTransform=r._worldFromLocalTransform),(e.viewerRequestVolume&&e.viewerRequestVolume.region||e.boundingVolume&&e.boundingVolume.region)&&(e._worldFromLocalTransform?o.copy(e._worldFromLocalTransform).invert():o.identity()),e.viewerRequestVolume=e.viewerRequestVolume?new i.A(e.viewerRequestVolume,o,s):null,e.boundingVolume=e.boundingVolume?new i.A(e.boundingVolume,o,s):null,this.tiles.push(e),e.tileId=this.tiles.length-1,e.baseURL=t,e.children)for(const r of e.children)this.parseTiles(r,t,e,s)}extendTileset(e,t,r,n){this.parseTiles(e.root,r,this.tiles[t],n),this.tiles[t].children=[e.root],this.tiles[t].isTileset=!0}}},47155:(e,t,r)=>{"use strict";r.d(t,{K3:()=>i,bf:()=>a,nt:()=>o,zv:()=>s});var n=r(99234);const i=e=>(e.fx&&(console.warn("ColorLayer fx is deprecated, use ColorLayer.effect_type and ColorLayer.effect_parameter instead."),e.fx>2?(e.effect_parameter=e.fx,e.effect_type=n.Ll.removeLightColor):e.fx>0&&(e.effect_parameter=e.fx,e.effect_type=n.Ll.removeWhiteColor)),e),s=e=>{if(e.crsOut||e.crsIn){console.warn("Parsing options with crsIn and crsOut are deprecated, use { in, out } structure.");const t={in:{},out:{}};return t.in.crs=e.crsIn,t.in.isInverted=e.isInverted,t.in.styles=e.styles,t.in.layers=e.layers,t.in.filter=e.filter,t.out.crs=e.crsOut,t.out.mergeFeatures=e.mergeFeatures,e.withAltitude&&e.withNormal?(console.warn("Parsing options withAltitude and withNormal is deprecated, use out.structure: 2d or 3d."),t.out.structure="3d"):t.out.structure="2d",t.out.filteringExtent=e.filteringExtent,t.out.style=e.style,void 0!==e.crsOut.overrideAltitudeInToZero&&console.error("Parsing options out.overrideAltitudeInToZero is removed, use Style.xxx.base_altitude instead"),t.out.filter=e.filter,t}return e.out&&(void 0===e.out.withAltitude&&void 0===e.out.withNormal||(console.warn("Parsing options out.withAltitude and out.withNormal is deprecated, use out.structure: 2d or 3d."),e.out.withAltitude&&e.out.withNormal?e.out.structure="3d":e.out.structure="2d"),void 0!==e.out.overrideAltitudeInToZero&&console.error("Parsing options out.overrideAltitudeInToZero is removed, use Style.xxx.base_altitude instead")),e},o=e=>{e.color&&console.error("Color convert option is removed, use Style.xxx.color"),e.extrude&&console.error("extrude convert option is removed, use Style.fill.extrusion_height instead"),e.altitude&&console.error("altitude convert option is removed, use Style.xxx.base_altitude instead")},a=e=>{!1===e.isWebGL2&&console.error("WebGL1 support ended in 2.43.0. Falling-back to the WebGL2 renderer.")}},36845:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>m,Xs:()=>u,ZC:()=>_,fj:()=>h});var n=r(39437),i=r(86215),s=r(52404),o=r(48306);function a(e){return new i.A(e,1/0,-1/0,1/0,-1/0)}function l(e,t){e.normals&&t.geodesicNormal.toArray(e.normals,e._pos),e._pushValues(t.x,t.y,t.z)}const c=new s.A("EPSG:4326",0,0,0),u={POINT:0,LINE:1,POLYGON:2};class h{#t;constructor(e){this.indices=[],this.properties={},this.size=e.size,e.extent&&(this.extent=a(e.extent.crs),this.#t=a(e.extent.crs))}startSubGeometry(e,t){const r=this.indices.length-1,n=this.extent?a(this.extent.crs):void 0,i=r>-1?this.indices[r].offset+this.indices[r].count:t.vertices.length/this.size;this.indices.push({offset:i,count:e,extent:n}),this.#t=n,function(e,t){e.vertices.length+=t*e.size,e.normals&&(e.normals.length=e.vertices.length)}(t,e)}closeSubGeometry(e,t){const r=this.indices.length-1,n=r>-1?this.indices[r].offset+this.indices[r].count:t.vertices.length/this.size-e;this.indices.push({offset:n,count:e,extent:this.#t}),this.extent&&(this.extent.union(this.#t),this.#t=a(this.extent.crs))}getLastSubGeometry(){const e=this.indices.length-1;return this.indices[e]}pushCoordinates(e,t){if(e.isCoordinates)return console.warn("Deprecated: change in arguments order, use pushCoordinates(feature, coordIn) instead"),void this.pushCoordinates(t,e);t.as(e.crs,c),e.transformToLocalSystem(c),l(e,c),this.#t&&this.#t.expandByCoordinates(e.useCrsOut?c:t)}pushCoordinatesValues(e,t,r){if((arguments.length<=3?0:arguments.length-3)>0)return console.warn("Deprecated: change in arguments, use pushCoordinatesValues(feature, {x: long, y: lat, normal}, coordProj) instead"),void this.pushCoordinatesValues(e,{x:t,y:r,normal:arguments.length<=3?void 0:arguments[3]},arguments.length<=4?void 0:arguments[4]);l(e,t),this.#t&&this.#t.expandByValuesCoordinates(t.x,t.y)}updateExtent(){if(this.extent){const e=this.indices[this.indices.length-1];e&&this.extent.union(e.extent)}}}function d(e,t){this.vertices[this._pos++]=e,this.vertices[this._pos++]=t}function p(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.vertices[this._pos++]=e,this.vertices[this._pos++]=t,this.vertices[this._pos++]=r}class f{constructor(e,t){if(!Object.keys(u).find((t=>u[t]===e)))throw new Error(`Unsupported Feature type: ${e}`);this.type=e,this.geometries=[],this.vertices=[],this.crs=t.crs,this.size=t.size,this.normals="EPSG:4978"==t.crs?[]:void 0,this.hasRawElevationData=!1,this.transformToLocalSystem=t.transformToLocalSystem.bind(t),t.extent&&(this.extent=a(t.extent.crs),this.useCrsOut=this.extent.crs==this.crs),this._pos=0,this._pushValues=(3===this.size?p:d).bind(this),this.style=o.Ay.setFromProperties}bindNewGeometry(){const e=new h(this);return this.geometries.push(e),e}updateExtent(e){this.extent&&this.extent.union(e.extent)}get geometryCount(){return this.geometries.length}}const m=f,g=()=>{},A=(e,t)=>(e.geodesicNormal.applyNormalMatrix(t.normalMatrixInverse),e.applyMatrix4(t.matrixWorldInverse)),y=(e,t)=>e.applyMatrix4(t.matrixWorldInverse),v=new n.Vector3(0,0,1),x=new n.Quaternion;class _ extends n.Object3D{#r=(()=>y)();#n=(()=>g)();constructor(e){super(),this.isFeatureCollection=!0,this.crs=e.accurate||!e.source?.crs?e.crs:e.source.crs,this.features=[],this.mergeFeatures=void 0===e.mergeFeatures||e.mergeFeatures,this.size="3d"==e.structure?3:2,this.filterExtent=e.filterExtent,this.style=e.style,this.isInverted=!1,this.matrixWorldInverse=new n.Matrix4,this.center=new s.A("EPSG:4326",0,0),2==this.size?(this.extent=!1===e.buildExtent?void 0:a(e.forcedExtentCrs||this.crs),this.#n=e=>{e.as(this.crs,this.center),this.position.copy(e),this.updateMatrixWorld(),this.#n=g}):(this.extent=e.buildExtent?a(e.forcedExtentCrs||this.crs):void 0,this.#n=e=>{e.as("EPSG:4326",this.center),"EPSG:4978"==this.crs&&(this.quaternion.setFromUnitVectors(v,e.geodesicNormal),x.setFromAxisAngle(v,n.MathUtils.degToRad(90+this.center.longitude)),this.quaternion.multiply(x)),this.position.copy(e),this.updateMatrixWorld(),this.normalMatrix.getNormalMatrix(this.matrix),this.normalMatrixInverse=(new n.Matrix3).copy(this.normalMatrix).invert(),this.#n=g},this.#r=A)}transformToLocalSystem(e){return this.#n(e),this.#r(e,this)}updateExtent(e){if(this.extent){const t=e?[e]:this.features.map((e=>e.extent));for(const e of t)this.extent.union(e)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}removeEmptyFeature(){this.features=this.features.filter((e=>e.geometries.length))}pushFeature(e){this.features.push(e),this.updateExtent(e.extent)}requestFeature(e,t){const r=this.features.find(t);if(r&&this.mergeFeatures)return r;{const t=new f(e,this);return this.features.push(t),t}}requestFeatureByType(e){return this.requestFeature(e,(t=>t.type===e))}requestFeatureById(e,t){return this.requestFeature(t,(t=>t.id===e))}newFeatureByReference(e){const t=new f(e.type,this);return t.extent=e.extent,t.geometries=e.geometries,t.normals=e.normals,t.size=e.size,t.vertices=e.vertices,t._pos=e._pos,this.features.push(t),t}}},52404:(e,t,r)=>{"use strict";r.d(t,{A:()=>f});var n=r(39437),i=r(68721),s=r(86406),o=r(96027);i.A.defs("EPSG:4978","+proj=geocent +datum=WGS84 +units=m +no_defs");const a=new o.A,l={},c=new n.Vector3,u=new n.Vector3;let h,d;class p{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.isCoordinates=!0,s.isValid(e),this.crs=e,this.x=0,this.y=0,this.z=0,this._normal=new n.Vector3,t.length>0?this.setFromArray(t):t.isVector3||t.isCoordinates?this.setFromVector3(t):this.setFromValues(t,r,i),this._normalNeedsUpdate=!0}setCrs(e){s.isValid(e),this.crs=e}setFromValues(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.x=null==e?0:e,this.y=null==t?0:t,this.z=null==r?0:r,this._normalNeedsUpdate=!0,this}setFromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.setFromValues(e[t],e[t+1],e[t+2])}setFromVector3(e){return this.setFromValues(e.x,e.y,e.z)}clone(){return new p(this.crs,this)}copy(e){return this.crs=e.crs,this.setFromVector3(e)}get longitude(){return this.x}get latitude(){return this.y}get altitude(){return this.z}set altitude(e){this.z=e}get geodesicNormal(){return this._normalNeedsUpdate&&(this._normalNeedsUpdate=!1,s.is4326(this.crs)?a.geodeticSurfaceNormalCartographic(this,this._normal):"EPSG:4978"==this.crs?a.geodeticSurfaceNormal(this,this._normal):this._normal.set(0,0,1)),this._normal}toVector3(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:new n.Vector3).copy(this)}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return n.Vector3.prototype.toArray.call(this,e,t)}planarDistanceTo(e){return this.toVector3(c).setZ(0),e.toVector3(u).setZ(0),c.distanceTo(u)}geodeticDistanceTo(e){return this.as("EPSG:4326",h),e.as("EPSG:4326",d),a.geodesicDistance(h,d)}spatialEuclideanDistanceTo(e){return this.as("EPSG:4978",h).toVector3(c),e.as("EPSG:4978",d).toVector3(u),c.distanceTo(u)}applyMatrix4(e){return n.Vector3.prototype.applyMatrix4.call(this,e)}as(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new p(e);var r,o;return this.crs==e?t.copy(this):(s.is4326(this.crs)&&"EPSG:3857"==e&&(this.y=n.MathUtils.clamp(this.y,-89.999999,89.999999)),t.setFromArray((r=this.crs,o=e,l[r]||(l[r]={}),l[r][o]||(l[r][o]=(0,i.A)(r,o)),l[r][o]).forward([this.x,this.y,this.z]))),t.crs=e,t}}h=new p("EPSG:4326",0,0,0),d=new p("EPSG:4326",0,0,0);const f=p},86215:(e,t,r)=>{"use strict";r.d(t,{A:()=>v});var n=r(39437),i=r(86406),s=r(52404);const o=new n.Vector2,a=new n.Vector2,l=new n.Box3,c=new n.Vector2(2,2),u=new s.A("EPSG:4326",0,0,0),h=new s.A("EPSG:4326",0,0,0),d=new s.A("EPSG:4326",0,0,0),p=new n.Vector3,f=new n.Vector3;let m;const g=new Array(8);for(let e=g.length-1;e>=0;e--)g[e]=new s.A("EPSG:4326",0,0,0);const A=new s.A("EPSG:4326",0,0);class y{constructor(e,t,r,n,s){if(i.isGeocentric(e))throw new Error(`${e} is a geocentric projection, it doesn't make sense with a geographical extent`);this.isExtent=!0,this.crs=e,this.west=0,this.east=0,this.south=0,this.north=0,this.set(t,r,n,s)}clone(){return new y(this.crs,this.west,this.east,this.south,this.north)}as(e,t){if(i.isValid(e),t=t||new y("EPSG:4326",[0,0,0,0]),this.crs!=e){const r=this.center(A);g[0].setFromValues(this.west,this.north),g[1].setFromValues(r.x,this.north),g[2].setFromValues(this.east,this.north),g[3].setFromValues(this.east,r.y),g[4].setFromValues(this.east,this.south),g[5].setFromValues(r.x,this.south),g[6].setFromValues(this.west,this.south),g[7].setFromValues(this.west,r.y),t.set(1/0,-1/0,1/0,-1/0);for(let r=0;r0&&void 0!==arguments[0]?arguments[0]:new s.A(this.crs);return this.planarDimensions(o),e.crs=this.crs,e.setFromValues(this.west+.5*o.x,this.south+.5*o.y),e}dimensions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new n.Vector2;return console.warn("Extent.dimensions is deprecated, use planarDimensions, geodeticDimensions or spatialEuclideanDimensions"),e.x=Math.abs(this.east-this.west),e.y=Math.abs(this.north-this.south),e}planarDimensions(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:new n.Vector2).set(Math.abs(this.east-this.west),Math.abs(this.north-this.south))}geodeticDimensions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new n.Vector2;return u.crs=this.crs,h.crs=this.crs,d.crs=this.crs,u.setFromValues(this.west,this.north,0),h.setFromValues(this.west,this.south,0),d.setFromValues(this.east,this.north,0),e.set(u.geodeticDistanceTo(d),u.geodeticDistanceTo(h))}spatialEuclideanDimensions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new n.Vector2;return u.crs=this.crs,h.crs=this.crs,d.crs=this.crs,u.setFromValues(this.west,this.north,0),h.setFromValues(this.west,this.south,0),d.setFromValues(this.east,this.north,0),e.set(u.spatialEuclideanDistanceTo(d),u.spatialEuclideanDistanceTo(h))}isPointInside(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.crs==e.crs?A.copy(e):e.as(this.crs,A),A.x<=this.east+t&&A.x>=this.west-t&&A.y<=this.north+t&&A.y>=this.south-t}isInside(e,t){return e.as(this.crs,m),t=t??i.reasonableEpsilon(this.crs),this.east-m.east<=t&&m.west-this.west<=t&&this.north-m.north<=t&&m.south-this.south<=t}offsetToParent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Vector4;if(this.crs!=e.crs)throw new Error("unsupported mix");e.planarDimensions(o),this.planarDimensions(a);const r=(this.west-e.west)/o.x,i=(e.north-this.north)/o.y,s=a.x/o.x,l=a.y/o.y;return t.set(r,i,s,l)}intersectsExtent(e){return y.intersectsExtent(this,e)}static intersectsExtent(e,t){const r=t.crs==e.crs?t:t.as(e.crs,m);return!(e.west>=r.east||e.east<=r.west||e.south>=r.north||e.north<=r.south)}intersect(e){return this.intersectsExtent(e)?(e.crs!=this.crs&&(e=e.as(this.crs,m)),new y(this.crs,Math.max(this.west,e.west),Math.min(this.east,e.east),Math.max(this.south,e.south),Math.min(this.north,e.north))):new y(this.crs,0,0,0,0)}set(e,t,r,n){if(null==e)throw new Error("No values to set in the extent");return e.isExtent&&(t=e.east,r=e.south,n=e.north,e=e.west),e.isCoordinates?(this.west=e.x,this.east=t.x,this.south=e.y,this.north=t.y):void 0!==e.west?(this.west=e.west,this.east=e.east,this.south=e.south,this.north=e.north):4==e.length?(this.west=e[0],this.east=e[1],this.south=e[2],this.north=e[3]):void 0!==n&&(this.west=e,this.east=t,this.south=r,this.north=n),this}copy(e){return this.crs=e.crs,this.set(e)}union(e){if(e.crs!=this.crs)throw new Error("unsupported union between 2 diff crs");if(this.west===1/0)this.copy(e);else{const t=e.west;tthis.east&&(this.east=r);const n=e.south;nthis.north&&(this.north=i)}}expandByCoordinates(e){const t=e.crs==this.crs?e:e.as(this.crs,A);this.expandByValuesCoordinates(t.x,t.y)}expandByValuesCoordinates(e,t){ethis.east&&(this.east=e),tthis.north&&(this.north=t)}static fromBox3(e,t){return i.isGeocentric(e)&&(e="EPSG:4326",t=l.copy(t),h.crs=e,h.setFromVector3(t.min).as(e,h).toVector3(t.min),d.crs=e,d.setFromVector3(t.max).as(e,d).toVector3(t.max)),new y(e,{west:t.min.x,east:t.max.x,south:t.min.y,north:t.max.y})}toString(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return`${this.east}${e}${this.north}${e}${this.west}${e}${this.south}`}subdivision(){return this.subdivisionByScheme()}subdivisionByScheme(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c;const t=[],r=this.planarDimensions(o).divide(e);for(let n=e.x-1;n>=0;n--)for(let i=e.y-1;i>=0;i--){const e=this.west+n*r.x,s=this.south+i*r.y;t.push(new y(this.crs,e,e+r.x,s,s+r.y))}return t}applyMatrix4(e){if(p.set(this.west,this.south,0).applyMatrix4(e),f.set(this.east,this.north,0).applyMatrix4(e),this.west=p.x,this.east=f.x,this.south=p.y,this.north=f.y,this.west>this.east){const e=this.west;this.west=this.east,this.east=e}if(this.south>this.north){const e=this.south;this.south=this.north,this.north=e}return this}clampSouthNorth(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.south,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.north;return this.south=Math.max(this.south,e),this.north=Math.min(this.north,t),this}clampWestEast(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.west,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.east;return this.west=Math.max(this.west,e),this.east=Math.min(this.east,t),this}clampByExtent(e){return this.clampSouthNorth(e.south,e.north),this.clampWestEast(e.west,e.east)}}m=new y("EPSG:4326",[0,0,0,0]);const v=y},77855:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(39437),i=r(86406);const s=new(r(52404).A)("EPSG:4326"),o=new n.Vector2,a=class{constructor(e,t,r){i.isGeographic(e.crs),this.extent=e,this.step=new n.Vector2(t.x,t.y||t.x),this.dimensions=this.extent.planarDimensions(),this.dataSize=(new n.Vector2).addVectors(this.step,this.dimensions).divide(this.step).round(),this.getData=r}getHeightAtCoordinates(e){return e.as(this.extent.crs,s),o.set((this.dataSize.x-1)*(s.x-this.extent.west)/this.dimensions.x,(this.dataSize.y-1)*(s.y-this.extent.south)/this.dimensions.y),o.x<0||o.x>=this.dataSize.x-1||o.y<0||o.y>=this.dataSize.y-1?0:function(e,t){const r=Math.floor(e.x),n=Math.floor(e.y),i=e.x-r,s=e.y-n;return(1-i)*((1-s)*t(n,r)+s*t(n+1,r))+i*((1-s)*t(n,r+1)+s*t(n+1,r+1))}(o,this.getData)}}},3837:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var n=r(39437),i=r(18590);const s=new(r(52404).A)("EPSG:4326");let o,a="";a=void 0!==document.documentElement.style.transform?"transform":void 0!==document.documentElement.style.webkitTransform?"webkitTransform":void 0!==document.documentElement.style.mozTransform?"mozTransform":void 0!==document.documentElement.style.oTransform?"oTransform":"transform";class l extends n.Object3D{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null==t)throw new Error("coordinates are mandatory to add a Label");arguments.length>3&&console.warn("Deprecated argument sprites in Label constructor. Sprites must be configured in style argument."),super();let n=this.visible;Object.defineProperty(this,"visible",{set(e){e!=n&&(n=e,this.content.style.display=e?"block":"none")},get:()=>n}),this.isLabel=!0,this.coordinates=t,this.projectedPosition={x:0,y:0},this.boundaries={left:0,right:0,top:0,bottom:0},"string"==typeof e?(this.content=document.createElement("div"),this.content.textContent=r.text.field):this.content=e.cloneNode(!0),this.content.classList.add("itowns-label"),this.content.style.userSelect="none",this.content.style.position="absolute",r.isStyle?(this.anchor=r.getTextAnchorPosition(),this.styleOffset=r.text.offset,"string"==typeof e&&(r.text.haloWidth>0&&this.content.classList.add("itowns-stroke-single"),r.applyToHTML(this.content).then((e=>{e&&(this.icon=e)})))):(this.anchor=[0,0],this.styleOffset=[0,0]),this.iconOffset={left:0,right:0,top:0,bottom:0},this.zoom={min:r.zoom&&null!=r.zoom.min?r.zoom.min:2,max:r.zoom&&null!=r.zoom.max?r.zoom.max:24},this.order=r.order||0,this.padding=2}updateProjectedPosition(e,t){const r=Math.round(e),n=Math.round(t);r==this.projectedPosition.x&&n==this.projectedPosition.y||(this.projectedPosition.x=r,this.projectedPosition.y=n,this.boundaries.left=e+this.offset.left-this.padding,this.boundaries.right=e+this.offset.right+this.padding,this.boundaries.top=t+this.offset.top-this.padding,this.boundaries.bottom=t+this.offset.bottom+this.padding,0===this.iconOffset.left&&0===this.iconOffset.right&&0===this.iconOffset.top&&0===this.iconOffset.bottom||(this.boundaries.left=Math.min(this.boundaries.left,e+this.iconOffset.left),this.boundaries.right=Math.max(this.boundaries.right,e+this.iconOffset.right),this.boundaries.top=Math.min(this.boundaries.top,t+this.iconOffset.top),this.boundaries.bottom=Math.max(this.boundaries.bottom,t+this.iconOffset.bottom)))}updateCSSPosition(){this.content.style[a]=`translate(${this.projectedPosition.x+this.offset.left}px, ${this.projectedPosition.y+this.offset.top}px)`,this.icon&&(this.icon.style[a]=`translate(${-this.offset.left}px, ${-this.offset.top}px)`)}initDimensions(){if(!this.offset){o=this.content.getBoundingClientRect();const e=Math.round(o.width),t=Math.round(o.height);this.offset={left:e*this.anchor[0]+this.styleOffset[0],top:t*this.anchor[1]+this.styleOffset[1]},this.offset.right=this.offset.left+e,this.offset.bottom=this.offset.top+t,this.icon&&(o=this.icon.getBoundingClientRect(),this.iconOffset={left:Math.floor(o.x),top:Math.floor(o.y),right:Math.ceil(o.x+o.width),bottom:Math.ceil(o.y+o.height)})}}update3dPosition(e){this.coordinates.as(e,s).toVector3(this.position),this.updateMatrixWorld()}updateElevationFromLayer(e,t){if(0==e.attachedLayers.filter((e=>e.isElevationLayer)).length)return;let r=Math.max(0,i.A.getElevationValueAt(e,this.coordinates,i.A.FAST_READ_Z,t));isNaN(r)&&(r=Math.max(0,i.A.getElevationValueAt(e,this.coordinates,i.A.FAST_READ_Z))),isNaN(r)||r==this.coordinates.z||(this.coordinates.z=r)}updateHorizonCullingPoint(){this.horizonCullingPoint&&this.getWorldPosition(this.horizonCullingPoint)}}const c=l},87196:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>c,Es:()=>i,n7:()=>s});var n=r(39437);const i=0,s={UPDATE_START:"update_start",BEFORE_CAMERA_UPDATE:"before_camera_update",AFTER_CAMERA_UPDATE:"after_camera_update",BEFORE_LAYER_UPDATE:"before_layer_update",AFTER_LAYER_UPDATE:"after_layer_update",BEFORE_RENDER:"before_render",AFTER_RENDER:"after_render",UPDATE_END:"update_end"};function o(e,t,r){if(r)for(const n of r){const r=t.update(e,t,n),i=t.getObjectToUpdateForAttachedLayers(n);if(i)if(i.element)for(const r of t.attachedLayers)r.ready&&(r.update(e,r,i.element,i.parent),r.cache.flush());else if(i.elements)for(let r=0;r{e===t||e.isCamera?(t.info.clear(),r=!0):e.layer===t&&n.add(e)})),r?new Set([t]):n}class l extends n.EventDispatcher{#i=!1;#s=!0;#o=0;constructor(e,t){super(),this.renderingState=i,this.scheduler=e,this.gfxEngine=t}scheduleViewUpdate(e,t){this.#i|=t,1!==this.renderingState&&(this.renderingState=1,this.gfxEngine.renderer.xr.isPresenting||requestAnimationFrame((t=>{this.step(e,t)})))}#a(e,t,r){const n={camera:e.camera,engine:this.gfxEngine,scheduler:this.scheduler,view:e};t.forEach((e=>{const r=e.layer||e;r.isLayer&&r.parent&&t.add(r.parent)}));for(const i of e.getLayers(((e,t)=>!t)))if(n.geometryLayer=i,i.ready&&i.visible&&!i.frozen){e.execFrameRequesters(s.BEFORE_LAYER_UPDATE,r,this.#s,i);const l=a(t,i);if(l.size>0){for(const e of i.attachedLayers)e.ready&&e.preUpdate&&e.preUpdate(n,l);const e=i.preUpdate(n,l);o(n,i,e),i.postUpdate(n,i,t)}i.cache.flush(),e.execFrameRequesters(s.AFTER_LAYER_UPDATE,r,this.#s,i)}}step(e,t){const r=t-this.#o;e._executeFrameRequestersRemovals(),e.execFrameRequesters(s.UPDATE_START,r,this.#s);const n=this.#i;this.#o=t,this.#i=!1,this.renderingState=i;const o=new Set(e._changeSources);e._changeSources.clear();const a=this.gfxEngine.getWindowSize();e.execFrameRequesters(s.BEFORE_CAMERA_UPDATE,r,this.#s),e.camera.update(a.x,a.y),e.execFrameRequesters(s.AFTER_CAMERA_UPDATE,r,this.#s);const l=e.camera3D.matrixAutoUpdate;e.camera3D.matrixAutoUpdate=!1,this.#a(e,o,r),0==this.scheduler.commandsWaitingExecutionCount()&&this.dispatchEvent({type:"command-queue-empty"}),n&&this.#l(e,r),this.#s=this.renderingState===i,e.camera3D.matrixAutoUpdate=l,e.execFrameRequesters(s.UPDATE_END,r,this.#s)}#l(e,t){e.execFrameRequesters(s.BEFORE_RENDER,t,this.#s),e.render?e.render():this.gfxEngine.renderView(e),e.execFrameRequesters(s.AFTER_RENDER,t,this.#s)}}const c=l},96027:(e,t,r)=>{"use strict";r.d(t,{A:()=>l,Q:()=>o});var n=r(39437),i=r(68721),s=r(52404);const o=new n.Vector3(i.A.WGS84.a,i.A.WGS84.a,i.A.WGS84.b),a=new n.Vector3,l=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o;this.size=new n.Vector3,this._radiiSquared=new n.Vector3,this._invRadiiSquared=new n.Vector3,this.eccentricity=0,this.setSize(e)}geodeticSurfaceNormal(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Vector3;return e.toVector3(t).multiply(this._invRadiiSquared).normalize()}geodeticSurfaceNormalCartographic(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Vector3;const r=n.MathUtils.degToRad(e.longitude),i=n.MathUtils.degToRad(e.latitude),s=Math.cos(i);return t.set(s*Math.cos(r),s*Math.sin(r),Math.sin(i))}setSize(e){this.size.set(e.x,e.y,e.z),this._radiiSquared.multiplyVectors(e,e),this._invRadiiSquared.x=0==e.x?0:1/this._radiiSquared.x,this._invRadiiSquared.y=0==e.y?0:1/this._radiiSquared.y,this._invRadiiSquared.z=0==e.z?0:1/this._radiiSquared.z,this.eccentricity=Math.sqrt(this._radiiSquared.x-this._radiiSquared.z)/this.size.x}cartographicToCartesian(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Vector3;a.copy(e.geodesicNormal),t.multiplyVectors(this._radiiSquared,a);const r=Math.sqrt(a.dot(t));return t.divideScalar(r),a.multiplyScalar(e.altitude),t.add(a)}cartesianToCartographic(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new s.A("EPSG:4326",0,0,0);const r=Math.sqrt(e.x*e.x+e.y*e.y+e.z*e.z),i=this.size.x,o=this.size.z,a=Math.abs((i*i-o*o)/(i*i)),l=1-Math.sqrt(1-a),c=Math.sqrt(e.x*e.x+e.y*e.y),u=Math.atan2(e.y,e.x),h=Math.atan(e.z/c*(1-l+a*i/r)),d=Math.sin(h),p=Math.cos(h),f=Math.atan((e.z*(1-l)+a*i*d*d*d)/((1-l)*(c-a*i*p*p*p))),m=c*Math.cos(f)+e.z*Math.sin(f)-i*Math.sqrt(1-a*Math.sin(f)*Math.sin(f));return t.setFromValues(n.MathUtils.radToDeg(u),n.MathUtils.radToDeg(f),m)}cartographicToCartesianArray(e){const t=[];for(let r=0;r{"use strict";r.d(t,{A:()=>g});var n=r(39437),i=r(12980),s=r(99234),o=r(52404);const a=new n.Vector4;function l(e,t){let r;for(let n=0;n<=e;n++){const e=n*n;for(let i=-n;i<=n;i++){const s=i*i;for(let o=-n;o<=n;o++){const n=s+o*o;if(!(n>e||n<=r||!1!==t(i,o)))return}}r=e}}function c(e){return e.layer?e.layer:e.parent?c(e.parent):void 0}const u=new n.Raycaster,h=new n.Vector2,d=new n.Vector3,p=new o.A("EPSG:4978"),f=new n.Vector3,m=new o.A("EPSG:4978"),g={pickTilesAt(e,t,r,o){let c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const u=function(e,t,r){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const c=e.mainLoop.gfxEngine.getWindowSize();r=r||new n.Vector2(Math.floor(c.x/2),Math.floor(c.y/2));const u=t.level0Nodes.map((e=>i.A.push(e,i.A.MODES.ID))),h=e.mainLoop.gfxEngine.renderViewToBuffer({camera:e.camera,scene:t.object3d},{x:r.x-o,y:r.y-o,width:1+2*o,height:1+2*o});u.forEach((e=>e()));const d=[];return l(o,((e,t)=>{const r=4*(2*t*o+e),n=h.slice(r,r+4||void 0);a.fromArray(n).divideScalar(255);const i=(0,s.RN)(a,256**3),l=Math.round(i);d.includes(l)||d.push(l)})),d}(e,o,t,r),h=e=>{u.includes(e.id)&&e.isTileMesh&&c.push({object:e,layer:o})};for(const e of o.level0Nodes)e.traverse(h);return c},pickPointsAt(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];if(!n.root)return;n.object3d.traverse((e=>{e.isPoints&&e.baseId&&e.material.enablePicking(!0)}));const s=e.mainLoop.gfxEngine.renderViewToBuffer({camera:e.camera,scene:n.object3d},{x:t.x-r,y:t.y-r,width:1+2*r,height:1+2*r}),o=[];return l(r,((e,t)=>{const n=4*(2*t*r+e),i=s.slice(n,n+4),a={objId:i[0]<<8|i[1],index:i[2]<<8|i[3]};for(let e=0;e{if(t.isPoints&&t.baseId){t.material.enablePicking(!1);for(let r=0;r4&&void 0!==arguments[4]?arguments[4]:[];if(e.viewToNormalizedCoords(t,h),r<0){u.setFromCamera(h,e.camera3D);const t=u.intersectObject(i,!0);for(const e of t)e.layer=c(e.object),s.push(e);return s}const o={x:t.x-r,y:t.y-r,width:1+2*r,height:1+2*r},a=e.mainLoop.gfxEngine.renderViewToBuffer({scene:i,camera:e.camera},o),d=new n.Color;e.mainLoop.gfxEngine.renderer.getClearColor(d);const p=Math.round(255*d.r),f=Math.round(255*d.g),m=Math.round(255*d.b),g=h.clone();return l(r,((t,n)=>{const o=4*((n+r)*(2*r+1)+(t+r)),l=a[o],d=a[o+1],A=a[o+2];if(Math.abs(p-l)<=1&&Math.abs(f-d)<=1&&Math.abs(m-A)<=1)return;g.setX(h.x+t/e.camera.width).setY(h.y+n/e.camera.height),u.setFromCamera(g,e.camera3D);const y=u.intersectObject(i,!0);for(const e of y)e.layer=c(e.object),s.push(e);return 0==s.length})),s}}},4660:(e,t,r)=>{"use strict";r.d(t,{A:()=>p});var n=r(39437),i=r(76932),s=r(96027),o=r(48150),a=r(28611);const l=new n.Matrix4,c=new n.Vector3;let u=0;const h=new n.Vector3;class d extends i.A{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{minSubdivisionLevel:i=2,maxSubdivisionLevel:c=19,...u}=r,h=o.fm.get("EPSG:4326"),d=o.af.get("EPSG:4326").subdivisionByScheme(h),p=["EPSG:4326","EPSG:3857"],f=p.length,m=new a.r({uvCount:f});super(e,t||new n.Group,d,m,{tileMatrixSets:p,...u}),this.isGlobeLayer=!0,this.options.defaultPickingRadius=5,this.minSubdivisionLevel=i,this.maxSubdivisionLevel=c,this.extent=this.schemeTile[0].clone();for(let e=1;e0:u{"use strict";r.d(t,{S:()=>I,A:()=>B});var n=r(39437),i=r(84354),s=r(98211),o=r(52404),a=r(4660),l=r(80736),c=r(96027);const u={getSunPosition(){const e=Math,t=e.PI,r=e.sin,n=e.cos,i=e.tan,s=e.asin,o=e.atan2,a=t/180,l=23.4397*a;function c(e,t,s){return o(r(e),n(e)*r(t)-i(s)*n(t))}function u(e,t,i){return s(r(t)*r(i)+n(t)*n(i)*n(e))}return function(e,h,d){const p=a*h,f=function(e){return function(e){return e.valueOf()/864e5-.5+2440588}(e)-2451545}(e),m=function(e){return a*(357.5291+.98560028*e)}(f),g=function(e){return a*(1.9148*r(e)+.02*r(2*e)+3e-4*r(3*e))}(m),A=function(e,r){return e+r+102.9372*a+t}(m,g),y=(v=A,s(r(0)*n(l)+n(0)*r(l)*r(v)));var v;const x=function(e){return o(r(e)*n(l)-i(0)*r(l),n(e))}(A),_=function(e,t){return a*(280.16+360.9856235*e)-t}(f,a*-d),b=_-x;return{EclipticLongitude:A,declinaison:y,ascension:x,H:b,SiderealTime:_,altitude:u(b,p,y),azimuth:c(b,p,y)+t/2}}},getSunPositionInScene(e,t,r){const n=864e5,i=u.getSunPosition()(e,t,r).ascension+e%n/n*-360+180;return new o.A("EPSG:4326",i,t,5e7).as("EPSG:4978").toVector3()}},h=u,d={uniforms:{luminance:{type:"f",value:1},turbidity:{type:"f",value:2},reileigh:{type:"f",value:1},mieCoefficient:{type:"f",value:.005},mieDirectionalG:{type:"f",value:.8},v3LightPosition:{type:"v3",value:new n.Vector3},up:{type:"v3",value:new n.Vector3(0,1,0)}},vertexShader:["varying vec3 vWorldPosition;","void main() {","vec4 worldPosition = modelMatrix * vec4( cameraPosition + position, 1.0 );","vWorldPosition = worldPosition.xyz;","gl_Position = projectionMatrix * modelViewMatrix * vec4( cameraPosition + position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D skySampler;","uniform vec3 v3LightPosition;","uniform vec3 up;","varying vec3 vWorldPosition;","// uniform sampler2D sDiffuse;","// const float turbidity = 10.0; //","// const float reileigh = 2.; //","// const float luminance = 1.0; //","// const float mieCoefficient = 0.005;","// const float mieDirectionalG = 0.8;","uniform float luminance;","uniform float turbidity;","uniform float reileigh;","uniform float mieCoefficient;","uniform float mieDirectionalG;","// constants for atmospheric scattering","const float e = 2.71828182845904523536028747135266249775724709369995957;","const float pi = 3.141592653589793238462643383279502884197169;","const float n = 1.0003; // refractive index of air","const float N = 2.545E25; // number of molecules per unit volume for air at","// 288.15K and 1013mb (sea level -45 celsius)","const float pn = 0.035; // depolatization factor for standard air","// wavelength of used primaries, according to preetham","const vec3 lambda = vec3(680E-9, 550E-9, 450E-9);","// mie stuff","// K coefficient for the primaries","const vec3 K = vec3(0.686, 0.678, 0.666);","const float v = 4.0;","// optical length at zenith for molecules","const float rayleighZenithLength = 8.4E3;","const float mieZenithLength = 1.25E3;","const float EE = 1000.0;","const float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324;","// 66 arc seconds -> degrees, and the cosine of that","// earth shadow hack","const float cutoffAngle = pi/1.95;","const float steepness = 1.5;","vec3 totalRayleigh(vec3 lambda)","{","return (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));","}","// A simplied version of the total Reayleigh scattering to works on browsers that use ANGLE","vec3 simplifiedRayleigh()","{","return 0.0005 / vec3(94, 40, 18);","}","float rayleighPhase(float cosTheta)","{ ","return (3.0 / (16.0*pi)) * (1.0 + pow(cosTheta, 2.0));","// return (1.0 / (3.0*pi)) * (1.0 + pow(cosTheta, 2.0));","// return (3.0 / 4.0) * (1.0 + pow(cosTheta, 2.0));","}","vec3 totalMie(vec3 lambda, vec3 K, float T)","{","float c = (0.2 * T ) * 10E-18;","return 0.434 * c * pi * pow((2.0 * pi) / lambda, vec3(v - 2.0)) * K;","}","float hgPhase(float cosTheta, float g)","{","return (1.0 / (4.0*pi)) * ((1.0 - pow(g, 2.0)) / pow(1.0 - 2.0*g*cosTheta + pow(g, 2.0), 1.5));","}","float sunIntensity(float zenithAngleCos)","{","return EE * max(0.0, 1.0 - exp(-((cutoffAngle - acos(zenithAngleCos))/steepness)));","}","// float logLuminance(vec3 c)","// {","// return log(c.r * 0.2126 + c.g * 0.7152 + c.b * 0.0722);","// }","// Filmic ToneMapping http://filmicgames.com/archives/75","float A = 0.15;","float B = 0.50;","float C = 0.10;","float D = 0.20;","float E = 0.02;","float F = 0.30;","float W = 1000.0;","vec3 Uncharted2Tonemap(vec3 x)","{","return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;","}","void main() ","{","vec3 up2 = normalize(cameraPosition.xyz);","float sunfade = 1.0-clamp(1.0-exp((v3LightPosition.y/450000.0)),0.0,1.0);","float reileighCoefficient = reileigh - (1.0* (1.0-sunfade));","vec3 sunDirection = normalize(v3LightPosition);","float sunE = sunIntensity(dot(sunDirection, up2));","// extinction (absorbtion + out scattering) ","// rayleigh coefficients","vec3 betaR = simplifiedRayleigh() * reileighCoefficient;","// mie coefficients","vec3 betaM = totalMie(lambda, K, turbidity) * mieCoefficient;","// optical length","// cutoff angle at 90 to avoid singularity in next formula.","float zenithAngle = acos(max(0.0, dot(up2, normalize(vWorldPosition - cameraPosition))));","float sR = rayleighZenithLength / (cos(zenithAngle) + 0.15 * pow(93.885 - ((zenithAngle * 180.0) / pi), -1.253));","float sM = mieZenithLength / (cos(zenithAngle) + 0.15 * pow(93.885 - ((zenithAngle * 180.0) / pi), -1.253));","// combined extinction factor","vec3 Fex = exp(-(betaR * sR + betaM * sM));","// in scattering","float cosTheta = dot(normalize(vWorldPosition - cameraPosition), sunDirection);","float rPhase = rayleighPhase(cosTheta*0.5+0.5);","vec3 betaRTheta = betaR * rPhase;","float mPhase = hgPhase(cosTheta, mieDirectionalG);","vec3 betaMTheta = betaM * mPhase;","vec3 Lin = pow(sunE * ((betaRTheta + betaMTheta) / (betaR + betaM)) * (1.0 - Fex),vec3(1.5));","Lin *= mix(vec3(1.0),pow(sunE * ((betaRTheta + betaMTheta) / (betaR + betaM)) * Fex,vec3(1.0/2.0)),clamp(pow(1.0-dot(up2, sunDirection),5.0),0.0,1.0));","//nightsky","vec3 direction = normalize(vWorldPosition - cameraPosition);","float theta = acos(direction.y); // elevation --\x3e y-axis, [-pi/2, pi/2]","float phi = atan(direction.z, direction.x); // azimuth --\x3e x-axis [-pi/2, pi/2]","vec2 uv = vec2(phi, theta) / vec2(2.0*pi, pi) + vec2(0.5, 0.0);","// vec3 L0 = texture2D(skySampler, uv).rgb+0.1 * Fex;","vec3 L0 = vec3(0.1) * Fex;","// composition + solar disc","//if (cosTheta > sunAngularDiameterCos)","float sundisk = smoothstep(sunAngularDiameterCos,sunAngularDiameterCos+0.00002,cosTheta);","// if (normalize(vWorldPosition - cameraPosition).y>0.0)","L0 += (sunE * 19000.0 * Fex)*sundisk;","vec3 whiteScale = 1.0/Uncharted2Tonemap(vec3(W));","vec3 texColor = (Lin+L0); ","texColor *= 0.04 ;","texColor += vec3(0.0,0.001,0.0025)*0.3;","float g_fMaxLuminance = 1.0;","float fLumScaled = 0.1 / luminance; ","float fLumCompressed = (fLumScaled * (1.0 + (fLumScaled / (g_fMaxLuminance * g_fMaxLuminance)))) / (1.0 + fLumScaled); ","float ExposureBias = fLumCompressed;","vec3 curr = Uncharted2Tonemap((log2(2.0/pow(luminance,4.0)))*texColor);","vec3 color = curr*whiteScale;","vec3 retColor = pow(color,vec3(1.0/(1.2+(1.2*sunfade))));","gl_FragColor.rgb = retColor;","gl_FragColor.a = 1. - ( (length(cameraPosition) - 6400000.) / 1000.);","}"].join("\n")};class p extends n.Mesh{constructor(){const e=n.UniformsUtils.clone(d.uniforms),t=new n.ShaderMaterial({fragmentShader:d.fragmentShader,vertexShader:d.vertexShader,uniforms:e,side:n.BackSide,transparent:!0,depthWrite:!1});super(new n.SphereGeometry(4e4,32,15),t)}}const f=p,m="#include \n\nuniform int atmoIN;\nvarying float intensity;\n\nvec4 glowColor = vec4(0.45, 0.74, 1. ,1.0);\n\nvoid main() {\n #include \n gl_FragColor = glowColor * intensity;\n}\n\n",g="#include \n#include \n\nuniform int atmoIN;\nvarying float intensity;\n\nvoid main()\n{\n vec3 normalES = normalize( normalMatrix * normal );\n vec3 normalCAMES = normalize( normalMatrix * cameraPosition );\n\n if(atmoIN == 0) {\n intensity = pow(0.666 - dot(normalES, normalCAMES), 4. );\n } else {\n intensity = pow( 1. - dot(normalES, normalCAMES), 0.8 );\n }\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n #include \n}\n\n\n",A=new n.Vector3(1,0,0),y=new n.Vector3,v=new o.A("EPSG:4326"),x=new o.A("EPSG:4326"),_=new n.Color(9688568),b=new n.Color,w=new n.Color(197896),E=6e5,M=160*c.Q.x;class S extends l.A{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"atmosphere",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.source=!1,super(e,new n.Object3D,t),this.isAtmosphere=!0;const r=new n.ShaderMaterial({uniforms:{atmoIN:{type:"i",value:0},screenSize:{type:"v2",value:new n.Vector2(window.innerWidth,window.innerHeight)}},vertexShader:g,fragmentShader:m,side:n.BackSide,blending:n.AdditiveBlending,transparent:!0,wireframe:!1}),i=new n.SphereGeometry(1,64,64),s=new n.Mesh(i,r);s.scale.copy(c.Q).multiplyScalar(1.14),this.basicAtmosphere=new n.Object3D,this.realisticAtmosphere=new n.Object3D,this.realisticAtmosphere.visible=!1,this.object3d.add(this.basicAtmosphere),this.object3d.add(this.realisticAtmosphere),this.basicAtmosphere.add(s);const o=new n.ShaderMaterial({uniforms:{atmoIN:{type:"i",value:1},screenSize:{type:"v2",value:new n.Vector2(window.innerWidth,window.innerHeight)}},vertexShader:g,fragmentShader:m,side:n.FrontSide,blending:n.AdditiveBlending,transparent:!0,depthWrite:!1}),a=new n.Mesh(i,o);a.scale.copy(c.Q).multiplyScalar(1.002),this.basicAtmosphere.add(a),this.realisticLightingPosition={x:-.5,y:0,z:1},this.fog={enable:!0,distance:M},this.realisticAtmosphereInitParams=t.Kr?t:{Kr:.0025,Km:.0015,ESun:20,g:-.95,innerRadius:64e5,outerRadius:67e5,wavelength:[.65,.57,.475],scaleDepth:.25},this.object3d.updateMatrixWorld()}update(e,t,r){r.material.fogDistance=this.fog.distance,r.material.lightingEnabled=this.realisticAtmosphere.visible,r.material.lightPosition=this.realisticLightingPosition}preUpdate(e){const t=e.view.camera3D.position;if(this.fog.enable){y.setFromMatrixPosition(e.view.tileLayer.object3d.matrixWorld);const r=y.distanceTo(t);this.fog.distance=M*(.25*(r-.99*c.Q.x)/c.Q.x)**1.5}else this.fog.distance=1e11;const r=e.view.mainLoop.gfxEngine.renderer;v.crs=e.view.referenceCrs,v.setFromVector3(t).as("EPSG:4326",x);const n=x.altitude;ne.material.uniforms.v3LightPosition.value.copy(this.realisticLightingPosition)))),this.basicAtmosphere.visible=!e,this.realisticAtmosphere.visible=e}}const C=S;var T=r(10733);const I={GLOBE_INITIALIZED:i.G.INITIALIZED,LAYER_ADDED:i.G.LAYER_ADDED,LAYER_REMOVED:i.G.LAYER_REMOVED,COLOR_LAYERS_ORDER_CHANGED:i.G.COLOR_LAYERS_ORDER_CHANGED};class R extends i.A{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n.Object3D.DEFAULT_UP.set(0,0,1),super("EPSG:4978",e,r),this.isGlobeView=!0,this.camera3D.near=Math.max(15,2352e-9*c.Q.x),this.camera3D.far=10*c.Q.x;const i=new a.A("globe",r.object3d,r);this.mainLoop.gfxEngine.label2dRenderer.infoTileLayer=i.info,this.addLayer(i),this.tileLayer=i,t.isExtent||(t.coord=t.coord||new o.A("EPSG:4326",0,0),t.tilt=t.tilt||89.5,t.heading=t.heading||0,t.range=t.range||2*c.Q.x),r.noControls?T.Ay.transformCameraToLookAtTarget(this,this.camera3D,t):(this.controls=new s.A(this,t,r.controls),this.controls.handleCollision=void 0===r.handleCollision||r.handleCollision),this.addLayer(new C("atmosphere",r.atmosphere)),this.camera.resize(e.clientWidth,e.clientHeight)}addLayer(e){if(!e||!e.isLayer)return Promise.reject(new Error("Add Layer type object"));if(e.isColorLayer){if(!this.tileLayer.tileMatrixSets.includes(e.source.crs))return e._reject(`Only ${this.tileLayer.tileMatrixSets} tileMatrixSet are currently supported for color layers`)}else if(e.isElevationLayer&&e.source.crs!==this.tileLayer.tileMatrixSets[0])return e._reject(`Only ${this.tileLayer.tileMatrixSets[0]} tileMatrixSet is currently supported for elevation layers`);return super.addLayer(e,this.tileLayer)}getPixelsToDegrees(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1?arguments[1]:void 0;return this.getMetersToDegrees(this.getPixelsToMeters(e,t))}getPixelsToDegreesFromDistance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.getMetersToDegrees(this.getPixelsToMetersFromDistance(e,t))}getMetersToDegrees(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return n.MathUtils.radToDeg(2*Math.asin(e/(2*c.Q.x)))}}const B=R},78682:(e,t,r)=>{"use strict";r.d(t,{A:()=>d});var n=r(39437),i=r(76932),s=r(48150),o=r(52404),a=r(86215);const l=new n.Quaternion,c=new n.Vector3;class u{constructor(e){e.projection&&(console.warn("PlanarTileBuilder projection parameter is deprecated, use crs instead."),e.crs??=e.projection),this._crs=e.crs,this._transform={coords:new o.A("EPSG:4326",0,0),position:new n.Vector3,normal:new n.Vector3(0,0,1)},this._uvCount=e.uvCount??1}get uvCount(){return this._uvCount}get crs(){return this._crs}prepare(e){const t=e;return t.nbRow=2**(e.level+1),t.coordinates=new o.A(this.crs),t}center(e){return e.center(this._transform.coords),c.set(this._transform.coords.x,this._transform.coords.y,0),c}vertexPosition(e){return this._transform.position.set(e.x,e.y,0),this._transform.position}vertexNormal(){return this._transform.normal}uProject(e,t){return t.west+e*(t.east-t.west)}vProject(e,t){return t.south+e*(t.north-t.south)}computeShareableExtent(e){return{shareableExtent:new a.A(e.crs,{west:0,east:Math.abs(e.west-e.east),south:0,north:Math.abs(e.north-e.south)}),quaternion:l,position:this.center(e).clone()}}}class h extends i.A{constructor(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const{minSubdivisionLevel:o=0,maxSubdivisionLevel:a=5,...l}=i,c=[t.crs];s.af.get(t.crs)||s.af.set(t.crs,t);const h=new u({crs:t.crs});super(e,r||new n.Group,[t],h,{tileMatrixSets:c,...l}),this.isPlanarLayer=!0,this.extent=t,this.minSubdivisionLevel=o,this.maxSubdivisionLevel=a}}const d=h},8917:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var n=r(39437),i=r(84354),s=r(10733),o=r(72682),a=r(78682);class l extends i.A{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n.Object3D.DEFAULT_UP.set(0,0,1),super(t.crs,e,r),this.isPlanarView=!0;const i=t.planarDimensions(),l=Math.max(i.x,i.y);this.camera3D.near=.1,this.camera3D.far=this.camera3D.isOrthographicCamera?2e3:2*l,this.camera3D.updateProjectionMatrix();const c=new a.A("planar",t,r.object3d,r);this.mainLoop.gfxEngine.label2dRenderer.infoTileLayer=c.info,this.addLayer(c);const u=r.placement||{};u.isExtent||(u.coord=u.coord||t.center(),u.tilt=u.tilt||90,u.heading=u.heading||0,u.range=u.range||l),s.Ay.transformCameraToLookAtTarget(this,this.camera3D,u),r.noControls||(this.controls=new o.Ay(this,r.controls)),this.tileLayer=c}addLayer(e){return super.addLayer(e,this.tileLayer)}}const c=l},99487:(e,t,r)=>{"use strict";let n;r.d(t,{A:()=>s,W:()=>i});const i={INFINITE:1/0,TEXTURE:9e5,GEOMETRY:9e5},s=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.INFINITE;this.lifeTime=e,this.lastTimeFlush=Date.now(),this.data=new Map}getByArray(e){return this.get(e[0],e[1],e[2])}setByArray(e,t){return this.set(e,t[0],t[1],t[2])}get(e,t,r){const i=this.data.get(e);if(null!=i){if(null!=i.lastTimeUsed)n=i;else{const e=i.get(t);if(null==e)return;if(null!=e.lastTimeUsed)n=e;else{const t=e.get(r);if(null==t)return;n=t}}return n.value?(n.lastTimeUsed=Date.now(),n.value):void 0}}set(e,t,r,i){if(n={value:e,lastTimeUsed:Date.now()},null==r)return this.data.set(t,n),e;this.data.get(t)||this.data.set(t,new Map);const s=this.data.get(t);return null==i?(s.set(r,n),e):(s.get(r)||s.set(r,new Map),s.get(r).set(i,n),e)}delete(e,t,r){const n=this.data.get(e);if(void 0!==n)if(null!=n.lastTimeUsed)this.data.get(e),this.data.delete(e);else{const i=n.get(t);if(void 0===i)return;if(null!=i.lastTimeUsed)n.get(t),n.delete(t),0==n.size&&this.data.delete(e);else{if(void 0===i.get(r))return;i.get(r),i.delete(r),0==i.size&&(n.delete(t),0==n.size&&this.data.delete(e))}}}clear(){this.data.clear()}flush(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();this.lifeTime==i.INFINITE||this.lifeTime>e-this.lastTimeFlush||!this.data.size||(this.lastTimeFlush=1/0,this.data.forEach(((t,r)=>{this.lifeTime{this.lifeTime{this.lifeTime{"use strict";r.d(t,{J:()=>w,Ay:()=>S,Jn:()=>g});var n=r(36845),i=r(99487),s=r(7794),o=r(67373),a=r(39437);function l(e){let t,r,n,i=e.r||e[0]/255,s=e.g||e[1]/255,o=e.b||e[2]/255;return i=i>.04045?((i+.055)/1.055)**2.4:i/12.92,s=s>.04045?((s+.055)/1.055)**2.4:s/12.92,o=o>.04045?((o+.055)/1.055)**2.4:o/12.92,t=(.4124*i+.3576*s+.1805*o)/.95047,r=(.2126*i+.7152*s+.0722*o)/1,n=(.0193*i+.1192*s+.9505*o)/1.08883,t=t>.008856?t**(1/3):7.787*t+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,[116*r-16,500*(t-r),200*(r-n)]}function c(e,t){const r=l(e),n=l(t),i=r[0]-n[0],s=r[1]-n[1],o=r[2]-n[2],a=Math.sqrt(r[1]*r[1]+r[2]*r[2]),c=a-Math.sqrt(n[1]*n[1]+n[2]*n[2]);let u=s*s+o*o-c*c;u=u<0?0:Math.sqrt(u);const h=i/1,d=c/(1+.045*a),p=u/(1+.015*a),f=h*h+d*d+p*p;return f<0?0:Math.sqrt(f)}var u=r(52404);const h=new i.A,d=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGMatrix(),p=document.createElement("canvas"),f=1/255;function m(e,t){return t?.coordinates?.z||0}function g(e,t){if(e.expression)return e.expression.evaluate(t);if(e.stops){const r=e.stops;e=e.stops[0][1];for(let n=r.length-1;n>=0;n--){const i=r[n];if(t.zoom>=i[0]){e=i[1];break}}}return"string"==typeof e||e instanceof String?e.replace(/\{(.+?)\}/g,((e,r)=>t.properties[r]||"")).trim():e instanceof Function?e(t.properties,t):e}function A(e){if(!e)return{};if(e.stops||e.expression)return{color:e};if("string"==typeof e){const t=e.match(/(?:((hsl|rgb)a? *\(([\d.%]+(?:deg|g?rad|turn)?)[ ,]*([\d.%]+)[ ,]*([\d.%]+)[ ,/]*([\d.%]*)\))|(#((?:[\d\w]{3}){1,2})([\d\w]{1,2})?))/i);if(null===t)return{color:e,opacity:1};if(t[7]){let e=1;return t[9]&&(e=parseInt(1==t[9].length?`${t[9]}${t[9]}`:t[9],16)*f),{color:`#${t[8]}`,opacity:e}}if(t[1])return{color:`${t[2]}(${t[3]},${t[4]},${t[5]})`,opacity:t[6]?Number(t[6]):1}}}function y(e,t){if(null!=e)return o.dn.isExpression(e)?o.dn.createExpression(e,t).value:e}async function v(e){let t=h.get(e,"null");return t||(t=s.A.texture(e,{crossOrigin:"anonymous"}),h.set(t,e,"null")),(await t).image}function x(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{width:e.naturalWidth,height:e.naturalHeight};p.width=t.width,p.height=t.height;const r=p.getContext("2d",{willReadFrequently:!0});return r.drawImage(e,t.x||0,t.y||0,t.width,t.height,0,0,t.width,t.height),r.getImageData(0,0,t.width,t.height)}const _={left:[0,-.5],right:[-1,-.5],top:[-.5,0],bottom:[-.5,-1],"top-right":[-1,0],"bottom-left":[0,-1],"bottom-right":[-1,-1],center:[-.5,-.5],"top-left":[0,0]};function b(e,t,r,n,i){let s;Object.defineProperty(e[t],r,{enumerable:!0,get:()=>{if(null!=s)return s;if(null!=n)return g(n,e.context);const o=e.context.featureStyle?.[t]?.[r];return null!=o?g(o,e.context):i instanceof Function?i(e.context.properties,e.context):i},set:e=>{s=e}})}class w{#c=(()=>new u.A("EPSG:4326",0,0,0))();#u=(()=>new u.A("EPSG:4326",0,0,0))();#h=!0;#d={};#p={};setZoom(e){this.zoom=e}setFeature(e){this.#d=e}setGeometry(e){this.#p=e}setCollection(e){this.collection=e,this.#u.setCrs(e.crs)}setLocalCoordinatesFromArray(e,t){return this.#h=!1,this.#u.setFromArray(e,t)}get properties(){return this.#p.properties}get type(){return this.#d.type}get featureStyle(){let e=this.#d.style;return e instanceof Function&&(e=e(this.properties,this)),e}get coordinates(){return this.#h||(this.#h=!0,this.#c.copy(this.#u).applyMatrix4(this.collection.matrixWorld),"EPSG:4978"!=this.#u.crs)?this.#c:this.#c.as("EPSG:4326",this.#c)}}const E={itowns_stroke_single_before:".itowns-stroke-single:before {\n display: var(--text_stroke_display);\n content: attr(data-before);\n opacity: 1;\n position: absolute;\n -webkit-text-stroke-width: var(--text_stroke_width);\n -webkit-text-stroke-color: var(--text_stroke_color);\n left: 0;\n right: 0;\n bottom: 0;\n top: 0;\n z-index: -1;\n white-space: inherit;\n overflow-wrap: inherit;\n letter-spacing: inherit;\n text-align: inherit;\n padding: inherit;\n font-family: inherit;\n text-transform: inherit;\n max-width: inherit;\n font-size: inherit;\n}\n"},M=document.createElement("style");M.type="text/css",Object.keys(E).forEach((e=>{M.innerHTML+=`${E[e]}\n\n`})),"undefined"!=typeof document&&document.getElementsByTagName("head")[0].appendChild(M);const S=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.isStyle=!0,this.context=new w,this.order=e.order||0,e.zoom=e.zoom||{},e.fill=e.fill||{},e.stroke=e.stroke||{},e.point=e.point||{},e.text=e.text||{},e.icon=e.icon||{},this.zoom={},b(this,"zoom","min",e.zoom.min),b(this,"zoom","max",e.zoom.max),this.fill={},b(this,"fill","color",e.fill.color),b(this,"fill","opacity",e.fill.opacity,1),b(this,"fill","pattern",e.fill.pattern),b(this,"fill","base_altitude",e.fill.base_altitude,m),e.fill.extrusion_height&&b(this,"fill","extrusion_height",e.fill.extrusion_height),this.stroke={},b(this,"stroke","color",e.stroke.color),b(this,"stroke","opacity",e.stroke.opacity,1),b(this,"stroke","width",e.stroke.width,1),b(this,"stroke","dasharray",e.stroke.dasharray,[]),b(this,"stroke","base_altitude",e.stroke.base_altitude,m),this.point={},b(this,"point","color",e.point.color),b(this,"point","line",e.point.line),b(this,"point","opacity",e.point.opacity,1),b(this,"point","radius",e.point.radius,2),b(this,"point","width",e.point.width,0),b(this,"point","base_altitude",e.point.base_altitude,m),e.point.model&&b(this,"point","model",e.point.model),this.text={},b(this,"text","field",e.text.field),b(this,"text","zOrder",e.text.zOrder,"auto"),b(this,"text","color",e.text.color,"#000000"),b(this,"text","anchor",e.text.anchor,"center"),b(this,"text","offset",e.text.offset,[0,0]),b(this,"text","padding",e.text.padding,2),b(this,"text","size",e.text.size,16),b(this,"text","placement",e.text.placement,"point"),b(this,"text","rotation",e.text.rotation,"auto"),b(this,"text","wrap",e.text.wrap,10),b(this,"text","spacing",e.text.spacing,0),b(this,"text","transform",e.text.transform,"none"),b(this,"text","justify",e.text.justify,"center"),b(this,"text","opacity",e.text.opacity,1),b(this,"text","font",e.text.font,["Open Sans Regular","Arial Unicode MS Regular","sans-serif"]),b(this,"text","haloColor",e.text.haloColor,"#000000"),b(this,"text","haloWidth",e.text.haloWidth,0),b(this,"text","haloBlur",e.text.haloBlur,0),this.icon={},b(this,"icon","source",e.icon.source),e.icon.key&&(console.warn("'icon.key' is deprecated: use 'icon.id' instead"),e.icon.id=e.icon.key),b(this,"icon","id",e.icon.id),b(this,"icon","cropValues",e.icon.cropValues),b(this,"icon","anchor",e.icon.anchor,"center"),b(this,"icon","size",e.icon.size,1),b(this,"icon","color",e.icon.color),b(this,"icon","opacity",e.icon.opacity,1)}setContext(e){this.context=e}static setFromProperties(e,t){const r=t.type,i={};if(r===n.Xs.POINT){const t={...void 0!==e.fill&&{color:e.fill},...void 0!==e["fill-opacity"]&&{opacity:e["fill-opacity"]},...void 0!==e.stroke&&{line:e.stroke},...void 0!==e.radius&&{radius:e.radius}};Object.keys(t).length&&(i.point=t);const r={...void 0!==e["label-color"]&&{color:e["label-color"]},...void 0!==e["label-opacity"]&&{opacity:e["label-opacity"]},...void 0!==e["label-size"]&&{size:e["label-size"]}};Object.keys(t).length&&(i.text=r);const n={...void 0!==e.icon&&{source:e.icon},...void 0!==e["icon-scale"]&&{size:e["icon-scale"]},...void 0!==e["icon-opacity"]&&{opacity:e["icon-opacity"]},...void 0!==e["icon-color"]&&{color:e["icon-color"]}};Object.keys(n).length&&(i.icon=n)}else{const t={...void 0!==e.stroke&&{color:e.stroke},...void 0!==e["stroke-width"]&&{width:e["stroke-width"]},...void 0!==e["stroke-opacity"]&&{opacity:e["stroke-opacity"]}};if(Object.keys(t).length&&(i.stroke=t),r!==n.Xs.LINE){const t={...void 0!==e.fill&&{color:e.fill},...void 0!==e["fill-opacity"]&&{opacity:e["fill-opacity"]}};Object.keys(t).length&&(i.fill=t)}}return i}static setFromVectorTileLayer(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i={fill:{},stroke:{},point:{},text:{},icon:{}};if(e.layout=e.layout||{},e.paint=e.paint||{},i.order=r,"fill"===e.type){const{color:r,opacity:n}=A(y(e.paint["fill-color"]||e.paint["fill-pattern"],{type:"color"}));if(i.fill.color=r,i.fill.opacity=y(e.paint["fill-opacity"])||n,e.paint["fill-pattern"])try{i.fill.pattern={id:e.paint["fill-pattern"],source:t.source,cropValues:t[e.paint["fill-pattern"]]}}catch(t){throw t.message=`VTlayer '${e.id}': argument sprites must not be null when using layer.paint['fill-pattern']`,t}if(e.paint["fill-outline-color"]){const{color:t,opacity:r}=A(y(e.paint["fill-outline-color"],{type:"color"}));i.stroke.color=t,i.stroke.opacity=r,i.stroke.width=1,i.stroke.dasharray=[]}}else if("line"===e.type){const t=y(e.paint["line-color"],{type:"color"}),{color:r,opacity:n}=A(t);i.stroke.dasharray=y(e.paint["line-dasharray"]),i.stroke.color=r,i.stroke.lineCap=e.layout["line-cap"],i.stroke.width=y(e.paint["line-width"]),i.stroke.opacity=y(e.paint["line-opacity"])||n}else if("circle"===e.type||n){const{color:t,opacity:r}=A(y(e.paint["circle-color"],{type:"color"}));i.point.color=t,i.point.opacity=r,i.point.radius=y(e.paint["circle-radius"])}else if("symbol"===e.type){i.text.zOrder=y(e.layout["symbol-z-order"]),"auto"==i.text.zOrder?i.text.zOrder=y(e.layout["symbol-sort-key"])||"Y":"viewport-y"==i.text.zOrder?i.text.zOrder="Y":"source"==i.text.zOrder&&(i.text.zOrder=0),i.text.anchor=y(e.layout["text-anchor"]),i.text.offset=y(e.layout["text-offset"]),i.text.padding=y(e.layout["text-padding"]),i.text.size=y(e.layout["text-size"]),i.text.placement=y(e.layout["symbol-placement"]),i.text.rotation=y(e.layout["text-rotation-alignment"]),i.text.field=y(e.layout["text-field"]),i.text.wrap=y(e.layout["text-max-width"]),i.text.spacing=y(e.layout["text-letter-spacing"]),i.text.transform=y(e.layout["text-transform"]),i.text.justify=y(e.layout["text-justify"]);const{color:r,opacity:n}=A(y(e.paint["text-color"],{type:"color"}));i.text.color=r,i.text.opacity=y(e.paint["text-opacity"])||void 0!==n&&n,i.text.font=y(e.layout["text-font"]);const s=y(e.paint["text-halo-color"],{type:"color"});s&&(i.text.haloColor=s.color||s,i.text.haloWidth=y(e.paint["text-halo-width"]),i.text.haloBlur=y(e.paint["text-halo-blur"]));const o=y(e.layout["icon-image"]);if(o)try{if(i.icon.id=o,o.stops){const e={...void 0!==o.base&&{base:o.base},stops:o.stops.map((e=>{let r=t[e[1]];return e[1].includes("{")&&(r=function(n){const i=e[1].replace(/\{(.+?)\}/g,((e,t)=>n[t]||"")).trim();return r=t[i],t[i]}),[e[0],r]}))};i.icon.cropValues=e}else i.icon.cropValues=t[o],o[0].includes("{")&&(i.icon.cropValues=function(e){const r=o.replace(/\{(.+?)\}/g,((t,r)=>e[r]||"")).trim();return i.icon.cropValues=t[r],t[r]});i.icon.source=t.source,i.icon.size=y(e.layout["icon-size"])||1;const{color:r,opacity:n}=A(y(e.paint["icon-color"],{type:"color"}));i.icon.color=r,i.icon.opacity=y(e.paint["icon-opacity"])||void 0!==n&&n}catch(t){throw t.message=`VTlayer '${e.id}': argument sprites must not be null when using layer.layout['icon-image']`,t}}return i.zoom={min:e.minzoom||0,max:e.maxzoom||24},i}applyToCanvasPolygon(e,t,r,n){const i=this.context;this.stroke&&this._applyStrokeToPolygon(e,r,t,i),n&&this.fill&&this._applyFillToPolygon(e,r,t,i)}_applyStrokeToPolygon(e,t,r){e.strokeStyle!==this.stroke.color&&(e.strokeStyle=this.stroke.color);const n=(this.stroke.width||2)*t;e.lineWidth!==n&&(e.lineWidth=n);const i=null==this.stroke.opacity?1:this.stroke.opacity;i!==e.globalAlpha&&"number"==typeof i&&(e.globalAlpha=i),e.lineCap!==this.stroke.lineCap&&(e.lineCap=this.stroke.lineCap),e.setLineDash(this.stroke.dasharray.map((e=>e*t*2))),e.stroke(r)}async _applyFillToPolygon(e,t,r){if(this.fill.pattern){let r=this.fill.pattern;const n=this.fill.pattern.cropValues;this.fill.pattern.source&&(r=await v(this.fill.pattern.source)),x(r,n),e.fillStyle=e.createPattern(p,"repeat"),e.fillStyle.setTransform?e.fillStyle.setTransform(d.scale(t)):console.warn("Raster pattern isn't completely supported on Ie and edge",e.fillStyle)}else e.fillStyle!==this.fill.color&&(e.fillStyle=this.fill.color);this.fill.opacity!==e.globalAlpha&&(e.globalAlpha=this.fill.opacity),e.fill(r)}async applyToHTML(e){if(arguments.length>1&&console.warn("Deprecated argument sprites. Sprites must be configured in style."),e.style.padding=`${this.text.padding}px`,e.style.maxWidth=`${this.text.wrap}em`,e.style.color=this.text.color,this.text.size>0&&(e.style.fontSize=`${this.text.size}px`),e.style.fontFamily=this.text.font.join(","),e.style.textTransform=this.text.transform,e.style.letterSpacing=`${this.text.spacing}em`,e.style.textAlign=this.text.justify,e.style["white-space"]="pre-line",this.text.haloWidth>0&&(e.style.setProperty("--text_stroke_display","block"),e.style.setProperty("--text_stroke_width",`${this.text.haloWidth}px`),e.style.setProperty("--text_stroke_color",this.text.haloColor),e.setAttribute("data-before",e.textContent)),!this.icon.source)return;const t=document.createElement("img"),r=new Promise(((r,n)=>{const i={size:this.icon.size,color:this.icon.color,opacity:this.icon.opacity,anchor:this.icon.anchor};t.onload=()=>r(function(e,t,r){const n=e.cloneNode();switch(n.setAttribute("class","itowns-icon"),n.width=e.width*r.size,n.height=e.height*r.size,n.style.color=r.color,n.style.opacity=r.opacity,n.style.position="absolute",n.style.top="0",n.style.left="0",r.anchor){case"left":n.style.top=-.5*n.height+"px";break;case"right":n.style.top=-.5*n.height+"px",n.style.left=-n.width+"px";break;case"top":n.style.left=-.5*n.width+"px";break;case"bottom":n.style.top=-n.height+"px",n.style.left=-.5*n.width+"px";break;case"bottom-left":n.style.top=-n.height+"px";break;case"bottom-right":n.style.top=-n.height+"px",n.style.left=-n.width+"px";break;case"top-left":break;case"top-right":n.style.left=-n.width+"px";break;default:n.style.top=-.5*n.height+"px",n.style.left=-.5*n.width+"px"}return n.style["z-index"]=-1,t.appendChild(n),n}(t,e,i)),t.onerror=e=>n(e)}));if(this.icon.cropValues||this.icon.color){const e=this.icon.cropValues,r=this.icon.color,n=this.icon.id||this.icon.source,i=function(e,t,r){if(!t)return e;const n=h.get(r,t);if(!n){const n=e.data,i=new a.Color(t),s=new a.Color("white");for(let e=0,t=n.length;e{"use strict";r.d(t,{A:()=>l});let n=!1,i=8,s=4096;function o(e,t,r){const n=e.getContext(),i=n.createShader(t);return n.shaderSource(i,r),n.compileShader(i),i}function a(){return navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes("firefox")}const l={isLogDepthBufferSupported:()=>n,isFirefox:a,getMaxTextureUnitsCount:()=>i,getMaxTextureSize:()=>s,updateCapabilities(e){const t=e.getContext();i=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),s=t.getParameter(t.MAX_TEXTURE_SIZE);const r=t.createProgram(),l=o(e,t.VERTEX_SHADER,"void main() {\n gl_Position = vec4( 0.0, 0.0, 0.0, 1.0 );\n}");let c=`#define SAMPLE ${i}\n`;c+="uniform sampler2D uni[SAMPLE];\nvoid main() {\n gl_FragColor += texture2D(uni[SAMPLE-1], vec2(0));\n}";const u=o(e,t.FRAGMENT_SHADER,c);if(t.attachShader(r,l),t.attachShader(r,u),t.linkProgram(r),!1===t.getProgramParameter(r,t.LINK_STATUS)){if(!(i>16))throw new Error(`The GPU capabilities could not be determined accurately.\n Impossible to link a shader with the Maximum texture units ${i}`);{const e=t.getProgramInfoLog(r);console.warn(`${e}: using a maximum of 16 texture units instead of the reported value (${i})`),a()&&console.warn("It can come from a Mesa/Firefox bug;\n the shader compiles to an error when using more than 16 sampler uniforms,\n see https://bugzilla.mozilla.org/show_bug.cgi?id=777028"),i=16}}t.deleteProgram(r),t.deleteShader(l),t.deleteShader(u),n=e.capabilities.logarithmicDepthBuffer}}},86706:(e,t,r)=>{"use strict";r.d(t,{A:()=>A,m:()=>g});var n=r(39437),i=r(86406),s=r(52404),o=r(86215),a=r(48150);const l=new n.Vector2,c=new n.Vector2,u={row:0,col:0,invDiff:0};function h(e,t){const r=2**(e.zoom-t);return u.invDiff=1/r,u.row=(e.row-e.row%r)*u.invDiff,u.col=(e.col-e.col%r)*u.invDiff,u}const d=new o.A("EPSG:4326",[0,0,0,0]),p=new o.A("EPSG:4326",[0,0,0,0]),f=new s.A("EPSG:4326",0,0);class m{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.isTile=!0,this.crs=e,this.zoom=t,this.row=r,this.col=n}clone(){return new m(this.crs,this.zoom,this.row,this.col)}toExtent(e,t){i.isValid(e),t=t||new o.A("EPSG:4326",[0,0,0,0]);const{epsg:r,globalExtent:n,globalDimension:s}=(0,a.Tz)(this.crs),l=(0,a.nw)(this.crs,this.zoom);return c.set(1,1).divide(l).multiply(s),t.west=n.west+(s.x-c.x*(l.x-this.col)),t.east=t.west+c.x,t.south=n.south+c.y*(l.y-this.row-1),t.north=t.south+c.y,t.crs=r,t.zoom=this.zoom,e==r?t:t.as(e,t)}isInside(e){return this.zoom==e.zoom?this.row==e.row&&this.col==e.col:!(this.zoom1&&void 0!==arguments[1]?arguments[1]:new n.Vector4;if(this.crs!=e.crs)throw new Error("unsupported mix");return h(this,e.zoom),t.set(this.col*u.invDiff-u.col,this.row*u.invDiff-u.row,u.invDiff,u.invDiff)}tiledExtentParent(e){return e&&e0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.zoom=e,this.row=t,this.col=r,this}copy(e){return this.crs=e.crs,this.set(e.zoom,e.row,e.col)}toString(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return`${this.zoom}${e}${this.row}${e}${this.col}`}}function g(e,t){if("EPSG:4326"==e.crs&&"EPSG:3857"==t){const r=[],n=d.copy(e).as(t,p),{globalExtent:i,globalDimension:s,sTs:o}=(0,a.Tz)(t);n.clampByExtent(i),n.planarDimensions(c);const u=e.zoom+1||Math.floor(Math.log2(Math.round(s.x/(c.x*o.x)))),h=(0,a.nw)(t,u),g=n.center(f);l.x=g.x-i.west,l.y=i.north-n.north,l.divide(s).multiply(h).floor();for(let e=Math.ceil((i.north-n.south)/s.x*h.y)-1;e>=l.y;e--)r.push(new m(t,u,e,l.x));return r}{const r=new m(t,0,0,0),{globalExtent:n,globalDimension:i,sTs:s,isInverted:o}=(0,a.Tz)(e.crs),u=e.center(f);e.planarDimensions(c);const h=Math.floor(Math.log2(Math.round(i.x/(c.x*s.x)))),d=(0,a.nw)(t,h);return l.x=u.x-n.west,l.y=o?n.north-u.y:u.y-n.south,l.divide(i).multiply(d).floor(),r.set(h,l.y,l.x),[r]}}const A=m},48150:(e,t,r)=>{"use strict";r.d(t,{Tz:()=>h,af:()=>a,fm:()=>l,nw:()=>d});var n=r(39437),i=r(86215);const s=new n.Vector2,o=new n.Vector2,a=new Map,l=new Map,c=new i.A("EPSG:4326",-180,180,-90,90);a.set("EPSG:4326",c);const u=c.as("EPSG:3857");function h(e){const t=a.get(e),r=t.planarDimensions(o),n=l.get(e)||l.get("default"),i=!e.includes(":NI");return{epsg:e,globalExtent:t,globalDimension:r,sTs:n,isInverted:i}}function d(e,t){const r=l.get(e)||l.get("default"),n=2**t;return s.set(n,n).multiply(r),s}u.clampSouthNorth(u.west,u.east),a.set("EPSG:3857",u),l.set("default",new n.Vector2(1,1)),l.set("EPSG:3857",l.get("default")),l.set("EPSG:4326",new n.Vector2(2,1))},84354:(e,t,r)=>{"use strict";r.d(t,{G:()=>j,A:()=>ne});var n=r(39437),i=r(86406),s=r(93320);var o=r(87196),a=r(2015),l=r(33746),c=r(99234);const u=class{static isWebGL2Available(){try{const e=document.createElement("canvas");return!(!window.WebGL2RenderingContext||!e.getContext("webgl2"))}catch(e){return!1}}static isColorSpaceAvailable(e){try{const t=document.createElement("canvas"),r=window.WebGL2RenderingContext&&t.getContext("webgl2");return r.drawingBufferColorSpace=e,r.drawingBufferColorSpace===e}catch(e){return!1}}static getWebGL2ErrorMessage(){return this.getErrorMessage(2)}static getErrorMessage(e){const t={1:window.WebGLRenderingContext,2:window.WebGL2RenderingContext};let r='Your $0 does not seem to support $1';const n=document.createElement("div");return n.id="webglmessage",n.style.fontFamily="monospace",n.style.fontSize="13px",n.style.fontWeight="normal",n.style.textAlign="center",n.style.background="#fff",n.style.color="#000",n.style.padding="1.5em",n.style.width="400px",n.style.margin="5em auto 0",r=t[e]?r.replace("$0","graphics card"):r.replace("$0","browser"),r=r.replace("$1",{1:"WebGL",2:"WebGL 2"}[e]),n.innerHTML=r,n}static isWebGLAvailable(){console.warn("isWebGLAvailable() has been deprecated and will be removed in r178. Use isWebGL2Available() instead.");try{const e=document.createElement("canvas");return!(!window.WebGLRenderingContext||!e.getContext("webgl")&&!e.getContext("experimental-webgl"))}catch(e){return!1}}static getWebGLErrorMessage(){return console.warn("getWebGLErrorMessage() has been deprecated and will be removed in r178. Use getWebGL2ErrorMessage() instead."),this.getErrorMessage(1)}};var h=r(7296),d=r(47155);const p=new n.Vector4,f=class{constructor(e){let t,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,d.bf)(i),void 0===i.antialias&&(i.antialias=!0),void 0===i.alpha&&(i.alpha=!0),void 0===i.logarithmicDepthBuffer&&(i.logarithmicDepthBuffer=!0),e.domElement?(t=e,r=t.domElement instanceof HTMLDivElement?t.domElement:t.domElement.parentElement):r=e,this.width=r.clientWidth,this.height=r.clientHeight,this.positionBuffer=null,this._nextThreejsLayer=1,this.fullSizeRenderTarget=new n.WebGLRenderTarget(this.width,this.height),this.fullSizeRenderTarget.texture.minFilter=n.LinearFilter,this.fullSizeRenderTarget.texture.magFilter=n.NearestFilter,this.fullSizeRenderTarget.depthBuffer=!0,this.fullSizeRenderTarget.depthTexture=new n.DepthTexture,this.fullSizeRenderTarget.depthTexture.type=n.UnsignedShortType,this.renderView=function(e){this.renderer.clear(),this.renderer.render(e.scene,e.camera3D),e.tileLayer&&this.label2dRenderer.render(e.tileLayer.object3d,e.camera3D)}.bind(this),this.onWindowResize=function(e,t){this.width=e,this.height=t,this.fullSizeRenderTarget.setSize(this.width,this.height),this.renderer.setSize(this.width,this.height),this.label2dRenderer.setSize(this.width,this.height)}.bind(this);try{this.label2dRenderer=new h.A,this.label2dRenderer.setSize(this.width,this.height),r.appendChild(this.label2dRenderer.domElement),this.renderer=t||new n.WebGLRenderer({canvas:document.createElement("canvas"),antialias:i.antialias,alpha:i.alpha,logarithmicDepthBuffer:i.logarithmicDepthBuffer}),this.renderer.domElement.style.position="relative",this.renderer.domElement.style.zIndex=0,this.renderer.domElement.style.top=0}catch(e){throw u.isWebGL2Available()||r.appendChild(u.getErrorMessage(2)),e}-1===this.renderer.domElement.tabIndex&&(this.renderer.domElement.tabIndex=-1),a.A.updateCapabilities(this.renderer),this.renderer.setClearColor(197896),this.renderer.autoClear=!1,this.renderer.sortObjects=!0,this.renderer.debug.checkShaderErrors=!1,t||(this.renderer.setPixelRatio(r.devicePixelRatio),this.renderer.setSize(r.clientWidth,r.clientHeight),r.appendChild(this.renderer.domElement))}getWindowSize(){return new n.Vector2(this.width,this.height)}getRenderer(){return this.renderer}renderViewToBuffer(e,t){return t||(t={x:0,y:0,width:this.width,height:this.height}),t.buffer=t.buffer||new Uint8Array(4*t.width*t.height),this.renderViewToRenderTarget(e,this.fullSizeRenderTarget,t),this.renderer.readRenderTargetPixels(this.fullSizeRenderTarget,t.x,this.height-(t.y+t.height),t.width,t.height,t.buffer),t.buffer}renderViewToRenderTarget(e,t,r){t||(t=this.fullSizeRenderTarget);const n=this.renderer.getRenderTarget();return r&&(this.fullSizeRenderTarget.scissor.set(r.x,t.height-(r.y+r.height),r.width,r.height),this.fullSizeRenderTarget.scissorTest=!0),this.renderer.setRenderTarget(t),this.renderer.clear(!0,!0,!1),this.renderer.render(e.scene,e.camera.camera3D),this.renderer.setRenderTarget(n),this.fullSizeRenderTarget.scissorTest=!1,t}bufferToImage(e,t,r){const n=document.createElement("canvas"),i=n.getContext("2d",{willReadFrequently:!0});n.width=t,n.height=r;const s=i.getImageData(0,0,t,r);s.data.set(e),i.putImageData(s,0,0);const o=new Image;return o.src=n.toDataURL(),o}depthBufferRGBAValueToOrthoZ(e,t){if(p.fromArray(e).divideScalar(255),a.A.isLogDepthBufferSupported()&&"PerspectiveCamera"==t.type)return 2**(2*(0,c.RN)(p)/(2/(Math.log(t.far+1)/Math.LN2)));{let e=(0,c.RN)(p);return e=2*e-1,e}}};var m=r(12980),g=r(52404),A=r(19073),y=r(80061);const v={executeCommand(e){const t=e.layer,r=e.extentsSource,n=e.extentsDestination||r;return Promise.all(r.map(((e,r)=>t.getData(e,n[r]))))}},x=class{constructor(e){this.command=e,this.isCancelledCommandException=!0}toString(){return`Cancelled command ${this.command.requester.id}/${this.command.layer.id}`}},_={executeCommand(e){const t=[],r=e.layer,n=e.requester,i=e.extentsSource;if(n&&!n.material)return Promise.reject(new x(e));for(const e of i)t.push(r.convert(n,e));return Promise.all(t)}};var b=r(55540),w=r(34993);const E=new TextDecoder;var M=r(7794),S=r(70515),C=r(6425),T=r(49423);const I=new TextDecoder;function R(e,t,r){const i=n.LoaderUtils.extractUrlBase(r),s={gltfUpAxis:t.tileset.asset.gltfUpAxis,urlBase:i,overrideMaterials:t.overrideMaterials,doNotPatchMaterial:t.doNotPatchMaterial,registeredExtensions:t.registeredExtensions,layer:t};return b.A.parse(e,s).then((e=>({batchTable:e.batchTable,object3d:e.gltf.scene})))}function B(e,t,r){const i=n.LoaderUtils.extractUrlBase(r);return T.TK.parseAsync(e,i).then((e=>({object3d:e.scene})))}function P(e,t){return function(e,t){if(!e)throw new Error("No array buffer provided.");const r=new DataView(e);let i=0;const s={};let o={},a={};if(s.magic=E.decode(new Uint8Array(e,i,4)),i+=4,s.magic){s.version=r.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT,s.byteLength=r.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT,s.FTJSONLength=r.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT,s.FTBinaryLength=r.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT,s.BTJSONLength=r.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT,s.BTBinaryLength=r.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT;let l={};if(s.FTJSONLength>0){const t=i,r=e.slice(t,s.FTJSONLength+t),n=E.decode(new Uint8Array(r));l=JSON.parse(n)}if(s.FTBinaryLength>0&&(a=function(e,t,r){const i=new n.BufferGeometry,s=E.decode(new Uint8Array(e,t,r)),o=JSON.parse(s);let a;if(o.POINTS_LENGTH&&(a=o.POINTS_LENGTH),o.POSITION){const r=o.POSITION.byteOffset+s.length+t,l=new Float32Array(e,r,3*a);i.setAttribute("position",new n.BufferAttribute(l,3))}if(o.RGB){const r=o.RGB.byteOffset+s.length+t,l=new Uint8Array(e,r,3*a);i.setAttribute("color",new n.BufferAttribute(l,3,!0))}if(o.POSITION_QUANTIZED)throw new Error("For pnts loader, POSITION_QUANTIZED: not yet managed");if(o.RGBA)throw new Error("For pnts loader, RGBA: not yet managed");if(o.RGB565)throw new Error("For pnts loader, RGB565: not yet managed");if(o.NORMAL)throw new Error("For pnts loader, NORMAL: not yet managed");if(o.NORMAL_OCT16P)throw new Error("For pnts loader, NORMAL_OCT16P: not yet managed");if(o.BATCH_ID)throw new Error("For pnts loader, BATCH_ID: not yet managed");return{geometry:i,offset:o.RTC_CENTER?(new n.Vector3).fromArray(o.RTC_CENTER):void 0}}(e,i,s.FTJSONLength)),s.BTJSONLength>0){const r=i+s.FTJSONLength+s.FTBinaryLength,c=e.slice(r,s.BTJSONLength+s.BTBinaryLength+r);o=new w.A(c,s.BTJSONLength,s.BTBinaryLength,l.BATCH_ID&&l.BATCH_LENGTH?l.BATCH_LENGTH:l.POINTS_LENGTH,t),a=function(e,t){if(e.geometry)return t.content&&t.content.Classification&&e.geometry.setAttribute("classification",new n.BufferAttribute(new Uint8Array(t.content.Classification),1)),e}(a,o)}const c={point:a,batchTable:o};return Promise.resolve(c)}throw new Error("Invalid pnts file.")}(e,t.registeredExtensions).then((e=>{const r=t.material?t.material.clone():new C.Ay({size:1,mode:t.pntsMode,shape:t.pntsShape,classificationScheme:t.classification,sizeMode:t.pntsSizeMode,minAttenuatedSize:t.pntsMinAttenuatedSize,maxAttenuatedSize:t.pntsMaxAttenuatedSize});(0,S.A)(r,t);const i=new n.Points(e.point.geometry,r);return e.point.offset&&i.position.copy(e.point.offset),{object3d:i,batchTable:e.batchTable}}))}const L={executeCommand:function(e){const t=e.layer,r=e.metadata,i=new n.Object3D;!function(e,t,r,n){e.frustumCulled=!1,e.layer=t,r.transform&&e.applyMatrix4(r.transform),e.geometricError=r.geometricError,e.tileId=r.tileId,r.refine?e.additiveRefinement="ADD"===r.refine.toUpperCase():e.additiveRefinement=!!n&&n.additiveRefinement,e.viewerRequestVolume=r.viewerRequestVolume,e.boundingVolume=r.boundingVolume,e.updateMatrixWorld()}(i,t,r,e.requester);const s=r.content&&(r.content.url||r.content.uri),o=e=>{e.userData.metadata=r,e.layer=t};if(s){let e=s.startsWith("http")?s:r.baseURL+s;t.source.isC3DTilesGoogleSource&&(e=t.source.getTileUrl(e));const n={b3dm:R,pnts:P,gltf:B};return M.A.arrayBuffer(e,t.source.networkOptions).then((s=>{if(void 0!==s){let a;const l=I.decode(new Uint8Array(s,0,4));if("{"===l[0]){s=JSON.parse(I.decode(new Uint8Array(s)));const n=t.source.isC3DTilesGoogleSource?t.source.baseUrl:e.slice(0,e.lastIndexOf("/")+1);t.tileset.extendTileset(s,r.tileId,n,t.registeredExtensions)}else if("b3dm"==l)a=n.b3dm;else if("pnts"==l)t.hasPnts=!0,a=n.pnts;else{if("glTF"!=l)return Promise.reject(`Unsupported magic code ${l}`);a=n.gltf}if(a)return a(s,t,e).then((e=>(i.content=e.object3d,e.batchTable&&(i.batchTable=e.batchTable),i.add(e.object3d),i.traverse(o),i)))}return i.traverse(o),i}))}return i.traverse(o),Promise.resolve(i)}};var D=r(86215);let O=1;const N={executeCommand(e){const t=e.layer,r=e.requester;return r.load().then((i=>{const s=new n.Points(i,t.material);return function(e){const t=e.geometry.attributes.position.count,r=new Uint8Array(4*t),i=O++;if(t>65535||i>65535)return console.warn("Currently picking is limited to Points with less than 65535 elements and less than 65535 Points instances"),e;for(let e=0;e>24,r[4*e+1]=(16711680&t)>>16,r[4*e+2]=(65280&t)>>8,r[4*e+3]=255&t}e.baseId=i,e.geometry.setAttribute("unique_id",new n.BufferAttribute(r,4,!0))}(s),s.frustumCulled=!1,s.matrixAutoUpdate=!1,s.position.copy(i.userData.origin||r.bbox.min),s.scale.copy(t.scale),s.updateMatrix(),s.tightbbox=i.boundingBox.applyMatrix4(s.matrix),s.layer=t,s.extent=D.A.fromBox3(e.view.referenceCrs,r.bbox),s.userData.node=r,s}))}};var U=r(97709);function F(e,t){const r=t.priority-e.priority;return 0===r?t.timestamp-e.timestamp:r}function k(){return{queue(e){const t=e.layer;let r=this.storages.get(t.id);r||(r={q:new y({comparator:F}),priority:1,accumulator:0},this.storages.set(t.id,r)),r.priority=t.priority||1,r.q.queue(e),this.counters.pending++},storages:new Map,counters:{executing:0,executed:0,failed:0,cancelled:0,pending:0},execute(e,t){return this.counters.pending--,this.counters.executing++,t.executeCommand(e).then((t=>{this.counters.executing--,e.resolve(t),this.counters.executed++}),(t=>{this.counters.executing--,e.reject(t),this.counters.failed++}))}}}function z(){this.defaultQueue=k(),this.hostQueues=new Map,this.providers={},this.maxCommandsPerHost=6,this.initDefaultProviders()}z.prototype.constructor=z,z.prototype.initDefaultProviders=function(){this.addProtocolProvider("tile",_),this.addProtocolProvider("3d-tiles",L),this.addProtocolProvider("pointcloud",N)},z.prototype.runCommand=function(e,t,r){const n=this.getProtocolProvider(e.layer.protocol);if(!n)throw new Error(`No known provider for layer ${e.layer.id}`);t.execute(e,n,r).then((()=>{if(e.view.notifyChange(e.requester,e.redraw),t.counters.executing{e.resolve=t,e.reject=r})),r&&!this.hostQueues.has(r)&&this.hostQueues.set(r,k());const n=r?this.hostQueues.get(r):this.defaultQueue;return e.timestamp=Date.now(),n.queue(e),n.counters.executing{if(n.counters.executing0&&(n+=e.priority,e.accumulator+=e.priority,(!t||e.accumulator>r)&&(t=e,r=e.accumulator))}if(t)return t.accumulator-=n,t.q}(e.storages);for(;t&&t.length>0;){const r=t.dequeue();if(!r.earlyDropFunction||!r.earlyDropFunction(r))return r;e.counters.pending--,e.counters.cancelled++,r.reject(new x(r))}};const G=z;var Q=r(10456),V=r(87070),H=r(32060);const j={LAYERS_INITIALIZED:"layers-initialized",LAYER_REMOVED:"layer-removed",LAYER_ADDED:"layer-added",INITIALIZED:"initialized",COLOR_LAYERS_ORDER_CHANGED:l.x,CAMERA_MOVED:"camera-moved",DISPOSED:"disposed"},q=new n.Vector2,W=new n.Matrix4,Y=new n.Vector2,X=new n.Ray,K=new n.Vector3,$=new n.Vector3,J=new g.A("EPSG:4326"),Z=[];let ee,te=0;class re extends n.EventDispatcher{#f=[];#m=(()=>new Uint8Array(4))();#g;constructor(e,t){let r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)throw new Error("Invalid viewerDiv parameter (must non be null/undefined)");super(),this.domElement=t,this.id=te++,this.referenceCrs=e,r=i.renderer&&i.renderer.domElement?new f(i.renderer):new f(t,i.renderer),this.mainLoop=i.mainLoop||new o.Ay(new G,r),this.scene=i.scene3D||new n.Scene,i.scene3D||(this.scene.matrixWorldAutoUpdate=!1),this.camera=new s.A(this.referenceCrs,this.mainLoop.gfxEngine.getWindowSize().x,this.mainLoop.gfxEngine.getWindowSize().y,i.camera),this._frameRequesters={},this._resizeListener=()=>this.resize(),window.addEventListener("resize",this._resizeListener,!1),this._changeSources=new Set,this._delayedFrameRequesterRemoval=[],this._allLayersAreReadyCallback=()=>{this.getLayers().every((e=>e.ready))&&0==this.mainLoop.scheduler.commandsWaitingExecutionCount()&&this.mainLoop.renderingState==o.Es&&(this.dispatchEvent({type:j.LAYERS_INITIALIZED}),this.removeFrameRequester(o.n7.UPDATE_END,this._allLayersAreReadyCallback))},this.camera.resize(this.domElement.clientWidth,this.domElement.clientHeight);const a=()=>{this.removeEventListener(j.LAYERS_INITIALIZED,a),this.dispatchEvent({type:j.INITIALIZED})};let l;this.addEventListener(j.LAYERS_INITIALIZED,a),this.#g=new Uint8Array(4*this.camera.width*this.camera.height),this.domElement.tabIndex=-1,i.disableFocusOnStart||this.domElement.focus(),this.domElement.addEventListener("mouseup",(e=>{2===e.button&&(l&&e.timeStamp-l<500&&this.domElement.dispatchEvent(new MouseEvent("dblclick-right",e)),l=e.timeStamp)})),Z.push(this),i.webXR&&((e,t)=>{const r=t.scale||1,i=e.mainLoop.gfxEngine.renderer.xr;i.addEventListener("sessionstart",(()=>{const t=e.camera.camera3D,s=n=>{"Escape"===n.key&&(document.removeEventListener("keydown",s),i.enabled=!1,e.camera.camera3D=t,e.scene.scale.multiplyScalar(1/r),e.scene.updateMatrixWorld(),async function(e){e&&await e.end()}(i.getSession()),e.notifyChange(e.camera.camera3D,!0))};e.scene.scale.multiplyScalar(r),e.scene.updateMatrixWorld(),i.enabled=!0,i.getReferenceSpace("local");const o=e.camera.position(),a=(new n.Quaternion).setFromUnitVectors(new n.Vector3(0,0,1),o.geodesicNormal).invert(),l=new n.Quaternion(-1,0,0,1).normalize().multiply(a),c=t.position.clone().multiplyScalar(-r).applyQuaternion(l),u=new XRRigidTransform(c,l),h=i.getReferenceSpace().getOffsetReferenceSpace(u);i.setReferenceSpace(h),e.camera.camera3D=i.getCamera(),e.camera.resize(e.camera.width,e.camera.height),document.addEventListener("keydown",s,!1),i.setAnimationLoop((t=>{i.isPresenting&&e.camera.camera3D.cameras[0]&&(e.camera.camera3D.updateMatrix(),e.camera.camera3D.updateMatrixWorld(!0),e.notifyChange(e.camera.camera3D,!0)),e.mainLoop.step(e,t)}))}))})(this,i.webXR)}get renderer(){return this.mainLoop?.gfxEngine?.getRenderer()}get camera3D(){return this.camera?.camera3D}dispose(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=Z.indexOf(this);if(-1==t)return void console.warn("View already disposed");window.removeEventListener("resize",this._resizeListener),this.controls&&("function"==typeof this.controls.dispose&&this.controls.dispose(),delete this.controls),this.removeAllFrameRequesters();const r=this.getLayers((e=>!e.isTiledGeometryLayer&&!e.isAtmosphere));for(const t of r)this.removeLayer(t.id,e);const n=this.getLayers((e=>e.isAtmosphere));for(const t of n)this.removeLayer(t.id,e);const i=this.getLayers((e=>e.isTiledGeometryLayer));for(const t of i)this.removeLayer(t.id,e);Z.splice(t,1),this.scene.traverse(H.A.cleanup),this.dispatchEvent({type:j.DISPOSED}),this.removeAllEvents()}addLayer(e,t){if(!e||!e.isLayer)return Promise.reject(new Error("Add Layer type object"));if(this.getLayerById(e.id))return e._reject(new Error(`Invalid id '${e.id}': id already used`));if(e=function(e,t,r){const n=t.source;if(r&&!t.extent&&(t.extent=r.extent,n&&!n.extent&&(n.extent=r.extent)),t.isGeometryLayer&&!t.isLabelLayer?t.crs=e.referenceCrs:t.crs||(r&&r.tileMatrixSets&&r.tileMatrixSets.includes(n.crs)?t.crs=n.crs:t.crs=r&&r.extent.crs),t.isLabelLayer)e.mainLoop.gfxEngine.label2dRenderer.registerLayer(t);else if(t.labelEnabled||t.addLabelLayer){t.labelEnabled&&console.info("layer.labelEnabled is deprecated use addLabelLayer, instead of"),t.buildExtent=!0,t.structure="3d";const r=new V.A(`${t.id}-label`,{source:n,style:t.style,zoom:t.zoom,performance:t.addLabelLayer.performance,crs:n.crs,visible:t.visible,margin:15,forceClampToTerrain:t.addLabelLayer.forceClampToTerrain});t.addEventListener("visible-property-changed",(()=>{r.visible=t.visible}));const i=n=>{n.layerId===t.id&&e.removeLayer(r.id),e.removeEventListener(j.LAYER_REMOVED,i)};e.addEventListener(j.LAYER_REMOVED,i),t.whenReady=t.whenReady.then((()=>(e.addLayer(r),t)))}return t.isOGC3DTilesLayer&&t._setup(e),t}(this,e,t),t)if(e.isColorLayer){const r=this.getLayers((e=>e.isColorLayer));if(e.sequence=r.length,!(t.countColorLayersTextures(...r,e)<=(0,c.gL)()))return e._reject(new Error(`Cant add color layer ${e.id}: the maximum layer is reached`));t.attach(e)}else t.attach(e);else{if("function"!=typeof e.update)return e._reject(new Error("Cant add GeometryLayer: missing a update function"));if("function"!=typeof e.preUpdate)return e._reject(new Error("Cant add GeometryLayer: missing a preUpdate function"));this.#f.push(e)}return e.object3d&&!e.object3d.parent&&e.object3d!==this.scene&&this.scene.add(e.object3d),Promise.all(e._promises).then((()=>{e._resolve(),this.notifyChange(t||e,!1),this._frameRequesters[o.n7.UPDATE_END]&&this._frameRequesters[o.n7.UPDATE_END].includes(this._allLayersAreReadyCallback)||this.addFrameRequester(o.n7.UPDATE_END,this._allLayersAreReadyCallback),this.dispatchEvent({type:j.LAYER_ADDED,layerId:e.id})}),e._reject),e.whenReady}removeLayer(e,t){const r=this.getLayerById(e);if(r){const n=r.parent;if(r.delete(t),n&&!n.detach(r))throw new Error(`Error to detach ${e} from ${n.id}`);if(null==n&&this.#f.splice(this.#f.findIndex((t=>t.id==e)),1),r.isColorLayer){const e=this.getLayers((e=>e.isColorLayer));for(const t of e)t.sequence>r.sequence&&t.sequence--}let i=0;for(const e of Z)i+=e.getLayers((e=>e.source.uid==r.source.uid&&e.crs==r.crs)).length;return r.source.onLayerRemoved({unusedCrs:0==i?r.crs:void 0}),this.notifyChange(this.camera),this.dispatchEvent({type:j.LAYER_REMOVED,layerId:e}),!0}throw new Error(`${e} doesn't exist`)}notifyChange(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(this._changeSources.add(e),this.mainLoop.gfxEngine.renderer.xr.isPresenting||!e.isTileMesh&&!e.isCamera||(this.#g.needsUpdate=!0)),this.mainLoop.scheduleViewUpdate(this,t)}getLayers(e){const t=[];for(const r of this.#f)if(e&&!e(r)||t.push(r),r.attachedLayers)for(const n of r.attachedLayers)e&&!e(n,r)||t.push(n);return t}getLayerById(e){return this.getLayers((t=>t.id===e))[0]}addFrameRequester(e,t){if("function"!=typeof t)throw new Error("frameRequester must be a function");this._frameRequesters[e]?this._frameRequesters[e].push(t):this._frameRequesters[e]=[t]}removeFrameRequester(e,t){this._frameRequesters[e].includes(t)?this._delayedFrameRequesterRemoval.push({when:e,frameRequester:t}):console.error("Invalid call to removeFrameRequester: frameRequester isn't registered")}removeAllFrameRequesters(){for(const e in this._frameRequesters)if(Object.prototype.hasOwnProperty.call(this._frameRequesters,e)){const t=this._frameRequesters[e];for(const r of t)this.removeFrameRequester(e,r)}this._executeFrameRequestersRemovals()}removeAllEvents(){if(void 0!==this._listeners){for(const e in this._listeners)Object.prototype.hasOwnProperty.call(this._listeners,e)&&delete this._listeners[e];this._listeners=void 0}}_executeFrameRequestersRemovals(){for(const e of this._delayedFrameRequesterRemoval){const t=this._frameRequesters[e.when].indexOf(e.frameRequester);t>=0?this._frameRequesters[e.when].splice(t,1):console.warn("FrameReq has already been removed")}this._delayedFrameRequesterRemoval.length=0}execFrameRequesters(e,t,r){if(this._frameRequesters[e]){this._delayedFrameRequesterRemoval.length>0&&this._executeFrameRequestersRemovals();for(var n=arguments.length,i=new Array(n>3?n-3:0),s=3;s1&&void 0!==arguments[1]?arguments[1]:q,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=this.domElement.getBoundingClientRect();if(e.touches&&e.touches.length)return t.set(e.touches[r].clientX-n.x,e.touches[r].clientY-n.y);if(void 0!==e.offsetX&&void 0!==e.offsetY){const r=e.target.getBoundingClientRect();return t.set(r.x+e.offsetX-n.x,r.y+e.offsetY-n.y)}}eventToNormalizedCoords(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.viewToNormalizedCoords(this.eventToViewCoords(e,q,t))}viewToNormalizedCoords(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:q;return t.x=e.x/this.camera.width*2-1,t.y=e.y/this.camera.height*-2+1,t}normalizedToViewCoords(e){return q.x=.5*(e.x+1)*this.camera.width,q.y=-.5*(e.y-1)*this.camera.height,q}pickObjectsAt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0;const n=[];if(r&&0!==r.length||(r=this.getLayers((e=>e.isGeometryLayer))),Array.isArray(r)||(r=[r]),r.forEach((e=>{"string"==typeof e&&(e=this.getLayerById(e)),e&&(e.isGeometryLayer||e.isObject3D)&&n.push(e)})),0==n.length)return[];const i=[],s=e instanceof Event?this.eventToViewCoords(e):e;for(const e of n)if(!e.isAtmosphere)if(e.isGeometryLayer){if(!e.ready){console.warn("view.pickObjectAt : layer is not ready : ",e);continue}e.pickObjectsAt(this,s,t,i)}else Q.A.pickObjectsAt(this,s,t,e,i);return i}getScale(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.28;return this.camera3D.isOrthographicCamera?.001*e/this.getPixelsToMeters():this.getScaleFromDistance(e,this.getDistanceFromCamera())}getScaleFromDistance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.28,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;e/=1e3;const r=n.MathUtils.degToRad(this.camera3D.fov);return e*(this.camera.height/(2*t*Math.tan(.5*r)))}getDistanceFromCamera(e){return this.getPickingPositionFromDepth(e,$),this.camera3D.position.distanceTo($)}getPixelsToMeters(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1?arguments[1]:void 0;return this.camera3D.isOrthographicCamera?(ee=(this.camera3D.right-this.camera3D.left)/this.camera3D.zoom,e*ee/this.camera.width):this.getPixelsToMetersFromDistance(e,this.getDistanceFromCamera(t))}getPixelsToMetersFromDistance(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:1)*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1)/this.camera._preSSE}getMetersToPixels(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1?arguments[1]:void 0;return this.camera3D.isOrthographicCamera?(ee=(this.camera3D.right-this.camera3D.left)/this.camera3D.zoom,e*this.camera.width/ee):this.getMetersToPixelsFromDistance(e,this.getDistanceFromCamera(t))}getMetersToPixelsFromDistance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.camera._preSSE*e/t}pickFeaturesAt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;for(var r=arguments.length,n=new Array(r>2?r-2:0),s=2;se.isColorLayer||e.isGeometryLayer)):n).forEach((e=>{"string"==typeof e&&(e=this.getLayerById(e)),e&&e.isLayer&&(a[e.id]=[],e.isColorLayer&&o.push(e.id))}));const l=e instanceof Event?this.eventToViewCoords(e,q):e,c=this.pickObjectsAt(l,t,...n);if(c.length>0&&c.forEach((e=>a[e.layer.id].push(e))),0==o.length)return a;let u;this.getPickingPositionFromDepth(l,$),J.crs=this.referenceCrs,J.setFromVector3($);const h={M:this.getPixelsToMeters(t,l),D:.001*t};this.isPlanarView?h.D=h.M:this.getPixelsToDegrees&&(h.D=this.getMetersToDegrees(h.M));const d=Q.A.pickTilesAt(this,l,t,this.tileLayer);for(const e of d)if(e.object.material)for(const t of e.object.material.getLayers(o))for(const e of t.textures)e.features&&(u=i.isMetricUnit(e.features.crs)?h.M:h.D,A.A.filterFeaturesUnderCoordinate(J,e.features,u).forEach((e=>{a[t.id].find((t=>t.geometry===e.geometry))||a[t.id].push(e)})));return a}readDepthBuffer(e,t,r,n,i){const s=this.mainLoop.gfxEngine,o=this.tileLayer.wireframe,a=this.tileLayer.opacity,l=this.tileLayer.visible;o&&(this.tileLayer.wireframe=!1),a<1&&(this.tileLayer.opacity=1),l||(this.tileLayer.visible=!0);const c=this.tileLayer.level0Nodes.map((e=>m.A.push(e,m.A.MODES.DEPTH)));return i=s.renderViewToBuffer({camera:this.camera,scene:this.tileLayer.object3d},{x:e,y:t,width:r,height:n,buffer:i}),c.forEach((e=>e())),this.tileLayer.wireframe!==o&&(this.tileLayer.wireframe=o),this.tileLayer.opacity!==a&&(this.tileLayer.opacity=a),this.tileLayer.visible!==l&&(this.tileLayer.visible=l),i}getPickingPositionFromDepth(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Vector3;if(!this.tileLayer||0==this.tileLayer.level0Nodes.length||!this.tileLayer.level0Nodes[0])return void(t=void 0);const r=this.mainLoop,i=0==r.scheduler.commandsWaitingExecutionCount()&&r.renderingState==o.Es,s=r.gfxEngine,l=s.getWindowSize();let c;if((e=e||l.clone().multiplyScalar(.5)).x=Math.floor(e.x),e.y=Math.floor(e.y),i){this.#g.needsUpdate&&(this.readDepthBuffer(0,0,l.x,l.y,this.#g),this.#g.needsUpdate=!1);const t=4*((l.y-e.y-1)*l.x+e.x);c=this.#g.slice(t,t+4)}else c=this.readDepthBuffer(e.x,e.y,1,1,this.#m);if(Y.x=e.x/l.x*2-1,Y.y=-e.y/l.y*2+1,a.A.isLogDepthBufferSupported()&&"PerspectiveCamera"==this.camera3D.type){X.origin.copy(this.camera3D.position),X.direction.set(Y.x,Y.y,.5),W.multiplyMatrices(this.camera3D.matrixWorld,W.copy(this.camera3D.projectionMatrix).invert()),X.direction.applyMatrix4(W),X.direction.sub(X.origin),K.set(0,0,1),K.applyMatrix4(W),K.sub(X.origin);const e=K.angleTo(X.direction),r=s.depthBufferRGBAValueToOrthoZ(c,this.camera3D)/Math.cos(e);t.addVectors(this.camera3D.position,X.direction.setLength(r))}else{const e=s.depthBufferRGBAValueToOrthoZ(c,this.camera3D);t.set(Y.x,Y.y,e),t.unproject(this.camera3D)}return t.length()>1e7?void 0:t}pickTerrainCoordinates(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new g.A(this.referenceCrs);return e instanceof Event?this.eventToViewCoords(e):e&&void 0!==e.x&&void 0!==e.y?q.copy(e):q.set(this.mainLoop.gfxEngine.width/2,this.mainLoop.gfxEngine.height/2),this.getPickingPositionFromDepth(q,$),J.crs=this.referenceCrs,J.setFromVector3($),J.as(t.crs,t),t}pickCoordinates(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new g.A(this.referenceCrs);return console.warn("Deprecated, use View#pickTerrainCoordinates instead."),this.pickTerrainCoordinates(e,t)}resize(e,t){e<0||t<0?console.warn(`Trying to resize the View with negative height (${t}) or width (${e}). Skipping resize.`):(null==e&&(e=this.domElement.clientWidth),null==t&&(t=this.domElement.clientHeight),this.#g=new Uint8Array(4*e*t),this.mainLoop.gfxEngine.onWindowResize(e,t),0!==e&&0!==t&&(this.camera.resize(e,t),this.notifyChange(this.camera3D)))}}const ne=re},14333:(e,t,r)=>{"use strict";r.d(t,{A:()=>A,s:()=>d});var n=r(39437),i=r(80736),s=r(48542),o=r(80264),a=r(706),l=r(6425),c=r(48306),u=r(55536),h=r(20620);const d={ON_TILE_CONTENT_LOADED:"on-tile-content-loaded",ON_TILE_REQUESTED:"on-tile-requested"},p=(0,s.oS)();function f(e){let t=e,r=t.tileId;for(;isNaN(r)&&t.parent;)t=t.parent,r=t.tileId;return r}function m(e){return e.geometry&&e.geometry.attributes._BATCHID}class g extends i.A{#A;constructor(e,t,r){console.warn("C3DTilesLayer is deprecated and will be removed in iTowns 3.0 version. Use OGC3DTilesLayer instead."),super(e,new n.Group,{source:t.source}),this.isC3DTilesLayer=!0,this.sseThreshold=t.sseThreshold||16,this.cleanupDelay=t.cleanupDelay||1e3,this.protocol="3d-tiles",this.name=t.name,this.registeredExtensions=t.registeredExtensions||new a.A,this.pntsMode=l.qW.COLOR,this.pntsShape=l.cn.CIRCLE,this.classification=t.classification,this.pntsSizeMode=l.qU.VALUE,this.pntsMinAttenuatedSize=t.pntsMinAttenuatedSize||1,this.pntsMaxAttenuatedSize=t.pntsMaxAttenuatedSize||7,t.pntsMode&&(Object.values(l.qW).includes(t.pntsMode)?this.pntsMode=t.pntsMode:console.warn("The points cloud mode doesn't exist. Use 'COLOR' or 'CLASSIFICATION' instead.")),t.pntsShape&&(Object.values(l.cn).includes(t.pntsShape)?this.pntsShape=t.pntsShape:console.warn("The points cloud point shape doesn't exist. Use 'CIRCLE' or 'SQUARE' instead.")),t.pntsSizeMode&&(Object.values(l.qU).includes(t.pntsSizeMode)?this.pntsSizeMode=t.pntsSizeMode:console.warn("The points cloud size mode doesn't exist. Use 'VALUE' or 'ATTENUATED' instead.")),this._style=t.style||null,this.#A=new Map,this.tilesC3DTileFeatures=new Map,t.onTileContentLoaded&&(console.warn("DEPRECATED onTileContentLoaded should not be passed at the contruction, use C3DTILES_LAYER_EVENTS.ON_TILE_CONTENT_LOADED event instead"),this.addEventListener(d.ON_TILE_CONTENT_LOADED,t.onTileContentLoaded)),t.overrideMaterials&&(console.warn("overrideMaterials is deprecated, use style API instead"),this.overrideMaterials=t.overrideMaterials),this._cleanableTiles=[];const i=this.addInitializationStep();this.source.whenReady.then((e=>{if(this.tileset=new o.A(e,this.source.baseUrl,this.registeredExtensions),this.tileset.extensionsUsed)for(const e of this.tileset.extensionsUsed)this.registeredExtensions.isExtensionRegistered(e)||(this.tileset.extensionsRequired&&this.tileset.extensionsRequired.includes(e)?console.error(`3D Tiles tileset required extension "${e}" must be registered to the 3D Tiles layer of iTowns to be parsed and used.`):console.warn(`3D Tiles tileset used extension "${e}" must be registered to the 3D Tiles layer of iTowns to be parsed and used.`));(0,s.WD)(r,r.mainLoop.scheduler,this,e.root).then(i)}))}preUpdate(e){return s.LM.bind(this)(e)}update(e,t,r){return p(e,t,r)}getObjectToUpdateForAttachedLayers(e){if(e.content){const t=[];e.content.traverse((r=>{r.isObject3D&&r.material&&r.layer==e.layer&&t.push(r)}));const r=e.parent;return r&&r.content?{elements:t,parent:r.content}:{elements:t}}}getC3DTileFeatureFromIntersectsArray(e){let t=null;for(let r=0;r{if(m(t)){const r=t.geometry.getAttribute("_BATCHID");let n=r.getX(0),i=0,s=0;const o=()=>{if(this.tilesC3DTileFeatures.get(e.tileId).has(n))this.tilesC3DTileFeatures.get(e.tileId).get(n).groups.push({start:i,count:s});else{const r=new u.A(e.tileId,n,[{start:i,count:s}],{},t);this.tilesC3DTileFeatures.get(e.tileId).set(n,r)}},a=t.geometry.getAttribute("position"),l=a.count*a.itemSize;for(let e=0;e=l&&o()}}}))}updateStyle(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!this._style)return!1;if(!this.object3d)return!1;const t=[],r=new Map;this.object3d.traverse((t=>{if(m(t)){const n=f(t);if(e&&!e.includes(n))return;r.has(n)||r.set(n,[]),r.get(n).push(t)}}));for(const[e,i]of r){const r=this.tilesC3DTileFeatures.get(e);i.forEach((e=>{e.geometry.clearGroups(),e.material=[];for(const[,t]of r){if(t.object3d!=e)continue;this._style.context.setGeometry({properties:t});const r=new n.Color(this._style.fill.color),i=this._style.fill.opacity,s=r.getHexString()+i;let o=null;this.#A.has(s)?o=this.#A.get(s):(o=new n.MeshStandardMaterial({color:r,opacity:i,transparent:i<1,alphaTest:.09}),this.#A.set(s,o));let a=-1;for(let t=0;t{e.geometry.addGroup(t.start,t.count,a)}))}(0,h.W)(e),e.material instanceof Array?e.material.forEach((e=>{t.includes(e)||t.push(e)})):t.includes(e.material)||t.push(e.material)}))}for(const[e,r]of this.#A)t.includes(r)||(r.dispose(),this.#A.delete(e));return!0}get materialCount(){return this.#A.size}set style(e){e instanceof c.Ay?this._style=e:this._style=e?new c.Ay(e):null,this.updateStyle()}get style(){return this._style}}const A=g},45232:(e,t,r)=>{"use strict";r.d(t,{A:()=>a,h:()=>s});var n=r(61276),i=r(24184);function s(e){return e?.attachedLayers.filter((e=>e.isGeoidLayer))[0]?.visible}class o extends n.A{constructor(e){super(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),this.isGeoidLayer=!0,this.defineLayerProperty("visible",!0)}updateNodeZ(e){e.material.geoidHeight=this.visible?e.geoidHeight:0,e.obb.updateZ({geoidHeight:e.material.geoidHeight})}update(e,t,r,n){if(!n||!r.material)return;const s=r.getExtentsByProjection(t.crs),o=s[0].zoom;if(!(o>t.zoom.max||othis.updateNodeZ(r);t.addEventListener("visible-property-changed",e),r.addEventListener("dispose",(()=>{t.removeEventListener("visible-property-changed",e)}))}if(!t.frozen&&t.visible&&r.material.visible&&r.layerUpdateState[t.id].canTryUpdate())return r.layerUpdateState[t.id].newTry(),this.getData(r.extent,s).then((e=>{r.geoidHeight=e.getHeightAtCoordinates(r.extent.center()),this.updateNodeZ(r),r.layerUpdateState[t.id].noMoreUpdatePossible()}))}}}const a=o},80736:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var n=r(61276),i=r(10456),s=r(99487),o=r(32060);class a extends n.A{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{cacheLifeTime:n=s.W.GEOMETRY,visible:i=!0,opacity:o=1,...a}=r;if(super(e,{...a,cacheLifeTime:n}),this.isGeometryLayer=!0,!t||!t.isObject3D)throw new Error("Missing/Invalid object3d parameter (must be a\n three.js Object3D instance)");"Group"===t.type&&""===t.name&&(t.name=e),this.object3d=t,Object.defineProperty(this,"object3d",{writable:!1,configurable:!0}),this.opacity=o,this.wireframe=!1,this.attachedLayers=[],this.visible=i,Object.defineProperty(this.zoom,"max",{value:1/0,writable:!1}),this.filteringExtent=!this.source.isFileSource,this.structure="3d"}get visible(){return this.object3d.visible}set visible(e){if(this.object3d.visible!==e){const t={type:"visible-property-changed",previous:{},new:{}};t.previous.visible=this.object3d.visible,t.new.visible=e,this.dispatchEvent(t),this.object3d.visible=e}}getObjectToUpdateForAttachedLayers(e){if(e.parent&&e.material)return{element:e,parent:e.parent}}postUpdate(){}culling(){return!0}attach(e){if(!e.update)throw new Error(`Missing 'update' function -> can't attach layer\n ${e.id}`);this.attachedLayers.push(e),e.parent=this}detach(e){const t=this.attachedLayers.length;return this.attachedLayers=this.attachedLayers.filter((t=>t.id!=e.id)),e.parent=void 0,this.attachedLayers.length2&&void 0!==arguments[2]?arguments[2]:this.options.defaultPickingRadius,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return i.A.pickObjectsAt(e,t,r,this.object3d,n)}}const l=a},66924:(e,t,r)=>{"use strict";r.d(t,{A:()=>i,y:()=>s});var n=r(86215);class i{constructor(e){this.layer=e}clear(){}update(){}}class s extends i{constructor(e){super(e),this.displayed={tiles:new Set},Object.defineProperty(this.displayed,"layers",{get:()=>{let e=[];return this.displayed.tiles.forEach((t=>{const r=t.material;e=[...new Set([...e,...r.colorLayerIds.filter((e=>r.getLayer(e))),...r.elevationLayerIds])]})),this.layer.attachedLayers.filter((t=>e.includes(t.id)))}}),Object.defineProperty(this.displayed,"extent",{get:()=>{const e=new n.A(this.layer.extent.crs,1/0,-1/0,1/0,-1/0);return e.min=1/0,e.max=-1/0,this.displayed.tiles.forEach((t=>{e.union(t.extent),e.min=Math.min(t.obb.z.min,e.min),e.max=Math.max(t.obb.z.max,e.max)})),e}})}clear(){this.displayed.tiles.clear()}update(e){e.material.visible?this.displayed.tiles.add(e):this.displayed.tiles.delete(e)}}},87070:(e,t,r)=>{"use strict";r.d(t,{A:()=>b});var n=r(39437),i=r(24184),s=r(32060),o=r(80736),a=r(52404),l=r(86215),c=r(3837),u=r(36845),h=r(48306),d=r(7296);const p=new h.J,f=new a.A("EPSG:4326",0,0,0),m=new l.A("EPSG:4326",0,0,0,0),g=new n.Vector2,A=new n.Vector2,y=new n.Vector2;class v{#y=!1;constructor(){this.dom=document.createElement("div"),this.dom.style.display="none",this.visible=!0}get visible(){return this.#y}set visible(e){e!==this.#y&&(this.#y=e,this.dom.style.display=e?"block":"none")}hide(){this.visible=!1}show(){this.visible=!0}add(e){this.dom.append(e.dom)}}class x extends n.Group{constructor(e){super(),this.nodeParent=e,this.needsUpdate=!0}initializeDom(){this.domElements=new v,this.domElements.labels=new v,this.domElements.add(this.domElements.labels),this.domElements.labels.dom.style.opacity="0"}addLabel(e){this.add(e),this.domElements.labels.dom.append(e.content),e.initDimensions(),this.nodeParent.layer.isGlobeLayer&&this.nodeParent.level<4&&(e.horizonCullingPoint=new n.Vector3)}removeLabel(e){this.remove(e),this.domElements.labels.dom.removeChild(e.content)}updatePosition(e){this.needsUpdate&&(this.needsAltitude&&e.updateElevationFromLayer(this.nodeParent.layer,[this.nodeParent]),e.update3dPosition(this.nodeParent.layer.crs),e.updateHorizonCullingPoint())}count(){return this.children.length}get labels(){return this.children}}class _ extends o.A{#v=(()=>new d.N)();constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{domElement:r,performance:i=!0,forceClampToTerrain:s=!1,margin:o,...a}=t;super(e,t.object3d||new n.Group,a),this.isLabelLayer=!0,this.domElement=new v,this.domElement.show(),this.domElement.dom.id=`itowns-label-${this.id}`,this.buildExtent=!0,this.crs=t.source.crs,this.performance=i,this.forceClampToTerrain=s,this.margin=o,this.toHide=new n.Group,this.labelDomelement=r,this.margin=t.margin}get visible(){return super.visible}set visible(e){super.visible=e,e?this.domElement?.show():this.domElement?.hide()}get submittedLabelNodes(){return this.object3d.children}convert(e,t){const r=[];return t.isExtent?t.as(e.crs,m):t.toExtent(e.crs,m),f.crs=e.crs,p.setZoom(t.zoom),e.features.forEach((t=>{if(t.type!==u.Xs.POINT)return;p.setFeature(t);const n=t.style?.text?.field,i=t.style?.point?.base_altitude,s=i instanceof Function&&"baseAltitudeDefault"==i.name;r.needsAltitude=r.needsAltitude||!0===this.forceClampToTerrain||s&&!t.hasRawElevationData,t.geometries.forEach((i=>{if(f.setFromArray(t.vertices,i.size*i.indices[0].offset),f.applyMatrix4(e.matrixWorld),!m.isPointInside(f))return;const s=i.properties.style&&i.properties.style.text&&i.properties.style.text.field;let o;p.setGeometry(i),this.style.setContext(p);const a=this.style.text&&this.style.text.field;if(this.labelDomelement)o=(0,h.Jn)(this.labelDomelement,p);else if(!(s||n||a||i.properties.style&&(i.properties.style.icon.source||i.properties.style.icon.key)||t.style&&t.style.icon&&(t.style.icon.source||t.style.icon.key)||this.style.icon&&(this.style.icon.source||this.style.icon.key)))return;const l=new c.A(o,f.clone(),this.style);l.layerId=this.id,l.padding=this.margin||l.padding,r.push(l)}))})),r}preUpdate(e,t){t.has(this.parent)&&(this.object3d.clear(),this.#v.width=.5*this.parent.maxScreenSizeNode,this.#v.height=.5*this.parent.maxScreenSizeNode,this.#v.resize())}#x(e){this.object3d.add(e)}#_(e){this.toHide.add(e)}#b(e){return e.parent?.isTileMesh?e.parent.link[this.id]?.domElements||this.#b(e.parent):this.domElement}#w(e){return e.children.every((e=>e.layerUpdateState&&e.layerUpdateState[this.id]?.hasFinished()))}#E(e){const t=e.children.slice();this.#v.reset(),t.sort(((e,t)=>t.order-e.order)),t.forEach((t=>{e.nodeParent.extent.planarDimensions(g),f.crs=e.nodeParent.extent.crs,f.setFromValues(e.nodeParent.extent.west,e.nodeParent.extent.north,0).toVector3(A),f.copy(t.coordinates).as(e.nodeParent.extent.crs,f).toVector3(y),y.sub(A),y.y+=g.y,y.divide(g).multiplyScalar(this.#v.width),t.updateProjectedPosition(y.x,y.y),this.#v.insert(t)||e.removeLabel(t)}))}update(e,t,r,n){if(!n&&r.link[t.id])return void s.A.removeChildrenAndCleanupRecursively(this,r);const o=r.link[t.id]||new x(r);if(r.link[t.id]=o,this.frozen||!r.visible||!this.visible)return;if(!r.material.visible&&this.#w(r))return this.#_(o);const a=r.getExtentsByProjection(this.source.crs)||[r.extent],l=a[0].zoom;if(lt.zoom.max)return this.#_(o);if(void 0===r.layerUpdateState[this.id]&&(r.layerUpdateState[this.id]=new i.A),!this.source.extentInsideLimit(r.extent,l))return void r.layerUpdateState[this.id].noMoreUpdatePossible();if(this.#w(r.parent))return r.material.visible||(o.needsUpdate=!0),void this.#x(o);if(!r.layerUpdateState[this.id].canTryUpdate())return;r.layerUpdateState[this.id].newTry();const c={layer:this,extentsSource:a,view:e.view,requester:r};return e.scheduler.execute(c).then((t=>{if(!t)return;const n=e.view.mainLoop.gfxEngine.label2dRenderer;o.initializeDom(),this.#b(r).add(o.domElements),t.forEach((e=>{r.parent?(o.needsAltitude=o.needsAltitude||e.needsAltitude,e.forEach((e=>{r.extent.isPointInside(e.coordinates)&&o.addLabel(e)}))):e.forEach((e=>{s.A.removeChildrenAndCleanupRecursively(this,e),n.removeLabelDOM(e)}))})),o.count()&&(o.domElements.labels.hide(),o.domElements.labels.dom.style.opacity="1.0",r.addEventListener("show",(()=>o.domElements.labels.show())),r.addEventListener("hidden",(()=>this.#_(o))),r.addEventListener("removed",(()=>this.removeNodeDomElement(r))),o.needsAltitude&&r.material.getElevationLayer()&&r.material.getElevationLayer().addEventListener("rasterElevationLevelChanged",(()=>{o.needsUpdate=!0})),this.performance&&this.#E(o)),r.layerUpdateState[this.id].noMoreUpdatePossible()}))}removeLabelsFromNodeRecursive(e){e.children.forEach((e=>{e.link[this.id]&&delete e.link[this.id],this.removeLabelsFromNodeRecursive(e)})),this.removeNodeDomElement(e)}removeNodeDomElement(e){if(e.link[this.id]?.domElements){const t=e.link[this.id].domElements.dom;t.parentElement.removeChild(t),delete e.link[this.id].domElements}}delete(e){e&&this.cache.clear(),this.domElement.dom.parentElement.removeChild(this.domElement.dom),this.parent.level0Nodes.forEach((e=>this.removeLabelsFromNodeRecursive(e)))}}const b=_},61276:(e,t,r)=>{"use strict";r.d(t,{A:()=>u,p:()=>h});var n=r(39437),i=r(85524),s=r(66924),o=r(88326),a=r(99487),l=r(48306);class c extends n.EventDispatcher{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{source:r,name:n,style:c={},subdivisionThreshold:u=256,addLabelLayer:h=!1,cacheLifeTime:d,options:p={},updateStrategy:f,zoom:m,mergeFeatures:g=!0,crs:A}=t;if(super(),this.isLayer=!0,this.id=e,Object.defineProperty(this,"id",{writable:!1}),this.name=n,void 0===r||!0===r)throw new Error(`Layer ${e} needs Source`);this.source=r||new o.A({url:"none"}),this.crs=A,!c||c instanceof l.Ay?this.style=c||new l.Ay:("string"==typeof c.fill?.pattern&&(console.warn("Using style.fill.pattern = { source: Img|url } is adviced"),c.fill.pattern={source:c.fill.pattern}),this.style=new l.Ay(c)),this.subdivisionThreshold=u,this.sizeDiagonalTexture=(this.subdivisionThreshold*this.subdivisionThreshold*2)**.5,this.addLabelLayer=h,this.options=p,this.updateStrategy=f??{type:i.Uv,options:{}},this.defineLayerProperty("frozen",!1),this.zoom={min:m?.min??0,max:m?.max??1/0},this.info=new s.A(this),this.ready=!1,this._promises=[],this.whenReady=new Promise(((e,t)=>{this._resolve=e,this._reject=t})).then((()=>(this.ready=!0,this.source.onLayerAdded({out:this}),this))),this._promises.push(this.source.whenReady),this.cache=new a.A(d),this.mergeFeatures=g}addInitializationStep(){let e;return this._promises.push(new Promise((t=>{e=t}))),e}defineLayerProperty(e,t,r){const n=Object.getOwnPropertyDescriptor(this,e);if(!n||!n.set){let n=null==this[e]?t:this[e];Object.defineProperty(this,e,{get:()=>n,set:t=>{if(n!==t){const i={type:`${e}-property-changed`,previous:{},new:{}};i.previous[e]=n,i.new[e]=t,n=t,r&&r(this,e),this.dispatchEvent(i)}}})}}convert(e){return e}getData(e,t){const r=this.source.requestToKey(this.source.isVectorSource?t:e);let n=this.cache.getByArray(r);return n||(n=this.source.loadData(e,this).then((e=>this.convert(e,t)),(e=>{throw e})),this.cache.setByArray(n,r)),n}delete(){console.warn("Function delete doesn't exist for this layer")}}const u=c,h={moveLayerToIndex:function(e,t,r){t=Math.min(t,r.length-1),t=Math.max(t,0);const n=e.sequence;for(const i of r)i.id===e.id?i.sequence=t:i.sequence>n&&i.sequence<=t?i.sequence--:i.sequence>=t&&i.sequence0&&this.moveLayerToIndex(e,e.sequence-1,t)},moveLayerUp:function(e,t){const r=t.length-1;e.sequencee.sequence-t.sequence)),t.map((e=>e.id))}}},24184:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});const n=[1,3,7,60],i=class{constructor(){this.state=0,this.lastErrorTimestamp=0,this.errorCount=0,this.failureParams={lowestLevelError:1/0}}hasFinished(){return 4==this.state}canTryUpdate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();switch(this.state){case 0:return!0;case 3:case 1:case 4:return!1;default:return 1e3*this.secondsUntilNextTry()<=e-this.lastErrorTimestamp}}secondsUntilNextTry(){if(2!==this.state)return 0;const e=Math.max(0,Math.min(this.errorCount,n.length)-1);return n[e]}newTry(){this.state=1}success(){this.lastErrorTimestamp=0,this.state=0}noMoreUpdatePossible(){this.state=4}noData(e){this.state=0,this.failureParams.lowestLevelError=Math.min(e.targetLevel,this.failureParams.lowestLevelError)}failure(e,t,r){r&&null!=r.targetLevel&&(this.failureParams.lowestLevelError=Math.min(r.targetLevel,this.failureParams.lowestLevelError)),this.lastErrorTimestamp=e,this.state=t?3:2,this.errorCount++}inError(){return 3==this.state||2==this.state}}},85524:(e,t,r)=>{"use strict";r.d(t,{Uv:()=>i,a0:()=>s,fZ:()=>a,kb:()=>u,oN:()=>o});var n=r(24051);const i=0,s=1,o=2,a=3;function l(e,t){const r=t.groups.filter((t=>t<=e));return r.length?r[r.length-1]:t.groups[0]}function c(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t==n.WS?r.zoom?r.zoom.min:0:Math.min(e,Math.ceil((t+e)/2))}function u(e,t){let r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.level,i=arguments.length>3?arguments[3]:void 0,u=arguments.length>4?arguments[4]:void 0,h=arguments.length>5?arguments[5]:void 0;const d=u.source.zoom?u.source.zoom.max:1/0;if(h.lowestLevelError!=1/0)r=c(h.lowestLevelError,i,u.source),r=h.lowestLevelError==r?r-1:r,e==s&&(r=l(r,u.updateStrategy.options));else{switch(e){case s:r=l(n,u.updateStrategy.options);break;case o:r=function(e,t,r){return Math.min(e,t+(r.increment||1))}(n,i,u.updateStrategy.options);break;case a:r=c(n,i,u.source);break;default:r=function(e,t,r,n){return e.pendingSubdivision&&!n.isVectorTileSource?r:t}(t,n,i,u.source)}r=Math.min(r,d)}return r}},49423:(e,t,r)=>{"use strict";r.d(t,{uj:()=>Cn,Ay:()=>Bn,YC:()=>Tn,eU:()=>In,TK:()=>Sn});var n=r(39437);const i=new n.OrthographicCamera(-1,1,1,-1,0,1);class s extends n.BufferGeometry{constructor(){super(),this.setAttribute("position",new n.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new n.Float32BufferAttribute([0,2,0,0,2,0],2))}}const o=new s;class a{constructor(e){this._mesh=new n.Mesh(o,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,i)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}}const l=parseInt(n.REVISION)>=165,c=parseInt(n.REVISION)>=166,u=new n.Box2,h=new n.Vector4,d=new n.Vector2,p=new class{constructor(){this._renderer=new n.WebGLRenderer,this._target=new n.WebGLRenderTarget(1,1),this._texTarget=new n.WebGLRenderTarget,this._quad=new a(new n.ShaderMaterial({blending:n.CustomBlending,blendDst:n.ZeroFactor,blendSrc:n.OneFactor,uniforms:{map:{value:null},pixel:{value:new n.Vector2}},vertexShader:"\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\t\t\t\tuniform sampler2D map;\n\t\t\t\tuniform ivec2 pixel;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tgl_FragColor = texelFetch( map, pixel, 0 );\n\n\t\t\t\t}\n\t\t\t"}))}increaseSizeTo(e){this._target.setSize(Math.max(this._target.width,e),1)}readDataAsync(e){const{_renderer:t,_target:r}=this;return l?t.readRenderTargetPixelsAsync(r,0,0,e.length/4,1,e):Promise.resolve().then((()=>this.readData(e)))}readData(e){const{_renderer:t,_target:r}=this;t.readRenderTargetPixels(r,0,0,e.length/4,1,e)}renderPixelToTarget(e,t,r){const{_quad:n,_renderer:i,_target:s,_texTarget:o}=this;if(c)u.min.copy(t),u.max.copy(t),u.max.x+=1,u.max.y+=1,i.initRenderTarget(s),i.copyTextureToTexture(e,s.texture,u,r,0);else{const a=i.autoClear,c=i.getRenderTarget(),u=i.getScissorTest();i.getScissor(h),o.setSize(e.image.width,e.image.height),i.setRenderTarget(o),d.set(0,0),l?i.copyTextureToTexture(e,o.texture,null,d):i.copyTextureToTexture(d,e,o.texture),n.material.uniforms.map.value=o.texture,n.material.uniforms.pixel.value.copy(t),i.setRenderTarget(s),i.setScissorTest(!0),i.setScissor(r.x,r.y,1,1),i.autoClear=!1,n.render(i),i.setScissorTest(u),i.setScissor(h),i.setRenderTarget(c),i.autoClear=a,o.dispose()}}},f=new n.Vector2,m=new n.Vector2,g=new n.Vector2;function A(e,t,r=new Array(3)){let n=3*t,i=3*t+1,s=3*t+2;return e.index&&(n=e.index.getX(n),i=e.index.getX(i),s=e.index.getX(s)),r[0]=n,r[1]=i,r[2]=s,r}function y(e,t,r,n,i){const[s,o,a]=n,l=function(e,t){return 0===t?e.getAttribute("uv"):e.getAttribute(`uv${t}`)}(e,t);f.fromBufferAttribute(l,s),m.fromBufferAttribute(l,o),g.fromBufferAttribute(l,a),i.set(0,0,0).addScaledVector(f,r.x).addScaledVector(m,r.y).addScaledVector(g,r.z)}function v(e,t,r,n){const i=e.x-Math.floor(e.x),s=e.y-Math.floor(e.y),o=Math.floor(i*t%t),a=Math.floor(s*r%r);return n.set(o,a),n}const x=new n.Vector2,_=new n.Vector2,b=new n.Vector2;class w{constructor(e,t,r){this.geometry=e,this.textures=t,this.data=r,this._asyncRead=!1,this.featureIds=r.featureIds.map((e=>{const{texture:t,...r}=e,n={label:null,propertyTable:null,nullFeatureId:null,...r};return t&&(n.texture={texCoord:0,channels:[0],...t}),n}))}getTextures(){return this.textures}getFeatureInfo(){return this.featureIds}getFeaturesAsync(...e){this._asyncRead=!0;const t=this.getFeatures(...e);return this._asyncRead=!1,t}getFeatures(e,t){const{geometry:r,textures:n,featureIds:i}=this,s=new Array(i.length).fill(null),o=i.length;p.increaseSizeTo(o);const a=A(r,e),l=a[function(e){return e.x>e.y&&e.x>e.z?0:e.y>e.z?1:2}(t)];for(let e=0,o=i.length;e(u(),s))):(p.readData(c),u(),s);function u(){const e=new Uint32Array(1);for(let t=0,r=i.length;tc[4*t+e]));new Uint8Array(e.buffer).set(o);const a=e[0];a!==n&&(s[t]=a)}}}}dispose(){this.textures.forEach((e=>{e&&(e.dispose(),e.image instanceof ImageBitmap&&e.image.close())}))}}const E="EXT_mesh_features";function M(e,t,r){e.traverse((e=>{if(t.associations.has(e)){const{meshes:n,primitives:i}=t.associations.get(e),s=t.json.meshes[n].primitives[i];s&&s.extensions&&s.extensions[E]&&r(e,s.extensions[E])}}))}class S{constructor(e){this.parser=e,this.name=E}async afterRoot({scene:e,parser:t}){const r=t.json.extensionsUsed;if(!r||!r.includes(E))return;const n=t.json.textures?.length||0,i=new Array(n).fill(null);M(e,t,((e,{featureIds:r})=>{r.forEach((e=>{if(e.texture&&null===i[e.texture.index]){const r=e.texture.index;i[r]=t.loadTexture(r)}}))}));const s=await Promise.all(i);M(e,t,((e,t)=>{e.userData.meshFeatures=new w(e.geometry,s,t)}))}}class C{constructor(e,t,r,n){C.prototype.isMatrix2=!0,this.elements=[1,0,0,1],void 0!==e&&this.set(e,t,r,n)}identity(){return this.set(1,0,0,1),this}fromArray(e,t=0){for(let r=0;r<4;r++)this.elements[r]=e[r+t];return this}set(e,t,r,n){const i=this.elements;return i[0]=e,i[1]=r,i[2]=t,i[3]=n,this}}function T(e,t,r){return e&&t in e?e[t]:r}function I(e){return"BOOLEAN"!==e&&"STRING"!==e&&"ENUM"!==e}function R(e){return/^VEC/.test(e)}function B(e){return/^MATRIX/.test(e)}function P(e,t,r,n=null){return B(r)||R(r)?n.fromArray(e,t):e[t]}function L(e){const{type:t,componentType:r}=e;switch(t){case"SCALAR":return"INT64"===r?0n:0;case"VEC2":return new n.Vector2;case"VEC3":return new n.Vector3;case"VEC4":return new n.Vector4;case"MAT2":return new C;case"MAT3":return new n.Matrix3;case"MAT4":return new n.Matrix4;case"BOOLEAN":return!1;case"STRING":return"";case"ENUM":return 0}}function D(e,t){if(null==t)return!1;switch(e){case"SCALAR":case"ENUM":return"number"==typeof t||"bigint"==typeof t;case"VEC2":return t.isVector2;case"VEC3":return t.isVector3;case"VEC4":return t.isVector4;case"MAT2":return t.isMatrix2;case"MAT3":return t.isMatrix3;case"MAT4":return t.isMatrix4;case"BOOLEAN":return"boolean"==typeof t;case"STRING":return"string"==typeof t}throw new Error("ClassProperty: invalid type.")}function O(e,t=null){switch(e){case"INT8":return Int8Array;case"INT16":return Int16Array;case"INT32":return Int32Array;case"INT64":return BigInt64Array;case"UINT8":return Uint8Array;case"UINT16":return Uint16Array;case"UINT32":return Uint32Array;case"UINT64":return BigUint64Array;case"FLOAT32":return Float32Array;case"FLOAT64":return Float64Array}switch(t){case"BOOLEAN":case"STRING":return Uint8Array}throw new Error("ClassProperty: invalid type.")}function N(e,t=null){const r=e.default,n=e.type;if(t=t||L(e),null===r){switch(n){case"SCALAR":return 0;case"VEC2":return t.set(0,0);case"VEC3":return t.set(0,0,0);case"VEC4":return t.set(0,0,0,0);case"MAT2":case"MAT3":case"MAT4":return t.identity();case"BOOLEAN":return!1;case"STRING":case"ENUM":return""}throw new Error("ClassProperty: invalid type.")}if(B(n))t.fromArray(r);else{if(!R(n))return r;t.fromArray(r)}}function U(e,t,r=null){if(e.array){Array.isArray(t)||(t=new Array(e.count||0)),t.length=null!==r?r:e.count;for(let r=0,n=t.length;rt.value===e));return null===r?"":r.name}}adjustValueScaleOffset(e){return I(this.type)?function(e,t){const{type:r,componentType:n,scale:i,offset:s,normalized:o}=e;if(Array.isArray(t))for(let e=0,r=t.length;e=this.count)throw new Error("PropertyAttributeAccessor: Requested index is outside the range of the buffer.");const i=this.properties[e],s=i.type;if(!i)throw new Error("PropertyAttributeAccessor: Requested class property does not exist.");if(!this.definition.properties[e])return i.resolveDefault(n);n=i.shapeToProperty(n);const o=r.getAttribute(i.attribute.toLowerCase());if(B(s)){const e=n.elements;for(let r=0,n=e.length;r>t&1)}return n}getPropertyValue(e,t,r=null){if(t>=this.count)throw new Error("PropertyTableAccessor: Requested index is outside the range of the table.");const n=this.properties[e];if(!n)throw new Error("PropertyTableAccessor: Requested property does not exist.");if(!this.definition.properties[e])return n.resolveDefault(r);const i=n.array,s=this.data,o=n.getArrayLengthFromId(s,t);if(r=n.shapeToProperty(r,o),i)for(let n=0,i=r.length;nn[e]));return this.getPropertyValuesAtTexel(s,e,t,r,o),s.forEach(((e,t)=>n[e]=o[t])),n}async getDataAsync(e,t,r,n={}){const i=this.properties;F(i,n);const s=Object.keys(i),o=s.map((e=>n[e]));return await this.getPropertyValuesAtTexelAsync(s,e,t,r,o),s.forEach(((e,t)=>n[e]=o[t])),n}getPropertyValuesAtTexelAsync(...e){this._asyncRead=!0;const t=this.getPropertyValuesAtTexel(...e);return this._asyncRead=!1,t}getPropertyValuesAtTexel(e,t,r,n,i=[]){for(;i.length(u.call(this),i))):(p.readData(c),u.call(this),i);function u(){for(let t=0,r=e.length;tc[4*t+e])),h=new(O(n.componentType,s))(l);if(new Uint8Array(h.buffer).set(u),n.array){const e=i[t];for(let t=0,r=e.length;t{e&&(e.dispose(),e.image instanceof ImageBitmap&&e.image.close())}))}}class K{constructor(e,t,r,n=null,i=null){const{schema:s,propertyTables:o=[],propertyTextures:a=[],propertyAttributes:l=[]}=e,{enums:c,classes:u}=s,h=o.map((e=>new H(e,u,c,r)));let d=[],p=[];n&&(n.propertyTextures&&(d=n.propertyTextures.map((e=>new X(a[e],u,c,t)))),n.propertyAttributes&&(p=n.propertyAttributes.map((e=>new Q(l[e],u,c))))),this.schema=s,this.tableAccessors=h,this.textureAccessors=d,this.attributeAccessors=p,this.object=i,this.textures=t,this.nodeMetadata=n}getPropertyTableData(e,t,r=null){if(Array.isArray(e)&&Array.isArray(t)){r=r||[];const n=Math.min(e.length,t.length);r.length=n;for(let i=0;it))),Array.isArray(e))return e.map((e=>{const t=this.tableAccessors[e];return{name:t.name,className:t.definition.class}}));{const t=this.tableAccessors[e];return{name:t.name,className:t.definition.class}}}getPropertyTextureData(e,t,r=[]){const n=this.textureAccessors;r.length=n.length;for(let i=0;i{r[s]=e}));i.push(o)}return await Promise.all(i),r}getPropertyTextureInfo(){return this.textureAccessors}getPropertyAttributeData(e,t=[]){const r=this.attributeAccessors;t.length=r.length;for(let n=0;n({name:e.name,className:e.definition.class})))}dispose(){this.textureAccessors.forEach((e=>e.dispose())),this.tableAccessors.forEach((e=>e.dispose())),this.attributeAccessors.forEach((e=>e.dispose()))}}const $="EXT_structural_metadata";function J(e,t=[]){const r=e.json.textures?.length||0,n=new Array(r).fill(null);return t.forEach((({properties:t})=>{for(const r in t){const{index:i}=t[r];null===n[i]&&(n[i]=e.loadTexture(i))}})),Promise.all(n)}function Z(e,t=[]){const r=e.json.bufferViews?.length||0,n=new Array(r).fill(null);return t.forEach((({properties:t})=>{for(const r in t){const{values:i,arrayOffsets:s,stringOffsets:o}=t[r];null===n[i]&&(n[i]=e.loadBufferView(i)),null===n[s]&&(n[s]=e.loadBufferView(s)),null===n[o]&&(n[o]=e.loadBufferView(o))}})),Promise.all(n)}class ee{constructor(e){this.parser=e,this.name=$}async afterRoot({scene:e,parser:t}){const r=t.json.extensionsUsed;if(!r||!r.includes($))return;let i=null,s=t.json.extensions[$];if(s.schemaUri){const{manager:e,path:r,requestHeader:o,crossOrigin:a}=t.options,l=new URL(s.schemaUri,r).toString(),c=new n.FileLoader(e);c.setCrossOrigin(a),c.setResponseType("json"),c.setRequestHeader(o),i=c.loadAsync(l).then((e=>{s={...s,schema:e}}))}const[o,a]=await Promise.all([J(t,s.propertyTextures),Z(t,s.propertyTables),i]),l=new K(s,o,a);e.userData.structuralMetadata=l,e.traverse((e=>{if(t.associations.has(e)){const{meshes:r,primitives:n}=t.associations.get(e),i=t.json.meshes[r].primitives[n];if(i&&i.extensions&&i.extensions[$]){const t=i.extensions[$];e.userData.structuralMetadata=new K(s,o,a,t,e)}else e.userData.structuralMetadata=l}}))}}class te{constructor(){this.name="CESIUM_RTC"}afterRoot(e){if(e.parser.json.extensions&&e.parser.json.extensions.CESIUM_RTC){const{center:t}=e.parser.json.extensions.CESIUM_RTC;t&&(e.scene.position.x+=t[0],e.scene.position.y+=t[1],e.scene.position.z+=t[2])}}}function re(e){let t;try{t=new URL(e,"http://fakehost.com/")}catch(e){return null}const r=t.pathname.split("/").pop(),n=r.lastIndexOf(".");return-1===n||n===r.length-1?null:r.substring(n+1)}class ne{get unloadPriorityCallback(){return this._unloadPriorityCallback}set unloadPriorityCallback(e){1===e.length?(console.warn('LRUCache: "unloadPriorityCallback" function has been changed to take two arguments.'),this._unloadPriorityCallback=(t,r)=>{const n=e(t),i=e(r);return ni?1:0}):this._unloadPriorityCallback=e}constructor(){this.minSize=6e3,this.maxSize=8e3,this.minBytesSize=322122547.2,this.maxBytesSize=429496729.6,this.unloadPercent=.05,this.itemSet=new Map,this.itemList=[],this.usedSet=new Set,this.callbacks=new Map,this.markUnusedQueued=!1,this.unloadingHandle=-1,this.cachedBytes=0,this.bytesMap=new Map,this.loadedSet=new Set,this._unloadPriorityCallback=null,this.computeMemoryUsageCallback=()=>null;const e=this.itemSet;this.defaultPriorityCallback=t=>e.get(t)}isFull(){return this.itemSet.size>=this.maxSize||this.cachedBytes>=this.maxBytesSize}getMemoryUsage(e){return this.bytesMap.get(e)??null}add(e,t){this.markUnusedQueued&&this.markAllUnused();const r=this.itemSet;if(r.has(e))return!1;if(this.isFull())return!1;const n=this.usedSet,i=this.itemList,s=this.callbacks,o=this.bytesMap;i.push(e),n.add(e),r.set(e,Date.now()),s.set(e,t);const a=this.computeMemoryUsageCallback(e);return this.cachedBytes+=a||0,o.set(e,a),!0}remove(e){const t=this.usedSet,r=this.itemSet,n=this.itemList,i=this.bytesMap,s=this.callbacks,o=this.loadedSet;if(r.has(e)){this.cachedBytes-=i.get(e)||0,i.delete(e),s.get(e)(e);const a=n.indexOf(e);return n.splice(a,1),t.delete(e),r.delete(e),s.delete(e),o.delete(e),!0}return!1}setLoaded(e,t){const{itemSet:r,loadedSet:n}=this;r.has(e)&&(!0===t?n.add(e):n.delete(e))}updateMemoryUsage(e){const t=this.itemSet,r=this.bytesMap;if(!t.has(e))return;this.cachedBytes-=r.get(e)||0;const n=this.computeMemoryUsageCallback(e);r.set(e,n),this.cachedBytes+=n}markUsed(e){this.markUnusedQueued&&this.markAllUnused();const t=this.itemSet,r=this.usedSet;t.has(e)&&!r.has(e)&&(t.set(e,Date.now()),r.add(e))}markAllUnused(){this.usedSet.clear(),this.markUnusedQueued=!1,-1!==this.unloadingHandle&&(cancelAnimationFrame(this.unloadingHandle),this.unloadingHandle=-1)}unloadUnusedContent(){const{unloadPercent:e,minSize:t,maxSize:r,itemList:n,itemSet:i,usedSet:s,loadedSet:o,callbacks:a,bytesMap:l,minBytesSize:c,maxBytesSize:u}=this,h=n.length-s.size,d=n.length-o.size,p=Math.max(Math.min(n.length-t,h),0),f=this.cachedBytes-c,m=this.unloadPriorityCallback||this.defaultPriorityCallback;let g=!1;const A=p>0&&h>0||d&&n.length>r;if(h&&this.cachedBytes>c||d&&this.cachedBytes>u||A){n.sort(((e,t)=>{const r=s.has(e);if(r===s.has(t)){const r=o.has(e);return r===o.has(t)?-m(e,t):r?1:-1}return r?1:-1}));const d=Math.max(t*e,p*e),A=Math.ceil(Math.min(d,h,p)),y=Math.max(e*f,e*c),v=Math.min(y,f);let x=0,_=0;for(;this.cachedBytes-_>u||n.length-x>r;){const e=n[x],t=l.get(e)||0;if(s.has(e)&&o.has(e)||this.cachedBytes-_-t=A)break;_+=t,x++}n.splice(0,x).forEach((e=>{this.cachedBytes-=l.get(e)||0,a.get(e)(e),l.delete(e),i.delete(e),a.delete(e),o.delete(e),s.delete(e)})),g=x0}g&&(this.unloadingHandle=requestAnimationFrame((()=>this.scheduleUnload())))}scheduleUnload(){this.scheduled||(this.scheduled=!0,queueMicrotask((()=>{this.scheduled=!1,this.unloadUnusedContent(),this.markUnusedQueued=!0})))}}class ie{constructor(){this.maxJobs=6,this.items=[],this.callbacks=new Map,this.currJobs=0,this.scheduled=!1,this.autoUpdate=!0,this.priorityCallback=()=>{throw new Error("PriorityQueue: PriorityCallback function not defined.")},this.schedulingCallback=e=>{requestAnimationFrame(e)},this._runjobs=()=>{this.tryRunJobs(),this.scheduled=!1}}sort(){const e=this.priorityCallback;this.items.sort(e)}add(e,t){return new Promise(((r,n)=>{const i=this.items,s=this.callbacks;i.push(e),s.set(e,((...e)=>t(...e).then(r).catch(n))),this.autoUpdate&&this.scheduleJobRun()}))}remove(e){const t=this.items,r=this.callbacks,n=t.indexOf(e);-1!==n&&(t.splice(n,1),r.delete(e))}tryRunJobs(){this.sort();const e=this.items,t=this.callbacks,r=this.maxJobs;let n=this.currJobs;for(;r>n&&e.length>0;){n++;const r=e.pop(),i=t.get(r);t.delete(r),i(r).then((()=>{this.currJobs--,this.autoUpdate&&this.scheduleJobRun()})).catch((()=>{this.currJobs--,this.autoUpdate&&this.scheduleJobRun()}))}this.currJobs=n}scheduleJobRun(){this.scheduled||(this.schedulingCallback(this._runjobs),this.scheduled=!0)}}const se=6378137,oe=1738100;function ae(e){return 3===e||-1===e}function le(e,t){return e.__lastFrameVisited===t&&e.__used}function ce(e,t){e.__lastFrameVisited!==t.frameCount&&(e.__lastFrameVisited=t.frameCount,e.__used=!1,e.__inFrustum=!1,e.__isLeaf=!1,e.__visible=!1,e.__active=!1,e.__error=1/0,e.__distanceFromCamera=1/0,e.__childrenWereVisible=!1,e.__allChildrenLoaded=!1,e.__inFrustum=t.tileInView(e),t.calculateError(e))}function ue(e,t){if(t.ensureChildrenArePreprocessed(e),ce(e,t),de(e,t),!e.__hasRenderableContent){const r=e.children;for(let e=0,n=r.length;e0&&e.__depth+1>=t.maxDepth)}(e,t))return void de(e,t);let r=!1,n=!1;const i=e.children;for(let e=0,s=i.length;ee.__depthFromRenderedParent!==t.__depthFromRenderedParent?e.__depthFromRenderedParent>t.__depthFromRenderedParent?-1:1:e.__inFrustum!==t.__inFrustum?e.__inFrustum?1:-1:e.__used!==t.__used?e.__used?1:-1:e.__error!==t.__error?e.__error>t.__error?1:-1:e.__distanceFromCamera!==t.__distanceFromCamera?e.__distanceFromCamera>t.__distanceFromCamera?-1:1:0,xe=(e,t)=>e.__depthFromRenderedParent!==t.__depthFromRenderedParent?e.__depthFromRenderedParent>t.__depthFromRenderedParent?1:-1:e.__loadingState!==t.__loadingState?e.__loadingState>t.__loadingState?-1:1:e.__lastFrameVisited!==t.__lastFrameVisited?e.__lastFrameVisited>t.__lastFrameVisited?-1:1:e.__hasUnrenderableContent!==t.__hasUnrenderableContent?e.__hasUnrenderableContent?-1:1:e.__error!==t.__error?e.__error>t.__error?-1:1:0;class _e{get root(){const e=this.rootTileSet;return e?e.root:null}set loadSiblings(e){console.warn('TilesRenderer: "loadSiblings" option has been removed.')}set stopAtEmptyTiles(e){console.warn('TilesRenderer: "stopAtEmptyTiles" option has been removed.')}set preprocessURL(e){console.warn('TilesRendererBase: The "preprocessURL" callback has been deprecated. Use a plugin, instead.'),this._preprocessURL=e}get preprocessURL(){return this._preprocessURL}constructor(e=null){this.rootTileSetTriggered=!1,this.rootTileSet=null,this.rootURL=e,this.fetchOptions={},this.plugins=[],this.queuedTiles=[],this._preprocessURL=null;const t=new ne;t.unloadPriorityCallback=xe;const r=new ie;r.maxJobs=4,r.priorityCallback=ve;const n=new ie;n.maxJobs=1,n.priorityCallback=ve,this.lruCache=t,this.downloadQueue=r,this.parseQueue=n,this.stats={parsing:0,downloading:0,failed:0,inFrustum:0,used:0,active:0,visible:0},this.frameCount=0,this.errorTarget=6,this.errorThreshold=1/0,this.displayActiveTiles=!1,this.maxDepth=1/0}registerPlugin(e){if(!0===e[ye])throw new Error("TilesRendererBase: A plugin can only be registered to a single tile set");this.plugins.push(e),e[ye]=!0,e.init&&e.init(this)}unregisterPlugin(e){const t=this.plugins;if("string"==typeof e&&(e=this.getPluginByName(name)),t.includes(e)){const r=t.indexOf(e);return t.splice(r,1),e.dispose&&e.dispose(),!0}return!1}getPluginByName(e){return this.plugins.find((t=>t.name===e))||null}traverse(e,t){this.root&&pe(this.root,((t,...r)=>(this.ensureChildrenArePreprocessed(t),!!e&&e(t,...r))),t)}queueTileForDownload(e){this.queuedTiles.push(e)}update(){const e=this.stats,t=this.lruCache;if(this.rootTileSetTriggered||(this.rootTileSetTriggered=!0,this.invokeOnePlugin((e=>e.loadRootTileSet&&e.loadRootTileSet()))),!this.root)return;const r=this.root;e.inFrustum=0,e.used=0,e.active=0,e.visible=0,this.frameCount++,fe(r,this),me(r,this),ge(r,this),Ae(r,this);const n=this.queuedTiles;n.sort(t.unloadPriorityCallback);for(let e=0,r=n.length;e{-1===e.__loadingState&&(e.__loadingState=0)})),e.failed=0)}dispose(){this.invokeAllPlugins((e=>{e!==this&&e.dispose&&e.dispose()}));const e=this.lruCache,t=[];this.traverse((e=>(t.push(e),!1)));for(let r=0,n=t.length;r{n!==this&&n.preprocessNode&&n.preprocessNode(e,t,r)}))}setTileActive(e,t){}setTileVisible(e,t){}calculateError(e){return 0}tileInView(e){return!0}ensureChildrenArePreprocessed(e){const t=e.children;for(let r=0,n=t.length;rparseInt(e)));console.assert(i<=1,"TilesRenderer: asset.version is expected to be a 1.x or a compatible version."),1===i&&s>0&&console.warn("TilesRenderer: tiles versions at 1.1 or higher have limited support. Some new extensions and features may not be supported.");let o=t.replace(/\/[^/]*\/?$/,"");o=new URL(o,window.location.href).toString(),this.preprocessNode(e.root,o,r)}loadRootTileSet(){let e=this.rootURL;this.invokeAllPlugins((t=>e=t.preprocessURL?t.preprocessURL(e,null):e));const t=this.invokeOnePlugin((t=>t.fetchData&&t.fetchData(e,this.fetchOptions))).then((t=>{if(t.ok)return t.json();throw new Error(`TilesRenderer: Failed to load tileset "${e}" with status ${t.status} : ${t.statusText}`)})).then((t=>{this.preprocessTileSet(t,e),this.rootTileSet=t}));return t.catch((e=>{console.error(e),this.rootTileSet=null})),t}requestTileContents(e){if(0!==e.__loadingState)return;let t=!1,r=new URL(e.content.uri,e.__basePath+"/").toString();this.invokeAllPlugins((t=>r=t.preprocessURL?t.preprocessURL(r,e):r));const n=this.stats,i=this.lruCache,s=this.downloadQueue,o=this.parseQueue,a=re(r);if(!i.add(e,(e=>{1===e.__loadingState?(e.__loadAbort.abort(),e.__loadAbort=null):t?e.children.length=0:this.invokeAllPlugins((t=>{t.disposeTile&&t.disposeTile(e)})),1===e.__loadingState?n.downloading--:2===e.__loadingState&&n.parsing--,e.__loadingState=0,e.__loadIndex++,o.remove(e),s.remove(e)})))return;e.__loadIndex++;const l=e.__loadIndex,c=new AbortController,u=c.signal;return n.downloading++,e.__loadAbort=c,e.__loadingState=1,s.add(e,(e=>e.__loadIndex!==l?Promise.resolve():this.invokeOnePlugin((e=>e.fetchData&&e.fetchData(r,{...this.fetchOptions,signal:u}))))).then((t=>{if(e.__loadIndex===l){if(t.ok)return"json"===a?t.json():t.arrayBuffer();throw new Error(`Failed to load model with error code ${t.status}`)}})).then((i=>{if(e.__loadIndex===l)return n.downloading--,n.parsing++,e.__loadAbort=null,e.__loadingState=2,o.add(e,(n=>n.__loadIndex!==l?Promise.resolve():"json"===a&&i.root?(this.preprocessTileSet(i,r,e),e.children.push(i.root),t=!0,Promise.resolve()):this.invokeOnePlugin((e=>e.parseTile&&e.parseTile(i,n,a,r)))))})).then((()=>{e.__loadIndex===l&&(n.parsing--,e.__loadingState=3,i.setLoaded(e,!0),null===i.getMemoryUsage(e)&&(i.isFull()&&i.computeMemoryUsageCallback(e)>0?i.remove(e):i.updateMemoryUsage(e)))})).catch((t=>{e.__loadIndex===l&&("AbortError"!==t.name?(o.remove(e),s.remove(e),2===e.__loadingState?n.parsing--:1===e.__loadingState&&n.downloading--,n.failed++,console.error(`TilesRenderer : Failed to load tile at url "${e.content.uri}".`),console.error(t),e.__loadingState=-1,i.setLoaded(e,!0)):i.remove(e))}))}getAttributions(e=[]){return this.invokeAllPlugins((t=>t!==this&&t.getAttributions&&t.getAttributions(e))),e}invokeOnePlugin(e){const t=[...this.plugins,this];for(let r=0;ro+a)throw new Error("FeatureTable: Feature data read outside binary body length.");return d}}return s}getBuffer(e,t){const{buffer:r,binOffset:n}=this;return r.slice(n+e,n+e+t)}}class Se{constructor(e){this.batchTable=e;const t=e.header.extensions["3DTILES_batch_table_hierarchy"];this.classes=t.classes;for(const e of this.classes){const t=e.instances;for(const r in t)e.instances[r]=this._parseProperty(t[r],e.length,r)}if(this.instancesLength=t.instancesLength,this.classIds=this._parseProperty(t.classIds,this.instancesLength,"classIds"),t.parentCounts?this.parentCounts=this._parseProperty(t.parentCounts,this.instancesLength,"parentCounts"):this.parentCounts=new Array(this.instancesLength).fill(1),t.parentIds){const e=this.parentCounts.reduce(((e,t)=>e+t),0);this.parentIds=this._parseProperty(t.parentIds,e,"parentIds")}else this.parentIds=null;this.instancesIds=[];const r={};for(const e of this.classIds)r[e]=r[e]??0,this.instancesIds.push(r[e]),r[e]++}_parseProperty(e,t,r){if(Array.isArray(e))return e;{const{buffer:n,binOffset:i}=this.batchTable;return Ee(n,i+e.byteOffset,t,"SCALAR",e.componentType||"UNSIGNED_SHORT",r)}}getDataFromId(e,t={}){const r=this.parentCounts[e];if(this.parentIds&&r>0){let n=0;for(let t=0;t=this.count)throw new Error(`BatchTable: id value "${e}" out of bounds for "${this.count}" features number.`);for(const r of this.getKeys())"extensions"!==r&&(t[r]=super.getData(r,this.count)[e]);for(const r in this.extensions){const n=this.extensions[r];n.getDataFromId instanceof Function&&(t[r]=t[r]||{},n.getDataFromId(e,t[r]))}return t}getPropertyArray(e){return super.getData(e,this.count)}}class Te{constructor(){this.fetchOptions={},this.workingPath=""}load(e){return console.warn('Loader: "load" function has been deprecated in favor of "loadAsync".'),this.loadAsync(e)}loadAsync(e){return fetch(e,this.fetchOptions).then((t=>{if(!t.ok)throw new Error(`Failed to load file "${e}" with status ${t.status} : ${t.statusText}`);return t.arrayBuffer()})).then((t=>(""===this.workingPath&&(this.workingPath=this.workingPathForURL(e)),this.parse(t))))}resolveExternalURL(e){return/^[^\\/]/.test(e)&&!/^http/.test(e)?this.workingPath+"/"+e:e}workingPathForURL(e){const t=e.split(/[\\/]/g);return t.pop(),t.join("/")+"/"}parse(e){throw new Error("LoaderBase: Parse not implemented.")}}function Ie(e){let t;if(t=e instanceof DataView?e:new DataView(e),"{"===String.fromCharCode(t.getUint8(0)))return null;let r="";for(let e=0;e<4;e++)r+=String.fromCharCode(t.getUint8(e));return r}class Re extends Te{parse(e){const t=new DataView(e),r=Ie(t);console.assert("b3dm"===r);const n=t.getUint32(4,!0);console.assert(1===n);const i=t.getUint32(8,!0);console.assert(i===e.byteLength);const s=t.getUint32(12,!0),o=t.getUint32(16,!0),a=t.getUint32(20,!0),l=t.getUint32(24,!0),c=e.slice(28,28+s+o),u=new Me(c,0,s,o),h=28+s+o,d=e.slice(h,h+a+l),p=new Ce(d,u.getData("BATCH_LENGTH"),0,a,l),f=h+a+l;return{version:n,featureTable:u,batchTable:p,glbBytes:new Uint8Array(e,f,i-f)}}}function Be(e,t){if(t===n.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t===n.TriangleFanDrawMode||t===n.TriangleStripDrawMode){let r=e.getIndex();if(null===r){const t=[],n=e.getAttribute("position");if(void 0===n)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;e=2.0 are supported.")));const l=new bt(i,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e=0&&void 0===o[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}l.setExtensions(s),l.setPlugins(o),l.parse(r,n)}parseAsync(e,t){const r=this;return new Promise((function(n,i){r.parse(e,t,n,i)}))}}function Le(){let e={};return{get:function(t){return e[t]},add:function(t,r){e[t]=r},remove:function(t){delete e[t]},removeAll:function(){e={}}}}const De={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class Oe{constructor(e){this.parser=e,this.name=De.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let r=0,n=t.length;r=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,i.source,s)}}class Xe{constructor(e){this.parser=e,this.name=De.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,r=this.parser,n=r.json,i=n.textures[e];if(!i.extensions||!i.extensions[t])return null;const s=i.extensions[t],o=n.images[s.source];let a=r.textureLoader;if(o.uri){const e=r.options.manager.getHandler(o.uri);null!==e&&(a=e)}return this.detectSupport().then((function(i){if(i)return r.loadTextureImage(e,s.source,a);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(e)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}}class Ke{constructor(e){this.parser=e,this.name=De.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,r=this.parser,n=r.json,i=n.textures[e];if(!i.extensions||!i.extensions[t])return null;const s=i.extensions[t],o=n.images[s.source];let a=r.textureLoader;if(o.uri){const e=r.options.manager.getHandler(o.uri);null!==e&&(a=e)}return this.detectSupport().then((function(i){if(i)return r.loadTextureImage(e,s.source,a);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(e)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}}class $e{constructor(e){this.name=De.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,r=t.bufferViews[e];if(r.extensions&&r.extensions[this.name]){const e=r.extensions[this.name],n=this.parser.getDependency("buffer",e.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return n.then((function(t){const r=e.byteOffset||0,n=e.byteLength||0,s=e.count,o=e.byteStride,a=new Uint8Array(t,r,n);return i.decodeGltfBufferAsync?i.decodeGltfBufferAsync(s,o,a,e.mode,e.filter).then((function(e){return e.buffer})):i.ready.then((function(){const t=new ArrayBuffer(s*o);return i.decodeGltfBuffer(new Uint8Array(t),s,o,a,e.mode,e.filter),t}))}))}return null}}class Je{constructor(e){this.name=De.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,r=t.nodes[e];if(!r.extensions||!r.extensions[this.name]||void 0===r.mesh)return null;const i=t.meshes[r.mesh];for(const e of i.primitives)if(e.mode!==at.TRIANGLES&&e.mode!==at.TRIANGLE_STRIP&&e.mode!==at.TRIANGLE_FAN&&void 0!==e.mode)return null;const s=r.extensions[this.name].attributes,o=[],a={};for(const e in s)o.push(this.parser.getDependency("accessor",s[e]).then((t=>(a[e]=t,a[e]))));return o.length<1?null:(o.push(this.parser.createNodeMesh(e)),Promise.all(o).then((e=>{const t=e.pop(),r=t.isGroup?t.children:[t],i=e[0].count,s=[];for(const e of r){const t=new n.Matrix4,r=new n.Vector3,o=new n.Quaternion,l=new n.Vector3(1,1,1),c=new n.InstancedMesh(e.geometry,e.material,i);for(let e=0;e-1,o=s?e.match(/Firefox\/([0-9]+)\./)[1]:-1}"undefined"==typeof createImageBitmap||r&&i<17||s&&o<98?this.textureLoader=new n.TextureLoader(this.options.manager):this.textureLoader=new n.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new n.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const r=this,n=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll((function(e){return e._markDefs&&e._markDefs()})),Promise.all(this._invokeAll((function(e){return e.beforeRoot&&e.beforeRoot()}))).then((function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])})).then((function(t){const s={scene:t[0][n.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:n.asset,parser:r,userData:{}};return mt(i,s,n),gt(s,n),Promise.all(r._invokeAll((function(e){return e.afterRoot&&e.afterRoot(s)}))).then((function(){for(const e of s.scenes)e.updateMatrixWorld();e(s)}))})).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[];for(let r=0,n=t.length;r{const r=this.associations.get(e);null!=r&&this.associations.set(t,r);for(const[r,n]of e.children.entries())i(n,t.children[r])};return i(r,n),n.name+="_instance_"+e.uses[t]++,n}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let r=0;r=2&&f.setY(t,h[e*o+1]),o>=3&&f.setZ(t,h[e*o+2]),o>=4&&f.setW(t,h[e*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return f}))}loadTexture(e){const t=this.json,r=this.options,n=t.textures[e].source,i=t.images[n];let s=this.textureLoader;if(i.uri){const e=r.manager.getHandler(i.uri);null!==e&&(s=e)}return this.loadTextureImage(e,n,s)}loadTextureImage(e,t,r){const i=this,s=this.json,o=s.textures[e],a=s.images[t],l=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const c=this.loadImageSource(t,r).then((function(t){t.flipY=!1,t.name=o.name||a.name||"",""===t.name&&"string"==typeof a.uri&&!1===a.uri.startsWith("data:image/")&&(t.name=a.uri);const r=(s.samplers||{})[o.sampler]||{};return t.magFilter=ct[r.magFilter]||n.LinearFilter,t.minFilter=ct[r.minFilter]||n.LinearMipmapLinearFilter,t.wrapS=ut[r.wrapS]||n.RepeatWrapping,t.wrapT=ut[r.wrapT]||n.RepeatWrapping,i.associations.set(t,{textures:e}),t})).catch((function(){return null}));return this.textureCache[l]=c,c}loadImageSource(e,t){const r=this.json,i=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then((e=>e.clone()));const s=r.images[e],o=self.URL||self.webkitURL;let a=s.uri||"",l=!1;if(void 0!==s.bufferView)a=this.getDependency("bufferView",s.bufferView).then((function(e){l=!0;const t=new Blob([e],{type:s.mimeType});return a=o.createObjectURL(t),a}));else if(void 0===s.uri)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const c=Promise.resolve(a).then((function(e){return new Promise((function(r,s){let o=r;!0===t.isImageBitmapLoader&&(o=function(e){const t=new n.Texture(e);t.needsUpdate=!0,r(t)}),t.load(n.LoaderUtils.resolveURL(e,i.path),o,void 0,s)}))})).then((function(e){var t;return!0===l&&o.revokeObjectURL(a),gt(e,s),e.userData.mimeType=s.mimeType||((t=s.uri).search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/)?"image/jpeg":t.search(/\.webp($|\?)/i)>0||0===t.search(/^data\:image\/webp/)?"image/webp":"image/png"),e})).catch((function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",a),e}));return this.sourceCache[e]=c,c}assignTexture(e,t,r,n){const i=this;return this.getDependency("texture",r.index).then((function(s){if(!s)return null;if(void 0!==r.texCoord&&r.texCoord>0&&((s=s.clone()).channel=r.texCoord),i.extensions[De.KHR_TEXTURE_TRANSFORM]){const e=void 0!==r.extensions?r.extensions[De.KHR_TEXTURE_TRANSFORM]:void 0;if(e){const t=i.associations.get(s);s=i.extensions[De.KHR_TEXTURE_TRANSFORM].extendTexture(s,e),i.associations.set(s,t)}}return void 0!==n&&(s.colorSpace=n),e[t]=s,s}))}assignFinalMaterial(e){const t=e.geometry;let r=e.material;const i=void 0===t.attributes.tangent,s=void 0!==t.attributes.color,o=void 0===t.attributes.normal;if(e.isPoints){const e="PointsMaterial:"+r.uuid;let t=this.cache.get(e);t||(t=new n.PointsMaterial,n.Material.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,t.sizeAttenuation=!1,this.cache.add(e,t)),r=t}else if(e.isLine){const e="LineBasicMaterial:"+r.uuid;let t=this.cache.get(e);t||(t=new n.LineBasicMaterial,n.Material.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,this.cache.add(e,t)),r=t}if(i||s||o){let e="ClonedMaterial:"+r.uuid+":";i&&(e+="derivative-tangents:"),s&&(e+="vertex-colors:"),o&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=r.clone(),s&&(t.vertexColors=!0),o&&(t.flatShading=!0),i&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(r))),r=t}e.material=r}getMaterialType(){return n.MeshStandardMaterial}loadMaterial(e){const t=this,r=this.json,i=this.extensions,s=r.materials[e];let o;const a={},l=[];if((s.extensions||{})[De.KHR_MATERIALS_UNLIT]){const e=i[De.KHR_MATERIALS_UNLIT];o=e.getMaterialType(),l.push(e.extendParams(a,s,t))}else{const r=s.pbrMetallicRoughness||{};if(a.color=new n.Color(1,1,1),a.opacity=1,Array.isArray(r.baseColorFactor)){const e=r.baseColorFactor;a.color.setRGB(e[0],e[1],e[2],n.LinearSRGBColorSpace),a.opacity=e[3]}void 0!==r.baseColorTexture&&l.push(t.assignTexture(a,"map",r.baseColorTexture,n.SRGBColorSpace)),a.metalness=void 0!==r.metallicFactor?r.metallicFactor:1,a.roughness=void 0!==r.roughnessFactor?r.roughnessFactor:1,void 0!==r.metallicRoughnessTexture&&(l.push(t.assignTexture(a,"metalnessMap",r.metallicRoughnessTexture)),l.push(t.assignTexture(a,"roughnessMap",r.metallicRoughnessTexture))),o=this._invokeOne((function(t){return t.getMaterialType&&t.getMaterialType(e)})),l.push(Promise.all(this._invokeAll((function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,a)}))))}!0===s.doubleSided&&(a.side=n.DoubleSide);const c=s.alphaMode||"OPAQUE";if("BLEND"===c?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,"MASK"===c&&(a.alphaTest=void 0!==s.alphaCutoff?s.alphaCutoff:.5)),void 0!==s.normalTexture&&o!==n.MeshBasicMaterial&&(l.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new n.Vector2(1,1),void 0!==s.normalTexture.scale)){const e=s.normalTexture.scale;a.normalScale.set(e,e)}if(void 0!==s.occlusionTexture&&o!==n.MeshBasicMaterial&&(l.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),void 0!==s.occlusionTexture.strength&&(a.aoMapIntensity=s.occlusionTexture.strength)),void 0!==s.emissiveFactor&&o!==n.MeshBasicMaterial){const e=s.emissiveFactor;a.emissive=(new n.Color).setRGB(e[0],e[1],e[2],n.LinearSRGBColorSpace)}return void 0!==s.emissiveTexture&&o!==n.MeshBasicMaterial&&l.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture,n.SRGBColorSpace)),Promise.all(l).then((function(){const r=new o(a);return s.name&&(r.name=s.name),gt(r,s),t.associations.set(r,{materials:e}),s.extensions&&mt(i,r,s),r}))}createUniqueName(e){const t=n.PropertyBinding.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,r=this.extensions,i=this.primitiveCache;function s(e){return r[De.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(r){return wt(r,e,t)}))}const o=[];for(let r=0,a=e.length;r0&&At(d,s),d.name=t.createUniqueName(s.name||"mesh_"+e),gt(d,s),h.extensions&&mt(i,d,h),t.assignFinalMaterial(d),c.push(d)}for(let r=0,n=c.length;r1?new n.Group:1===t.length?t[0]:new n.Object3D,a!==t[0])for(let e=0,r=t.length;e{const t=new Map;for(const[e,r]of i.associations)(e instanceof n.Material||e instanceof n.Texture)&&t.set(e,r);return e.traverse((e=>{const r=i.associations.get(e);null!=r&&t.set(e,r)})),t})(s),s}))}_createAnimationTracks(e,t,r,i,s){const o=[],a=e.name?e.name:e.uuid,l=[];let c;switch(pt[s.path]===pt.weights?e.traverse((function(e){e.morphTargetInfluences&&l.push(e.name?e.name:e.uuid)})):l.push(a),pt[s.path]){case pt.weights:c=n.NumberKeyframeTrack;break;case pt.rotation:c=n.QuaternionKeyframeTrack;break;case pt.position:case pt.scale:c=n.VectorKeyframeTrack;break;default:c=1===r.itemSize?n.NumberKeyframeTrack:n.VectorKeyframeTrack}const u=void 0!==i.interpolation?ft[i.interpolation]:n.InterpolateLinear,h=this._getArrayFromAccessor(r);for(let e=0,r=l.length;e{const i=this.manager,s=this.fetchOptions,o=i.getHandler("path.gltf")||new Pe(i);"include"===s.credentials&&"cors"===s.mode&&o.setCrossOrigin("use-credentials"),"credentials"in s&&o.setWithCredentials("include"===s.credentials),s.headers&&o.setRequestHeader(s.headers);let a=this.workingPath;!/[\\/]$/.test(a)&&a.length&&(a+="/");const l=this.adjustmentTransform;o.parse(r,a,(r=>{const{batchTable:n,featureTable:i}=t,{scene:s}=r,o=i.getData("RTC_CENTER");o&&(s.position.x+=o[0],s.position.y+=o[1],s.position.z+=o[2]),r.scene.updateMatrix(),r.scene.matrix.multiply(l),r.scene.matrix.decompose(r.scene.position,r.scene.quaternion,r.scene.scale),r.batchTable=n,r.featureTable=i,s.batchTable=n,s.featureTable=i,e(r)}),n)}))}}class Mt extends Te{parse(e){const t=new DataView(e),r=Ie(t);console.assert("pnts"===r);const n=t.getUint32(4,!0);console.assert(1===n);const i=t.getUint32(8,!0);console.assert(i===e.byteLength);const s=t.getUint32(12,!0),o=t.getUint32(16,!0),a=t.getUint32(20,!0),l=t.getUint32(24,!0),c=e.slice(28,28+s+o),u=new Me(c,0,s,o),h=28+s+o,d=e.slice(h,h+a+l),p=new Ce(d,u.getData("BATCH_LENGTH")||u.getData("POINTS_LENGTH"),0,a,l);return Promise.resolve({version:n,featureTable:u,batchTable:p})}}function St(e){const t=e>>11,r=e>>5&63,n=31&e;return[Math.round(t/31*255),Math.round(r/63*255),Math.round(n/31*255)]}const Ct={RGB:"color",POSITION:"position"};class Tt extends Mt{constructor(e=n.DefaultLoadingManager){super(),this.manager=e}parse(e){return super.parse(e).then((async e=>{const{featureTable:t,batchTable:r}=e,i=new n.PointsMaterial,s=t.header.extensions,o=new n.Vector3;let a;if(s&&s["3DTILES_draco_point_compression"]){const{byteOffset:e,byteLength:r,properties:n}=s["3DTILES_draco_point_compression"],o=this.manager.getHandler("draco.drc");if(null==o)throw new Error("PNTSLoader: dracoLoader not available.");const l={};for(const e in n)e in Ct&&e in n&&(l[Ct[e]]=n[e]);const c={attributeIDs:l,attributeTypes:{position:"Float32Array",color:"Uint8Array"},useUniqueIDs:!0},u=t.getBuffer(e,r);a=await o.decodeGeometry(u,c),a.attributes.color&&(i.vertexColors=!0)}else{const e=t.getData("POINTS_LENGTH"),r=t.getData("POSITION",e,"FLOAT","VEC3"),s=t.getData("RGB",e,"UNSIGNED_BYTE","VEC3"),l=t.getData("RGBA",e,"UNSIGNED_BYTE","VEC4"),c=t.getData("RGB565",e,"UNSIGNED_SHORT","SCALAR"),u=t.getData("CONSTANT_RGBA",e,"UNSIGNED_BYTE","VEC4"),h=t.getData("POSITION_QUANTIZED",e,"UNSIGNED_SHORT","VEC3"),d=t.getData("QUANTIZED_VOLUME_SCALE",e,"FLOAT","VEC3"),p=t.getData("QUANTIZED_VOLUME_OFFSET",e,"FLOAT","VEC3");if(a=new n.BufferGeometry,h){const t=new Float32Array(3*e);for(let r=0;r{e in t.header&&console.warn(`PNTSLoader: Unsupported FeatureTable feature "${e}" detected.`)}));const l=new n.Points(a,i);l.position.copy(o),e.scene=l,e.scene.featureTable=t,e.scene.batchTable=r;const c=t.getData("RTC_CENTER");return c&&(e.scene.position.x+=c[0],e.scene.position.y+=c[1],e.scene.position.z+=c[2]),e}))}}class It extends Te{parse(e){const t=new DataView(e),r=Ie(t);console.assert("i3dm"===r);const n=t.getUint32(4,!0);console.assert(1===n);const i=t.getUint32(8,!0);console.assert(i===e.byteLength);const s=t.getUint32(12,!0),o=t.getUint32(16,!0),a=t.getUint32(20,!0),l=t.getUint32(24,!0),c=t.getUint32(28,!0),u=e.slice(32,32+s+o),h=new Me(u,0,s,o),d=32+s+o,p=e.slice(d,d+a+l),f=new Ce(p,h.getData("INSTANCES_LENGTH"),0,a,l),m=d+a+l,g=new Uint8Array(e,m,i-m);let A=null,y=null,v=null;if(c)A=g,y=Promise.resolve();else{const e=this.resolveExternalURL(we(g)),t=e.split(/[\\/]/g);t.pop(),v=t.join("/"),y=fetch(e,this.fetchOptions).then((t=>{if(!t.ok)throw new Error(`I3DMLoaderBase : Failed to load file "${e}" with status ${t.status} : ${t.statusText}`);return t.arrayBuffer()})).then((e=>{A=new Uint8Array(e)}))}return y.then((()=>({version:n,featureTable:h,batchTable:f,glbBytes:A,gltfWorkingPath:v})))}}const Rt=new n.Vector3,Bt=new n.Vector3,Pt=new n.Vector3,Lt=new n.Vector3,Dt=new n.Quaternion,Ot=new n.Vector3,Nt=new n.Matrix4,Ut=new n.Matrix4;class Ft extends It{constructor(e=n.DefaultLoadingManager){super(),this.manager=e,this.adjustmentTransform=new n.Matrix4}resolveExternalURL(e){return this.manager.resolveURL(super.resolveExternalURL(e))}parse(e){return super.parse(e).then((e=>{const{featureTable:t,batchTable:r}=e,i=e.glbBytes.slice().buffer;return new Promise(((s,o)=>{const a=this.fetchOptions,l=this.manager,c=l.getHandler("path.gltf")||new Pe(l);"include"===a.credentials&&"cors"===a.mode&&c.setCrossOrigin("use-credentials"),"credentials"in a&&c.setWithCredentials("include"===a.credentials),a.headers&&c.setRequestHeader(a.headers);let u=e.gltfWorkingPath??this.workingPath;/[\\/]$/.test(u)||(u+="/");const h=this.adjustmentTransform;c.parse(i,u,(e=>{const i=t.getData("INSTANCES_LENGTH"),o=t.getData("POSITION",i,"FLOAT","VEC3"),a=t.getData("NORMAL_UP",i,"FLOAT","VEC3"),l=t.getData("NORMAL_RIGHT",i,"FLOAT","VEC3"),c=t.getData("SCALE_NON_UNIFORM",i,"FLOAT","VEC3"),u=t.getData("SCALE",i,"FLOAT","SCALAR"),d=t.getData("RTC_CENTER");["QUANTIZED_VOLUME_OFFSET","QUANTIZED_VOLUME_SCALE","EAST_NORTH_UP","POSITION_QUANTIZED","NORMAL_UP_OCT32P","NORMAL_RIGHT_OCT32P"].forEach((e=>{e in t.header&&console.warn(`I3DMLoader: Unsupported FeatureTable feature "${e}" detected.`)}));const p=new n.Vector3;for(let e=0;e{if(e.isMesh){m.push(e);const{geometry:t,material:r}=e,s=new n.InstancedMesh(t,r,i);s.position.copy(p),d&&(s.position.x+=d[0],s.position.y+=d[1],s.position.z+=d[2]),f.push(s)}}));for(let e=0;e{const t=new n.Group;return e.forEach((e=>{t.add(e.scene)})),{tiles:e,scene:t}}))}}class Gt extends Te{constructor(e=n.DefaultLoadingManager){super(),this.manager=e}parse(e){return new Promise(((t,r)=>{const n=this.manager,i=this.fetchOptions;let s=n.getHandler("path.gltf")||n.getHandler("path.glb");s||(s=new Pe(n),s.register((()=>new te))),"include"===i.credentials&&"cors"===i.mode&&s.setCrossOrigin("use-credentials"),"credentials"in i&&s.setWithCredentials("include"===i.credentials),i.headers&&s.setRequestHeader(i.headers);let o=s.resourcePath||s.path||this.workingPath;!/[\\/]$/.test(o)&&o.length&&(o+="/"),s.parse(e,o,(e=>{t(e)}),r)}))}}const Qt=new n.Matrix4;class Vt extends n.Group{constructor(e){super(),this.name="TilesRenderer.TilesGroup",this.tilesRenderer=e}raycast(e,t){return!this.tilesRenderer.optimizeRaycast||(this.tilesRenderer.raycast(e,t),!1)}updateMatrixWorld(e){if(this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldNeedsUpdate||e){null===this.parent?Qt.copy(this.matrix):Qt.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1;const e=Qt.elements,t=this.matrixWorld.elements;let r=!1;for(let n=0;n<16;n++){const i=e[n],s=t[n];if(Math.abs(i-s)>Number.EPSILON){r=!0;break}}if(r){this.matrixWorld.copy(Qt);const e=this.children;for(let t=0,r=e.length;t{Object.getPrototypeOf(e).raycast.call(e,t,n)})),Yt.sort(Xt)):r.invokeOnePlugin((r=>r.raycastTile&&r.raycastTile(e,i,t,n)))||t.intersectObject(i,!0,n)}function $t(e,t,r,n=null){const{group:i,activeTiles:s}=e;e.ensureChildrenArePreprocessed(t),null===n&&(n=qt,jt.copy(i.matrixWorld).invert(),n.copy(r.ray).applyMatrix4(jt));const o=[],a=t.children;for(let e=0,t=a.length;ec)break;const u=$t(e,a,r,n);if(u){const e=u.distance*u.distance;enew n.Vector3)),this.planes=new Array(6).fill().map((()=>new n.Plane))}clampPoint(e,t){return t.copy(e).applyMatrix4(this.inverseTransform).clamp(this.box.min,this.box.max).applyMatrix4(this.transform)}distanceToPoint(e){return this.clampPoint(e,tr).distanceTo(e)}containsPoint(e){return tr.copy(e).applyMatrix4(this.inverseTransform),this.box.containsPoint(tr)}intersectsRay(e){return rr.copy(e).applyMatrix4(this.inverseTransform),rr.intersectsBox(this.box)}intersectRay(e,t){return rr.copy(e).applyMatrix4(this.inverseTransform),rr.intersectBox(this.box,t)?(t.applyMatrix4(this.transform),t):null}update(){const{points:e,inverseTransform:t,transform:r,box:n}=this;t.copy(r).invert();const{min:i,max:s}=n;let o=0;for(let t=-1;t<=1;t+=2)for(let n=-1;n<=1;n+=2)for(let a=-1;a<=1;a+=2)e[o].set(t<0?i.x:s.x,n<0?i.y:s.y,a<0?i.z:s.z).applyMatrix4(r),o++;this.updatePlanes()}updatePlanes(){Zt.copy(this.box.min).applyMatrix4(this.transform),er.copy(this.box.max).applyMatrix4(this.transform),tr.set(0,0,1).transformDirection(this.transform),this.planes[0].setFromNormalAndCoplanarPoint(tr,Zt),this.planes[1].setFromNormalAndCoplanarPoint(tr,er).negate(),tr.set(0,1,0).transformDirection(this.transform),this.planes[2].setFromNormalAndCoplanarPoint(tr,Zt),this.planes[3].setFromNormalAndCoplanarPoint(tr,er).negate(),tr.set(1,0,0).transformDirection(this.transform),this.planes[4].setFromNormalAndCoplanarPoint(tr,Zt),this.planes[5].setFromNormalAndCoplanarPoint(tr,er).negate()}intersectsFrustum(e){const{points:t}=this,{planes:r}=e;for(let e=0;e<6;e++){const n=r[e];let i=-1/0;for(let e=0;e<8;e++){const r=t[e],s=n.distanceToPoint(r);i=ii?n:i}intersectsFrustum(e){const t=this.obb||this.regionObb,r=this.sphere;return!(r&&!e.intersectsSphere(r))&&!(t&&!t.intersectsFrustum(e))&&Boolean(r||t)}getOBB(e,t){const r=this.obb||this.regionObb;r?(e.copy(r.box),t.copy(r.transform)):(this.getAABB(e),t.identity())}getAABB(e){if(this.sphere)this.sphere.getBoundingBox(e);else{const t=this.obb||this.regionObb;e.copy(t.box).applyMatrix4(t.transform)}}getSphere(e){if(this.sphere)e.copy(this.sphere);else if(this.region)this.region.getBoundingSphere(e);else{const t=this.obb||this.regionObb;t.box.getBoundingSphere(e),e.applyMatrix4(t.transform)}}setObbData(e,t){const r=new nr;sr.set(e[3],e[4],e[5]),or.set(e[6],e[7],e[8]),ar.set(e[9],e[10],e[11]);const n=sr.length(),i=or.length(),s=ar.length();sr.normalize(),or.normalize(),ar.normalize(),0===n&&sr.crossVectors(or,ar),0===i&&or.crossVectors(sr,ar),0===s&&ar.crossVectors(sr,or),r.transform.set(sr.x,or.x,ar.x,e[0],sr.y,or.y,ar.y,e[1],sr.z,or.z,ar.z,e[2],0,0,0,1).premultiply(t),r.box.min.set(-n,-i,-s),r.box.max.set(n,i,s),r.update(),this.obb=r}setSphereData(e,t,r,i,s){const o=new n.Sphere;o.center.set(e,t,r),o.radius=i,o.applyMatrix4(s),this.sphere=o}setRegionData(e,t,r,n,i,s,o){const a=new ir.M(...e.radius,r,i,t,n,s,o),l=new nr;a.getBoundingBox(l.box,l.transform),l.update(),this.region=a,this.regionObb=l}}const hr=new n.Matrix3;class dr extends n.Frustum{constructor(){super(),this.points=Array(8).fill().map((()=>new n.Vector3))}setFromProjectionMatrix(e,t){super.setFromProjectionMatrix(e,t),this.calculateFrustumPoints()}calculateFrustumPoints(){const{planes:e,points:t}=this;[[e[0],e[3],e[4]],[e[1],e[3],e[4]],[e[0],e[2],e[4]],[e[1],e[2],e[4]],[e[0],e[3],e[5]],[e[1],e[3],e[5]],[e[0],e[2],e[5]],[e[1],e[2],e[5]]].forEach(((e,r)=>{!function(e,t,r,n){const i=hr.set(e.normal.x,e.normal.y,e.normal.z,t.normal.x,t.normal.y,t.normal.z,r.normal.x,r.normal.y,r.normal.z);n.set(-e.constant,-t.constant,-r.constant),n.applyMatrix3(i.invert())}(e[0],e[1],e[2],t[r])}))}}var pr=r(52219);const fr=new pr.C1(se,se,6356752.314245179),mr=(new pr.C1(oe,oe,1736e3),new n.Matrix4),gr=new n.Euler,Ar=parseInt(n.REVISION)<165,yr=Symbol("INITIAL_FRUSTUM_CULLED"),vr=new n.Matrix4,xr=new n.Matrix4,_r=new n.Vector3,br=new n.Vector2,wr=new n.Vector3(1,0,0),Er=new n.Vector3(0,1,0);function Mr(e,t){e.traverse((e=>{e.frustumCulled=e[yr]&&t}))}class Sr extends _e{get autoDisableRendererCulling(){return this._autoDisableRendererCulling}set autoDisableRendererCulling(e){this._autoDisableRendererCulling!==e&&(super._autoDisableRendererCulling=e,this.forEachLoadedModel((t=>{Mr(t,!e)})))}constructor(...e){super(...e),this.group=new Vt(this),this.ellipsoid=fr.clone(),this.cameras=[],this.cameraMap=new Map,this.cameraInfo=[],this.activeTiles=new Set,this.visibleTiles=new Set,this.optimizeRaycast=!0,this._eventDispatcher=new n.EventDispatcher,this._upRotationMatrix=new n.Matrix4,this.lruCache.computeMemoryUsageCallback=e=>e.cached.bytesUsed??null,this._autoDisableRendererCulling=!0,this._loadingTiles=!1;const t=new n.LoadingManager;if(t.setURLModifier((e=>this.preprocessURL?this.preprocessURL(e):e)),this.manager=t,Ar){const e=this;this._overridenRaycast=function(t,r){e.optimizeRaycast||Object.getPrototypeOf(this).raycast.call(this,t,r)}}}addEventListener(...e){this._eventDispatcher.addEventListener(...e)}hasEventListener(...e){this._eventDispatcher.hasEventListener(...e)}removeEventListener(...e){this._eventDispatcher.removeEventListener(...e)}dispatchEvent(...e){this._eventDispatcher.dispatchEvent(...e)}getBounds(...e){return console.warn("TilesRenderer: getBounds has been renamed to getBoundingBox."),this.getBoundingBox(...e)}getOrientedBounds(...e){return console.warn("TilesRenderer: getOrientedBounds has been renamed to getOrientedBoundingBox."),this.getOrientedBoundingBox(...e)}getBoundingBox(e){if(!this.root)return!1;const t=this.root.cached.boundingVolume;return!!t&&(t.getAABB(e),!0)}getOrientedBoundingBox(e,t){if(!this.root)return!1;const r=this.root.cached.boundingVolume;return!!r&&(r.getOBB(e,t),!0)}getBoundingSphere(e){if(!this.root)return!1;const t=this.root.cached.boundingVolume;return!!t&&(t.getSphere(e),!0)}forEachLoadedModel(e){this.traverse((t=>{const r=t.cached.scene;r&&e(r,t)}))}raycast(e,t){if(this.root)if(e.firstHitOnly){const r=$t(this,this.root,e);r&&t.push(r)}else Jt(this,this.root,e,t)}hasCamera(e){return this.cameraMap.has(e)}setCamera(e){const t=this.cameras,r=this.cameraMap;return!r.has(e)&&(r.set(e,new n.Vector2),t.push(e),this.dispatchEvent({type:"add-camera",camera:e}),!0)}setResolution(e,t,r){const n=this.cameraMap;if(!n.has(e))return!1;const i=t.isVector2?t.x:t,s=t.isVector2?t.y:r,o=n.get(e);return o.width===i&&o.height===s||(o.set(i,s),this.dispatchEvent({type:"camera-resolution-change"})),!0}setResolutionFromRenderer(e,t){return t.getSize(br).multiplyScalar(t.getPixelRatio()),this.setResolution(e,br.x,br.y)}deleteCamera(e){const t=this.cameras,r=this.cameraMap;if(r.has(e)){const n=t.indexOf(e);return t.splice(n,1),r.delete(e),this.dispatchEvent({type:"delete-camera",camera:e}),!0}return!1}preprocessTileSet(e,t,r){super.preprocessTileSet(e,t,r),queueMicrotask((()=>{this.dispatchEvent({type:"load-tile-set",tileSet:e,url:t})}))}loadRootTileSet(...e){return super.loadRootTileSet(...e).then((()=>{switch((this.rootTileSet.asset&&this.rootTileSet.asset.gltfUpAxis||"y").toLowerCase()){case"x":this._upRotationMatrix.makeRotationAxis(Er,-Math.PI/2);break;case"y":this._upRotationMatrix.makeRotationAxis(wr,Math.PI/2)}this.dispatchEvent({type:"load-content"})})).catch((()=>{}))}update(){let e=null;if(this.invokeAllPlugins((t=>{if(t.doTilesNeedUpdate){const r=t.doTilesNeedUpdate();e=null===e?r:e||r}})),!1===e)return this.dispatchEvent({type:"update-before"}),void this.dispatchEvent({type:"update-after"});this.dispatchEvent({type:"update-before"});const t=this.group,r=this.cameras,i=this.cameraMap,s=this.cameraInfo;if(0!==r.length){for(;s.length>r.length;)s.pop();for(;s.length1e-6&&console.warn("ThreeTilesRenderer : Non uniform scale used for tile which may cause issues when calculating screen space error.");for(let e=0,n=s.length;ee.scene));break}case"gltf":case"glb":{const t=new Gt(c);t.workingPath=a,t.fetchOptions=l,h=t.parse(e);break}default:console.warn(`TilesRenderer: Content type "${f}" not supported.`),h=Promise.resolve(null)}const m=this.stats;!1===this._loadingTiles&&m.parsing+m.downloading>0&&(this.dispatchEvent({type:"tiles-load-start"}),this._loadingTiles=!0);const g=await h;let A,y;if(g.isObject3D?(A=g,y=null):(A=g.scene,y=g),await this.invokeAllPlugins((e=>e.processTileModel&&e.processTileModel(A,t))),s._loadIndex!==u)return;A.updateMatrix(),"glb"!==f&&"gltf"!==f||A.matrix.multiply(p),A.matrix.premultiply(d),A.matrix.decompose(A.position,A.quaternion,A.scale),A.traverse((e=>{e[yr]=e.frustumCulled})),Mr(A,!this.autoDisableRendererCulling),Ar&&A.traverse((e=>{e.raycast=this._overridenRaycast}));const v=[],x=[],_=[];A.traverse((e=>{if(e.geometry&&x.push(e.geometry),e.material){const t=e.material;v.push(e.material);for(const e in t){const r=t[e];r&&r.isTexture&&_.push(r)}}})),s.materials=v,s.geometry=x,s.textures=_,s.scene=A,s.metadata=y,s.bytesUsed=function(e){const{TextureUtils:t}=n;if(!t)return 0;const r=new Set;let i=0;return e.traverse((e=>{if(e.geometry&&!r.has(e.geometry)&&(i+=function(e){let t=0;for(const r in e.attributes){const n=e.getAttribute(r);t+=n.count*n.itemSize*n.array.BYTES_PER_ELEMENT}const r=e.getIndex();return t+=r?r.count*r.itemSize*r.array.BYTES_PER_ELEMENT:0,t}(e.geometry),r.add(e.geometry)),e.material){const n=e.material;for(const e in n){const s=n[e];if(s&&s.isTexture&&!r.has(s)){const{format:e,type:n,image:o}=s,{width:a,height:l}=o,c=t.getByteLength(a,l,e,n);i+=s.generateMipmaps?4*c/3:c,r.add(s)}}}})),i}(A),this.dispatchEvent({type:"load-model",scene:A,tile:t}),!0===this._loadingTiles&&m.parsing+m.downloading===1&&(this.dispatchEvent({type:"tiles-load-end"}),this._loadingTiles=!1)}disposeTile(e){super.disposeTile(e);const t=e.cached;if(t.scene){const r=t.materials,n=t.geometry,i=t.textures,s=t.scene.parent;t.scene.traverse((e=>{e.userData.meshFeatures&&e.userData.meshFeatures.dispose(),e.userData.structuralMetadata&&e.userData.structuralMetadata.dispose()}));for(let e=0,t=n.length;e{const r=Symbol(e);Object.defineProperty(Sr.prototype,e,{get(){return this[r]||null},set(n){console.warn(`TilesRenderer: "${e}" has been deprecated in favor of the "${t}" event.`),this[r]&&this.removeEventListener(t,this[r]),this[r]=n,this.addEventListener(t,n)}})}));class Cr{constructor(){this.creditsCount={}}_adjustAttributions(e,t){const r=this.creditsCount,n=e.split(/;/g);for(let e=0,i=n.length;e{const r=e[1];return t[1]-r})).map((e=>e[0])).join("; ")}}function Tr(e){let t=null;return pe(e,(e=>{if(e.content&&e.content.uri){const[,r]=e.content.uri.split("?");return t=new URLSearchParams(r).get("session"),!0}return!1})),t}class Ir{constructor({apiToken:e,autoRefreshToken:t=!1,logoUrl:r=null,useRecommendedSettings:n=!0}){this.name="GOOGLE_CLOUD_AUTH_PLUGIN",this.apiToken=e,this.autoRefreshToken=t,this.useRecommendedSettings=n,this.logoUrl=r,this.sessionToken=null,this.tiles=null,this._onLoadCallback=null,this._visibilityChangeCallback=null,this._tokenRefreshPromise=null,this._attributionsManager=new Cr,this._logoAttribution={value:"",type:"image",collapsible:!1},this._attribution={value:"",type:"string",collapsible:!0}}init(e){null!=e&&(null==e.rootURL&&(e.rootURL="https://tile.googleapis.com/v1/3dtiles/root.json"),this.useRecommendedSettings&&(e.parseQueue.maxJobs=10,e.downloadQueue.maxJobs=30,e.errorTarget=40),this.tiles=e,this._onLoadCallback=({tileSet:t})=>{this.sessionToken=Tr(t.root),e.removeEventListener("load-tile-set",this._onLoadCallback)},this._visibilityChangeCallback=({tile:e,visible:t})=>{const r=e.cached.metadata.asset.copyright||"";t?this._attributionsManager.addAttributions(r):this._attributionsManager.removeAttributions(r)},e.addEventListener("load-tile-set",this._onLoadCallback),e.addEventListener("tile-visibility-change",this._visibilityChangeCallback))}getAttributions(e){this.tiles.visibleTiles.size>0&&(this.logoUrl&&(this._logoAttribution.value=this.logoUrl,e.push(this._logoAttribution)),this._attribution.value=this._attributionsManager.toString(),e.push(this._attribution))}preprocessURL(e){return e=new URL(e),/^http/.test(e.protocol)&&(e.searchParams.append("key",this.apiToken),null!==this.sessionToken&&e.searchParams.append("session",this.sessionToken)),e.toString()}dispose(){const{tiles:e}=this;e.removeEventListener("load-tile-set",this._onLoadCallback),e.removeEventListener("tile-visibility-change",this._visibilityChangeCallback)}async fetchData(e,t){null!==this._tokenRefreshPromise&&(await this._tokenRefreshPromise,e=this.preprocessURL(e));const r=await fetch(e,t);return r.status>=400&&r.status<=499&&this.autoRefreshToken?(await this._refreshToken(t),fetch(this.preprocessURL(e),t)):r}_refreshToken(e){if(null===this._tokenRefreshPromise){const t=new URL(this.tiles.rootURL);t.searchParams.append("key",this.apiToken),this._tokenRefreshPromise=fetch(t,e).then((e=>e.json())).then((e=>{this.sessionToken=Tr(e.root),this._tokenRefreshPromise=null}))}return this._tokenRefreshPromise}}class Rr{constructor({apiToken:e,assetId:t=null,autoRefreshToken:r=!1}){this.name="CESIUM_ION_AUTH_PLUGIN",this.apiToken=e,this.assetId=t,this.autoRefreshToken=r,this.tiles=null,this.endpointURL=null,this._bearerToken=null,this._tileSetVersion=-1,this._tokenRefreshPromise=null,this._attributions=[]}init(e){null!==this.assetId&&(e.rootURL=`https://api.cesium.com/v1/assets/${this.assetId}/endpoint`),this.tiles=e,this.endpointURL=e.rootURL}loadRootTileSet(){return this._refreshToken().then((()=>this.tiles.loadRootTileSet()))}preprocessURL(e){return e=new URL(e),/^http/.test(e.protocol)&&-1!=this._tileSetVersion&&e.searchParams.append("v",this._tileSetVersion),e.toString()}fetchData(e,t){return null!==this.tiles.getPluginByName("GOOGLE_CLOUD_AUTH_PLUGIN")?null:Promise.resolve().then((async()=>{null!==this._tokenRefreshPromise&&(await this._tokenRefreshPromise,e=this.preprocessURL(e));const r=await fetch(e,t);return r.status>=400&&r.status<=499&&this.autoRefreshToken?(await this._refreshToken(t),fetch(this.preprocessURL(e),t)):r}))}getAttributions(e){this.tiles.visibleTiles.size>0&&e.push(...this._attributions)}_refreshToken(e){if(null===this._tokenRefreshPromise){const t=new URL(this.endpointURL);t.searchParams.append("access_token",this.apiToken),this._tokenRefreshPromise=fetch(t,e).then((e=>{if(!e.ok)throw new Error(`CesiumIonAuthPlugin: Failed to load data with error code ${e.status}`);return e.json()})).then((e=>{const r=this.tiles;if("externalType"in e){const t=new URL(e.options.url);r.rootURL=e.options.url,r.registerPlugin(new Ir({apiToken:t.searchParams.get("key")}))}else{if(r.rootURL=e.url,r.fetchOptions.headers=r.fetchOptions.headers||{},r.fetchOptions.headers.Authorization=`Bearer ${e.accessToken}`,t.searchParams.has("v")&&-1===this._tileSetVersion){const t=new URL(e.url);this._tileSetVersion=t.searchParams.get("v")}this._bearerToken=e.accessToken,e.attributions&&(this._attributions=e.attributions.map((e=>({value:e.html,type:"html",collapsible:e.collapsible}))))}return this._tokenRefreshPromise=null,e}))}return this._tokenRefreshPromise}}function Br(e){return"OCTREE"===e.__implicitRoot.implicitTiling.subdivisionScheme}function Pr(e){return Br(e)?8:4}class Lr{constructor(e,t){this.parent=e,this.children=[],this.__level=e.__level+1,this.__implicitRoot=e.__implicitRoot,this.__subtreeIdx=t,[this.__x,this.__y,this.__z]=function(e,t){return t?[2*t.__x+e.__subtreeIdx%2,2*t.__y+Math.floor(e.__subtreeIdx/2)%2,Br(e)?2*t.__z+Math.floor(e.__subtreeIdx/4)%2:0]:[0,0,0]}(this,e)}static copy(e){const t={children:[]};return t.__level=e.__level,t.__implicitRoot=e.__implicitRoot,t.__subtreeIdx=e.__subtreeIdx,[t.__x,t.__y,t.__z]=[e.__x,e.__y,e.__z],t.boundingVolume=e.boundingVolume,t.geometricError=e.geometricError,t}}class Dr extends Te{constructor(e){super(),this.tile=e,this.rootTile=e.__implicitRoot}parseBuffer(e){const t=new DataView(e);let r=0;const n=Ie(t);console.assert("subt"===n,'SUBTREELoader: The magic bytes equal "subt".'),r+=4;const i=t.getUint32(r,!0);console.assert(1===i,'SUBTREELoader: The version listed in the header is "1".'),r+=4;const s=t.getUint32(r,!0);r+=8;const o=t.getUint32(r,!0);r+=8;const a=JSON.parse(we(new Uint8Array(e,r,s)));return r+=s,{version:i,subtreeJson:a,subtreeByte:e.slice(r,r+o)}}parse(e){const t=this.parseBuffer(e),r=t.subtreeJson;r.contentAvailabilityHeaders=[].concat(r.contentAvailability);const n=this.preprocessBuffers(r.buffers),i=this.preprocessBufferViews(r.bufferViews,n);this.markActiveBufferViews(r,i);const s=this.requestActiveBuffers(n,t.subtreeByte),o=this.parseActiveBufferViews(i,s);this.parseAvailability(t,r,o),this.expandSubtree(this.tile,t)}markActiveBufferViews(e,t){let r;const n=e.tileAvailability;isNaN(n.bitstream)?isNaN(n.bufferView)||(r=t[n.bufferView]):r=t[n.bitstream],r&&(r.isActive=!0,r.bufferHeader.isActive=!0);const i=e.contentAvailabilityHeaders;for(let e=0;e>Math.log2(i)];if(!this.getBit(t._tileAvailability,o)){n.push(void 0);continue}const l=this.deriveChildTile(t,a,o,e);a.children.push(l),n.push(l)}r=n,n=[]}return r}deriveChildTile(e,t,r,n){const i=new Lr(t,n);i.boundingVolume=this.getTileBoundingVolume(i),i.geometricError=this.getGeometricError(i);for(let t=0;e&&t=e.lengthBits)throw new Error("Bit index out of bounds.");if(void 0!==e.constant)return e.constant;const r=t>>3,n=t%8;return 1==(new Uint8Array(e.bitstream)[r]>>n&1)}getTileBoundingVolume(e){const t={};if(this.rootTile.boundingVolume.region){const r=[...this.rootTile.boundingVolume.region],n=r[0],i=r[2],s=r[1],o=r[3],a=(i-n)/Math.pow(2,e.__level),l=(o-s)/Math.pow(2,e.__level);r[0]=n+a*e.__x,r[2]=n+a*(e.__x+1),r[1]=s+l*e.__y,r[3]=s+l*(e.__y+1);for(let e=0;e<4;e++){const t=r[e];t<-Math.PI?r[e]+=2*Math.PI:t>Math.PI&&(r[e]-=2*Math.PI)}if(Br(e)){const t=r[4],n=(r[5]-t)/Math.pow(2,e.__level);r[4]=t+n*e.__z,r[5]=t+n*(e.__z+1)}t.region=r}if(this.rootTile.boundingVolume.box){const r=[...this.rootTile.boundingVolume.box],n=2**e.__level-1,i=Math.pow(2,-e.__level),s=Br(e)?3:2;for(let t=0;t{this.parse(e,t,i)}),r,i)}parse(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>{};this.decodeDracoFile(e,t,null,null,n.SRGBColorSpace,r).catch(r)}decodeDracoFile(e,t,r,i){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:n.LinearSRGBColorSpace,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:()=>{};const a={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!r,vertexColorSpace:s};return this.decodeGeometry(e,a).then(t).catch(o)}decodeGeometry(e,t){const r=JSON.stringify(t);if(Fr.has(e)){const t=Fr.get(e);if(t.key===r)return t.promise;if(0===e.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let n;const i=this.workerNextTaskID++,s=e.byteLength,o=this._getWorker(i,s).then((r=>(n=r,new Promise(((r,s)=>{n._callbacks[i]={resolve:r,reject:s},n.postMessage({type:"decode",id:i,taskConfig:t,buffer:e},[e])}))))).then((e=>this._createGeometry(e.geometry)));return o.catch((()=>!0)).then((()=>{n&&i&&this._releaseTask(n,i)})),Fr.set(e,{key:r,promise:o}),o}_createGeometry(e){const t=new n.BufferGeometry;e.index&&t.setIndex(new n.BufferAttribute(e.index.array,1));for(let r=0;r{r.load(e,t,void 0,n)}))}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then((t=>{const r=t[0];e||(this.decoderConfig.wasmBinary=t[1]);const n=zr.toString(),i=["/* draco decoder */",r,"","/* worker */",n.substring(n.indexOf("{")+1,n.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([i]))})),this.decoderPending}_getWorker(e,t){return this._initDecoder().then((()=>{if(this.workerPool.lengtht._taskLoad?-1:1}));const r=this.workerPool[this.workerPool.length-1];return r._taskCosts[e]=t,r._taskLoad+=t,r}))}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map((e=>e._taskLoad)))}dispose(){for(let e=0;e{const t=e.draco,o=new t.Decoder;try{const e=function(e,t,n,i){const s=i.attributeIDs,o=i.attributeTypes;let a,l;const c=t.GetEncodedGeometryType(n);if(c===e.TRIANGULAR_MESH)a=new e.Mesh,l=t.DecodeArrayToMesh(n,n.byteLength,a);else{if(c!==e.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");a=new e.PointCloud,l=t.DecodeArrayToPointCloud(n,n.byteLength,a)}if(!l.ok()||0===a.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+l.error_msg());const u={index:null,attributes:[]};for(const n in s){const l=self[o[n]];let c,h;if(i.useUniqueIDs)h=s[n],c=t.GetAttributeByUniqueId(a,h);else{if(h=t.GetAttributeId(a,e[s[n]]),-1===h)continue;c=t.GetAttribute(a,h)}const d=r(e,t,a,n,l,c);"color"===n&&(d.vertexColorSpace=i.vertexColorSpace),u.attributes.push(d)}return c===e.TRIANGULAR_MESH&&(u.index=function(e,t,r){const n=3*r.num_faces(),i=4*n,s=e._malloc(i);t.GetTrianglesUInt32Array(r,i,s);const o=new Uint32Array(e.HEAPF32.buffer,s,n).slice();return e._free(s),{array:o,itemSize:1}}(e,t,a)),e.destroy(a),u}(t,o,new Int8Array(n),s),a=e.attributes.map((e=>e.array.buffer));e.index&&a.push(e.index.array.buffer),self.postMessage({type:"decode",id:i.id,geometry:e},a)}catch(e){console.error(e),self.postMessage({type:"error",id:i.id,error:e.message})}finally{t.destroy(o)}}))}}}class Gr{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:4;this.pool=e,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0}_initWorker(e){if(!this.workers[e]){const t=this.workerCreator();t.addEventListener("message",this._onMessage.bind(this,e)),this.workers[e]=t}}_getIdleWorker(){for(let e=0;e{const n=this._getIdleWorker();-1!==n?(this._initWorker(n),this.workerStatus|=1<e.terminate())),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}const Qr=9,Vr=15,Hr=16,jr=22,qr=37,Wr=43,Yr=76,Xr=83,Kr=97,$r=100,Jr=103,Zr=109,en=165,tn=166;class rn{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}}class nn{constructor(e,t,r,n){this._dataView=new DataView(e.buffer,e.byteOffset+t,r),this._littleEndian=n,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian)+2**32*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_nextInt32(){const e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_skip(e){return this._offset+=e,this}_scan(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=this._offset;let n=0;for(;this._dataView.getUint8(this._offset)!==t&&ne.arrayBuffer())).then((e=>WebAssembly.instantiate(e,un))).then(this._init):WebAssembly.instantiate(Buffer.from(dn,"base64"),un).then(this._init),an)}_init(e){ln=e.instance,un.env.emscripten_notify_memory_growth(0)}decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!ln)throw new Error("ZSTDDecoder: Await .init() before decoding.");const r=e.byteLength,n=ln.exports.malloc(r);cn.set(e,n),t=t||Number(ln.exports.ZSTD_findDecompressedSize(n,r));const i=ln.exports.malloc(t),s=ln.exports.ZSTD_decompress(i,t,n,r),o=cn.slice(i,i+s);return ln.exports.free(n),ln.exports.free(i),o}}const dn="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZACAAKAIAIAAoAgRBH3F0QQAgAWtBH3F2CwgAIABBiH9LC34BBH9BAyEBIAAoAgQiA0EgTQRAIAAoAggiASAAKAIQTwRAIAAQDQ8LIAAoAgwiAiABRgRAQQFBAiADQSBJGw8LIAAgASABIAJrIANBA3YiBCABIARrIAJJIgEbIgJrIgQ2AgggACADIAJBA3RrNgIEIAAgBCgAADYCAAsgAQsUAQF/IAAgARACIQIgACABEAEgAgv3AQECfyACRQRAIABCADcCACAAQQA2AhAgAEIANwIIQbh/DwsgACABNgIMIAAgAUEEajYCECACQQRPBEAgACABIAJqIgFBfGoiAzYCCCAAIAMoAAA2AgAgAUF/ai0AACIBBEAgAEEIIAEQFGs2AgQgAg8LIABBADYCBEF/DwsgACABNgIIIAAgAS0AACIDNgIAIAJBfmoiBEEBTQRAIARBAWtFBEAgACABLQACQRB0IANyIgM2AgALIAAgAS0AAUEIdCADajYCAAsgASACakF/ai0AACIBRQRAIABBADYCBEFsDwsgAEEoIAEQFCACQQN0ams2AgQgAgsWACAAIAEpAAA3AAAgACABKQAINwAICy8BAX8gAUECdEGgHWooAgAgACgCAEEgIAEgACgCBGprQR9xdnEhAiAAIAEQASACCyEAIAFCz9bTvtLHq9lCfiAAfEIfiUKHla+vmLbem55/fgsdAQF/IAAoAgggACgCDEYEfyAAKAIEQSBGBUEACwuCBAEDfyACQYDAAE8EQCAAIAEgAhBnIAAPCyAAIAJqIQMCQCAAIAFzQQNxRQRAAkAgAkEBSARAIAAhAgwBCyAAQQNxRQRAIAAhAgwBCyAAIQIDQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADTw0BIAJBA3ENAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgA0F8aiIEIABJBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAsMACAAIAEpAAA3AAALQQECfyAAKAIIIgEgACgCEEkEQEEDDwsgACAAKAIEIgJBB3E2AgQgACABIAJBA3ZrIgE2AgggACABKAAANgIAQQALDAAgACABKAIANgAAC/cCAQJ/AkAgACABRg0AAkAgASACaiAASwRAIAAgAmoiBCABSw0BCyAAIAEgAhALDwsgACABc0EDcSEDAkACQCAAIAFJBEAgAwRAIAAhAwwDCyAAQQNxRQRAIAAhAwwCCyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkF/aiECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YEQCAHQRhqIQcgBiAQSQR/IAZBAmoiBigAACAFdgUgBUEQaiEFIARBEHYLIQQMAQsLA0AgBEEDcSIIQQNGBEAgBUECaiEFIARBAnYhBCAHQQNqIQcMAQsLIAcgCGoiByAPSw0EIAVBAmohBQNAIAIgB0kEQCANIAJBAXRqQQA7AQAgAkEBaiECDAELCyAGIA5LQQAgBiAFQQN1aiIHIAxLG0UEQCAHKAAAIAVBB3EiBXYhBAwCCyAEQQJ2IQQLIAYhBwsCfyALQX9qIAQgAEF/anEiBiAAQQF0QX9qIgggCWsiEUkNABogBCAIcSIEQQAgESAEIABIG2shBiALCyEIIA0gAkEBdGogBkF/aiIEOwEAIAlBASAGayAEIAZBAUgbayEJA0AgCSAASARAIABBAXUhACALQX9qIQsMAQsLAn8gByAOS0EAIAcgBSAIaiIFQQN1aiIGIAxLG0UEQCAFQQdxDAELIAUgDCIGIAdrQQN0awshBSACQQFqIQIgBEUhCCAGKAAAIAVBH3F2IQQMAQsLQWwgCUEBRyAFQSBKcg0BGiABIAJBf2o2AgAgBiAFQQdqQQN1aiADawwBC0FQCyEAIApBEGokACAACwkAQQFBBSAAGwsMACAAIAEoAAA2AAALqgMBCn8jAEHwAGsiCiQAIAJBAWohDiAAQQhqIQtBgIAEIAVBf2p0QRB1IQxBACECQQEhBkEBIAV0IglBf2oiDyEIA0AgAiAORkUEQAJAIAEgAkEBdCINai8BACIHQf//A0YEQCALIAhBA3RqIAI2AgQgCEF/aiEIQQEhBwwBCyAGQQAgDCAHQRB0QRB1ShshBgsgCiANaiAHOwEAIAJBAWohAgwBCwsgACAFNgIEIAAgBjYCACAJQQN2IAlBAXZqQQNqIQxBACEAQQAhBkEAIQIDQCAGIA5GBEADQAJAIAAgCUYNACAKIAsgAEEDdGoiASgCBCIGQQF0aiICIAIvAQAiAkEBajsBACABIAUgAhAUayIIOgADIAEgAiAIQf8BcXQgCWs7AQAgASAEIAZBAnQiAmooAgA6AAIgASACIANqKAIANgIEIABBAWohAAwBCwsFIAEgBkEBdGouAQAhDUEAIQcDQCAHIA1ORQRAIAsgAkEDdGogBjYCBANAIAIgDGogD3EiAiAISw0ACyAHQQFqIQcMAQsLIAZBAWohBgwBCwsgCkHwAGokAAsjAEIAIAEQCSAAhUKHla+vmLbem55/fkLj3MqV/M7y9YV/fAsQACAAQn43AwggACABNgIACyQBAX8gAARAIAEoAgQiAgRAIAEoAgggACACEQEADwsgABAmCwsfACAAIAEgAi8BABAINgIAIAEQBBogACACQQRqNgIEC0oBAX9BoCAoAgAiASAAaiIAQX9MBEBBiCBBMDYCAEF/DwsCQCAAPwBBEHRNDQAgABBmDQBBiCBBMDYCAEF/DwtBoCAgADYCACABC9cBAQh/Qbp/IQoCQCACKAIEIgggAigCACIJaiIOIAEgAGtLDQBBbCEKIAkgBCADKAIAIgtrSw0AIAAgCWoiBCACKAIIIgxrIQ0gACABQWBqIg8gCyAJQQAQKSADIAkgC2o2AgACQAJAIAwgBCAFa00EQCANIQUMAQsgDCAEIAZrSw0CIAcgDSAFayIAaiIBIAhqIAdNBEAgBCABIAgQDxoMAgsgBCABQQAgAGsQDyEBIAIgACAIaiIINgIEIAEgAGshBAsgBCAPIAUgCEEBECkLIA4hCgsgCgubAgEBfyMAQYABayINJAAgDSADNgJ8AkAgAkEDSwRAQX8hCQwBCwJAAkACQAJAIAJBAWsOAwADAgELIAZFBEBBuH8hCQwEC0FsIQkgBS0AACICIANLDQMgACAHIAJBAnQiAmooAgAgAiAIaigCABA7IAEgADYCAEEBIQkMAwsgASAJNgIAQQAhCQwCCyAKRQRAQWwhCQwCC0EAIQkgC0UgDEEZSHINAUEIIAR0QQhqIQBBACECA0AgAiAATw0CIAJBQGshAgwAAAsAC0FsIQkgDSANQfwAaiANQfgAaiAFIAYQFSICEAMNACANKAJ4IgMgBEsNACAAIA0gDSgCfCAHIAggAxAYIAEgADYCACACIQkLIA1BgAFqJAAgCQsLACAAIAEgAhALGgsQACAALwAAIAAtAAJBEHRyCy8AAn9BuH8gAUEISQ0AGkFyIAAoAAQiAEF3Sw0AGkG4fyAAQQhqIgAgACABSxsLCwkAIAAgATsAAAsDAAELigYBBX8gACAAKAIAIgVBfnE2AgBBACAAIAVBAXZqQYQgKAIAIgQgAEYbIQECQAJAIAAoAgQiAkUNACACKAIAIgNBAXENACACQQhqIgUgA0EBdkF4aiIDQQggA0EISxtnQR9zQQJ0QYAfaiIDKAIARgRAIAMgAigCDDYCAAsgAigCCCIDBEAgAyACKAIMNgIECyACKAIMIgMEQCADIAIoAgg2AgALIAIgAigCACAAKAIAQX5xajYCAEGEICEAAkACQCABRQ0AIAEgAjYCBCABKAIAIgNBAXENASADQQF2QXhqIgNBCCADQQhLG2dBH3NBAnRBgB9qIgMoAgAgAUEIakYEQCADIAEoAgw2AgALIAEoAggiAwRAIAMgASgCDDYCBAsgASgCDCIDBEAgAyABKAIINgIAQYQgKAIAIQQLIAIgAigCACABKAIAQX5xajYCACABIARGDQAgASABKAIAQQF2akEEaiEACyAAIAI2AgALIAIoAgBBAXZBeGoiAEEIIABBCEsbZ0Efc0ECdEGAH2oiASgCACEAIAEgBTYCACACIAA2AgwgAkEANgIIIABFDQEgACAFNgIADwsCQCABRQ0AIAEoAgAiAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAigCACABQQhqRgRAIAIgASgCDDYCAAsgASgCCCICBEAgAiABKAIMNgIECyABKAIMIgIEQCACIAEoAgg2AgBBhCAoAgAhBAsgACAAKAIAIAEoAgBBfnFqIgI2AgACQCABIARHBEAgASABKAIAQQF2aiAANgIEIAAoAgAhAgwBC0GEICAANgIACyACQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgIoAgAhASACIABBCGoiAjYCACAAIAE2AgwgAEEANgIIIAFFDQEgASACNgIADwsgBUEBdkF4aiIBQQggAUEISxtnQR9zQQJ0QYAfaiICKAIAIQEgAiAAQQhqIgI2AgAgACABNgIMIABBADYCCCABRQ0AIAEgAjYCAAsLDgAgAARAIABBeGoQJQsLgAIBA38CQCAAQQ9qQXhxQYQgKAIAKAIAQQF2ayICEB1Bf0YNAAJAQYQgKAIAIgAoAgAiAUEBcQ0AIAFBAXZBeGoiAUEIIAFBCEsbZ0Efc0ECdEGAH2oiASgCACAAQQhqRgRAIAEgACgCDDYCAAsgACgCCCIBBEAgASAAKAIMNgIECyAAKAIMIgFFDQAgASAAKAIINgIAC0EBIQEgACAAKAIAIAJBAXRqIgI2AgAgAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAygCACECIAMgAEEIaiIDNgIAIAAgAjYCDCAAQQA2AgggAkUNACACIAM2AgALIAELtwIBA38CQAJAIABBASAAGyICEDgiAA0AAkACQEGEICgCACIARQ0AIAAoAgAiA0EBcQ0AIAAgA0EBcjYCACADQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgAgAEEIakYEQCABIAAoAgw2AgALIAAoAggiAQRAIAEgACgCDDYCBAsgACgCDCIBBEAgASAAKAIINgIACyACECchAkEAIQFBhCAoAgAhACACDQEgACAAKAIAQX5xNgIAQQAPCyACQQ9qQXhxIgMQHSICQX9GDQIgAkEHakF4cSIAIAJHBEAgACACaxAdQX9GDQMLAkBBhCAoAgAiAUUEQEGAICAANgIADAELIAAgATYCBAtBhCAgADYCACAAIANBAXRBAXI2AgAMAQsgAEUNAQsgAEEIaiEBCyABC7kDAQJ/IAAgA2ohBQJAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAFNBH8gACACakF/ai0AACIAQQNxQQJ0QaAeaigCACACaiAAQQZ2IgFBAnRBsB5qKAIAaiAAQSBxIgBFaiABRSAAQQV2cWoFQbh/CwsdACAAKAKQ4gEQWiAAQQA2AqDiASAAQgA3A5DiAQu1AwEFfyMAQZACayIKJABBuH8hBgJAIAVFDQAgBCwAACIIQf8BcSEHAkAgCEF/TARAIAdBgn9qQQF2IgggBU8NAkFsIQYgB0GBf2oiBUGAAk8NAiAEQQFqIQdBACEGA0AgBiAFTwRAIAUhBiAIIQcMAwUgACAGaiAHIAZBAXZqIgQtAABBBHY6AAAgACAGQQFyaiAELQAAQQ9xOgAAIAZBAmohBgwBCwAACwALIAcgBU8NASAAIARBAWogByAKEFMiBhADDQELIAYhBEEAIQYgAUEAQTQQECEJQQAhBQNAIAQgBkcEQCAAIAZqIggtAAAiAUELSwRAQWwhBgwDBSAJIAFBAnRqIgEgASgCAEEBajYCACAGQQFqIQZBASAILQAAdEEBdSAFaiEFDAILAAsLQWwhBiAFRQ0AIAUQFEEBaiIBQQxLDQAgAyABNgIAQQFBASABdCAFayIDEBQiAXQgA0cNACAAIARqIAFBAWoiADoAACAJIABBAnRqIgAgACgCAEEBajYCACAJKAIEIgBBAkkgAEEBcXINACACIARBAWo2AgAgB0EBaiEGCyAKQZACaiQAIAYLxhEBDH8jAEHwAGsiBSQAQWwhCwJAIANBCkkNACACLwAAIQogAi8AAiEJIAIvAAQhByAFQQhqIAQQDgJAIAMgByAJIApqakEGaiIMSQ0AIAUtAAohCCAFQdgAaiACQQZqIgIgChAGIgsQAw0BIAVBQGsgAiAKaiICIAkQBiILEAMNASAFQShqIAIgCWoiAiAHEAYiCxADDQEgBUEQaiACIAdqIAMgDGsQBiILEAMNASAAIAFqIg9BfWohECAEQQRqIQZBASELIAAgAUEDakECdiIDaiIMIANqIgIgA2oiDiEDIAIhBCAMIQcDQCALIAMgEElxBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgCS0AAyELIAcgBiAFQUBrIAgQAkECdGoiCS8BADsAACAFQUBrIAktAAIQASAJLQADIQogBCAGIAVBKGogCBACQQJ0aiIJLwEAOwAAIAVBKGogCS0AAhABIAktAAMhCSADIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgDS0AAyENIAAgC2oiCyAGIAVB2ABqIAgQAkECdGoiAC8BADsAACAFQdgAaiAALQACEAEgAC0AAyEAIAcgCmoiCiAGIAVBQGsgCBACQQJ0aiIHLwEAOwAAIAVBQGsgBy0AAhABIActAAMhByAEIAlqIgkgBiAFQShqIAgQAkECdGoiBC8BADsAACAFQShqIAQtAAIQASAELQADIQQgAyANaiIDIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgACALaiEAIAcgCmohByAEIAlqIQQgAyANLQADaiEDIAVB2ABqEA0gBUFAaxANciAFQShqEA1yIAVBEGoQDXJFIQsMAQsLIAQgDksgByACS3INAEFsIQsgACAMSw0BIAxBfWohCQNAQQAgACAJSSAFQdgAahAEGwRAIAAgBiAFQdgAaiAIEAJBAnRqIgovAQA7AAAgBUHYAGogCi0AAhABIAAgCi0AA2oiACAGIAVB2ABqIAgQAkECdGoiCi8BADsAACAFQdgAaiAKLQACEAEgACAKLQADaiEADAEFIAxBfmohCgNAIAVB2ABqEAQgACAKS3JFBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgACAJLQADaiEADAELCwNAIAAgCk0EQCAAIAYgBUHYAGogCBACQQJ0aiIJLwEAOwAAIAVB2ABqIAktAAIQASAAIAktAANqIQAMAQsLAkAgACAMTw0AIAAgBiAFQdgAaiAIEAIiAEECdGoiDC0AADoAACAMLQADQQFGBEAgBUHYAGogDC0AAhABDAELIAUoAlxBH0sNACAFQdgAaiAGIABBAnRqLQACEAEgBSgCXEEhSQ0AIAVBIDYCXAsgAkF9aiEMA0BBACAHIAxJIAVBQGsQBBsEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiIAIAYgBUFAayAIEAJBAnRqIgcvAQA7AAAgBUFAayAHLQACEAEgACAHLQADaiEHDAEFIAJBfmohDANAIAVBQGsQBCAHIAxLckUEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwNAIAcgDE0EQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwJAIAcgAk8NACAHIAYgBUFAayAIEAIiAEECdGoiAi0AADoAACACLQADQQFGBEAgBUFAayACLQACEAEMAQsgBSgCREEfSw0AIAVBQGsgBiAAQQJ0ai0AAhABIAUoAkRBIUkNACAFQSA2AkQLIA5BfWohAgNAQQAgBCACSSAFQShqEAQbBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2oiACAGIAVBKGogCBACQQJ0aiIELwEAOwAAIAVBKGogBC0AAhABIAAgBC0AA2ohBAwBBSAOQX5qIQIDQCAFQShqEAQgBCACS3JFBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsDQCAEIAJNBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsCQCAEIA5PDQAgBCAGIAVBKGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBKGogAi0AAhABDAELIAUoAixBH0sNACAFQShqIAYgAEECdGotAAIQASAFKAIsQSFJDQAgBUEgNgIsCwNAQQAgAyAQSSAFQRBqEAQbBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2oiACAGIAVBEGogCBACQQJ0aiICLwEAOwAAIAVBEGogAi0AAhABIAAgAi0AA2ohAwwBBSAPQX5qIQIDQCAFQRBqEAQgAyACS3JFBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsDQCADIAJNBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsCQCADIA9PDQAgAyAGIAVBEGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBEGogAi0AAhABDAELIAUoAhRBH0sNACAFQRBqIAYgAEECdGotAAIQASAFKAIUQSFJDQAgBUEgNgIUCyABQWwgBUHYAGoQCiAFQUBrEApxIAVBKGoQCnEgBUEQahAKcRshCwwJCwAACwALAAALAAsAAAsACwAACwALQWwhCwsgBUHwAGokACALC7UEAQ5/IwBBEGsiBiQAIAZBBGogABAOQVQhBQJAIARB3AtJDQAgBi0ABCEHIANB8ARqQQBB7AAQECEIIAdBDEsNACADQdwJaiIJIAggBkEIaiAGQQxqIAEgAhAxIhAQA0UEQCAGKAIMIgQgB0sNASADQdwFaiEPIANBpAVqIREgAEEEaiESIANBqAVqIQEgBCEFA0AgBSICQX9qIQUgCCACQQJ0aigCAEUNAAsgAkEBaiEOQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgASALaiAKNgIAIAVBAWohBSAKIAxqIQoMAQsLIAEgCjYCAEEAIQUgBigCCCELA0AgBSALRkUEQCABIAUgCWotAAAiDEECdGoiDSANKAIAIg1BAWo2AgAgDyANQQF0aiINIAw6AAEgDSAFOgAAIAVBAWohBQwBCwtBACEBIANBADYCqAUgBEF/cyAHaiEJQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgAyALaiABNgIAIAwgBSAJanQgAWohASAFQQFqIQUMAQsLIAcgBEEBaiIBIAJrIgRrQQFqIQgDQEEBIQUgBCAIT0UEQANAIAUgDk9FBEAgBUECdCIJIAMgBEE0bGpqIAMgCWooAgAgBHY2AgAgBUEBaiEFDAELCyAEQQFqIQQMAQsLIBIgByAPIAogESADIAIgARBkIAZBAToABSAGIAc6AAYgACAGKAIENgIACyAQIQULIAZBEGokACAFC8ENAQt/IwBB8ABrIgUkAEFsIQkCQCADQQpJDQAgAi8AACEKIAIvAAIhDCACLwAEIQYgBUEIaiAEEA4CQCADIAYgCiAMampBBmoiDUkNACAFLQAKIQcgBUHYAGogAkEGaiICIAoQBiIJEAMNASAFQUBrIAIgCmoiAiAMEAYiCRADDQEgBUEoaiACIAxqIgIgBhAGIgkQAw0BIAVBEGogAiAGaiADIA1rEAYiCRADDQEgACABaiIOQX1qIQ8gBEEEaiEGQQEhCSAAIAFBA2pBAnYiAmoiCiACaiIMIAJqIg0hAyAMIQQgCiECA0AgCSADIA9JcQRAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAACAGIAVBQGsgBxACQQF0aiIILQAAIQsgBUFAayAILQABEAEgAiALOgAAIAYgBUEoaiAHEAJBAXRqIggtAAAhCyAFQShqIAgtAAEQASAEIAs6AAAgBiAFQRBqIAcQAkEBdGoiCC0AACELIAVBEGogCC0AARABIAMgCzoAACAGIAVB2ABqIAcQAkEBdGoiCC0AACELIAVB2ABqIAgtAAEQASAAIAs6AAEgBiAFQUBrIAcQAkEBdGoiCC0AACELIAVBQGsgCC0AARABIAIgCzoAASAGIAVBKGogBxACQQF0aiIILQAAIQsgBUEoaiAILQABEAEgBCALOgABIAYgBUEQaiAHEAJBAXRqIggtAAAhCyAFQRBqIAgtAAEQASADIAs6AAEgA0ECaiEDIARBAmohBCACQQJqIQIgAEECaiEAIAkgBUHYAGoQDUVxIAVBQGsQDUVxIAVBKGoQDUVxIAVBEGoQDUVxIQkMAQsLIAQgDUsgAiAMS3INAEFsIQkgACAKSw0BIApBfWohCQNAIAVB2ABqEAQgACAJT3JFBEAgBiAFQdgAaiAHEAJBAXRqIggtAAAhCyAFQdgAaiAILQABEAEgACALOgAAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAASAAQQJqIQAMAQsLA0AgBUHYAGoQBCAAIApPckUEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCwNAIAAgCkkEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCyAMQX1qIQADQCAFQUBrEAQgAiAAT3JFBEAgBiAFQUBrIAcQAkEBdGoiCi0AACEJIAVBQGsgCi0AARABIAIgCToAACAGIAVBQGsgBxACQQF0aiIKLQAAIQkgBUFAayAKLQABEAEgAiAJOgABIAJBAmohAgwBCwsDQCAFQUBrEAQgAiAMT3JFBEAgBiAFQUBrIAcQAkEBdGoiAC0AACEKIAVBQGsgAC0AARABIAIgCjoAACACQQFqIQIMAQsLA0AgAiAMSQRAIAYgBUFAayAHEAJBAXRqIgAtAAAhCiAFQUBrIAAtAAEQASACIAo6AAAgAkEBaiECDAELCyANQX1qIQADQCAFQShqEAQgBCAAT3JFBEAgBiAFQShqIAcQAkEBdGoiAi0AACEKIAVBKGogAi0AARABIAQgCjoAACAGIAVBKGogBxACQQF0aiICLQAAIQogBUEoaiACLQABEAEgBCAKOgABIARBAmohBAwBCwsDQCAFQShqEAQgBCANT3JFBEAgBiAFQShqIAcQAkEBdGoiAC0AACECIAVBKGogAC0AARABIAQgAjoAACAEQQFqIQQMAQsLA0AgBCANSQRAIAYgBUEoaiAHEAJBAXRqIgAtAAAhAiAFQShqIAAtAAEQASAEIAI6AAAgBEEBaiEEDAELCwNAIAVBEGoQBCADIA9PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIAYgBUEQaiAHEAJBAXRqIgAtAAAhAiAFQRBqIAAtAAEQASADIAI6AAEgA0ECaiEDDAELCwNAIAVBEGoQBCADIA5PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIANBAWohAwwBCwsDQCADIA5JBEAgBiAFQRBqIAcQAkEBdGoiAC0AACECIAVBEGogAC0AARABIAMgAjoAACADQQFqIQMMAQsLIAFBbCAFQdgAahAKIAVBQGsQCnEgBUEoahAKcSAFQRBqEApxGyEJDAELQWwhCQsgBUHwAGokACAJC8oCAQR/IwBBIGsiBSQAIAUgBBAOIAUtAAIhByAFQQhqIAIgAxAGIgIQA0UEQCAEQQRqIQIgACABaiIDQX1qIQQDQCAFQQhqEAQgACAET3JFBEAgAiAFQQhqIAcQAkEBdGoiBi0AACEIIAVBCGogBi0AARABIAAgCDoAACACIAVBCGogBxACQQF0aiIGLQAAIQggBUEIaiAGLQABEAEgACAIOgABIABBAmohAAwBCwsDQCAFQQhqEAQgACADT3JFBEAgAiAFQQhqIAcQAkEBdGoiBC0AACEGIAVBCGogBC0AARABIAAgBjoAACAAQQFqIQAMAQsLA0AgACADT0UEQCACIAVBCGogBxACQQF0aiIELQAAIQYgBUEIaiAELQABEAEgACAGOgAAIABBAWohAAwBCwsgAUFsIAVBCGoQChshAgsgBUEgaiQAIAILtgMBCX8jAEEQayIGJAAgBkEANgIMIAZBADYCCEFUIQQCQAJAIANBQGsiDCADIAZBCGogBkEMaiABIAIQMSICEAMNACAGQQRqIAAQDiAGKAIMIgcgBi0ABEEBaksNASAAQQRqIQogBkEAOgAFIAYgBzoABiAAIAYoAgQ2AgAgB0EBaiEJQQEhBANAIAQgCUkEQCADIARBAnRqIgEoAgAhACABIAU2AgAgACAEQX9qdCAFaiEFIARBAWohBAwBCwsgB0EBaiEHQQAhBSAGKAIIIQkDQCAFIAlGDQEgAyAFIAxqLQAAIgRBAnRqIgBBASAEdEEBdSILIAAoAgAiAWoiADYCACAHIARrIQhBACEEAkAgC0EDTQRAA0AgBCALRg0CIAogASAEakEBdGoiACAIOgABIAAgBToAACAEQQFqIQQMAAALAAsDQCABIABPDQEgCiABQQF0aiIEIAg6AAEgBCAFOgAAIAQgCDoAAyAEIAU6AAIgBCAIOgAFIAQgBToABCAEIAg6AAcgBCAFOgAGIAFBBGohAQwAAAsACyAFQQFqIQUMAAALAAsgAiEECyAGQRBqJAAgBAutAQECfwJAQYQgKAIAIABHIAAoAgBBAXYiAyABa0F4aiICQXhxQQhHcgR/IAIFIAMQJ0UNASACQQhqC0EQSQ0AIAAgACgCACICQQFxIAAgAWpBD2pBeHEiASAAa0EBdHI2AgAgASAANgIEIAEgASgCAEEBcSAAIAJBAXZqIAFrIgJBAXRyNgIAQYQgIAEgAkH/////B3FqQQRqQYQgKAIAIABGGyABNgIAIAEQJQsLygIBBX8CQAJAAkAgAEEIIABBCEsbZ0EfcyAAaUEBR2oiAUEESSAAIAF2cg0AIAFBAnRB/B5qKAIAIgJFDQADQCACQXhqIgMoAgBBAXZBeGoiBSAATwRAIAIgBUEIIAVBCEsbZ0Efc0ECdEGAH2oiASgCAEYEQCABIAIoAgQ2AgALDAMLIARBHksNASAEQQFqIQQgAigCBCICDQALC0EAIQMgAUEgTw0BA0AgAUECdEGAH2ooAgAiAkUEQCABQR5LIQIgAUEBaiEBIAJFDQEMAwsLIAIgAkF4aiIDKAIAQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgBGBEAgASACKAIENgIACwsgAigCACIBBEAgASACKAIENgIECyACKAIEIgEEQCABIAIoAgA2AgALIAMgAygCAEEBcjYCACADIAAQNwsgAwvhCwINfwV+IwBB8ABrIgckACAHIAAoAvDhASIINgJcIAEgAmohDSAIIAAoAoDiAWohDwJAAkAgBUUEQCABIQQMAQsgACgCxOABIRAgACgCwOABIREgACgCvOABIQ4gAEEBNgKM4QFBACEIA0AgCEEDRwRAIAcgCEECdCICaiAAIAJqQazQAWooAgA2AkQgCEEBaiEIDAELC0FsIQwgB0EYaiADIAQQBhADDQEgB0EsaiAHQRhqIAAoAgAQEyAHQTRqIAdBGGogACgCCBATIAdBPGogB0EYaiAAKAIEEBMgDUFgaiESIAEhBEEAIQwDQCAHKAIwIAcoAixBA3RqKQIAIhRCEIinQf8BcSEIIAcoAkAgBygCPEEDdGopAgAiFUIQiKdB/wFxIQsgBygCOCAHKAI0QQN0aikCACIWQiCIpyEJIBVCIIghFyAUQiCIpyECAkAgFkIQiKdB/wFxIgNBAk8EQAJAIAZFIANBGUlyRQRAIAkgB0EYaiADQSAgBygCHGsiCiAKIANLGyIKEAUgAyAKayIDdGohCSAHQRhqEAQaIANFDQEgB0EYaiADEAUgCWohCQwBCyAHQRhqIAMQBSAJaiEJIAdBGGoQBBoLIAcpAkQhGCAHIAk2AkQgByAYNwNIDAELAkAgA0UEQCACBEAgBygCRCEJDAMLIAcoAkghCQwBCwJAAkAgB0EYakEBEAUgCSACRWpqIgNBA0YEQCAHKAJEQX9qIgMgA0VqIQkMAQsgA0ECdCAHaigCRCIJIAlFaiEJIANBAUYNAQsgByAHKAJINgJMCwsgByAHKAJENgJIIAcgCTYCRAsgF6chAyALBEAgB0EYaiALEAUgA2ohAwsgCCALakEUTwRAIAdBGGoQBBoLIAgEQCAHQRhqIAgQBSACaiECCyAHQRhqEAQaIAcgB0EYaiAUQhiIp0H/AXEQCCAUp0H//wNxajYCLCAHIAdBGGogFUIYiKdB/wFxEAggFadB//8DcWo2AjwgB0EYahAEGiAHIAdBGGogFkIYiKdB/wFxEAggFqdB//8DcWo2AjQgByACNgJgIAcoAlwhCiAHIAk2AmggByADNgJkAkACQAJAIAQgAiADaiILaiASSw0AIAIgCmoiEyAPSw0AIA0gBGsgC0Egak8NAQsgByAHKQNoNwMQIAcgBykDYDcDCCAEIA0gB0EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgHUIgiKchAgJAIB9CEIinQf8BcSIDQQJPBEACQCAGRSADQRlJckUEQCAIIAdBKGogA0EgIAcoAixrIg0gDSADSxsiDRAFIAMgDWsiA3RqIQggB0EoahAEGiADRQ0BIAdBKGogAxAFIAhqIQgMAQsgB0EoaiADEAUgCGohCCAHQShqEAQaCyAHKQJUISEgByAINgJUIAcgITcDWAwBCwJAIANFBEAgAgRAIAcoAlQhCAwDCyAHKAJYIQgMAQsCQAJAIAdBKGpBARAFIAggAkVqaiIDQQNGBEAgBygCVEF/aiIDIANFaiEIDAELIANBAnQgB2ooAlQiCCAIRWohCCADQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAg2AlQLICCnIQMgCQRAIAdBKGogCRAFIANqIQMLIAkgC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgAmohAgsgB0EoahAEGiAHIAcoAmggAmoiCSADajYCaCAKIAwgCCAJSxsoAgAhDSAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogB0EoaiAfQhiIp0H/AXEQCCEOIAdB8ABqIARBBHRqIgsgCSANaiAIazYCDCALIAg2AgggCyADNgIEIAsgAjYCACAHIA4gH6dB//8DcWo2AkQgBEEBaiEEDAELCyAEIBdIDQEgEkFgaiEYIAdB4ABqIRogB0HkAGohGyABIQMDQCAHQShqEARBAksgBCAFTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEIIAcoAkggBygCREEDdGopAgAiH0IgiKchCSAeQiCIISAgHUIgiKchDAJAIB9CEIinQf8BcSICQQJPBEACQCAGRSACQRlJckUEQCAJIAdBKGogAkEgIAcoAixrIgogCiACSxsiChAFIAIgCmsiAnRqIQkgB0EoahAEGiACRQ0BIAdBKGogAhAFIAlqIQkMAQsgB0EoaiACEAUgCWohCSAHQShqEAQaCyAHKQJUISEgByAJNgJUIAcgITcDWAwBCwJAIAJFBEAgDARAIAcoAlQhCQwDCyAHKAJYIQkMAQsCQAJAIAdBKGpBARAFIAkgDEVqaiICQQNGBEAgBygCVEF/aiICIAJFaiEJDAELIAJBAnQgB2ooAlQiCSAJRWohCSACQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAk2AlQLICCnIRQgCARAIAdBKGogCBAFIBRqIRQLIAggC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgDGohDAsgB0EoahAEGiAHIAcoAmggDGoiGSAUajYCaCAbIBogCSAZSxsoAgAhHCAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogByAHQShqIB9CGIinQf8BcRAIIB+nQf//A3FqNgJEIAcgB0HwAGogBEEDcUEEdGoiDSkDCCIdNwPIASAHIA0pAwAiHjcDwAECQAJAAkAgBygCvAEiDiAepyICaiIWIBNLDQAgAyAHKALEASIKIAJqIgtqIBhLDQAgEiADayALQSBqTw0BCyAHIAcpA8gBNwMQIAcgBykDwAE3AwggAyASIAdBCGogB0G8AWogEyAPIBUgERAeIQsMAQsgAiADaiEIIAMgDhAHIAJBEU8EQCADQRBqIQIDQCACIA5BEGoiDhAHIAJBEGoiAiAISQ0ACwsgCCAdpyIOayECIAcgFjYCvAEgDiAIIA9rSwRAIA4gCCAVa0sEQEFsIQsMAgsgESACIA9rIgJqIhYgCmogEU0EQCAIIBYgChAPGgwCCyAIIBZBACACaxAPIQggByACIApqIgo2AsQBIAggAmshCCAPIQILIA5BEE8EQCAIIApqIQoDQCAIIAIQByACQRBqIQIgCEEQaiIIIApJDQALDAELAkAgDkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgDkECdCIKQcAeaigCAGoiAhAXIAIgCkHgHmooAgBrIQIgBygCxAEhCgwBCyAIIAIQDAsgCkEJSQ0AIAggCmohCiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAKSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAKSQ0ACwsgCxADBEAgCyEQDAQFIA0gDDYCACANIBkgHGogCWs2AgwgDSAJNgIIIA0gFDYCBCAEQQFqIQQgAyALaiEDDAILAAsLIAQgBUgNASAEIBdrIQtBACEEA0AgCyAFSARAIAcgB0HwAGogC0EDcUEEdGoiAikDCCIdNwPIASAHIAIpAwAiHjcDwAECQAJAAkAgBygCvAEiDCAepyICaiIKIBNLDQAgAyAHKALEASIJIAJqIhBqIBhLDQAgEiADayAQQSBqTw0BCyAHIAcpA8gBNwMgIAcgBykDwAE3AxggAyASIAdBGGogB0G8AWogEyAPIBUgERAeIRAMAQsgAiADaiEIIAMgDBAHIAJBEU8EQCADQRBqIQIDQCACIAxBEGoiDBAHIAJBEGoiAiAISQ0ACwsgCCAdpyIGayECIAcgCjYCvAEgBiAIIA9rSwRAIAYgCCAVa0sEQEFsIRAMAgsgESACIA9rIgJqIgwgCWogEU0EQCAIIAwgCRAPGgwCCyAIIAxBACACaxAPIQggByACIAlqIgk2AsQBIAggAmshCCAPIQILIAZBEE8EQCAIIAlqIQYDQCAIIAIQByACQRBqIQIgCEEQaiIIIAZJDQALDAELAkAgBkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgBkECdCIGQcAeaigCAGoiAhAXIAIgBkHgHmooAgBrIQIgBygCxAEhCQwBCyAIIAIQDAsgCUEJSQ0AIAggCWohBiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAGSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAGSQ0ACwsgEBADDQMgC0EBaiELIAMgEGohAwwBCwsDQCAEQQNHBEAgACAEQQJ0IgJqQazQAWogAiAHaigCVDYCACAEQQFqIQQMAQsLIAcoArwBIQgLQbp/IRAgEyAIayIAIBIgA2tLDQAgAwR/IAMgCCAAEAsgAGoFQQALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY0AAQMyIFEAMiBg0AIANBHzYCfCADIANB/ABqIANB+ABqIAQgBCAFaiAGGyIEIAEgAmoiAiAEaxAVIgUQAw0AIAMoAnwiBkEfSw0AIAMoAngiB0EJTw0AIABBiCBqIAMgBkGAC0GADCAHEBggA0E0NgJ8IAMgA0H8AGogA0H4AGogBCAFaiIEIAIgBGsQFSIFEAMNACADKAJ8IgZBNEsNACADKAJ4IgdBCk8NACAAQZAwaiADIAZBgA1B4A4gBxAYIANBIzYCfCADIANB/ABqIANB+ABqIAQgBWoiBCACIARrEBUiBRADDQAgAygCfCIGQSNLDQAgAygCeCIHQQpPDQAgACADIAZBwBBB0BEgBxAYIAQgBWoiBEEMaiIFIAJLDQAgAiAFayEFQQAhAgNAIAJBA0cEQCAEKAAAIgZBf2ogBU8NAiAAIAJBAnRqQZzQAWogBjYCACACQQFqIQIgBEEEaiEEDAELCyAEIAFrIQgLIANBgAFqJAAgCAtGAQN/IABBCGohAyAAKAIEIQJBACEAA0AgACACdkUEQCABIAMgAEEDdGotAAJBFktqIQEgAEEBaiEADAELCyABQQggAmt0C4YDAQV/Qbh/IQcCQCADRQ0AIAItAAAiBEUEQCABQQA2AgBBAUG4fyADQQFGGw8LAn8gAkEBaiIFIARBGHRBGHUiBkF/Sg0AGiAGQX9GBEAgA0EDSA0CIAUvAABBgP4BaiEEIAJBA2oMAQsgA0ECSA0BIAItAAEgBEEIdHJBgIB+aiEEIAJBAmoLIQUgASAENgIAIAVBAWoiASACIANqIgNLDQBBbCEHIABBEGogACAFLQAAIgVBBnZBI0EJIAEgAyABa0HAEEHQEUHwEiAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBmCBqIABBCGogBUEEdkEDcUEfQQggASABIAZqIAgbIgEgAyABa0GAC0GADEGAFyAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBoDBqIABBBGogBUECdkEDcUE0QQkgASABIAZqIAgbIgEgAyABa0GADUHgDkGQGSAAKAKM4QEgACgCnOIBIAQQHyIAEAMNACAAIAFqIAJrIQcLIAcLrQMBCn8jAEGABGsiCCQAAn9BUiACQf8BSw0AGkFUIANBDEsNABogAkEBaiELIABBBGohCUGAgAQgA0F/anRBEHUhCkEAIQJBASEEQQEgA3QiB0F/aiIMIQUDQCACIAtGRQRAAkAgASACQQF0Ig1qLwEAIgZB//8DRgRAIAkgBUECdGogAjoAAiAFQX9qIQVBASEGDAELIARBACAKIAZBEHRBEHVKGyEECyAIIA1qIAY7AQAgAkEBaiECDAELCyAAIAQ7AQIgACADOwEAIAdBA3YgB0EBdmpBA2ohBkEAIQRBACECA0AgBCALRkUEQCABIARBAXRqLgEAIQpBACEAA0AgACAKTkUEQCAJIAJBAnRqIAQ6AAIDQCACIAZqIAxxIgIgBUsNAAsgAEEBaiEADAELCyAEQQFqIQQMAQsLQX8gAg0AGkEAIQIDfyACIAdGBH9BAAUgCCAJIAJBAnRqIgAtAAJBAXRqIgEgAS8BACIBQQFqOwEAIAAgAyABEBRrIgU6AAMgACABIAVB/wFxdCAHazsBACACQQFqIQIMAQsLCyEFIAhBgARqJAAgBQvjBgEIf0FsIQcCQCACQQNJDQACQAJAAkACQCABLQAAIgNBA3EiCUEBaw4DAwEAAgsgACgCiOEBDQBBYg8LIAJBBUkNAkEDIQYgASgAACEFAn8CQAJAIANBAnZBA3EiCEF+aiIEQQFNBEAgBEEBaw0BDAILIAVBDnZB/wdxIQQgBUEEdkH/B3EhAyAIRQwCCyAFQRJ2IQRBBCEGIAVBBHZB//8AcSEDQQAMAQsgBUEEdkH//w9xIgNBgIAISw0DIAEtAARBCnQgBUEWdnIhBEEFIQZBAAshBSAEIAZqIgogAksNAgJAIANBgQZJDQAgACgCnOIBRQ0AQQAhAgNAIAJBg4ABSw0BIAJBQGshAgwAAAsACwJ/IAlBA0YEQCABIAZqIQEgAEHw4gFqIQIgACgCDCEGIAUEQCACIAMgASAEIAYQXwwCCyACIAMgASAEIAYQXQwBCyAAQbjQAWohAiABIAZqIQEgAEHw4gFqIQYgAEGo0ABqIQggBQRAIAggBiADIAEgBCACEF4MAQsgCCAGIAMgASAEIAIQXAsQAw0CIAAgAzYCgOIBIABBATYCiOEBIAAgAEHw4gFqNgLw4QEgCUECRgRAIAAgAEGo0ABqNgIMCyAAIANqIgBBiOMBakIANwAAIABBgOMBakIANwAAIABB+OIBakIANwAAIABB8OIBakIANwAAIAoPCwJ/AkACQAJAIANBAnZBA3FBf2oiBEECSw0AIARBAWsOAgACAQtBASEEIANBA3YMAgtBAiEEIAEvAABBBHYMAQtBAyEEIAEQIUEEdgsiAyAEaiIFQSBqIAJLBEAgBSACSw0CIABB8OIBaiABIARqIAMQCyEBIAAgAzYCgOIBIAAgATYC8OEBIAEgA2oiAEIANwAYIABCADcAECAAQgA3AAggAEIANwAAIAUPCyAAIAM2AoDiASAAIAEgBGo2AvDhASAFDwsCfwJAAkACQCADQQJ2QQNxQX9qIgRBAksNACAEQQFrDgIAAgELQQEhByADQQN2DAILQQIhByABLwAAQQR2DAELIAJBBEkgARAhIgJBj4CAAUtyDQFBAyEHIAJBBHYLIQIgAEHw4gFqIAEgB2otAAAgAkEgahAQIQEgACACNgKA4gEgACABNgLw4QEgB0EBaiEHCyAHC0sAIABC+erQ0OfJoeThADcDICAAQgA3AxggAELP1tO+0ser2UI3AxAgAELW64Lu6v2J9eAANwMIIABCADcDACAAQShqQQBBKBAQGgviAgICfwV+IABBKGoiASAAKAJIaiECAn4gACkDACIDQiBaBEAgACkDECIEQgeJIAApAwgiBUIBiXwgACkDGCIGQgyJfCAAKQMgIgdCEol8IAUQGSAEEBkgBhAZIAcQGQwBCyAAKQMYQsXP2bLx5brqJ3wLIAN8IQMDQCABQQhqIgAgAk0EQEIAIAEpAAAQCSADhUIbiUKHla+vmLbem55/fkLj3MqV/M7y9YV/fCEDIAAhAQwBCwsCQCABQQRqIgAgAksEQCABIQAMAQsgASgAAK1Ch5Wvr5i23puef34gA4VCF4lCz9bTvtLHq9lCfkL5893xmfaZqxZ8IQMLA0AgACACSQRAIAAxAABCxc/ZsvHluuonfiADhUILiUKHla+vmLbem55/fiEDIABBAWohAAwBCwsgA0IhiCADhULP1tO+0ser2UJ+IgNCHYggA4VC+fPd8Zn2masWfiIDQiCIIAOFC+8CAgJ/BH4gACAAKQMAIAKtfDcDAAJAAkAgACgCSCIDIAJqIgRBH00EQCABRQ0BIAAgA2pBKGogASACECAgACgCSCACaiEEDAELIAEgAmohAgJ/IAMEQCAAQShqIgQgA2ogAUEgIANrECAgACAAKQMIIAQpAAAQCTcDCCAAIAApAxAgACkAMBAJNwMQIAAgACkDGCAAKQA4EAk3AxggACAAKQMgIABBQGspAAAQCTcDICAAKAJIIQMgAEEANgJIIAEgA2tBIGohAQsgAUEgaiACTQsEQCACQWBqIQMgACkDICEFIAApAxghBiAAKQMQIQcgACkDCCEIA0AgCCABKQAAEAkhCCAHIAEpAAgQCSEHIAYgASkAEBAJIQYgBSABKQAYEAkhBSABQSBqIgEgA00NAAsgACAFNwMgIAAgBjcDGCAAIAc3AxAgACAINwMICyABIAJPDQEgAEEoaiABIAIgAWsiBBAgCyAAIAQ2AkgLCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQEBogAwVBun8LCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQCxogAwVBun8LC6gCAQZ/IwBBEGsiByQAIABB2OABaikDAEKAgIAQViEIQbh/IQUCQCAEQf//B0sNACAAIAMgBBBCIgUQAyIGDQAgACgCnOIBIQkgACAHQQxqIAMgAyAFaiAGGyIKIARBACAFIAYbayIGEEAiAxADBEAgAyEFDAELIAcoAgwhBCABRQRAQbp/IQUgBEEASg0BCyAGIANrIQUgAyAKaiEDAkAgCQRAIABBADYCnOIBDAELAkACQAJAIARBBUgNACAAQdjgAWopAwBCgICACFgNAAwBCyAAQQA2ApziAQwBCyAAKAIIED8hBiAAQQA2ApziASAGQRRPDQELIAAgASACIAMgBSAEIAgQOSEFDAELIAAgASACIAMgBSAEIAgQOiEFCyAHQRBqJAAgBQtnACAAQdDgAWogASACIAAoAuzhARAuIgEQAwRAIAEPC0G4fyECAkAgAQ0AIABB7OABaigCACIBBEBBYCECIAAoApjiASABRw0BC0EAIQIgAEHw4AFqKAIARQ0AIABBkOEBahBDCyACCycBAX8QVyIERQRAQUAPCyAEIAAgASACIAMgBBBLEE8hACAEEFYgAAs/AQF/AkACQAJAIAAoAqDiAUEBaiIBQQJLDQAgAUEBaw4CAAECCyAAEDBBAA8LIABBADYCoOIBCyAAKAKU4gELvAMCB38BfiMAQRBrIgkkAEG4fyEGAkAgBCgCACIIQQVBCSAAKALs4QEiBRtJDQAgAygCACIHQQFBBSAFGyAFEC8iBRADBEAgBSEGDAELIAggBUEDakkNACAAIAcgBRBJIgYQAw0AIAEgAmohCiAAQZDhAWohCyAIIAVrIQIgBSAHaiEHIAEhBQNAIAcgAiAJECwiBhADDQEgAkF9aiICIAZJBEBBuH8hBgwCCyAJKAIAIghBAksEQEFsIQYMAgsgB0EDaiEHAn8CQAJAAkAgCEEBaw4CAgABCyAAIAUgCiAFayAHIAYQSAwCCyAFIAogBWsgByAGEEcMAQsgBSAKIAVrIActAAAgCSgCCBBGCyIIEAMEQCAIIQYMAgsgACgC8OABBEAgCyAFIAgQRQsgAiAGayECIAYgB2ohByAFIAhqIQUgCSgCBEUNAAsgACkD0OABIgxCf1IEQEFsIQYgDCAFIAFrrFINAQsgACgC8OABBEBBaiEGIAJBBEkNASALEEQhDCAHKAAAIAynRw0BIAdBBGohByACQXxqIQILIAMgBzYCACAEIAI2AgAgBSABayEGCyAJQRBqJAAgBgsuACAAECsCf0EAQQAQAw0AGiABRSACRXJFBEBBYiAAIAEgAhA9EAMNARoLQQALCzcAIAEEQCAAIAAoAsTgASABKAIEIAEoAghqRzYCnOIBCyAAECtBABADIAFFckUEQCAAIAEQWwsL0QIBB38jAEEQayIGJAAgBiAENgIIIAYgAzYCDCAFBEAgBSgCBCEKIAUoAgghCQsgASEIAkACQANAIAAoAuzhARAWIQsCQANAIAQgC0kNASADKAAAQXBxQdDUtMIBRgRAIAMgBBAiIgcQAw0EIAQgB2shBCADIAdqIQMMAQsLIAYgAzYCDCAGIAQ2AggCQCAFBEAgACAFEE5BACEHQQAQA0UNAQwFCyAAIAogCRBNIgcQAw0ECyAAIAgQUCAMQQFHQQAgACAIIAIgBkEMaiAGQQhqEEwiByIDa0EAIAMQAxtBCkdyRQRAQbh/IQcMBAsgBxADDQMgAiAHayECIAcgCGohCEEBIQwgBigCDCEDIAYoAgghBAwBCwsgBiADNgIMIAYgBDYCCEG4fyEHIAQNASAIIAFrIQcMAQsgBiADNgIMIAYgBDYCCAsgBkEQaiQAIAcLRgECfyABIAAoArjgASICRwRAIAAgAjYCxOABIAAgATYCuOABIAAoArzgASEDIAAgATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEEdCAAbiECCyAAQQh2IgEgAkEYbCIAQYwIaigCAGwgAEGICGooAgBqIgJBA3YgAmogAEGACGooAgAgAEGECGooAgAgAWxqSQs3ACAAIAMgBCAFQYAQEDMiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQMgVBuH8LC78DAQN/IwBBIGsiBSQAIAVBCGogAiADEAYiAhADRQRAIAAgAWoiB0F9aiEGIAUgBBAOIARBBGohAiAFLQACIQMDQEEAIAAgBkkgBUEIahAEGwRAIAAgAiAFQQhqIAMQAkECdGoiBC8BADsAACAFQQhqIAQtAAIQASAAIAQtAANqIgQgAiAFQQhqIAMQAkECdGoiAC8BADsAACAFQQhqIAAtAAIQASAEIAAtAANqIQAMAQUgB0F+aiEEA0AgBUEIahAEIAAgBEtyRQRAIAAgAiAFQQhqIAMQAkECdGoiBi8BADsAACAFQQhqIAYtAAIQASAAIAYtAANqIQAMAQsLA0AgACAES0UEQCAAIAIgBUEIaiADEAJBAnRqIgYvAQA7AAAgBUEIaiAGLQACEAEgACAGLQADaiEADAELCwJAIAAgB08NACAAIAIgBUEIaiADEAIiA0ECdGoiAC0AADoAACAALQADQQFGBEAgBUEIaiAALQACEAEMAQsgBSgCDEEfSw0AIAVBCGogAiADQQJ0ai0AAhABIAUoAgxBIUkNACAFQSA2AgwLIAFBbCAFQQhqEAobIQILCwsgBUEgaiQAIAILkgIBBH8jAEFAaiIJJAAgCSADQTQQCyEDAkAgBEECSA0AIAMgBEECdGooAgAhCSADQTxqIAgQIyADQQE6AD8gAyACOgA+QQAhBCADKAI8IQoDQCAEIAlGDQEgACAEQQJ0aiAKNgEAIARBAWohBAwAAAsAC0EAIQkDQCAGIAlGRQRAIAMgBSAJQQF0aiIKLQABIgtBAnRqIgwoAgAhBCADQTxqIAotAABBCHQgCGpB//8DcRAjIANBAjoAPyADIAcgC2siCiACajoAPiAEQQEgASAKa3RqIQogAygCPCELA0AgACAEQQJ0aiALNgEAIARBAWoiBCAKSQ0ACyAMIAo2AgAgCUEBaiEJDAELCyADQUBrJAALowIBCX8jAEHQAGsiCSQAIAlBEGogBUE0EAsaIAcgBmshDyAHIAFrIRADQAJAIAMgCkcEQEEBIAEgByACIApBAXRqIgYtAAEiDGsiCGsiC3QhDSAGLQAAIQ4gCUEQaiAMQQJ0aiIMKAIAIQYgCyAPTwRAIAAgBkECdGogCyAIIAUgCEE0bGogCCAQaiIIQQEgCEEBShsiCCACIAQgCEECdGooAgAiCEEBdGogAyAIayAHIA4QYyAGIA1qIQgMAgsgCUEMaiAOECMgCUEBOgAPIAkgCDoADiAGIA1qIQggCSgCDCELA0AgBiAITw0CIAAgBkECdGogCzYBACAGQQFqIQYMAAALAAsgCUHQAGokAA8LIAwgCDYCACAKQQFqIQoMAAALAAs0ACAAIAMgBCAFEDYiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQNAVBuH8LCyMAIAA/AEEQdGtB//8DakEQdkAAQX9GBEBBAA8LQQAQAEEBCzsBAX8gAgRAA0AgACABIAJBgCAgAkGAIEkbIgMQCyEAIAFBgCBqIQEgAEGAIGohACACIANrIgINAAsLCwYAIAAQAwsLqBUJAEGICAsNAQAAAAEAAAACAAAAAgBBoAgLswYBAAAAAQAAAAIAAAACAAAAJgAAAIIAAAAhBQAASgAAAGcIAAAmAAAAwAEAAIAAAABJBQAASgAAAL4IAAApAAAALAIAAIAAAABJBQAASgAAAL4IAAAvAAAAygIAAIAAAACKBQAASgAAAIQJAAA1AAAAcwMAAIAAAACdBQAASgAAAKAJAAA9AAAAgQMAAIAAAADrBQAASwAAAD4KAABEAAAAngMAAIAAAABNBgAASwAAAKoKAABLAAAAswMAAIAAAADBBgAATQAAAB8NAABNAAAAUwQAAIAAAAAjCAAAUQAAAKYPAABUAAAAmQQAAIAAAABLCQAAVwAAALESAABYAAAA2gQAAIAAAABvCQAAXQAAACMUAABUAAAARQUAAIAAAABUCgAAagAAAIwUAABqAAAArwUAAIAAAAB2CQAAfAAAAE4QAAB8AAAA0gIAAIAAAABjBwAAkQAAAJAHAACSAAAAAAAAAAEAAAABAAAABQAAAA0AAAAdAAAAPQAAAH0AAAD9AAAA/QEAAP0DAAD9BwAA/Q8AAP0fAAD9PwAA/X8AAP3/AAD9/wEA/f8DAP3/BwD9/w8A/f8fAP3/PwD9/38A/f//AP3//wH9//8D/f//B/3//w/9//8f/f//P/3//38AAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABEAAAASAAAAEwAAABQAAAAVAAAAFgAAABcAAAAYAAAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAKAAAACwAAAAwAAAANAAAADgAAAA8AAAAQAAAAEQAAABIAAAATAAAAFAAAABUAAAAWAAAAFwAAABgAAAAZAAAAGgAAABsAAAAcAAAAHQAAAB4AAAAfAAAAIAAAACEAAAAiAAAAIwAAACUAAAAnAAAAKQAAACsAAAAvAAAAMwAAADsAAABDAAAAUwAAAGMAAACDAAAAAwEAAAMCAAADBAAAAwgAAAMQAAADIAAAA0AAAAOAAAADAAEAQeAPC1EBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAEAAAABQAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAABAAQcQQC4sBAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABIAAAAUAAAAFgAAABgAAAAcAAAAIAAAACgAAAAwAAAAQAAAAIAAAAAAAQAAAAIAAAAEAAAACAAAABAAAAAgAAAAQAAAAIAAAAAAAQBBkBIL5gQBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAAAEAAAAEAAAACAAAAAAAAAABAAEBBgAAAAAAAAQAAAAAEAAABAAAAAAgAAAFAQAAAAAAAAUDAAAAAAAABQQAAAAAAAAFBgAAAAAAAAUHAAAAAAAABQkAAAAAAAAFCgAAAAAAAAUMAAAAAAAABg4AAAAAAAEFEAAAAAAAAQUUAAAAAAABBRYAAAAAAAIFHAAAAAAAAwUgAAAAAAAEBTAAAAAgAAYFQAAAAAAABwWAAAAAAAAIBgABAAAAAAoGAAQAAAAADAYAEAAAIAAABAAAAAAAAAAEAQAAAAAAAAUCAAAAIAAABQQAAAAAAAAFBQAAACAAAAUHAAAAAAAABQgAAAAgAAAFCgAAAAAAAAULAAAAAAAABg0AAAAgAAEFEAAAAAAAAQUSAAAAIAABBRYAAAAAAAIFGAAAACAAAwUgAAAAAAADBSgAAAAAAAYEQAAAABAABgRAAAAAIAAHBYAAAAAAAAkGAAIAAAAACwYACAAAMAAABAAAAAAQAAAEAQAAACAAAAUCAAAAIAAABQMAAAAgAAAFBQAAACAAAAUGAAAAIAAABQgAAAAgAAAFCQAAACAAAAULAAAAIAAABQwAAAAAAAAGDwAAACAAAQUSAAAAIAABBRQAAAAgAAIFGAAAACAAAgUcAAAAIAADBSgAAAAgAAQFMAAAAAAAEAYAAAEAAAAPBgCAAAAAAA4GAEAAAAAADQYAIABBgBcLhwIBAAEBBQAAAAAAAAUAAAAAAAAGBD0AAAAAAAkF/QEAAAAADwX9fwAAAAAVBf3/HwAAAAMFBQAAAAAABwR9AAAAAAAMBf0PAAAAABIF/f8DAAAAFwX9/38AAAAFBR0AAAAAAAgE/QAAAAAADgX9PwAAAAAUBf3/DwAAAAIFAQAAABAABwR9AAAAAAALBf0HAAAAABEF/f8BAAAAFgX9/z8AAAAEBQ0AAAAQAAgE/QAAAAAADQX9HwAAAAATBf3/BwAAAAEFAQAAABAABgQ9AAAAAAAKBf0DAAAAABAF/f8AAAAAHAX9//8PAAAbBf3//wcAABoF/f//AwAAGQX9//8BAAAYBf3//wBBkBkLhgQBAAEBBgAAAAAAAAYDAAAAAAAABAQAAAAgAAAFBQAAAAAAAAUGAAAAAAAABQgAAAAAAAAFCQAAAAAAAAULAAAAAAAABg0AAAAAAAAGEAAAAAAAAAYTAAAAAAAABhYAAAAAAAAGGQAAAAAAAAYcAAAAAAAABh8AAAAAAAAGIgAAAAAAAQYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",pn=new WeakMap;let fn,mn=0;class gn extends n.Loader{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new Gr,this.workerSourceURL="",this.workerConfig=null,"undefined"!=typeof MSC_TRANSCODER&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(e){return this.transcoderPath=e,this}setWorkerLimit(e){return this.workerPool.setWorkerLimit(e),this}async detectSupportAsync(e){return this.workerConfig={astcSupported:await e.hasFeatureAsync("texture-compression-astc"),etc1Supported:await e.hasFeatureAsync("texture-compression-etc1"),etc2Supported:await e.hasFeatureAsync("texture-compression-etc2"),dxtSupported:await e.hasFeatureAsync("texture-compression-bc"),bptcSupported:await e.hasFeatureAsync("texture-compression-bptc"),pvrtcSupported:await e.hasFeatureAsync("texture-compression-pvrtc")},this}detectSupport(e){return!0===e.isWebGPURenderer?this.workerConfig={astcSupported:e.hasFeature("texture-compression-astc"),etc1Supported:e.hasFeature("texture-compression-etc1"),etc2Supported:e.hasFeature("texture-compression-etc2"),dxtSupported:e.hasFeature("texture-compression-bc"),bptcSupported:e.hasFeature("texture-compression-bptc"),pvrtcSupported:e.hasFeature("texture-compression-pvrtc")}:this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),etc1Supported:e.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:e.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:e.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:e.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:e.extensions.has("WEBGL_compressed_texture_pvrtc")||e.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},this}init(){if(!this.transcoderPending){const e=new n.FileLoader(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),r=new n.FileLoader(this.manager);r.setPath(this.transcoderPath),r.setResponseType("arraybuffer"),r.setWithCredentials(this.withCredentials);const i=r.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,i]).then((e=>{let[t,r]=e;const n=gn.BasisWorker.toString(),i=["/* constants */","let _EngineFormat = "+JSON.stringify(gn.EngineFormat),"let _TranscoderFormat = "+JSON.stringify(gn.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(gn.BasisFormat),"/* basis_transcoder.js */",t,"/* worker */",n.substring(n.indexOf("{")+1,n.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([i])),this.transcoderBinary=r,this.workerPool.setWorkerCreator((()=>{const e=new Worker(this.workerSourceURL),t=this.transcoderBinary.slice(0);return e.postMessage({type:"init",config:this.workerConfig,transcoderBinary:t},[t]),e}))})),mn>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),mn++}return this.transcoderPending}load(e,t,r,i){if(null===this.workerConfig)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const s=new n.FileLoader(this.manager);s.setResponseType("arraybuffer"),s.setWithCredentials(this.withCredentials),s.load(e,(e=>{this.parse(e,t,i)}),r,i)}parse(e,t,r){if(null===this.workerConfig)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");if(pn.has(e))return pn.get(e).promise.then(t).catch(r);this._createTexture(e).then((e=>t?t(e):null)).catch(r)}_createTextureFrom(e,t){const{faces:r,width:i,height:s,format:o,type:a,error:l,dfdFlags:c}=e;if("error"===a)return Promise.reject(l);let u;if(6===t.faceCount)u=new n.CompressedCubeTexture(r,o,n.UnsignedByteType);else{const e=r[0].mipmaps;u=t.layerCount>1?new n.CompressedArrayTexture(e,i,s,t.layerCount,o,n.UnsignedByteType):new n.CompressedTexture(e,i,s,o,n.UnsignedByteType)}return u.minFilter=1===r[0].mipmaps.length?n.LinearFilter:n.LinearMipmapLinearFilter,u.magFilter=n.LinearFilter,u.generateMipmaps=!1,u.needsUpdate=!0,u.colorSpace=xn(t),u.premultiplyAlpha=!!(1&c),u}async _createTexture(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=function(e){const t=new Uint8Array(e.buffer,e.byteOffset,sn.length);if(t[0]!==sn[0]||t[1]!==sn[1]||t[2]!==sn[2]||t[3]!==sn[3]||t[4]!==sn[4]||t[5]!==sn[5]||t[6]!==sn[6]||t[7]!==sn[7]||t[8]!==sn[8]||t[9]!==sn[9]||t[10]!==sn[10]||t[11]!==sn[11])throw new Error("Missing KTX 2.0 identifier.");const r=new rn,n=17*Uint32Array.BYTES_PER_ELEMENT,i=new nn(e,sn.length,n,!0);r.vkFormat=i._nextUint32(),r.typeSize=i._nextUint32(),r.pixelWidth=i._nextUint32(),r.pixelHeight=i._nextUint32(),r.pixelDepth=i._nextUint32(),r.layerCount=i._nextUint32(),r.faceCount=i._nextUint32();const s=i._nextUint32();r.supercompressionScheme=i._nextUint32();const o=i._nextUint32(),a=i._nextUint32(),l=i._nextUint32(),c=i._nextUint32(),u=i._nextUint64(),h=i._nextUint64(),d=new nn(e,sn.length+n,3*s*8,!0);for(let t=0;t{const t=new hn;await t.init(),e(t)}))),r=await fn);const i=[];for(let s=0;s>s),a=Math.max(1,e.pixelHeight>>s),l=e.pixelDepth?Math.max(1,e.pixelDepth>>s):0,c=e.levels[s];let u,h;if(0===e.supercompressionScheme)u=c.levelData;else{if(2!==e.supercompressionScheme)throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");u=r.decode(c.levelData,c.uncompressedByteLength)}h=vn[t]===n.FloatType?new Float32Array(u.buffer,u.byteOffset,u.byteLength/Float32Array.BYTES_PER_ELEMENT):vn[t]===n.HalfFloatType?new Uint16Array(u.buffer,u.byteOffset,u.byteLength/Uint16Array.BYTES_PER_ELEMENT):u,i.push({data:h,width:o,height:a,depth:l})}let s;if(An.has(yn[t]))s=0===e.pixelDepth?new n.DataTexture(i[0].data,e.pixelWidth,e.pixelHeight):new n.Data3DTexture(i[0].data,e.pixelWidth,e.pixelHeight,e.pixelDepth);else{if(e.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");s=new n.CompressedTexture(i,e.pixelWidth,e.pixelHeight)}return s.mipmaps=i,s.type=vn[t],s.format=yn[t],s.colorSpace=xn(e),s.needsUpdate=!0,Promise.resolve(s)}(r);const i=this.init().then((()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:t},[e]))).then((e=>this._createTextureFrom(e.data,r)));return pn.set(e,{promise:i}),i}dispose(){return this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),mn--,this}}gn.BasisFormat={ETC1S:0,UASTC_4x4:1},gn.TranscoderFormat={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16},gn.EngineFormat={RGBAFormat:n.RGBAFormat,RGBA_ASTC_4x4_Format:n.RGBA_ASTC_4x4_Format,RGBA_BPTC_Format:n.RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:n.RGBA_ETC2_EAC_Format,RGBA_PVRTC_4BPPV1_Format:n.RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT5_Format:n.RGBA_S3TC_DXT5_Format,RGB_ETC1_Format:n.RGB_ETC1_Format,RGB_ETC2_Format:n.RGB_ETC2_Format,RGB_PVRTC_4BPPV1_Format:n.RGB_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT1_Format:n.RGBA_S3TC_DXT1_Format},gn.BasisWorker=function(){let e,t,r;const n=_EngineFormat,i=_TranscoderFormat,s=_BasisFormat;self.addEventListener("message",(function(o){const h=o.data;switch(h.type){case"init":e=h.config,d=h.transcoderBinary,t=new Promise((e=>{r={wasmBinary:d,onRuntimeInitialized:e},BASIS(r)})).then((()=>{r.initializeBasis(),void 0===r.KTX2File&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")}));break;case"transcode":t.then((()=>{try{const{faces:t,buffers:o,width:d,height:p,hasAlpha:f,format:m,dfdFlags:g}=function(t){const o=new r.KTX2File(new Uint8Array(t));function h(){o.close(),o.delete()}if(!o.isValid())throw h(),new Error("THREE.KTX2Loader:\tInvalid or unsupported .ktx2 file");const d=o.isUASTC()?s.UASTC_4x4:s.ETC1S,p=o.getWidth(),f=o.getHeight(),m=o.getLayers()||1,g=o.getLevels(),A=o.getFaces(),y=o.getHasAlpha(),v=o.getDFDFlags(),{transcoderFormat:x,engineFormat:_}=function(t,r,o,u){let h,d;const p=t===s.ETC1S?a:l;for(let n=0;n1?(i=a.origWidth,s=a.origHeight):(i=a.width,s=a.height);const l=new Uint8Array(o.getImageTranscodedSizeInBytes(r,t,0,x));if(!o.transcodeImage(l,r,t,e,x,0,-1,-1))throw h(),new Error("THREE.KTX2Loader: .transcodeImage failed.");n.push(l)}const a=u(n);t.push({data:a,width:i,height:s}),w.push(a.buffer)}b.push({mipmaps:t,width:p,height:f,format:_})}return h(),{faces:b,buffers:w,width:p,height:f,hasAlpha:y,format:_,dfdFlags:v}}(h.buffer);self.postMessage({type:"transcode",id:h.id,faces:t,width:d,height:p,hasAlpha:f,format:m,dfdFlags:g},o)}catch(e){console.error(e),self.postMessage({type:"error",id:h.id,error:e.message})}}))}var d}));const o=[{if:"astcSupported",basisFormat:[s.UASTC_4x4],transcoderFormat:[i.ASTC_4x4,i.ASTC_4x4],engineFormat:[n.RGBA_ASTC_4x4_Format,n.RGBA_ASTC_4x4_Format],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.BC7_M5,i.BC7_M5],engineFormat:[n.RGBA_BPTC_Format,n.RGBA_BPTC_Format],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.BC1,i.BC3],engineFormat:[n.RGBA_S3TC_DXT1_Format,n.RGBA_S3TC_DXT5_Format],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.ETC1,i.ETC2],engineFormat:[n.RGB_ETC2_Format,n.RGBA_ETC2_EAC_Format],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.ETC1],engineFormat:[n.RGB_ETC1_Format],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.PVRTC1_4_RGB,i.PVRTC1_4_RGBA],engineFormat:[n.RGB_PVRTC_4BPPV1_Format,n.RGBA_PVRTC_4BPPV1_Format],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0}],a=o.sort((function(e,t){return e.priorityETC1S-t.priorityETC1S})),l=o.sort((function(e,t){return e.priorityUASTC-t.priorityUASTC}));function c(e){return e<=2||!(e&e-1)&&0!==e}function u(e){if(1===e.length)return e[0];let t=0;for(let r=0;rnew S)),Sn.register((()=>new ee)),Sn.register((()=>new te));const Cn={LOAD_TILE_SET:"load-tile-set",LOAD_MODEL:"load-model",DISPOSE_MODEL:"dispose-model",TILE_VISIBILITY_CHANGE:"tile-visibility-change",TILES_LOAD_START:"tiles-load-start",TILES_LOAD_END:"tiles-load-end"};function Tn(e,t){if(!e)throw new Error("Path to draco folder is mandatory");const r=new kr;r.setDecoderPath(e),t&&r.setDecoderConfig(t),Sn.setDRACOLoader(r)}function In(e,t){if(!e||!t)throw new Error("Path to ktx2 folder and renderer are mandatory");const r=new gn;r.setTranscoderPath(e),r.detectSupport(t),Sn.setKTX2Loader(r)}class Rn extends Nr.A{constructor(e,t){super(e,new n.Group,{source:t.source}),this.isOGC3DTilesLayer=!0,this._handlePointsMaterialConfig(t),this.tilesRenderer=new Sr(this.source.url),t.source.isOGC3DTilesIonSource?this.tilesRenderer.registerPlugin(new Rr({apiToken:t.source.accessToken,assetId:t.source.assetId,autoRefreshToken:!0})):t.source.isOGC3DTilesGoogleSource&&this.tilesRenderer.registerPlugin(new Ir({apiToken:t.source.key,autoRefreshToken:!0})),this.tilesRenderer.registerPlugin(new Or),this.tilesRenderer.manager.addHandler(/\.gltf$/,Sn),this.object3d.add(this.tilesRenderer.group),this._res=this.addInitializationStep(),this.sseThreshold=this.tilesRenderer.errorTarget,Object.defineProperty(this,"sseThreshold",{get(){return this.tilesRenderer.errorTarget},set(e){this.tilesRenderer.errorTarget=e}}),t.sseThreshold&&(this.sseThreshold=t.sseThreshold)}_handlePointsMaterialConfig(e){this.pntsMode=e.pntsMode??bn.qW.COLOR,this.pntsShape=e.pntsShape??bn.cn.CIRCLE,this.classification=e.classification??bn.MY.DEFAULT,this.pntsSizeMode=e.pntsSizeMode??bn.qU.VALUE,this.pntsMinAttenuatedSize=e.pntsMinAttenuatedSize||3,this.pntsMaxAttenuatedSize=e.pntsMaxAttenuatedSize||10}_setupCacheAndQueues(e){const t=e.id;Mn[t]?(this.tilesRenderer.lruCache=Mn[t].lruCache,this.tilesRenderer.downloadQueue=Mn[t].downloadQueue,this.tilesRenderer.parseQueue=Mn[t].parseQueue):(Mn[t]={lruCache:this.tilesRenderer.lruCache,downloadQueue:this.tilesRenderer.downloadQueue,parseQueue:this.tilesRenderer.parseQueue},e.addEventListener(wn.G.DISPOSED,(e=>{delete Mn[e.target.id]})))}_setupEvents(){for(const e of Object.values(Cn))this.tilesRenderer.addEventListener(e,(e=>{this.dispatchEvent(e)}))}_setup(e){this.tilesRenderer.setCamera(e.camera3D),this.tilesRenderer.setResolutionFromRenderer(e.camera3D,e.renderer);let t=!1;this.tilesRenderer.addEventListener("load-tile-set",(()=>{e.notifyChange(this),t||(t=!0,this._res())})),this.tilesRenderer.addEventListener("load-model",(t=>{let{scene:r}=t;r.traverse((e=>{this._assignFinalMaterial(e),this._assignFinalAttributes(e)})),e.notifyChange(this)})),this._setupCacheAndQueues(e),this._setupEvents(),this.tilesRenderer.update()}_assignFinalMaterial(e){let t=e.material;if(e.isPoints){const e=new bn.Ay({mode:this.pntsMode,shape:this.pntsShape,classificationScheme:this.classification,sizeMode:this.pntsSizeMode,minAttenuatedSize:this.pntsMinAttenuatedSize,maxAttenuatedSize:this.pntsMaxAttenuatedSize});e.copy(t),t=e}t&&(0,_n.A)(t,this),e.material=t}_assignFinalAttributes(e){const t=e.geometry,r=e.batchTable;if(e.isPoints){const e=r?.getPropertyArray("Classification");e&&t.setAttribute("classification",new n.BufferAttribute(e,1))}}preUpdate(e){return this.scale=e.camera._preSSE,this.tilesRenderer.update(),null}update(){}delete(){this.tilesRenderer.dispose()}getC3DTileFeatureFromIntersectsArray(e){if(!e.length)return null;const{face:t,index:r,object:n,instanceId:i}=e[0];let s;if(n.isPoints&&r?s=n.geometry.getAttribute("_BATCHID")?.getX(r)??r:n.isMesh&&t&&(s=n.geometry.getAttribute("_BATCHID")?.getX(t.a)??i),void 0===s)return null;let o=n;for(;!o.batchTable;)o=o.parent;return o.batchTable.getDataFromId(s)}pickObjectsAt(e,t){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];const n=e.camera.camera3D;En.setFromCamera(e.viewToNormalizedCoords(t),n),En.near=n.near,En.far=n.far,En.firstHitOnly=!0;const i=En.intersectObject(this.tilesRenderer.group,!0);return i.forEach((e=>{e.layer=this})),r.push(...i),r}attach(){console.warn("[OGC3DTilesLayer]: Attaching / detaching layers is not yet implemented for OGC3DTilesLayer.")}detach(){return console.warn("[OGC3DTilesLayer]: Attaching / detaching layers is not yet implemented for OGC3DTilesLayer."),!0}getObjectToUpdateForAttachedLayers(){return null}forEachTile(e){this.tilesRenderer.traverse((t=>{e(t,t.cached.scene)}))}}const Bn=Rn},70515:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});const n=function(e,t){if(t&&t.isGeometryLayer){let r=e.transparent;e.layer=t,e.uniforms&&null!=e.uniforms.opacity?Object.defineProperty(e.uniforms.opacity,"value",{get:()=>e.layer.opacity}):null!=e.opacity&&Object.defineProperty(e,"opacity",{get:()=>e.layer.opacity}),e.uniforms&&null!=e.uniforms.mode&&Object.defineProperty(e.uniforms.mode,"value",{get:()=>e.layer.pntsMode}),e.uniforms&&null!=e.uniforms.shape&&Object.defineProperty(e.uniforms.shape,"value",{get:()=>e.layer.pntsShape}),e.uniforms&&null!=e.uniforms.sizeMode&&Object.defineProperty(e.uniforms.sizeMode,"value",{get:()=>e.layer.pntsSizeMode}),e.uniforms&&null!=e.uniforms.minAttenuatedSize&&Object.defineProperty(e.uniforms.minAttenuatedSize,"value",{get:()=>e.layer.pntsMinAttenuatedSize}),e.uniforms&&null!=e.uniforms.maxAttenuatedSize&&Object.defineProperty(e.uniforms.maxAttenuatedSize,"value",{get:()=>e.layer.pntsMaxAttenuatedSize}),e.uniforms&&null!=e.uniforms.scale&&Object.defineProperty(e.uniforms.scale,"value",{get:()=>e.layer.scale}),Object.defineProperty(e,"wireframe",{get:()=>e.layer.wireframe}),Object.defineProperty(e,"transparent",{get:()=>{const t=e.userData.needTransparency?.[e.mode]||e.layer.opacity<1;return r!=t&&(e.needsUpdate=!0,r=t),r}})}return e}},76932:(e,t,r)=>{"use strict";r.d(t,{A:()=>S});var n=r(39437),i=r(80736),s=r(66924),o=r(10456),a=r(45232),l=r(86706);class c extends n.Mesh{#M=(()=>new Map)();#S=!0;constructor(e,t,r,i){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(super(e,t),!i)throw new Error("extent is mandatory to build a TileMesh");this.layer=r,this.extent=i,this.extent.zoom=s,this.level=s,this.material.objectId=this.id,this.obb=this.geometry.OBB.clone(),this.boundingSphere=new n.Sphere,this.obb.box3D.getBoundingSphere(this.boundingSphere);for(const e of r.tileMatrixSets)this.#M.set(e,(0,l.m)(this.extent,e));this.frustumCulled=!1,this.matrixAutoUpdate=!1,this.rotationAutoUpdate=!1,this.layerUpdateState={},this.isTileMesh=!0,this.geoidHeight=0,this.link={},Object.defineProperty(this,"visible",{get(){return this.#S},set(e){this.#S!=e&&(this.#S=e,this.dispatchEvent({type:e?"shown":"hidden"}))}})}setBBoxZ(e){e.geoidHeight=(0,a.h)(this.layer)?this.geoidHeight:0,this.obb.updateZ(e),this.horizonCullingPointElevationScaled&&this.horizonCullingPointElevationScaled.setLength(this.obb.z.delta+this.horizonCullingPoint.length()),this.obb.box3D.getBoundingSphere(this.boundingSphere)}getExtentsByProjection(e){return this.#M.get(e)}findCommonAncestor(e){if(e)return e.level==this.level?e.id==this.id?e:0!=e.level?this.parent.findCommonAncestor(e.parent):void 0:e.level{c=e})),A.set(l,o,t.level,a),t.extent=r,t.center=e.center(t.extent).clone();let u,h=g.get(a);t.buildIndexAndUv_0=!h;try{u=(0,f.t)(e,t)}catch(e){return Promise.reject(e)}h||(h={},h.index=new n.BufferAttribute(u.index,1),h.uv=new n.BufferAttribute(u.uvs[0],2),g.set(a,h));const p={index:h.index,uvs:[h.uv,...void 0!==u.uvs[1]?[new n.BufferAttribute(u.uvs[1],1)]:[]],position:new n.BufferAttribute(u.position,3),normal:new n.BufferAttribute(u.normal,3)},y=new d.p(e,t,p);return y.OBB=new m.A(y.boundingBox.min,y.boundingBox.max),y.initRefCount(A,[o,t.level,a]),c(y),Promise.resolve({geometry:y,quaternion:i,position:s})}return l.then((e=>({geometry:e,quaternion:i,position:s})))}(i,l).then((e=>{e.geometry.increaseRefCount();const l=r.tileMatrixSets.length,c=new h.Ay(r.materialOptions,l);(0,y.A)(c,r);const d=new u(e.geometry,c,r,t,o);if(s&&s.isTileMesh){const t=i.computeShareableExtent(s.extent);e.position.sub(t.position).applyQuaternion(t.quaternion.invert()),e.quaternion.premultiply(t.quaternion)}if(d.position.copy(e.position),d.quaternion.copy(e.quaternion),d.visible=!1,d.updateMatrix(),function(e,t){if(t.diffuse&&(e.material.diffuse=t.diffuse),t.isGlobeLayer){e.horizonCullingPoint=e.extent.center().as("EPSG:4978").toVector3(),e.extent.planarDimensions(v).multiplyScalar(n.MathUtils.DEG2RAD);const t=v.length(),r=Math.abs(1/Math.cos(.5*t));e.horizonCullingPoint.setLength(r*e.horizonCullingPoint.length()),e.horizonCullingPointElevationScaled=e.horizonCullingPoint.clone()}}(d,r),s){d.geoidHeight=s.geoidHeight;const e=(0,a.h)(r)?d.geoidHeight:0;d.setBBoxZ({min:s.obb.z.min,max:s.obb.z.max,geoidHeight:e}),d.material.geoidHeight=e}return d}))}};var _=r(32060),b=r(61276);const w=new n.Vector3,E=new n.Vector3;class M extends i.A{constructor(e,t,r,n,i){const{sseSubdivisionThreshold:o=1,minSubdivisionLevel:a,maxSubdivisionLevel:l,maxDeltaElevationLevel:c,tileMatrixSets:u,diffuse:h,showOutline:d=!1,segments:f,disableSkirt:m=!1,materialOptions:g,...A}=i;if(super(e,t,{...A,cacheLifeTime:p.W.INFINITE,source:!1}),this.isTiledGeometryLayer=!0,this.protocol="tile",this.object3d.geoidHeight=0,this.disableSkirt=m,this._hideSkirt=!!i.hideSkirt,this.sseSubdivisionThreshold=o,this.minSubdivisionLevel=a,this.maxSubdivisionLevel=l,this.maxDeltaElevationLevel=c,this.segments=f,this.schemeTile=r,this.builder=n,this.info=new s.y(this),!this.schemeTile)throw new Error(`Cannot init tiled layer without schemeTile for layer ${this.id}`);if(!this.builder)throw new Error(`Cannot init tiled layer without builder for layer ${this.id}`);this.maxScreenSizeNode=this.sseSubdivisionThreshold*(2*this.sizeDiagonalTexture),this.tileMatrixSets=u,this.materialOptions=g,this.showOutline=d,this.diffuse=h,this.level0Nodes=[];const y=[];for(const e of this.schemeTile)y.push(this.convert(void 0,e));this._promises.push(Promise.all(y).then((e=>{this.level0Nodes=e,this.object3d.add(...e),this.object3d.updateMatrixWorld()})))}get hideSkirt(){return this._hideSkirt}set hideSkirt(e){if(this.level0Nodes){this._hideSkirt=e;for(const t of this.level0Nodes)t.traverse((t=>{t.isTileMesh&&(t.geometry.hideSkirt=e)}))}}pickObjectsAt(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.options.defaultPickingRadius,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return o.A.pickTilesAt(e,t,r,this,n)}preUpdate(e,t){if(t.has(void 0)||0==t.size)return this.level0Nodes;e.colorLayers=e.view.getLayers(((e,t)=>t&&t.id==this.id&&e.isColorLayer)),e.elevationLayers=e.view.getLayers(((e,t)=>t&&t.id==this.id&&e.isElevationLayer)),e.maxElevationLevel=-1;for(const t of e.elevationLayers)e.maxElevationLevel=Math.max(t.source.zoom.max,e.maxElevationLevel);let r;-1==e.maxElevationLevel&&(e.maxElevationLevel=1/0),this.colorLayersOrder=b.p.getColorLayersIdOrderedBySequence(e.colorLayers);for(const e of t.values()){if(e.isCamera)return this.level0Nodes;if(e.layer===this){if(r){if(r=e.findCommonAncestor(r),!r)return this.level0Nodes}else r=e;null==r.material&&(r=void 0)}}return r?[r]:this.level0Nodes}update(e,t,r){if(!r.parent)return _.A.removeChildrenAndCleanup(this,r);if(r.parent.pendingSubdivision)return r.visible=!1,r.material.visible=!1,void this.info.update(r);if(r.visible=!this.culling(r,e.camera),r.visible){let t=!1;return r.material.visible=!0,this.info.update(r),(r.pendingSubdivision||M.hasEnoughTexturesToSubdivide(e,r)&&this.subdivision(e,this,r))&&(this.subdivideNode(e,r),r.material.visible=r.pendingSubdivision,this.info.update(r),t=!0),r.material.visible&&!t?_.A.removeChildren(this,r):t?r.children.filter((e=>e.layer==this)):void 0}return r.material.visible=!1,this.info.update(r),_.A.removeChildren(this,r)}convert(e,t){return x.convert(e,t,this)}countColorLayersTextures(){return arguments.length}culling(e,t){return!t.isBox3Visible(e.obb.box3D,e.matrixWorld)}static hasEnoughTexturesToSubdivide(e,t){const r=t.layerUpdateState||{};let n=t.material.getElevationLayer();for(const i of e.elevationLayers){const e=t.getExtentsByProjection(i.crs)[0].zoom;if(!(e>i.zoom.max||ei.zoom.max||ee.layer==this))){const r=t.extent.subdivision();t.pendingSubdivision=!0;const n={view:e.view,requester:t,layer:this,priority:1e4,extentsSource:r,redraw:!1};return e.scheduler.execute(n).then((r=>{for(const e of r)t.add(e),e.updateMatrixWorld(!0);t.pendingSubdivision=!1,e.view.notifyChange(t,!1)}),(e=>{if(t.pendingSubdivision=!1,!e.isCancelledCommandException)throw new Error(e)}))}}subdivision(e,t,r){if(r.level{"use strict";r.r(t),r.d(t,{$3dTilesCulling:()=>bs.Li,$3dTilesSubdivisionControl:()=>bs.cG,B3dmParser:()=>ps.A,C3DTBatchTable:()=>ys.A,C3DTBatchTableHierarchyExtension:()=>_s,C3DTBoundingVolume:()=>As.A,C3DTExtensions:()=>vs.A,C3DTFeature:()=>ms.A,C3DTILES_LAYER_EVENTS:()=>Or.s,C3DTilesBoundingVolumeTypes:()=>xs.h,C3DTilesGoogleSource:()=>mi,C3DTilesIonSource:()=>pi,C3DTilesLayer:()=>Or.A,C3DTilesSource:()=>di,C3DTilesTypes:()=>xs.A,C3DTileset:()=>gs.A,CAMERA_TYPE:()=>It.d,CONTROL_EVENTS:()=>D.W,CRS:()=>l,CameraCalibrationParser:()=>Yr,CameraUtils:()=>wt.Ay,Capabilities:()=>Tt.A,ClassificationScheme:()=>L.MY,ColorLayer:()=>tr,ColorLayersOrdering:()=>en.A,Coordinates:()=>o.A,CopcLayer:()=>_n,CopcSource:()=>Ti,DEMUtils:()=>bt.A,ElevationLayer:()=>rr,Ellipsoid:()=>c.A,EntwinePointTileLayer:()=>pn,EntwinePointTileSource:()=>Si,Extent:()=>s.A,FEATURE_TYPES:()=>ke.Xs,Feature:()=>ke.Ay,Feature2Mesh:()=>xt,FeatureCollection:()=>ke.ZC,FeatureGeometry:()=>ke.fj,FeatureGeometryLayer:()=>sr,FeatureProcessing:()=>_,FeaturesUtils:()=>_t.A,Fetcher:()=>d.A,FileSource:()=>En,FirstPersonControls:()=>te,FlyControls:()=>H,GDFParser:()=>hs.A,GLOBE_VIEW_EVENTS:()=>u.S,GTXParser:()=>ds.Ay,GeoJsonParser:()=>jr.A,GeoidGrid:()=>a.A,GeoidLayer:()=>v.A,GeometryLayer:()=>nr.A,GlobeControls:()=>D.A,GlobeLayer:()=>tn.A,GlobeView:()=>u.A,GpxParser:()=>Ri.A,ISGParser:()=>us.A,ImageryLayers:()=>Bt.p,KMLParser:()=>Bi.A,LASParser:()=>Ei,Label:()=>Rt.A,LabelLayer:()=>nn.A,Layer:()=>Bt.A,MAIN_LOOP_EVENTS:()=>p.n7,OGC3DTILES_LAYER_EVENTS:()=>Nr.uj,OGC3DTilesGoogleSource:()=>vi,OGC3DTilesIonSource:()=>yi,OGC3DTilesLayer:()=>Nr.Ay,OGC3DTilesSource:()=>Ai,OrientationUtils:()=>$e,OrientedImageCamera:()=>P,OrientedImageLayer:()=>Zr,OrientedImageSource:()=>$n,PLANAR_CONTROL_EVENT:()=>pe.w7,PNTS_MODE:()=>L.qW,PNTS_SHAPE:()=>L.cn,PNTS_SIZE_MODE:()=>L.qU,PlanarControls:()=>pe.Ay,PlanarLayer:()=>rn.A,PlanarView:()=>h.A,PointCloudLayer:()=>gr,PointsMaterial:()=>L.Ay,Potree2Layer:()=>Dr,Potree2Source:()=>ui,PotreeLayer:()=>Er,PotreeSource:()=>ri,REVISION:()=>ws,STRATEGY_DICHOTOMY:()=>b.fZ,STRATEGY_GROUP:()=>b.a0,STRATEGY_MIN_NETWORK_TRAFFIC:()=>b.Uv,STRATEGY_PROGRESSIVE:()=>b.oN,ShaderChunk:()=>St,ShapefileParser:()=>cs,Source:()=>bn.A,StreetControls:()=>de,Style:()=>Je.Ay,THREE:()=>n,TMSSource:()=>Rn,TiledGeometryLayer:()=>Ur.A,VIEW_EVENTS:()=>f.G,VectorTilesSource:()=>Xn,View:()=>f.A,WFSSource:()=>Ln,WMSSource:()=>Un,WMTSSource:()=>Fn,colorLayerEffects:()=>Ct.Ll,ellipsoidSizes:()=>c.Q,enableDracoLoader:()=>Nr.YC,enableKtx2Loader:()=>Nr.eU,getMaxColorSamplerUnitsCount:()=>Ct.gL,iGLTFLoader:()=>fs.A,process3dTilesNode:()=>bs.oS,proj4:()=>i.A,updateLayeredMaterialNodeElevation:()=>C,updateLayeredMaterialNodeImagery:()=>S});var n=r(39437),i=r(68721),s=r(86215),o=r(52404),a=r(77855),l=r(86406),c=r(96027),u=r(86397),h=r(8917),d=r(7794),p=r(87196),f=r(84354),m=r(24184),g=r(32060);const A=4;function y(e,t,r,n,i){if(t.layerUpdateState[r.id])if(e.isCancelledCommandException)t.layerUpdateState[r.id].success();else if(e instanceof SyntaxError)t.layerUpdateState[r.id].failure(0,!0);else{const e=t.layerUpdateState[r.id].errorCount>A;t.layerUpdateState[r.id].failure(Date.now(),e,{targetLevel:n}),e||window.setTimeout((()=>{i.notifyChange(t,!1)}),1e3*t.layerUpdateState[r.id].secondsUntilNextTry())}}var v=r(45232);const x=new o.A("EPSG:4326",0,0,0),_={update(e,t,r){if(!r.parent&&r.children.length)return void g.A.removeChildrenAndCleanupRecursively(t,r);if(!r.visible)return;if(void 0===r.layerUpdateState[t.id])r.layerUpdateState[t.id]=new m.A;else if(!r.layerUpdateState[t.id].canTryUpdate())return void r.link[t.id]?.forEach((e=>{e.layer.object3d.add(e),e.meshes.position.z=(0,v.h)(t.parent)?r.geoidHeight:0,e.meshes.updateMatrixWorld()}));const n=r.getExtentsByProjection(t.source.crs)||[r.extent],i=n[0].zoom;if(i!=t.zoom.min||!this.source.extentInsideLimit(r.extent,i)||t.source.isFileSource&&!r.extent.isPointInside(t.source.extent.center(x)))return void r.layerUpdateState[t.id].noMoreUpdatePossible();r.layerUpdateState[t.id].newTry();const s={layer:t,extentsSource:n,view:e.view,requester:r};return e.scheduler.execute(s).then((n=>{r.layerUpdateState[t.id].noMoreUpdatePossible(),n.forEach((n=>{n?(r.link[t.id]=r.link[t.id]||[],n.as(e.view.referenceCrs),n.meshes.position.z=(0,v.h)(t.parent)?r.geoidHeight:0,n.updateMatrixWorld(),t.onMeshCreated&&t.onMeshCreated(n,e),r.parent?(t.object3d.add(n),r.link[t.id].push(n)):g.A.removeChildrenAndCleanupRecursively(t,n),n.layer=t):r.layerUpdateState[t.id].failure(1,!0)}))}),(n=>y(n,r,t,r.level,e.view)))}};var b=r(85524);function w(e){return e.visible?100:10}function E(e){return!(e.requester.parent&&e.requester.material&&!(e.layer.isElevationLayer&&e.requester.material.getElevationLayer()&&e.targetLevel<=e.requester.material.getElevationLayer().level)&&e.requester.layerUpdateState[e.layer.id]&&e.layer.source._featuresCaches[e.layer.crs]&&e.requester.material.visible)}function M(e,t,r,n,i){return{view:e,layer:t,extentsSource:r,extentsDestination:n,requester:i,priority:w(i.material),earlyDropFunction:E}}function S(e,t,r,n){const i=r.material;if(!n||!i)return;const s=r.getExtentsByProjection(t.crs),o=s[0].zoom;if(o>t.zoom.max||o=t.source.zoom.min)return void e.view.notifyChange(r,!1)}if(!i.visible)return;if(!t.visible||!r.layerUpdateState[t.id].canTryUpdate())return;if(a.level>=s[0].zoom)return void r.layerUpdateState[t.id].noMoreUpdatePossible();if(t.frozen)return;const l=r.layerUpdateState[t.id].failureParams,c=s[0].zoom||r.level,u=(0,b.kb)(t.updateStrategy.type,r,c,a.level,t,l);if(!t.source.isVectorSource&&u<=a.level||u>c)return void(l.lowestLevelError!=1/0&&r.layerUpdateState[t.id].noMoreUpdatePossible());if(!t.source.extentInsideLimit(r.extent,u))return r.layerUpdateState[t.id].noData({targetLevel:u}),void e.view.notifyChange(r,!1);const h=s.map((e=>e.tiledExtentParent(u)));r.layerUpdateState[t.id].newTry();const d=M(e.view,t,h,s,r);return e.scheduler.execute(d).then((e=>{if(!r.layerUpdateState[t.id])return;const n=s.map(((t,r)=>t.offsetToParent(e[r].extent,a.offsetScales[r])));a.setTextures(e,n),r.layerUpdateState[t.id].success()}),(n=>y(n,r,t,u,e.view)))}function C(e,t,r,n){const i=r.material;if(!n||!i)return;const s=r.getExtentsByProjection(t.crs),o=s[0].zoom;if(o>t.zoom.max||o=t.source.zoom.min)return void e.view.notifyChange(r,!1)}if(t.frozen||!i.visible||!r.layerUpdateState[t.id].canTryUpdate())return;const l=r.layerUpdateState[t.id].failureParams,c=(0,b.kb)(t.updateStrategy.type,r,s[0].zoom,a.level,t,l);if(c<=a.level||c>s[0].zoom)return void r.layerUpdateState[t.id].noMoreUpdatePossible();if(!t.source.extentInsideLimit(r.extent,c))return r.layerUpdateState[t.id].noData({targetLevel:c}),void e.view.notifyChange(r,!1);const u=s.map((e=>e.tiledExtentParent(c)));r.layerUpdateState[t.id].newTry();const h=M(e.view,t,u,s,r);return e.scheduler.execute(h).then((e=>{if(!r.layerUpdateState[t.id])return;if(c<=a.level)return void r.layerUpdateState[t.id].noMoreUpdatePossible();const n=s.map(((t,r)=>t.offsetToParent(e[r].extent,a.offsetScales[r])));a.setTextures(e,n),r.layerUpdateState[t.id].success()}),(n=>y(n,r,t,c,e.view)))}function T(e){return function(t){t.material?.removeLayer&&(t.material.elevationLayerIds.indexOf(e)>-1&&t.setBBoxZ({min:0,max:0}),t.material.removeLayer(e)),t.layerUpdateState&&t.layerUpdateState[e]&&delete t.layerUpdateState[e]}}class I{constructor(e){this.size=e,this.pps=null,this.polynom=null,this.l1l2=null}setFromMicmacCalibration(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.pps=(new n.Vector2).fromArray(e.pps),this.polynom=(new n.Vector4).fromArray(e.poly357),this.l1l2=new n.Vector3,this.pps.y=t?this.size.y-this.pps.y:this.pps.y,this.polynom.w=e.limit**2,e.l1l2&&(this.l1l2.fromArray(e.l1l2),this.l1l2.z=e.etats)}clone(){const e=new I(this.size.clone());return e.pps=this.pps.clone(),e.polynom=this.polynom.clone(),e.l1l2=this.l1l2.clone(),e}}const R=new n.Vector3;class B extends n.PerspectiveCamera{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1024,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1024,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1e4,o=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0;e=e.isVector2?e:new n.Vector2(e,e),a=a||e.x/e.y,super(void 0,a,i,s),this.size=e,this.focal=t.isVector2?t:new n.Vector2(t,t),this.center=r||e.clone().multiplyScalar(.5),this.skew=o||0,this.textureMatrixWorldInverse=new n.Matrix4,Object.defineProperty(this,"fov",{get:()=>2*n.MathUtils.radToDeg(Math.atan2(this.size.y,2*this.focal.y)),set:e=>{const t=.5*this.size.y/Math.tan(n.MathUtils.degToRad(.5*e));this.focal.x=t,this.focal.y=t}}),this.distortion=new I(this.size),this.maskPath=void 0,this.mask=void 0,this.updateProjectionMatrix()}updateProjectionMatrix(){if(!this.focal)return;const e=this.near,t=e/this.focal.x,r=e/this.focal.y,n=-t*this.center.x,i=-r*this.center.y,s=n+t*this.size.x,o=i+r*this.size.y;this.projectionMatrix.makePerspective(n,s,o,i,e,this.far),this.projectionMatrix.elements[4]=2*this.skew/this.size.x;const a=this.size.x/this.size.y,l=this.aspect/a;R.set(this.zoom,this.zoom,1),l>1?R.x/=l:R.y*=l,this.projectionMatrix.scale(R)}copy(e,t){return super.copy(e,t),this.size=e.size.clone(),this.focal=e.focal.clone(),this.center=e.center.clone(),this.distortion=e.distortion.clone(),this.textureMatrixWorldInverse=e.textureMatrixWorldInverse.clone(),this.skew=e.skew,this.maskPath=e.maskPath,this.mask=e.mask,this}}const P=B;var L=r(6425),D=r(98211);const O={38:{method:"translateZ",sign:-1},40:{method:"translateZ",sign:1},37:{method:"translateX",sign:-1},39:{method:"translateX",sign:1},33:{method:"rotateZ",sign:1,noSpeed:!0},34:{method:"rotateZ",sign:-1,noSpeed:!0},wheelup:{method:"translateZ",sign:1,oneshot:!0},wheeldown:{method:"translateZ",sign:-1,oneshot:!0}};function N(e){e.preventDefault(),this._isMouseDown=!0;const t=this.view.eventToViewCoords(e);this._onMouseDownMouseX=t.x,this._onMouseDownMouseY=t.y}function U(e){e.preventDefault(),this._isMouseDown=!0,this._onMouseDownMouseX=e.touches[0].pageX,this._onMouseDownMouseY=e.touches[0].pageY}function F(e){if(!0===this._isMouseDown){const t=this.view.eventToViewCoords(e),r=n.MathUtils.degToRad(this._camera3D.fov)/this.view.mainLoop.gfxEngine.height;this._camera3D.rotateY((t.x-this._onMouseDownMouseX)*r),this._camera3D.rotateX((t.y-this._onMouseDownMouseY)*r),this._onMouseDownMouseX=t.x,this._onMouseDownMouseY=t.y,this.view.notifyChange(this._camera3D,!1)}}function k(){this._isMouseDown=!1}function z(e){const t=O[e.keyCode];t&&(this.moves.delete(t),e.preventDefault())}function G(e){const t=O[e.keyCode];t&&(this.moves.add(t),this.view.notifyChange(this._camera3D,!1),e.preventDefault())}function Q(e){-e.deltaY<0?this.moves.add(O.wheelup):this.moves.add(O.wheeldown),this.view.notifyChange(this._camera3D,!1)}class V extends n.EventDispatcher{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),this.view=e,this.options=t,this._camera3D=e.camera3D,this.moves=new Set,this.moveSpeed=10,this._onMouseDownMouseX=0,this._onMouseDownMouseY=0,this._isMouseDown=!1,e.domElement.addEventListener("mousedown",N.bind(this),!1),e.domElement.addEventListener("touchstart",U.bind(this),!1);const r=F.bind(this);e.domElement.addEventListener("mousemove",r,!1),e.domElement.addEventListener("touchmove",r,!1),e.domElement.addEventListener("mouseup",k.bind(this),!1),e.domElement.addEventListener("touchend",k.bind(this),!1),e.domElement.addEventListener("wheel",Q.bind(this),!1),e.domElement.addEventListener("keyup",z.bind(this),!0),e.domElement.addEventListener("keydown",G.bind(this),!0),this.view.addFrameRequester(p.n7.AFTER_CAMERA_UPDATE,this.update.bind(this)),t.focusOnMouseOver&&e.domElement.addEventListener("mouseover",(()=>e.domElement.focus())),t.focusOnClick&&e.domElement.addEventListener("click",(()=>e.domElement.focus()))}isUserInteracting(){return 0!==this.moves.size||this._isMouseDown}update(e,t){t&&(e=16);for(const t of this.moves)this._camera3D[t.method](t.sign*(t.noSpeed?1:this.moveSpeed)*e/1e3);if(this.moves.size>0||this._isMouseDown){this.view.notifyChange(this._camera3D);for(const e of this.moves)e.oneshot&&this.moves.delete(e)}}}const H=V;function j(e,t,r){const i=.5*n.MathUtils.degToRad(r-e.fov);return n.MathUtils.clamp(t,-i,i)}const q=new n.Vector3(0,1,0);function W(e,t,r){t.quaternion.setFromUnitVectors(q,t.up),t.rotateY(r.rotateY),t.rotateX(r.rotateX),e.notifyChange(e.camera3D)}const Y={38:{method:"translateZ",sign:-1},40:{method:"translateZ",sign:1},37:{method:"translateX",sign:-1},39:{method:"translateX",sign:1},33:{method:"translateY",sign:1},34:{method:"translateY",sign:-1}};function X(e){this.camera.position.z+=e}const K=new n.Vector3,$=new n.Quaternion,J=new n.Euler(0,0,0,"YXZ");function Z(e){K.copy(this.camera.position),K.normalize(),this.camera.position.add(K.multiplyScalar(e))}class ee extends n.EventDispatcher{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(super(),this.isFirstPersonControls=!0,this.camera=e.camera3D,this.view=e,this.moves=new Set,t.panoramaRatio){const e=200*t.panoramaRatio/(2*Math.PI);t.verticalFOV=2==t.panoramaRatio?180:n.MathUtils.radToDeg(2*Math.atan(200/(2*e)))}t.verticalFOV=t.verticalFOV||180,t.moveSpeed=void 0===t.moveSpeed?10:t.moveSpeed,this.options=t,this._isMouseDown=!1,this._onMouseDownMouseX=0,this._onMouseDownMouseY=0,this._state={rotateX:0,rotateY:0,snapshot(){return{rotateX:this.rotateX,rotateY:this.rotateY}}},this.reset(),this.eventListeners=t.disableEventListeners,t.disableEventListeners||(this._onMouseDown=this.onMouseDown.bind(this),this._onMouseMove=this.onMouseMove.bind(this),this._onMouseUp=this.onMouseUp.bind(this),this._onMouseWheel=this.onMouseWheel.bind(this),this._onKeyUp=this.onKeyUp.bind(this),this._onKeyDown=this.onKeyDown.bind(this),this._onContextMenu=this.onContextMenu.bind(this),e.domElement.addEventListener("mousedown",this._onMouseDown,!1),e.domElement.addEventListener("touchstart",this._onMouseDown,!1),e.domElement.addEventListener("mousemove",this._onMouseMove,!1),e.domElement.addEventListener("touchmove",this._onMouseMove,!1),e.domElement.addEventListener("mouseup",this._onMouseUp,!1),e.domElement.addEventListener("touchend",this._onMouseUp,!1),e.domElement.addEventListener("wheel",this._onMouseWheel,!1),e.domElement.addEventListener("contextmenu",this._onContextMenu,!1),document.addEventListener("keydown",this._onKeyDown,!1),document.addEventListener("keyup",this._onKeyUp,!1)),this.view.addFrameRequester(p.n7.AFTER_CAMERA_UPDATE,this.update.bind(this)),this._onFocus=()=>e.domElement.focus(),this.focusOnMouseOver=t.focusOnMouseOver,t.focusOnMouseOver&&e.domElement.addEventListener("mouseover",this._onFocus),this.focusOnClick=t.focusOnClick,t.focusOnClick&&e.domElement.addEventListener("click",this._onFocus),"EPSG:4978"==e.referenceCrs?this.moveCameraVertical=Z:this.moveCameraVertical=X}isUserInteracting(){return 0!==this.moves.size&&!this._isMouseDown}reset(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];$.setFromUnitVectors(q,this.camera.up),$.invert(),$.multiply(this.camera.quaternion),J.setFromQuaternion($),e||(this._state.rotateX=J.x),this._state.rotateY=J.y}update(e,t,r){if(0!=this.enabled){t&&(e=16);for(const t of this.moves)"translateY"===t.method?this.moveCameraVertical(t.sign*this.options.moveSpeed*e/1e3):this.camera[t.method](t.sign*this.options.moveSpeed*e/1e3);!0!==this._isMouseDown&&!0!==r||W(this.view,this.camera,this._state),this.moves.size&&this.view.notifyChange(this.camera)}}onMouseDown(e){if(0==this.enabled)return;this._isMouseDown=!0;const t=this.view.eventToViewCoords(e);this._onMouseDownMouseX=t.x,this._onMouseDownMouseY=t.y,this._stateOnMouseDown=this._state.snapshot()}onMouseUp(){0!=this.enabled&&(this._isMouseDown=!1)}onMouseMove(e){if(0!=this.enabled&&!0===this._isMouseDown){const t=n.MathUtils.degToRad(this.camera.fov)/this.view.mainLoop.gfxEngine.height,r=this.view.eventToViewCoords(e);this._state.rotateY=(r.x-this._onMouseDownMouseX)*t+this._stateOnMouseDown.rotateY,this._state.rotateX=j(this.camera,(r.y-this._onMouseDownMouseY)*t+this._stateOnMouseDown.rotateX,this.options.verticalFOV),W(this.view,this.camera,this._state)}}onMouseWheel(e){if(0==this.enabled)return;const t=e.deltaY;this.camera.fov=n.MathUtils.clamp(this.camera.fov+Math.sign(t),10,Math.min(100,this.options.verticalFOV)),this.camera.updateProjectionMatrix(),this._state.rotateX=j(this.camera,this._state.rotateX,this.options.verticalFOV),W(this.view,this.camera,this._state)}onKeyUp(e){if(0==this.enabled)return;const t=Y[e.keyCode];t&&(this.moves.delete(t),this.view.notifyChange(void 0,!1),e.preventDefault())}onKeyDown(e){if(0==this.enabled)return;const t=Y[e.keyCode];t&&(this.moves.add(t),this.view.notifyChange(void 0,!1),e.preventDefault())}onContextMenu(e){e.preventDefault()}dispose(){this.eventListeners||(this.view.domElement.removeEventListener("mousedown",this._onMouseDown,!1),this.view.domElement.removeEventListener("touchstart",this._onMouseDown,!1),this.view.domElement.removeEventListener("mousemove",this._onMouseMove,!1),this.view.domElement.removeEventListener("touchmove",this._onMouseMove,!1),this.view.domElement.removeEventListener("mouseup",this._onMouseUp,!1),this.view.domElement.removeEventListener("touchend",this._onMouseUp,!1),this.view.domElement.removeEventListener("wheel",this._onMouseWheel,!1),this.view.domElement.removeEventListener("contextmenu",this._onContextMenu,!1),document.removeEventListener("keydown",this._onKeyDown,!1),document.removeEventListener("keyup",this._onKeyUp,!1)),this.focusOnMouseOver&&this.view.domElement.removeEventListener("mouseover",this._onFocus),this.focusOnClick&&this.view.domElement.removeEventListener("click",this._onFocus),this.dispatchEvent({type:"dispose"})}}const te=ee;var re=r(50040);const ne=new n.MeshBasicMaterial({color:16777215,depthTest:!1,transparent:!0,opacity:.5});function ie(e,t,r){e.position.copy(t),e.up.copy(t).normalize(),e.lookAt(r),e.updateMatrixWorld(!0)}const se=new n.Vector3,oe=new n.Vector3,ae=new n.Matrix3,le=new n.Vector3,ce=new n.Quaternion;function ue(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:()=>{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:()=>{},s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:()=>{};t.getPickingPositionFromDepth(t.eventToViewCoords(e),se);const o=t.camera3D.position.distanceTo(se),a=r?t.pickObjectsAt(e,-1,r):[];a.length&&a[0].distance1&&void 0!==arguments[1]?arguments[1]:{};super(e,t),this.isStreetControls=!0,this._onMouseOut=super.onMouseUp.bind(this),e.domElement.addEventListener("mouseout",this._onMouseOut),this.previousPosition=void 0,this.currentPosition=void 0,this.nextPosition=void 0,this.keyGoToNextPosition=90,this.keyGoToPreviousPosition=83,this.keySetCameraToCurrentPositionAndLookAtNext=65,this.keySetCameraToCurrentPositionAndLookAtPrevious=81,this.tweenGroup=new re.Ay.Group,this.surfaceGround=t.surfaceGround||function(){const e=new n.CircleGeometry(1,32);return new n.Mesh(e,ne)}(),this.surfaceWall=t.surfaceWall||function(){const e=new n.PlaneGeometry(4,2,1),t=new n.Mesh(e,ne);return t.rotateX(.5*-Math.PI),t}(),this.surfaces=new n.Object3D,this.surfaces.add(this.surfaceGround),this.surfaces.add(this.surfaceWall),this.view.scene.add(this.surfaces),this.wallMaxDistance=t.wallMaxDistance||1e3,this.animationDurationWall=t.animationDurationWall||200,this.buildingsLayer=t.buildingsLayer,this.computeTime=t.computeTime||he,this.offset=t.offset||4,this.transformationPositionPickOnTheGround=t.transformationPositionPickOnTheGround||(e=>e),this.end=this.camera.clone()}setCurrentPosition(e){this.currentPosition=e}setNextPosition(e){this.nextPosition=e}setPreviousPosition(e){this.previousPosition=e}onMouseUp(e){0!=this.enabled&&(super.onMouseUp(),this._stateOnMouseDrag?this._stateOnMouseDrag=!1:ue(e,this.view,this.buildingsLayer,this.onClickOnGround.bind(this),this.onClickOnWall.bind(this)))}onMouseMove(e){0!=this.enabled&&(super.onMouseMove(e),this._isMouseDown?(this._stateOnMouseDrag=!0,this.stopAnimations()):this.tween||(ue(e,this.view,this.buildingsLayer,((e,t)=>{ie(this.surfaces,e,t),this.surfaceGround.visible=!0,this.surfaceWall.visible=!1}),((e,t)=>{ie(this.surfaces,e,t),this.surfaceWall.visible=!0,this.surfaceGround.visible=!1})),this.view.notifyChange(this.surfaces)))}setCameraToCurrentPosition(e){e?this.setCameraOnPosition(this.currentPosition,this.previousPosition):this.setCameraOnPosition(this.currentPosition,this.nextPosition)}setCameraOnPosition(e,t){e&&t&&(this.camera.position.copy(e),this.view.tileLayer&&this.view.tileLayer.isGlobeLayer?this.camera.up.copy(e).normalize():this.camera.up.set(0,0,1),this.camera.lookAt(t),this.camera.updateMatrixWorld(),this.reset())}onClickOnGround(e){e=this.transformationPositionPickOnTheGround(e),this.view.tileLayer&&this.view.tileLayer.isGlobeLayer?le.copy(e).normalize():le.set(0,0,1),e.add(le.multiplyScalar(this.offset));const t=this.camera.position.distanceTo(e),r=this.computeTime(t);this.moveCameraTo(e,r)}onClickOnWall(e){this.camera.position.distanceTo(e){this.stopAnimations()})).onUpdate((e=>{this.camera.quaternion.slerpQuaternions(ce,this.end.quaternion,e.t)})).start(),this.tweenGroup.add(this.tween),this.animationFrameRequester=()=>{this.tweenGroup.update(),this.reset(),this.view.notifyChange(this.camera)},this.view.addFrameRequester(p.n7.BEFORE_RENDER,this.animationFrameRequester),this.view.notifyChange(this.camera)}moveCameraTo(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;if(!e)return Promise.resolve();const n=new Promise((e=>{t=e}));return this.stopAnimations(),this.tween=new re.Ay.Tween(this.camera.position).to(e.clone(),r).easing(re.Ay.Easing.Quadratic.Out).onComplete((()=>{this.stopAnimations(),t()})).start(),this.tweenGroup.add(this.tween),this.animationFrameRequester=()=>{this.tweenGroup.update(),this.view.notifyChange(this.camera)},this.view.addFrameRequester(p.n7.BEFORE_RENDER,this.animationFrameRequester),this.view.notifyChange(this.camera),n}stopAnimations(){this.tween&&(this.tween.stop(),this.tween=void 0,this.tweenGroup.removeAll()),this.animationFrameRequester&&(this.view.removeFrameRequester(p.n7.BEFORE_RENDER,this.animationFrameRequester),this.animationFrameRequester=null)}moveCameraToCurrentPosition(){this.moveCameraTo(this.currentPosition)}onKeyDown(e){0!=this.enabled&&(super.onKeyDown(e),e.keyCode==this.keyGoToNextPosition&&this.moveCameraTo(this.nextPosition),e.keyCode==this.keyGoToPreviousPosition&&this.moveCameraTo(this.previousPosition),e.keyCode==this.keySetCameraToCurrentPositionAndLookAtNext&&(this.setCameraToCurrentPosition(),this.view.notifyChange(this.view.camera3D)),e.keyCode==this.keySetCameraToCurrentPositionAndLookAtPrevious&&(this.setCameraToCurrentPosition(!0),this.view.notifyChange(this.view.camera3D)))}dispose(){this.view.domElement.removeEventListener("mouseout",this._onMouseOut,!1),super.dispose()}};var pe=r(72682);function fe(e,t,r=2){const n=t&&t.length,i=n?t[0]*r:e.length;let s=me(e,0,i,r,!0);const o=[];if(!s||s.next===s.prev)return o;let a,l,c;if(n&&(s=function(e,t,r,n){const i=[];for(let r=0,s=t.length;r80*r){a=1/0,l=1/0;let t=-1/0,n=-1/0;for(let s=r;st&&(t=r),i>n&&(n=i)}c=Math.max(t-a,n-l),c=0!==c?32767/c:0}return Ae(s,o,r,a,l,c,0),o}function me(e,t,r,n,i){let s;if(i===function(e,t,r,n){let i=0;for(let s=t,o=r-n;s0)for(let i=t;i=t;i-=n)s=Ne(i/n|0,e[i],e[i+1],s);return s&&Re(s,s.next)&&(Ue(s),s=s.next),s}function ge(e,t){if(!e)return e;t||(t=e);let r,n=e;do{if(r=!1,n.steiner||!Re(n,n.next)&&0!==Ie(n.prev,n,n.next))n=n.next;else{if(Ue(n),n=t=n.prev,n===n.next)break;r=!0}}while(r||n!==t);return t}function Ae(e,t,r,n,i,s,o){if(!e)return;!o&&s&&function(e,t,r,n){let i=e;do{0===i.z&&(i.z=Me(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){let t,r=1;do{let n,i=e;e=null;let s=null;for(t=0;i;){t++;let o=i,a=0;for(let e=0;e0||l>0&&o;)0!==a&&(0===l||!o||i.z<=o.z)?(n=i,i=i.nextZ,a--):(n=o,o=o.nextZ,l--),s?s.nextZ=n:e=n,n.prevZ=s,s=n;i=o}s.nextZ=null,r*=2}while(t>1)}(i)}(e,n,i,s);let a=e;for(;e.prev!==e.next;){const l=e.prev,c=e.next;if(s?ve(e,n,i,s):ye(e))t.push(l.i,e.i,c.i),Ue(e),e=c.next,a=c.next;else if((e=c)===a){o?1===o?Ae(e=xe(ge(e),t),t,r,n,i,s,2):2===o&&_e(e,t,r,n,i,s):Ae(ge(e),t,r,n,i,s,1);break}}}function ye(e){const t=e.prev,r=e,n=e.next;if(Ie(t,r,n)>=0)return!1;const i=t.x,s=r.x,o=n.x,a=t.y,l=r.y,c=n.y,u=is?i>o?i:o:s>o?s:o,p=a>l?a>c?a:c:l>c?l:c;let f=n.next;for(;f!==t;){if(f.x>=u&&f.x<=d&&f.y>=h&&f.y<=p&&Ce(i,a,s,l,o,c,f.x,f.y)&&Ie(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function ve(e,t,r,n){const i=e.prev,s=e,o=e.next;if(Ie(i,s,o)>=0)return!1;const a=i.x,l=s.x,c=o.x,u=i.y,h=s.y,d=o.y,p=al?a>c?a:c:l>c?l:c,g=u>h?u>d?u:d:h>d?h:d,A=Me(p,f,t,r,n),y=Me(m,g,t,r,n);let v=e.prevZ,x=e.nextZ;for(;v&&v.z>=A&&x&&x.z<=y;){if(v.x>=p&&v.x<=m&&v.y>=f&&v.y<=g&&v!==i&&v!==o&&Ce(a,u,l,h,c,d,v.x,v.y)&&Ie(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==i&&x!==o&&Ce(a,u,l,h,c,d,x.x,x.y)&&Ie(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;v&&v.z>=A;){if(v.x>=p&&v.x<=m&&v.y>=f&&v.y<=g&&v!==i&&v!==o&&Ce(a,u,l,h,c,d,v.x,v.y)&&Ie(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;x&&x.z<=y;){if(x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==i&&x!==o&&Ce(a,u,l,h,c,d,x.x,x.y)&&Ie(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function xe(e,t){let r=e;do{const n=r.prev,i=r.next.next;!Re(n,i)&&Be(n,r,r.next,i)&&De(n,i)&&De(i,n)&&(t.push(n.i,r.i,i.i),Ue(r),Ue(r.next),r=e=i),r=r.next}while(r!==e);return ge(r)}function _e(e,t,r,n,i,s){let o=e;do{let e=o.next.next;for(;e!==o.prev;){if(o.i!==e.i&&Te(o,e)){let a=Oe(o,e);return o=ge(o,o.next),a=ge(a,a.next),Ae(o,t,r,n,i,s,0),void Ae(a,t,r,n,i,s,0)}e=e.next}o=o.next}while(o!==e)}function be(e,t){return e.x-t.x}function we(e,t){const r=function(e,t){let r=t;const n=e.x,i=e.y;let s,o=-1/0;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){const e=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(e<=n&&e>o&&(o=e,s=r.x=r.x&&r.x>=l&&n!==r.x&&Ce(is.x||r.x===s.x&&Ee(s,r)))&&(s=r,u=t)}r=r.next}while(r!==a);return s}(e,t);if(!r)return t;const n=Oe(r,e);return ge(n,n.next),ge(r,r.next)}function Ee(e,t){return Ie(e.prev,e,t.prev)<0&&Ie(t.next,e,e.next)<0}function Me(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Se(e){let t=e,r=e;do{(t.x=(e-o)*(s-a)&&(e-o)*(n-a)>=(r-o)*(t-a)&&(r-o)*(s-a)>=(i-o)*(n-a)}function Te(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&Be(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(De(e,t)&&De(t,e)&&function(e,t){let r=e,n=!1;const i=(e.x+t.x)/2,s=(e.y+t.y)/2;do{r.y>s!=r.next.y>s&&r.next.y!==r.y&&i<(r.next.x-r.x)*(s-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(Ie(e.prev,e,t.prev)||Ie(e,t.prev,t))||Re(e,t)&&Ie(e.prev,e,e.next)>0&&Ie(t.prev,t,t.next)>0)}function Ie(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Re(e,t){return e.x===t.x&&e.y===t.y}function Be(e,t,r,n){const i=Le(Ie(e,t,r)),s=Le(Ie(e,t,n)),o=Le(Ie(r,n,e)),a=Le(Ie(r,n,t));return i!==s&&o!==a||!(0!==i||!Pe(e,r,t))||!(0!==s||!Pe(e,n,t))||!(0!==o||!Pe(r,e,n))||!(0!==a||!Pe(r,t,n))}function Pe(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function Le(e){return e>0?1:e<0?-1:0}function De(e,t){return Ie(e.prev,e,e.next)<0?Ie(e,t,e.next)>=0&&Ie(e,e.prev,t)>=0:Ie(e,t,e.prev)<0||Ie(e,e.next,t)<0}function Oe(e,t){const r=Fe(e.i,e.x,e.y),n=Fe(t.i,t.x,t.y),i=e.next,s=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,s.next=n,n.prev=s,n}function Ne(e,t,r,n){const i=Fe(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Ue(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Fe(e,t,r){return{i:e,x:t,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}var ke=r(36845),ze=r(70515),Ge=r(47155);const Qe=n.MathUtils.DEG2RAD,Ve=new n.Matrix4,He=new n.Vector3,je=new n.Vector3,qe=(new n.Vector3).set(0,0,1),We=new o.A("EPSG:4326",0,0,0),Ye=new n.Euler,Xe=new n.Quaternion;function Ke(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Quaternion;return e?t.set(0,0,0,1):Ke}const $e={quaternionFromRollPitchHeading(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new n.Quaternion;return e*=Qe,t*=Qe,r*=Qe,i.setFromEuler(Ye.set(-t,-e,-r,"YXZ"))},quaternionFromOmegaPhiKappa(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new n.Quaternion;return e*=Qe,t*=Qe,r*=Qe,i.setFromEuler(Ye.set(e,t,r,"XYZ")),i.set(i.w,i.z,-i.y,-i.x),i},quaternionFromAttitude(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Quaternion;return void 0!==e.roll||void 0!==e.pitch||void 0!==e.heading?this.quaternionFromRollPitchHeading(e.roll,e.pitch,e.heading,t):void 0!==e.omega||void 0!==e.phi||void 0!==e.kappa?this.quaternionFromOmegaPhiKappa(e.omega,e.phi,e.kappa,t):t.set(0,0,0,1)},quaternionFromEnuToGeocent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Quaternion;return e?this.quaternionFromEnuToGeocent()(e,t):function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Quaternion;const r=e.geodesicNormal;return 0==r.x&&0==r.y?t.set(0,0,0,1):(je.set(-r.y,r.x,0).normalize(),He.crossVectors(r,je),Ve.makeBasis(je,He,r),t.setFromRotationMatrix(Ve))}},quaternionFromGeocentToEnu(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Quaternion;if(e)return this.quaternionFromGeocentToEnu()(e,t);const r=this.quaternionFromEnuToGeocent();return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Quaternion;return r(e,t).conjugate()}},quaternionFromLCCToEnu(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new n.Quaternion;if(t)return this.quaternionFromLCCToEnu(e)(t,r);const i=Math.sin(e.lat0);return function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Quaternion;const s=t.as(We.crs,We).longitude*Qe;return r.setFromAxisAngle(qe,i*(e.long0-s))}},quaternionFromEnuToLCC(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new n.Quaternion;if(t)return this.quaternionFromEnuToLCC(e)(t,r);const i=this.quaternionFromLCCToEnu(e);return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Quaternion;return i(e,t).conjugate()}},quaternionFromTMercToEnu(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new n.Quaternion;if(t)return this.quaternionFromTMercToEnu(e)(t,r);const i=e.a*e.a,s=e.b*e.b,o=e.e*e.e,a=e.e?o/(1-o):i/s-1;return function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Quaternion;t.as(We.crs,We);const i=We.longitude*Qe,s=We.latitude*Qe,o=e.long0-i,l=Math.cos(s),c=Math.sin(s),u=l*l,h=o*o*u,d=a*u;return r.setFromAxisAngle(qe,o*c*(1+h/3*(1+3*d+2*d*d)+h*h*(2-c/l)/15))}},quaternionFromEnuToTMerc(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new n.Quaternion;if(t)return this.quaternionFromEnuToTMerc(e)(t,r);const i=this.quaternionFromTMercToEnu(e);return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Quaternion;return i(e,t).conjugate()}},quaternionFromLongLatToEnu(e){return Ke(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Quaternion)},quaternionFromEnuToLongLat(e){return Ke(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Quaternion)},quaternionUnimplemented(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new n.Quaternion;return console.warn("This quaternion function is not implemented for projections of type",e.projName),Ke(t,r)},quaternionFromEnuToCRS(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new n.Quaternion;if(t)return this.quaternionFromEnuToCRS(e)(t,r);const s=e.projName?e:i.A.defs(e);switch(s.projName){case"geocent":return this.quaternionFromEnuToGeocent();case"lcc":return this.quaternionFromEnuToLCC(s);case"tmerc":return this.quaternionFromEnuToTMerc(s);case"longlat":return this.quaternionFromEnuToLongLat();default:return this.quaternionUnimplemented(s)}},quaternionFromCRSToEnu(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new n.Quaternion;if(t)return this.quaternionFromCRSToEnu(e)(t,r);const s=e.projName?e:i.A.defs(e);switch(s.projName){case"geocent":return this.quaternionFromGeocentToEnu();case"lcc":return this.quaternionFromLCCToEnu(s);case"tmerc":return this.quaternionFromTMercToEnu(s);case"longlat":return this.quaternionFromLongLatToEnu();default:return this.quaternionUnimplemented(s)}},quaternionFromCRSToCRS(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new n.Quaternion;if(r)return this.quaternionFromCRSToCRS(e,t)(r,i);if(e==t)return function(){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Quaternion).set(0,0,0,1)};const s=this.quaternionFromCRSToEnu(e),o=this.quaternionFromEnuToCRS(t);return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Quaternion;return o(e,t).multiply(s(e,Xe))}}};var Je=r(48306);const Ze=new o.A("EPSG:4326",0,0,0),et=new Je.J,tt=new Je.Ay;let rt;const nt=new n.Vector2,it=new n.Vector2,st=new n.Vector3,ot=new n.Vector3,at=new n.Vector3,lt=new n.Vector3,ct=new s.A("EPSG:4326",0,0,0,0),ut=new n.Color,ht="EPSG:4326";class dt extends n.Group{#C;#T;#I=(()=>new n.Group)();#R=(()=>new n.Group)();constructor(e,t){super(),this.meshes=(new n.Group).add(...e),this.#I=(new n.Group).add(this.meshes),this.#I.quaternion.copy(t.quaternion),this.#I.position.copy(t.position),this.#I.scale.copy(t.scale),this.#I.updateMatrix(),this.#T=t.crs,this.#C=this.#T,this.extent=t.extent,this.add(this.#R.add(this.#I))}as(e){if(this.#C!==e)if(this.#C=e,e==this.#T)this.place.position.set(0,0,0),this.position.set(0,0,0),this.scale.set(1,1,1),this.quaternion.identity();else{Ze.crs=this.#T,this.extent.isExtent?(ct.copy(this.extent).applyMatrix4(this.#I.matrix),ct.as(Ze.crs,ct)):this.extent.toExtent(Ze.crs,ct),ct.spatialEuclideanDimensions(nt),ct.planarDimensions(it),it.x&&it.y&&this.scale.copy(nt).divide(it).setZ(1),this.#R.position.copy(this.#I.position).negate(),Ze.setFromVector3(this.#I.position);const t="EPSG:3857"==this.#T?ht:this.#T;$e.quaternionFromCRSToCRS(t,e)(Ze.as(ht),this.quaternion),Ze.as(e,Ze).toVector3(this.position)}return this}}function pt(e){return e?"Color"==e.type?e:ut.set(e):ut.set(16777215*Math.random())}function ft(e,t){return t<=255?new Uint8Array(e):t<=65535?new Uint16Array(e):new Uint32Array(e)}function mt(e,t,r,n,i){const s=e.length;e.length+=6*(n-1);for(let o=r,a=s;ot);let a=0;const l=new Float32Array(r);lt.setFromMatrixScale(et.collection.matrixWorldInverse),st.set(0,0,1).multiply(lt);const c=[];et.setFeature(e);for(const t of e.geometries){const r=t.indices[0].offset,n=t.indices[0].count,u=o(t.properties,a);et.setGeometry(t);for(let t=3*r,o=r;o1&&console.warn("Too many differents point.radius, only the first one will be used"),new n.Points(u,t.pointMaterial)}function At(e,t,r){const n=(t*=3)+3*r;let i=0;for(let r=n-3,s=t;s{e instanceof n.Mesh&&(e.updateMatrixWorld(),e.geometry.applyMatrix4(e.matrixWorld),t.push(e))})),t}(i).forEach((n=>e.add(yt(n,r,t)))),e}throw new Error("The format of the model object provided in the style (layer.style.point.model.object) is not supported. Only THREE.Mesh or THREE.Object3D are supported.")}(e),r.isInstancedMesh=!0}catch(n){r=gt(e,t)}else r=gt(e,t);break;case ke.Xs.LINE:r=function(e,t){const r=e.vertices,i=new Uint8Array(r.length),s=r.length/3,o=new Uint32Array(s),a=t.batchId||((e,t)=>t);let l=0;const c=new Float32Array(r.length),u=new n.BufferGeometry,h=[];et.setFeature(e);const d=ft(2*(s-e.geometries.length),s);let p=0;lt.setFromMatrixScale(et.collection.matrixWorldInverse),st.set(0,0,1).multiply(lt);for(const t of e.geometries){et.setGeometry(t);const r=a(t.properties,l),n=t.indices[0].offset;if(n>65535){console.warn("Feature to Line: integer overflow, too many points in lines");break}const s=n+t.indices[0].count;for(let t=3*n,a=n;a1&&console.warn("Too many differents stroke.width, only the first one will be used"),u.setAttribute("position",new n.BufferAttribute(c,3)),u.setAttribute("color",new n.BufferAttribute(i,3,!0)),u.setAttribute("batchId",new n.BufferAttribute(o,1)),u.setIndex(new n.BufferAttribute(d,1)),new n.LineSegments(u,t.lineMaterial)}(e,t);break;case ke.Xs.POLYGON:r=rt.fill&&Object.keys(rt.fill).includes("extrusion_height")?function(e,t){const r=e.vertices,i=new Float32Array(2*r.length),s=r.length/3,o=new Uint8Array(2*r.length),a=[],l=new Uint32Array(i.length/3),c=t.batchId||((e,t)=>t);let u=0;et.setFeature(e),lt.setFromMatrixScale(et.collection.matrixWorldInverse),st.set(0,0,1).multiply(lt),Ze.setCrs(et.collection.crs);for(const t of e.geometries){et.setGeometry(t);const n=t.indices[0].offset,h=t.indices.slice(-1)[0],d=h.offset+h.count,p=d-n,f=t.indices[0].ccw??At(r,n,p)<0,m=3*n,g=n+s,A=c(t.properties,u);for(let t=m,a=m+r.length,c=n;te.offset-n)).slice(1),3),v=a.length;a.length+=y.length;for(let e=0;et);et.setFeature(e),lt.setFromMatrixScale(et.collection.matrixWorldInverse),st.set(0,0,1).multiply(lt);let l=0;for(const t of e.geometries){const n=t.indices[0].offset;if(n>4294967295){console.warn("Feature to Polygon: integer overflow, too many points in polygons");break}et.setGeometry(t);const c=t.indices.slice(-1)[0],u=c.offset+c.count,h=3*n,d=a(t.properties,l);for(let t=h,s=n;te.offset-n)).slice(1),3),f=s.length;s.length+=p.length;for(let e=0;e0&&void 0!==arguments[0]?arguments[0]:{};return(0,Ge.nt)(e),function(t){if(!t)return;e.pointMaterial||(e.pointMaterial=(0,ze.A)(new n.PointsMaterial,this),e.lineMaterial=(0,ze.A)(new n.LineBasicMaterial,this),e.polygonMaterial=(0,ze.A)(new n.MeshBasicMaterial,this)),rt=this?.style||(e.style?new Je.Ay(e.style):tt),et.setCollection(t);const r=t.features;if(!r||0==r.length)return;const i=r.map((t=>{const r=vt(t,e);return r.layer=this,r}));return new dt(i,t)}}};var _t=r(19073),bt=r(18590),wt=r(10733);const Et={color_layers_pars_fragment:"struct Layer {\n int textureOffset;\n int crs;\n int effect_type;\n float effect_parameter;\n float opacity;\n bool transparent;\n};\n\n#include \n\nuniform sampler2D colorTextures[NUM_FS_TEXTURES];\nuniform vec4 colorOffsetScales[NUM_FS_TEXTURES];\nuniform Layer colorLayers[NUM_FS_TEXTURES];\nuniform int colorTextureCount;\n\nvec3 uvs[NUM_CRS];\n\nfloat getBorderDistance(vec2 uv) {\n vec2 p2 = min(uv, 1. -uv);\n return min(p2.x, p2.y);\n}\n\nfloat tolerance = 0.99;\n\nvec4 applyWhiteToInvisibleEffect(vec4 color) {\n float a = dot(color.rgb, vec3(0.333333333));\n if (a >= tolerance) {\n color.a = 0.0;\n }\n return color;\n}\n\nvec4 applyLightColorToInvisibleEffect(vec4 color, float intensity) {\n float a = max(0.05,1. - length(color.xyz - 1.));\n color.a *= 1.0 - pow(abs(a), intensity);\n color.rgb *= color.rgb * color.rgb;\n return color;\n}\n\n#if defined(DEBUG)\nuniform bool showOutline;\nuniform vec3 outlineColors[NUM_CRS];\nuniform float outlineWidth;\n\nvec4 getOutlineColor(vec3 outlineColor, vec2 uv) {\n float alpha = 1. - clamp(getBorderDistance(uv) / outlineWidth, 0., 1.);\n return vec4(outlineColor, alpha);\n}\n#endif\n\nuniform float minBorderDistance;\nvec4 getLayerColor(int textureOffset, sampler2D tex, vec4 offsetScale, Layer layer) {\n if ( textureOffset >= colorTextureCount ) return vec4(0);\n\n vec3 uv;\n // #pragma unroll_loop\n for ( int i = 0; i < NUM_CRS; i ++ ) {\n if ( i == layer.crs ) uv = uvs[ i ];\n }\n\n float borderDistance = getBorderDistance(uv.xy);\n if (textureOffset != layer.textureOffset + int(uv.z) || borderDistance < minBorderDistance ) return vec4(0);\n vec4 color = texture2D(tex, pitUV(uv.xy, offsetScale));\n if (layer.effect_type == 3) {\n #include \n } else {\n if (layer.transparent && color.a != 0.0) {\n color.rgb /= color.a;\n }\n\n if (layer.effect_type == 1) {\n color = applyLightColorToInvisibleEffect(color, layer.effect_parameter);\n } else if (layer.effect_type == 2) {\n color = applyWhiteToInvisibleEffect(color);\n }\n }\n color.a *= layer.opacity;\n return color;\n}\n",custom_body_colorLayer:"// no custom body",custom_header_colorLayer:"// no custom header",elevation_pars_vertex:"#if NUM_VS_TEXTURES > 0\n struct Layer {\n float scale;\n float bias;\n int mode;\n float zmin;\n float zmax;\n };\n\n uniform Layer elevationLayers[NUM_VS_TEXTURES];\n uniform sampler2D elevationTextures[NUM_VS_TEXTURES];\n uniform vec4 elevationOffsetScales[NUM_VS_TEXTURES];\n uniform int elevationTextureCount;\n uniform float geoidHeight;\n\n highp float decode32(highp vec4 rgba) {\n highp float Sign = 1.0 - step(128.0,rgba[0])*2.0;\n highp float Exponent = 2.0 * mod(rgba[0],128.0) + step(128.0,rgba[1]) - 127.0;\n highp float Mantissa = mod(rgba[1],128.0)*65536.0 + rgba[2]*256.0 +rgba[3] + float(0x800000);\n highp float Result = Sign * exp2(Exponent) * (Mantissa * exp2(-23.0 ));\n return Result;\n }\n\n float getElevationMode(vec2 uv, sampler2D tex, int mode) {\n if (mode == ELEVATION_RGBA)\n return decode32(texture2D( tex, uv ).abgr * 255.0);\n if (mode == ELEVATION_DATA || mode == ELEVATION_COLOR)\n return texture2D( tex, uv ).r;\n return 0.;\n }\n\n float getElevation(vec2 uv, sampler2D tex, vec4 offsetScale, Layer layer) {\n // Elevation textures are inverted along the y-axis\n uv = vec2(uv.x, 1.0 - uv.y);\n uv = uv * offsetScale.zw + offsetScale.xy;\n float d = clamp(getElevationMode(uv, tex, layer.mode), layer.zmin, layer.zmax);\n return d * layer.scale + layer.bias;\n }\n#endif\n",elevation_vertex:"#if NUM_VS_TEXTURES > 0\n if(elevationTextureCount > 0) {\n float elevation = getElevation(uv, elevationTextures[0], elevationOffsetScales[0], elevationLayers[0]);\n transformed += elevation * normal;\n }\n#endif\n",geoid_vertex:"transformed += geoidHeight * normal;\n",fog_fragment:"#if defined(USE_FOG)\n float fogFactor = 1. - min( exp(-vFogDepth / fogDistance), 1.);\n gl_FragColor.rgb = mix(gl_FragColor.rgb, fogColor, fogFactor);\n#endif\n",fog_pars_fragment:"#if defined(USE_FOG)\nuniform vec3 fogColor;\nuniform float fogDistance;\nvarying float vFogDepth;\n#endif\n",lighting_fragment:"if (lightingEnabled) {\n float light = min(2. * dot(vNormal, lightPosition), 1.);\n gl_FragColor.rgb *= light;\n}\n",lighting_pars_fragment:"uniform bool lightingEnabled;\nuniform vec3 lightPosition;\nvarying vec3 vNormal;\n",mode_depth_fragment:"#if defined(USE_LOGDEPTHBUF)\ngl_FragColor = packDepthToRGBA(gl_FragDepthEXT);\n#else\nfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\ngl_FragColor = packDepthToRGBA(fragCoordZ);\n#endif\n",mode_id_fragment:"// 16777216.0 == 256.0 * 256.0 * 256.0\ngl_FragColor = packDepthToRGBA(float(objectId) / 16777216.0);\n",mode_pars_fragment:"#if MODE == MODE_ID || MODE == MODE_DEPTH\n#include \n#endif\n\n#if MODE == MODE_ID\nuniform int objectId;\n#endif\n",overlay_fragment:"gl_FragColor.rgb = mix(gl_FragColor.rgb, overlayColor, overlayAlpha);\n",overlay_pars_fragment:"uniform vec3 overlayColor;\nuniform float overlayAlpha;\n",pitUV:"vec2 pitUV(vec2 uv, vec4 pit)\n{\n return uv * pit.zw + vec2(pit.x, 1.0 - pit.w - pit.y);\n}\n\n",precision_qualifier:"precision highp float;\nprecision highp int;\n",projective_texturing_vertex:"for(int i = 0; i < ORIENTED_IMAGES_COUNT; ++i)\n projectiveTextureCoords[i] = projectiveTextureMatrix[i] * mvPosition;\n",projective_texturing_pars_vertex:"uniform mat4 projectiveTextureMatrix[ORIENTED_IMAGES_COUNT];\nvarying vec4 projectiveTextureCoords[ORIENTED_IMAGES_COUNT];\n",projective_texturing_pars_fragment:"uniform sampler2D projectiveTexture[ORIENTED_IMAGES_COUNT];\nuniform sampler2D mask[ORIENTED_IMAGES_COUNT];\nvarying vec4 projectiveTextureCoords[ORIENTED_IMAGES_COUNT];\nuniform float projectiveTextureAlphaBorder;\nuniform float opacity;\nuniform bool boostLight;\n\nstruct Distortion {\n vec2 size;\n#if USE_DISTORTION\n vec2 pps;\n vec4 polynom;\n vec3 l1l2;\n#endif\n};\n\nuniform Distortion projectiveTextureDistortion[ORIENTED_IMAGES_COUNT];\n\nfloat getAlphaBorder(vec2 p)\n{\n vec2 d = clamp(projectiveTextureAlphaBorder * min(p, 1. - p), 0., 1.);\n return min(d.x, d.y);\n}\n\n#if USE_DISTORTION\nvoid distort(inout vec2 p, vec4 polynom, vec2 pps)\n{\n vec2 v = p - pps;\n float v2 = dot(v, v);\n if (v2 > polynom.w) {\n p = vec2(-1.);\n }\n else {\n p += (v2 * (polynom.x + v2 * (polynom.y + v2 * polynom.z) ) ) * v;\n }\n}\n\nvoid distort(inout vec2 p, vec4 polynom, vec3 l1l2, vec2 pps)\n{\n if ((l1l2.x == 0.) && (l1l2.y == 0.)) {\n distort(p, polynom, pps);\n } else {\n vec2 AB = (p - pps) / l1l2.z;\n float R = length(AB);\n float lambda = atan(R) / R;\n vec2 ab = lambda * AB;\n float rho2 = dot(ab, ab);\n float r357 = 1. + rho2* (polynom.x + rho2* (polynom.y + rho2 * polynom.z));\n p = pps + l1l2.z * (r357 * ab + vec2(dot(l1l2.xy, ab), l1l2.y * ab.x));\n }\n}\n#endif\n\nvec4 mixBaseColor(vec4 aColor, vec4 baseColor) {\n #ifdef USE_BASE_MATERIAL\n baseColor.rgb = aColor.a == 1.0 ? aColor.rgb : mix(baseColor, aColor, aColor.a).rgb;\n baseColor.a = min(1.0, aColor.a + baseColor.a);\n #else\n baseColor.rgb += aColor.rgb * aColor.a;\n baseColor.a += aColor.a;\n #endif\n return baseColor;\n}\n\nvec4 projectiveTextureColor(vec4 coords, Distortion distortion, sampler2D tex, sampler2D mask, vec4 baseColor) {\n vec3 p = coords.xyz / coords.w;\n if(p.z * p.z < 1.) {\n#if USE_DISTORTION\n p.xy *= distortion.size;\n distort(p.xy, distortion.polynom, distortion.l1l2, distortion.pps);\n p.xy /= distortion.size;\n#endif\n\n float d = getAlphaBorder(p.xy) * texture2D(mask, p.xy).r;\n\n if(d > 0.) {\n\n#if DEBUG_ALPHA_BORDER\n vec3 r = texture2D(tex, p.xy).rgb;\n return mixBaseColor(vec4( r.r * d, r.g, r.b, 1.0), baseColor);\n#else\n vec4 color = texture2D(tex, p.xy);\n color.a *= d;\n if (boostLight) {\n return mixBaseColor(vec4(sqrt(color.rgb), color.a), baseColor);\n } else {\n return mixBaseColor(color, baseColor);\n }\n#endif\n\n }\n }\n return mixBaseColor(vec4(0.), baseColor);\n}\n"},Mt=new class{constructor(e,t){this.path=t,this.target=e,this.install()}customHeaderColorLayer(e){Et.custom_header_colorLayer=e,this.target[`${this.path}custom_header_colorLayer`]=e}customBodyColorLayer(e){Et.custom_body_colorLayer=e,this.target[`${this.path}custom_body_colorLayer`]=e}install(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.target,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Et,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.path;return Object.keys(t).forEach((n=>{Object.defineProperty(this,n,{get:()=>t[n]}),e[r+n]=t[n]})),e}}(n.ShaderChunk,"itowns/"),St=Mt;var Ct=r(99234),Tt=r(2015),It=r(93320),Rt=r(3837),Bt=r(61276);const Pt=new Je.Ay,Lt=new Je.J;let Dt;function Ot(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[{offset:0,count:1}],n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0;if(0===t.length)return;const l=new Path2D;for(const e of r)if(e.extent&&s.A.intersectsExtent(e.extent,i)){const r=e.offset*n,i=r+e.count*n;l.moveTo(t[r],t[r+1]);for(let e=r+n;e(e.generateMipmaps=!1,e.magFilter=t.magFilter||n.LinearFilter,e.minFilter=t.minFilter||n.LinearFilter,e),Kt={convert(e,t,r){let i;if(e.isFeatureCollection){const s=r.source.backgroundLayer,o=s&&s.paint?new n.Color(s.paint["background-color"]):void 0;t.toExtent(r.crs,Yt),i=Wt.createTextureFromFeature(e,Yt,r.subdivisionThreshold,r.style,o),i.features=e,i.extent=t}else{if(!e.isTexture)throw new Error("Data type is not supported to convert into texture");i=e}return r.isColorLayer?function(e,t){return e.anisotropy=16,e.premultiplyAlpha=t.transparent,Xt(e,t)}(i,r):r.isElevationLayer?(i.flipY&&(i.flipY=!1),Xt(i,r)):void 0}};var $t=r(99487);class Jt extends Bt.A{constructor(e,t){const{cacheLifeTime:r=$t.W.TEXTURE,minFilter:n,magFilter:i,...s}=t;super(e,{...s,cacheLifeTime:r}),this.minFilter=n,this.magFilter=i}convert(e,t){return Kt.convert(e,t,this)}delete(e){e&&this.cache.clear();for(const e of this.parent.level0Nodes)e.traverse(T(this.id))}}const Zt=Jt;var er=r(24051);const tr=class extends Zt{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,Ge.K3)(t);const{effect_type:r=0,effect_parameter:n=1,transparent:i,...s}=t;super(e,s),this.isColorLayer=!0,this.visible=!0,this.defineLayerProperty("visible",this.visible),this.opacity=1,this.defineLayerProperty("opacity",this.opacity),this.sequence=0,this.defineLayerProperty("sequence",this.sequence),this.transparent=i||this.opacity<1,this.noTextureParentOutsideLimit=!!t.source&&t.source.isFileSource,this.effect_type=r,this.effect_parameter=n,this.buildExtent=!0,this.structure="2d"}setupRasterNode(e){const t=new er.p7(e.material,this);return e.material.addLayer(t),e.material.setSequence(this.parent.colorLayersOrder),t}update(e,t,r,n){return S(e,this,r,n)}},rr=class extends Zt{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{scale:r=1,noDataValue:n,clampValues:i,useRgbaTextureElevation:s,useColorTextureElevation:o,colorTextureElevationMinZ:a,colorTextureElevationMaxZ:l,bias:c,mode:u,...h}=t;super(e,h),this.isElevationLayer=!0,this.noDataValue=n,(t.zmin||t.zmax)&&console.warn("Config using zmin and zmax are deprecated, use {clampValues: {min, max}} structure."),this.zmin=i?.min??t.zmin,this.zmax=i?.max??t.zmax,this.defineLayerProperty("scale",r),this.useRgbaTextureElevation=s,this.useColorTextureElevation=o,this.colorTextureElevationMinZ=a,this.colorTextureElevationMaxZ=l,this.bias=c,this.mode=u}setupRasterNode(e){const t=new er.Is(e.material,this);e.material.addLayer(t),e.material.setSequenceElevation(this.id);const r=()=>e.setBBoxZ({min:t.min,max:t.max,scale:this.scale});return r(),t.addEventListener("rasterElevationLevelChanged",r),this.addEventListener("scale-property-changed",r),e.addEventListener("dispose",(()=>{this.removeEventListener("scale-property-changed",r)})),t}update(e,t,r,n){return C(e,this,r,n)}};var nr=r(80736);class ir extends nr.A{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{object3d:r,batchId:i,onMeshCreated:s,accurate:o=!0,filter:a,...l}=t;super(e,r||new n.Group,l),this.update=_.update,this.convert=xt.convert({batchId:i}),this.onMeshCreated=s,this.isFeatureGeometryLayer=!0,this.accurate=o,this.buildExtent=!this.accurate,this.filter=a}preUpdate(e,t){t.has(this.parent)&&this.object3d.clear()}}const sr=ir;var or=r(10456);const ar=new n.Vector3,lr=new n.Mesh,cr=new n.Box3;function ur(e,t,r,i,s){return e.camera.camera3D.isOrthographicCamera?function(e,t,r,i){const s=r/2**i.depth,o=new n.Vector4(s);o.applyMatrix4(e.camera.camera3D.projectionMatrix);const a=.5*o.x*e.camera.width,l=.5*o.y*e.camera.height,c=Math.sqrt(a*a+l*l);return Math.max(0,c-t)}(e,t,r,i):function(e,t,r,n,i){if(i<=0)return 1/0;const s=r/2**n.depth,o=e.camera.preSSE*s/i;return Math.max(0,o-t)}(e,t,r,i,s)}function hr(e){e.obj&&(e.obj.visible=!1),e.notVisibleSince||(e.notVisibleSince=Date.now(),e.sse=-1);for(const t of e.children)hr(t)}function dr(e){e.material.intensityRange?.set(e.minIntensityRange,e.maxIntensityRange)}function pr(e){e.material.elevationRange?.set(e.minElevationRange,e.maxElevationRange)}function fr(e){e.material.angleRange?.set(e.minAngleRange,e.maxAngleRange)}lr.geometry.boundingBox=cr;class mr extends nr.A{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{object3d:r=new n.Group,group:i=new n.Group,bboxes:s=new n.Group,octreeDepthLimit:o=-1,pointBudget:a=2e6,pointSize:l=2,sseThreshold:c=2,minIntensityRange:u=1,maxIntensityRange:h=65536,minElevationRange:d=0,maxElevationRange:p=1e3,minAngleRange:f=-90,maxAngleRange:m=90,material:g={},mode:A=L.qW.COLOR,...y}=t;super(e,r,y),this.isPointCloudLayer=!0,this.protocol="pointcloud",this.group=i,this.object3d.add(this.group),this.bboxes=s||new n.Group,this.bboxes.visible=!1,this.object3d.add(this.bboxes),this.group.updateMatrixWorld(),this.octreeDepthLimit=o,this.pointBudget=a,this.pointSize=l,this.sseThreshold=c,this.defineLayerProperty("minIntensityRange",u,dr),this.defineLayerProperty("maxIntensityRange",h,dr),this.defineLayerProperty("minElevationRange",d,pr),this.defineLayerProperty("maxElevationRange",p,pr),this.defineLayerProperty("minAngleRange",f,fr),this.defineLayerProperty("maxAngleRange",m,fr),this.material=g,this.material.isMaterial||(this.material.intensityRange=new n.Vector2(this.minIntensityRange,this.maxIntensityRange),this.material.elevationRange=new n.Vector2(this.minElevationRange,this.maxElevationRange),this.material.angleRange=new n.Vector2(this.minAngleRange,this.maxAngleRange),this.material=new L.Ay(this.material)),this.mode=A||L.qW.COLOR,this.root=void 0}preUpdate(e,t){let r;e.camera.preSSE=e.camera.height/(2*Math.tan(.5*n.MathUtils.degToRad(e.camera.camera3D.fov))),this.material&&(this.material.visible=this.visible,this.material.opacity=this.opacity,this.material.transparent=this.opacity<1||this.material.userData.needTransparency[this.material.mode],this.material.size=this.pointSize,this.material.scale=e.camera.preSSE,this.material.updateUniforms&&this.material.updateUniforms());for(const e of t.values()){if(e.isCamera||e==this)return[this.root];if(void 0!==e.obj&&e.obj.isPoints&&e.obj.layer==this)if(r){if(r=e.findCommonAncestor(r),!r)return[this.root]}else r=e}return r?[r]:[this.root]}update(e,t,r){if(r.visible=!1,this.octreeDepthLimit>=0&&this.octreeDepthLimit!e.requester.visible||!this.visible}).then((e=>{this.onPointsCreated&&this.onPointsCreated(t,e),r.obj=e,r.tightbbox=e.tightbbox,this.group.add(r.obj),r.obj.updateMatrixWorld(!0),r.promise=null}),(e=>{e.isCancelledCommandException&&(r.promise=null)}))}if(r.children&&r.children.length){const n=i.distanceToPoint(ar);if(r.sse=ur(e,t.pointSize,t.spacing,r,n)/this.sseThreshold,r.sse>=1)return r.children;for(const e of r.children)hr(e)}}else hr(r)}postUpdate(){this.displayedCount=0;for(const e of this.group.children)if(e.visible){const t=e.geometry.attributes.position.count;e.geometry.setDrawRange(0,t),this.displayedCount+=t}if(this.displayedCount>this.pointBudget)if(this.supportsProgressiveDisplay){const e=this.pointBudget/this.displayedCount;for(const t of this.group.children)if(t.visible){const r=Math.floor(t.geometry.drawRange.count*e);r>0?t.geometry.setDrawRange(0,r):t.visible=!1}this.displayedCount*=e}else{this.group.children.sort(((e,t)=>t.userData.node.sse-e.userData.node.sse));let e=!1;this.displayedCount=0;for(const t of this.group.children){const r=t.geometry.attributes.position.count;e||this.displayedCount+r>this.pointBudget?(t.visible=!1,e=!0):this.displayedCount+=r}}const e=Date.now();for(let t=this.group.children.length-1;t>=0;t--){const r=this.group.children[t];!r.visible&&e-r.userData.node.notVisibleSince>1e4&&(this.group.children.splice(t,1),r.geometry.dispose(),r.material=null,r.geometry=null,r.userData.node.obj=null)}}pickObjectsAt(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return or.A.pickPointsAt(e,t,r,this,n)}getObjectToUpdateForAttachedLayers(e){if(e.obj){const t=e.parent;return t&&t.obj?{element:e.obj,parent:t.obj}:{element:e.obj}}}}const gr=mr;class Ar extends n.EventDispatcher{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;super(),this.numPoints=e,this.layer=t,this.children=[],this.bbox=new n.Box3,this.sse=-1}add(e,t){this.children.push(e),e.parent=this,this.createChildAABB(e,t)}load(){return this.octreeIsLoaded||this.loadOctree(),this.layer.source.fetcher(this.url,this.layer.source.networkOptions).then((e=>this.layer.source.parse(e,{out:this.layer,in:this.layer.source})))}findCommonAncestor(e){return e.depth!=this.depth?e.depth1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2?arguments[2]:void 0;super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t),this.childrenBitField=e,this.id="",this.depth=0,this.baseurl=t.source.baseurl}add(e,t,r){super.add(e,t),e.id=this.id+t,e.depth=e.id.length,e.id.length%this.layer.hierarchyStepSize==0?e.baseurl=`${r.baseurl}/${e.id.substr(r.id.length)}`:e.baseurl=r.baseurl}createChildAABB(e,t){e.bbox.copy(this.bbox),this.bbox.getCenter(e.bbox.max),vr.copy(e.bbox.max).sub(this.bbox.min),1===t?(e.bbox.min.z+=vr.z,e.bbox.max.z+=vr.z):3===t?(e.bbox.min.z+=vr.z,e.bbox.max.z+=vr.z,e.bbox.min.y+=vr.y,e.bbox.max.y+=vr.y):0===t||(2===t?(e.bbox.min.y+=vr.y,e.bbox.max.y+=vr.y):5===t?(e.bbox.min.z+=vr.z,e.bbox.max.z+=vr.z,e.bbox.min.x+=vr.x,e.bbox.max.x+=vr.x):7===t?(e.bbox.min.add(vr),e.bbox.max.add(vr)):4===t?(e.bbox.min.x+=vr.x,e.bbox.max.x+=vr.x):6===t&&(e.bbox.min.y+=vr.y,e.bbox.max.y+=vr.y,e.bbox.min.x+=vr.x,e.bbox.max.x+=vr.x))}get octreeIsLoaded(){return!(this.childrenBitField&&0===this.children.length)}get url(){return`${this.baseurl}/r${this.id}.${this.layer.source.extension}`}loadOctree(){const e=`${this.baseurl}/r${this.id}.${this.layer.source.extensionOctree}`;return this.layer.source.fetcher(e,this.layer.source.networkOptions).then((e=>{const t=new DataView(e),r=[];let n=0;for(this.childrenBitField=t.getUint8(0),n+=1,this.numPoints=t.getUint32(1,!0),n+=4,r.push(this);r.length&&n{this.scale=(new n.Vector3).addScalar(e.scale),this.spacing=e.spacing,this.hierarchyStepSize=e.hierarchyStepSize;const t=Array.isArray(e.pointAttributes)&&e.pointAttributes.find((e=>e.startsWith("NORMAL")));return t&&(this.material.defines[t]=1),this.supportsProgressiveDisplay="cin"===this.source.extension,this.root=new _r(0,0,this),this.root.bbox.min.set(e.boundingBox.lx,e.boundingBox.ly,e.boundingBox.lz),this.root.bbox.max.set(e.boundingBox.ux,e.boundingBox.uy,e.boundingBox.uz),this.extent=s.A.fromBox3(this.source.crs||"EPSG:4326",this.root.bbox),this.root.loadOctree().then(r)}))}},Mr=new n.Vector3;class Sr extends yr{constructor(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2?arguments[2]:void 0;super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t),this.childrenBitField=e,this.id="",this.depth=0,this.baseurl=t.source.baseurl}add(e,t){super.add(e,t),e.id=this.id+t,e.depth=this.depth+1}createChildAABB(e,t){e.bbox.copy(this.bbox),this.bbox.getCenter(e.bbox.max),Mr.copy(e.bbox.max).sub(this.bbox.min),1===t?(e.bbox.min.z+=Mr.z,e.bbox.max.z+=Mr.z):3===t?(e.bbox.min.z+=Mr.z,e.bbox.max.z+=Mr.z,e.bbox.min.y+=Mr.y,e.bbox.max.y+=Mr.y):0===t||(2===t?(e.bbox.min.y+=Mr.y,e.bbox.max.y+=Mr.y):5===t?(e.bbox.min.z+=Mr.z,e.bbox.max.z+=Mr.z,e.bbox.min.x+=Mr.x,e.bbox.max.x+=Mr.x):7===t?(e.bbox.min.add(Mr),e.bbox.max.add(Mr)):4===t?(e.bbox.min.x+=Mr.x,e.bbox.max.x+=Mr.x):6===t&&(e.bbox.min.y+=Mr.y,e.bbox.max.y+=Mr.y,e.bbox.min.x+=Mr.x,e.bbox.max.x+=Mr.x))}get octreeIsLoaded(){return!(this.childrenBitField&&0===this.children.length)}get url(){return`${this.baseurl}/octree.bin`}networkOptions(e,t){const r=e;return{...this.layer.source.networkOptions,headers:{...this.layer.source.networkOptions.headers,...this.url.startsWith("https://raw.githubusercontent.com")?{}:{"content-type":"multipart/byteranges"},Range:`bytes=${r}-${r+t-1n}`}}}async load(){return this.octreeIsLoaded||await this.loadOctree(),this.layer.source.fetcher(this.url,this.networkOptions(this.byteOffset,this.byteSize)).then((e=>this.layer.source.parser(e,{in:{source:this.layer.source,bbox:this.bbox,numPoints:this.numPoints},out:this.layer}))).then((e=>(this.loaded=!0,this.loading=!1,e.geometry)))}async loadOctree(){if(!this.loaded&&!this.loading)return this.loading=!0,2===this.nodeType?this.loadHierarchy():Promise.resolve()}async loadHierarchy(){const e=`${this.baseurl}/hierarchy.bin`,t=await this.layer.source.fetcher(e,this.networkOptions(this.hierarchyByteOffset,this.hierarchyByteSize));this.parseHierarchy(t)}parseHierarchy(e){const t=new DataView(e),r=e.byteLength/22,n=[];n.push(this);for(let e=0;e{Tr[t]=Tr[e]}));class Ir{constructor(e,t,r){this.name=e,this.type=t,this.numElements=r,this.byteSize=this.numElements*this.type.size,this.description="",this.range=[1/0,-1/0]}}Ir.POSITION_CARTESIAN=new Ir("POSITION_CARTESIAN",Tr.DATA_TYPE_FLOAT,3),Ir.RGBA_PACKED=new Ir("COLOR_PACKED",Tr.DATA_TYPE_INT8,4),Ir.COLOR_PACKED=Ir.RGBA_PACKED,Ir.RGB_PACKED=new Ir("COLOR_PACKED",Tr.DATA_TYPE_INT8,3),Ir.NORMAL_FLOATS=new Ir("NORMAL_FLOATS",Tr.DATA_TYPE_FLOAT,3),Ir.INTENSITY=new Ir("INTENSITY",Tr.DATA_TYPE_UINT16,1),Ir.CLASSIFICATION=new Ir("CLASSIFICATION",Tr.DATA_TYPE_UINT8,1),Ir.NORMAL_SPHEREMAPPED=new Ir("NORMAL_SPHEREMAPPED",Tr.DATA_TYPE_UINT8,2),Ir.NORMAL_OCT16=new Ir("NORMAL_OCT16",Tr.DATA_TYPE_UINT8,2),Ir.NORMAL=new Ir("NORMAL",Tr.DATA_TYPE_FLOAT,3),Ir.RETURN_NUMBER=new Ir("RETURN_NUMBER",Tr.DATA_TYPE_UINT8,1),Ir.NUMBER_OF_RETURNS=new Ir("NUMBER_OF_RETURNS",Tr.DATA_TYPE_UINT8,1),Ir.SOURCE_ID=new Ir("SOURCE_ID",Tr.DATA_TYPE_UINT16,1),Ir.INDICES=new Ir("INDICES",Tr.DATA_TYPE_UINT32,1),Ir.SPACING=new Ir("SPACING",Tr.DATA_TYPE_FLOAT,1),Ir.GPS_TIME=new Ir("GPS_TIME",Tr.DATA_TYPE_DOUBLE,1);class Rr{constructor(){this.attributes=[],this.byteSize=0,this.size=0,this.vectors=[]}add(e){this.attributes.push(e),this.byteSize+=e.byteSize,this.size++}addVector(e){this.vectors.push(e)}hasNormals(){for(let e=0;e{this.scale=new n.Vector3(1,1,1),this.metadata=e,this.pointAttributes=function(e){const t=new Rr,r={rgb:"rgba"};for(const n of e){const{name:e,numElements:i,min:s,max:o}=n,a=Lr[n.type],l=new Ir(r[e]?r[e]:e,a,i);l.range=1===i?[s[0],o[0]]:[s,o],"gps-time"===e&&l.range[0]===l.range[1]&&(l.range[1]+=1),l.initialRange=l.range,t.add(l)}return void 0!==t.attributes.find((e=>"NormalX"===e.name))&&void 0!==t.attributes.find((e=>"NormalY"===e.name))&&void 0!==t.attributes.find((e=>"NormalZ"===e.name))&&t.addVector({name:"NORMAL",attributes:["NormalX","NormalY","NormalZ"]}),t}(e.attributes),this.spacing=e.spacing;const t=Array.isArray(this.pointAttributes.attributes)&&this.pointAttributes.attributes.find((e=>e.name.startsWith("NORMAL")));t&&(this.material.defines[t.name]=1);const i=new n.Vector3(...e.boundingBox.min),o=new n.Vector3(...e.boundingBox.max),a=new n.Box3(i,o),l=new Cr(0,0,this);return l.bbox=a,l.boundingSphere=a.getBoundingSphere(new n.Sphere),l.id="r",l.depth=0,l.nodeType=2,l.hierarchyByteOffset=0n,l.hierarchyByteSize=BigInt(e.hierarchy.firstChunkSize),l.byteOffset=0,this.root=l,this.extent=s.A.fromBox3(this.source.crs||"EPSG:4326",a),this.root.loadOctree().then(r)}))}};var Or=r(14333),Nr=r(49423),Ur=r(76932),Fr=r(21311);const kr=new n.Matrix4(1,0,0,1,0,1,0,1,0,0,2,0,0,0,0,2),zr=new n.DataTexture(new Uint8Array([255,255,255,255]),1,1,n.RGBAFormat,n.UnsignedByteType);zr.needsUpdate=!0;const Gr=new n.Texture,Qr=new n.ShaderMaterial;class Vr extends n.ShaderMaterial{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.side=t.side??n.DoubleSide,t.transparent=t.transparent??!0,t.opacity=t.opacity??1;const r={};for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&void 0!==Qr[e]&&(r[e]=t[e]);super(r),this.defines.ORIENTED_IMAGES_COUNT=t.OrientedImagesCount??e.length;const i=Tt.A.getMaxTextureUnitsCount();this.defines.ORIENTED_IMAGES_COUNT>i&&(console.warn(`OrientedImageMaterial: Can't project ${e.length} textures, because it's more than GPU capabilities maximum texture units (${i})`),this.defines.ORIENTED_IMAGES_COUNT=i-1,console.warn(`OrientedImageMaterial: We'll use only the first ${this.defines.ORIENTED_IMAGES_COUNT} cameras.`)),t.useBaseMaterial&&(this.defines.USE_BASE_MATERIAL=!0),this.defines.USE_DISTORTION=Number(e.some((e=>null!==e.distortion.pps))),this.alphaBorder=20|t.alphaBorder,this.defines.DEBUG_ALPHA_BORDER=0|t.debugAlphaBorder,this.cameras=e;const s=[],o=[],a=[],l=[];this.group=new n.Group;for(let t=0;t\n#include \n#include \nvarying vec3 vNormal;\n\n#ifdef USE_BASE_MATERIAL\nstruct noPT {\n vec3 lightDirection;\n vec3 ambient;\n float opacity;\n};\n\nuniform noPT noProjectiveMaterial;\n#endif\n\nvoid main(void)\n{\n #include \n #ifdef USE_BASE_MATERIAL\n float nDotVP = (max(0.1, dot(vNormal, normalize(noProjectiveMaterial.lightDirection))));\n vec4 color = vec4(noProjectiveMaterial.ambient + nDotVP, 0.0);\n #else\n vec4 color = vec4(0.0);\n #endif\n\n #pragma unroll_loop\n for (int i = 0; i < ORIENTED_IMAGES_COUNT; i++) {\n color = projectiveTextureColor(projectiveTextureCoords[ ORIENTED_IMAGES_COUNT - 1 - i ], projectiveTextureDistortion[ ORIENTED_IMAGES_COUNT - 1 - i ], projectiveTexture[ ORIENTED_IMAGES_COUNT - 1 - i ], mask[ORIENTED_IMAGES_COUNT - 1 - i], color);\n }\n\n #ifdef USE_BASE_MATERIAL\n color.a = color.a < 1.0 ? max(noProjectiveMaterial.opacity, color.a) : 1.0 ;\n gl_FragColor = vec4(color.rgb, color.a * opacity);\n #else\n gl_FragColor = vec4(color.rgb / color.a, opacity);\n #endif\n\n}\n",this.defines)}setTextures(e,t,r){if(e){this.group.position.copy(t.position),this.group.quaternion.copy(t.quaternion);for(let t=0;te.name===r[t]));this.uniforms.mask.value[t]=e.maskTexture||zr,this.uniforms.mask.value[t].needsUpdate=!0,this.uniforms.projectiveTextureDistortion.value[t]=e.distortion,this.group.children[t]=e,e.parent=this.group}}this.group.children[t].needsUpdate=!0}this.group.updateMatrixWorld(!0)}}updateUniforms(e){for(let t=0;t1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=JSON.parse(e)),Promise.all(e.map((e=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=null==t.useMask||t.useMask,i=null==t.imageYDown||t.imageYDown,s=e.projection,o=(new n.Vector2).fromArray(e.size),a=new n.Vector2(s[0],s[4]),l=new n.Vector2(s[2],i?o.y-s[5]:s[5]),c=s[1],u=new P(o,a,l,t.near,t.far,c);u.position.fromArray(e.position);const h=Wr.fromArray(e.rotation);let d;u.matrix.setFromMatrix3(h),u.quaternion.setFromRotationMatrix(u.matrix),u.rotateX(Math.PI),e.distortion&&u.distortion.setFromMicmacCalibration(e.distortion,i),u.maskPath=e.mask,u.name=e.id;const p=new Promise((e=>{d=e}));return r&&u.maskPath?qr.load(u.maskPath,(e=>{u.maskTexture=e,d(u)})):d(u),p}(e,t))))}},Xr=new o.A("EPSG:4978",0,0,0),Kr=e=>e.requester.id!==e.layer.currentPano.id;function $r(e){if(!e||e<=0)return;const t=new n.SphereGeometry(e,32,32),r=new n.MeshPhongMaterial({color:7829503,side:n.DoubleSide,transparent:!0,opacity:.5,wireframe:!0}),i=new n.Mesh(t,r);return i.visible=!0,i.name="OrientedImageBackground",i}class Jr extends nr.A{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{backgroundDistance:r,background:i=$r(r),onPanoChanged:s=()=>{},getCamerasNameFromFeature:o=()=>{},...a}=t;t.projection&&(console.warn("OrientedImageLayer projection parameter is deprecated, use crs instead."),t.crs=t.crs||t.projection),super(e,new n.Group,a),this.isOrientedImageLayer=!0,this.background=i,this.background&&(this.background.layer=this.background.layer??{},this.background.layer.id=this.background.layer.id??e,this.object3d.add(this.background)),this.currentPano=void 0,this.onPanoChanged=s,this.getCamerasNameFromFeature=o;const l=this.addInitializationStep();this.mergeFeatures=!1,this.filteringExtent=!1,this.accurate=!0;const c={out:this};this.source.whenReady.then((e=>jr.A.parse(t.orientation||e.orientation,c).then((e=>{this.panos=e.features;const r=c.in.crs,i=t.crs,s=$e.quaternionFromCRSToCRS(r,i),o=new n.Quaternion;let a=0;for(const t of this.panos)Xr.crs=t.crs,Xr.setFromArray(t.vertices).applyMatrix4(e.matrix),t.position=Xr.toVector3(),s(Xr,o),t.quaternion=$e.quaternionFromAttitude(t.geometries[0].properties).premultiply(o),t.id=t.geometries[0].properties.id,t.index=a++})).then((()=>{Yr.parse(t.calibration||e.calibration,t).then((e=>{this.cameras=e,this.material=new Hr(this.cameras,t),l()}))}))))}update(){}set boostLight(e){this.material.uniforms.boostLight.value=e}get boostLight(){return this.material.uniforms.boostLight.value}preUpdate(e){var t;!function(e,t,r){const n=r.mostNearPano(t.position),i=r.currentPano?r.currentPano.id:void 0;if(n&&i!=n.id){r.currentPano=n,r.onPanoChanged({previousPanoPosition:r.getPreviousPano()?r.getPreviousPano().position:void 0,currentPanoPosition:r.getCurrentPano().position,nextPanoPosition:r.getNextPano().position});const t=n.geometries[0].properties.idSensors,i=r.cameras.map((e=>({cameraId:e.name,panoId:n.id,as:()=>{}}))).filter((e=>!t||t.includes(e.cameraId))),s={layer:r,extentsSource:i,view:e.view,requester:n,earlyDropFunction:Kr};e.scheduler.execute(s).then((t=>{n.id===r.currentPano.id&&(r.material.setTextures(t,n,r.getCamerasNameFromFeature(n)),r.material.updateUniforms(e.camera.camera3D),e.view.notifyChange(r,!0))}),(()=>{}))}}(e,e.camera.camera3D,this),this.material.updateUniforms(e.camera.camera3D),(t=this).background&&t.currentPano&&(t.background.position.copy(t.currentPano.position),t.background.updateMatrixWorld(),t.background.material=t.material||t.background.material)}getNextPano(){const e=(this.currentPano.index+1)%this.panos.length;return this.panos[e]}getCurrentPano(){return this.currentPano}getPreviousPano(){const e=(this.currentPano.index-1)%this.panos.length;return this.panos[e]}delete(e){this.background&&super.delete(),e&&this.cache.clear(),this.material.visible=!1,console.warn("You need to replace OrientedImageLayer.material applied on each object. This issue will be fixed when OrientedImageLayer will be a ColorLayer. the material visibility is set to false. To follow issue see https://github.com/iTowns/itowns/issues/1018")}mostNearPano(e){let t,r=1/0;for(const n of this.panos){const i=e.distanceTo(n.position);i5&&void 0!==arguments[5]?arguments[5]:0,i),this.isEntwinePointTileNode=!0,this.depth=e,this.x=t,this.y=r,this.z=n,this.id=ln(e,t,r,n),this.url=`${this.layer.source.url}/ept-data/${this.id}.${this.layer.source.extension}`}createChildAABB(e){const t=2**(e.depth-this.depth);this.bbox.getSize(sn).divideScalar(t),e.bbox.min.copy(this.bbox.min),on.copy(this).multiplyScalar(t),an.subVectors(e,on).multiply(sn),e.bbox.min.add(an),e.bbox.max.copy(e.bbox.min).add(sn)}get octreeIsLoaded(){return this.numPoints>=0}loadOctree(){return d.A.json(`${this.layer.source.url}/ept-hierarchy/${this.id}.json`,this.layer.source.networkOptions).then((e=>{this.numPoints=e[this.id];const t=[];for(t.push(this);t.length;){const r=t.shift(),n=r.depth+1,i=2*r.x,s=2*r.y,o=2*r.z;r.findAndCreateChild(n,i,s,o,e,t),r.findAndCreateChild(n,i+1,s,o,e,t),r.findAndCreateChild(n,i,s+1,o,e,t),r.findAndCreateChild(n,i+1,s+1,o,e,t),r.findAndCreateChild(n,i,s,o+1,e,t),r.findAndCreateChild(n,i+1,s,o+1,e,t),r.findAndCreateChild(n,i,s+1,o+1,e,t),r.findAndCreateChild(n,i+1,s+1,o+1,e,t)}}))}findAndCreateChild(e,t,r,n,i,s){const o=i[ln(e,t,r,n)];if("number"==typeof o){const i=new cn(e,t,r,n,this.layer,o);this.add(i),s.push(i)}}}const un=cn,hn=new n.Mesh,dn=new n.Box3;hn.geometry.boundingBox=dn;const pn=class extends gr{constructor(e,t){super(e,t),this.isEntwinePointTileLayer=!0,this.scale=new n.Vector3(1,1,1);const r=this.addInitializationStep();this.whenReady=this.source.whenReady.then((()=>(this.root=new un(0,0,0,0,this,-1),this.root.bbox.min.fromArray(this.source.boundsConforming,0),this.root.bbox.max.fromArray(this.source.boundsConforming,3),this.minElevationRange=this.source.boundsConforming[2],this.maxElevationRange=this.source.boundsConforming[5],this.extent=s.A.fromBox3(t.crs||"EPSG:4326",this.root.bbox),this.root.loadOctree().then(r))))}get spacing(){return this.source.spacing}};var fn=r(15234);const mn=new n.Vector3,gn=new n.Vector3,An=new n.Vector3;function yn(e,t,r,n){return`${e}-${t}-${r}-${n}`}class vn extends yr{constructor(e,t,r,n,i,s,o){super(arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,o),this.isCopcNode=!0,this.entryOffset=i,this.entryLength=s,this.layer=o,this.depth=e,this.x=t,this.y=r,this.z=n}get id(){return yn(this.depth,this.x,this.y,this.z)}get octreeIsLoaded(){return this.numPoints>=0}async _fetch(e,t){return this.layer.source.fetcher(this.layer.source.url,{...this.layer.source.networkOptions,headers:{...this.layer.source.networkOptions.headers,range:`bytes=${e}-${e+t-1}`}})}createChildAABB(e){const t=2**(e.depth-this.depth);this.bbox.getSize(mn).divideScalar(t),e.bbox.min.copy(this.bbox.min),gn.copy(this).multiplyScalar(t),An.subVectors(e,gn).multiply(mn),e.bbox.min.add(An),e.bbox.max.copy(e.bbox.min).add(mn)}findAndCreateChild(e,t,r,n,i,s){const o=yn(e,t,r,n);let a,l,c;const u=i.nodes[o];if(u)a=u.pointCount,l=u.pointDataOffset,c=u.pointDataLength;else{const e=i.pages[o];if(!e)return;a=-1,l=e.pageOffset,c=e.pageLength}const h=new vn(e,t,r,n,l,c,this.layer,a);this.add(h),s.push(h)}async loadOctree(){const e=await this._fetch(this.entryOffset,this.entryLength),t=await fn.Hierarchy.parse(new Uint8Array(e)),r=t.nodes[this.id];if(!r)return Promise.reject("[CopcNode]: Ill-formed data, entry not found in hierarchy.");this.numPoints=r.pointCount,this.entryOffset=r.pointDataOffset,this.entryLength=r.pointDataLength;const n=[];for(n.push(this);n.length;){const e=n.shift(),r=e.depth+1,i=2*e.x,s=2*e.y,o=2*e.z;e.findAndCreateChild(r,i,s,o,t,n),e.findAndCreateChild(r,i+1,s,o,t,n),e.findAndCreateChild(r,i,s+1,o,t,n),e.findAndCreateChild(r,i+1,s+1,o,t,n),e.findAndCreateChild(r,i,s,o+1,t,n),e.findAndCreateChild(r,i+1,s,o+1,t,n),e.findAndCreateChild(r,i,s+1,o+1,t,n),e.findAndCreateChild(r,i+1,s+1,o+1,t,n)}}async load(){this.octreeIsLoaded||await this.loadOctree();const e=await this._fetch(this.entryOffset,this.entryLength);return await this.layer.source.parser(e,{in:{...this.layer.source,pointCount:this.numPoints},out:this.layer})}}const xn=vn,_n=class extends gr{constructor(e,t){super(e,t),this.isCopcLayer=!0;const r=()=>this;this.whenReady=this.source.whenReady.then((e=>{const{cube:t,rootHierarchyPage:i}=e.info,{pageOffset:s,pageLength:o}=i;return this.root=new xn(0,0,0,0,s,o,this,-1),this.root.bbox.min.fromArray(t,0),this.root.bbox.max.fromArray(t,3),this.minElevationRange=e.header.min[2],this.maxElevationRange=e.header.max[2],this.scale=new n.Vector3(1,1,1),this.offset=new n.Vector3(0,0,0),this.root.loadOctree().then(r)}))}get spacing(){return this.source.info.spacing}};var bn=r(88326);class wn extends bn.A{constructor(e){if(e.parsedData&&(console.warn("FileSource parsedData parameter is deprecated, use features instead of."),e.features=e.features||e.parsedData),e.projection&&(console.warn("FileSource projection parameter is deprecated, use crs instead."),e.crs=e.crs||e.projection),!e.crs){if(!e.features||!e.features.crs)throw new Error("source.crs is required in FileSource");e.crs=e.features.crs}if(!e.url&&!e.fetchedData&&!e.features)throw new Error("url, fetchedData and features are not set in\n FileSource; at least one needs to be present");e.url=e.url||"none",super(e),this.isFileSource=!0,this.fetchedData=e.fetchedData,this.fetchedData||e.features?e.features&&(this._featuresCaches[e.features.crs]=new $t.A,this._featuresCaches[e.features.crs].setByArray(Promise.resolve(e.features),[0])):this.whenReady=this.fetcher(this.urlFromExtent(),this.networkOptions).then((e=>{this.fetchedData=e})),this.whenReady.then((()=>this.fetchedData)),this.zoom={min:0,max:1/0}}urlFromExtent(){return this.url}onLayerAdded(e){e.in=this,super.onLayerAdded(e);let t=this._featuresCaches[e.out.crs].getByArray([0]);t||(e.out.buildExtent="EPSG:4978"!=this.crs,e.out.buildExtent&&(e.out.forcedExtentCrs="EPSG:4978"!=e.out.crs?e.out.crs:this.crs),t=this.parser(this.fetchedData,e),this._featuresCaches[e.out.crs].setByArray(t,[0])),t.then((e=>{e.extent&&(this.extent=e.extent.clone(),this.extent.crs==e.crs&&this.extent.applyMatrix4(e.matrixWorld))}))}loadData(e,t){return this._featuresCaches[t.crs].getByArray([0])}extentInsideLimit(e){return this.extent.intersectsExtent(e)}}const En=wn;var Mn=r(97709),Sn=r(86706),Cn=r(48150);const Tn=new Sn.A("EPSG:4326",0,0,0);class In extends bn.A{constructor(e){if(e.format=e.format||"image/png",super(e),!e.crs)throw new Error("New TMSSource/WMTSSource: crs is required");if(this.isTMSSource=!0,e.extent||(this.extent=Cn.af.get(e.crs)),this.zoom=e.zoom,this.isInverted=e.isInverted||!1,this.crs=e.crs,this.tileMatrixSetLimits=e.tileMatrixSetLimits,this.extentSetlimits={},this.tileMatrixCallback=e.tileMatrixCallback||(e=>e),!this.zoom)if(this.tileMatrixSetLimits){const e=Object.keys(this.tileMatrixSetLimits),t=e.length,r=Number(e[t-1]);this.zoom={min:r-t+1,max:r}}else this.zoom={min:0,max:1/0}}urlFromExtent(e){return Mn.A.xyz(e,this)}onLayerAdded(e){super.onLayerAdded(e);const t=e.out.parent,r=t?t.extent.crs:e.out.crs;if(this.tileMatrixSetLimits&&!this.extentSetlimits[r]){this.extentSetlimits[r]={},Tn.crs=this.crs;for(let e=this.zoom.max;e>=this.zoom.min;e--){const t=this.tileMatrixSetLimits[e],{west:n,north:i}=Tn.set(e,t.minTileRow,t.minTileCol).toExtent(r),{east:o,south:a}=Tn.set(e,t.maxTileRow,t.maxTileCol).toExtent(r);this.extentSetlimits[r][e]=new s.A(r,n,o,a,i)}}}extentInsideLimit(e,t){return t>=this.zoom.min&&t<=this.zoom.max&&(null==this.extentSetlimits[e.crs]||this.extentSetlimits[e.crs][t].intersectsExtent(e))}}const Rn=In,Bn=new s.A("EPSG:4326",[0,0,0,0]);class Pn extends bn.A{constructor(e){if(e.projection&&(console.warn("WFSSource projection parameter is deprecated, use crs instead."),e.crs=e.crs||e.projection),!e.typeName)throw new Error("source.typeName is required in wfs source.");if(!e.crs)throw new Error("source.crs is required in wfs source");e.format=e.format||"application/json",super(e),this.isWFSSource=!0,this.typeName=e.typeName,this.version=e.version||"2.0.2",this.bboxDigits=e.bboxDigits,this.zoom={min:0,max:1/0};const t=new URL(e.url);t.searchParams.set("SERVICE","WFS"),t.searchParams.set("REQUEST","GetFeature"),t.searchParams.set("typeName",this.typeName),t.searchParams.set("VERSION",this.version),t.searchParams.set("SRSNAME",this.crs),t.searchParams.set("outputFormat",this.format),t.searchParams.set("BBOX",`%bbox,${this.crs}`),this.vendorSpecific=e.vendorSpecific;for(const e in this.vendorSpecific)Object.prototype.hasOwnProperty.call(this.vendorSpecific,e)&&t.searchParams.set(e,this.vendorSpecific[e]);this.url=decodeURIComponent(t.toString())}handlingError(e){return e.response&&400==e.response.status?e.response.text().then((t=>{const r=`${this.url}SERVICE=WFS&REQUEST=GetCapabilities&VERSION=${this.version}`,n=(new DOMParser).parseFromString(t,"application/xml").querySelector("Exception"),i=n.getAttribute("exceptionCode"),s=n.querySelector("ExceptionText").textContent;console.error(`Source ${this.typeName}: bad request when fetching data. Server says: "${i}: ${s}". \nReviewing ${r} may help.`,e)})):super.handlingError(e)}requestToKey(e){return e.isTile?super.requestToKey(e):[e.zoom,e.south,e.west]}urlFromExtent(e){const t=e.isExtent?e.as(this.crs,Bn):e.toExtent(this.crs,Bn);return Mn.A.bbox(t,this)}extentInsideLimit(e){return this.extent.intersectsExtent(e)}}const Ln=Pn,Dn=new s.A("EPSG:4326",[0,0,0,0]),On={en:"wsen",es:"wnes",wn:"eswn",ws:"enws",ne:"swne",se:"nwse",nw:"senw",sw:"nesw"};class Nn extends bn.A{constructor(e){if(!e.name)throw new Error("source.name is required.");if(!e.extent)throw new Error("source.extent is required");if(!e.crs&&!e.projection)throw new Error("source.crs is required");var t;e.format=e.format||"image/png",super(e),this.isWMSSource=!0,this.name=e.name,this.zoom={min:0,max:1/0},this.style=e.style||"",this.width=e.width||e.height||256,this.height=e.height||e.width||256,this.version=e.version||"1.3.0",this.transparent=e.transparent||!1,this.bboxDigits=e.bboxDigits,e.axisOrder?this.axisOrder=e.axisOrder:"1.3.0"===this.version?this.axisOrder=(t=l.axisOrder(this.crs))&&On[t.slice(0,2)]||"wsen":this.axisOrder="wsen";const r="1.3.0"===this.version?"CRS":"SRS",n=new URL(this.url);n.searchParams.set("SERVICE","WMS"),n.searchParams.set("REQUEST","GetMap"),n.searchParams.set("LAYERS",this.name),n.searchParams.set("VERSION",this.version),n.searchParams.set("STYLES",this.style),n.searchParams.set("FORMAT",this.format),n.searchParams.set("TRANSPARENT",this.transparent),n.searchParams.set("BBOX","%bbox"),n.searchParams.set(r,this.crs),n.searchParams.set("WIDTH",this.width),n.searchParams.set("HEIGHT",this.height),this.vendorSpecific=e.vendorSpecific;for(const e in this.vendorSpecific)Object.prototype.hasOwnProperty.call(this.vendorSpecific,e)&&n.searchParams.set(e,this.vendorSpecific[e]);this.url=decodeURIComponent(n.toString())}urlFromExtent(e){const t=e.isExtent?e.as(this.crs,Dn):e.toExtent(this.crs,Dn);return Mn.A.bbox(t,this)}extentInsideLimit(e){return this.extent.intersectsExtent(e)}}const Un=Nn,Fn=class extends Rn{constructor(e){if(!e.name)throw new Error("New WMTSSource: name is required");super(e),this.isWMTSSource=!0;const t=new URL(this.url);t.searchParams.set("LAYER",e.name),t.searchParams.set("FORMAT",this.format),t.searchParams.set("SERVICE","WMTS"),t.searchParams.set("VERSION",e.version||"1.0.0"),t.searchParams.set("REQUEST","GetTile"),t.searchParams.set("STYLE",e.style||"normal"),t.searchParams.set("TILEMATRIXSET",e.tileMatrixSet),t.searchParams.set("TILEMATRIX","%TILEMATRIX"),t.searchParams.set("TILEROW","%ROW"),t.searchParams.set("TILECOL","%COL"),this.vendorSpecific=e.vendorSpecific;for(const e in this.vendorSpecific)Object.prototype.hasOwnProperty.call(this.vendorSpecific,e)&&t.searchParams.set(e,this.vendorSpecific[e]);this.url=decodeURIComponent(t.toString())}};var kn=r(67373);const zn=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Gn(e){const t=e.params.length?`?${e.params.join("&")}`:"";return`${e.protocol}://${e.authority}${e.path}${t}`}function Qn(e,t){const r=Hn("https://api.mapbox.com");if(e.protocol=r.protocol,e.authority=r.authority,"http"===e.protocol){const t=e.params.indexOf("secure");t>=0&&e.params.splice(t,1)}if("/"!==r.path&&(e.path=`${r.path}${e.path}`),!(t=t||null))throw new Error("An API access token is required");if("s"===t[0])throw new Error("Use a public access token (pk.*), not a secret access token (sk.*).");return e.params=e.params.filter((e=>-1===e.indexOf("access_token"))),e.params.push(`access_token=${t}`),Gn(e)}function Vn(e){return 0===e.indexOf("mapbox:")}function Hn(e){const t=e.match(zn);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}const jn=function(e,t){if(!Vn(e))return e;const r=Hn(e);return r.path=`/styles/v1${r.path}`,Qn(r,t)},qn=function(e,t){if(!Vn(e))return e;const r=Hn(e);return r.path=`/v4/${r.authority}.json`,r.params.push("secure"),Qn(r,t)},Wn=function(e,t,r,n){const i=Hn(e);return Vn(e)?(i.path=`/styles/v1${i.path}/sprite${t}${r}`,Qn(i,n)):(i.path+=`${t}${r}`,Gn(i))};function Yn(e){return e.replace(/\{/g,"${")}const Xn=class extends Rn{constructor(e){e.format="application/x-protobuf;type=mapbox-vector",e.crs="EPSG:3857",e.isInverted=!0,e.url=e.url||".",super(e);const t=e.filter||(()=>!0);let r;if(this.urls=[],this.layers={},this.styles={},this.isVectorTileSource=!0,this.accessToken=e.accessToken,!e.style)throw new Error("New VectorTilesSource: style is required");if("string"==typeof e.style){const t=jn(e.style,this.accessToken);r=d.A.json(t,this.networkOptions)}else r=Promise.resolve(e.style);this.whenReady=r.then((t=>{this.jsonStyle=t;const r=e.sprite||t.sprite;if(r){const e=Wn(r,"",".json",this.accessToken);return d.A.json(e,this.networkOptions).then((e=>{this.sprites=e;const n=Wn(r,"",".png",this.accessToken);return this.sprites.source=n,t}))}return t})).then((e=>{if(e.layers.forEach(((e,r)=>{if(e.sourceUid=this.uid,"background"===e.type)this.backgroundLayer=e;else if(t(e)){const t=Je.Ay.setFromVectorTileLayer(e,this.sprites,r,this.symbolToCircle);this.styles[e.id]=t,this.layers[e["source-layer"]]||(this.layers[e["source-layer"]]=[]),this.layers[e["source-layer"]].push({id:e.id,order:r,filterExpression:(0,kn.fC)(e.filter),zoom:{min:e.minzoom||0,max:e.maxzoom||24}})}})),"."==this.url){const t=Object.values(e.sources).map((e=>{if(e.url){const t=qn(e.url,this.accessToken);return d.A.json(t,this.networkOptions).then((e=>{if(e.tiles[0])return Yn(e.tiles[0])}))}return e.tiles?Promise.resolve(Yn(e.tiles[0])):Promise.reject()}));return Promise.all(t)}return Promise.resolve([this.url])})).then((e=>{this.urls=Array.from(new Set(e))}))}urlFromExtent(e,t){return Mn.A.xyz(e,{tileMatrixCallback:this.tileMatrixCallback,url:t})}onLayerAdded(e){super.onLayerAdded(e),e.out.style&&e.out.isFeatureGeometryLayer&&e.out.accurate&&(console.warn("With VectorTilesSource and FeatureGeometryLayer, the accurate option is always false"),e.out.accurate=!1)}loadData(e,t){const r=this._featuresCaches[t.crs],n=this.requestToKey(e);let i=r.getByArray(n);return i||(i=r.setByArray(Promise.all(this.urls.map((r=>this.fetcher(this.urlFromExtent(e,r),this.networkOptions).then((r=>this.parser(r,{out:t,in:this,extent:e})))))).then((e=>function(e){const t=e[0];return e.forEach(((e,r)=>{0!==r&&e.features.forEach((e=>{t.features.push(e)}))})),t}(e))).catch((e=>this.handlingError(e))),n),this.onParsedFile&&i.then((e=>(this.onParsedFile(e),console.warn("Source.onParsedFile was deprecated"),e)))),i}};class Kn extends bn.A{constructor(e){super(e),this.isOrientedImageSource=!0;const t=[];t.push(e.orientationsUrl?d.A.json(e.orientationsUrl,this.networkOptions):Promise.resolve()),t.push(e.calibrationUrl?d.A.json(e.calibrationUrl,this.networkOptions):Promise.resolve()),this.whenReady=Promise.all(t).then((e=>({orientation:e[0],calibration:e[1]})))}urlFromExtent(e){return this.imageUrl(e.cameraId,e.panoId)}requestToKey(e){return[e.cameraId,e.panoId]}imageUrl(e,t){return this.url.replace("{cameraId}",e).replace("{panoId}",t)}}const $n=Kn,Jn={POSITION_CARTESIAN:{numElements:3,arrayType:Float32Array,attributeName:"position"},COLOR_PACKED:{numElements:4,arrayType:Uint8Array,attributeName:"color",normalized:!0},INTENSITY:{numElements:1,numByte:2,arrayType:Uint16Array,attributeName:"intensity",normalized:!0},CLASSIFICATION:{numElements:1,arrayType:Uint8Array,attributeName:"classification",normalized:!0},NORMAL_SPHEREMAPPED:{numElements:2,arrayType:Uint8Array,attributeName:"sphereMappedNormal"},NORMAL_OCT16:{numElements:2,arrayType:Uint8Array,attributeName:"oct16Normal"},NORMAL:{numElements:3,arrayType:Float32Array,attributeName:"normal"}};for(const e of Object.keys(Jn)){const t=Jn[e];t.potreeName=e,t.numByte=t.numByte||t.arrayType.BYTES_PER_ELEMENT,t.byteSize=t.numElements*t.numByte,t.normalized=t.normalized||!1;const r="getUint"+8*t.numByte;t.getValue=1===t.numByte?function(e,t){return e[r](t)}:function(e,t){return e[r](t,!0)}}const Zn={parse:function(e,t){if(!e)throw new Error("No array buffer provided.");const r=new DataView(e);let i=0;for(const e of t.in.pointAttributes)i+=Jn[e].byteSize;const s=Math.floor(e.byteLength/i),o=new n.BufferGeometry;let a=0,l=0;for(const e of t.in.pointAttributes){const t=Jn[e],c=t.numElements*s,u=new t.arrayType(c);for(let e=0;e(this.pointAttributes=e.pointAttributes,this.baseurl=`${this.url}/${e.octreeDir}/r`,this.extension="CIN"===e.pointAttributes?"cin":"bin",this.parse="cin"===this.extension?ei.parse:Zn.parse,e)))}}const ri=ti;var ni=r(40447);ni.registerSerializer;const ii=ni.spawn,si=(ni.BlobWorker,ni.DefaultSerializer,ni.Pool,ni.Thread),oi=ni.Transfer;let ai;ni.Worker;const li={terminate(){const e=ai;return ai=void 0,si.terminate(e)},parse:async function(e,t){const i=t.in.source.metadata,s=t.out.pointAttributes,o=i.scale,a=t.in.bbox,l=a.min,c=a.max.clone().sub(a.min),u=a.max,h=i.offset,d=t.in.numPoints,p=function(e,t){return"BROTLI"===t.encoding?e.parseBrotli:e.parse}(await async function(){return ai||(ai=await ii(new Worker(new URL(r.p+r.u(343),r.b),{type:void 0})),ai)}(),i),f=await p(oi(e),{pointAttributes:s,scale:o,min:l,max:u,size:c,offset:h,numPoints:d}),m=f.attributeBuffers,g=new n.BufferGeometry;return Object.keys(m).forEach((e=>{const t=m[e].buffer;if("position"===e)g.setAttribute("position",new n.BufferAttribute(new Float32Array(t),3));else if("rgba"===e)g.setAttribute("color",new n.BufferAttribute(new Uint8Array(t),4,!0));else if("NORMAL"===e)g.setAttribute("normal",new n.BufferAttribute(new Float32Array(t),3));else if("INDICES"===e){const e=new n.BufferAttribute(new Uint8Array(t),4);e.normalized=!0,g.setAttribute("indices",e)}else{const r=new n.BufferAttribute(new Float32Array(t),1),i=m[e].attribute;r.potree={offset:m[e].offset,scale:m[e].scale,preciseBuffer:m[e].preciseBuffer,range:i.range},g.setAttribute(e,r)}})),g.computeBoundingBox(),{geometry:g,density:f.density}}};class ci extends bn.A{constructor(e){if(!e.file)throw new Error("New Potree2Source: file is required");super(e),this.file=e.file,this.fetcher=d.A.arrayBuffer,this.whenReady=(e.metadata?Promise.resolve(e.metadata):d.A.json(`${this.url}/${this.file}`,this.networkOptions)).then((e=>(this.metadata=e,this.pointAttributes=e.attributes,this.baseurl=`${this.url}`,this.extension="bin",this.parser=li.parse,e)))}}const ui=ci;class hi extends bn.A{constructor(e){super(e),this.isC3DTilesSource=!0,this.baseUrl=this.url.slice(0,this.url.lastIndexOf("/")+1),this.whenReady=d.A.json(this.url,this.networkOptions)}}const di=hi,pi=class extends di{constructor(e){if(!e.accessToken)throw new Error("New 3D Tiles Ion Source: access token is required");if(!e.assetId)throw new Error("New 3D Tiles Ion Source: asset id is required");e.url=`https://api.cesium.com/v1/assets/${e.assetId}/endpoint?access_token=${e.accessToken}`,super(e),this.isC3DTilesIonSource=!0,this.accessToken=e.accessToken,this.assetId=e.assetId,this.whenReady=d.A.json(e.url,this.networkOptions).then((e=>{if("3DTILES"!==e.type)throw new Error(`${e.type} datasets from Cesium ion are not supported with C3DTilesIonSource. Only 3D Tiles datasets are supported.`);return this.url=e.url,this.baseUrl=e.url.slice(0,e.url.lastIndexOf("/")+1),this.networkOptions.headers={},this.networkOptions.headers.Authorization=`Bearer ${e.accessToken}`,this.attribution=e.attributions,d.A.json(this.url,this.networkOptions)}))}};function fi(e){if(!e)return null;if(e.content&&e.content.uri)return new URLSearchParams(e.content.uri.slice(e.content.uri.indexOf("?")+1)).get("session");if(e.children&&e.children.length>0)for(const t of e.children){const e=fi(t);if(e)return e}return null}const mi=class extends di{constructor(e){if(!e.key)throw new Error("[C3DTilesGoogleSource]: A API key for the google map tiles API is required");e.url=`https://tile.googleapis.com/v1/3dtiles/root.json?key=${e.key}`,super(e),this.isC3DTilesGoogleSource=!0,this.baseUrl="https://tile.googleapis.com",this.key=e.key,this.whenReady=d.A.json(e.url,this.networkOptions).then((e=>{if(e&&e.root&&(this.sessionId=fi(e.root),null===this.sessionId))throw new Error("[C3DTilesGoogleSource]: Cannot find sessionId from the tileset while it is mandatory to request tiles.");return e}))}getTileUrl(e){const t=`key=${this.key}&session=${this.sessionId}`;return/\?/.test(e)?`${e}&${t}`:`${e}?${t}`}};class gi extends bn.A{constructor(e){super(e),this.isOGC3DTilesSource=!0}}const Ai=gi,yi=class extends Ai{constructor(e){if(!e.accessToken)throw new Error("[OGC3DTilesIonSource]: accessToken is required");if(!e.assetId)throw new Error("[OGC3DTilesIonSource]: assetId is required");e.url=`https://api.cesium.com/v1/assets/${e.assetId}/endpoint?access_token=${e.accessToken}`,super(e),this.isOGC3DTilesIonSource=!0,this.accessToken=e.accessToken,this.assetId=e.assetId}},vi=class extends Ai{constructor(e){if(!e.key)throw new Error("[OGC3DTilesGoogleSource]: A API key for the google map tiles API is required");e.url=`https://tile.googleapis.com/v1/3dtiles/root.json?key=${e.key}`,super(e),this.isOGC3DTilesGoogleSource=!0,this.key=e.key}};let xi,_i;async function bi(){return _i||(_i=await ii(new Worker(new URL(r.p+r.u(899),r.b),{type:void 0})),xi&&_i.lazPerf(xi),_i)}function wi(e){const t=new n.BufferGeometry,r=new n.BufferAttribute(e.position,3);t.setAttribute("position",r);const i=new n.BufferAttribute(e.intensity,1);t.setAttribute("intensity",i);const s=new n.BufferAttribute(e.returnNumber,1);t.setAttribute("returnNumber",s);const o=new n.BufferAttribute(e.numberOfReturns,1);t.setAttribute("numberOfReturns",o);const a=new n.BufferAttribute(e.classification,1);t.setAttribute("classification",a);const l=new n.BufferAttribute(e.pointSourceID,1);if(t.setAttribute("pointSourceID",l),e.color){const r=new n.BufferAttribute(e.color,4,!0);t.setAttribute("color",r)}const c=new n.BufferAttribute(e.scanAngle,1);return t.setAttribute("scanAngle",c),t.userData.origin=(new n.Vector3).fromArray(e.origin),t}const Ei={enableLazPerf(e){if(!e)throw new Error("Path to laz-perf is mandatory");xi=e},terminate(){const e=_i;return _i=void 0,si.terminate(e)},async parseChunk(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=await bi(),n=wi((await r.parseChunk(oi(e),{pointCount:t.in.pointCount,header:t.in.header,eb:t.eb,colorDepth:t.in.colorDepth})).attributes);return n.computeBoundingBox(),n},async parse(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.out?.skip&&console.warn("Warning: options 'skip' not supported anymore");const r=t.in,n=await bi(),i=await n.parseFile(oi(e),{colorDepth:r?.colorDepth}),s=wi(i.attributes);return s.userData.header=i.header,s.computeBoundingBox(),s}};class Mi extends bn.A{constructor(e){super(e),this.isEntwinePointTileSource=!0,this.colorDepth=e.colorDepth,this.url=this.url.replace("/ept.json",""),this.whenReady=d.A.json(`${this.url}/ept.json`,this.networkOptions).then((e=>(this.parse="laszip"===e.dataType?Ei.parse:Zn.parse,this.extension="laszip"===e.dataType?"laz":"bin",e.srs&&e.srs.authority&&e.srs.horizontal&&(this.crs=`${e.srs.authority}:${e.srs.horizontal}`,i.A.defs(this.crs)||i.A.defs(this.crs,e.srs.wkt),e.srs.vertical&&e.srs.vertical!==e.srs.horizontal&&console.warn("EntwinePointTileSource: Vertical coordinates system code is not yet supported.")),this.spacing=(Math.abs(e.boundsConforming[3]-e.boundsConforming[0])+Math.abs(e.boundsConforming[4]-e.boundsConforming[1]))/(2*e.span),this.boundsConforming=e.boundsConforming,this.span=e.span,this))),this.fetcher=d.A.arrayBuffer}}const Si=Mi;class Ci extends bn.A{constructor(e){super(e),this.isCopcSource=!0,this.parser=Ei.parseChunk,this.fetcher=d.A.arrayBuffer,this.colorDepth=e.colorDepth??16,this.whenReady=async function(e){const t=fn.Las.Header.parse(await e(0,fn.Las.Constants.minHeaderLength)),r=await fn.Las.Vlr.walk(e,t),n=fn.Las.Vlr.find(r,"copc",1);if(!n)return Promise.reject("COPC info VLR is required");const i=fn.Info.parse(await fn.Las.Vlr.fetch(e,n)),s=fn.Las.Vlr.find(r,"LASF_Projection",2112);if(!s)return Promise.reject("LAS1.4 WKT VLR is required");const o=fn.Binary.toCString(await fn.Las.Vlr.fetch(e,s)),a=fn.Las.Vlr.find(r,"LASF_Spec",4);return{header:t,info:i,wkt:o,eb:a?fn.Las.ExtraBytes.parse(await fn.Las.Vlr.fetch(e,a)):[]}}(((e,t)=>this.fetcher(this.url,{...this.networkOptions,headers:{...this.networkOptions.headers,range:`bytes=${e}-${t-1}`}}).then((e=>new Uint8Array(e))))).then((t=>{this.header=t.header,this.info=t.info,this.eb=t.eb,this.crs=e.crs||"EPSG:4326";const r=new n.Box3;return r.min.fromArray(this.info.cube,0),r.max.fromArray(this.info.cube,3),this.extent=s.A.fromBox3(this.crs,r),this}))}}const Ti=Ci;var Ii,Ri=r(62873),Bi=r(68632),Pi="deflate-raw",Li=self.DecompressionStream;try{new Li(Pi),Ii=async e=>{let t=new Li(Pi),r=t.writable.getWriter(),n=t.readable.getReader();r.write(e),r.close();let i,s,o=[],a=0,l=0;for(;!(s=await n.read()).done;)i=s.value,o.push(i),a+=i.length;return o.length-1?(i=new Uint8Array(a),o.map((e=>{i.set(e,l),l+=e.length})),i):o[0]}}catch{}var Di=new TextDecoder,Oi=e=>{throw new Error("but-unzip~"+e)},Ni=e=>Di.decode(e);const Ui=/.+\.(shp|dbf|json|prj|cpg)$/i,Fi=globalThis.URL;async function ki(e,t){const r=((e,t)=>{if(!t)return e;const r=new Fi(e);return r.pathname=`${r.pathname}.${t}`,r.href})(e,t),n="prj"===t||"cpg"===t;try{const e=await fetch(r);if(e.status>399)throw new Error(e.statusText);if(n)return e.text();const t=await e.arrayBuffer();return new DataView(t)}catch(e){if(n||"dbf"===t)return!1;throw e}}function zi(e){let t=0,r=1;const n=e.length;let i,s;const o=[e[0][0],e[0][1],e[0][0],e[0][1]];for(;ro[2]&&(o[2]=s[0]),s[1]>o[3]&&(o[3]=s[1]);return{ring:e,clockWise:t>0,bbox:o,children:[]}}function Gi(e,t){return!(e.bbox[0]>t.bbox[0]||e.bbox[1]>t.bbox[1]||e.bbox[2]20&&(t-=20),!(t in Qi))throw new Error(`I don't know shp type "${t}"`);var r;this.parseFunc=this[Qi[t]],this.parseCoord=(r=e)?function(e,t){const n=[e.getFloat64(t,!0),e.getFloat64(t+8,!0)];return r.inverse(n)}:function(e,t){return[e.getFloat64(t,!0),e.getFloat64(t+8,!0)]}},Vi.prototype.getShpCode=function(){return this.parseHeader().shpCode},Vi.prototype.parseHeader=function(){const e=this.buffer;return{length:e.getInt32(24)<<1,version:e.getInt32(28,!0),shpCode:e.getInt32(32,!0),bbox:[e.getFloat64(36,!0),e.getFloat64(44,!0),e.getFloat64(52,!0),e.getFloat64(60,!0)]}},Vi.prototype.getRows=function(){let e=100;const t=this.buffer.byteLength-8,r=[];let n;for(;e<=t&&(n=this.getRow(e),n);)e+=8,e+=n.len,n.type?r.push(this.parseFunc(n.data)):r.push(null);return r},Vi.prototype.getRow=function(e){const t=this.buffer.getInt32(e),r=this.buffer.getInt32(e+4)<<1;return 0===r?{id:t,len:r,type:0}:e+r+8>this.buffer.byteLength?void 0:{id:t,len:r,data:new DataView(this.buffer.buffer,this.buffer.byteOffset+e+12,r-4),type:this.buffer.getInt32(e+8,!0)}};var ji=/^(?:ANSI\s)?(\d+)$/m;function qi(e,t){if(!e)return n;try{new TextDecoder(e.trim())}catch(i){var r=ji.exec(e);return r&&!t?qi("windows-"+r[1],!0):(e=void 0,n)}return n;function n(t){var r=new TextDecoder(e||void 0);return(r.decode(t,{stream:!0})+r.decode()).replace(/\0/g,"").trim()}}function Wi(e,t,r,n,i){var s=i(new Uint8Array(e.buffer.slice(e.byteOffset+t,e.byteOffset+t+r)));switch(n){case"N":case"F":case"O":return parseFloat(s,10);case"D":return new Date(s.slice(0,4),parseInt(s.slice(4,6),10)-1,s.slice(6,8));case"L":return"y"===s.toLowerCase()||"t"===s.toLowerCase();default:return s}}function Yi(e,t,r,n){for(var i,s,o={},a=0,l=r.length;a{if(e)return"string"==typeof e?e:es(e)||ArrayBuffer.isView(e)||ts(e)?$i.decode(e):void 0},Zi=e=>{if(!e)throw new Error("forgot to pass buffer");if(ts(e))return e;if(es(e))return new DataView(e);if(es(e.buffer))return new DataView(e.buffer,e.byteOffset,e.byteLength);throw new Error("invalid buffer like object")};function es(e){return e instanceof globalThis.ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(e)}function ts(e){return e instanceof globalThis.DataView||"[object DataView]"===Object.prototype.toString.call(e)}const rs=function([e,t]){const r={type:"FeatureCollection",features:[]};let n=0;const i=e.length;for(t||(t=[]);n{if(!e)throw new Error("forgot to pass buffer");if(es(e))return new Uint8Array(e);if(es(e.buffer))return 1===e.BYTES_PER_ELEMENT?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("invalid buffer like object")})(e);const n=await(async e=>{const t={},r=[];for(const n of function*(e,t=Ii){let r=(e=>{let t=e.length-20,r=Math.max(t-65516,2);for(;-1!==(t=e.lastIndexOf(80,t-1))&&(75!==e[t+1]||5!==e[t+2]||6!==e[t+3])&&t>r;);return t})(e);-1===r&&Oi(2);let n=(t,n)=>e.subarray(r+=t,r+=n),i=new DataView(e.buffer,e.byteOffset),s=e=>i.getUint16(e+r,!0),o=e=>i.getUint32(e+r,!0),a=s(10);for(a!==s(8)&&Oi(3),r=o(16);a--;){let e,i=s(10),a=s(28),l=s(30),c=s(32),u=o(20),h=o(42),d=Ni(n(46,a)),p=Ni(n(l,c)),f=r;r=h,e=n(30+s(26)+s(28),u),yield{filename:d,comment:p,read:()=>8&i?t(e):i?Oi(1):e},r=f}}(e))Ui.test(n.filename)&&r.push(Promise.resolve(n.read()).then((e=>t[n.filename]=e)));await Promise.all(r);const n={},i=new TextDecoder;for(const[e,r]of Object.entries(t))"shp"===e.slice(-3).toLowerCase()||"dbf"===e.slice(-3).toLowerCase()?n[e]=new DataView(r.buffer,r.byteOffset,r.byteLength):n[e]=i.decode(r);return n})(e),s=[];for(r in t=t||[],n)-1===r.indexOf("__MACOSX")&&(".shp"===r.slice(-4).toLowerCase()?(s.push(r.slice(0,-4)),n[r.slice(0,-3)+r.slice(-3).toLowerCase()]=n[r]):".prj"===r.slice(-4).toLowerCase()?n[r.slice(0,-3)+r.slice(-3).toLowerCase()]=(0,i.A)(n[r]):".json"===r.slice(-5).toLowerCase()||t.indexOf(r.split(".").pop())>-1?s.push(r.slice(0,-3)+r.slice(-3).toLowerCase()):".dbf"!==r.slice(-4).toLowerCase()&&".cpg"!==r.slice(-4).toLowerCase()||(n[r.slice(0,-3)+r.slice(-3).toLowerCase()]=n[r]));if(!s.length)throw new Error("no layers founds");const o=s.map((function(e){let r,i;const s=e.lastIndexOf(".");return s>-1&&e.slice(s).indexOf("json")>-1?(r=JSON.parse(n[e]),r.fileName=e.slice(0,s)):t.indexOf(e.slice(s+1))>-1?(r=n[e],r.fileName=e):(n[e+".dbf"]&&(i=Xi(n[e+".dbf"],n[e+".cpg"])),r=rs([Hi(n[e+".shp"],n[e+".prj"]),i]),r.fileName=e),r}));return 1===o.length?o[0]:o},is=async e=>{const t=await Promise.all([ki(e,"shp"),ki(e,"prj")]);let r=!1;try{t[1]&&(r=(0,i.A)(t[1]))}catch(e){r=!1}return Hi(t[0],r)},ss=async e=>{const[t,r]=await Promise.all([ki(e,"dbf"),ki(e,"cpg")]);if(t)return Xi(t,r)},os=(e,t)=>new Ki(e,globalThis?.document?.location).pathname.slice(-4).toLowerCase()===t,as=function(e,t){if(e=Zi(e),"string"==typeof(t=Ji(t)))try{t=(0,i.A)(t)}catch(e){t=!1}return Hi(e,t)},ls=async function(e,t){if("string"!=typeof e){if(es(e)||ArrayBuffer.isView(e)||ts(e))return ns(e);if(e.shp)return(({shp:e,dbf:t,cpg:r,prj:n})=>{const i=[as(e,n)];return t&&i.push(function(e,t){return Xi(e=Zi(e),t=Ji(t))}(t,r)),rs(i)})(e);throw new TypeError("must be a string, some sort of Buffer, or an object with at least a .shp property")}if(os(e,".zip"))return async function(e,t){const r=await ki(e);return ns(r,t)}(e,t);os(e,".shp")&&(e=e.slice(0,-4));const r=await Promise.all([is(e),ss(e)]);return rs(r)},cs={parse(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r=(0,Ge.zv)(r),e.zip?t=ls(e.zip):e.shp&&e.shx&&e.dbf&&(t=ls(e)),r.in=r.in||{},r.in.crs=e.prj?(0,i.A)(e.prj).oProj.datumName:r.in.crs,Promise.resolve(t).then((e=>jr.A.parse(e,r)))}};var us=r(18625),hs=r(8123),ds=r(51429),ps=r(55540),fs=r(57669),ms=r(55536),gs=r(80264),As=r(34422),ys=r(34993),vs=r(706),xs=r(25847);const _s=class{constructor(e){this.classes=e.classes,this.inverseHierarchy={},this.instancesIdxs=[];const t={};let r=0,n=e.parentCounts;void 0===n&&(n=new Array(e.instancesLength),n.fill(1));for(let i=0;i{"use strict";r.d(t,{A:()=>f});var n=r(39437),i=r(34993),s=r(2015),o=r(20620),a=r(21311),l=r(70515),c=r(49423);const u=(new n.Matrix4).makeRotationX(Math.PI/2),h=(new n.Matrix4).makeRotationZ(-Math.PI/2),d=new TextDecoder;function p(e){const t=["MODELVIEW","MODELVIEWINVERSETRANSPOSE","PROJECTION","JOINTMATRIX"];if(e.gltfShader){const r=[];for(const t in e.gltfShader.boundUniforms)r.push(t);for(const n of r){const r=e.gltfShader.boundUniforms[n].semantic;t.includes(r)||delete e.gltfShader.boundUniforms[n]}}}const f={parse(e,t){const r=!0===t.frustumCulled;if(!e)throw new Error("No array buffer provided.");const f=new DataView(e,4);let m=0;const g={};if(g.magic=d.decode(new Uint8Array(e,0,4)),g.magic){g.version=f.getUint32(m,!0),m+=Uint32Array.BYTES_PER_ELEMENT,g.byteLength=f.getUint32(m,!0),m+=Uint32Array.BYTES_PER_ELEMENT,g.FTJSONLength=f.getUint32(m,!0),m+=Uint32Array.BYTES_PER_ELEMENT,g.FTBinaryLength=f.getUint32(m,!0),m+=Uint32Array.BYTES_PER_ELEMENT,g.BTJSONLength=f.getUint32(m,!0),m+=Uint32Array.BYTES_PER_ELEMENT,g.BTBinaryLength=f.getUint32(m,!0),m+=Uint32Array.BYTES_PER_ELEMENT;const A=m+4,y=[];let v={};const x=new n.Vector3;if(g.FTJSONLength>0){const t=A,r=e.slice(t,g.FTJSONLength+t),n=d.decode(new Uint8Array(r));v=JSON.parse(n),v.RTC_CENTER?x.fromArray(v.RTC_CENTER):x.set(0,0,0)}if(g.FTBinaryLength>0&&console.warn("3D Tiles feature table binary not supported yet."),g.BTJSONLength>0){const r=A+g.FTJSONLength+g.FTBinaryLength,n=e.slice(r,r+g.BTJSONLength+g.BTBinaryLength);y.push(Promise.resolve(new i.A(n,g.BTJSONLength,g.BTBinaryLength,v.BATCH_LENGTH,t.registeredExtensions)))}else y.push(Promise.resolve(new i.A));const _=A+g.FTJSONLength+g.FTBinaryLength+g.BTJSONLength+g.BTBinaryLength,b=e.slice(_),w=function(e){if(e.frustumCulled=r,e.material){if(t.overrideMaterials){const r=e.material;"object"==typeof t.overrideMaterials&&t.overrideMaterials.isMaterial?e.material=t.overrideMaterials:e.material=new n.MeshBasicMaterial,(0,o.A)(r)}else s.A.isLogDepthBufferSupported()&&e.material.isRawShaderMaterial&&!t.doNotPatchMaterial&&(a.A.patchMaterialForLogDepthSupport(e.material),console.warn("glTF shader has been patched to add log depth buffer support"));(0,l.A)(e.material,t.layer)}};return y.push(c.TK.parseAsync(b,t).then((e=>{for(const t of e.scenes)t.traverse(p);var r,n;r=e.scene,(n=t.gltfUpAxis)&&"Y"!==n?"X"===n&&r.applyMatrix4(h):r.applyMatrix4(u);const i=s.A.isLogDepthBufferSupported()&&!t.doNotPatchMaterial;return(!1===t.frustumCulling||t.overrideMaterials||i||t.layer)&&e.scene.traverse(w),e.scene.position.copy(x),e})).catch((e=>{throw new Error(e)}))),Promise.all(y).then((e=>({gltf:e[1],batchTable:e[0]}))).catch((e=>{throw new Error(e)}))}throw new Error("Invalid b3dm file.")}}},8123:(e,t,r)=>{"use strict";r.d(t,{A:()=>l,i:()=>a});var n=r(39437),i=r(77855),s=r(86215),o=r(51429);function a(e,t){const r=e[e.indexOf(e.find((e=>e.includes(t))))].split(" ").filter((e=>""!==e));return parseFloat(r[r.length-1])}const l={parse(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{in:{}};const r=e.split("\n"),l=r.indexOf(r.find((e=>e.includes("end_of_head"))))+1,c=r.slice(0,l),u={minX:a(c,"longlimit_west"),maxX:a(c,"longlimit_east"),minY:a(c,"latlimit_south"),maxY:a(c,"latlimit_north"),stepX:a(c,"gridstep"),stepY:a(c,"gridstep"),nRows:a(c,"latitude_parallels"),nColumns:a(c,"longitude_parallels")},h=new DataView(new ArrayBuffer(o.mo*u.nRows*u.nColumns));let d=0;for(let e of r.slice(l,r.length))e=e.split(" ").filter((e=>""!==e)),e.length&&(h.setFloat64(d*o.mo,parseFloat(e[2])),d++);const p=new s.A(t.in.crs||"EPSG:4326",u.minX,u.maxX,u.minY,u.maxY),f=new n.Vector2(u.stepX,u.stepY);return Promise.resolve(new i.A(p,f,((e,t)=>h.getFloat64((u.nColumns*(u.nRows-e-1)+t)*o.mo))))}}},51429:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>a,mo:()=>o});var n=r(39437),i=r(77855),s=r(86215);const o=8,a={parse(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{in:{}};const r=t.in.dataType||"float";if(!["float","double"].includes(r))throw new Error("`dataType` parameter is incorrect for GTXParser.parse method. This parameter must be either `double` or `float`.");const a=new DataView(e,0,40),l={minX:a.getFloat64(8),minY:a.getFloat64(0),stepX:a.getFloat64(24),stepY:a.getFloat64(16),nColumns:a.getInt32(36),nRows:a.getInt32(32)},c=new DataView(e,40),u=l.minX+l.stepX*(l.nColumns-1),h=l.minY+l.stepY*(l.nRows-1),d=new s.A(t.in.crs||"EPSG:4326",l.minX,u,l.minY,h),p=new n.Vector2(l.stepX,l.stepY);return Promise.resolve(new i.A(d,p,((e,t)=>"float"===r?c.getFloat32(4*(l.nColumns*e+t)):"double"===r?c.getFloat64((l.nColumns*e+t)*o):void 0)))}}},89191:(e,t,r)=>{"use strict";r.d(t,{A:()=>m});var n=r(52404),i=r(36845),s=r(47155);const o=new n.A("EPSG:4978",0,0,0),a=new n.A("EPSG:4978",0,0,0),l=new n.A("EPSG:4978",0,0,0),c=(e,t,r)=>(o.crs=r,o.setFromArray(t[0]),!e.isPointInside(o)),u={populateGeometry(e,t,r,n){r.startSubGeometry(t.length,n),o.crs=e;for(const e of t)o.setFromValues(e[0],e[1],e[2]),r.pushCoordinates(n,o);r.updateExtent()},populateGeometryWithCCW(e,t,r,n){r.startSubGeometry(t.length,n),o.crs=e;let i=0;l.setFromValues(t[0][0],t[0][1],t[0][2]),a.copy(l);for(let e=0;evoid 0===e||Array.isArray(e)&&!isNaN(e[0])?e:d(e[0]);function p(e,t,r){if(!t.geometry?.type)return console.warn("No geometry provided"),null;const n=t.geometry.type.toLowerCase(),s=function(e){switch(e){case"point":case"multipoint":return i.Xs.POINT;case"linestring":case"multilinestring":return i.Xs.LINE;case"polygon":case"multipolygon":return i.Xs.POLYGON;default:throw new Error(`Unhandled geometry type ${e}`)}}(n),o=r.requestFeatureByType(s),a="point"!=n?t.geometry.coordinates:[t.geometry.coordinates],l=t.properties||{};o.hasRawElevationData=3===d(a)?.length;for(const e of Object.keys(t))h.includes(e.toLowerCase())||(l.geojson=l.geojson||{},l.geojson[e]=t[e]);return function(e,t,r,n,i,s){if(0!=n.length)switch(e){case"point":case"linestring":return u.default(t,r,n,i,s);case"multipoint":return u.multi("point",t,r,n,i,s);case"multilinestring":return u.multi("default",t,r,n,i,s);case"polygon":return u.polygon(t,r,n,i,s);case"multipolygon":return u.multi("polygon",t,r,n,i,s);default:throw new Error(`Unhandled geojson type ${t.type}`)}}(n,o,e,a,r,l),o}function f(e,t,r){const n=new i.ZC(r),s=r.filter||(()=>!0);for(const r of t)s(r.properties,r.geometry)&&p(e,r,n);return n.removeEmptyFeature(),n.updateExtent(),n}const m={parse(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=(0,s.zv)(t),t.in=t.in||{};const r=t.out,n=t.in;switch("string"==typeof e&&(e=JSON.parse(e)),n.crs=n.crs||function(e){if(e.crs){if("epsg"==e.crs.type.toLowerCase())return`EPSG:${e.crs.properties.code}`;if("name"==e.crs.type.toLowerCase()){if(e.crs.properties.name.toLowerCase().includes("epsg:")){const t=e.crs.properties.name.lastIndexOf(":");if(t>0)return`EPSG:${e.crs.properties.name.substr(t+1)}`}throw new Error(`Unsupported CRS authority '${e.crs.properties.name}'`)}throw new Error(`Unsupported CRS type '${e.crs}'`)}return"EPSG:4326"}(e),r.filteringExtent&&("boolean"==typeof r.filteringExtent?r.filterExtent=t.extent.isExtent?t.extent.as(n.crs):t.extent.toExtent(n.crs):r.filteringExtent.isExtent&&(r.filterExtent=r.filteringExtent)),e.type.toLowerCase()){case"featurecollection":return Promise.resolve(f(n.crs,e.features,r));case"feature":return Promise.resolve(f(n.crs,[e],r));default:throw new Error(`Unsupported GeoJSON type: '${e.type}`)}}}},62873:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(20992),i=r(89191),s=r(47155);const o={parse:(e,t)=>(t=(0,s.zv)(t),i.A.parse((0,n.GN)(e),t))}},18625:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var n=r(39437),i=r(77855),s=r(86215),o=r(8123),a=r(51429);const l={parse(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{in:{}};const r=e.split("\n"),l=r.indexOf(r.find((e=>e.includes("end_of_head"))))+1,c=r.slice(0,l),u={minX:(0,o.i)(c,"lon min"),maxX:(0,o.i)(c,"lon max"),minY:(0,o.i)(c,"lat min"),maxY:(0,o.i)(c,"lat max"),stepX:(0,o.i)(c,"delta lon"),stepY:(0,o.i)(c,"delta lat"),nRows:(0,o.i)(c,"nrows"),nColumns:(0,o.i)(c,"ncols")},h=new DataView(new ArrayBuffer(a.mo*u.nRows*u.nColumns));let d=0;for(let e of r.slice(l,r.length))if(e=e.split(" ").filter((e=>""!==e)),e.length)for(const t of e)h.setFloat64(d*a.mo,parseFloat(t)),d++;const p=new s.A(t.in.crs||"EPSG:4326",u.minX+u.stepX/2,u.maxX-u.stepX/2,u.minY+u.stepY/2,u.maxY-u.stepY/2),f=new n.Vector2(u.stepX,u.stepY);return Promise.resolve(new i.A(p,f,((e,t)=>h.getFloat64((u.nColumns*e+t)*a.mo))))}}},68632:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(20992),i=r(89191),s=r(47155);const o={parse:(e,t)=>(t=(0,s.zv)(t),i.A.parse((0,n.bW)(e),t))}},57669:(e,t,r)=>{"use strict";r.d(t,{A:()=>ee});var n=r(39437);const i={};i.LegacyGLTFLoader=function(){class e extends n.Loader{constructor(e){super(e)}load(e,t,r,i){var s,o=this;s=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:n.LoaderUtils.extractUrlBase(e);var a=new n.FileLoader(o.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.load(e,(function(e){o.parse(e,s,t)}),r,i)}parse(e,t,r){var a,u={};n.LoaderUtils.decodeText(new Uint8Array(e,0,4))===o.magic?(u[i.KHR_BINARY_GLTF]=new l(e),a=u[i.KHR_BINARY_GLTF].content):a=n.LoaderUtils.decodeText(new Uint8Array(e));var h=JSON.parse(a);h.extensionsUsed&&h.extensionsUsed.indexOf(i.KHR_MATERIALS_COMMON)>=0&&(u[i.KHR_MATERIALS_COMMON]=new s(h)),h.extensionsUsed&&h.extensionsUsed.indexOf(i.CESIUM_RTC)>=0&&(u[i.CESIUM_RTC]=new c(h)),new T(h,u,{crossOrigin:this.crossOrigin,manager:this.manager,path:t||this.resourcePath||""}).parse((function(e,t,n,i){r({scene:e,scenes:t,cameras:n,animations:i})}))}}function t(){var e={};return{get:function(t){return e[t]},add:function(t,r){e[t]=r},remove:function(t){delete e[t]},removeAll:function(){e={}},update:function(t,r){for(var n in e){var i=e[n];i.update&&i.update(t,r)}}}}function r(e,t){var r={},i=e.material.uniforms;for(var s in i){var o=i[s];if(o.semantic){var a=o.node,l=e;a&&(l=t[a]),r[s]={semantic:o.semantic,sourceNode:l,targetNode:e,uniform:o}}}this.boundUniforms=r,this._m4=new n.Matrix4}e.Shaders={update:function(){console.warn("threeExamples.LegacyGLTFLoader.Shaders has been deprecated, and now updates automatically.")}},r.prototype.update=function(e,t){var r=this.boundUniforms;for(var n in r){var i=r[n];switch(i.semantic){case"MODELVIEW":i.uniform.value.multiplyMatrices(t.matrixWorldInverse,i.sourceNode.matrixWorld);break;case"MODELVIEWINVERSETRANSPOSE":var s=i.uniform.value;this._m4.multiplyMatrices(t.matrixWorldInverse,i.sourceNode.matrixWorld),s.getNormalMatrix(this._m4);break;case"PROJECTION":i.uniform.value.copy(t.projectionMatrix);break;case"JOINTMATRIX":for(var o=i.uniform.value,a=0;a=2.0 are supported.")));const l=new $(i,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e=0&&void 0===o[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}l.setExtensions(s),l.setPlugins(o),l.parse(r,n)}parseAsync(e,t){const r=this;return new Promise((function(n,i){r.parse(e,t,n,i)}))}}function l(){let e={};return{get:function(t){return e[t]},add:function(t,r){e[t]=r},remove:function(t){delete e[t]},removeAll:function(){e={}}}}const c={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class u{constructor(e){this.parser=e,this.name=c.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let r=0,n=t.length;r=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,i.source,s)}}class E{constructor(e){this.parser=e,this.name=c.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,r=this.parser,n=r.json,i=n.textures[e];if(!i.extensions||!i.extensions[t])return null;const s=i.extensions[t],o=n.images[s.source];let a=r.textureLoader;if(o.uri){const e=r.options.manager.getHandler(o.uri);null!==e&&(a=e)}return this.detectSupport().then((function(i){if(i)return r.loadTextureImage(e,s.source,a);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(e)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}}class M{constructor(e){this.parser=e,this.name=c.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,r=this.parser,n=r.json,i=n.textures[e];if(!i.extensions||!i.extensions[t])return null;const s=i.extensions[t],o=n.images[s.source];let a=r.textureLoader;if(o.uri){const e=r.options.manager.getHandler(o.uri);null!==e&&(a=e)}return this.detectSupport().then((function(i){if(i)return r.loadTextureImage(e,s.source,a);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(e)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}}class S{constructor(e){this.name=c.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,r=t.bufferViews[e];if(r.extensions&&r.extensions[this.name]){const e=r.extensions[this.name],n=this.parser.getDependency("buffer",e.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return n.then((function(t){const r=e.byteOffset||0,n=e.byteLength||0,s=e.count,o=e.byteStride,a=new Uint8Array(t,r,n);return i.decodeGltfBufferAsync?i.decodeGltfBufferAsync(s,o,a,e.mode,e.filter).then((function(e){return e.buffer})):i.ready.then((function(){const t=new ArrayBuffer(s*o);return i.decodeGltfBuffer(new Uint8Array(t),s,o,a,e.mode,e.filter),t}))}))}return null}}class C{constructor(e){this.name=c.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,r=t.nodes[e];if(!r.extensions||!r.extensions[this.name]||void 0===r.mesh)return null;const i=t.meshes[r.mesh];for(const e of i.primitives)if(e.mode!==N.TRIANGLES&&e.mode!==N.TRIANGLE_STRIP&&e.mode!==N.TRIANGLE_FAN&&void 0!==e.mode)return null;const s=r.extensions[this.name].attributes,o=[],a={};for(const e in s)o.push(this.parser.getDependency("accessor",s[e]).then((t=>(a[e]=t,a[e]))));return o.length<1?null:(o.push(this.parser.createNodeMesh(e)),Promise.all(o).then((e=>{const t=e.pop(),r=t.isGroup?t.children:[t],i=e[0].count,s=[];for(const e of r){const t=new n.Matrix4,r=new n.Vector3,o=new n.Quaternion,l=new n.Vector3(1,1,1),c=new n.InstancedMesh(e.geometry,e.material,i);for(let e=0;e0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new l,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let r=!1,i=-1,s=!1,o=-1;if("undefined"!=typeof navigator){const e=navigator.userAgent;r=!0===/^((?!chrome|android).)*safari/i.test(e);const t=e.match(/Version\/(\d+)/);i=r&&t?parseInt(t[1],10):-1,s=e.indexOf("Firefox")>-1,o=s?e.match(/Firefox\/([0-9]+)\./)[1]:-1}"undefined"==typeof createImageBitmap||r&&i<17||s&&o<98?this.textureLoader=new n.TextureLoader(this.options.manager):this.textureLoader=new n.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new n.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const r=this,n=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll((function(e){return e._markDefs&&e._markDefs()})),Promise.all(this._invokeAll((function(e){return e.beforeRoot&&e.beforeRoot()}))).then((function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])})).then((function(t){const s={scene:t[0][n.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:n.asset,parser:r,userData:{}};return H(i,s,n),j(s,n),Promise.all(r._invokeAll((function(e){return e.afterRoot&&e.afterRoot(s)}))).then((function(){for(const e of s.scenes)e.updateMatrixWorld();e(s)}))})).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[];for(let r=0,n=t.length;r{const r=this.associations.get(e);null!=r&&this.associations.set(t,r);for(const[r,n]of e.children.entries())i(n,t.children[r])};return i(r,n),n.name+="_instance_"+e.uses[t]++,n}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let r=0;r=2&&p.setY(t,h[e*o+1]),o>=3&&p.setZ(t,h[e*o+2]),o>=4&&p.setW(t,h[e*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return p}))}loadTexture(e){const t=this.json,r=this.options,n=t.textures[e].source,i=t.images[n];let s=this.textureLoader;if(i.uri){const e=r.manager.getHandler(i.uri);null!==e&&(s=e)}return this.loadTextureImage(e,n,s)}loadTextureImage(e,t,r){const i=this,s=this.json,o=s.textures[e],a=s.images[t],l=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const c=this.loadImageSource(t,r).then((function(t){t.flipY=!1,t.name=o.name||a.name||"",""===t.name&&"string"==typeof a.uri&&!1===a.uri.startsWith("data:image/")&&(t.name=a.uri);const r=(s.samplers||{})[o.sampler]||{};return t.magFilter=F[r.magFilter]||n.LinearFilter,t.minFilter=F[r.minFilter]||n.LinearMipmapLinearFilter,t.wrapS=k[r.wrapS]||n.RepeatWrapping,t.wrapT=k[r.wrapT]||n.RepeatWrapping,i.associations.set(t,{textures:e}),t})).catch((function(){return null}));return this.textureCache[l]=c,c}loadImageSource(e,t){const r=this.json,i=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then((e=>e.clone()));const s=r.images[e],o=self.URL||self.webkitURL;let a=s.uri||"",l=!1;if(void 0!==s.bufferView)a=this.getDependency("bufferView",s.bufferView).then((function(e){l=!0;const t=new Blob([e],{type:s.mimeType});return a=o.createObjectURL(t),a}));else if(void 0===s.uri)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const c=Promise.resolve(a).then((function(e){return new Promise((function(r,s){let o=r;!0===t.isImageBitmapLoader&&(o=function(e){const t=new n.Texture(e);t.needsUpdate=!0,r(t)}),t.load(n.LoaderUtils.resolveURL(e,i.path),o,void 0,s)}))})).then((function(e){var t;return!0===l&&o.revokeObjectURL(a),j(e,s),e.userData.mimeType=s.mimeType||((t=s.uri).search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/)?"image/jpeg":t.search(/\.webp($|\?)/i)>0||0===t.search(/^data\:image\/webp/)?"image/webp":"image/png"),e})).catch((function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",a),e}));return this.sourceCache[e]=c,c}assignTexture(e,t,r,n){const i=this;return this.getDependency("texture",r.index).then((function(s){if(!s)return null;if(void 0!==r.texCoord&&r.texCoord>0&&((s=s.clone()).channel=r.texCoord),i.extensions[c.KHR_TEXTURE_TRANSFORM]){const e=void 0!==r.extensions?r.extensions[c.KHR_TEXTURE_TRANSFORM]:void 0;if(e){const t=i.associations.get(s);s=i.extensions[c.KHR_TEXTURE_TRANSFORM].extendTexture(s,e),i.associations.set(s,t)}}return void 0!==n&&(s.colorSpace=n),e[t]=s,s}))}assignFinalMaterial(e){const t=e.geometry;let r=e.material;const i=void 0===t.attributes.tangent,s=void 0!==t.attributes.color,o=void 0===t.attributes.normal;if(e.isPoints){const e="PointsMaterial:"+r.uuid;let t=this.cache.get(e);t||(t=new n.PointsMaterial,n.Material.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,t.sizeAttenuation=!1,this.cache.add(e,t)),r=t}else if(e.isLine){const e="LineBasicMaterial:"+r.uuid;let t=this.cache.get(e);t||(t=new n.LineBasicMaterial,n.Material.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,this.cache.add(e,t)),r=t}if(i||s||o){let e="ClonedMaterial:"+r.uuid+":";i&&(e+="derivative-tangents:"),s&&(e+="vertex-colors:"),o&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=r.clone(),s&&(t.vertexColors=!0),o&&(t.flatShading=!0),i&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(r))),r=t}e.material=r}getMaterialType(){return n.MeshStandardMaterial}loadMaterial(e){const t=this,r=this.json,i=this.extensions,s=r.materials[e];let o;const a={},l=[];if((s.extensions||{})[c.KHR_MATERIALS_UNLIT]){const e=i[c.KHR_MATERIALS_UNLIT];o=e.getMaterialType(),l.push(e.extendParams(a,s,t))}else{const r=s.pbrMetallicRoughness||{};if(a.color=new n.Color(1,1,1),a.opacity=1,Array.isArray(r.baseColorFactor)){const e=r.baseColorFactor;a.color.setRGB(e[0],e[1],e[2],n.LinearSRGBColorSpace),a.opacity=e[3]}void 0!==r.baseColorTexture&&l.push(t.assignTexture(a,"map",r.baseColorTexture,n.SRGBColorSpace)),a.metalness=void 0!==r.metallicFactor?r.metallicFactor:1,a.roughness=void 0!==r.roughnessFactor?r.roughnessFactor:1,void 0!==r.metallicRoughnessTexture&&(l.push(t.assignTexture(a,"metalnessMap",r.metallicRoughnessTexture)),l.push(t.assignTexture(a,"roughnessMap",r.metallicRoughnessTexture))),o=this._invokeOne((function(t){return t.getMaterialType&&t.getMaterialType(e)})),l.push(Promise.all(this._invokeAll((function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,a)}))))}!0===s.doubleSided&&(a.side=n.DoubleSide);const u=s.alphaMode||"OPAQUE";if("BLEND"===u?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,"MASK"===u&&(a.alphaTest=void 0!==s.alphaCutoff?s.alphaCutoff:.5)),void 0!==s.normalTexture&&o!==n.MeshBasicMaterial&&(l.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new n.Vector2(1,1),void 0!==s.normalTexture.scale)){const e=s.normalTexture.scale;a.normalScale.set(e,e)}if(void 0!==s.occlusionTexture&&o!==n.MeshBasicMaterial&&(l.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),void 0!==s.occlusionTexture.strength&&(a.aoMapIntensity=s.occlusionTexture.strength)),void 0!==s.emissiveFactor&&o!==n.MeshBasicMaterial){const e=s.emissiveFactor;a.emissive=(new n.Color).setRGB(e[0],e[1],e[2],n.LinearSRGBColorSpace)}return void 0!==s.emissiveTexture&&o!==n.MeshBasicMaterial&&l.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture,n.SRGBColorSpace)),Promise.all(l).then((function(){const r=new o(a);return s.name&&(r.name=s.name),j(r,s),t.associations.set(r,{materials:e}),s.extensions&&H(i,r,s),r}))}createUniqueName(e){const t=n.PropertyBinding.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,r=this.extensions,i=this.primitiveCache;function s(e){return r[c.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(r){return J(r,e,t)}))}const o=[];for(let r=0,a=e.length;r0&&q(p,s),p.name=t.createUniqueName(s.name||"mesh_"+e),j(p,s),d.extensions&&H(i,p,d),t.assignFinalMaterial(p),u.push(p)}for(let r=0,n=u.length;r1?new n.Group:1===t.length?t[0]:new n.Object3D,a!==t[0])for(let e=0,r=t.length;e{const t=new Map;for(const[e,r]of i.associations)(e instanceof n.Material||e instanceof n.Texture)&&t.set(e,r);return e.traverse((e=>{const r=i.associations.get(e);null!=r&&t.set(e,r)})),t})(s),s}))}_createAnimationTracks(e,t,r,i,s){const o=[],a=e.name?e.name:e.uuid,l=[];let c;switch(Q[s.path]===Q.weights?e.traverse((function(e){e.morphTargetInfluences&&l.push(e.name?e.name:e.uuid)})):l.push(a),Q[s.path]){case Q.weights:c=n.NumberKeyframeTrack;break;case Q.rotation:c=n.QuaternionKeyframeTrack;break;case Q.position:case Q.scale:c=n.VectorKeyframeTrack;break;default:c=1===r.itemSize?n.NumberKeyframeTrack:n.VectorKeyframeTrack}const u=void 0!==i.interpolation?V[i.interpolation]:n.InterpolateLinear,h=this._getArrayFromAccessor(r);for(let e=0,r=l.length;e{i?i(t):console.error(t),s.manager.itemError(e),s.manager.itemEnd(e)},l=new n.FileLoader(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,(r=>{try{s.parse(r,o,(r=>{t(r),s.manager.itemEnd(e)}),a)}catch(e){a(e)}}),r,a)}setDRACOLoader(e){this.glTFLoader.setDRACOLoader(e)}setKTX2Loader(e){this.glTFLoader.setKTX2Loader(e)}setMeshoptDecoder(e){this.glTFLoader.setMeshoptDecoder(e)}register(e){this.glTFLoader.register(e)}unregister(e){this.glTFLoader.unregister(e)}parse(e,t,r,n){e&&t?1===new DataView(e,0,20).getUint32(4,!0)?this.legacyGLTFLoader.parse(e,t,r,n):this.glTFLoader.parse(e,t,r,n):n("[iGLTFLoader]: Buffer and path are mandatory to parse a glTF.")}parseAsync(e,t){const r=this;return new Promise(((n,i)=>{r.parse(e,t,n,i)}))}}const ee=Z},48542:(e,t,r)=>{"use strict";r.d(t,{LM:()=>d,Li:()=>u,WD:()=>m,cG:()=>v,oS:()=>y});var n=r(39437),i=r(32060),s=r(25847),o=r(14333);function a(e,t,r,n,i,s){const a={view:e,requester:i,layer:r,priority:i?1/(i.distance+1):100,metadata:n,redraw:s};return r.dispatchEvent({type:o.s.ON_TILE_REQUESTED,metadata:n}),t.execute(a)}function l(e){return e.children.filter((t=>t.layer==e.layer&&t.tileId))}const c=new n.Matrix4;function u(e,t,r,n){return!(!r.viewerRequestVolume||!r.viewerRequestVolume.viewerRequestVolumeCulling(t,n))||!(!r.boundingVolume||!r.boundingVolume.boundingVolumeCulling(t,n))}function h(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=t.additiveRefinement||r>0;for(let s=0;sthis.cleanupDelay){this.root.cleanableSince=void 0;let e=0;for(;ethis.cleanupDelay))break;h(this,r)}this._cleanableTiles.splice(0,e)}return[this.root]}const p=new n.Box3,f=new n.Sphere;function m(e,t,r,n){return a(e,t,r,n,void 0,!0).then((e=>{r.object3d.add(e),e.updateMatrixWorld(),r.tileset.tiles[e.tileId].loaded=!0,r.root=e,r.onTileContentLoaded(e)}))}function g(e,t){e.content&&(e.content.visible=t)}function A(e,t){t.cleanableSince||(t.cleanableSince=Date.now(),e._cleanableTiles.push(t))}function y(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v;return function(r,n,i){if(i.parent.pendingSubdivision&&!i.parent.additiveRefinement)return void(i.visible=!1);const s=!e||!e(n,r.camera,i,i.matrixWorld);if(i.visible=s,s){let s;if(i.cleanableSince&&(n._cleanableTiles.splice(n._cleanableTiles.indexOf(i),1),i.cleanableSince=void 0),i.pendingSubdivision||t(r,n,i))(function(e,t,r,n){r.additiveRefinement?function(e,t,r,n){for(const i of t.tileset.tiles[r.tileId].children){if(i.promise||i.loaded)continue;let s=r.matrixWorld;i.transform&&(s=c.multiplyMatrices(r.matrixWorld,i.transform)),(!n||!n(t,e.camera,i,s))&&(i.promise=a(e.view,e.scheduler,t,i,r,!0).then((n=>{r.add(n),n.updateMatrixWorld(),t.onTileContentLoaded(n),e.view.notifyChange(i),i.loaded=!0,delete i.promise})))}}(e,t,r,n):function(e,t,r){if(!r.pendingSubdivision&&0==l(r).length){const n=t.tileset.tiles[r.tileId].children;if(void 0===n||0===n.length)return;r.pendingSubdivision=!0;const i=[];for(let s=0;s{n[s].loaded=!0,r.add(i),i.updateMatrixWorld(),r.additiveRefinement&&e.view.notifyChange(r),t.tileset.tiles[i.tileId].loaded=!0,t.onTileContentLoaded(i)})));Promise.all(i).then((()=>{r.pendingSubdivision=!1,e.view.notifyChange(r)}))}}(e,t,r)})(r,n,i,e),g(i,i.pendingSubdivision||i.additiveRefinement),s=l(i);else{g(i,!0);for(const e of l(i))e.visible=!1,A(n,e)}return s}A(n,i)}}function v(e,t,r){if(void 0===t.tileset.tiles[r.tileId].children)return!1;if(t.tileset.tiles[r.tileId].isTileset)return!0;const n=function(e,t){if(t.distance=0,t.boundingVolume.initialVolumeType===s.h.box)p.copy(t.boundingVolume.volume),p.applyMatrix4(t.matrixWorld),t.distance=p.distanceToPoint(e.camera3D.position);else{if(t.boundingVolume.initialVolumeType!==s.h.sphere&&t.boundingVolume.initialVolumeType!==s.h.region)return 1/0;f.copy(t.boundingVolume.volume),f.applyMatrix4(t.matrixWorld),t.distance=Math.max(0,f.distanceToPoint(e.camera3D.position))}return 0===t.distance?1/0:e._preSSE*(t.geometricError/t.distance)}(e.camera,r);return n>t.sseThreshold}},32060:(e,t,r)=>{"use strict";function n(e){e.dispose();for(const t of Object.keys(e)){const r=e[t];r&&r.isTexture&&r.dispose()}}r.d(t,{A:()=>i});const i={cleanup(e){if(e.layer=null,e.isScene||"function"!=typeof e.dispose){if(e.geometry&&e.geometry.dispose(),e.material)if(Array.isArray(e.material))for(const t of e.material)n(t);else n(e.material);e.dispatchEvent({type:"dispose"})}else e.dispose()},removeChildren(e,t){const r=t.children.filter((t=>(t.layer&&t.layer.id)===e.id));return t.remove(...r),r},removeChildrenAndCleanup(e,t){const r=t.children.filter((t=>(t.layer&&t.layer.id)===e.id));return t.remove(...r),t.layer===e&&this.cleanup(t),r},removeChildrenAndCleanupRecursively(e,t){let r=t.children.filter((t=>t.layer&&t.layer.id===e.id));const n=t.link&&t.link[e.id];n?.children.length&&(r=r.concat(n.children),delete t.link[e.id]);for(const t of r)this.removeChildrenAndCleanupRecursively(e,t);return t.remove(...r),t.layer&&t.layer.id===e.id&&this.cleanup(t),r}}},7794:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(39437);const i=new n.TextureLoader;function s(e){if(!e.ok){const t=new Error(`Error loading ${e.url}: status ${e.status}`);throw t.response=e,t}}const o=function(e){return fetch(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).then((e=>(s(e),e.arrayBuffer())))},a={text(e){return fetch(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).then((e=>(s(e),e.text())))},json(e){return fetch(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).then((e=>(s(e),e.json())))},xml(e){return fetch(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).then((e=>(s(e),e.text()))).then((e=>(new window.DOMParser).parseFromString(e,"text/xml")))},texture(e){let t,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i.crossOrigin=n.crossOrigin;const s=new Promise(((e,n)=>{t=e,r=n}));return i.load(e,t,(()=>{}),(t=>{const n=new Error(`Failed to load texture from URL: \`${e}\``);n.originalEvent=t,r(n)})),s},arrayBuffer:o,textureFloat(e){return o(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).then((e=>{const t=function(e){const t=new n.DataTexture(e,256,256,n.RedFormat,n.FloatType);return t.internalFormat="R32F",t.needsUpdate=!0,t}(new Float32Array(e));return t}))},multiple(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=[];let i;for(const s in t){if(!this[s])throw new Error(`${s} is not a valid Fetcher method.`);for(const o of t[s])i=`${e}.${o}`,n.push(this[s](i,r).then((e=>({type:o,result:e}))))}return Promise.all(n).then((e=>{const t={};for(const r of e)t[r.type]=r.result;return Promise.resolve(t)}))},get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const[t,r]=e.split("/");switch(t){case"application":switch(r){case"geo+json":case"json":return this.json;case"kml":case"gpx":return this.xml;case"x-protobuf;type=mapbox-vector":case"gtx":return this.arrayBuffer;default:return this.text}case"image":return"x-bil;bits=32"===r?this.textureFloat:this.texture;default:return this.texture}}}},97709:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let n=0;function i(e){const t=/\$\{u:([\w-_.|]+)\}/.exec(e);if(!t)return e;const r=t[1].split("|");return e.replace(t[0],r[n++%r.length])}const s={subDomains:i,xyz:function(e,t){return i(t.url.replace(/(\$\{z\}|%TILEMATRIX)/,t.tileMatrixCallback(e.zoom)).replace(/(\$\{y\}|%ROW)/,e.row).replace(/(\$\{x\}|%COL)/,e.col))},bbox:function(e,t){let r="EPSG:4326"==t.crs?9:2;void 0!==t.bboxDigits&&(r=t.bboxDigits);const n=e.west.toFixed(r),s=e.south.toFixed(r),o=e.east.toFixed(r),a=e.north.toFixed(r);let l=t.axisOrder||"wsen";return l=l.replace("w",`${n},`).replace("s",`${s},`).replace("e",`${o},`).replace("n",`${a},`).slice(0,-1),i(t.url.replace("%bbox",l))}}},93320:(e,t,r)=>{"use strict";r.d(t,{A:()=>h,d:()=>o});var n=r(39437),i=r(52404),s=r(18590);const o={PERSPECTIVE:0,ORTHOGRAPHIC:1},a={frustum:new n.Frustum,matrix:new n.Matrix4,box3:new n.Box3},l=new n.Box3(new n.Vector3(-1,-1,-1),new n.Vector3(1,1,1));function c(e,t,r){if(e.camera3D.isOrthographicCamera)e._preSSE=t;else{const i=n.MathUtils.degToRad(r);e._preSSE=t/(2*Math.tan(.5*i))}}const u=[new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3],h=class{#B=!0;#P=(()=>new n.Matrix4)();constructor(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(this.crs=e,i.isCamera)console.warn("options.camera parameter is deprecated. Use options.camera.cameraThree to place a custom camera as a parameter. See the documentation of Camera."),this.camera3D=i;else if(i.cameraThree)this.camera3D=i.cameraThree;else switch(i.type){case o.ORTHOGRAPHIC:this.camera3D=new n.OrthographicCamera;break;case o.PERSPECTIVE:default:this.camera3D=new n.PerspectiveCamera(30)}if(this.camera3D.aspect=this.camera3D.aspect??1,this.width=t,this.height=r,this.resize(t,r),this._preSSE=1/0,this.camera3D.isPerspectiveCamera){let e=this.camera3D.fov;Object.defineProperty(this.camera3D,"fov",{get:()=>e,set:t=>{e=t,c(this,this.height,e)}})}}resize(e,t){if(!e||e<=0||!t||t<=0)return void console.warn(`Trying to resize the Camera with invalid height (${t}) or width (${e}). Skipping resize.`);const r=e/t;if(this.camera3D.aspect!==r){if(this.camera3D.isOrthographicCamera){this.camera3D.zoom*=this.width/e;const t=this.camera3D.top*this.camera3D.aspect/r;this.camera3D.bottom=-t,this.camera3D.top=t}else this.camera3D.isPerspectiveCamera&&(this.camera3D.fov=2*n.MathUtils.radToDeg(Math.atan(t/this.height*Math.tan(n.MathUtils.degToRad(this.camera3D.fov)/2))));this.camera3D.aspect=r}this.width=e,this.height=t,c(this,this.height,this.camera3D.fov),this.camera3D.updateProjectionMatrix&&(this.camera3D.updateProjectionMatrix(),this.#B=!0)}update(){this.camera3D.updateMatrixWorld(),this.#B=!0}position(e){return new i.A(this.crs,this.camera3D.position).as(e||this.crs)}setPosition(e){this.camera3D.position.copy(e.as(this.crs))}isBox3Visible(e,t){return this.box3SizeOnScreen(e,t).intersectsBox(l)}isSphereVisible(e,t){return this.#B&&(this.#P.multiplyMatrices(this.camera3D.projectionMatrix,this.camera3D.matrixWorldInverse),this.#B=!1),t?(a.matrix.multiplyMatrices(this.#P,t),a.frustum.setFromProjectionMatrix(a.matrix)):a.frustum.setFromProjectionMatrix(this.#P),a.frustum.intersectsSphere(e)}box3SizeOnScreen(e,t){const r=function(e,t,r){let n=e.camera3D.matrixWorldInverse;r&&(n=a.matrix.multiplyMatrices(e.camera3D.matrixWorldInverse,r)),u[0].set(t.min.x,t.min.y,t.min.z).applyMatrix4(n),u[1].set(t.min.x,t.min.y,t.max.z).applyMatrix4(n),u[2].set(t.min.x,t.max.y,t.min.z).applyMatrix4(n),u[3].set(t.min.x,t.max.y,t.max.z).applyMatrix4(n),u[4].set(t.max.x,t.min.y,t.min.z).applyMatrix4(n),u[5].set(t.max.x,t.min.y,t.max.z).applyMatrix4(n),u[6].set(t.max.x,t.max.y,t.min.z).applyMatrix4(n),u[7].set(t.max.x,t.max.y,t.max.z).applyMatrix4(n);let i=!1;for(let t=0;t<8;t++)u[t].z<=-e.camera3D.near?i=!0:u[t].z=-e.camera3D.near;return i?u:void 0}(this,e,t);if(!r)return a.box3.makeEmpty();for(let e=0;e<8;e++)r[e].applyMatrix4(this.camera3D.projectionMatrix);return a.box3.setFromPoints(r)}adjustAltitudeToAvoidCollisionWithLayer(e,t,r){const n=e.camera.position().as("EPSG:4326");if(void 0!==t){const i=s.A.getElevationValueAt(t,n);void 0!==i&&n.altitude-(i+r)<0&&(n.altitude=i+r,e.camera3D.position.copy(n.as(e.referenceCrs)),e.notifyChange(this.camera3D))}}}},33746:(e,t,r)=>{"use strict";r.d(t,{A:()=>o,x:()=>s});var n=r(61276);function i(e,t){const r=n.p.getColorLayersIdOrderedBySequence(t),i=function(e){e.material?.setSequence&&e.material.setSequence(r)};for(const t of e.level0Nodes)t.traverse(i)}const s="layers-order-changed",o={moveLayerUp(e,t){const r=e.getLayers((e=>e.isColorLayer)),o=e.getLayerById(t);if(!o)throw new Error(`${t} isn't color layer`);{const t=n.p.getColorLayersIdOrderedBySequence(r);n.p.moveLayerUp(o,r),i(e.tileLayer,r),e.dispatchEvent({type:s,previous:{sequence:t},new:{sequence:n.p.getColorLayersIdOrderedBySequence(r)}}),e.notifyChange(e.tileLayer)}},moveLayerDown(e,t){const r=e.getLayers((e=>e.isColorLayer)),o=e.getLayerById(t);if(!o)throw new Error(`${t} isn't color layer`);{const t=n.p.getColorLayersIdOrderedBySequence(r);n.p.moveLayerDown(o,r),i(e.tileLayer,r),e.dispatchEvent({type:s,previous:{sequence:t},new:{sequence:n.p.getColorLayersIdOrderedBySequence(r)}}),e.notifyChange(e.tileLayer)}},moveLayerToIndex(e,t,r){const o=e.getLayers((e=>e.isColorLayer)),a=e.getLayerById(t);if(!a)throw new Error(`${t} isn't color layer`);{const t=n.p.getColorLayersIdOrderedBySequence(o);n.p.moveLayerToIndex(a,r,o),i(e.tileLayer,o),e.dispatchEvent({type:s,previous:{sequence:t},new:{sequence:n.p.getColorLayersIdOrderedBySequence(o)}}),e.notifyChange(e.tileLayer)}}}},68983:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n=r(39437);const i={setDefineMapping(e,t,r){Object.keys(r).forEach((n=>{e.defines[`${t}_${n}`]=r[n]}))},setDefineProperty(e,t,r,n){e.defines[r]=n,Object.defineProperty(e,t,{get:()=>e.defines[r],set:t=>{e.defines[r]!=t&&(e.defines[r]=t,e.needsUpdate=!0)}})},setUniformProperty(e,t,r){e.uniforms[t]=new n.Uniform(r),Object.defineProperty(e,t,{get:()=>e.uniforms[t].value,set:r=>{e.uniforms[t].value!=r&&(e.uniforms[t].value=r)}})}}},7296:(e,t,r)=>{"use strict";r.d(t,{A:()=>l,N:()=>o});var n=r(39437),i=r(4660);const s=new n.Frustum;class o{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;this.x=e,this.y=t,this.grid=[],this.visible=[],this.resize(),this.reset(),this.width=r,this.height=n}reset(){for(let e=0;e0&&this.grid[s][t].some((t=>{return r=t.boundaries,n=e.boundaries,!(r.left>n.right||r.rightn.bottom||r.bottome.isLabelLayer&&e.visible));0!=r.length&&(this.grid.reset(),s.setFromProjectionMatrix(t.projectionMatrix),r.forEach((e=>{e.submittedLabelNodes.forEach((e=>{e.labels.forEach((r=>{e.updatePosition(r),this.culling(r,t)})),e.domElements.labels.show(),e.needsUpdate=!1}))})),this.grid.visible.sort(((e,t)=>{const r=t.order-e.order;return 0==r?!e.visible&&t.visible?1:-1:r})),this.grid.visible.forEach((e=>{this.grid.insert(e)?(e.visible=!0,e.updateCSSPosition()):e.visible=!1})),r.forEach((e=>{e.toHide.children.forEach((e=>e.domElements?.labels.hide())),e.toHide.clear()})))}culling(e,t){e.getWorldPosition(a),!s.containsPoint(a.applyMatrix4(t.matrixWorldInverse))||e.horizonCullingPoint&&i.A.horizonCulling(e.horizonCullingPoint)||this.grid.visible.some((t=>{const r=e.content.textContent;return""!==r&&t.content.textContent.toLowerCase()==r.toLowerCase()}))?e.visible=!1:(a.applyMatrix4(t.projectionMatrix),e.updateProjectedPosition(a.x*this.halfWidth+this.halfWidth,-a.y*this.halfHeight+this.halfHeight),this.grid.visible.push(e))}removeLabelDOM(e){this.garbage.appendChild(e.content),this.garbage.innerHTML=""}}},99234:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>w,Ll:()=>g,RN:()=>d,gL:()=>m,zY:()=>v});var n=r(39437),i=r(21311),s=r(2015),o=r(12980),a=r(68983);const l=new n.Vector4(0,0,1,1),c=new n.Texture,u=255/256,h=new n.Vector4(u,.0038909912109375,u/65536,5.9371814131736755e-8);function d(e,t){return t?h.dot(e)*t:h.dot(e)}const p=15,f=1;function m(){const e=s.A.getMaxTextureUnitsCount();return Math.min(e-f,p)}const g={noEffect:0,removeLightColor:1,removeWhiteColor:2,customEffect:3},A={bias:0,noDataValue:-99999,zmin:0,zmax:0,scale:0,mode:0,textureOffset:0,opacity:0,crs:0,effect_parameter:0,effect_type:g.noEffect,transparent:!1};function y(e,t,r){const n=e.layers.value,i=e.textures.value,s=e.offsetScales.value,o=e.textureCount;let a=0;for(const e of t){e.textureOffset=a;for(let t=0,o=e.textures.length;tr&&console.warn(`LayeredMaterial: Not enough texture units (${r} < ${a}), excess textures have been discarded.`),o.value=a;for(let e=a;e1?arguments[1]:void 0;super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),x=x||[f,m()],this.defines.NUM_VS_TEXTURES=x[0],this.defines.NUM_FS_TEXTURES=x[1],this.defines.USE_FOG=1,this.defines.NUM_CRS=e,a.A.setDefineMapping(this,"ELEVATION",v),a.A.setDefineMapping(this,"MODE",o.A.MODES),a.A.setDefineProperty(this,"mode","MODE",o.A.MODES.FINAL),this.vertexShader="#include \n#include \n#include \n#include \n#if NUM_CRS > 1\nattribute float uv_1;\n#endif\n\nuniform bool lightingEnabled;\nvarying vec2 vHighPrecisionZW;\n\n#if MODE == MODE_FINAL\n#include \nvarying vec3 vUv;\nvarying vec3 vNormal;\n#endif\nvoid main() {\n #include \n #include \n #include \n #include \n #include \n vHighPrecisionZW = gl_Position.zw;\n#if MODE == MODE_FINAL\n #include \n #if NUM_CRS > 1\n vUv = vec3(uv, (uv_1 > 0.) ? uv_1 : uv.y); // set uv_1 = uv if uv_1 is undefined\n #else\n vUv = vec3(uv, 0.0);\n #endif\n vNormal = normalize ( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );\n#endif\n}\n",_[e]=_[e]||i.A.unrollLoops("#include \n#include \n#include \n#include \n#if MODE == MODE_FINAL\n#include \n#include \n#include \n#endif\n#include \n\nuniform vec3 diffuse;\nuniform float opacity;\nvarying vec3 vUv; // uv.x/uv_1.x, uv.y, uv_1.y\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n #include \n\n#if MODE == MODE_ID\n\n #include \n\n#elif MODE == MODE_DEPTH\n\n #include \n\n#else\n\n gl_FragColor = vec4(diffuse, opacity);\n\n uvs[0] = vec3(vUv.xy, 0.);\n\n#if NUM_CRS > 1\n uvs[1] = vec3(vUv.x, fract(vUv.z), floor(vUv.z));\n#endif\n\n vec4 color;\n #pragma unroll_loop\n for ( int i = 0; i < NUM_FS_TEXTURES; i ++ ) {\n color = getLayerColor( i , colorTextures[ i ], colorOffsetScales[ i ], colorLayers[ i ]);\n gl_FragColor.rgb = mix(gl_FragColor.rgb, color.rgb, color.a);\n }\n\n #if defined(DEBUG)\n if (showOutline) {\n #pragma unroll_loop\n for ( int i = 0; i < NUM_CRS; i ++) {\n color = getOutlineColor( outlineColors[ i ], uvs[ i ].xy);\n gl_FragColor.rgb = mix(gl_FragColor.rgb, color.rgb, color.a);\n }\n }\n #endif\n\n #include \n #include \n #include \n\n#endif\n}\n",this.defines),this.fragmentShader=_[e],a.A.setUniformProperty(this,"diffuse",new n.Color(.04,.23,.35)),a.A.setUniformProperty(this,"opacity",this.opacity),a.A.setUniformProperty(this,"lightingEnabled",!1),a.A.setUniformProperty(this,"lightPosition",new n.Vector3(-.5,0,1)),a.A.setUniformProperty(this,"fogDistance",1e9),a.A.setUniformProperty(this,"fogColor",new n.Color(.76,.85,1)),a.A.setUniformProperty(this,"overlayAlpha",0),a.A.setUniformProperty(this,"overlayColor",new n.Color(1,.3,0)),a.A.setUniformProperty(this,"objectId",0),a.A.setUniformProperty(this,"geoidHeight",0),a.A.setUniformProperty(this,"minBorderDistance",-.01),this.layers=[],this.elevationLayerIds=[],this.colorLayerIds=[],this.uniforms.elevationLayers=new n.Uniform(new Array(x[0]).fill(A)),this.uniforms.elevationTextures=new n.Uniform(new Array(x[0]).fill(c)),this.uniforms.elevationOffsetScales=new n.Uniform(new Array(x[0]).fill(l)),this.uniforms.elevationTextureCount=new n.Uniform(0),this.uniforms.colorLayers=new n.Uniform(new Array(x[1]).fill(A)),this.uniforms.colorTextures=new n.Uniform(new Array(x[1]).fill(c)),this.uniforms.colorOffsetScales=new n.Uniform(new Array(x[1]).fill(l)),this.uniforms.colorTextureCount=new n.Uniform(0),Object.defineProperty(this,"visible",{get(){return this.#L},set(e){this.#L!=e&&(this.#L=e,this.dispatchEvent({type:e?"shown":"hidden"}))}})}getUniformByType(e){return{layers:this.uniforms[`${e}Layers`],textures:this.uniforms[`${e}Textures`],offsetScales:this.uniforms[`${e}OffsetScales`],textureCount:this.uniforms[`${e}TextureCount`]}}updateLayersUniforms(){const e=this.layers.filter((e=>this.colorLayerIds.includes(e.id)&&e.visible&&e.opacity>0));if(e.sort(((e,t)=>this.colorLayerIds.indexOf(e.id)-this.colorLayerIds.indexOf(t.id))),y(this.getUniformByType("color"),e,this.defines.NUM_FS_TEXTURES),this.elevationLayerIds.some((e=>this.getLayer(e)))||this.uniforms.elevationTextureCount.value&&!this.elevationLayerIds.length){const e=this.getElevationLayer()?[this.getElevationLayer()]:[];y(this.getUniformByType("elevation"),e,this.defines.NUM_VS_TEXTURES)}this.layersNeedUpdate=!1}dispose(){this.dispatchEvent({type:"dispose"}),this.layers.forEach((e=>e.dispose(!0))),this.layers.length=0,this.layersNeedUpdate=!0}setSequence(e){this.colorLayerIds=e,this.layersNeedUpdate=!0}setSequenceElevation(e){this.elevationLayerIds[0]=e,this.layersNeedUpdate=!0}removeLayer(e){const t=this.layers.findIndex((t=>t.id===e));if(t>-1){this.layers[t].dispose(),this.layers.splice(t,1);const r=this.colorLayerIds.indexOf(e);r>-1?this.colorLayerIds.splice(r,1):this.elevationLayerIds=[]}}addLayer(e){e.layer.id in this.layers&&console.warn('The "{layer.id}" layer was already present in the material, overwritting.'),this.layers.push(e)}getLayer(e){return this.layers.find((t=>t.id===e))}getLayers(e){return this.layers.filter((t=>e.includes(t.id)))}getElevationLayer(){return this.layers.find((e=>e.id===this.elevationLayerIds[0]))}setElevationScale(e){this.elevationLayerIds.length&&(this.getElevationLayer().scale=e)}}const w=b},41466:(e,t,r)=>{"use strict";r.d(t,{A:()=>m});var n=r(39437),i=r(86406),s=r(66124),o=r(28611),a=r(52404);const l=new o.r({uvCount:1}),c=new n.Vector3,u=new n.Vector2,h=new n.Vector3,d=new a.A("EPSG:4326",0,0,0);let p;class f extends n.Object3D{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new n.Vector3(1/0,1/0,1/0),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Vector3(-1/0,-1/0,-1/0);super(),this.box3D=new n.Box3(e.clone(),t.clone()),this.natBox=this.box3D.clone(),this.z={min:0,max:0,scale:1}}clone(){return(new f).copy(this)}copy(e){return super.copy(e),this.box3D.copy(e.box3D),this.natBox.copy(e.natBox),this.z.min=e.z.min,this.z.max=e.z.max,this.z.scale=e.z.scale,this}updateZ(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.z.min=e.min??this.z.min,this.z.max=e.max??this.z.max,this.z.scale=e.scale>0?e.scale:this.z.scale,this.z.delta=Math.abs(this.z.max-this.z.min)*this.z.scale;const t=e.geoidHeight||0;this.box3D.min.z=this.natBox.min.z+this.z.min*this.z.scale+t,this.box3D.max.z=this.natBox.max.z+this.z.max*this.z.scale+t}isSphereAboveXYBox(e){const t=this.worldToLocal(e.center),r=Math.max(this.box3D.min.x,Math.min(t.x,this.box3D.max.x)),n=Math.max(this.box3D.min.y,Math.min(t.y,this.box3D.max.y));return Math.sqrt((r-t.x)*(r-t.x)+(n-t.y)*(n-t.y))1&&void 0!==arguments[1]?arguments[1]:e.min||0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.max||0;if("EPSG:4326"==e.crs){const{shareableExtent:n,quaternion:i,position:o}=l.computeShareableExtent(e),a=Math.max(Math.floor(n.planarDimensions(u).x/90+1),2),c=new s.p(l,{extent:n,level:0,segments:a,disableSkirt:!0});p.box3D.copy(c.boundingBox),p.natBox.copy(c.boundingBox),this.copy(p),this.updateZ({min:t,max:r}),this.position.copy(o),this.quaternion.copy(i),this.updateMatrixWorld(!0)}else{if(!i.isMetricUnit(e.crs))throw new Error("Unsupported extent crs");e.center(d).toVector3(this.position),e.planarDimensions(u),c.set(u.x,u.y,Math.abs(r-t)),this.box3D.setFromCenterAndSize(h,c),this.updateMatrixWorld(!0)}return this}}p=new f;const m=f},6425:(e,t,r)=>{"use strict";r.d(t,{MY:()=>u,qW:()=>o,cn:()=>a,qU:()=>l,Ay:()=>f});var n=r(39437),i=r(68983);const s={SPECTRAL:[[0,new n.Color(.3686,.3098,.6353)],[.1,new n.Color(.1961,.5333,.7412)],[.2,new n.Color(.4,.7608,.6471)],[.3,new n.Color(.6706,.8667,.6431)],[.4,new n.Color(.902,.9608,.5961)],[.5,new n.Color(1,1,.749)],[.6,new n.Color(.9961,.8784,.5451)],[.7,new n.Color(.9922,.6824,.3804)],[.8,new n.Color(.9569,.4275,.2627)],[.9,new n.Color(.8353,.2431,.3098)],[1,new n.Color(.6196,.0039,.2588)]],PLASMA:[[0,new n.Color(.241,.015,.61)],[.1,new n.Color(.387,.001,.654)],[.2,new n.Color(.524,.025,.653)],[.3,new n.Color(.651,.125,.596)],[.4,new n.Color(.752,.227,.513)],[.5,new n.Color(.837,.329,.431)],[.6,new n.Color(.907,.435,.353)],[.7,new n.Color(.963,.554,.272)],[.8,new n.Color(.992,.681,.195)],[.9,new n.Color(.987,.822,.144)],[1,new n.Color(.94,.975,.131)]],YELLOW_GREEN:[[0,new n.Color(.1647,.2824,.3451)],[.1,new n.Color(.1338,.3555,.4227)],[.2,new n.Color(.061,.4319,.4864)],[.3,new n.Color(0,.5099,.5319)],[.4,new n.Color(0,.5881,.5569)],[.5,new n.Color(.137,.665,.5614)],[.6,new n.Color(.2906,.7395,.5477)],[.7,new n.Color(.4453,.8099,.5201)],[.8,new n.Color(.6102,.8748,.485)],[.9,new n.Color(.7883,.9323,.4514)],[1,new n.Color(.9804,.9804,.4314)]],VIRIDIS:[[0,new n.Color(.267,.005,.329)],[.1,new n.Color(.283,.141,.458)],[.2,new n.Color(.254,.265,.53)],[.3,new n.Color(.207,.372,.553)],[.4,new n.Color(.164,.471,.558)],[.5,new n.Color(.128,.567,.551)],[.6,new n.Color(.135,.659,.518)],[.7,new n.Color(.267,.749,.441)],[.8,new n.Color(.478,.821,.318)],[.9,new n.Color(.741,.873,.15)],[1,new n.Color(.993,.906,.144)]],INFERNO:[[0,new n.Color(.077,.042,.206)],[.1,new n.Color(.225,.036,.388)],[.2,new n.Color(.373,.074,.432)],[.3,new n.Color(.522,.128,.42)],[.4,new n.Color(.665,.182,.37)],[.5,new n.Color(.797,.255,.287)],[.6,new n.Color(.902,.364,.184)],[.7,new n.Color(.969,.516,.063)],[.8,new n.Color(.988,.683,.072)],[.9,new n.Color(.961,.859,.298)],[1,new n.Color(.988,.998,.645)]],GRAYSCALE:[[0,new n.Color(0,0,0)],[1,new n.Color(1,1,1)]],TURBO:[[0,new n.Color(.18995,.07176,.23217)],[.07,new n.Color(.25107,.25237,.63374)],[.13,new n.Color(.27628,.42118,.89123)],[.2,new n.Color(.25862,.57958,.99876)],[.27,new n.Color(.15844,.73551,.92305)],[.33,new n.Color(.09267,.86554,.7623)],[.4,new n.Color(.19659,.94901,.59466)],[.47,new n.Color(.42778,.99419,.38575)],[.53,new n.Color(.64362,.98999,.23356)],[.6,new n.Color(.80473,.92452,.20459)],[.67,new n.Color(.93301,.81236,.22667)],[.73,new n.Color(.99314,.67408,.20348)],[.8,new n.Color(.9836,.49291,.12849)],[.87,new n.Color(.92105,.31489,.05475)],[.93,new n.Color(.81608,.18462,.01809)],[1,new n.Color(.66449,.08436,.00424)]],RAINBOW:[[0,new n.Color(.278,0,.714)],[1/6,new n.Color(0,0,1)],[2/6,new n.Color(0,1,1)],[.5,new n.Color(0,1,0)],[4/6,new n.Color(1,1,0)],[5/6,new n.Color(1,.64,0)],[1,new n.Color(1,0,0)]],CONTOUR:[[0,new n.Color(0,0,0)],[.03,new n.Color(0,0,0)],[.04,new n.Color(1,1,1)],[1,new n.Color(1,1,1)]]},o={COLOR:0,INTENSITY:1,CLASSIFICATION:2,ELEVATION:3,RETURN_NUMBER:4,RETURN_TYPE:5,RETURN_COUNT:6,POINT_SOURCE_ID:7,SCAN_ANGLE:8,NORMAL:9},a={CIRCLE:0,SQUARE:1},l={VALUE:0,ATTENUATED:1},c=new n.Color(1,1,1),u={DEFAULT:{0:{visible:!0,name:"never classified",color:new n.Color(.5,.5,.5),opacity:1},1:{visible:!0,name:"unclassified",color:new n.Color(.5,.5,.5),opacity:1},2:{visible:!0,name:"ground",color:new n.Color(.63,.32,.18),opacity:1},3:{visible:!0,name:"low vegetation",color:new n.Color(0,1,0),opacity:1},4:{visible:!0,name:"medium vegetation",color:new n.Color(0,.8,0),opacity:1},5:{visible:!0,name:"high vegetation",color:new n.Color(0,.6,0),opacity:1},6:{visible:!0,name:"building",color:new n.Color(1,.66,0),opacity:1},7:{visible:!0,name:"low point(noise)",color:new n.Color(1,0,1),opacity:1},8:{visible:!0,name:"key-point",color:new n.Color(1,0,0),opacity:1},9:{visible:!0,name:"water",color:new n.Color(0,0,1),opacity:1},10:{visible:!0,name:"rail",color:new n.Color(.8,.8,1),opacity:1},11:{visible:!0,name:"road Surface",color:new n.Color(.4,.4,.7),opacity:1},12:{visible:!0,name:"overlap",color:new n.Color(1,1,0),opacity:1},DEFAULT:{visible:!0,name:"default",color:new n.Color(.3,.6,.6),opacity:1}}},h={DEFAULT:{0:{visible:!0,name:"0",color:new n.Color("rgb(67, 99, 216)"),opacity:1},1:{visible:!0,name:"1",color:new n.Color("rgb(60, 180, 75);"),opacity:1},2:{visible:!0,name:"2",color:new n.Color("rgb(255, 255, 25)"),opacity:1},3:{visible:!0,name:"3",color:new n.Color("rgb(145, 30, 180)"),opacity:1},4:{visible:!0,name:"4",color:new n.Color("rgb(245, 130, 49)"),opacity:1},5:{visible:!0,name:"5",color:new n.Color("rgb(230, 25, 75)"),opacity:1},6:{visible:!0,name:"6",color:new n.Color("rgb(66, 212, 244)"),opacity:1},7:{visible:!0,name:"7",color:new n.Color("rgb(240, 50, 230)"),opacity:1},DEFAULT:{visible:!0,name:"default",color:c,opacity:1}}};function d(e,t,r){let n;const i=t.image.data,s=t.image.width;r||(r=Object.keys(e).length);for(let t=0;t0&&void 0!==arguments[0]?arguments[0]:{};const t={...e.gradient,...s};e.gradient=Object.values(t)[0];const{intensityRange:r=new n.Vector2(1,65536),elevationRange:c=new n.Vector2(0,1e3),angleRange:d=new n.Vector2(-90,90),classificationScheme:p=u.DEFAULT,discreteScheme:f=h.DEFAULT,size:m=1,mode:g=o.COLOR,shape:A=a.CIRCLE,sizeMode:y=l.ATTENUATED,minAttenuatedSize:v=3,maxAttenuatedSize:x=10,gradient:_,scale:b=.025/Math.tan(.5),...w}=e;super({...w,fog:!0,precision:"highp",vertexColors:!0}),this.uniforms=n.UniformsUtils.merge([n.UniformsLib.points,n.UniformsLib.fog]),this.vertexShader="#include \n#include \n#include \n#include \n#include \nvarying vec4 vColor; // color_pars_vertex\n\n#ifdef USE_POINTS_UV\n varying vec2 vUv;\n uniform mat3 uvTransform;\n#endif\n\n#define NB_CLASS 8.\n\nuniform float size;\nuniform float scale;\n\nuniform bool picking;\nuniform int mode;\n\nuniform vec2 elevationRange;\nuniform vec2 intensityRange;\nuniform vec2 angleRange;\n\nuniform sampler2D classificationTexture;\nuniform sampler2D discreteTexture;\nuniform sampler2D gradientTexture;\nuniform int sizeMode;\nuniform float minAttenuatedSize;\nuniform float maxAttenuatedSize;\n\nattribute vec4 unique_id;\nattribute float intensity;\nattribute float classification;\nattribute float pointSourceID;\n\nattribute float returnNumber;\nattribute float numberOfReturns;\nattribute float scanAngle;\n\nvoid main() {\n vColor = vec4(1.0);\n if (picking) {\n vColor = unique_id;\n } else {\n if (mode == PNTS_MODE_CLASSIFICATION) {\n vec2 uv = vec2(classification/255., 0.5);\n vColor = texture2D(classificationTexture, uv);\n } else if (mode == PNTS_MODE_NORMAL) {\n vColor.rgb = abs(normal);\n } else if (mode == PNTS_MODE_COLOR) {\n#if defined(USE_COLOR)\n vColor.rgb = color.rgb;\n#elif defined(USE_COLOR_ALPHA)\n vColor = color;\n#endif\n } else if (mode == PNTS_MODE_RETURN_NUMBER) {\n vec2 uv = vec2(returnNumber/255., 0.5);\n vColor = texture2D(discreteTexture, uv);\n } else if (mode == PNTS_MODE_RETURN_TYPE) {\n float returnType;\n if (returnNumber > numberOfReturns) {\n returnType = 4.;\n } else if (returnNumber == 1.) {\n if (numberOfReturns == 1.) {\n // single\n returnType = 0.;\n } else {\n // first\n returnType = 1.;\n }\n } else {\n if (returnNumber == numberOfReturns) {\n // last\n returnType = 3.;\n } else {\n // intermediate\n returnType = 2.;\n }\n }\n vec2 uv = vec2(returnType/255., 0.5);\n vColor = texture2D(discreteTexture, uv);\n } else if (mode == PNTS_MODE_RETURN_COUNT) {\n vec2 uv = vec2(numberOfReturns/255., 0.5);\n vColor = texture2D(discreteTexture, uv);\n } else if (mode == PNTS_MODE_POINT_SOURCE_ID) {\n vec2 uv = vec2(mod(pointSourceID, NB_CLASS)/255., 0.5);\n vColor = texture2D(discreteTexture, uv);\n } else if (mode == PNTS_MODE_SCAN_ANGLE) {\n float i = (scanAngle - angleRange.x) / (angleRange.y - angleRange.x);\n vec2 uv = vec2(i, (1. - i));\n vColor = texture2D(gradientTexture, uv);\n } else if (mode == PNTS_MODE_INTENSITY) {\n float i = (intensity - intensityRange.x) / (intensityRange.y - intensityRange.x);\n vec2 uv = vec2(i, (1. - i));\n vColor = texture2D(gradientTexture, uv);\n } else if (mode == PNTS_MODE_ELEVATION) {\n float z = (modelMatrix * vec4(position, 1.0)).z;\n float i = (z - elevationRange.x) / (elevationRange.y - elevationRange.x);\n vec2 uv = vec2(i, (1. - i));\n vColor = texture2D(gradientTexture, uv);\n }\n }\n\n#define USE_COLOR_ALPHA\n#include \n#include \n#include \n#include \n\n gl_PointSize = size;\n\n if (sizeMode == PNTS_SIZE_MODE_ATTENUATED) {\n bool isPerspective = isPerspectiveMatrix(projectionMatrix);\n\n if (isPerspective) {\n gl_PointSize *= scale / -mvPosition.z;\n gl_PointSize = clamp(gl_PointSize, minAttenuatedSize, maxAttenuatedSize);\n }\n }\n\n#include \n#include \n#include \n#include \n}\n",this.fragmentShader="#define USE_COLOR_ALPHA\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nuniform vec3 diffuse;\nuniform float opacity;\n\nuniform bool picking;\nuniform int shape;\n\nvoid main() {\n\n// Early discard (clipping planes and shape)\n#include \n if (shape == PNTS_SHAPE_CIRCLE) {\n //circular rendering in glsl\n if ((length(gl_PointCoord - 0.5) > 0.5)) {\n discard;\n }\n }\n\n#include \n\n vec4 diffuseColor = vec4(diffuse, opacity);\n#include \n#include \n\n#include \n#include \n\n vec3 outgoingLight = diffuseColor.rgb;\n#include // gl_FragColor\n#include \n#include \n#include \n\n}\n",this.userData.needTransparency={},this.gradients=t,this.gradientTexture=new n.CanvasTexture,i.A.setDefineMapping(this,"PNTS_MODE",o),i.A.setDefineMapping(this,"PNTS_SHAPE",a),i.A.setDefineMapping(this,"PNTS_SIZE_MODE",l),this.size=m,i.A.setUniformProperty(this,"mode",g),i.A.setUniformProperty(this,"shape",A),i.A.setUniformProperty(this,"picking",!1),i.A.setUniformProperty(this,"opacity",this.opacity),i.A.setUniformProperty(this,"intensityRange",r),i.A.setUniformProperty(this,"elevationRange",c),i.A.setUniformProperty(this,"angleRange",d),i.A.setUniformProperty(this,"sizeMode",y),i.A.setUniformProperty(this,"scale",b),i.A.setUniformProperty(this,"minAttenuatedSize",v),i.A.setUniformProperty(this,"maxAttenuatedSize",x);const E=new Uint8Array(1024),M=new n.DataTexture(E,256,1,n.RGBAFormat);M.needsUpdate=!0,M.magFilter=n.NearestFilter,i.A.setUniformProperty(this,"classificationTexture",M);const S=new Uint8Array(1024),C=new n.DataTexture(S,256,1,n.RGBAFormat);C.needsUpdate=!0,C.magFilter=n.NearestFilter,i.A.setUniformProperty(this,"discreteTexture",C),this.classificationScheme=p,this.discreteScheme=f,this.recomputeClassification(),this.recomputeDiscreteTexture(),this.gradient=_,i.A.setUniformProperty(this,"gradientTexture",this.gradientTexture)}copy(e){const t=void 0!==e.userData.needTransparency?e.userData.needTransparency:this.userData.needTransparency;return e.isShaderMaterial?super.copy(e):n.Material.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this.userData.needTransparency=t,this}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value.copy(e)}get map(){return this.uniforms.map.value}set map(e){this.uniforms.map.value=e,e&&(e.matrixAutoUpdate&&e.updateMatrix(),this.uniforms.uvTransform.value.copy(e.matrix))}get alphaMap(){return this.uniforms.alphaMap.value}set alphaMap(e){this.uniforms.alphaMap.value=e,e&&(e.matrixAutoUpdate&&e.updateMatrix(),this.uniforms.alphaMapTransform.value.copy(e.matrix))}get size(){return this.uniforms.size.value}set size(e){this.uniforms.size.value=e}get sizeAttenuation(){return this.sizeMode!==l.VALUE}set sizeAttenuation(e){this.sizeMode=e?l.ATTENUATED:l.VALUE}recomputeClassification(){const e=d(this.classificationScheme,this.classificationTexture,256);this.userData.needTransparency[o.CLASSIFICATION]=e,this.dispatchEvent({type:"material_property_changed",target:this.uniforms})}recomputeDiscreteTexture(){const e=d(this.discreteScheme,this.discreteTexture);this.userData.needTransparency[o.RETURN_NUMBER]=e,this.userData.needTransparency[o.RETURN_TYPE]=e,this.userData.needTransparency[o.RETURN_COUNT]=e,this.userData.needTransparency[o.POINT_SOURCE_ID]=e,this.dispatchEvent({type:"material_property_changed",target:this.uniforms})}enablePicking(e){this.picking=e,this.blending=e?n.NoBlending:n.NormalBlending}set gradient(e){this.gradientTexture=function(e){const t=64,r=document.createElement("canvas");r.width=t,r.height=t;const i=r.getContext("2d");i.rect(0,0,t,t);const s=i.createLinearGradient(0,0,t,t);for(let t=0;t{"use strict";r.d(t,{WS:()=>o,p7:()=>c,Is:()=>u});var n=r(39437),i=r(99234),s=r(18590);const o=-1,a=new n.Vector4;class l extends n.EventDispatcher{constructor(e,t){super(),this.layer=t,this.crs=t.parent.tileMatrixSets.indexOf(t.crs),-1==this.crs&&console.error("Unknown crs:",t.crs),this.textures=[],this.offsetScales=[],this.level=o,this.material=e,this._handlerCBEvent=()=>{this.material.layersNeedUpdate=!0},t.addEventListener("visible-property-changed",this._handlerCBEvent),t.addEventListener("opacity-property-changed",this._handlerCBEvent)}get id(){return this.layer.id}get opacity(){return this.layer.opacity}get visible(){return this.layer.visible}initFromParent(e,t){if(e&&e.level>this.level){let r=0;for(const n of t)for(const t of e.textures)if(n.isInside(t.extent)){this.setTexture(r++,t,n.offsetToParent(t.extent));break}}}dispose(){(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&(this.layer.removeEventListener("visible-property-changed",this._handlerCBEvent),this.layer.removeEventListener("opacity-property-changed",this._handlerCBEvent),this._listeners={});for(const e of this.textures)e.isTexture&&e.dispose();this.level=o,this.textures=[],this.offsetScales=[],this.material.layersNeedUpdate=!0}setTexture(e,t,r){this.level=t&&t.extent&&0==e?t.extent.zoom:this.level,this.textures[e]=t||null,this.offsetScales[e]=r,this.material.layersNeedUpdate=!0}setTextures(e,t){this.dispose(!1);for(let r=0,n=e.length;rnull!=e));return a.length?{min:Math.min(...a),max:Math.max(...a)}:{min:1/0,max:-1/0}}(e,t,r);const c=Math.floor(t.z*n);if(c>2){const e=Math.floor(t.z*i),s=Math.floor(t.x*n),u=Math.floor(t.y*i),h=Math.max(Math.floor(c/32),2);for(let t=u;tr.zmax&&(a=r.zmax),l>r.zmax&&(l=r.zmax)),l===-1/0||a===1/0?{min:null,max:null}:{min:a,max:l}}(this.textures[0],this.offsetScales[0],{noDataValue:this.layer.noDataValue,zmin:this.layer.zmin,zmax:this.layer.zmax});this.min==e&&this.max==t||(this.min=e,this.max=t)}}replaceNoDataValueFromTexture(e){const t=this.layer.noDataValue;if(null==t)return;const r=this.textures[0],n=r&&r.image&&r.image.data,i=e.image&&e.image.data;i&&!function(e,t){const r=e.length;return e[0]>t&&e[r-1]>t&&e[Math.sqrt(r)-1]>t&&e[r-Math.sqrt(r)]>t}(i,t)&&function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>0,r=arguments.length>2?arguments[2]:void 0;for(let n=0,i=e.length;nr[function(e,t,r){const n=Math.floor(e/r)/r,i=t.x+e%r/r*t.z,s=t.y+n*t.w;return Math.floor(s*r)*r+Math.floor(i*r)}(e,n,256)]}(e,r,n,a),t)}}},12980:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});const n={FINAL:0,DEPTH:1,ID:2},i={MODES:n,push:function(e,t){const r=e.mode??n.FINAL;if(r==t)return()=>{};const i=e=>t=>{const r=t.material;r&&(r.mode=e)};return e.traverse(i(t)),()=>{e.traverse(i(r))}}}},21311:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});const n=new RegExp("gl_Position.*(?![^]*gl_Position)"),i=new RegExp("[^\\w]*main[^\\w]*(void)?[^\\w]*{"),s={patchMaterialForLogDepthSupport(e){if(e.vertexShader.includes("USE_LOGDEPTHBUF")||e.vertexShader.includes("logdepthbuf_pars_vertex"))return;e.vertexShader=`#include \n#define EPSILON 1e-6\n${e.vertexShader}`;let t=n.exec(e.vertexShader),r=t[0].length+t.index;e.vertexShader=`${e.vertexShader.slice(0,r)}\n#include \n${e.vertexShader.slice(r)}`,e.fragmentShader=`#include \n${e.fragmentShader}`,t=i.exec(e.fragmentShader),r=t[0].length+t.index,e.fragmentShader=`${e.fragmentShader.slice(0,r)}\n#include \n${e.fragmentShader.slice(r)}`,e.defines={USE_LOGDEPTHBUF:1,USE_LOGDEPTHBUF_EXT:1}},unrollLoops:(e,t)=>e.replace(/#pragma unroll_loop\s+for\s*\(\s*int\s+i\s*=\s*([\w\d]+);\s*i\s+<\s+([\w\d]+);\s*i\s*\+\+\s*\)\s*\{\n([^}]*)\}/g,(function(e,r,n,i){let s="";r=r in t?t[r]:parseInt(r,10),n=n in t?t[n]:parseInt(n,10);for(let e=r;e{"use strict";r.d(t,{A:()=>J});var n=r(86406),i=r(86215),s=r(89191),o=r(68632),a=r(8123),l=r(62873),c=r(51429),u=r(18625),h=r(39437);const d=4294967296,p=1/d,f="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8");class m{constructor(e=new Uint8Array(16)){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(e,t,r=this.length){for(;this.pos>3,i=this.pos;this.type=7&r,e(n,t,this),this.pos===i&&this.skip(r)}return t}readMessage(e,t){return this.readFields(e,t,this.readVarint()+this.pos)}readFixed32(){const e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){const e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*d;return this.pos+=8,e}readSFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*d;return this.pos+=8,e}readFloat(){const e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){const e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){const t=this.buf;let r,n;return n=t[this.pos++],r=127&n,n<128?r:(n=t[this.pos++],r|=(127&n)<<7,n<128?r:(n=t[this.pos++],r|=(127&n)<<14,n<128?r:(n=t[this.pos++],r|=(127&n)<<21,n<128?r:(n=t[this.pos],r|=(15&n)<<28,function(e,t,r){const n=r.buf;let i,s;if(s=n[r.pos++],i=(112&s)>>4,s<128)return g(e,i,t);if(s=n[r.pos++],i|=(127&s)<<3,s<128)return g(e,i,t);if(s=n[r.pos++],i|=(127&s)<<10,s<128)return g(e,i,t);if(s=n[r.pos++],i|=(127&s)<<17,s<128)return g(e,i,t);if(s=n[r.pos++],i|=(127&s)<<24,s<128)return g(e,i,t);if(s=n[r.pos++],i|=(1&s)<<31,s<128)return g(e,i,t);throw new Error("Expected varint not more than 10 bytes")}(r,e,this)))))}readVarint64(){return this.readVarint(!0)}readSVarint(){const e=this.readVarint();return e%2==1?(e+1)/-2:e/2}readBoolean(){return Boolean(this.readVarint())}readString(){const e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&f?f.decode(this.buf.subarray(t,e)):function(e,t,r){let n="",i=t;for(;i239?4:t>223?3:t>191?2:1;if(i+c>r)break;1===c?t<128&&(l=t):2===c?(s=e[i+1],128==(192&s)&&(l=(31&t)<<6|63&s,l<=127&&(l=null))):3===c?(s=e[i+1],o=e[i+2],128==(192&s)&&128==(192&o)&&(l=(15&t)<<12|(63&s)<<6|63&o,(l<=2047||l>=55296&&l<=57343)&&(l=null))):4===c&&(s=e[i+1],o=e[i+2],a=e[i+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&(l=(15&t)<<18|(63&s)<<12|(63&o)<<6|63&a,(l<=65535||l>=1114112)&&(l=null))),null===l?(l=65533,c=1):l>65535&&(l-=65536,n+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),n+=String.fromCharCode(l),i+=c}return n}(this.buf,t,e)}readBytes(){const e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t}readPackedVarint(e=[],t){const r=this.readPackedEnd();for(;this.pos127;);else if(2===t)this.pos=this.readVarint()+this.pos;else if(5===t)this.pos+=4;else{if(1!==t)throw new Error(`Unimplemented type: ${t}`);this.pos+=8}}writeTag(e,t){this.writeVarint(e<<3|t)}realloc(e){let t=this.length||16;for(;t268435455||e<0?function(e,t){let r,n;if(e>=0?(r=e%4294967296|0,n=e/4294967296|0):(r=~(-e%4294967296),n=~(-e/4294967296),4294967295^r?r=r+1|0:(r=0,n=n+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,r){r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos]=127&e}(r,0,t),function(e,t){const r=(7&e)<<4;t.buf[t.pos++]|=r|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}(n,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))}writeSVarint(e){this.writeVarint(e<0?2*-e-1:2*e)}writeBoolean(e){this.writeVarint(+e)}writeString(e){e=String(e),this.realloc(4*e.length),this.pos++;const t=this.pos;this.pos=function(e,t,r){for(let n,i,s=0;s55295&&n<57344){if(!i){n>56319||s+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):i=n;continue}if(n<56320){e[r++]=239,e[r++]=191,e[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(e[r++]=239,e[r++]=191,e[r++]=189,i=null);n<128?e[r++]=n:(n<2048?e[r++]=n>>6|192:(n<65536?e[r++]=n>>12|224:(e[r++]=n>>18|240,e[r++]=n>>12&63|128),e[r++]=n>>6&63|128),e[r++]=63&n|128)}return r}(this.buf,e,this.pos);const r=this.pos-t;r>=128&&A(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r}writeFloat(e){this.realloc(4),this.dataView.setFloat32(this.pos,e,!0),this.pos+=4}writeDouble(e){this.realloc(8),this.dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeBytes(e){const t=e.length;this.writeVarint(t),this.realloc(t);for(let r=0;r=128&&A(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n}writeMessage(e,t,r){this.writeTag(e,2),this.writeRawMessage(t,r)}writePackedVarint(e,t){t.length&&this.writeMessage(e,y,t)}writePackedSVarint(e,t){t.length&&this.writeMessage(e,v,t)}writePackedBoolean(e,t){t.length&&this.writeMessage(e,b,t)}writePackedFloat(e,t){t.length&&this.writeMessage(e,x,t)}writePackedDouble(e,t){t.length&&this.writeMessage(e,_,t)}writePackedFixed32(e,t){t.length&&this.writeMessage(e,w,t)}writePackedSFixed32(e,t){t.length&&this.writeMessage(e,E,t)}writePackedFixed64(e,t){t.length&&this.writeMessage(e,M,t)}writePackedSFixed64(e,t){t.length&&this.writeMessage(e,S,t)}writeBytesField(e,t){this.writeTag(e,2),this.writeBytes(t)}writeFixed32Field(e,t){this.writeTag(e,5),this.writeFixed32(t)}writeSFixed32Field(e,t){this.writeTag(e,5),this.writeSFixed32(t)}writeFixed64Field(e,t){this.writeTag(e,1),this.writeFixed64(t)}writeSFixed64Field(e,t){this.writeTag(e,1),this.writeSFixed64(t)}writeVarintField(e,t){this.writeTag(e,0),this.writeVarint(t)}writeSVarintField(e,t){this.writeTag(e,0),this.writeSVarint(t)}writeStringField(e,t){this.writeTag(e,2),this.writeString(t)}writeFloatField(e,t){this.writeTag(e,5),this.writeFloat(t)}writeDoubleField(e,t){this.writeTag(e,1),this.writeDouble(t)}writeBooleanField(e,t){this.writeVarintField(e,+t)}}function g(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function A(e,t,r){const n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(n);for(let t=r.pos-1;t>=e;t--)r.buf[t+n]=r.buf[t]}function y(e,t){for(let r=0;r>3}if(s--,1===i||2===i)o+=e.readSVarint(),a+=e.readSVarint(),1===i&&(n&&r.push(n),n=[]),n&&n.push(new C(o,a));else{if(7!==i)throw new Error(`unknown command ${i}`);n&&n.push(n[0].clone())}}return n&&r.push(n),r}bbox(){const e=this._pbf;e.pos=this._geometry;const t=e.readVarint()+e.pos;let r=1,n=0,i=0,s=0,o=1/0,a=-1/0,l=1/0,c=-1/0;for(;e.pos>3}if(n--,1===r||2===r)i+=e.readSVarint(),s+=e.readSVarint(),ia&&(a=i),sc&&(c=s);else if(7!==r)throw new Error(`unknown command ${r}`)}return[o,l,a,c]}toGeoJSON(e,t,r){const n=this.extent*Math.pow(2,r),i=this.extent*e,s=this.extent*t,o=this.loadGeometry();function a(e){return[360*(e.x+i)/n-180,360/Math.PI*Math.atan(Math.exp((1-2*(e.y+s)/n)*Math.PI))-90]}function l(e){return e.map(a)}let c;if(1===this.type){const e=[];for(const t of o)e.push(t[0]);const t=l(e);c=1===e.length?{type:"Point",coordinates:t[0]}:{type:"MultiPoint",coordinates:t}}else if(2===this.type){const e=o.map(l);c=1===e.length?{type:"LineString",coordinates:e[0]}:{type:"MultiLineString",coordinates:e}}else{if(3!==this.type)throw new Error("unknown feature type");{const e=function(e){const t=e.length;if(t<=1)return[e];const r=[];let n,i;for(let s=0;s=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];const t=this._pbf.readVarint()+this._pbf.pos;return new T(this._pbf,t,this.extent,this._keys,this._values)}}function P(e,t,r){15===e?t.version=r.readVarint():1===e?t.name=r.readString():5===e?t.extent=r.readVarint():2===e?t._features.push(r.pos):3===e?t._keys.push(r.readString()):4===e&&t._values.push(function(e){let t=null;const r=e.readVarint()+e.pos;for(;e.pos>3;t=1===r?e.readString():2===r?e.readFloat():3===r?e.readDouble():4===r?e.readVarint64():5===r?e.readVarint():6===r?e.readSVarint():7===r?e.readBoolean():null}return t}(r))}class L{constructor(e,t){this.layers=e.readFields(D,{},t)}}function D(e,t,r){if(3===e){const e=new B(r,r.readVarint()+r.pos);e.length&&(t[e.name]=e)}}var O=r(48150),N=r(36845),U=r(47155),F=r(52404);const k=O.af.get("EPSG:3857").planarDimensions(),z=new h.Vector3(k.x,k.y,1),G=new h.Vector2,Q=new h.Vector2;function V(e,t,r,n){const i=n*2**r.z,s=n*r.x,o=n*r.y;return new F.A("EPSG:4326",360*(e+s)/i-180,360/Math.PI*Math.atan(Math.exp((180-360*(t+o)/i)*Math.PI/180))-90)}function H(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=t.bindNewGeometry();const i=t.type===N.Xs.POLYGON;r=r&&i,n.properties=e.properties;const s=e._pbf;s.pos=e._geometry;const o=s.readVarint()+s.pos;let a=1,l=0,c=0,u=0,h=0,d=0;for(;s.pos>3}if(l--,1===a||2===a){c+=s.readSVarint(),u+=s.readSVarint(),1===a&&(h&&(r&&d>0&&n.indices.length>0&&(t.updateExtent(n),n=t.bindNewGeometry(),n.properties=e.properties),n.closeSubGeometry(h,t),n.getLastSubGeometry().ccw=d<0),h=0,d=0),h++;const o=V(c,u,e.tileNumbers,e.extent);n.pushCoordinatesValues(t,{x:c,y:u},o),1==h?(Q.set(c,u),Q.coordProj=o,G.set(c,u)):i&&h>1&&(d+=(G.x-c)*(G.y+u),G.set(c,u))}else{if(7!==a)throw new Error(`unknown command ${a}`);h&&(h++,n.pushCoordinatesValues(t,{x:Q.x,y:Q.y},Q.coordProj),i&&(d+=(G.x-Q.x)*(G.y+Q.y)))}}h&&(r&&d>0&&n.indices.length>0&&(t.updateExtent(n),n=t.bindNewGeometry(),n.properties=e.properties),n.closeSubGeometry(h,t),n.getLastSubGeometry().ccw=d<0),t.updateExtent(n)}const j={parse:(e,t)=>(t=(0,U.zv)(t),Promise.resolve(function(e,t){t.out=t.out||{};const r=new L(new m(e)),n=Object.keys(r.layers);if(n.length<1)return;const i=t.extent.col,s=t.extent.zoom,o=t.in.isInverted?t.extent.row:(1<{if(!t.in.layers[e])return;const n=r.layers[e];for(let r=n.length-1;r>=0;r--){const o=n.feature(r);o.tileNumbers={x:i,y:t.extent.row,z:s};const l=t.in.layers[e].filter((e=>e.filterExpression.filter({zoom:s},o)&&s>=e.zoom.min&&st.id===e.id))||(c=a.newFeatureByReference(c),c.id=e.id,c.order=e.order,c.style=t.in.styles[c.id]):(c=a.requestFeatureById(e.id,o.type-1),c.id=e.id,c.order=e.order,c.style=t.in.styles[c.id],H(o,c))}})),a.removeEmptyFeature(),a.features.sort(((e,t)=>e.order-t.order)),a.updateExtent(),a.extent=t.extent,a.isInverted=t.in.isInverted,Promise.resolve(a)}(e,t)))};var q=r(7794),W=r(99487);const Y=new Map([["application/geo+json",s.A.parse],["application/json",s.A.parse],["application/kml",o.A.parse],["application/gpx",l.A.parse],["application/x-protobuf;type=mapbox-vector",j.parse],["application/gtx",c.Ay.parse],["application/isg",u.A.parse],["application/gdf",a.A.parse]]),X={getByArray:()=>{},setByArray:e=>e,clear:()=>{}};class K{constructor(e){e.projection&&(console.warn("Source projection parameter is deprecated, use crs instead."),e.crs=e.crs||e.projection),e.crs&&n.isValid(e.crs),this.crs=e.crs}}let $=0;const J=class extends K{constructor(e){if(super(e),this.isSource=!0,!e.url)throw new Error("New Source: url is required");this.uid=$++,this.url=e.url,this.format=e.format,this.fetcher=e.fetcher||q.A.get(e.format),this.parser=e.parser||Y.get(e.format)||((e,t)=>(e.extent=t.extent,e)),this.isVectorSource=null!=(e.parser||Y.get(e.format)),this.networkOptions=e.networkOptions||{crossOrigin:"anonymous"},this.attribution=e.attribution,this.whenReady=Promise.resolve(),this._featuresCaches={},e.extent&&!e.extent.isExtent?this.extent=new i.A(this.crs,e.extent):this.extent=e.extent}handlingError(e){throw new Error(e)}urlFromExtent(){throw new Error("In extended Source, you have to implement the method urlFromExtent!")}requestToKey(e){return[e.zoom,e.row,e.col]}loadData(e,t){const r=this._featuresCaches[t.crs],n=this.requestToKey(e);let i=r.getByArray(n);return i||(i=r.setByArray(this.fetcher(this.urlFromExtent(e),this.networkOptions).then((r=>this.parser(r,{out:t,in:this,extent:e}))).catch((e=>this.handlingError(e))),n),this.onParsedFile&&i.then((e=>(this.onParsedFile(e),console.warn("Source.onParsedFile was deprecated"),e)))),i}onLayerAdded(e){this._featuresCaches[e.out.crs]||(this._featuresCaches[e.out.crs]=this.isVectorSource?new W.A:X)}onLayerRemoved(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=this._featuresCaches[e.unusedCrs];t&&(t.clear(),delete this._featuresCaches[e.unusedCrs])}extentInsideLimit(){throw new Error("In extented Source, you have to implement the method extentInsideLimit!")}}},10733:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>_});var n=r(39437),i=r(50040),s=r(18590),o=r(87196),a=r(52404),l=r(96027),c=r(41466),u=r(84354);n.Object3D.DEFAULT_UP.set(0,0,1);const h=new n.Vector3,d=new a.A("EPSG:4326",0,0,0),p=new l.A,f=[],m=new c.A,g=new n.Vector3;function A(e){return e-360*Math.floor((e+180)/360)}function y(e){return e.getLayers((e=>e.isTiledGeometryLayer))[0]}class v extends n.Object3D{constructor(){super(),this.seaLevel=new n.Object3D,this.target=new n.Object3D,this.target.rotation.order="ZXY",this.camera=new n.Camera,this.add(this.seaLevel),this.seaLevel.add(this.target),this.target.add(this.camera),this.coord=new a.A("EPSG:4978",0,0),this.targetWorldPosition=new n.Vector3,this.removeAll=()=>{},this._onChangeCallback=null}applyTransformToCamera(e,t){this.proxy?(t.quaternion._onChange(this._onChangeCallback),this.camera.matrixWorld.decompose(this.proxy.position,t.quaternion,t.scale),t.quaternion._onChange((()=>this.removeProxy(e,t)))):this.camera.matrixWorld.decompose(t.position,t.quaternion,t.scale),e.dispatchEvent({type:u.G.CAMERA_MOVED,coord:this.coord,range:this.range,heading:this.heading,tilt:this.tilt})}setProxy(e,t){!this.proxy&&e&&t&&(this.proxy={position:new n.Vector3},Object.keys(t.position).forEach((r=>function(e,t,r,n){r.proxy.position[n]=t.position[n],Object.defineProperty(t.position,n,{get:()=>r.proxy.position[n],set:i=>{r.removeProxy(e,t),t.position[n]=i}})}(e,t,this,r))),this._onChangeCallback=t.quaternion._onChangeCallback,t.quaternion._onChange((()=>this.removeProxy(e,t))))}removeProxy(e,t){this.stop(e),this.proxy&&e&&t&&(Object.keys(t.position).forEach((e=>Object.defineProperty(t.position,e,{value:this.proxy.position[e],writable:!0}))),t.quaternion._onChange(this._onChangeCallback),this.proxy=null)}setTargetFromCoordinate(e,t){t.as(y(e).extent.crs,this.coord);const r=Math.max(0,s.A.getElevationValueAt(y(e),this.coord,s.A.PRECISE_READ_Z)||this.coord.z);this.coord.z=r,this.coord.as(e.referenceCrs).toVector3(h),"EPSG:4978"==e.referenceCrs?(this.lookAt(h),this.seaLevel.position.set(0,0,h.length()-r)):(this.position.set(h.x,h.y,0),this.seaLevel.position.set(0,0,0)),this.target.position.set(0,0,r)}setFromPositions(e,t){this.setTargetFromCoordinate(e,new a.A(e.referenceCrs,h)),this.target.rotation.set(0,0,0),this.updateMatrixWorld(!0),this.camera.position.copy(t),this.target.worldToLocal(this.camera.position);const r=this.camera.position.length();this.target.rotation.x=Math.asin(this.camera.position.z/r);const i=n.MathUtils.clamp(this.camera.position.y/(Math.cos(this.target.rotation.x)*r),-1,1);this.target.rotation.z=Math.sign(-this.camera.position.x||1)*Math.acos(i),this.camera.position.set(0,r,0)}applyParams(e,t){t.coord&&this.setTargetFromCoordinate(e,t.coord),null!=t.tilt&&(this.target.rotation.x=n.MathUtils.degToRad(t.tilt)),null!=t.heading&&(this.target.rotation.z=n.MathUtils.degToRad(-A(t.heading+180))),t.range&&this.camera.position.set(0,t.range,0),this.camera.rotation.set(.5*-Math.PI,0,Math.PI),this.updateMatrixWorld(!0),this.targetWorldPosition.setFromMatrixPosition(this.seaLevel.matrixWorld)}getParams(){return{coord:this.coord.clone(),tilt:this.tilt,heading:this.heading,range:this.range,targetWorldPosition:this.targetWorldPosition}}setfromCamera(e,t,r){t.updateMatrixWorld(!0),null==r&&(r=e.getPickingPositionFromDepth()||function(e,t){const r=new n.Vector3(0,0,.5);if(r.unproject(t),r.sub(t.position).normalize(),"EPSG:4978"==e.referenceCrs)return p.intersection({direction:r,origin:t.position});{const e=t.position.z/r.z;return r.multiplyScalar(e).add(t.position)}}(e,t));const i=r&&!isNaN(r.x)?t.position.distanceTo(r):100;t.localToWorld(h.set(0,0,-i)),this.setFromPositions(e,t.position)}copyObject3D(e){return this.copy(e,!1),this.seaLevel.copy(e.seaLevel,!1),this.target.copy(e.target,!1),this.camera.copy(e.camera),this}animateCameraToLookAtTarget(e,t,r){r.easing=r.easing||i.Ay.Easing.Quartic.InOut,this.setfromCamera(e,t);const s=new i.Ay.Group;this.start=(this.start||new v).copyObject3D(this),this.end=(this.end||new v).copyObject3D(this);const a=r.time||2500,l={t:0},c=[],u=(()=>{let e,t;return{promise:new Promise(((r,n)=>{e=r,t=n})),resolve:e,reject:t}})();this.addPlaceTargetOnGround(e,t,r.coord,l),this.end.applyParams(e,r);const h=this.end.target.rotation.z-this.start.target.rotation.z;return Math.abs(h)>Math.PI&&(this.end.target.rotation.z=this.start.target.rotation.z+h-2*Math.sign(h)*Math.PI),c.push(new i.Ay.Tween(l).to({t:1},a).easing(r.easing).onUpdate((t=>{"EPSG:4978"==e.referenceCrs&&this.quaternion.slerpQuaternions(this.start.quaternion,this.end.quaternion,t.t),this.camera.quaternion.slerpQuaternions(this.start.camera.quaternion,this.end.camera.quaternion,t.t),this.target.rotation.set(0,0,0),this.target.rotateZ(n.MathUtils.lerp(this.start.target.rotation.z,this.end.target.rotation.z,t.t)),this.target.rotateX(n.MathUtils.lerp(this.start.target.rotation.x,this.end.target.rotation.x,t.t))}))),"EPSG:4978"!=e.referenceCrs&&c.push(new i.Ay.Tween(this.position).to(this.end.position,a).easing(r.easing)),c.push(new i.Ay.Tween(this.seaLevel.position).to(this.end.seaLevel.position,a).easing(r.easing)),c.push(new i.Ay.Tween(this.camera.position).to(this.end.camera.position,a).easing(r.easing)),s.add(...c),this.animationFrameRequester=()=>{s.update(),this.updateMatrixWorld(!0),this.applyTransformToCamera(e,t),this.targetWorldPosition.setFromMatrixPosition(this.seaLevel.matrixWorld),r.callback&&r.callback(this),d.crs=e.referenceCrs,d.setFromVector3(this.targetWorldPosition).as(y(e).extent.crs,this.coord),e.notifyChange(t)},this.removeAll=function(t){this.removeAll=()=>{},s.removeAll(),this.animationFrameRequester&&e.removeFrameRequester(o.n7.BEFORE_RENDER,this.animationFrameRequester),u.resolve(void 0!==t),this.animationFrameRequester=null},c[c.length-1].onComplete(this.removeAll),c.forEach((e=>e.start())),e.addFrameRequester(o.n7.BEFORE_RENDER,this.animationFrameRequester),e.notifyChange(t),u}stop(e){this.removePlaceTargetOnGround(e),this.removeAll()}addPlaceTargetOnGround(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{t:1};if(this.removePlaceTargetOnGround(e),e&&t){const i=this.target.position.z;this.placeTargetOnGround=()=>{const o=Math.max(0,s.A.getElevationValueAt(y(e),r||this.coord,s.A.PRECISE_READ_Z)||0);this.target.position.z=i*(1-n.t)+o*n.t,this.target.updateMatrixWorld(!0),this.applyTransformToCamera(e,t)},this.placeTargetOnGround(),e.addFrameRequester(o.n7.BEFORE_RENDER,this.placeTargetOnGround)}}removePlaceTargetOnGround(e){e&&this.placeTargetOnGround&&(e.removeFrameRequester(o.n7.BEFORE_RENDER,this.placeTargetOnGround),this.placeTargetOnGround=null)}get tilt(){return n.MathUtils.radToDeg(this.target.rotation.x)}get heading(){return-A(n.MathUtils.radToDeg(this.target.rotation.z)+180)}get range(){return this.camera.position.y}}function x(e){return f[e.uuid]=f[e.uuid]||new v,f[e.uuid]}const _={defaultStopPlaceOnGroundAtEnd:!1,Easing:i.Ay.Easing,stop(e,t){x(t).stop(e)},getTransformCameraLookingAtTarget(e,t,r){const n=x(t);return n.setfromCamera(e,t,r),n.getParams()},transformCameraToLookAtTarget(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r.isExtent&&(r=this.getCameraTransformOptionsFromExtent(e,t,r)),r.proxy=void 0===r.proxy||r.proxy;const n=x(t);return n.stop(e),n.setfromCamera(e,t),r.proxy&&n.setProxy(e,t),n.applyParams(e,r),n.addPlaceTargetOnGround(e,t,r.coord),n.applyTransformToCamera(e,t),e.notifyChange(t),Promise.resolve(n.getParams())},getCameraTransformOptionsFromExtent(e,t,r){const i={coord:new a.A(r.crs,0,0,0),heading:0,tilt:e.isPlanarView?90:89.9};let s;if(e.isGlobeView?(r=r.as("EPSG:4326"),m.setFromExtent(r),m.box3D.getSize(g),s={x:g.y,y:g.x}):s=(r=r.as(e.referenceCrs)).planarDimensions(),r.center(i.coord),t.isOrthographicCamera)s.x/s.y>t.aspect?t.zoom=(t.right-t.left)/s.x:t.zoom=(t.top-t.bottom)/s.y,t.updateProjectionMatrix(),i.range=1e3;else if(t.isPerspectiveCamera){const r=n.MathUtils.degToRad(t.fov);if(s.x/s.y>t.aspect){const t=.5*e.domElement.clientHeight/Math.tan(.5*r),n=2*Math.atan(.5*e.domElement.clientWidth/t);i.range=s.x/(2*Math.tan(.5*n))}else i.range=s.y/(2*Math.tan(.5*r))}return i},animateCameraToLookAtTarget(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r.proxy=void 0===r.proxy||r.proxy;const n=x(t);return n.stop(e),r.proxy&&n.setProxy(e,t),n.animateCameraToLookAtTarget(e,t,r).promise.then((t=>{const i=void 0===r.stopPlaceOnGroundAtEnd?this.defaultStopPlaceOnGroundAtEnd:r.stopPlaceOnGroundAtEnd,s=n.getParams();return i&&n.stop(e),s.finished=t,s}))},sequenceAnimationsToLookAtTarget(e,t){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:[{}]).map((r=>()=>this.animateCameraToLookAtTarget(e,t,r))).reduce(((e,t)=>e.then((e=>!e.length||e[e.length-1].finished?t().then(Array.prototype.concat.bind(e)):Promise.resolve([{finished:!1}])))),Promise.resolve([]))},getDiffParams(e,t){if(!e||!t)return;let r;return Math.abs(e.range-t.range)/e.range>.001&&(r=r||{},r.range={previous:e.range,new:t.range}),Math.abs(e.tilt-t.tilt)>.1&&(r=r||{},r.tilt={previous:e.tilt,new:t.tilt}),Math.abs(e.heading-t.heading)>.1&&(r=r||{},r.heading={previous:e.heading,new:t.heading}),(Math.abs(e.coord.x-t.coord.x)>1e-6||Math.abs(e.coord.y-t.coord.y)>1e-6)&&(r=r||{},r.coord={previous:e.coord,new:t.coord}),r}}},18590:(e,t,r)=>{"use strict";r.d(t,{A:()=>a,N:()=>p});var n=r(39437),i=r(52404);const s={v:new n.Vector3,coord1:new i.A("EPSG:4978"),coord2:new i.A("EPSG:4978"),offset:new n.Vector2};function o(e,t,r,n,o,l){let c=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{},u=arguments.length>8?arguments[8]:void 0;const h=(arguments.length>7?arguments[7]:void 0)||new i.A(n);c.worldFromLocal?h.setFromVector3(s.v.copy(o).applyMatrix4(c.worldFromLocal)):h.setFromVector3(o);const d=a.getTerrainObjectAt(e,h,t,r,u);if(d)return d.coord.z+=l,d.coord.as(n,s.coord2).toVector3(o),c.localFromWorld&&o.applyMatrix4(c.localFromWorld),{id:d.texture.id,version:d.texture.version,tile:d.tile}}const a={getElevationValueAt(e,t){const r=A(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,t,(arguments.length>3?arguments[3]:void 0)||e.level0Nodes);if(r)return r.coord.z},getTerrainObjectAt(e,t){let r=arguments.length>4?arguments[4]:void 0;return A(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,t,(arguments.length>3?arguments[3]:void 0)||e.level0Nodes,r)},FAST_READ_Z:0,PRECISE_READ_Z:1,placeObjectOnGround:function(e,t,r){let s,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},c=arguments.length>4?arguments[4]:void 0;if(console.warn("placeObjectOnGround has been deprecated because it needs review and test"),s=c?c.concat(e.level0Nodes):e.level0Nodes,l.modifyGeometry){const c={worldFromLocal:r.matrixWorld,localFromWorld:(new n.Matrix4).copy(r.matrixWorld).invert()},u=r.geometry;if(u.vertices){l.cache&&(l.cache.length=u.vertices.length);let r=!0;const n=new i.A(t);for(let i=0;i=0?t:void 0}}let c;function u(e,t){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;s2&&void 0!==arguments[2]?arguments[2]:new n.Vector2;if(e.crs!=t.crs)throw new Error(`Unsupported mix: ${e.crs} and ${t.crs}`);t.planarDimensions(g);const i=(e.x-t.west)/g.x,s=(t.north-e.y)/g.y;r.set(i,s)}(o,a.extent,m.offset),o.z=1==t?function(e,t,r,i,s){const o=i.x/s.x/16;let a=Math.floor(r.x/o)*o,l=Math.floor(r.y/o)*o;1==a&&(a-=o),1==l&&(l-=o);const c=a,u=a+o,h=l,d=l+o,m=(r.x-a)/o,g=(r.y-l)/o,A=new n.Triangle(new n.Vector3(c,d),new n.Vector3(u,h),1==g||m/(1-g)>=1?new n.Vector3(u,d):new n.Vector3(c,h));A.getBarycoord(new n.Vector3(r.x,r.y),f);const y=e.attachedLayers.filter((e=>e.isElevationLayer))[0],v=p(y,t,A.a.x,A.a.y),x=p(y,t,A.b.x,A.b.y),_=p(y,t,A.c.x,A.c.y);return v*f.x+x*f.y+_*f.z}(e,A,m.offset,c.extent.planarDimensions(),a.extent.planarDimensions()):function(e,t,r){return function(e,t,r,n){const i=h(t,r,n);return u(e,t,i.wu<=0?i.u1:i.u2,i.wv<=0?i.v1:i.v2)}(e.attachedLayers.filter((e=>e.isElevationLayer))[0],t,r.x,r.y)}(e,A,m.offset),null!=o.z?{coord:o,texture:A,tile:c}:void 0}},19073:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var n=r(36845);function i(e,t,r,n,i,s){const o=e.x,a=e.y;for(let e=n+s,l=n;e=-r&&p<=d+r&&Math.abs(h*o-u*a+s*i-c*n)/d<=r)return!0}return!1}function s(e,t,r,s,o,a,l){if(t==n.Xs.LINE&&i(e,r,s,o,a,l))return!0;if(t==n.Xs.POLYGON&&function(e,t,r,n,s,o){const a=e.x,l=e.y;let c=!1;for(let u=n,h=n+s-o;ul!=d>l&&a<(o-n)*(l-s)/(d-s)+n&&(c=!c)}return c}(e,r,s,o,a,l))return!0;if(t==n.Xs.POINT){const t=function(e,t,r,n,i,s){const o=e.x,a=e.y;let l,c=r*r;for(let e=n;e2&&void 0!==arguments[2]?arguments[2]:.1;const n=[];if(e.as(t.crs,a),a.applyMatrix4(t.matrixWorldInverse),t.extent.isPointInside(a,r))if(t.isFeatureCollection){r*=Math.sqrt(t.scale.x**2+t.scale.y**2);for(const e of t.features)e.extent&&!e.extent.isPointInside(a,r)||o(a,e,r,n)}else t.geometries&&o(a,t,r,n);return n}}},20620:(e,t,r)=>{"use strict";function n(e){const t=function(e){const t=[];return e.alphaMap&&t.push(e.map),e.aoMap&&t.push(e.map),e.bumpMap&&t.push(e.bumpMap),e.displacementMap&&t.push(e.bumpMap),e.emissiveMap&&t.push(e.emissiveMap),e.envMap&&t.push(e.envMap),e.lightMap&&t.push(e.envMap),e.map&&t.push(e.map),e.metalnessMap&&t.push(e.map),e.normalMap&&t.push(e.map),e.roughnessMap&&t.push(e.map),e.specularMap&&t.push(e.specularMap),t}(e);if(Array.isArray(e))for(const t of e)t.dispose();else e.dispose();for(let e=0;e-1*(e.start-t.start)));const t=e.geometry.groups.length-1;let r=e.geometry.groups[t].materialIndex;const n=[r];for(let i=t-1;i>=0;i--){const t=e.geometry.groups[i];t.materialIndex===r?(e.geometry.groups[i+1].count+=t.count,e.geometry.groups.splice(i,1)):(r=t.materialIndex,n.push(r))}for(let t=e.material.length-1;t>=0;t--)n.includes(t)||(e.geometry.groups.forEach((e=>{e.materialIndex>t&&(e.materialIndex-=1)})),e.material.splice(t,1))}r.d(t,{A:()=>n,W:()=>i})},39437:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ACESFilmicToneMapping:()=>ie,AddEquation:()=>w,AddOperation:()=>Z,AdditiveAnimationBlendMode:()=>Qt,AdditiveBlending:()=>v,AgXToneMapping:()=>oe,AlphaFormat:()=>Ge,AlwaysCompare:()=>Rr,AlwaysDepth:()=>H,AlwaysStencilFunc:()=>br,AmbientLight:()=>vp,AnimationAction:()=>cf,AnimationClip:()=>Vd,AnimationLoader:()=>Jd,AnimationMixer:()=>hf,AnimationObjectGroup:()=>lf,AnimationUtils:()=>Rd,ArcCurve:()=>Xu,ArrayCamera:()=>Xl,ArrowHelper:()=>im,AttachedBindMode:()=>le,Audio:()=>qp,AudioAnalyser:()=>Jp,AudioContext:()=>Lp,AudioListener:()=>jp,AudioLoader:()=>Dp,AxesHelper:()=>sm,BackSide:()=>m,BasicDepthPacking:()=>qt,BasicShadowMap:()=>u,BatchedMesh:()=>vu,Bone:()=>Gc,BooleanKeyframeTrack:()=>Nd,Box2:()=>Mf,Box3:()=>Fn,Box3Helper:()=>Zf,BoxGeometry:()=>Xs,BoxHelper:()=>Jf,BufferAttribute:()=>ds,BufferGeometry:()=>Is,BufferGeometryLoader:()=>Sp,ByteType:()=>Re,Cache:()=>jd,Camera:()=>to,CameraHelper:()=>Xf,CanvasTexture:()=>qu,CapsuleGeometry:()=>gh,CatmullRomCurve3:()=>th,CineonToneMapping:()=>ne,CircleGeometry:()=>Ah,ClampToEdgeWrapping:()=>Ae,Clock:()=>kp,Color:()=>es,ColorKeyframeTrack:()=>Ud,ColorManagement:()=>An,CompressedArrayTexture:()=>Hu,CompressedCubeTexture:()=>ju,CompressedTexture:()=>Vu,CompressedTextureLoader:()=>Zd,ConeGeometry:()=>vh,ConstantAlphaFactor:()=>G,ConstantColorFactor:()=>k,Controls:()=>am,CubeCamera:()=>ao,CubeReflectionMapping:()=>he,CubeRefractionMapping:()=>de,CubeTexture:()=>lo,CubeTextureLoader:()=>tp,CubeUVReflectionMapping:()=>me,CubicBezierCurve:()=>sh,CubicBezierCurve3:()=>oh,CubicInterpolant:()=>Pd,CullFaceBack:()=>a,CullFaceFront:()=>l,CullFaceFrontBack:()=>c,CullFaceNone:()=>o,Curve:()=>Wu,CurvePath:()=>ph,CustomBlending:()=>b,CustomToneMapping:()=>se,CylinderGeometry:()=>yh,Cylindrical:()=>bf,Data3DTexture:()=>Pn,DataArrayTexture:()=>Rn,DataTexture:()=>Qc,DataTextureLoader:()=>rp,DataUtils:()=>cs,DecrementStencilOp:()=>hr,DecrementWrapStencilOp:()=>pr,DefaultLoadingManager:()=>Wd,DepthFormat:()=>qe,DepthStencilFormat:()=>We,DepthTexture:()=>ra,DetachedBindMode:()=>ce,DirectionalLight:()=>yp,DirectionalLightHelper:()=>qf,DiscreteInterpolant:()=>Dd,DisplayP3ColorSpace:()=>tr,DodecahedronGeometry:()=>_h,DoubleSide:()=>g,DstAlphaFactor:()=>D,DstColorFactor:()=>N,DynamicCopyUsage:()=>Fr,DynamicDrawUsage:()=>Pr,DynamicReadUsage:()=>Or,EdgesGeometry:()=>Sh,EllipseCurve:()=>Yu,EqualCompare:()=>Mr,EqualDepth:()=>W,EqualStencilFunc:()=>Ar,EquirectangularReflectionMapping:()=>pe,EquirectangularRefractionMapping:()=>fe,Euler:()=>_i,EventDispatcher:()=>Hr,ExtrudeGeometry:()=>td,FileLoader:()=>$d,Float16BufferAttribute:()=>xs,Float32BufferAttribute:()=>_s,FloatType:()=>Oe,Fog:()=>ac,FogExp2:()=>oc,FramebufferTexture:()=>Qu,FrontSide:()=>f,Frustum:()=>Ao,GLBufferAttribute:()=>gf,GLSL1:()=>zr,GLSL3:()=>Gr,GreaterCompare:()=>Cr,GreaterDepth:()=>X,GreaterEqualCompare:()=>Ir,GreaterEqualDepth:()=>Y,GreaterEqualStencilFunc:()=>_r,GreaterStencilFunc:()=>vr,GridHelper:()=>Gf,Group:()=>Kl,HalfFloatType:()=>Ne,HemisphereLight:()=>sp,HemisphereLightHelper:()=>zf,IcosahedronGeometry:()=>nd,ImageBitmapLoader:()=>Bp,ImageLoader:()=>ep,ImageUtils:()=>_n,IncrementStencilOp:()=>ur,IncrementWrapStencilOp:()=>dr,InstancedBufferAttribute:()=>qc,InstancedBufferGeometry:()=>Mp,InstancedInterleavedBuffer:()=>mf,InstancedMesh:()=>eu,Int16BufferAttribute:()=>gs,Int32BufferAttribute:()=>ys,Int8BufferAttribute:()=>ps,IntType:()=>Le,InterleavedBuffer:()=>cc,InterleavedBufferAttribute:()=>hc,Interpolant:()=>Bd,InterpolateDiscrete:()=>Ot,InterpolateLinear:()=>Nt,InterpolateSmooth:()=>Ut,InvertStencilOp:()=>fr,KeepStencilOp:()=>lr,KeyframeTrack:()=>Od,LOD:()=>Rc,LatheGeometry:()=>mh,Layers:()=>bi,LessCompare:()=>Er,LessDepth:()=>j,LessEqualCompare:()=>Sr,LessEqualDepth:()=>q,LessEqualStencilFunc:()=>yr,LessStencilFunc:()=>gr,Light:()=>ip,LightProbe:()=>bp,Line:()=>Tu,Line3:()=>Tf,LineBasicMaterial:()=>xu,LineCurve:()=>ah,LineCurve3:()=>lh,LineDashedMaterial:()=>Ed,LineLoop:()=>Lu,LineSegments:()=>Pu,LinearDisplayP3ColorSpace:()=>rr,LinearFilter:()=>Ee,LinearInterpolant:()=>Ld,LinearMipMapLinearFilter:()=>Te,LinearMipMapNearestFilter:()=>Se,LinearMipmapLinearFilter:()=>Ce,LinearMipmapNearestFilter:()=>Me,LinearSRGBColorSpace:()=>er,LinearToneMapping:()=>te,LinearTransfer:()=>nr,Loader:()=>Yd,LoaderUtils:()=>Ep,LoadingManager:()=>qd,LoopOnce:()=>Pt,LoopPingPong:()=>Dt,LoopRepeat:()=>Lt,LuminanceAlphaFormat:()=>je,LuminanceFormat:()=>He,MOUSE:()=>i,Material:()=>ns,MaterialLoader:()=>wp,MathUtils:()=>tn,Matrix2:()=>wf,Matrix3:()=>nn,Matrix4:()=>hi,MaxEquation:()=>C,Mesh:()=>Ws,MeshBasicMaterial:()=>is,MeshDepthMaterial:()=>Gl,MeshDistanceMaterial:()=>Ql,MeshLambertMaterial:()=>bd,MeshMatcapMaterial:()=>wd,MeshNormalMaterial:()=>_d,MeshPhongMaterial:()=>vd,MeshPhysicalMaterial:()=>yd,MeshStandardMaterial:()=>Ad,MeshToonMaterial:()=>xd,MinEquation:()=>S,MirroredRepeatWrapping:()=>ye,MixOperation:()=>J,MultiplyBlending:()=>_,MultiplyOperation:()=>$,NearestFilter:()=>ve,NearestMipMapLinearFilter:()=>we,NearestMipMapNearestFilter:()=>_e,NearestMipmapLinearFilter:()=>be,NearestMipmapNearestFilter:()=>xe,NeutralToneMapping:()=>ae,NeverCompare:()=>wr,NeverDepth:()=>V,NeverStencilFunc:()=>mr,NoBlending:()=>A,NoColorSpace:()=>Jt,NoToneMapping:()=>ee,NormalAnimationBlendMode:()=>Gt,NormalBlending:()=>y,NotEqualCompare:()=>Tr,NotEqualDepth:()=>K,NotEqualStencilFunc:()=>xr,NumberKeyframeTrack:()=>Fd,Object3D:()=>Fi,ObjectLoader:()=>Cp,ObjectSpaceNormalMap:()=>$t,OctahedronGeometry:()=>id,OneFactor:()=>I,OneMinusConstantAlphaFactor:()=>Q,OneMinusConstantColorFactor:()=>z,OneMinusDstAlphaFactor:()=>O,OneMinusDstColorFactor:()=>U,OneMinusSrcAlphaFactor:()=>L,OneMinusSrcColorFactor:()=>B,OrthographicCamera:()=>Lo,P3Primaries:()=>or,PCFShadowMap:()=>h,PCFSoftShadowMap:()=>d,PMREMGenerator:()=>Ho,Path:()=>fh,PerspectiveCamera:()=>so,Plane:()=>fo,PlaneGeometry:()=>xo,PlaneHelper:()=>em,PointLight:()=>gp,PointLightHelper:()=>Nf,Points:()=>ku,PointsMaterial:()=>Du,PolarGridHelper:()=>Qf,PolyhedronGeometry:()=>xh,PositionalAudio:()=>$p,PropertyBinding:()=>af,PropertyMixer:()=>Zp,QuadraticBezierCurve:()=>ch,QuadraticBezierCurve3:()=>uh,Quaternion:()=>Dn,QuaternionKeyframeTrack:()=>zd,QuaternionLinearInterpolant:()=>kd,RED_GREEN_RGTC2_Format:()=>Rt,RED_RGTC1_Format:()=>Tt,REVISION:()=>n,RGBADepthPacking:()=>Wt,RGBAFormat:()=>Ve,RGBAIntegerFormat:()=>Ze,RGBA_ASTC_10x10_Format:()=>bt,RGBA_ASTC_10x5_Format:()=>vt,RGBA_ASTC_10x6_Format:()=>xt,RGBA_ASTC_10x8_Format:()=>_t,RGBA_ASTC_12x10_Format:()=>wt,RGBA_ASTC_12x12_Format:()=>Et,RGBA_ASTC_4x4_Format:()=>ht,RGBA_ASTC_5x4_Format:()=>dt,RGBA_ASTC_5x5_Format:()=>pt,RGBA_ASTC_6x5_Format:()=>ft,RGBA_ASTC_6x6_Format:()=>mt,RGBA_ASTC_8x5_Format:()=>gt,RGBA_ASTC_8x6_Format:()=>At,RGBA_ASTC_8x8_Format:()=>yt,RGBA_BPTC_Format:()=>Mt,RGBA_ETC2_EAC_Format:()=>ut,RGBA_PVRTC_2BPPV1_Format:()=>at,RGBA_PVRTC_4BPPV1_Format:()=>ot,RGBA_S3TC_DXT1_Format:()=>tt,RGBA_S3TC_DXT3_Format:()=>rt,RGBA_S3TC_DXT5_Format:()=>nt,RGBDepthPacking:()=>Yt,RGBFormat:()=>Qe,RGBIntegerFormat:()=>Je,RGB_BPTC_SIGNED_Format:()=>St,RGB_BPTC_UNSIGNED_Format:()=>Ct,RGB_ETC1_Format:()=>lt,RGB_ETC2_Format:()=>ct,RGB_PVRTC_2BPPV1_Format:()=>st,RGB_PVRTC_4BPPV1_Format:()=>it,RGB_S3TC_DXT1_Format:()=>et,RGDepthPacking:()=>Xt,RGFormat:()=>Ke,RGIntegerFormat:()=>$e,RawShaderMaterial:()=>gd,Ray:()=>ui,Raycaster:()=>yf,Rec709Primaries:()=>sr,RectAreaLight:()=>xp,RedFormat:()=>Ye,RedIntegerFormat:()=>Xe,ReinhardToneMapping:()=>re,RenderTarget:()=>Tn,RepeatWrapping:()=>ge,ReplaceStencilOp:()=>cr,ReverseSubtractEquation:()=>M,RingGeometry:()=>sd,SIGNED_RED_GREEN_RGTC2_Format:()=>Bt,SIGNED_RED_RGTC1_Format:()=>It,SRGBColorSpace:()=>Zt,SRGBTransfer:()=>ir,Scene:()=>lc,ShaderChunk:()=>_o,ShaderLib:()=>wo,ShaderMaterial:()=>eo,ShadowMaterial:()=>md,Shape:()=>Ch,ShapeGeometry:()=>od,ShapePath:()=>om,ShapeUtils:()=>Jh,ShortType:()=>Be,Skeleton:()=>jc,SkeletonHelper:()=>Df,SkinnedMesh:()=>zc,Source:()=>wn,Sphere:()=>ri,SphereGeometry:()=>ad,Spherical:()=>_f,SphericalHarmonics3:()=>_p,SplineCurve:()=>hh,SpotLight:()=>hp,SpotLightHelper:()=>Rf,Sprite:()=>Sc,SpriteMaterial:()=>dc,SrcAlphaFactor:()=>P,SrcAlphaSaturateFactor:()=>F,SrcColorFactor:()=>R,StaticCopyUsage:()=>Ur,StaticDrawUsage:()=>Br,StaticReadUsage:()=>Dr,StereoCamera:()=>Fp,StreamCopyUsage:()=>kr,StreamDrawUsage:()=>Lr,StreamReadUsage:()=>Nr,StringKeyframeTrack:()=>Gd,SubtractEquation:()=>E,SubtractiveBlending:()=>x,TOUCH:()=>s,TangentSpaceNormalMap:()=>Kt,TetrahedronGeometry:()=>ld,Texture:()=>Sn,TextureLoader:()=>np,TextureUtils:()=>ql,TorusGeometry:()=>cd,TorusKnotGeometry:()=>ud,Triangle:()=>Xi,TriangleFanDrawMode:()=>jt,TriangleStripDrawMode:()=>Ht,TrianglesDrawMode:()=>Vt,TubeGeometry:()=>hd,UVMapping:()=>ue,Uint16BufferAttribute:()=>As,Uint32BufferAttribute:()=>vs,Uint8BufferAttribute:()=>fs,Uint8ClampedBufferAttribute:()=>ms,Uniform:()=>df,UniformsGroup:()=>ff,UniformsLib:()=>bo,UniformsUtils:()=>Zs,UnsignedByteType:()=>Ie,UnsignedInt248Type:()=>ke,UnsignedInt5999Type:()=>ze,UnsignedIntType:()=>De,UnsignedShort4444Type:()=>Ue,UnsignedShort5551Type:()=>Fe,UnsignedShortType:()=>Pe,VSMShadowMap:()=>p,Vector2:()=>rn,Vector3:()=>On,Vector4:()=>Cn,VectorKeyframeTrack:()=>Qd,VideoTexture:()=>Gu,WebGL3DRenderTarget:()=>Ln,WebGLArrayRenderTarget:()=>Bn,WebGLCoordinateSystem:()=>Qr,WebGLCubeRenderTarget:()=>co,WebGLMultipleRenderTargets:()=>lm,WebGLRenderTarget:()=>In,WebGLRenderer:()=>sc,WebGLUtils:()=>Yl,WebGPUCoordinateSystem:()=>Vr,WireframeGeometry:()=>dd,WrapAroundEnding:()=>zt,ZeroCurvatureEnding:()=>Ft,ZeroFactor:()=>T,ZeroSlopeEnding:()=>kt,ZeroStencilOp:()=>ar,createCanvasElement:()=>un});const n="168",i={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},s={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},o=0,a=1,l=2,c=3,u=0,h=1,d=2,p=3,f=0,m=1,g=2,A=0,y=1,v=2,x=3,_=4,b=5,w=100,E=101,M=102,S=103,C=104,T=200,I=201,R=202,B=203,P=204,L=205,D=206,O=207,N=208,U=209,F=210,k=211,z=212,G=213,Q=214,V=0,H=1,j=2,q=3,W=4,Y=5,X=6,K=7,$=0,J=1,Z=2,ee=0,te=1,re=2,ne=3,ie=4,se=5,oe=6,ae=7,le="attached",ce="detached",ue=300,he=301,de=302,pe=303,fe=304,me=306,ge=1e3,Ae=1001,ye=1002,ve=1003,xe=1004,_e=1004,be=1005,we=1005,Ee=1006,Me=1007,Se=1007,Ce=1008,Te=1008,Ie=1009,Re=1010,Be=1011,Pe=1012,Le=1013,De=1014,Oe=1015,Ne=1016,Ue=1017,Fe=1018,ke=1020,ze=35902,Ge=1021,Qe=1022,Ve=1023,He=1024,je=1025,qe=1026,We=1027,Ye=1028,Xe=1029,Ke=1030,$e=1031,Je=1032,Ze=1033,et=33776,tt=33777,rt=33778,nt=33779,it=35840,st=35841,ot=35842,at=35843,lt=36196,ct=37492,ut=37496,ht=37808,dt=37809,pt=37810,ft=37811,mt=37812,gt=37813,At=37814,yt=37815,vt=37816,xt=37817,_t=37818,bt=37819,wt=37820,Et=37821,Mt=36492,St=36494,Ct=36495,Tt=36283,It=36284,Rt=36285,Bt=36286,Pt=2200,Lt=2201,Dt=2202,Ot=2300,Nt=2301,Ut=2302,Ft=2400,kt=2401,zt=2402,Gt=2500,Qt=2501,Vt=0,Ht=1,jt=2,qt=3200,Wt=3201,Yt=3202,Xt=3203,Kt=0,$t=1,Jt="",Zt="srgb",er="srgb-linear",tr="display-p3",rr="display-p3-linear",nr="linear",ir="srgb",sr="rec709",or="p3",ar=0,lr=7680,cr=7681,ur=7682,hr=7683,dr=34055,pr=34056,fr=5386,mr=512,gr=513,Ar=514,yr=515,vr=516,xr=517,_r=518,br=519,wr=512,Er=513,Mr=514,Sr=515,Cr=516,Tr=517,Ir=518,Rr=519,Br=35044,Pr=35048,Lr=35040,Dr=35045,Or=35049,Nr=35041,Ur=35046,Fr=35050,kr=35042,zr="100",Gr="300 es",Qr=2e3,Vr=2001;class Hr{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});const r=this._listeners;void 0===r[e]&&(r[e]=[]),-1===r[e].indexOf(t)&&r[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;const r=this._listeners;return void 0!==r[e]&&-1!==r[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;const r=this._listeners[e];if(void 0!==r){const e=r.indexOf(t);-1!==e&&r.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;const t=this._listeners[e.type];if(void 0!==t){e.target=this;const r=t.slice(0);for(let t=0,n=r.length;t>8&255]+jr[e>>16&255]+jr[e>>24&255]+"-"+jr[255&t]+jr[t>>8&255]+"-"+jr[t>>16&15|64]+jr[t>>24&255]+"-"+jr[63&r|128]+jr[r>>8&255]+"-"+jr[r>>16&255]+jr[r>>24&255]+jr[255&n]+jr[n>>8&255]+jr[n>>16&255]+jr[n>>24&255]).toLowerCase()}function Kr(e,t,r){return Math.max(t,Math.min(r,e))}function $r(e,t){return(e%t+t)%t}function Jr(e,t,r){return(1-r)*e+r*t}function Zr(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}function en(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(4294967295*e);case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int32Array:return Math.round(2147483647*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw new Error("Invalid component type.")}}const tn={DEG2RAD:Wr,RAD2DEG:Yr,generateUUID:Xr,clamp:Kr,euclideanModulo:$r,mapLinear:function(e,t,r,n,i){return n+(e-t)*(i-n)/(r-t)},inverseLerp:function(e,t,r){return e!==t?(r-e)/(t-e):0},lerp:Jr,damp:function(e,t,r,n){return Jr(e,t,1-Math.exp(-r*n))},pingpong:function(e,t=1){return t-Math.abs($r(e,2*t)-t)},smoothstep:function(e,t,r){return e<=t?0:e>=r?1:(e=(e-t)/(r-t))*e*(3-2*e)},smootherstep:function(e,t,r){return e<=t?0:e>=r?1:(e=(e-t)/(r-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){void 0!==e&&(qr=e);let t=qr+=1831565813;return t=Math.imul(t^t>>>15,1|t),t^=t+Math.imul(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296},degToRad:function(e){return e*Wr},radToDeg:function(e){return e*Yr},isPowerOfTwo:function(e){return!(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,r,n,i){const s=Math.cos,o=Math.sin,a=s(r/2),l=o(r/2),c=s((t+n)/2),u=o((t+n)/2),h=s((t-n)/2),d=o((t-n)/2),p=s((n-t)/2),f=o((n-t)/2);switch(i){case"XYX":e.set(a*u,l*h,l*d,a*c);break;case"YZY":e.set(l*d,a*u,l*h,a*c);break;case"ZXZ":e.set(l*h,l*d,a*u,a*c);break;case"XZX":e.set(a*u,l*f,l*p,a*c);break;case"YXY":e.set(l*p,a*u,l*f,a*c);break;case"ZYZ":e.set(l*f,l*p,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}},normalize:en,denormalize:Zr};class rn{constructor(e=0,t=0){rn.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,r=this.y,n=e.elements;return this.x=n[0]*t+n[3]*r+n[6],this.y=n[1]*t+n[4]*r+n[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}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=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const r=this.dot(e)/t;return Math.acos(Kr(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y;return t*t+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const r=Math.cos(t),n=Math.sin(t),i=this.x-e.x,s=this.y-e.y;return this.x=i*r-s*n+e.x,this.y=i*n+s*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class nn{constructor(e,t,r,n,i,s,o,a,l){nn.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,t,r,n,i,s,o,a,l)}set(e,t,r,n,i,s,o,a,l){const c=this.elements;return c[0]=e,c[1]=n,c[2]=o,c[3]=t,c[4]=i,c[5]=a,c[6]=r,c[7]=s,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],this}extractBasis(e,t,r){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const r=e.elements,n=t.elements,i=this.elements,s=r[0],o=r[3],a=r[6],l=r[1],c=r[4],u=r[7],h=r[2],d=r[5],p=r[8],f=n[0],m=n[3],g=n[6],A=n[1],y=n[4],v=n[7],x=n[2],_=n[5],b=n[8];return i[0]=s*f+o*A+a*x,i[3]=s*m+o*y+a*_,i[6]=s*g+o*v+a*b,i[1]=l*f+c*A+u*x,i[4]=l*m+c*y+u*_,i[7]=l*g+c*v+u*b,i[2]=h*f+d*A+p*x,i[5]=h*m+d*y+p*_,i[8]=h*g+d*v+p*b,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],r=e[1],n=e[2],i=e[3],s=e[4],o=e[5],a=e[6],l=e[7],c=e[8];return t*s*c-t*o*l-r*i*c+r*o*a+n*i*l-n*s*a}invert(){const e=this.elements,t=e[0],r=e[1],n=e[2],i=e[3],s=e[4],o=e[5],a=e[6],l=e[7],c=e[8],u=c*s-o*l,h=o*a-c*i,d=l*i-s*a,p=t*u+r*h+n*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const f=1/p;return e[0]=u*f,e[1]=(n*l-c*r)*f,e[2]=(o*r-n*s)*f,e[3]=h*f,e[4]=(c*t-n*a)*f,e[5]=(n*i-o*t)*f,e[6]=d*f,e[7]=(r*a-l*t)*f,e[8]=(s*t-r*i)*f,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,r,n,i,s,o){const a=Math.cos(i),l=Math.sin(i);return this.set(r*a,r*l,-r*(a*s+l*o)+s+e,-n*l,n*a,-n*(-l*s+a*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(sn.makeScale(e,t)),this}rotate(e){return this.premultiply(sn.makeRotation(-e)),this}translate(e,t){return this.premultiply(sn.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,r,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,r=e.elements;for(let e=0;e<9;e++)if(t[e]!==r[e])return!1;return!0}fromArray(e,t=0){for(let r=0;r<9;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e}clone(){return(new this.constructor).fromArray(this.elements)}}const sn=new nn;function on(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}const an={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function ln(e,t){return new an[e](t)}function cn(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function un(){const e=cn("canvas");return e.style.display="block",e}const hn={};function dn(e){e in hn||(hn[e]=!0,console.warn(e))}const pn=(new nn).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),fn=(new nn).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),mn={[er]:{transfer:nr,primaries:sr,luminanceCoefficients:[.2126,.7152,.0722],toReference:e=>e,fromReference:e=>e},[Zt]:{transfer:ir,primaries:sr,luminanceCoefficients:[.2126,.7152,.0722],toReference:e=>e.convertSRGBToLinear(),fromReference:e=>e.convertLinearToSRGB()},[rr]:{transfer:nr,primaries:or,luminanceCoefficients:[.2289,.6917,.0793],toReference:e=>e.applyMatrix3(fn),fromReference:e=>e.applyMatrix3(pn)},[tr]:{transfer:ir,primaries:or,luminanceCoefficients:[.2289,.6917,.0793],toReference:e=>e.convertSRGBToLinear().applyMatrix3(fn),fromReference:e=>e.applyMatrix3(pn).convertLinearToSRGB()}},gn=new Set([er,rr]),An={enabled:!0,_workingColorSpace:er,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(e){if(!gn.has(e))throw new Error(`Unsupported working color space, "${e}".`);this._workingColorSpace=e},convert:function(e,t,r){if(!1===this.enabled||t===r||!t||!r)return e;const n=mn[t].toReference;return(0,mn[r].fromReference)(n(e))},fromWorkingColorSpace:function(e,t){return this.convert(e,this._workingColorSpace,t)},toWorkingColorSpace:function(e,t){return this.convert(e,t,this._workingColorSpace)},getPrimaries:function(e){return mn[e].primaries},getTransfer:function(e){return e===Jt?nr:mn[e].transfer},getLuminanceCoefficients:function(e,t=this._workingColorSpace){return e.fromArray(mn[t].luminanceCoefficients)}};function yn(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function vn(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}let xn;class _n{static getDataURL(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===xn&&(xn=cn("canvas")),xn.width=e.width,xn.height=e.height;const r=xn.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),t=xn}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const t=cn("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const n=r.getImageData(0,0,e.width,e.height),i=n.data;for(let e=0;e0&&(r.userData=this.userData),t||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==ue)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case ge:e.x=e.x-Math.floor(e.x);break;case Ae:e.x=e.x<0?0:1;break;case ye:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case ge:e.y=e.y-Math.floor(e.y);break;case Ae:e.y=e.y<0?0:1;break;case ye:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){!0===e&&this.pmremVersion++}}Sn.DEFAULT_IMAGE=null,Sn.DEFAULT_MAPPING=ue,Sn.DEFAULT_ANISOTROPY=1;class Cn{constructor(e=0,t=0,r=0,n=1){Cn.prototype.isVector4=!0,this.x=e,this.y=t,this.z=r,this.w=n}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,r,n){return this.x=e,this.y=t,this.z=r,this.w=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){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: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,r=this.y,n=this.z,i=this.w,s=e.elements;return this.x=s[0]*t+s[4]*r+s[8]*n+s[12]*i,this.y=s[1]*t+s[5]*r+s[9]*n+s[13]*i,this.z=s[2]*t+s[6]*r+s[10]*n+s[14]*i,this.w=s[3]*t+s[7]*r+s[11]*n+s[15]*i,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,r,n,i;const s=.01,o=.1,a=e.elements,l=a[0],c=a[4],u=a[8],h=a[1],d=a[5],p=a[9],f=a[2],m=a[6],g=a[10];if(Math.abs(c-h)a&&e>A?eA?a=0?1:-1,n=1-t*t;if(n>Number.EPSILON){const i=Math.sqrt(n),s=Math.atan2(i,t*r);e=Math.sin(e*s)/i,o=Math.sin(o*s)/i}const i=o*r;if(a=a*e+h*i,l=l*e+d*i,c=c*e+p*i,u=u*e+f*i,e===1-o){const e=1/Math.sqrt(a*a+l*l+c*c+u*u);a*=e,l*=e,c*=e,u*=e}}e[t]=a,e[t+1]=l,e[t+2]=c,e[t+3]=u}static multiplyQuaternionsFlat(e,t,r,n,i,s){const o=r[n],a=r[n+1],l=r[n+2],c=r[n+3],u=i[s],h=i[s+1],d=i[s+2],p=i[s+3];return e[t]=o*p+c*u+a*d-l*h,e[t+1]=a*p+c*h+l*u-o*d,e[t+2]=l*p+c*d+o*h-a*u,e[t+3]=c*p-o*u-a*h-l*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,r,n){return this._x=e,this._y=t,this._z=r,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const r=e._x,n=e._y,i=e._z,s=e._order,o=Math.cos,a=Math.sin,l=o(r/2),c=o(n/2),u=o(i/2),h=a(r/2),d=a(n/2),p=a(i/2);switch(s){case"XYZ":this._x=h*c*u+l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u-h*d*p;break;case"YXZ":this._x=h*c*u+l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u+h*d*p;break;case"ZXY":this._x=h*c*u-l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u-h*d*p;break;case"ZYX":this._x=h*c*u-l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u+h*d*p;break;case"YZX":this._x=h*c*u+l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u-h*d*p;break;case"XZY":this._x=h*c*u-l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u+h*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!0===t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const r=t/2,n=Math.sin(r);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,r=t[0],n=t[4],i=t[8],s=t[1],o=t[5],a=t[9],l=t[2],c=t[6],u=t[10],h=r+o+u;if(h>0){const e=.5/Math.sqrt(h+1);this._w=.25/e,this._x=(c-a)*e,this._y=(i-l)*e,this._z=(s-n)*e}else if(r>o&&r>u){const e=2*Math.sqrt(1+r-o-u);this._w=(c-a)/e,this._x=.25*e,this._y=(n+s)/e,this._z=(i+l)/e}else if(o>u){const e=2*Math.sqrt(1+o-r-u);this._w=(i-l)/e,this._x=(n+s)/e,this._y=.25*e,this._z=(a+c)/e}else{const e=2*Math.sqrt(1+u-r-o);this._w=(s-n)/e,this._x=(i+l)/e,this._y=(a+c)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let r=e.dot(t)+1;return rMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Kr(this.dot(e),-1,1)))}rotateTowards(e,t){const r=this.angleTo(e);if(0===r)return this;const n=Math.min(1,t/r);return this.slerp(e,n),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(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._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 e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const r=e._x,n=e._y,i=e._z,s=e._w,o=t._x,a=t._y,l=t._z,c=t._w;return this._x=r*c+s*o+n*l-i*a,this._y=n*c+s*a+i*o-r*l,this._z=i*c+s*l+r*a-n*o,this._w=s*c-r*o-n*a-i*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const r=this._x,n=this._y,i=this._z,s=this._w;let o=s*e._w+r*e._x+n*e._y+i*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=s,this._x=r,this._y=n,this._z=i,this;const a=1-o*o;if(a<=Number.EPSILON){const e=1-t;return this._w=e*s+t*this._w,this._x=e*r+t*this._x,this._y=e*n+t*this._y,this._z=e*i+t*this._z,this.normalize(),this}const l=Math.sqrt(a),c=Math.atan2(l,o),u=Math.sin((1-t)*c)/l,h=Math.sin(t*c)/l;return this._w=s*u+this._w*h,this._x=r*u+this._x*h,this._y=n*u+this._y*h,this._z=i*u+this._z*h,this._onChangeCallback(),this}slerpQuaternions(e,t,r){return this.copy(e).slerp(t,r)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),r=Math.random(),n=Math.sqrt(1-r),i=Math.sqrt(r);return this.set(n*Math.sin(e),n*Math.cos(e),i*Math.sin(t),i*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class On{constructor(e=0,t=0,r=0){On.prototype.isVector3=!0,this.x=e,this.y=t,this.z=r}set(e,t,r){return void 0===r&&(r=this.z),this.x=e,this.y=t,this.z=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(Un.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Un.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,r=this.y,n=this.z,i=e.elements;return this.x=i[0]*t+i[3]*r+i[6]*n,this.y=i[1]*t+i[4]*r+i[7]*n,this.z=i[2]*t+i[5]*r+i[8]*n,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,r=this.y,n=this.z,i=e.elements,s=1/(i[3]*t+i[7]*r+i[11]*n+i[15]);return this.x=(i[0]*t+i[4]*r+i[8]*n+i[12])*s,this.y=(i[1]*t+i[5]*r+i[9]*n+i[13])*s,this.z=(i[2]*t+i[6]*r+i[10]*n+i[14])*s,this}applyQuaternion(e){const t=this.x,r=this.y,n=this.z,i=e.x,s=e.y,o=e.z,a=e.w,l=2*(s*n-o*r),c=2*(o*t-i*n),u=2*(i*r-s*t);return this.x=t+a*l+s*u-o*c,this.y=r+a*c+o*l-i*u,this.z=n+a*u+i*c-s*l,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,r=this.y,n=this.z,i=e.elements;return this.x=i[0]*t+i[4]*r+i[8]*n,this.y=i[1]*t+i[5]*r+i[9]*n,this.z=i[2]*t+i[6]*r+i[10]*n,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}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=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.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(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const r=e.x,n=e.y,i=e.z,s=t.x,o=t.y,a=t.z;return this.x=n*a-i*o,this.y=i*s-r*a,this.z=r*o-n*s,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const r=e.dot(this)/t;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return Nn.copy(this).projectOnVector(e),this.sub(Nn)}reflect(e){return this.sub(Nn.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const r=this.dot(e)/t;return Math.acos(Kr(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y,n=this.z-e.z;return t*t+r*r+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,r){const n=Math.sin(t)*e;return this.x=n*Math.sin(r),this.y=Math.cos(t)*e,this.z=n*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,r){return this.x=e*Math.sin(t),this.y=r,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=r,this.z=n,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=2*Math.random()-1,r=Math.sqrt(1-t*t);return this.x=r*Math.cos(e),this.y=t,this.z=r*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Nn=new On,Un=new Dn;class Fn{constructor(e=new On(1/0,1/0,1/0),t=new On(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,r=e.length;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,zn),zn.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,r;return e.normal.x>0?(t=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),t<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Yn),Xn.subVectors(this.max,Yn),Qn.subVectors(e.a,Yn),Vn.subVectors(e.b,Yn),Hn.subVectors(e.c,Yn),jn.subVectors(Vn,Qn),qn.subVectors(Hn,Vn),Wn.subVectors(Qn,Hn);let t=[0,-jn.z,jn.y,0,-qn.z,qn.y,0,-Wn.z,Wn.y,jn.z,0,-jn.x,qn.z,0,-qn.x,Wn.z,0,-Wn.x,-jn.y,jn.x,0,-qn.y,qn.x,0,-Wn.y,Wn.x,0];return!!Jn(t,Qn,Vn,Hn,Xn)&&(t=[1,0,0,0,1,0,0,0,1],!!Jn(t,Qn,Vn,Hn,Xn)&&(Kn.crossVectors(jn,qn),t=[Kn.x,Kn.y,Kn.z],Jn(t,Qn,Vn,Hn,Xn)))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,zn).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(zn).length()),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(kn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),kn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),kn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),kn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),kn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),kn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),kn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),kn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(kn)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const kn=[new On,new On,new On,new On,new On,new On,new On,new On],zn=new On,Gn=new Fn,Qn=new On,Vn=new On,Hn=new On,jn=new On,qn=new On,Wn=new On,Yn=new On,Xn=new On,Kn=new On,$n=new On;function Jn(e,t,r,n,i){for(let s=0,o=e.length-3;s<=o;s+=3){$n.fromArray(e,s);const o=i.x*Math.abs($n.x)+i.y*Math.abs($n.y)+i.z*Math.abs($n.z),a=t.dot($n),l=r.dot($n),c=n.dot($n);if(Math.max(-Math.max(a,l,c),Math.min(a,l,c))>o)return!1}return!0}const Zn=new Fn,ei=new On,ti=new On;class ri{constructor(e=new On,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const r=this.center;void 0!==t?r.copy(t):Zn.setFromPoints(e).getCenter(r);let n=0;for(let t=0,i=e.length;tthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;ei.subVectors(e,this.center);const t=ei.lengthSq();if(t>this.radius*this.radius){const e=Math.sqrt(t),r=.5*(e-this.radius);this.center.addScaledVector(ei,r/e),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(ti.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(ei.copy(e.center).add(ti)),this.expandByPoint(ei.copy(e.center).sub(ti))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const ni=new On,ii=new On,si=new On,oi=new On,ai=new On,li=new On,ci=new On;class ui{constructor(e=new On,t=new On(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,ni)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const r=t.dot(this.direction);return r<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=ni.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(ni.copy(this.origin).addScaledVector(this.direction,t),ni.distanceToSquared(e))}distanceSqToSegment(e,t,r,n){ii.copy(e).add(t).multiplyScalar(.5),si.copy(t).sub(e).normalize(),oi.copy(this.origin).sub(ii);const i=.5*e.distanceTo(t),s=-this.direction.dot(si),o=oi.dot(this.direction),a=-oi.dot(si),l=oi.lengthSq(),c=Math.abs(1-s*s);let u,h,d,p;if(c>0)if(u=s*a-o,h=s*o-a,p=i*c,u>=0)if(h>=-p)if(h<=p){const e=1/c;u*=e,h*=e,d=u*(u+s*h+2*o)+h*(s*u+h+2*a)+l}else h=i,u=Math.max(0,-(s*h+o)),d=-u*u+h*(h+2*a)+l;else h=-i,u=Math.max(0,-(s*h+o)),d=-u*u+h*(h+2*a)+l;else h<=-p?(u=Math.max(0,-(-s*i+o)),h=u>0?-i:Math.min(Math.max(-i,-a),i),d=-u*u+h*(h+2*a)+l):h<=p?(u=0,h=Math.min(Math.max(-i,-a),i),d=h*(h+2*a)+l):(u=Math.max(0,-(s*i+o)),h=u>0?i:Math.min(Math.max(-i,-a),i),d=-u*u+h*(h+2*a)+l);else h=s>0?-i:i,u=Math.max(0,-(s*h+o)),d=-u*u+h*(h+2*a)+l;return r&&r.copy(this.origin).addScaledVector(this.direction,u),n&&n.copy(ii).addScaledVector(si,h),d}intersectSphere(e,t){ni.subVectors(e.center,this.origin);const r=ni.dot(this.direction),n=ni.dot(ni)-r*r,i=e.radius*e.radius;if(n>i)return null;const s=Math.sqrt(i-n),o=r-s,a=r+s;return a<0?null:o<0?this.at(a,t):this.at(o,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/t;return r>=0?r:null}intersectPlane(e,t){const r=this.distanceToPlane(e);return null===r?null:this.at(r,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let r,n,i,s,o,a;const l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,h=this.origin;return l>=0?(r=(e.min.x-h.x)*l,n=(e.max.x-h.x)*l):(r=(e.max.x-h.x)*l,n=(e.min.x-h.x)*l),c>=0?(i=(e.min.y-h.y)*c,s=(e.max.y-h.y)*c):(i=(e.max.y-h.y)*c,s=(e.min.y-h.y)*c),r>s||i>n?null:((i>r||isNaN(r))&&(r=i),(s=0?(o=(e.min.z-h.z)*u,a=(e.max.z-h.z)*u):(o=(e.max.z-h.z)*u,a=(e.min.z-h.z)*u),r>a||o>n?null:((o>r||r!=r)&&(r=o),(a=0?r:n,t)))}intersectsBox(e){return null!==this.intersectBox(e,ni)}intersectTriangle(e,t,r,n,i){ai.subVectors(t,e),li.subVectors(r,e),ci.crossVectors(ai,li);let s,o=this.direction.dot(ci);if(o>0){if(n)return null;s=1}else{if(!(o<0))return null;s=-1,o=-o}oi.subVectors(this.origin,e);const a=s*this.direction.dot(li.crossVectors(oi,li));if(a<0)return null;const l=s*this.direction.dot(ai.cross(oi));if(l<0)return null;if(a+l>o)return null;const c=-s*oi.dot(ci);return c<0?null:this.at(c/o,i)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class hi{constructor(e,t,r,n,i,s,o,a,l,c,u,h,d,p,f,m){hi.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,t,r,n,i,s,o,a,l,c,u,h,d,p,f,m)}set(e,t,r,n,i,s,o,a,l,c,u,h,d,p,f,m){const g=this.elements;return g[0]=e,g[4]=t,g[8]=r,g[12]=n,g[1]=i,g[5]=s,g[9]=o,g[13]=a,g[2]=l,g[6]=c,g[10]=u,g[14]=h,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(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],this}copyPosition(e){const t=this.elements,r=e.elements;return t[12]=r[12],t[13]=r[13],t[14]=r[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,r){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,t,r){return this.set(e.x,t.x,r.x,0,e.y,t.y,r.y,0,e.z,t.z,r.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,r=e.elements,n=1/di.setFromMatrixColumn(e,0).length(),i=1/di.setFromMatrixColumn(e,1).length(),s=1/di.setFromMatrixColumn(e,2).length();return t[0]=r[0]*n,t[1]=r[1]*n,t[2]=r[2]*n,t[3]=0,t[4]=r[4]*i,t[5]=r[5]*i,t[6]=r[6]*i,t[7]=0,t[8]=r[8]*s,t[9]=r[9]*s,t[10]=r[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,r=e.x,n=e.y,i=e.z,s=Math.cos(r),o=Math.sin(r),a=Math.cos(n),l=Math.sin(n),c=Math.cos(i),u=Math.sin(i);if("XYZ"===e.order){const e=s*c,r=s*u,n=o*c,i=o*u;t[0]=a*c,t[4]=-a*u,t[8]=l,t[1]=r+n*l,t[5]=e-i*l,t[9]=-o*a,t[2]=i-e*l,t[6]=n+r*l,t[10]=s*a}else if("YXZ"===e.order){const e=a*c,r=a*u,n=l*c,i=l*u;t[0]=e+i*o,t[4]=n*o-r,t[8]=s*l,t[1]=s*u,t[5]=s*c,t[9]=-o,t[2]=r*o-n,t[6]=i+e*o,t[10]=s*a}else if("ZXY"===e.order){const e=a*c,r=a*u,n=l*c,i=l*u;t[0]=e-i*o,t[4]=-s*u,t[8]=n+r*o,t[1]=r+n*o,t[5]=s*c,t[9]=i-e*o,t[2]=-s*l,t[6]=o,t[10]=s*a}else if("ZYX"===e.order){const e=s*c,r=s*u,n=o*c,i=o*u;t[0]=a*c,t[4]=n*l-r,t[8]=e*l+i,t[1]=a*u,t[5]=i*l+e,t[9]=r*l-n,t[2]=-l,t[6]=o*a,t[10]=s*a}else if("YZX"===e.order){const e=s*a,r=s*l,n=o*a,i=o*l;t[0]=a*c,t[4]=i-e*u,t[8]=n*u+r,t[1]=u,t[5]=s*c,t[9]=-o*c,t[2]=-l*c,t[6]=r*u+n,t[10]=e-i*u}else if("XZY"===e.order){const e=s*a,r=s*l,n=o*a,i=o*l;t[0]=a*c,t[4]=-u,t[8]=l*c,t[1]=e*u+i,t[5]=s*c,t[9]=r*u-n,t[2]=n*u-r,t[6]=o*c,t[10]=i*u+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(fi,e,mi)}lookAt(e,t,r){const n=this.elements;return yi.subVectors(e,t),0===yi.lengthSq()&&(yi.z=1),yi.normalize(),gi.crossVectors(r,yi),0===gi.lengthSq()&&(1===Math.abs(r.z)?yi.x+=1e-4:yi.z+=1e-4,yi.normalize(),gi.crossVectors(r,yi)),gi.normalize(),Ai.crossVectors(yi,gi),n[0]=gi.x,n[4]=Ai.x,n[8]=yi.x,n[1]=gi.y,n[5]=Ai.y,n[9]=yi.y,n[2]=gi.z,n[6]=Ai.z,n[10]=yi.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const r=e.elements,n=t.elements,i=this.elements,s=r[0],o=r[4],a=r[8],l=r[12],c=r[1],u=r[5],h=r[9],d=r[13],p=r[2],f=r[6],m=r[10],g=r[14],A=r[3],y=r[7],v=r[11],x=r[15],_=n[0],b=n[4],w=n[8],E=n[12],M=n[1],S=n[5],C=n[9],T=n[13],I=n[2],R=n[6],B=n[10],P=n[14],L=n[3],D=n[7],O=n[11],N=n[15];return i[0]=s*_+o*M+a*I+l*L,i[4]=s*b+o*S+a*R+l*D,i[8]=s*w+o*C+a*B+l*O,i[12]=s*E+o*T+a*P+l*N,i[1]=c*_+u*M+h*I+d*L,i[5]=c*b+u*S+h*R+d*D,i[9]=c*w+u*C+h*B+d*O,i[13]=c*E+u*T+h*P+d*N,i[2]=p*_+f*M+m*I+g*L,i[6]=p*b+f*S+m*R+g*D,i[10]=p*w+f*C+m*B+g*O,i[14]=p*E+f*T+m*P+g*N,i[3]=A*_+y*M+v*I+x*L,i[7]=A*b+y*S+v*R+x*D,i[11]=A*w+y*C+v*B+x*O,i[15]=A*E+y*T+v*P+x*N,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],r=e[4],n=e[8],i=e[12],s=e[1],o=e[5],a=e[9],l=e[13],c=e[2],u=e[6],h=e[10],d=e[14];return e[3]*(+i*a*u-n*l*u-i*o*h+r*l*h+n*o*d-r*a*d)+e[7]*(+t*a*d-t*l*h+i*s*h-n*s*d+n*l*c-i*a*c)+e[11]*(+t*l*u-t*o*d-i*s*u+r*s*d+i*o*c-r*l*c)+e[15]*(-n*o*c-t*a*u+t*o*h+n*s*u-r*s*h+r*a*c)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,r){const n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=t,n[14]=r),this}invert(){const e=this.elements,t=e[0],r=e[1],n=e[2],i=e[3],s=e[4],o=e[5],a=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11],p=e[12],f=e[13],m=e[14],g=e[15],A=u*m*l-f*h*l+f*a*d-o*m*d-u*a*g+o*h*g,y=p*h*l-c*m*l-p*a*d+s*m*d+c*a*g-s*h*g,v=c*f*l-p*u*l+p*o*d-s*f*d-c*o*g+s*u*g,x=p*u*a-c*f*a-p*o*h+s*f*h+c*o*m-s*u*m,_=t*A+r*y+n*v+i*x;if(0===_)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const b=1/_;return e[0]=A*b,e[1]=(f*h*i-u*m*i-f*n*d+r*m*d+u*n*g-r*h*g)*b,e[2]=(o*m*i-f*a*i+f*n*l-r*m*l-o*n*g+r*a*g)*b,e[3]=(u*a*i-o*h*i-u*n*l+r*h*l+o*n*d-r*a*d)*b,e[4]=y*b,e[5]=(c*m*i-p*h*i+p*n*d-t*m*d-c*n*g+t*h*g)*b,e[6]=(p*a*i-s*m*i-p*n*l+t*m*l+s*n*g-t*a*g)*b,e[7]=(s*h*i-c*a*i+c*n*l-t*h*l-s*n*d+t*a*d)*b,e[8]=v*b,e[9]=(p*u*i-c*f*i-p*r*d+t*f*d+c*r*g-t*u*g)*b,e[10]=(s*f*i-p*o*i+p*r*l-t*f*l-s*r*g+t*o*g)*b,e[11]=(c*o*i-s*u*i-c*r*l+t*u*l+s*r*d-t*o*d)*b,e[12]=x*b,e[13]=(c*f*n-p*u*n+p*r*h-t*f*h-c*r*m+t*u*m)*b,e[14]=(p*o*n-s*f*n-p*r*a+t*f*a+s*r*m-t*o*m)*b,e[15]=(s*u*n-c*o*n+c*r*a-t*u*a-s*r*h+t*o*h)*b,this}scale(e){const t=this.elements,r=e.x,n=e.y,i=e.z;return t[0]*=r,t[4]*=n,t[8]*=i,t[1]*=r,t[5]*=n,t[9]*=i,t[2]*=r,t[6]*=n,t[10]*=i,t[3]*=r,t[7]*=n,t[11]*=i,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,r,n))}makeTranslation(e,t,r){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,r,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,t,-r,0,0,r,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,0,r,0,0,1,0,0,-r,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,0,r,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const r=Math.cos(t),n=Math.sin(t),i=1-r,s=e.x,o=e.y,a=e.z,l=i*s,c=i*o;return this.set(l*s+r,l*o-n*a,l*a+n*o,0,l*o+n*a,c*o+r,c*a-n*s,0,l*a-n*o,c*a+n*s,i*a*a+r,0,0,0,0,1),this}makeScale(e,t,r){return this.set(e,0,0,0,0,t,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,t,r,n,i,s){return this.set(1,r,i,0,e,1,s,0,t,n,1,0,0,0,0,1),this}compose(e,t,r){const n=this.elements,i=t._x,s=t._y,o=t._z,a=t._w,l=i+i,c=s+s,u=o+o,h=i*l,d=i*c,p=i*u,f=s*c,m=s*u,g=o*u,A=a*l,y=a*c,v=a*u,x=r.x,_=r.y,b=r.z;return n[0]=(1-(f+g))*x,n[1]=(d+v)*x,n[2]=(p-y)*x,n[3]=0,n[4]=(d-v)*_,n[5]=(1-(h+g))*_,n[6]=(m+A)*_,n[7]=0,n[8]=(p+y)*b,n[9]=(m-A)*b,n[10]=(1-(h+f))*b,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this}decompose(e,t,r){const n=this.elements;let i=di.set(n[0],n[1],n[2]).length();const s=di.set(n[4],n[5],n[6]).length(),o=di.set(n[8],n[9],n[10]).length();this.determinant()<0&&(i=-i),e.x=n[12],e.y=n[13],e.z=n[14],pi.copy(this);const a=1/i,l=1/s,c=1/o;return pi.elements[0]*=a,pi.elements[1]*=a,pi.elements[2]*=a,pi.elements[4]*=l,pi.elements[5]*=l,pi.elements[6]*=l,pi.elements[8]*=c,pi.elements[9]*=c,pi.elements[10]*=c,t.setFromRotationMatrix(pi),r.x=i,r.y=s,r.z=o,this}makePerspective(e,t,r,n,i,s,o=Qr){const a=this.elements,l=2*i/(t-e),c=2*i/(r-n),u=(t+e)/(t-e),h=(r+n)/(r-n);let d,p;if(o===Qr)d=-(s+i)/(s-i),p=-2*s*i/(s-i);else{if(o!==Vr)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);d=-s/(s-i),p=-s*i/(s-i)}return a[0]=l,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=p,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,r,n,i,s,o=Qr){const a=this.elements,l=1/(t-e),c=1/(r-n),u=1/(s-i),h=(t+e)*l,d=(r+n)*c;let p,f;if(o===Qr)p=(s+i)*u,f=-2*u;else{if(o!==Vr)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);p=i*u,f=-1*u}return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=f,a[14]=-p,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){const t=this.elements,r=e.elements;for(let e=0;e<16;e++)if(t[e]!==r[e])return!1;return!0}fromArray(e,t=0){for(let r=0;r<16;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e[t+9]=r[9],e[t+10]=r[10],e[t+11]=r[11],e[t+12]=r[12],e[t+13]=r[13],e[t+14]=r[14],e[t+15]=r[15],e}}const di=new On,pi=new hi,fi=new On(0,0,0),mi=new On(1,1,1),gi=new On,Ai=new On,yi=new On,vi=new hi,xi=new Dn;class _i{constructor(e=0,t=0,r=0,n=_i.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=r,this._order=n}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,r,n=this._order){return this._x=e,this._y=t,this._z=r,this._order=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,r=!0){const n=e.elements,i=n[0],s=n[4],o=n[8],a=n[1],l=n[5],c=n[9],u=n[2],h=n[6],d=n[10];switch(t){case"XYZ":this._y=Math.asin(Kr(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-s,i)):(this._x=Math.atan2(h,l),this._z=0);break;case"YXZ":this._x=Math.asin(-Kr(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(o,d),this._z=Math.atan2(a,l)):(this._y=Math.atan2(-u,i),this._z=0);break;case"ZXY":this._x=Math.asin(Kr(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-u,d),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(a,i));break;case"ZYX":this._y=Math.asin(-Kr(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(h,d),this._z=Math.atan2(a,i)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(Kr(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-u,i)):(this._x=0,this._y=Math.atan2(o,d));break;case"XZY":this._z=Math.asin(-Kr(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(h,l),this._y=Math.atan2(o,i)):(this._x=Math.atan2(-c,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===r&&this._onChangeCallback(),this}setFromQuaternion(e,t,r){return vi.makeRotationFromQuaternion(e),this.setFromRotationMatrix(vi,t,r)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return xi.setFromEuler(this),this.setFromQuaternion(xi,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}_i.DEFAULT_ORDER="XYZ";class bi{constructor(){this.mask=1}set(e){this.mask=1<>>0}enable(e){this.mask|=1<1){for(let e=0;e1){for(let e=0;e0&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),n.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(n.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(n.type="BatchedMesh",n.perObjectFrustumCulled=this.perObjectFrustumCulled,n.sortObjects=this.sortObjects,n.drawRanges=this._drawRanges,n.reservedRanges=this._reservedRanges,n.visibility=this._visibility,n.active=this._active,n.bounds=this._bounds.map((e=>({boxInitialized:e.boxInitialized,boxMin:e.box.min.toArray(),boxMax:e.box.max.toArray(),sphereInitialized:e.sphereInitialized,sphereRadius:e.sphere.radius,sphereCenter:e.sphere.center.toArray()}))),n.maxInstanceCount=this._maxInstanceCount,n.maxVertexCount=this._maxVertexCount,n.maxIndexCount=this._maxIndexCount,n.geometryInitialized=this._geometryInitialized,n.geometryCount=this._geometryCount,n.matricesTexture=this._matricesTexture.toJSON(e),null!==this._colorsTexture&&(n.colorsTexture=this._colorsTexture.toJSON(e)),null!==this.boundingSphere&&(n.boundingSphere={center:n.boundingSphere.center.toArray(),radius:n.boundingSphere.radius}),null!==this.boundingBox&&(n.boundingBox={min:n.boundingBox.min.toArray(),max:n.boundingBox.max.toArray()})),this.isScene)this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(n.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){n.geometry=i(e.geometries,this.geometry);const t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){const r=t.shapes;if(Array.isArray(r))for(let t=0,n=r.length;t0){n.children=[];for(let t=0;t0){n.animations=[];for(let t=0;t0&&(r.geometries=t),n.length>0&&(r.materials=n),i.length>0&&(r.textures=i),o.length>0&&(r.images=o),a.length>0&&(r.shapes=a),l.length>0&&(r.skeletons=l),c.length>0&&(r.animations=c),u.length>0&&(r.nodes=u)}return r.object=n,r;function s(e){const t=[];for(const r in e){const n=e[r];delete n.metadata,t.push(n)}return t}}clone(e){return(new this.constructor).copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t0?n.multiplyScalar(1/Math.sqrt(i)):n.set(0,0,0)}static getBarycoord(e,t,r,n,i){ki.subVectors(n,t),zi.subVectors(r,t),Gi.subVectors(e,t);const s=ki.dot(ki),o=ki.dot(zi),a=ki.dot(Gi),l=zi.dot(zi),c=zi.dot(Gi),u=s*l-o*o;if(0===u)return i.set(0,0,0),null;const h=1/u,d=(l*a-o*c)*h,p=(s*c-o*a)*h;return i.set(1-d-p,p,d)}static containsPoint(e,t,r,n){return null!==this.getBarycoord(e,t,r,n,Qi)&&Qi.x>=0&&Qi.y>=0&&Qi.x+Qi.y<=1}static getInterpolation(e,t,r,n,i,s,o,a){return null===this.getBarycoord(e,t,r,n,Qi)?(a.x=0,a.y=0,"z"in a&&(a.z=0),"w"in a&&(a.w=0),null):(a.setScalar(0),a.addScaledVector(i,Qi.x),a.addScaledVector(s,Qi.y),a.addScaledVector(o,Qi.z),a)}static isFrontFacing(e,t,r,n){return ki.subVectors(r,t),zi.subVectors(e,t),ki.cross(zi).dot(n)<0}set(e,t,r){return this.a.copy(e),this.b.copy(t),this.c.copy(r),this}setFromPointsAndIndices(e,t,r,n){return this.a.copy(e[t]),this.b.copy(e[r]),this.c.copy(e[n]),this}setFromAttributeAndIndices(e,t,r,n){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,r),this.c.fromBufferAttribute(e,n),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return ki.subVectors(this.c,this.b),zi.subVectors(this.a,this.b),.5*ki.cross(zi).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Xi.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Xi.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,r,n,i){return Xi.getInterpolation(e,this.a,this.b,this.c,t,r,n,i)}containsPoint(e){return Xi.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Xi.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const r=this.a,n=this.b,i=this.c;let s,o;Vi.subVectors(n,r),Hi.subVectors(i,r),qi.subVectors(e,r);const a=Vi.dot(qi),l=Hi.dot(qi);if(a<=0&&l<=0)return t.copy(r);Wi.subVectors(e,n);const c=Vi.dot(Wi),u=Hi.dot(Wi);if(c>=0&&u<=c)return t.copy(n);const h=a*u-c*l;if(h<=0&&a>=0&&c<=0)return s=a/(a-c),t.copy(r).addScaledVector(Vi,s);Yi.subVectors(e,i);const d=Vi.dot(Yi),p=Hi.dot(Yi);if(p>=0&&d<=p)return t.copy(i);const f=d*l-a*p;if(f<=0&&l>=0&&p<=0)return o=l/(l-p),t.copy(r).addScaledVector(Hi,o);const m=c*p-d*u;if(m<=0&&u-c>=0&&d-p>=0)return ji.subVectors(i,n),o=(u-c)/(u-c+(d-p)),t.copy(n).addScaledVector(ji,o);const g=1/(m+f+h);return s=f*g,o=h*g,t.copy(r).addScaledVector(Vi,s).addScaledVector(Hi,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const Ki={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},$i={h:0,s:0,l:0},Ji={h:0,s:0,l:0};function Zi(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+6*(t-e)*(2/3-r):e}class es{constructor(e,t,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,r)}set(e,t,r){if(void 0===t&&void 0===r){const t=e;t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t)}else this.setRGB(e,t,r);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Zt){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,An.toWorkingColorSpace(this,t),this}setRGB(e,t,r,n=An.workingColorSpace){return this.r=e,this.g=t,this.b=r,An.toWorkingColorSpace(this,n),this}setHSL(e,t,r,n=An.workingColorSpace){if(e=$r(e,1),t=Kr(t,0,1),r=Kr(r,0,1),0===t)this.r=this.g=this.b=r;else{const n=r<=.5?r*(1+t):r+t-r*t,i=2*r-n;this.r=Zi(i,n,e+1/3),this.g=Zi(i,n,e),this.b=Zi(i,n,e-1/3)}return An.toWorkingColorSpace(this,n),this}setStyle(e,t=Zt){function r(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^(\w+)\(([^\)]*)\)/.exec(e)){let i;const s=n[1],o=n[2];switch(s){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(i[4]),this.setRGB(Math.min(255,parseInt(i[1],10))/255,Math.min(255,parseInt(i[2],10))/255,Math.min(255,parseInt(i[3],10))/255,t);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(i[4]),this.setRGB(Math.min(100,parseInt(i[1],10))/100,Math.min(100,parseInt(i[2],10))/100,Math.min(100,parseInt(i[3],10))/100,t);break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=n[1],i=r.length;if(3===i)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(6===i)return this.setHex(parseInt(r,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Zt){const r=Ki[e.toLowerCase()];return void 0!==r?this.setHex(r,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=yn(e.r),this.g=yn(e.g),this.b=yn(e.b),this}copyLinearToSRGB(e){return this.r=vn(e.r),this.g=vn(e.g),this.b=vn(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Zt){return An.fromWorkingColorSpace(ts.copy(this),e),65536*Math.round(Kr(255*ts.r,0,255))+256*Math.round(Kr(255*ts.g,0,255))+Math.round(Kr(255*ts.b,0,255))}getHexString(e=Zt){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=An.workingColorSpace){An.fromWorkingColorSpace(ts.copy(this),t);const r=ts.r,n=ts.g,i=ts.b,s=Math.max(r,n,i),o=Math.min(r,n,i);let a,l;const c=(o+s)/2;if(o===s)a=0,l=0;else{const e=s-o;switch(l=c<=.5?e/(s+o):e/(2-s-o),s){case r:a=(n-i)/e+(n0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(const t in e){const r=e[t];if(void 0===r){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const n=this[t];void 0!==n?n&&n.isColor?n.set(r):n&&n.isVector3&&r&&r.isVector3?n.copy(r):this[t]=r:console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`)}}toJSON(e){const t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});const r={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function n(e){const t=[];for(const r in e){const n=e[r];delete n.metadata,t.push(n)}return t}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),void 0!==this.roughness&&(r.roughness=this.roughness),void 0!==this.metalness&&(r.metalness=this.metalness),void 0!==this.sheen&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(r.shininess=this.shininess),void 0!==this.clearcoat&&(r.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.dispersion&&(r.dispersion=this.dispersion),void 0!==this.iridescence&&(r.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(r.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),void 0!==this.anisotropy&&(r.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(r.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(r.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(r.combine=this.combine)),void 0!==this.envMapRotation&&(r.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(r.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(r.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(r.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(r.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(r.size=this.size),null!==this.shadowSide&&(r.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==y&&(r.blending=this.blending),this.side!==f&&(r.side=this.side),!0===this.vertexColors&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),!0===this.transparent&&(r.transparent=!0),this.blendSrc!==P&&(r.blendSrc=this.blendSrc),this.blendDst!==L&&(r.blendDst=this.blendDst),this.blendEquation!==w&&(r.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(r.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(r.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(r.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(r.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(r.blendAlpha=this.blendAlpha),this.depthFunc!==q&&(r.depthFunc=this.depthFunc),!1===this.depthTest&&(r.depthTest=this.depthTest),!1===this.depthWrite&&(r.depthWrite=this.depthWrite),!1===this.colorWrite&&(r.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(r.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==br&&(r.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(r.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(r.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==lr&&(r.stencilFail=this.stencilFail),this.stencilZFail!==lr&&(r.stencilZFail=this.stencilZFail),this.stencilZPass!==lr&&(r.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(r.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(r.rotation=this.rotation),!0===this.polygonOffset&&(r.polygonOffset=!0),0!==this.polygonOffsetFactor&&(r.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(r.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(r.linewidth=this.linewidth),void 0!==this.dashSize&&(r.dashSize=this.dashSize),void 0!==this.gapSize&&(r.gapSize=this.gapSize),void 0!==this.scale&&(r.scale=this.scale),!0===this.dithering&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),!0===this.alphaHash&&(r.alphaHash=!0),!0===this.alphaToCoverage&&(r.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(r.premultipliedAlpha=!0),!0===this.forceSinglePass&&(r.forceSinglePass=!0),!0===this.wireframe&&(r.wireframe=!0),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(r.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(r.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(r.flatShading=!0),!1===this.visible&&(r.visible=!1),!1===this.toneMapped&&(r.toneMapped=!1),!1===this.fog&&(r.fog=!1),Object.keys(this.userData).length>0&&(r.userData=this.userData),t){const t=n(e.textures),i=n(e.images);t.length>0&&(r.textures=t),i.length>0&&(r.images=i)}return r}clone(){return(new this.constructor).copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let r=null;if(null!==t){const e=t.length;r=new Array(e);for(let n=0;n!==e;++n)r[n]=t[n].clone()}return this.clippingPlanes=r,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class is extends ns{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new es(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.envMapRotation=new _i,this.combine=$,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const ss=os();function os(){const e=new ArrayBuffer(4),t=new Float32Array(e),r=new Uint32Array(e),n=new Uint32Array(512),i=new Uint32Array(512);for(let e=0;e<256;++e){const t=e-127;t<-27?(n[e]=0,n[256|e]=32768,i[e]=24,i[256|e]=24):t<-14?(n[e]=1024>>-t-14,n[256|e]=1024>>-t-14|32768,i[e]=-t-1,i[256|e]=-t-1):t<=15?(n[e]=t+15<<10,n[256|e]=t+15<<10|32768,i[e]=13,i[256|e]=13):t<128?(n[e]=31744,n[256|e]=64512,i[e]=24,i[256|e]=24):(n[e]=31744,n[256|e]=64512,i[e]=13,i[256|e]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,r=0;for(;!(8388608&t);)t<<=1,r-=8388608;t&=-8388609,r+=947912704,s[e]=t|r}for(let e=1024;e<2048;++e)s[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)o[e]=e<<23;o[31]=1199570944,o[32]=2147483648;for(let e=33;e<63;++e)o[e]=2147483648+(e-32<<23);o[63]=3347054592;for(let e=1;e<64;++e)32!==e&&(a[e]=1024);return{floatView:t,uint32View:r,baseTable:n,shiftTable:i,mantissaTable:s,exponentTable:o,offsetTable:a}}function as(e){Math.abs(e)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),e=Kr(e,-65504,65504),ss.floatView[0]=e;const t=ss.uint32View[0],r=t>>23&511;return ss.baseTable[r]+((8388607&t)>>ss.shiftTable[r])}function ls(e){const t=e>>10;return ss.uint32View[0]=ss.mantissaTable[ss.offsetTable[t]+(1023&e)]+ss.exponentTable[t],ss.floatView[0]}const cs={toHalfFloat:as,fromHalfFloat:ls},us=new On,hs=new rn;class ds{constructor(e,t,r=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=r,this.usage=Br,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Oe,this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}get updateRange(){return dn("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,r){e*=this.itemSize,r*=t.itemSize;for(let n=0,i=this.itemSize;n0&&(e.userData=this.userData),void 0!==this.parameters){const t=this.parameters;for(const r in t)void 0!==t[r]&&(e[r]=t[r]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const r=this.attributes;for(const t in r){const n=r[t];e.data.attributes[t]=n.toJSON(e.data)}const n={};let i=!1;for(const t in this.morphAttributes){const r=this.morphAttributes[t],s=[];for(let t=0,n=r.length;t0&&(n[t]=s,i=!0)}i&&(e.data.morphAttributes=n,e.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));const o=this.boundingSphere;return null!==o&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),e}clone(){return(new this.constructor).copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const r=e.index;null!==r&&this.setIndex(r.clone(t));const n=e.attributes;for(const e in n){const r=n[e];this.setAttribute(e,r.clone(t))}const i=e.morphAttributes;for(const e in i){const r=[],n=i[e];for(let e=0,i=n.length;e0){const r=e[t[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=r.length;e(e.far-e.near)**2)return}Rs.copy(i).invert(),Bs.copy(e.ray).applyMatrix4(Rs),null!==r.boundingBox&&!1===Bs.intersectsBox(r.boundingBox)||this._computeIntersections(e,t,Bs)}}_computeIntersections(e,t,r){let n;const i=this.geometry,s=this.material,o=i.index,a=i.attributes.position,l=i.attributes.uv,c=i.attributes.uv1,u=i.attributes.normal,h=i.groups,d=i.drawRange;if(null!==o)if(Array.isArray(s))for(let i=0,a=h.length;ir.far?null:{distance:c,point:qs.clone(),object:e}}(e,t,r,n,Ds,Os,Ns,js);if(u){i&&(ks.fromBufferAttribute(i,a),zs.fromBufferAttribute(i,l),Gs.fromBufferAttribute(i,c),u.uv=Xi.getInterpolation(js,Ds,Os,Ns,ks,zs,Gs,new rn)),s&&(ks.fromBufferAttribute(s,a),zs.fromBufferAttribute(s,l),Gs.fromBufferAttribute(s,c),u.uv1=Xi.getInterpolation(js,Ds,Os,Ns,ks,zs,Gs,new rn)),o&&(Qs.fromBufferAttribute(o,a),Vs.fromBufferAttribute(o,l),Hs.fromBufferAttribute(o,c),u.normal=Xi.getInterpolation(js,Ds,Os,Ns,Qs,Vs,Hs,new On),u.normal.dot(n.direction)>0&&u.normal.multiplyScalar(-1));const e={a,b:l,c,normal:new On,materialIndex:0};Xi.getNormal(Ds,Os,Ns,e.normal),u.face=e}return u}class Xs extends Is{constructor(e=1,t=1,r=1,n=1,i=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:r,widthSegments:n,heightSegments:i,depthSegments:s};const o=this;n=Math.floor(n),i=Math.floor(i),s=Math.floor(s);const a=[],l=[],c=[],u=[];let h=0,d=0;function p(e,t,r,n,i,s,p,f,m,g,A){const y=s/m,v=p/g,x=s/2,_=p/2,b=f/2,w=m+1,E=g+1;let M=0,S=0;const C=new On;for(let s=0;s0?1:-1,c.push(C.x,C.y,C.z),u.push(a/m),u.push(1-s/g),M+=1}}for(let e=0;e0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const r={};for(const e in this.extensions)!0===this.extensions[e]&&(r[e]=!0);return Object.keys(r).length>0&&(t.extensions=r),t}}class to extends Fi{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new hi,this.projectionMatrix=new hi,this.projectionMatrixInverse=new hi,this.coordinateSystem=Qr}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}const ro=new On,no=new rn,io=new rn;class so extends to{constructor(e=50,t=1,r=.1,n=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=n,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=2*Yr*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*Wr*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*Yr*Math.atan(Math.tan(.5*Wr*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,r){ro.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(ro.x,ro.y).multiplyScalar(-e/ro.z),ro.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),r.set(ro.x,ro.y).multiplyScalar(-e/ro.z)}getViewSize(e,t){return this.getViewBounds(e,no,io),t.subVectors(io,no)}setViewOffset(e,t,r,n,i,s){this.aspect=e/t,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=e,this.view.fullHeight=t,this.view.offsetX=r,this.view.offsetY=n,this.view.width=i,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*Wr*this.fov)/this.zoom,r=2*t,n=this.aspect*r,i=-.5*n;const s=this.view;if(null!==this.view&&this.view.enabled){const e=s.fullWidth,o=s.fullHeight;i+=s.offsetX*n/e,t-=s.offsetY*r/o,n*=s.width/e,r*=s.height/o}const o=this.filmOffset;0!==o&&(i+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+n,t,t-r,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const oo=-90;class ao extends Fi{constructor(e,t,r){super(),this.type="CubeCamera",this.renderTarget=r,this.coordinateSystem=null,this.activeMipmapLevel=0;const n=new so(oo,1,e,t);n.layers=this.layers,this.add(n);const i=new so(oo,1,e,t);i.layers=this.layers,this.add(i);const s=new so(oo,1,e,t);s.layers=this.layers,this.add(s);const o=new so(oo,1,e,t);o.layers=this.layers,this.add(o);const a=new so(oo,1,e,t);a.layers=this.layers,this.add(a);const l=new so(oo,1,e,t);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[r,n,i,s,o,a]=t;for(const e of t)this.remove(e);if(e===Qr)r.up.set(0,1,0),r.lookAt(1,0,0),n.up.set(0,1,0),n.lookAt(-1,0,0),i.up.set(0,0,-1),i.lookAt(0,1,0),s.up.set(0,0,1),s.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),a.up.set(0,1,0),a.lookAt(0,0,-1);else{if(e!==Vr)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);r.up.set(0,-1,0),r.lookAt(-1,0,0),n.up.set(0,-1,0),n.lookAt(1,0,0),i.up.set(0,0,1),i.lookAt(0,1,0),s.up.set(0,0,-1),s.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),a.up.set(0,-1,0),a.lookAt(0,0,-1)}for(const e of t)this.add(e),e.updateMatrixWorld()}update(e,t){null===this.parent&&this.updateMatrixWorld();const{renderTarget:r,activeMipmapLevel:n}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[i,s,o,a,l,c]=this.children,u=e.getRenderTarget(),h=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;const f=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0,n),e.render(t,i),e.setRenderTarget(r,1,n),e.render(t,s),e.setRenderTarget(r,2,n),e.render(t,o),e.setRenderTarget(r,3,n),e.render(t,a),e.setRenderTarget(r,4,n),e.render(t,l),r.texture.generateMipmaps=f,e.setRenderTarget(r,5,n),e.render(t,c),e.setRenderTarget(u,h,d),e.xr.enabled=p,r.texture.needsPMREMUpdate=!0}}class lo extends Sn{constructor(e,t,r,n,i,s,o,a,l,c){super(e=void 0!==e?e:[],t=void 0!==t?t:he,r,n,i,s,o,a,l,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class co extends In{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},n=[r,r,r,r,r,r];this.texture=new lo(n,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==t.generateMipmaps&&t.generateMipmaps,this.texture.minFilter=void 0!==t.minFilter?t.minFilter:Ee}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const r={tEquirect:{value:null}},n="\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 \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",i="\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \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",s=new Xs(5,5,5),o=new eo({name:"CubemapFromEquirect",uniforms:Ks(r),vertexShader:n,fragmentShader:i,side:m,blending:A});o.uniforms.tEquirect.value=t;const a=new Ws(s,o),l=t.minFilter;return t.minFilter===Ce&&(t.minFilter=Ee),new ao(1,10,this).update(e,a),t.minFilter=l,a.geometry.dispose(),a.material.dispose(),this}clear(e,t,r,n){const i=e.getRenderTarget();for(let i=0;i<6;i++)e.setRenderTarget(this,i),e.clear(t,r,n);e.setRenderTarget(i)}}const uo=new On,ho=new On,po=new nn;class fo{constructor(e=new On(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,r,n){return this.normal.set(e,t,r),this.constant=n,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,r){const n=uo.subVectors(r,t).cross(ho.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(n,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const r=e.delta(uo),n=this.normal.dot(r);if(0===n)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;const i=-(e.start.dot(this.normal)+this.constant)/n;return i<0||i>1?null:t.copy(e.start).addScaledVector(r,i)}intersectsLine(e){const t=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return t<0&&r>0||r<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const r=t||po.getNormalMatrix(e),n=this.coplanarPoint(uo).applyMatrix4(e),i=this.normal.applyMatrix3(r).normalize();return this.constant=-n.dot(i),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const mo=new ri,go=new On;class Ao{constructor(e=new fo,t=new fo,r=new fo,n=new fo,i=new fo,s=new fo){this.planes=[e,t,r,n,i,s]}set(e,t,r,n,i,s){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(r),o[3].copy(n),o[4].copy(i),o[5].copy(s),this}copy(e){const t=this.planes;for(let r=0;r<6;r++)t[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e,t=Qr){const r=this.planes,n=e.elements,i=n[0],s=n[1],o=n[2],a=n[3],l=n[4],c=n[5],u=n[6],h=n[7],d=n[8],p=n[9],f=n[10],m=n[11],g=n[12],A=n[13],y=n[14],v=n[15];if(r[0].setComponents(a-i,h-l,m-d,v-g).normalize(),r[1].setComponents(a+i,h+l,m+d,v+g).normalize(),r[2].setComponents(a+s,h+c,m+p,v+A).normalize(),r[3].setComponents(a-s,h-c,m-p,v-A).normalize(),r[4].setComponents(a-o,h-u,m-f,v-y).normalize(),t===Qr)r[5].setComponents(a+o,h+u,m+f,v+y).normalize();else{if(t!==Vr)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);r[5].setComponents(o,u,f,y).normalize()}return this}intersectsObject(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),mo.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),mo.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(mo)}intersectsSprite(e){return mo.center.set(0,0,0),mo.radius=.7071067811865476,mo.applyMatrix4(e.matrixWorld),this.intersectsSphere(mo)}intersectsSphere(e){const t=this.planes,r=e.center,n=-e.radius;for(let e=0;e<6;e++)if(t[e].distanceToPoint(r)0?e.max.x:e.min.x,go.y=n.normal.y>0?e.max.y:e.min.y,go.z=n.normal.z>0?e.max.z:e.min.z,n.distanceToPoint(go)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let r=0;r<6;r++)if(t[r].distanceToPoint(e)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function yo(){let e=null,t=!1,r=null,n=null;function i(t,s){r(t,s),n=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==r&&(n=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(n),t=!1},setAnimationLoop:function(e){r=e},setContext:function(t){e=t}}}function vo(e){const t=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),t.get(e)},remove:function(r){r.isInterleavedBufferAttribute&&(r=r.data);const n=t.get(r);n&&(e.deleteBuffer(n.buffer),t.delete(r))},update:function(r,n){if(r.isInterleavedBufferAttribute&&(r=r.data),r.isGLBufferAttribute){const e=t.get(r);return void((!e||e.version 0\n\tvec4 plane;\n\t#ifdef ALPHA_TO_COVERAGE\n\t\tfloat distanceToPlane, distanceGradient;\n\t\tfloat clipOpacity = 1.0;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\tif ( clipOpacity == 0.0 ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tfloat unionClipOpacity = 1.0;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\t\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tclipOpacity *= 1.0 - unionClipOpacity;\n\t\t#endif\n\t\tdiffuseColor.a *= clipOpacity;\n\t\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tbool clipped = true;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tif ( clipped ) discard;\n\t\t#endif\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_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\n#ifdef USE_BATCHING_COLOR\n\tvec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );\n\tvColor.xyz *= batchingColor.xyz;\n#endif",common:"#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};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\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}\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}\nvec3 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} // validated",cube_uv_reflection_fragment:"#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_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\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",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n\tmat3 bm = mat3( batchingMatrix );\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n\ttransformedNormal = bm * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = bm * transformedTangent;\n\t#endif\n#endif\n#ifdef USE_INSTANCING\n\tmat3 im = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n\ttransformedNormal = im * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = im * transformedTangent;\n\t#endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"\nconst mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(\n\tvec3( 0.8224621, 0.177538, 0.0 ),\n\tvec3( 0.0331941, 0.9668058, 0.0 ),\n\tvec3( 0.0170827, 0.0723974, 0.9105199 )\n);\nconst mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.2249401, - 0.2249404, 0.0 ),\n\tvec3( - 0.0420569, 1.0420571, 0.0 ),\n\tvec3( - 0.0196376, - 0.0786361, 1.0982735 )\n);\nvec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );\n}\nvec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );\n}\nvec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferOETF( 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}",envmap_fragment:"#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, envMapRotation * 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",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform mat3 envMapRotation;\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",envmap_pars_fragment:"#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",envmap_pars_vertex:"#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",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * 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#ifdef 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, envMapRotation * 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\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif",envmap_vertex:"#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",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#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",fog_pars_fragment:"#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",gradientmap_pars_fragment:"#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}",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, 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 vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, 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",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\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\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif ( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\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, 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 vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\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 vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\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",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, 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",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"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 vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, 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",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\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 USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\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, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).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_DISPERSION\n\tmaterial.dispersion = dispersion;\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, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).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_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tif( material.anisotropy == 0.0 ) {\n\t\tanisotropyV = vec2( 1.0, 0.0 );\n\t} else {\n\t\tanisotropyV /= material.anisotropy;\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\n\t}\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\tfloat dispersion;\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\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\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}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\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 = F_Schlick( f0, f90, dotVH );\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\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.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\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\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}\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\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 vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\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 vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, 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 vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, 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( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, 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}",lights_fragment_begin:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n\tgeometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\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, geometryPosition, 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.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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, geometryPosition, 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.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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, 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.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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\t#if defined( USE_LIGHT_PROBES )\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\t#endif\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 ], geometryNormal );\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",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\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( geometryNormal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tgl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvFragDepth = 1.0 + gl_Position.w;\n\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\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\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\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",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphinstance_vertex:"#ifdef USE_INSTANCING_MORPH\n\tfloat morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\tfloat morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tmorphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n\t}\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS )\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",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_INSTANCING_MORPH\n\t\tuniform float morphTargetBaseInfluence;\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t#endif\n\tuniform sampler2DArray morphTargetsTexture;\n\tuniform ivec2 morphTargetsTextureSize;\n\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t}\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif",normal_fragment_begin:"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 *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 nonPerturbedNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).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( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#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",normal_pars_vertex:"#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",normal_vertex:"#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",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.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 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"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.;const float ShiftRight8 = 1. / 256.;\nconst float Inv255 = 1. / 255.;\nconst vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\nconst vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );\nconst vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );\nconst vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );\nvec4 packDepthToRGBA( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec4( 0., 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec4( 1., 1., 1., 1. );\n\tfloat vuf;\n\tfloat af = modf( v * PackFactors.a, vuf );\n\tfloat bf = modf( vuf * ShiftRight8, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );\n}\nvec3 packDepthToRGB( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec3( 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec3( 1., 1., 1. );\n\tfloat vuf;\n\tfloat bf = modf( v * PackFactors.b, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec3( vuf * Inv255, gf * PackUpscale, bf );\n}\nvec2 packDepthToRG( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec2( 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec2( 1., 1. );\n\tfloat vuf;\n\tfloat gf = modf( v * 256., vuf );\n\treturn vec2( vuf * Inv255, gf );\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors4 );\n}\nfloat unpackRGBToDepth( const in vec3 v ) {\n\treturn dot( v, UnpackFactors3 );\n}\nfloat unpackRGToDepth( const in vec2 v ) {\n\treturn v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;\n}\nvec4 pack2HalfToRGBA( const in 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( const in 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 depth, const in float near, const in float far ) {\n\treturn depth * ( 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 depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n\tmvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#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",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform 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 shadowIntensity;\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 shadowIntensity;\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 shadowIntensity;\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 shadowIntensity, 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 mix( 1.0, shadow, shadowIntensity );\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 shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tfloat shadow = 1.0;\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\t\n\t\tfloat lightToPositionLength = length( lightToPosition );\n\t\tif ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n\t\t\tfloat dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\t\tdp += shadowBias;\n\t\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\t\tshadow = (\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t\t) * ( 1.0 / 9.0 );\n\t\t\t#else\n\t\t\t\tshadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying 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 shadowIntensity;\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 shadowIntensity;\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 shadowIntensity;\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",shadowmap_vertex:"#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",shadowmask_pars_fragment:"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.shadowIntensity, 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.shadowIntensity, 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.shadowIntensity, 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}",skinbase_vertex:"#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",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tint size = textureSize( boneTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",skinning_vertex:"#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",skinnormal_vertex:"#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",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 CineonToneMapping( 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}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n\tvec3( 0.6274, 0.0691, 0.0164 ),\n\tvec3( 0.3293, 0.9195, 0.0880 ),\n\tvec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n\tvec3 x2 = x * x;\n\tvec3 x4 = x2 * x2;\n\treturn + 15.5 * x4 * x2\n\t\t- 40.14 * x4 * x\n\t\t+ 31.96 * x4\n\t\t- 6.868 * x2 * x\n\t\t+ 0.4298 * x2\n\t\t+ 0.1191 * x\n\t\t- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n\tconst mat3 AgXInsetMatrix = mat3(\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n\t);\n\tconst mat3 AgXOutsetMatrix = mat3(\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n\t);\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\n\tcolor *= toneMappingExposure;\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor = AgXInsetMatrix * color;\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n\tcolor = clamp( color, 0.0, 1.0 );\n\tcolor = agxDefaultContrastApprox( color );\n\tcolor = AgXOutsetMatrix * color;\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n\tcolor = clamp( color, 0.0, 1.0 );\n\treturn color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n\tconst float StartCompression = 0.8 - 0.04;\n\tconst float Desaturation = 0.15;\n\tcolor *= toneMappingExposure;\n\tfloat x = min( color.r, min( color.g, color.b ) );\n\tfloat offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n\tcolor -= offset;\n\tfloat peak = max( color.r, max( color.g, color.b ) );\n\tif ( peak < StartCompression ) return color;\n\tfloat d = 1. - StartCompression;\n\tfloat newPeak = 1. - d * d / ( peak + d - StartCompression );\n\tcolor *= newPeak / peak;\n\tfloat g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n\treturn mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#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, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#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\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\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 lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\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 dispersion, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec4 transmittedLight;\n\t\tvec3 transmittance;\n\t\t#ifdef USE_DISPERSION\n\t\t\tfloat halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n\t\t\tvec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n\t\t\tfor ( int i = 0; i < 3; i ++ ) {\n\t\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n\t\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\n\t\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\t\trefractionCoords += 1.0;\n\t\t\t\trefractionCoords /= 2.0;\n\t\t\n\t\t\t\tvec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n\t\t\t\ttransmittedLight[ i ] = transmissionSample[ i ];\n\t\t\t\ttransmittedLight.a += transmissionSample.a;\n\t\t\t\ttransmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n\t\t\t}\n\t\t\ttransmittedLight.a /= 3.0;\n\t\t\n\t\t#else\n\t\t\n\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\trefractionCoords += 1.0;\n\t\t\trefractionCoords /= 2.0;\n\t\t\ttransmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\t\ttransmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\t\n\t\t#endif\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#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_BATCHING\n\t\tworldPosition = batchingMatrix * worldPosition;\n\t#endif\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"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}",background_frag:"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 \n\t#include \n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#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;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, backgroundRotation * 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 \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"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 \n\t#include \n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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#elif DEPTH_PACKING == 3202\n\t\tgl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\n\t#elif DEPTH_PACKING == 3203\n\t\tgl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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, vLightMapUv );\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 \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_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 USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_DISPERSION\n\tuniform float dispersion;\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_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \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 + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\t#include \n\t#include \n\t#include \n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n}"},bo={common:{diffuse:{value:new es(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new nn},alphaMap:{value:null},alphaMapTransform:{value:new nn},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new nn}},envmap:{envMap:{value:null},envMapRotation:{value:new nn},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new nn}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new nn}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new nn},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new nn},normalScale:{value:new rn(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new nn},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new nn}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new nn}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new nn}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new es(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,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 es(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new nn},alphaTest:{value:0},uvTransform:{value:new nn}},sprite:{diffuse:{value:new es(16777215)},opacity:{value:1},center:{value:new rn(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new nn},alphaMap:{value:null},alphaMapTransform:{value:new nn},alphaTest:{value:0}}},wo={basic:{uniforms:$s([bo.common,bo.specularmap,bo.envmap,bo.aomap,bo.lightmap,bo.fog]),vertexShader:_o.meshbasic_vert,fragmentShader:_o.meshbasic_frag},lambert:{uniforms:$s([bo.common,bo.specularmap,bo.envmap,bo.aomap,bo.lightmap,bo.emissivemap,bo.bumpmap,bo.normalmap,bo.displacementmap,bo.fog,bo.lights,{emissive:{value:new es(0)}}]),vertexShader:_o.meshlambert_vert,fragmentShader:_o.meshlambert_frag},phong:{uniforms:$s([bo.common,bo.specularmap,bo.envmap,bo.aomap,bo.lightmap,bo.emissivemap,bo.bumpmap,bo.normalmap,bo.displacementmap,bo.fog,bo.lights,{emissive:{value:new es(0)},specular:{value:new es(1118481)},shininess:{value:30}}]),vertexShader:_o.meshphong_vert,fragmentShader:_o.meshphong_frag},standard:{uniforms:$s([bo.common,bo.envmap,bo.aomap,bo.lightmap,bo.emissivemap,bo.bumpmap,bo.normalmap,bo.displacementmap,bo.roughnessmap,bo.metalnessmap,bo.fog,bo.lights,{emissive:{value:new es(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:_o.meshphysical_vert,fragmentShader:_o.meshphysical_frag},toon:{uniforms:$s([bo.common,bo.aomap,bo.lightmap,bo.emissivemap,bo.bumpmap,bo.normalmap,bo.displacementmap,bo.gradientmap,bo.fog,bo.lights,{emissive:{value:new es(0)}}]),vertexShader:_o.meshtoon_vert,fragmentShader:_o.meshtoon_frag},matcap:{uniforms:$s([bo.common,bo.bumpmap,bo.normalmap,bo.displacementmap,bo.fog,{matcap:{value:null}}]),vertexShader:_o.meshmatcap_vert,fragmentShader:_o.meshmatcap_frag},points:{uniforms:$s([bo.points,bo.fog]),vertexShader:_o.points_vert,fragmentShader:_o.points_frag},dashed:{uniforms:$s([bo.common,bo.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:_o.linedashed_vert,fragmentShader:_o.linedashed_frag},depth:{uniforms:$s([bo.common,bo.displacementmap]),vertexShader:_o.depth_vert,fragmentShader:_o.depth_frag},normal:{uniforms:$s([bo.common,bo.bumpmap,bo.normalmap,bo.displacementmap,{opacity:{value:1}}]),vertexShader:_o.meshnormal_vert,fragmentShader:_o.meshnormal_frag},sprite:{uniforms:$s([bo.sprite,bo.fog]),vertexShader:_o.sprite_vert,fragmentShader:_o.sprite_frag},background:{uniforms:{uvTransform:{value:new nn},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:_o.background_vert,fragmentShader:_o.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new nn}},vertexShader:_o.backgroundCube_vert,fragmentShader:_o.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:_o.cube_vert,fragmentShader:_o.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:_o.equirect_vert,fragmentShader:_o.equirect_frag},distanceRGBA:{uniforms:$s([bo.common,bo.displacementmap,{referencePosition:{value:new On},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:_o.distanceRGBA_vert,fragmentShader:_o.distanceRGBA_frag},shadow:{uniforms:$s([bo.lights,bo.fog,{color:{value:new es(0)},opacity:{value:1}}]),vertexShader:_o.shadow_vert,fragmentShader:_o.shadow_frag}};wo.physical={uniforms:$s([wo.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new nn},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new nn},clearcoatNormalScale:{value:new rn(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new nn},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new nn},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new nn},sheen:{value:0},sheenColor:{value:new es(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new nn},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new nn},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new nn},transmissionSamplerSize:{value:new rn},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new nn},attenuationDistance:{value:0},attenuationColor:{value:new es(0)},specularColor:{value:new es(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new nn},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new nn},anisotropyVector:{value:new rn},anisotropyMap:{value:null},anisotropyMapTransform:{value:new nn}}]),vertexShader:_o.meshphysical_vert,fragmentShader:_o.meshphysical_frag};const Eo={r:0,b:0,g:0},Mo=new _i,So=new hi;function Co(e,t,r,n,i,s,o){const a=new es(0);let l,c,u=!0===s?0:1,h=null,d=0,p=null;function g(e){let n=!0===e.isScene?e.background:null;return n&&n.isTexture&&(n=(e.backgroundBlurriness>0?r:t).get(n)),n}function A(t,r){t.getRGB(Eo,Js(e)),n.buffers.color.setClear(Eo.r,Eo.g,Eo.b,r,o)}return{getClearColor:function(){return a},setClearColor:function(e,t=1){a.set(e),u=t,A(a,u)},getClearAlpha:function(){return u},setClearAlpha:function(e){u=e,A(a,u)},render:function(t){let r=!1;const i=g(t);null===i?A(a,u):i&&i.isColor&&(A(i,1),r=!0);const s=e.xr.getEnvironmentBlendMode();"additive"===s?n.buffers.color.setClear(0,0,0,1,o):"alpha-blend"===s&&n.buffers.color.setClear(0,0,0,0,o),(e.autoClear||r)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil))},addToRenderList:function(t,r){const n=g(r);n&&(n.isCubeTexture||n.mapping===me)?(void 0===c&&(c=new Ws(new Xs(1,1,1),new eo({name:"BackgroundCubeMaterial",uniforms:Ks(wo.backgroundCube.uniforms),vertexShader:wo.backgroundCube.vertexShader,fragmentShader:wo.backgroundCube.fragmentShader,side:m,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(e,t,r){this.matrixWorld.copyPosition(r.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(c)),Mo.copy(r.backgroundRotation),Mo.x*=-1,Mo.y*=-1,Mo.z*=-1,n.isCubeTexture&&!1===n.isRenderTargetTexture&&(Mo.y*=-1,Mo.z*=-1),c.material.uniforms.envMap.value=n,c.material.uniforms.flipEnvMap.value=n.isCubeTexture&&!1===n.isRenderTargetTexture?-1:1,c.material.uniforms.backgroundBlurriness.value=r.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=r.backgroundIntensity,c.material.uniforms.backgroundRotation.value.setFromMatrix4(So.makeRotationFromEuler(Mo)),c.material.toneMapped=An.getTransfer(n.colorSpace)!==ir,h===n&&d===n.version&&p===e.toneMapping||(c.material.needsUpdate=!0,h=n,d=n.version,p=e.toneMapping),c.layers.enableAll(),t.unshift(c,c.geometry,c.material,0,0,null)):n&&n.isTexture&&(void 0===l&&(l=new Ws(new xo(2,2),new eo({name:"BackgroundMaterial",uniforms:Ks(wo.background.uniforms),vertexShader:wo.background.vertexShader,fragmentShader:wo.background.fragmentShader,side:f,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(l)),l.material.uniforms.t2D.value=n,l.material.uniforms.backgroundIntensity.value=r.backgroundIntensity,l.material.toneMapped=An.getTransfer(n.colorSpace)!==ir,!0===n.matrixAutoUpdate&&n.updateMatrix(),l.material.uniforms.uvTransform.value.copy(n.matrix),h===n&&d===n.version&&p===e.toneMapping||(l.material.needsUpdate=!0,h=n,d=n.version,p=e.toneMapping),l.layers.enableAll(),t.unshift(l,l.geometry,l.material,0,0,null))}}}function To(e,t){const r=e.getParameter(e.MAX_VERTEX_ATTRIBS),n={},i=c(null);let s=i,o=!1;function a(t){return e.bindVertexArray(t)}function l(t){return e.deleteVertexArray(t)}function c(e){const t=[],n=[],i=[];for(let e=0;e=0){const r=i[t];let n=o[t];if(void 0===n&&("instanceMatrix"===t&&e.instanceMatrix&&(n=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(n=e.instanceColor)),void 0===r)return!0;if(r.attribute!==n)return!0;if(n&&r.data!==n.data)return!0;a++}return s.attributesNum!==a||s.index!==n}(r,m,l,g),A&&function(e,t,r,n){const i={},o=t.attributes;let a=0;const l=r.getAttributes();for(const t in l)if(l[t].location>=0){let r=o[t];void 0===r&&("instanceMatrix"===t&&e.instanceMatrix&&(r=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(r=e.instanceColor));const n={};n.attribute=r,r&&r.data&&(n.data=r.data),i[t]=n,a++}s.attributes=i,s.attributesNum=a,s.index=n}(r,m,l,g),null!==g&&t.update(g,e.ELEMENT_ARRAY_BUFFER),(A||o)&&(o=!1,function(r,n,i,s){u();const o=s.attributes,a=i.getAttributes(),l=n.defaultAttributeValues;for(const n in a){const i=a[n];if(i.location>=0){let a=o[n];if(void 0===a&&("instanceMatrix"===n&&r.instanceMatrix&&(a=r.instanceMatrix),"instanceColor"===n&&r.instanceColor&&(a=r.instanceColor)),void 0!==a){const n=a.normalized,o=a.itemSize,l=t.get(a);if(void 0===l)continue;const c=l.buffer,u=l.type,p=l.bytesPerElement,m=u===e.INT||u===e.UNSIGNED_INT||a.gpuType===Le;if(a.isInterleavedBufferAttribute){const t=a.data,l=t.stride,g=a.offset;if(t.isInstancedInterleavedBuffer){for(let e=0;e0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let o=void 0!==r.precision?r.precision:"highp";const a=s(o);a!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",a,"instead."),o=a);const l=!0===r.logarithmicDepthBuffer,c=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),u=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS);return{isWebGL2:!0,getMaxAnisotropy:function(){if(void 0!==i)return i;if(!0===t.has("EXT_texture_filter_anisotropic")){const r=t.get("EXT_texture_filter_anisotropic");i=e.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i},getMaxPrecision:s,textureFormatReadable:function(t){return t===Ve||n.convert(t)===e.getParameter(e.IMPLEMENTATION_COLOR_READ_FORMAT)},textureTypeReadable:function(r){const i=r===Ne&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return!(r!==Ie&&n.convert(r)!==e.getParameter(e.IMPLEMENTATION_COLOR_READ_TYPE)&&r!==Oe&&!i)},precision:o,logarithmicDepthBuffer:l,maxTextures:c,maxVertexTextures:u,maxTextureSize:e.getParameter(e.MAX_TEXTURE_SIZE),maxCubemapSize:e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),maxAttributes:e.getParameter(e.MAX_VERTEX_ATTRIBS),maxVertexUniforms:e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),maxVaryings:e.getParameter(e.MAX_VARYING_VECTORS),maxFragmentUniforms:e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),vertexTextures:u>0,maxSamples:e.getParameter(e.MAX_SAMPLES)}}function Bo(e){const t=this;let r=null,n=0,i=!1,s=!1;const o=new fo,a=new nn,l={value:null,needsUpdate:!1};function c(e,r,n,i){const s=null!==e?e.length:0;let c=null;if(0!==s){if(c=l.value,!0!==i||null===c){const t=n+4*s,i=r.matrixWorldInverse;a.getNormalMatrix(i),(null===c||c.length0),t.numPlanes=n,t.numIntersection=0);else{const e=s?0:n,t=4*e;let i=f.clippingState||null;l.value=i,i=c(h,a,t,u);for(let e=0;e!==t;++e)i[e]=r[e];f.clippingState=i,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=e}}}function Po(e){let t=new WeakMap;function r(e,t){return t===pe?e.mapping=he:t===fe&&(e.mapping=de),e}function n(e){const r=e.target;r.removeEventListener("dispose",n);const i=t.get(r);void 0!==i&&(t.delete(r),i.dispose())}return{get:function(i){if(i&&i.isTexture){const s=i.mapping;if(s===pe||s===fe){if(t.has(i))return r(t.get(i).texture,i.mapping);{const s=i.image;if(s&&s.height>0){const o=new co(s.height);return o.fromEquirectangularTexture(e,i),t.set(i,o),i.addEventListener("dispose",n),r(o.texture,i.mapping)}return null}}}return i},dispose:function(){t=new WeakMap}}}class Lo extends to{constructor(e=-1,t=1,r=1,n=-1,i=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=r,this.bottom=n,this.near=i,this.far=s,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,r,n,i,s){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=e,this.view.fullHeight=t,this.view.offsetX=r,this.view.offsetY=n,this.view.width=i,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,n=(this.top+this.bottom)/2;let i=r-e,s=r+e,o=n+t,a=n-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=e*this.view.offsetX,s=i+e*this.view.width,o-=t*this.view.offsetY,a=o-t*this.view.height}this.projectionMatrix.makeOrthographic(i,s,o,a,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}const Do=[.125,.215,.35,.446,.526,.582],Oo=new Lo,No=new es;let Uo=null,Fo=0,ko=0,zo=!1;const Go=(1+Math.sqrt(5))/2,Qo=1/Go,Vo=[new On(-Go,Qo,0),new On(Go,Qo,0),new On(-Qo,0,Go),new On(Qo,0,Go),new On(0,Go,-Qo),new On(0,Go,Qo),new On(-1,1,-1),new On(1,1,-1),new On(-1,1,1),new On(1,1,1)];class Ho{constructor(e){this._renderer=e,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(e,t=0,r=.1,n=100){Uo=this._renderer.getRenderTarget(),Fo=this._renderer.getActiveCubeFace(),ko=this._renderer.getActiveMipmapLevel(),zo=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const i=this._allocateTargets();return i.depthBuffer=!0,this._sceneToCubeUV(e,r,n,i),t>0&&this._blur(i,0,0,t),this._applyPMREM(i),this._cleanup(i),i}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=Yo(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=Wo(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;ee-4?a=Do[o-e+4-1]:0===o&&(a=0),n.push(a);const l=1/(s-2),c=-l,u=1+l,h=[c,c,u,c,u,u,c,c,u,u,c,u],d=6,p=6,f=3,m=2,g=1,A=new Float32Array(f*p*d),y=new Float32Array(m*p*d),v=new Float32Array(g*p*d);for(let e=0;e2?0:-1,n=[t,r,0,t+2/3,r,0,t+2/3,r+1,0,t,r,0,t+2/3,r+1,0,t,r+1,0];A.set(n,f*p*e),y.set(h,m*p*e);const i=[e,e,e,e,e,e];v.set(i,g*p*e)}const x=new Is;x.setAttribute("position",new ds(A,f)),x.setAttribute("uv",new ds(y,m)),x.setAttribute("faceIndex",new ds(v,g)),t.push(x),i>4&&i--}return{lodPlanes:t,sizeLods:r,sigmas:n}}(n)),this._blurMaterial=function(e,t,r){const n=new Float32Array(20),i=new On(0,1,0);return new eo({name:"SphericalGaussianBlur",defines:{n:20,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/r,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:"\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",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 \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:A,depthTest:!1,depthWrite:!1})}(n,e,t)}return n}_compileMaterial(e){const t=new Ws(this._lodPlanes[0],e);this._renderer.compile(t,Oo)}_sceneToCubeUV(e,t,r,n){const i=new so(90,1,t,r),s=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],a=this._renderer,l=a.autoClear,c=a.toneMapping;a.getClearColor(No),a.toneMapping=ee,a.autoClear=!1;const u=new is({name:"PMREM.Background",side:m,depthWrite:!1,depthTest:!1}),h=new Ws(new Xs,u);let d=!1;const p=e.background;p?p.isColor&&(u.color.copy(p),e.background=null,d=!0):(u.color.copy(No),d=!0);for(let t=0;t<6;t++){const r=t%3;0===r?(i.up.set(0,s[t],0),i.lookAt(o[t],0,0)):1===r?(i.up.set(0,0,s[t]),i.lookAt(0,o[t],0)):(i.up.set(0,s[t],0),i.lookAt(0,0,o[t]));const l=this._cubeSize;qo(n,r*l,t>2?l:0,l,l),a.setRenderTarget(n),d&&a.render(h,i),a.render(e,i)}h.geometry.dispose(),h.material.dispose(),a.toneMapping=c,a.autoClear=l,e.background=p}_textureToCubeUV(e,t){const r=this._renderer,n=e.mapping===he||e.mapping===de;n?(null===this._cubemapMaterial&&(this._cubemapMaterial=Yo()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=Wo());const i=n?this._cubemapMaterial:this._equirectMaterial,s=new Ws(this._lodPlanes[0],i);i.uniforms.envMap.value=e;const o=this._cubeSize;qo(t,0,0,3*o,2*o),r.setRenderTarget(t),r.render(s,Oo)}_applyPMREM(e){const t=this._renderer,r=t.autoClear;t.autoClear=!1;const n=this._lodPlanes.length;for(let t=1;t20&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);const m=[];let g=0;for(let e=0;e<20;++e){const t=e/p,r=Math.exp(-t*t/2);m.push(r),0===e?g+=r:eA-4?n-A+4:0),4*(this._cubeSize-y),3*y,2*y),a.setRenderTarget(t),a.render(c,Oo)}}function jo(e,t,r){const n=new In(e,t,r);return n.texture.mapping=me,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function qo(e,t,r,n,i){e.viewport.set(t,r,n,i),e.scissor.set(t,r,n,i)}function Wo(){return new eo({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:"\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",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 \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:A,depthTest:!1,depthWrite:!1})}function Yo(){return new eo({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:"\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",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:A,depthTest:!1,depthWrite:!1})}function Xo(e){let t=new WeakMap,r=null;function n(e){const r=e.target;r.removeEventListener("dispose",n);const i=t.get(r);void 0!==i&&(t.delete(r),i.dispose())}return{get:function(i){if(i&&i.isTexture){const s=i.mapping,o=s===pe||s===fe,a=s===he||s===de;if(o||a){let s=t.get(i);const l=void 0!==s?s.texture.pmremVersion:0;if(i.isRenderTargetTexture&&i.pmremVersion!==l)return null===r&&(r=new Ho(e)),s=o?r.fromEquirectangular(i,s):r.fromCubemap(i,s),s.texture.pmremVersion=i.pmremVersion,t.set(i,s),s.texture;if(void 0!==s)return s.texture;{const l=i.image;return o&&l&&l.height>0||a&&l&&function(e){let t=0;for(let r=0;r<6;r++)void 0!==e[r]&&t++;return 6===t}(l)?(null===r&&(r=new Ho(e)),s=o?r.fromEquirectangular(i):r.fromCubemap(i),s.texture.pmremVersion=i.pmremVersion,t.set(i,s),i.addEventListener("dispose",n),s.texture):null}}}return i},dispose:function(){t=new WeakMap,null!==r&&(r.dispose(),r=null)}}}function Ko(e){const t={};function r(r){if(void 0!==t[r])return t[r];let n;switch(r){case"WEBGL_depth_texture":n=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=e.getExtension(r)}return t[r]=n,n}return{has:function(e){return null!==r(e)},init:function(){r("EXT_color_buffer_float"),r("WEBGL_clip_cull_distance"),r("OES_texture_float_linear"),r("EXT_color_buffer_half_float"),r("WEBGL_multisampled_render_to_texture"),r("WEBGL_render_shared_exponent")},get:function(e){const t=r(e);return null===t&&dn("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function $o(e,t,r,n){const i={},s=new WeakMap;function o(e){const a=e.target;null!==a.index&&t.remove(a.index);for(const e in a.attributes)t.remove(a.attributes[e]);for(const e in a.morphAttributes){const r=a.morphAttributes[e];for(let e=0,n=r.length;et.maxTextureSize&&(x=Math.ceil(v/t.maxTextureSize),v=t.maxTextureSize);const _=new Float32Array(v*x*4*u),b=new Rn(_,v,x,u);b.type=Oe,b.needsUpdate=!0;const w=4*y;for(let M=0;M0)return e;const i=t*r;let s=la[i];if(void 0===s&&(s=new Float32Array(i),la[i]=s),0!==t){n.toArray(s,0);for(let n=1,i=0;n!==t;++n)i+=r,e[n].toArray(s,i)}return s}function fa(e,t){if(e.length!==t.length)return!1;for(let r=0,n=e.length;r":" "} ${i}: ${r[e]}`)}return n.join("\n")}(e.getShaderSource(t),n)}return i}function hl(e,t){const r=function(e){const t=An.getPrimaries(An.workingColorSpace),r=An.getPrimaries(e);let n;switch(t===r?n="":t===or&&r===sr?n="LinearDisplayP3ToLinearSRGB":t===sr&&r===or&&(n="LinearSRGBToLinearDisplayP3"),e){case er:case rr:return[n,"LinearTransferOETF"];case Zt:case tr:return[n,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",e),[n,"LinearTransferOETF"]}}(t);return`vec4 ${e}( vec4 value ) { return ${r[0]}( ${r[1]}( value ) ); }`}function dl(e,t){let r;switch(t){case te:r="Linear";break;case re:r="Reinhard";break;case ne:r="Cineon";break;case ie:r="ACESFilmic";break;case oe:r="AgX";break;case ae:r="Neutral";break;case se:r="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),r="Linear"}return"vec3 "+e+"( vec3 color ) { return "+r+"ToneMapping( color ); }"}const pl=new On;function fl(e){return""!==e}function ml(e,t){const r=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,r).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function gl(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const Al=/^[ \t]*#include +<([\w\d./]+)>/gm;function yl(e){return e.replace(Al,xl)}const vl=new Map;function xl(e,t){let r=_o[t];if(void 0===r){const e=vl.get(t);if(void 0===e)throw new Error("Can not resolve #include <"+t+">");r=_o[e],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,e)}return yl(r)}const _l=/#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 bl(e){return e.replace(_l,wl)}function wl(e,t,r,n){let i="";for(let e=parseInt(t);e0&&(v+="\n"),x=["#define SHADER_TYPE "+r.shaderType,"#define SHADER_NAME "+r.shaderName,A].filter(fl).join("\n"),x.length>0&&(x+="\n")):(v=[El(r),"#define SHADER_TYPE "+r.shaderType,"#define SHADER_NAME "+r.shaderName,A,r.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",r.batching?"#define USE_BATCHING":"",r.batchingColor?"#define USE_BATCHING_COLOR":"",r.instancing?"#define USE_INSTANCING":"",r.instancingColor?"#define USE_INSTANCING_COLOR":"",r.instancingMorph?"#define USE_INSTANCING_MORPH":"",r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+u:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",r.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",r.displacementMap?"#define USE_DISPLACEMENTMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.anisotropy?"#define USE_ANISOTROPY":"",r.anisotropyMap?"#define USE_ANISOTROPYMAP":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",r.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",r.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.alphaHash?"#define USE_ALPHAHASH":"",r.transmission?"#define USE_TRANSMISSION":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.thicknessMap?"#define USE_THICKNESSMAP":"",r.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",r.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",r.mapUv?"#define MAP_UV "+r.mapUv:"",r.alphaMapUv?"#define ALPHAMAP_UV "+r.alphaMapUv:"",r.lightMapUv?"#define LIGHTMAP_UV "+r.lightMapUv:"",r.aoMapUv?"#define AOMAP_UV "+r.aoMapUv:"",r.emissiveMapUv?"#define EMISSIVEMAP_UV "+r.emissiveMapUv:"",r.bumpMapUv?"#define BUMPMAP_UV "+r.bumpMapUv:"",r.normalMapUv?"#define NORMALMAP_UV "+r.normalMapUv:"",r.displacementMapUv?"#define DISPLACEMENTMAP_UV "+r.displacementMapUv:"",r.metalnessMapUv?"#define METALNESSMAP_UV "+r.metalnessMapUv:"",r.roughnessMapUv?"#define ROUGHNESSMAP_UV "+r.roughnessMapUv:"",r.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+r.anisotropyMapUv:"",r.clearcoatMapUv?"#define CLEARCOATMAP_UV "+r.clearcoatMapUv:"",r.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+r.clearcoatNormalMapUv:"",r.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+r.clearcoatRoughnessMapUv:"",r.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+r.iridescenceMapUv:"",r.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+r.iridescenceThicknessMapUv:"",r.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+r.sheenColorMapUv:"",r.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+r.sheenRoughnessMapUv:"",r.specularMapUv?"#define SPECULARMAP_UV "+r.specularMapUv:"",r.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+r.specularColorMapUv:"",r.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+r.specularIntensityMapUv:"",r.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+r.transmissionMapUv:"",r.thicknessMapUv?"#define THICKNESSMAP_UV "+r.thicknessMapUv:"",r.vertexTangents&&!1===r.flatShading?"#define USE_TANGENT":"",r.vertexColors?"#define USE_COLOR":"",r.vertexAlphas?"#define USE_COLOR_ALPHA":"",r.vertexUv1s?"#define USE_UV1":"",r.vertexUv2s?"#define USE_UV2":"",r.vertexUv3s?"#define USE_UV3":"",r.pointsUvs?"#define USE_POINTS_UV":"",r.flatShading?"#define FLAT_SHADED":"",r.skinning?"#define USE_SKINNING":"",r.morphTargets?"#define USE_MORPHTARGETS":"",r.morphNormals&&!1===r.flatShading?"#define USE_MORPHNORMALS":"",r.morphColors?"#define USE_MORPHCOLORS":"",r.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+r.morphTextureStride:"",r.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+r.morphTargetsCount:"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+l:"",r.sizeAttenuation?"#define USE_SIZEATTENUATION":"",r.numLightProbes>0?"#define USE_LIGHT_PROBES":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","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","#ifdef USE_INSTANCING_MORPH","\tuniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","\tattribute vec2 uv1;","#endif","#ifdef USE_UV2","\tattribute vec2 uv2;","#endif","#ifdef USE_UV3","\tattribute vec2 uv3;","#endif","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(fl).join("\n"),x=[El(r),"#define SHADER_TYPE "+r.shaderType,"#define SHADER_NAME "+r.shaderName,A,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",r.map?"#define USE_MAP":"",r.matcap?"#define USE_MATCAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+c:"",r.envMap?"#define "+u:"",r.envMap?"#define "+f:"",m?"#define CUBEUV_TEXEL_WIDTH "+m.texelWidth:"",m?"#define CUBEUV_TEXEL_HEIGHT "+m.texelHeight:"",m?"#define CUBEUV_MAX_MIP "+m.maxMip+".0":"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",r.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.anisotropy?"#define USE_ANISOTROPY":"",r.anisotropyMap?"#define USE_ANISOTROPYMAP":"",r.clearcoat?"#define USE_CLEARCOAT":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.dispersion?"#define USE_DISPERSION":"",r.iridescence?"#define USE_IRIDESCENCE":"",r.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",r.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",r.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.alphaTest?"#define USE_ALPHATEST":"",r.alphaHash?"#define USE_ALPHAHASH":"",r.sheen?"#define USE_SHEEN":"",r.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",r.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",r.transmission?"#define USE_TRANSMISSION":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.thicknessMap?"#define USE_THICKNESSMAP":"",r.vertexTangents&&!1===r.flatShading?"#define USE_TANGENT":"",r.vertexColors||r.instancingColor||r.batchingColor?"#define USE_COLOR":"",r.vertexAlphas?"#define USE_COLOR_ALPHA":"",r.vertexUv1s?"#define USE_UV1":"",r.vertexUv2s?"#define USE_UV2":"",r.vertexUv3s?"#define USE_UV3":"",r.pointsUvs?"#define USE_POINTS_UV":"",r.gradientMap?"#define USE_GRADIENTMAP":"",r.flatShading?"#define FLAT_SHADED":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+l:"",r.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",r.numLightProbes>0?"#define USE_LIGHT_PROBES":"",r.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",r.toneMapping!==ee?"#define TONE_MAPPING":"",r.toneMapping!==ee?_o.tonemapping_pars_fragment:"",r.toneMapping!==ee?dl("toneMapping",r.toneMapping):"",r.dithering?"#define DITHERING":"",r.opaque?"#define OPAQUE":"",_o.colorspace_pars_fragment,hl("linearToOutputTexel",r.outputColorSpace),(An.getLuminanceCoefficients(pl),["float luminance( const in vec3 rgb ) {",`\tconst vec3 weights = vec3( ${pl.x.toFixed(4)}, ${pl.y.toFixed(4)}, ${pl.z.toFixed(4)} );`,"\treturn dot( weights, rgb );","}"].join("\n")),r.useDepthPacking?"#define DEPTH_PACKING "+r.depthPacking:"","\n"].filter(fl).join("\n")),o=yl(o),o=ml(o,r),o=gl(o,r),a=yl(a),a=ml(a,r),a=gl(a,r),o=bl(o),a=bl(a),!0!==r.isRawShaderMaterial&&(_="#version 300 es\n",v=[g,"#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+v,x=["#define varying in",r.glslVersion===Gr?"":"layout(location = 0) out highp vec4 pc_fragColor;",r.glslVersion===Gr?"":"#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"+x);const b=_+v+o,w=_+x+a,E=ll(i,i.VERTEX_SHADER,b),M=ll(i,i.FRAGMENT_SHADER,w);function S(t){if(e.debug.checkShaderErrors){const r=i.getProgramInfoLog(y).trim(),n=i.getShaderInfoLog(E).trim(),s=i.getShaderInfoLog(M).trim();let o=!0,a=!0;if(!1===i.getProgramParameter(y,i.LINK_STATUS))if(o=!1,"function"==typeof e.debug.onShaderError)e.debug.onShaderError(i,y,E,M);else{const e=ul(i,E,"vertex"),n=ul(i,M,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(y,i.VALIDATE_STATUS)+"\n\nMaterial Name: "+t.name+"\nMaterial Type: "+t.type+"\n\nProgram Info Log: "+r+"\n"+e+"\n"+n)}else""!==r?console.warn("THREE.WebGLProgram: Program Info Log:",r):""!==n&&""!==s||(a=!1);a&&(t.diagnostics={runnable:o,programLog:r,vertexShader:{log:n,prefix:v},fragmentShader:{log:s,prefix:x}})}i.deleteShader(E),i.deleteShader(M),C=new al(i,y),T=function(e,t){const r={},n=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let i=0;i0,X=s.clearcoat>0,K=s.dispersion>0,$=s.iridescence>0,J=s.sheen>0,Z=s.transmission>0,te=Y&&!!s.anisotropyMap,re=X&&!!s.clearcoatMap,ne=X&&!!s.clearcoatNormalMap,ie=X&&!!s.clearcoatRoughnessMap,se=$&&!!s.iridescenceMap,oe=$&&!!s.iridescenceThicknessMap,ae=J&&!!s.sheenColorMap,le=J&&!!s.sheenRoughnessMap,ce=!!s.specularMap,ue=!!s.specularColorMap,he=!!s.specularIntensityMap,de=Z&&!!s.transmissionMap,pe=Z&&!!s.thicknessMap,fe=!!s.gradientMap,ge=!!s.alphaMap,Ae=s.alphaTest>0,ye=!!s.alphaHash,ve=!!s.extensions;let xe=ee;s.toneMapped&&(null!==D&&!0!==D.isXRRenderTarget||(xe=e.toneMapping));const _e={shaderID:S,shaderType:s.type,shaderName:s.name,vertexShader:I,fragmentShader:R,defines:s.defines,customVertexShaderID:B,customFragmentShaderID:P,isRawShaderMaterial:!0===s.isRawShaderMaterial,glslVersion:s.glslVersion,precision:p,batching:N,batchingColor:N&&null!==x._colorsTexture,instancing:O,instancingColor:O&&null!==x.instanceColor,instancingMorph:O&&null!==x.morphTexture,supportsVertexTextures:d,outputColorSpace:null===D?e.outputColorSpace:!0===D.isXRRenderTarget?D.texture.colorSpace:er,alphaToCoverage:!!s.alphaToCoverage,map:U,matcap:F,envMap:k,envMapMode:k&&E.mapping,envMapCubeUVHeight:M,aoMap:z,lightMap:G,bumpMap:Q,normalMap:V,displacementMap:d&&H,emissiveMap:j,normalMapObjectSpace:V&&s.normalMapType===$t,normalMapTangentSpace:V&&s.normalMapType===Kt,metalnessMap:q,roughnessMap:W,anisotropy:Y,anisotropyMap:te,clearcoat:X,clearcoatMap:re,clearcoatNormalMap:ne,clearcoatRoughnessMap:ie,dispersion:K,iridescence:$,iridescenceMap:se,iridescenceThicknessMap:oe,sheen:J,sheenColorMap:ae,sheenRoughnessMap:le,specularMap:ce,specularColorMap:ue,specularIntensityMap:he,transmission:Z,transmissionMap:de,thicknessMap:pe,gradientMap:fe,opaque:!1===s.transparent&&s.blending===y&&!1===s.alphaToCoverage,alphaMap:ge,alphaTest:Ae,alphaHash:ye,combine:s.combine,mapUv:U&&A(s.map.channel),aoMapUv:z&&A(s.aoMap.channel),lightMapUv:G&&A(s.lightMap.channel),bumpMapUv:Q&&A(s.bumpMap.channel),normalMapUv:V&&A(s.normalMap.channel),displacementMapUv:H&&A(s.displacementMap.channel),emissiveMapUv:j&&A(s.emissiveMap.channel),metalnessMapUv:q&&A(s.metalnessMap.channel),roughnessMapUv:W&&A(s.roughnessMap.channel),anisotropyMapUv:te&&A(s.anisotropyMap.channel),clearcoatMapUv:re&&A(s.clearcoatMap.channel),clearcoatNormalMapUv:ne&&A(s.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ie&&A(s.clearcoatRoughnessMap.channel),iridescenceMapUv:se&&A(s.iridescenceMap.channel),iridescenceThicknessMapUv:oe&&A(s.iridescenceThicknessMap.channel),sheenColorMapUv:ae&&A(s.sheenColorMap.channel),sheenRoughnessMapUv:le&&A(s.sheenRoughnessMap.channel),specularMapUv:ce&&A(s.specularMap.channel),specularColorMapUv:ue&&A(s.specularColorMap.channel),specularIntensityMapUv:he&&A(s.specularIntensityMap.channel),transmissionMapUv:de&&A(s.transmissionMap.channel),thicknessMapUv:pe&&A(s.thicknessMap.channel),alphaMapUv:ge&&A(s.alphaMap.channel),vertexTangents:!!b.attributes.tangent&&(V||Y),vertexColors:s.vertexColors,vertexAlphas:!0===s.vertexColors&&!!b.attributes.color&&4===b.attributes.color.itemSize,pointsUvs:!0===x.isPoints&&!!b.attributes.uv&&(U||ge),fog:!!_,useFog:!0===s.fog,fogExp2:!!_&&_.isFogExp2,flatShading:!0===s.flatShading,sizeAttenuation:!0===s.sizeAttenuation,logarithmicDepthBuffer:h,skinning:!0===x.isSkinnedMesh,morphTargets:void 0!==b.morphAttributes.position,morphNormals:void 0!==b.morphAttributes.normal,morphColors:void 0!==b.morphAttributes.color,morphTargetsCount:T,morphTextureStride:L,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numSpotLightMaps:a.spotLightMap.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numDirLightShadows:a.directionalShadowMap.length,numPointLightShadows:a.pointShadowMap.length,numSpotLightShadows:a.spotShadowMap.length,numSpotLightShadowsWithMaps:a.numSpotLightShadowsWithMaps,numLightProbes:a.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:s.dithering,shadowMapEnabled:e.shadowMap.enabled&&u.length>0,shadowMapType:e.shadowMap.type,toneMapping:xe,decodeVideoTexture:U&&!0===s.map.isVideoTexture&&An.getTransfer(s.map.colorSpace)===ir,premultipliedAlpha:s.premultipliedAlpha,doubleSided:s.side===g,flipSided:s.side===m,useDepthPacking:s.depthPacking>=0,depthPacking:s.depthPacking||0,index0AttributeName:s.index0AttributeName,extensionClipCullDistance:ve&&!0===s.extensions.clipCullDistance&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(ve&&!0===s.extensions.multiDraw||N)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:s.customProgramCacheKey()};return _e.vertexUv1s=c.has(1),_e.vertexUv2s=c.has(2),_e.vertexUv3s=c.has(3),c.clear(),_e},getProgramCacheKey:function(t){const r=[];if(t.shaderID?r.push(t.shaderID):(r.push(t.customVertexShaderID),r.push(t.customFragmentShaderID)),void 0!==t.defines)for(const e in t.defines)r.push(e),r.push(t.defines[e]);return!1===t.isRawShaderMaterial&&(function(e,t){e.push(t.precision),e.push(t.outputColorSpace),e.push(t.envMapMode),e.push(t.envMapCubeUVHeight),e.push(t.mapUv),e.push(t.alphaMapUv),e.push(t.lightMapUv),e.push(t.aoMapUv),e.push(t.bumpMapUv),e.push(t.normalMapUv),e.push(t.displacementMapUv),e.push(t.emissiveMapUv),e.push(t.metalnessMapUv),e.push(t.roughnessMapUv),e.push(t.anisotropyMapUv),e.push(t.clearcoatMapUv),e.push(t.clearcoatNormalMapUv),e.push(t.clearcoatRoughnessMapUv),e.push(t.iridescenceMapUv),e.push(t.iridescenceThicknessMapUv),e.push(t.sheenColorMapUv),e.push(t.sheenRoughnessMapUv),e.push(t.specularMapUv),e.push(t.specularColorMapUv),e.push(t.specularIntensityMapUv),e.push(t.transmissionMapUv),e.push(t.thicknessMapUv),e.push(t.combine),e.push(t.fogExp2),e.push(t.sizeAttenuation),e.push(t.morphTargetsCount),e.push(t.morphAttributeCount),e.push(t.numDirLights),e.push(t.numPointLights),e.push(t.numSpotLights),e.push(t.numSpotLightMaps),e.push(t.numHemiLights),e.push(t.numRectAreaLights),e.push(t.numDirLightShadows),e.push(t.numPointLightShadows),e.push(t.numSpotLightShadows),e.push(t.numSpotLightShadowsWithMaps),e.push(t.numLightProbes),e.push(t.shadowMapType),e.push(t.toneMapping),e.push(t.numClippingPlanes),e.push(t.numClipIntersection),e.push(t.depthPacking)}(r,t),function(e,t){a.disableAll(),t.supportsVertexTextures&&a.enable(0),t.instancing&&a.enable(1),t.instancingColor&&a.enable(2),t.instancingMorph&&a.enable(3),t.matcap&&a.enable(4),t.envMap&&a.enable(5),t.normalMapObjectSpace&&a.enable(6),t.normalMapTangentSpace&&a.enable(7),t.clearcoat&&a.enable(8),t.iridescence&&a.enable(9),t.alphaTest&&a.enable(10),t.vertexColors&&a.enable(11),t.vertexAlphas&&a.enable(12),t.vertexUv1s&&a.enable(13),t.vertexUv2s&&a.enable(14),t.vertexUv3s&&a.enable(15),t.vertexTangents&&a.enable(16),t.anisotropy&&a.enable(17),t.alphaHash&&a.enable(18),t.batching&&a.enable(19),t.dispersion&&a.enable(20),t.batchingColor&&a.enable(21),e.push(a.mask),a.disableAll(),t.fog&&a.enable(0),t.useFog&&a.enable(1),t.flatShading&&a.enable(2),t.logarithmicDepthBuffer&&a.enable(3),t.skinning&&a.enable(4),t.morphTargets&&a.enable(5),t.morphNormals&&a.enable(6),t.morphColors&&a.enable(7),t.premultipliedAlpha&&a.enable(8),t.shadowMapEnabled&&a.enable(9),t.doubleSided&&a.enable(10),t.flipSided&&a.enable(11),t.useDepthPacking&&a.enable(12),t.dithering&&a.enable(13),t.transmission&&a.enable(14),t.sheen&&a.enable(15),t.opaque&&a.enable(16),t.pointsUvs&&a.enable(17),t.decodeVideoTexture&&a.enable(18),t.alphaToCoverage&&a.enable(19),e.push(a.mask)}(r,t),r.push(e.outputColorSpace)),r.push(t.customProgramCacheKey),r.join()},getUniforms:function(e){const t=f[e.type];let r;if(t){const e=wo[t];r=Zs.clone(e.uniforms)}else r=e.uniforms;return r},acquireProgram:function(t,r){let n;for(let e=0,t=u.length;e0?n.push(u):!0===o.transparent?i.push(u):r.push(u)},unshift:function(e,t,o,a,l,c){const u=s(e,t,o,a,l,c);o.transmission>0?n.unshift(u):!0===o.transparent?i.unshift(u):r.unshift(u)},finish:function(){for(let r=t,n=e.length;r1&&r.sort(e||Bl),n.length>1&&n.sort(t||Pl),i.length>1&&i.sort(t||Pl)}}}function Dl(){let e=new WeakMap;return{get:function(t,r){const n=e.get(t);let i;return void 0===n?(i=new Ll,e.set(t,[i])):r>=n.length?(i=new Ll,n.push(i)):i=n[r],i},dispose:function(){e=new WeakMap}}}function Ol(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let r;switch(t.type){case"DirectionalLight":r={direction:new On,color:new es};break;case"SpotLight":r={position:new On,direction:new On,color:new es,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":r={position:new On,color:new es,distance:0,decay:0};break;case"HemisphereLight":r={direction:new On,skyColor:new es,groundColor:new es};break;case"RectAreaLight":r={color:new es,position:new On,halfWidth:new On,halfHeight:new On}}return e[t.id]=r,r}}}let Nl=0;function Ul(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function Fl(e){const t=new Ol,r=function(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let r;switch(t.type){case"DirectionalLight":case"SpotLight":r={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new rn};break;case"PointLight":r={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new rn,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=r,r}}}(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-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,numLightProbes:0};for(let e=0;e<9;e++)n.probe.push(new On);const i=new On,s=new hi,o=new hi;return{setup:function(i){let s=0,o=0,a=0;for(let e=0;e<9;e++)n.probe[e].set(0,0,0);let l=0,c=0,u=0,h=0,d=0,p=0,f=0,m=0,g=0,A=0,y=0;i.sort(Ul);for(let e=0,v=i.length;e0&&(!0===e.has("OES_texture_float_linear")?(n.rectAreaLTC1=bo.LTC_FLOAT_1,n.rectAreaLTC2=bo.LTC_FLOAT_2):(n.rectAreaLTC1=bo.LTC_HALF_1,n.rectAreaLTC2=bo.LTC_HALF_2)),n.ambient[0]=s,n.ambient[1]=o,n.ambient[2]=a;const v=n.hash;v.directionalLength===l&&v.pointLength===c&&v.spotLength===u&&v.rectAreaLength===h&&v.hemiLength===d&&v.numDirectionalShadows===p&&v.numPointShadows===f&&v.numSpotShadows===m&&v.numSpotMaps===g&&v.numLightProbes===y||(n.directional.length=l,n.spot.length=u,n.rectArea.length=h,n.point.length=c,n.hemi.length=d,n.directionalShadow.length=p,n.directionalShadowMap.length=p,n.pointShadow.length=f,n.pointShadowMap.length=f,n.spotShadow.length=m,n.spotShadowMap.length=m,n.directionalShadowMatrix.length=p,n.pointShadowMatrix.length=f,n.spotLightMatrix.length=m+g-A,n.spotLightMap.length=g,n.numSpotLightShadowsWithMaps=A,n.numLightProbes=y,v.directionalLength=l,v.pointLength=c,v.spotLength=u,v.rectAreaLength=h,v.hemiLength=d,v.numDirectionalShadows=p,v.numPointShadows=f,v.numSpotShadows=m,v.numSpotMaps=g,v.numLightProbes=y,n.version=Nl++)},setupView:function(e,t){let r=0,a=0,l=0,c=0,u=0;const h=t.matrixWorldInverse;for(let t=0,d=e.length;t=i.length?(s=new kl(e),i.push(s)):s=i[n],s},dispose:function(){t=new WeakMap}}}class Gl extends ns{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=qt,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class Ql extends ns{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}function Vl(e,t,r){let n=new Ao;const i=new rn,s=new rn,o=new Cn,a=new Gl({depthPacking:Wt}),l=new Ql,c={},u=r.maxTextureSize,d={[f]:m,[m]:f,[g]:g},y=new eo({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new rn},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \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}"}),v=y.clone();v.defines.HORIZONTAL_PASS=1;const x=new Is;x.setAttribute("position",new ds(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new Ws(x,y),b=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=h;let w=this.type;function E(r,n){const s=t.update(_);y.defines.VSM_SAMPLES!==r.blurSamples&&(y.defines.VSM_SAMPLES=r.blurSamples,v.defines.VSM_SAMPLES=r.blurSamples,y.needsUpdate=!0,v.needsUpdate=!0),null===r.mapPass&&(r.mapPass=new In(i.x,i.y)),y.uniforms.shadow_pass.value=r.map.texture,y.uniforms.resolution.value=r.mapSize,y.uniforms.radius.value=r.radius,e.setRenderTarget(r.mapPass),e.clear(),e.renderBufferDirect(n,null,s,y,_,null),v.uniforms.shadow_pass.value=r.mapPass.texture,v.uniforms.resolution.value=r.mapSize,v.uniforms.radius.value=r.radius,e.setRenderTarget(r.map),e.clear(),e.renderBufferDirect(n,null,s,v,_,null)}function M(t,r,n,i){let s=null;const o=!0===n.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(void 0!==o)s=o;else if(s=!0===n.isPointLight?l:a,e.localClippingEnabled&&!0===r.clipShadows&&Array.isArray(r.clippingPlanes)&&0!==r.clippingPlanes.length||r.displacementMap&&0!==r.displacementScale||r.alphaMap&&r.alphaTest>0||r.map&&r.alphaTest>0){const e=s.uuid,t=r.uuid;let n=c[e];void 0===n&&(n={},c[e]=n);let i=n[t];void 0===i&&(i=s.clone(),n[t]=i,r.addEventListener("dispose",C)),s=i}return s.visible=r.visible,s.wireframe=r.wireframe,s.side=i===p?null!==r.shadowSide?r.shadowSide:r.side:null!==r.shadowSide?r.shadowSide:d[r.side],s.alphaMap=r.alphaMap,s.alphaTest=r.alphaTest,s.map=r.map,s.clipShadows=r.clipShadows,s.clippingPlanes=r.clippingPlanes,s.clipIntersection=r.clipIntersection,s.displacementMap=r.displacementMap,s.displacementScale=r.displacementScale,s.displacementBias=r.displacementBias,s.wireframeLinewidth=r.wireframeLinewidth,s.linewidth=r.linewidth,!0===n.isPointLight&&!0===s.isMeshDistanceMaterial&&(e.properties.get(s).light=n),s}function S(r,i,s,o,a){if(!1===r.visible)return;if(r.layers.test(i.layers)&&(r.isMesh||r.isLine||r.isPoints)&&(r.castShadow||r.receiveShadow&&a===p)&&(!r.frustumCulled||n.intersectsObject(r))){r.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,r.matrixWorld);const n=t.update(r),l=r.material;if(Array.isArray(l)){const t=n.groups;for(let c=0,u=t.length;cu||i.y>u)&&(i.x>u&&(s.x=Math.floor(u/g.x),i.x=s.x*g.x,h.mapSize.x=s.x),i.y>u&&(s.y=Math.floor(u/g.y),i.y=s.y*g.y,h.mapSize.y=s.y)),null===h.map||!0===f||!0===m){const e=this.type!==p?{minFilter:ve,magFilter:ve}:{};null!==h.map&&h.map.dispose(),h.map=new In(i.x,i.y,e),h.map.texture.name=c.name+".shadowMap",h.camera.updateProjectionMatrix()}e.setRenderTarget(h.map),e.clear();const A=h.getViewportCount();for(let e=0;e=1):-1!==me.indexOf("OpenGL ES")&&(fe=parseFloat(/^OpenGL ES (\d)/.exec(me)[1]),pe=fe>=2);let ge=null,Ae={};const ye=e.getParameter(e.SCISSOR_BOX),ve=e.getParameter(e.VIEWPORT),xe=(new Cn).fromArray(ye),_e=(new Cn).fromArray(ve);function be(t,r,n,i){const s=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let o=0;ot?(e.repeat.x=1,e.repeat.y=r/t,e.offset.x=0,e.offset.y=(1-e.repeat.y)/2):(e.repeat.x=t/r,e.repeat.y=1,e.offset.x=(1-e.repeat.x)/2,e.offset.y=0),e},cover:function(e,t){const r=e.image&&e.image.width?e.image.width/e.image.height:1;return r>t?(e.repeat.x=t/r,e.repeat.y=1,e.offset.x=(1-e.repeat.x)/2,e.offset.y=0):(e.repeat.x=1,e.repeat.y=r/t,e.offset.x=0,e.offset.y=(1-e.repeat.y)/2),e},fill:function(e){return e.repeat.x=1,e.repeat.y=1,e.offset.x=0,e.offset.y=0,e},getByteLength:jl};function Wl(e,t,r,n,i,s,o){const a=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,l="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),c=new rn,u=new WeakMap;let h;const d=new WeakMap;let p=!1;try{p="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}function f(e,t){return p?new OffscreenCanvas(e,t):cn("canvas")}function m(e,t,r){let n=1;const i=z(e);if((i.width>r||i.height>r)&&(n=r/Math.max(i.width,i.height)),n<1){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof VideoFrame&&e instanceof VideoFrame){const r=Math.floor(n*i.width),s=Math.floor(n*i.height);void 0===h&&(h=f(r,s));const o=t?f(r,s):h;return o.width=r,o.height=s,o.getContext("2d").drawImage(e,0,0,r,s),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+i.width+"x"+i.height+") to ("+r+"x"+s+")."),o}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+i.width+"x"+i.height+")."),e}return e}function g(e){return e.generateMipmaps&&e.minFilter!==ve&&e.minFilter!==Ee}function A(t){e.generateMipmap(t)}function y(r,n,i,s,o=!1){if(null!==r){if(void 0!==e[r])return e[r];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+r+"'")}let a=n;if(n===e.RED&&(i===e.FLOAT&&(a=e.R32F),i===e.HALF_FLOAT&&(a=e.R16F),i===e.UNSIGNED_BYTE&&(a=e.R8)),n===e.RED_INTEGER&&(i===e.UNSIGNED_BYTE&&(a=e.R8UI),i===e.UNSIGNED_SHORT&&(a=e.R16UI),i===e.UNSIGNED_INT&&(a=e.R32UI),i===e.BYTE&&(a=e.R8I),i===e.SHORT&&(a=e.R16I),i===e.INT&&(a=e.R32I)),n===e.RG&&(i===e.FLOAT&&(a=e.RG32F),i===e.HALF_FLOAT&&(a=e.RG16F),i===e.UNSIGNED_BYTE&&(a=e.RG8)),n===e.RG_INTEGER&&(i===e.UNSIGNED_BYTE&&(a=e.RG8UI),i===e.UNSIGNED_SHORT&&(a=e.RG16UI),i===e.UNSIGNED_INT&&(a=e.RG32UI),i===e.BYTE&&(a=e.RG8I),i===e.SHORT&&(a=e.RG16I),i===e.INT&&(a=e.RG32I)),n===e.RGB&&i===e.UNSIGNED_INT_5_9_9_9_REV&&(a=e.RGB9_E5),n===e.RGBA){const t=o?nr:An.getTransfer(s);i===e.FLOAT&&(a=e.RGBA32F),i===e.HALF_FLOAT&&(a=e.RGBA16F),i===e.UNSIGNED_BYTE&&(a=t===ir?e.SRGB8_ALPHA8:e.RGBA8),i===e.UNSIGNED_SHORT_4_4_4_4&&(a=e.RGBA4),i===e.UNSIGNED_SHORT_5_5_5_1&&(a=e.RGB5_A1)}return a!==e.R16F&&a!==e.R32F&&a!==e.RG16F&&a!==e.RG32F&&a!==e.RGBA16F&&a!==e.RGBA32F||t.get("EXT_color_buffer_float"),a}function v(t,r){let n;return t?null===r||r===De||r===ke?n=e.DEPTH24_STENCIL8:r===Oe?n=e.DEPTH32F_STENCIL8:r===Pe&&(n=e.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):null===r||r===De||r===ke?n=e.DEPTH_COMPONENT24:r===Oe?n=e.DEPTH_COMPONENT32F:r===Pe&&(n=e.DEPTH_COMPONENT16),n}function x(e,t){return!0===g(e)||e.isFramebufferTexture&&e.minFilter!==ve&&e.minFilter!==Ee?Math.log2(Math.max(t.width,t.height))+1:void 0!==e.mipmaps&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function _(e){const t=e.target;t.removeEventListener("dispose",_),function(e){const t=n.get(e);if(void 0===t.__webglInit)return;const r=e.source,i=d.get(r);if(i){const n=i[t.__cacheKey];n.usedTimes--,0===n.usedTimes&&w(e),0===Object.keys(i).length&&d.delete(r)}n.remove(e)}(t),t.isVideoTexture&&u.delete(t)}function b(t){const r=t.target;r.removeEventListener("dispose",b),function(t){const r=n.get(t);if(t.depthTexture&&t.depthTexture.dispose(),t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++){if(Array.isArray(r.__webglFramebuffer[t]))for(let n=0;n0&&s.__version!==t.version){const e=t.image;if(null===e)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==e.complete)return void B(s,t,i);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}r.bindTexture(e.TEXTURE_2D,s.__webglTexture,e.TEXTURE0+i)}const S={[ge]:e.REPEAT,[Ae]:e.CLAMP_TO_EDGE,[ye]:e.MIRRORED_REPEAT},C={[ve]:e.NEAREST,[xe]:e.NEAREST_MIPMAP_NEAREST,[be]:e.NEAREST_MIPMAP_LINEAR,[Ee]:e.LINEAR,[Me]:e.LINEAR_MIPMAP_NEAREST,[Ce]:e.LINEAR_MIPMAP_LINEAR},T={[wr]:e.NEVER,[Rr]:e.ALWAYS,[Er]:e.LESS,[Sr]:e.LEQUAL,[Mr]:e.EQUAL,[Ir]:e.GEQUAL,[Cr]:e.GREATER,[Tr]:e.NOTEQUAL};function I(r,s){if(s.type!==Oe||!1!==t.has("OES_texture_float_linear")||s.magFilter!==Ee&&s.magFilter!==Me&&s.magFilter!==be&&s.magFilter!==Ce&&s.minFilter!==Ee&&s.minFilter!==Me&&s.minFilter!==be&&s.minFilter!==Ce||console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),e.texParameteri(r,e.TEXTURE_WRAP_S,S[s.wrapS]),e.texParameteri(r,e.TEXTURE_WRAP_T,S[s.wrapT]),r!==e.TEXTURE_3D&&r!==e.TEXTURE_2D_ARRAY||e.texParameteri(r,e.TEXTURE_WRAP_R,S[s.wrapR]),e.texParameteri(r,e.TEXTURE_MAG_FILTER,C[s.magFilter]),e.texParameteri(r,e.TEXTURE_MIN_FILTER,C[s.minFilter]),s.compareFunction&&(e.texParameteri(r,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(r,e.TEXTURE_COMPARE_FUNC,T[s.compareFunction])),!0===t.has("EXT_texture_filter_anisotropic")){if(s.magFilter===ve)return;if(s.minFilter!==be&&s.minFilter!==Ce)return;if(s.type===Oe&&!1===t.has("OES_texture_float_linear"))return;if(s.anisotropy>1||n.get(s).__currentAnisotropy){const o=t.get("EXT_texture_filter_anisotropic");e.texParameterf(r,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,i.getMaxAnisotropy())),n.get(s).__currentAnisotropy=s.anisotropy}}}function R(t,r){let n=!1;void 0===t.__webglInit&&(t.__webglInit=!0,r.addEventListener("dispose",_));const i=r.source;let s=d.get(i);void 0===s&&(s={},d.set(i,s));const a=function(e){const t=[];return t.push(e.wrapS),t.push(e.wrapT),t.push(e.wrapR||0),t.push(e.magFilter),t.push(e.minFilter),t.push(e.anisotropy),t.push(e.internalFormat),t.push(e.format),t.push(e.type),t.push(e.generateMipmaps),t.push(e.premultiplyAlpha),t.push(e.flipY),t.push(e.unpackAlignment),t.push(e.colorSpace),t.join()}(r);if(a!==t.__cacheKey){void 0===s[a]&&(s[a]={texture:e.createTexture(),usedTimes:0},o.memory.textures++,n=!0),s[a].usedTimes++;const i=s[t.__cacheKey];void 0!==i&&(s[t.__cacheKey].usedTimes--,0===i.usedTimes&&w(r)),t.__cacheKey=a,t.__webglTexture=s[a].texture}return n}function B(t,o,a){let l=e.TEXTURE_2D;(o.isDataArrayTexture||o.isCompressedArrayTexture)&&(l=e.TEXTURE_2D_ARRAY),o.isData3DTexture&&(l=e.TEXTURE_3D);const c=R(t,o),u=o.source;r.bindTexture(l,t.__webglTexture,e.TEXTURE0+a);const h=n.get(u);if(u.version!==h.__version||!0===c){r.activeTexture(e.TEXTURE0+a);const t=An.getPrimaries(An.workingColorSpace),n=o.colorSpace===Jt?null:An.getPrimaries(o.colorSpace),d=o.colorSpace===Jt||t===n?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,d);let p=m(o.image,!1,i.maxTextureSize);p=k(o,p);const f=s.convert(o.format,o.colorSpace),_=s.convert(o.type);let b,w=y(o.internalFormat,f,_,o.colorSpace,o.isVideoTexture);I(l,o);const E=o.mipmaps,M=!0!==o.isVideoTexture,S=void 0===h.__version||!0===c,C=u.dataReady,T=x(o,p);if(o.isDepthTexture)w=v(o.format===We,o.type),S&&(M?r.texStorage2D(e.TEXTURE_2D,1,w,p.width,p.height):r.texImage2D(e.TEXTURE_2D,0,w,p.width,p.height,0,f,_,null));else if(o.isDataTexture)if(E.length>0){M&&S&&r.texStorage2D(e.TEXTURE_2D,T,w,E[0].width,E[0].height);for(let t=0,n=E.length;t0){const n=jl(b.width,b.height,o.format,o.type);for(const i of o.layerUpdates){const s=b.data.subarray(i*n/b.data.BYTES_PER_ELEMENT,(i+1)*n/b.data.BYTES_PER_ELEMENT);r.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,i,b.width,b.height,1,f,s,0,0)}o.clearLayerUpdates()}else r.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,b.width,b.height,p.depth,f,b.data,0,0)}else r.compressedTexImage3D(e.TEXTURE_2D_ARRAY,t,w,b.width,b.height,p.depth,0,b.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else M?C&&r.texSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,b.width,b.height,p.depth,f,_,b.data):r.texImage3D(e.TEXTURE_2D_ARRAY,t,w,b.width,b.height,p.depth,0,f,_,b.data)}else{M&&S&&r.texStorage2D(e.TEXTURE_2D,T,w,E[0].width,E[0].height);for(let t=0,n=E.length;t0){const t=jl(p.width,p.height,o.format,o.type);for(const n of o.layerUpdates){const i=p.data.subarray(n*t/p.data.BYTES_PER_ELEMENT,(n+1)*t/p.data.BYTES_PER_ELEMENT);r.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,n,p.width,p.height,1,f,_,i)}o.clearLayerUpdates()}else r.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,p.width,p.height,p.depth,f,_,p.data)}else r.texImage3D(e.TEXTURE_2D_ARRAY,0,w,p.width,p.height,p.depth,0,f,_,p.data);else if(o.isData3DTexture)M?(S&&r.texStorage3D(e.TEXTURE_3D,T,w,p.width,p.height,p.depth),C&&r.texSubImage3D(e.TEXTURE_3D,0,0,0,0,p.width,p.height,p.depth,f,_,p.data)):r.texImage3D(e.TEXTURE_3D,0,w,p.width,p.height,p.depth,0,f,_,p.data);else if(o.isFramebufferTexture){if(S)if(M)r.texStorage2D(e.TEXTURE_2D,T,w,p.width,p.height);else{let t=p.width,n=p.height;for(let i=0;i>=1,n>>=1}}else if(E.length>0){if(M&&S){const t=z(E[0]);r.texStorage2D(e.TEXTURE_2D,T,w,t.width,t.height)}for(let t=0,n=E.length;t>u),n=Math.max(1,i.height>>u);c===e.TEXTURE_3D||c===e.TEXTURE_2D_ARRAY?r.texImage3D(c,u,p,t,n,i.depth,0,h,d,null):r.texImage2D(c,u,p,t,n,0,h,d,null)}r.bindFramebuffer(e.FRAMEBUFFER,t),F(i)?a.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,l,c,n.get(o).__webglTexture,0,U(i)):(c===e.TEXTURE_2D||c>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&c<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,l,c,n.get(o).__webglTexture,u),r.bindFramebuffer(e.FRAMEBUFFER,null)}function L(t,r,n){if(e.bindRenderbuffer(e.RENDERBUFFER,t),r.depthBuffer){const i=r.depthTexture,s=i&&i.isDepthTexture?i.type:null,o=v(r.stencilBuffer,s),l=r.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,c=U(r);F(r)?a.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,c,o,r.width,r.height):n?e.renderbufferStorageMultisample(e.RENDERBUFFER,c,o,r.width,r.height):e.renderbufferStorage(e.RENDERBUFFER,o,r.width,r.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,l,e.RENDERBUFFER,t)}else{const t=r.textures;for(let i=0;i{delete i.__boundDepthTexture,delete i.__depthDisposeCallback,e.removeEventListener("dispose",t)};e.addEventListener("dispose",t),i.__depthDisposeCallback=t}i.__boundDepthTexture=e}if(t.depthTexture&&!i.__autoAllocateDepthBuffer){if(s)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,i){if(i&&i.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(r.bindFramebuffer(e.FRAMEBUFFER,t),!i.depthTexture||!i.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");n.get(i.depthTexture).__webglTexture&&i.depthTexture.image.width===i.width&&i.depthTexture.image.height===i.height||(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),M(i.depthTexture,0);const s=n.get(i.depthTexture).__webglTexture,o=U(i);if(i.depthTexture.format===qe)F(i)?a.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,s,0,o):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,s,0);else{if(i.depthTexture.format!==We)throw new Error("Unknown depthTexture format");F(i)?a.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,s,0,o):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,s,0)}}(i.__webglFramebuffer,t)}else if(s){i.__webglDepthbuffer=[];for(let n=0;n<6;n++)if(r.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[n]),void 0===i.__webglDepthbuffer[n])i.__webglDepthbuffer[n]=e.createRenderbuffer(),L(i.__webglDepthbuffer[n],t,!1);else{const r=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,s=i.__webglDepthbuffer[n];e.bindRenderbuffer(e.RENDERBUFFER,s),e.framebufferRenderbuffer(e.FRAMEBUFFER,r,e.RENDERBUFFER,s)}}else if(r.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer),void 0===i.__webglDepthbuffer)i.__webglDepthbuffer=e.createRenderbuffer(),L(i.__webglDepthbuffer,t,!1);else{const r=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,n=i.__webglDepthbuffer;e.bindRenderbuffer(e.RENDERBUFFER,n),e.framebufferRenderbuffer(e.FRAMEBUFFER,r,e.RENDERBUFFER,n)}r.bindFramebuffer(e.FRAMEBUFFER,null)}const O=[],N=[];function U(e){return Math.min(i.maxSamples,e.samples)}function F(e){const r=n.get(e);return e.samples>0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==r.__useRenderToTexture}function k(e,t){const r=e.colorSpace,n=e.format,i=e.type;return!0===e.isCompressedTexture||!0===e.isVideoTexture||r!==er&&r!==Jt&&(An.getTransfer(r)===ir?n===Ve&&i===Ie||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",r)),t}function z(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?(c.width=e.naturalWidth||e.width,c.height=e.naturalHeight||e.height):"undefined"!=typeof VideoFrame&&e instanceof VideoFrame?(c.width=e.displayWidth,c.height=e.displayHeight):(c.width=e.width,c.height=e.height),c}this.allocateTextureUnit=function(){const e=E;return e>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+i.maxTextures),E+=1,e},this.resetTextureUnits=function(){E=0},this.setTexture2D=M,this.setTexture2DArray=function(t,i){const s=n.get(t);t.version>0&&s.__version!==t.version?B(s,t,i):r.bindTexture(e.TEXTURE_2D_ARRAY,s.__webglTexture,e.TEXTURE0+i)},this.setTexture3D=function(t,i){const s=n.get(t);t.version>0&&s.__version!==t.version?B(s,t,i):r.bindTexture(e.TEXTURE_3D,s.__webglTexture,e.TEXTURE0+i)},this.setTextureCube=function(t,o){const a=n.get(t);t.version>0&&a.__version!==t.version?function(t,o,a){if(6!==o.image.length)return;const l=R(t,o),c=o.source;r.bindTexture(e.TEXTURE_CUBE_MAP,t.__webglTexture,e.TEXTURE0+a);const u=n.get(c);if(c.version!==u.__version||!0===l){r.activeTexture(e.TEXTURE0+a);const t=An.getPrimaries(An.workingColorSpace),n=o.colorSpace===Jt?null:An.getPrimaries(o.colorSpace),h=o.colorSpace===Jt||t===n?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,h);const d=o.isCompressedTexture||o.image[0].isCompressedTexture,p=o.image[0]&&o.image[0].isDataTexture,f=[];for(let e=0;e<6;e++)f[e]=d||p?p?o.image[e].image:o.image[e]:m(o.image[e],!0,i.maxCubemapSize),f[e]=k(o,f[e]);const v=f[0],_=s.convert(o.format,o.colorSpace),b=s.convert(o.type),w=y(o.internalFormat,_,b,o.colorSpace),E=!0!==o.isVideoTexture,M=void 0===u.__version||!0===l,S=c.dataReady;let C,T=x(o,v);if(I(e.TEXTURE_CUBE_MAP,o),d){E&&M&&r.texStorage2D(e.TEXTURE_CUBE_MAP,T,w,v.width,v.height);for(let t=0;t<6;t++){C=f[t].mipmaps;for(let n=0;n0&&T++;const t=z(f[0]);r.texStorage2D(e.TEXTURE_CUBE_MAP,T,w,t.width,t.height)}for(let t=0;t<6;t++)if(p){E?S&&r.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,f[t].width,f[t].height,_,b,f[t].data):r.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,w,f[t].width,f[t].height,0,_,b,f[t].data);for(let n=0;n1;if(h||(void 0===l.__webglTexture&&(l.__webglTexture=e.createTexture()),l.__version=i.version,o.memory.textures++),u){a.__webglFramebuffer=[];for(let t=0;t<6;t++)if(i.mipmaps&&i.mipmaps.length>0){a.__webglFramebuffer[t]=[];for(let r=0;r0){a.__webglFramebuffer=[];for(let t=0;t0&&!1===F(t)){a.__webglMultisampledFramebuffer=e.createFramebuffer(),a.__webglColorRenderbuffer=[],r.bindFramebuffer(e.FRAMEBUFFER,a.__webglMultisampledFramebuffer);for(let r=0;r0)for(let n=0;n0)for(let r=0;r0)if(!1===F(t)){const i=t.textures,s=t.width,o=t.height;let a=e.COLOR_BUFFER_BIT;const c=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,u=n.get(t),h=i.length>1;if(h)for(let t=0;ta+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&o<=a-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==a&&e.gripSpace&&(i=t.getPose(e.gripSpace,r),null!==i&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,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));null!==o&&(n=t.getPose(e.targetRaySpace,r),null===n&&null!==i&&(n=i),null!==n&&(o.matrix.fromArray(n.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,n.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(n.linearVelocity)):o.hasLinearVelocity=!1,n.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(n.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent($l)))}return null!==o&&(o.visible=null!==n),null!==a&&(a.visible=null!==i),null!==l&&(l.visible=null!==s),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){const r=new Kl;r.matrixAutoUpdate=!1,r.visible=!1,e.joints[t.jointName]=r,e.add(r)}return e.joints[t.jointName]}}class Zl{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,r){if(null===this.texture){const n=new Sn;e.properties.get(n).__webglTexture=t.texture,t.depthNear==r.depthNear&&t.depthFar==r.depthFar||(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=n}}getMesh(e){if(null!==this.texture&&null===this.mesh){const t=e.cameras[0].viewport,r=new eo({vertexShader:"\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}",fragmentShader:"\nuniform sampler2DArray depthColor;\nuniform float depthWidth;\nuniform float depthHeight;\n\nvoid main() {\n\n\tvec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\n\n\tif ( coord.x >= 1.0 ) {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n\t} else {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\n\n\t}\n\n}",uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Ws(new xo(20,20),r)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class ec extends Hr{constructor(e,t){super();const r=this;let n=null,i=1,s=null,o="local-floor",a=1,l=null,c=null,u=null,h=null,d=null,p=null;const f=new Zl,m=t.getContextAttributes();let g=null,A=null;const y=[],v=[],x=new rn;let _=null;const b=new so;b.layers.enable(1),b.viewport=new Cn;const w=new so;w.layers.enable(2),w.viewport=new Cn;const E=[b,w],M=new Xl;M.layers.enable(1),M.layers.enable(2);let S=null,C=null;function T(e){const t=v.indexOf(e.inputSource);if(-1===t)return;const r=y[t];void 0!==r&&(r.update(e.inputSource,e.frame,l||s),r.dispatchEvent({type:e.type,data:e.inputSource}))}function I(){n.removeEventListener("select",T),n.removeEventListener("selectstart",T),n.removeEventListener("selectend",T),n.removeEventListener("squeeze",T),n.removeEventListener("squeezestart",T),n.removeEventListener("squeezeend",T),n.removeEventListener("end",I),n.removeEventListener("inputsourceschange",R);for(let e=0;e=0&&(v[n]=null,y[n].disconnect(r))}for(let t=0;t=v.length){v.push(r),n=e;break}if(null===v[e]){v[e]=r,n=e;break}}if(-1===n)break}const i=y[n];i&&i.connect(r)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=y[e];return void 0===t&&(t=new Jl,y[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=y[e];return void 0===t&&(t=new Jl,y[e]=t),t.getGripSpace()},this.getHand=function(e){let t=y[e];return void 0===t&&(t=new Jl,y[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){i=e,!0===r.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){o=e,!0===r.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||s},this.setReferenceSpace=function(e){l=e},this.getBaseLayer=function(){return null!==h?h:d},this.getBinding=function(){return u},this.getFrame=function(){return p},this.getSession=function(){return n},this.setSession=async function(c){if(n=c,null!==n){if(g=e.getRenderTarget(),n.addEventListener("select",T),n.addEventListener("selectstart",T),n.addEventListener("selectend",T),n.addEventListener("squeeze",T),n.addEventListener("squeezestart",T),n.addEventListener("squeezeend",T),n.addEventListener("end",I),n.addEventListener("inputsourceschange",R),!0!==m.xrCompatible&&await t.makeXRCompatible(),_=e.getPixelRatio(),e.getSize(x),void 0===n.renderState.layers){const r={antialias:m.antialias,alpha:!0,depth:m.depth,stencil:m.stencil,framebufferScaleFactor:i};d=new XRWebGLLayer(n,t,r),n.updateRenderState({baseLayer:d}),e.setPixelRatio(1),e.setSize(d.framebufferWidth,d.framebufferHeight,!1),A=new In(d.framebufferWidth,d.framebufferHeight,{format:Ve,type:Ie,colorSpace:e.outputColorSpace,stencilBuffer:m.stencil})}else{let r=null,s=null,o=null;m.depth&&(o=m.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,r=m.stencil?We:qe,s=m.stencil?ke:De);const a={colorFormat:t.RGBA8,depthFormat:o,scaleFactor:i};u=new XRWebGLBinding(n,t),h=u.createProjectionLayer(a),n.updateRenderState({layers:[h]}),e.setPixelRatio(1),e.setSize(h.textureWidth,h.textureHeight,!1),A=new In(h.textureWidth,h.textureHeight,{format:Ve,type:Ie,depthTexture:new ra(h.textureWidth,h.textureHeight,s,void 0,void 0,void 0,void 0,void 0,void 0,r),stencilBuffer:m.stencil,colorSpace:e.outputColorSpace,samples:m.antialias?4:0,resolveDepthBuffer:!1===h.ignoreDepthValues})}A.isXRRenderTarget=!0,this.setFoveation(a),l=null,s=await n.requestReferenceSpace(o),O.setContext(n),O.start(),r.isPresenting=!0,r.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==n)return n.environmentBlendMode},this.getDepthTexture=function(){return f.getDepthTexture()};const B=new On,P=new On;function L(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(null===n)return;let t=e.near,r=e.far;null!==f.texture&&(f.depthNear>0&&(t=f.depthNear),f.depthFar>0&&(r=f.depthFar)),M.near=w.near=b.near=t,M.far=w.far=b.far=r,S===M.near&&C===M.far||(n.updateRenderState({depthNear:M.near,depthFar:M.far}),S=M.near,C=M.far);const i=e.parent,s=M.cameras;L(M,i);for(let e=0;e0&&(e.alphaTest.value=n.alphaTest);const i=t.get(n),s=i.envMap,o=i.envMapRotation;s&&(e.envMap.value=s,tc.copy(o),tc.x*=-1,tc.y*=-1,tc.z*=-1,s.isCubeTexture&&!1===s.isRenderTargetTexture&&(tc.y*=-1,tc.z*=-1),e.envMapRotation.value.setFromMatrix4(rc.makeRotationFromEuler(tc)),e.flipEnvMap.value=s.isCubeTexture&&!1===s.isRenderTargetTexture?-1:1,e.reflectivity.value=n.reflectivity,e.ior.value=n.ior,e.refractionRatio.value=n.refractionRatio),n.lightMap&&(e.lightMap.value=n.lightMap,e.lightMapIntensity.value=n.lightMapIntensity,r(n.lightMap,e.lightMapTransform)),n.aoMap&&(e.aoMap.value=n.aoMap,e.aoMapIntensity.value=n.aoMapIntensity,r(n.aoMap,e.aoMapTransform))}return{refreshFogUniforms:function(t,r){r.color.getRGB(t.fogColor.value,Js(e)),r.isFog?(t.fogNear.value=r.near,t.fogFar.value=r.far):r.isFogExp2&&(t.fogDensity.value=r.density)},refreshMaterialUniforms:function(e,i,s,o,a){i.isMeshBasicMaterial||i.isMeshLambertMaterial?n(e,i):i.isMeshToonMaterial?(n(e,i),function(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(e,i)):i.isMeshPhongMaterial?(n(e,i),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}(e,i)):i.isMeshStandardMaterial?(n(e,i),function(e,t){e.metalness.value=t.metalness,t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap,r(t.metalnessMap,e.metalnessMapTransform)),e.roughness.value=t.roughness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap,r(t.roughnessMap,e.roughnessMapTransform)),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}(e,i),i.isMeshPhysicalMaterial&&function(e,t,n){e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap,r(t.sheenColorMap,e.sheenColorMapTransform)),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap,r(t.sheenRoughnessMap,e.sheenRoughnessMapTransform))),t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap,r(t.clearcoatMap,e.clearcoatMapTransform)),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap,r(t.clearcoatRoughnessMap,e.clearcoatRoughnessMapTransform)),t.clearcoatNormalMap&&(e.clearcoatNormalMap.value=t.clearcoatNormalMap,r(t.clearcoatNormalMap,e.clearcoatNormalMapTransform),e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),t.side===m&&e.clearcoatNormalScale.value.negate())),t.dispersion>0&&(e.dispersion.value=t.dispersion),t.iridescence>0&&(e.iridescence.value=t.iridescence,e.iridescenceIOR.value=t.iridescenceIOR,e.iridescenceThicknessMinimum.value=t.iridescenceThicknessRange[0],e.iridescenceThicknessMaximum.value=t.iridescenceThicknessRange[1],t.iridescenceMap&&(e.iridescenceMap.value=t.iridescenceMap,r(t.iridescenceMap,e.iridescenceMapTransform)),t.iridescenceThicknessMap&&(e.iridescenceThicknessMap.value=t.iridescenceThicknessMap,r(t.iridescenceThicknessMap,e.iridescenceThicknessMapTransform))),t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=n.texture,e.transmissionSamplerSize.value.set(n.width,n.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap,r(t.transmissionMap,e.transmissionMapTransform)),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap,r(t.thicknessMap,e.thicknessMapTransform)),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor)),t.anisotropy>0&&(e.anisotropyVector.value.set(t.anisotropy*Math.cos(t.anisotropyRotation),t.anisotropy*Math.sin(t.anisotropyRotation)),t.anisotropyMap&&(e.anisotropyMap.value=t.anisotropyMap,r(t.anisotropyMap,e.anisotropyMapTransform))),e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap,r(t.specularColorMap,e.specularColorMapTransform)),t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap,r(t.specularIntensityMap,e.specularIntensityMapTransform))}(e,i,a)):i.isMeshMatcapMaterial?(n(e,i),function(e,t){t.matcap&&(e.matcap.value=t.matcap)}(e,i)):i.isMeshDepthMaterial?n(e,i):i.isMeshDistanceMaterial?(n(e,i),function(e,r){const n=t.get(r).light;e.referencePosition.value.setFromMatrixPosition(n.matrixWorld),e.nearDistance.value=n.shadow.camera.near,e.farDistance.value=n.shadow.camera.far}(e,i)):i.isMeshNormalMaterial?n(e,i):i.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,t.map&&(e.map.value=t.map,r(t.map,e.mapTransform))}(e,i),i.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,i)):i.isPointsMaterial?function(e,t,n,i){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*n,e.scale.value=.5*i,t.map&&(e.map.value=t.map,r(t.map,e.uvTransform)),t.alphaMap&&(e.alphaMap.value=t.alphaMap,r(t.alphaMap,e.alphaMapTransform)),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}(e,i,s,o):i.isSpriteMaterial?function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map,r(t.map,e.mapTransform)),t.alphaMap&&(e.alphaMap.value=t.alphaMap,r(t.alphaMap,e.alphaMapTransform)),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}(e,i):i.isShadowMaterial?(e.color.value.copy(i.color),e.opacity.value=i.opacity):i.isShaderMaterial&&(i.uniformsNeedUpdate=!1)}}}function ic(e,t,r,n){let i={},s={},o=[];const a=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function l(e,t,r,n){const i=e.value,s=t+"_"+r;if(void 0===n[s])return n[s]="number"==typeof i||"boolean"==typeof i?i:i.clone(),!0;{const e=n[s];if("number"==typeof i||"boolean"==typeof i){if(e!==i)return n[s]=i,!0}else if(!1===e.equals(i))return e.copy(i),!0}return!1}function c(e){const t={boundary:0,storage:0};return"number"==typeof e||"boolean"==typeof e?(t.boundary=4,t.storage=4):e.isVector2?(t.boundary=8,t.storage=8):e.isVector3||e.isColor?(t.boundary=16,t.storage=12):e.isVector4?(t.boundary=16,t.storage=16):e.isMatrix3?(t.boundary=48,t.storage=48):e.isMatrix4?(t.boundary=64,t.storage=64):e.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",e),t}function u(t){const r=t.target;r.removeEventListener("dispose",u);const n=o.indexOf(r.__bindingPointIndex);o.splice(n,1),e.deleteBuffer(i[r.id]),delete i[r.id],delete s[r.id]}return{bind:function(e,t){const r=t.program;n.uniformBlockBinding(e,r)},update:function(r,h){let d=i[r.id];void 0===d&&(function(e){const t=e.uniforms;let r=0;for(let e=0,n=t.length;e0&&(r+=16-n),e.__size=r,e.__cache={}}(r),d=function(t){const r=function(){for(let e=0;e0),h=!!r.morphAttributes.position,d=!!r.morphAttributes.normal,p=!!r.morphAttributes.color;let f=ee;n.toneMapped&&(null!==S&&!0!==S.isXRRenderTarget||(f=b.toneMapping));const m=r.morphAttributes.position||r.morphAttributes.normal||r.morphAttributes.color,g=void 0!==m?m.length:0,A=re.get(n),y=v.state.lights;if(!0===V&&(!0===H||e!==T)){const t=e===T&&n.id===C;pe.setState(n,e,t)}let x=!1;n.version===A.__version?A.needsLights&&A.lightsStateVersion!==y.state.version||A.outputColorSpace!==a||i.isBatchedMesh&&!1===A.batching?x=!0:i.isBatchedMesh||!0!==A.batching?i.isBatchedMesh&&!0===A.batchingColor&&null===i.colorTexture||i.isBatchedMesh&&!1===A.batchingColor&&null!==i.colorTexture||i.isInstancedMesh&&!1===A.instancing?x=!0:i.isInstancedMesh||!0!==A.instancing?i.isSkinnedMesh&&!1===A.skinning?x=!0:i.isSkinnedMesh||!0!==A.skinning?i.isInstancedMesh&&!0===A.instancingColor&&null===i.instanceColor||i.isInstancedMesh&&!1===A.instancingColor&&null!==i.instanceColor||i.isInstancedMesh&&!0===A.instancingMorph&&null===i.morphTexture||i.isInstancedMesh&&!1===A.instancingMorph&&null!==i.morphTexture||A.envMap!==l||!0===n.fog&&A.fog!==s?x=!0:void 0===A.numClippingPlanes||A.numClippingPlanes===pe.numPlanes&&A.numIntersection===pe.numIntersection?(A.vertexAlphas!==c||A.vertexTangents!==u||A.morphTargets!==h||A.morphNormals!==d||A.morphColors!==p||A.toneMapping!==f||A.morphTargetsCount!==g)&&(x=!0):x=!0:x=!0:x=!0:x=!0:(x=!0,A.__version=n.version);let _=A.currentProgram;!0===x&&(_=Ye(n,t,i));let w=!1,E=!1,M=!1;const I=_.getUniforms(),R=A.uniforms;if(Z.useProgram(_.program)&&(w=!0,E=!0,M=!0),n.id!==C&&(C=n.id,E=!0),w||T!==e){I.setValue(be,"projectionMatrix",e.projectionMatrix),I.setValue(be,"viewMatrix",e.matrixWorldInverse);const t=I.map.cameraPosition;void 0!==t&&t.setValue(be,q.setFromMatrixPosition(e.matrixWorld)),J.logarithmicDepthBuffer&&I.setValue(be,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&I.setValue(be,"isOrthographic",!0===e.isOrthographicCamera),T!==e&&(T=e,E=!0,M=!0)}if(i.isSkinnedMesh){I.setOptional(be,i,"bindMatrix"),I.setOptional(be,i,"bindMatrixInverse");const e=i.skeleton;e&&(null===e.boneTexture&&e.computeBoneTexture(),I.setValue(be,"boneTexture",e.boneTexture,ne))}i.isBatchedMesh&&(I.setOptional(be,i,"batchingTexture"),I.setValue(be,"batchingTexture",i._matricesTexture,ne),I.setOptional(be,i,"batchingIdTexture"),I.setValue(be,"batchingIdTexture",i._indirectTexture,ne),I.setOptional(be,i,"batchingColorTexture"),null!==i._colorsTexture&&I.setValue(be,"batchingColorTexture",i._colorsTexture,ne));const B=r.morphAttributes;var P,L;if(void 0===B.position&&void 0===B.normal&&void 0===B.color||ge.update(i,r,_),(E||A.receiveShadow!==i.receiveShadow)&&(A.receiveShadow=i.receiveShadow,I.setValue(be,"receiveShadow",i.receiveShadow)),n.isMeshGouraudMaterial&&null!==n.envMap&&(R.envMap.value=l,R.flipEnvMap.value=l.isCubeTexture&&!1===l.isRenderTargetTexture?-1:1),n.isMeshStandardMaterial&&null===n.envMap&&null!==t.environment&&(R.envMapIntensity.value=t.environmentIntensity),E&&(I.setValue(be,"toneMappingExposure",b.toneMappingExposure),A.needsLights&&(L=M,(P=R).ambientLightColor.needsUpdate=L,P.lightProbe.needsUpdate=L,P.directionalLights.needsUpdate=L,P.directionalLightShadows.needsUpdate=L,P.pointLights.needsUpdate=L,P.pointLightShadows.needsUpdate=L,P.spotLights.needsUpdate=L,P.spotLightShadows.needsUpdate=L,P.rectAreaLights.needsUpdate=L,P.hemisphereLights.needsUpdate=L),s&&!0===n.fog&&ue.refreshFogUniforms(R,s),ue.refreshMaterialUniforms(R,n,N,O,v.state.transmissionRenderTarget[e.id]),al.upload(be,Ke(A),R,ne)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(al.upload(be,Ke(A),R,ne),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&I.setValue(be,"center",i.center),I.setValue(be,"modelViewMatrix",i.modelViewMatrix),I.setValue(be,"normalMatrix",i.normalMatrix),I.setValue(be,"modelMatrix",i.matrixWorld),n.isShaderMaterial||n.isRawShaderMaterial){const e=n.uniformsGroups;for(let t=0,r=e.length;t{function r(){n.forEach((function(e){re.get(e).currentProgram.isReady()&&n.delete(e)})),0!==n.size?setTimeout(r,10):t(e)}null!==$.get("KHR_parallel_shader_compile")?r():setTimeout(r,10)}))};let Oe=null;function ze(){Qe.stop()}function Ge(){Qe.start()}const Qe=new yo;function Ve(e,t,r,n){if(!1===e.visible)return;if(e.layers.test(t.layers))if(e.isGroup)r=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)v.pushLight(e),e.castShadow&&v.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||Q.intersectsSprite(e)){n&&W.setFromMatrixPosition(e.matrixWorld).applyMatrix4(j);const t=le.update(e),i=e.material;i.visible&&y.push(e,t,i,r,W.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||Q.intersectsObject(e))){const t=le.update(e),i=e.material;if(n&&(void 0!==e.boundingSphere?(null===e.boundingSphere&&e.computeBoundingSphere(),W.copy(e.boundingSphere.center)):(null===t.boundingSphere&&t.computeBoundingSphere(),W.copy(t.boundingSphere.center)),W.applyMatrix4(e.matrixWorld).applyMatrix4(j)),Array.isArray(i)){const n=t.groups;for(let s=0,o=n.length;s0&&qe(i,t,r),s.length>0&&qe(s,t,r),o.length>0&&qe(o,t,r),Z.buffers.depth.setTest(!0),Z.buffers.depth.setMask(!0),Z.buffers.color.setMask(!0),Z.setPolygonOffset(!1)}function je(e,t,r,n){if(null!==(!0===r.isScene?r.overrideMaterial:null))return;void 0===v.state.transmissionRenderTarget[n.id]&&(v.state.transmissionRenderTarget[n.id]=new In(1,1,{generateMipmaps:!0,type:$.has("EXT_color_buffer_half_float")||$.has("EXT_color_buffer_float")?Ne:Ie,minFilter:Ce,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:An.workingColorSpace}));const i=v.state.transmissionRenderTarget[n.id],o=n.viewport||I;i.setSize(o.z,o.w);const a=b.getRenderTarget();b.setRenderTarget(i),b.getClearColor(P),L=b.getClearAlpha(),L<1&&b.setClearColor(16777215,.5),b.clear(),X&&me.render(r);const l=b.toneMapping;b.toneMapping=ee;const c=n.viewport;if(void 0!==n.viewport&&(n.viewport=void 0),v.setupLightsView(n),!0===V&&pe.setGlobalState(b.clippingPlanes,n),qe(e,r,n),ne.updateMultisampleRenderTarget(i),ne.updateRenderTargetMipmap(i),!1===$.has("WEBGL_multisampled_render_to_texture")){let e=!1;for(let i=0,s=t.length;i0)for(let t=0,s=r.length;t0&&je(n,i,e,t),X&&me.render(e),He(y,e,t);null!==S&&(ne.updateMultisampleRenderTarget(S),ne.updateRenderTargetMipmap(S)),!0===e.isScene&&e.onAfterRender(b,e,t),xe.resetDefaultState(),C=-1,T=null,_.pop(),_.length>0?(v=_[_.length-1],!0===V&&pe.setGlobalState(b.clippingPlanes,v.state.camera)):v=null,x.pop(),y=x.length>0?x[x.length-1]:null},this.getActiveCubeFace=function(){return E},this.getActiveMipmapLevel=function(){return M},this.getRenderTarget=function(){return S},this.setRenderTargetTextures=function(e,t,r){re.get(e.texture).__webglTexture=t,re.get(e.depthTexture).__webglTexture=r;const n=re.get(e);n.__hasExternalTextures=!0,n.__autoAllocateDepthBuffer=void 0===r,n.__autoAllocateDepthBuffer||!0===$.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),n.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(e,t){const r=re.get(e);r.__webglFramebuffer=t,r.__useDefaultFramebuffer=void 0===t},this.setRenderTarget=function(e,t=0,r=0){S=e,E=t,M=r;let n=!0,i=null,s=!1,o=!1;if(e){const a=re.get(e);if(void 0!==a.__useDefaultFramebuffer)Z.bindFramebuffer(be.FRAMEBUFFER,null),n=!1;else if(void 0===a.__webglFramebuffer)ne.setupRenderTarget(e);else if(a.__hasExternalTextures)ne.rebindTextures(e,re.get(e.texture).__webglTexture,re.get(e.depthTexture).__webglTexture);else if(e.depthBuffer){const t=e.depthTexture;if(a.__boundDepthTexture!==t){if(null!==t&&re.has(t)&&(e.width!==t.image.width||e.height!==t.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");ne.setupDepthRenderbuffer(e)}}const l=e.texture;(l.isData3DTexture||l.isDataArrayTexture||l.isCompressedArrayTexture)&&(o=!0);const c=re.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(i=Array.isArray(c[t])?c[t][r]:c[t],s=!0):i=e.samples>0&&!1===ne.useMultisampledRTT(e)?re.get(e).__webglMultisampledFramebuffer:Array.isArray(c)?c[r]:c,I.copy(e.viewport),R.copy(e.scissor),B=e.scissorTest}else I.copy(k).multiplyScalar(N).floor(),R.copy(z).multiplyScalar(N).floor(),B=G;if(Z.bindFramebuffer(be.FRAMEBUFFER,i)&&n&&Z.drawBuffers(e,i),Z.viewport(I),Z.scissor(R),Z.setScissorTest(B),s){const n=re.get(e.texture);be.framebufferTexture2D(be.FRAMEBUFFER,be.COLOR_ATTACHMENT0,be.TEXTURE_CUBE_MAP_POSITIVE_X+t,n.__webglTexture,r)}else if(o){const n=re.get(e.texture),i=t||0;be.framebufferTextureLayer(be.FRAMEBUFFER,be.COLOR_ATTACHMENT0,n.__webglTexture,r||0,i)}C=-1},this.readRenderTargetPixels=function(e,t,r,n,i,s,o){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let a=re.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(a=a[o]),a){Z.bindFramebuffer(be.FRAMEBUFFER,a);try{const o=e.texture,a=o.format,l=o.type;if(!J.textureFormatReadable(a))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!J.textureTypeReadable(l))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");t>=0&&t<=e.width-n&&r>=0&&r<=e.height-i&&be.readPixels(t,r,n,i,ve.convert(a),ve.convert(l),s)}finally{const e=null!==S?re.get(S).__webglFramebuffer:null;Z.bindFramebuffer(be.FRAMEBUFFER,e)}}},this.readRenderTargetPixelsAsync=async function(e,t,r,n,i,s,o){if(!e||!e.isWebGLRenderTarget)throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let a=re.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(a=a[o]),a){Z.bindFramebuffer(be.FRAMEBUFFER,a);try{const o=e.texture,a=o.format,l=o.type;if(!J.textureFormatReadable(a))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!J.textureTypeReadable(l))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(t>=0&&t<=e.width-n&&r>=0&&r<=e.height-i){const e=be.createBuffer();be.bindBuffer(be.PIXEL_PACK_BUFFER,e),be.bufferData(be.PIXEL_PACK_BUFFER,s.byteLength,be.STREAM_READ),be.readPixels(t,r,n,i,ve.convert(a),ve.convert(l),0),be.flush();const o=be.fenceSync(be.SYNC_GPU_COMMANDS_COMPLETE,0);await function(e,t){return new Promise((function(r,n){setTimeout((function i(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:n();break;case e.TIMEOUT_EXPIRED:setTimeout(i,4);break;default:r()}}),4)}))}(be,o);try{be.bindBuffer(be.PIXEL_PACK_BUFFER,e),be.getBufferSubData(be.PIXEL_PACK_BUFFER,0,s)}finally{be.deleteBuffer(e),be.deleteSync(o)}return s}}finally{const e=null!==S?re.get(S).__webglFramebuffer:null;Z.bindFramebuffer(be.FRAMEBUFFER,e)}}},this.copyFramebufferToTexture=function(e,t=null,r=0){!0!==e.isTexture&&(dn("WebGLRenderer: copyFramebufferToTexture function signature has changed."),t=arguments[0]||null,e=arguments[1]);const n=Math.pow(2,-r),i=Math.floor(e.image.width*n),s=Math.floor(e.image.height*n),o=null!==t?t.x:0,a=null!==t?t.y:0;ne.setTexture2D(e,0),be.copyTexSubImage2D(be.TEXTURE_2D,r,0,0,o,a,i,s),Z.unbindTexture()},this.copyTextureToTexture=function(e,t,r=null,n=null,i=0){let s,o,a,l,c,u;!0!==e.isTexture&&(dn("WebGLRenderer: copyTextureToTexture function signature has changed."),n=arguments[0]||null,e=arguments[1],t=arguments[2],i=arguments[3]||0,r=null),null!==r?(s=r.max.x-r.min.x,o=r.max.y-r.min.y,a=r.min.x,l=r.min.y):(s=e.image.width,o=e.image.height,a=0,l=0),null!==n?(c=n.x,u=n.y):(c=0,u=0);const h=ve.convert(t.format),d=ve.convert(t.type);ne.setTexture2D(t,0),be.pixelStorei(be.UNPACK_FLIP_Y_WEBGL,t.flipY),be.pixelStorei(be.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),be.pixelStorei(be.UNPACK_ALIGNMENT,t.unpackAlignment);const p=be.getParameter(be.UNPACK_ROW_LENGTH),f=be.getParameter(be.UNPACK_IMAGE_HEIGHT),m=be.getParameter(be.UNPACK_SKIP_PIXELS),g=be.getParameter(be.UNPACK_SKIP_ROWS),A=be.getParameter(be.UNPACK_SKIP_IMAGES),y=e.isCompressedTexture?e.mipmaps[i]:e.image;be.pixelStorei(be.UNPACK_ROW_LENGTH,y.width),be.pixelStorei(be.UNPACK_IMAGE_HEIGHT,y.height),be.pixelStorei(be.UNPACK_SKIP_PIXELS,a),be.pixelStorei(be.UNPACK_SKIP_ROWS,l),e.isDataTexture?be.texSubImage2D(be.TEXTURE_2D,i,c,u,s,o,h,d,y.data):e.isCompressedTexture?be.compressedTexSubImage2D(be.TEXTURE_2D,i,c,u,y.width,y.height,h,y.data):be.texSubImage2D(be.TEXTURE_2D,i,c,u,s,o,h,d,y),be.pixelStorei(be.UNPACK_ROW_LENGTH,p),be.pixelStorei(be.UNPACK_IMAGE_HEIGHT,f),be.pixelStorei(be.UNPACK_SKIP_PIXELS,m),be.pixelStorei(be.UNPACK_SKIP_ROWS,g),be.pixelStorei(be.UNPACK_SKIP_IMAGES,A),0===i&&t.generateMipmaps&&be.generateMipmap(be.TEXTURE_2D),Z.unbindTexture()},this.copyTextureToTexture3D=function(e,t,r=null,n=null,i=0){let s,o,a,l,c,u,h,d,p;!0!==e.isTexture&&(dn("WebGLRenderer: copyTextureToTexture3D function signature has changed."),r=arguments[0]||null,n=arguments[1]||null,e=arguments[2],t=arguments[3],i=arguments[4]||0);const f=e.isCompressedTexture?e.mipmaps[i]:e.image;null!==r?(s=r.max.x-r.min.x,o=r.max.y-r.min.y,a=r.max.z-r.min.z,l=r.min.x,c=r.min.y,u=r.min.z):(s=f.width,o=f.height,a=f.depth,l=0,c=0,u=0),null!==n?(h=n.x,d=n.y,p=n.z):(h=0,d=0,p=0);const m=ve.convert(t.format),g=ve.convert(t.type);let A;if(t.isData3DTexture)ne.setTexture3D(t,0),A=be.TEXTURE_3D;else{if(!t.isDataArrayTexture&&!t.isCompressedArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");ne.setTexture2DArray(t,0),A=be.TEXTURE_2D_ARRAY}be.pixelStorei(be.UNPACK_FLIP_Y_WEBGL,t.flipY),be.pixelStorei(be.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),be.pixelStorei(be.UNPACK_ALIGNMENT,t.unpackAlignment);const y=be.getParameter(be.UNPACK_ROW_LENGTH),v=be.getParameter(be.UNPACK_IMAGE_HEIGHT),x=be.getParameter(be.UNPACK_SKIP_PIXELS),_=be.getParameter(be.UNPACK_SKIP_ROWS),b=be.getParameter(be.UNPACK_SKIP_IMAGES);be.pixelStorei(be.UNPACK_ROW_LENGTH,f.width),be.pixelStorei(be.UNPACK_IMAGE_HEIGHT,f.height),be.pixelStorei(be.UNPACK_SKIP_PIXELS,l),be.pixelStorei(be.UNPACK_SKIP_ROWS,c),be.pixelStorei(be.UNPACK_SKIP_IMAGES,u),e.isDataTexture||e.isData3DTexture?be.texSubImage3D(A,i,h,d,p,s,o,a,m,g,f.data):t.isCompressedArrayTexture?be.compressedTexSubImage3D(A,i,h,d,p,s,o,a,m,f.data):be.texSubImage3D(A,i,h,d,p,s,o,a,m,g,f),be.pixelStorei(be.UNPACK_ROW_LENGTH,y),be.pixelStorei(be.UNPACK_IMAGE_HEIGHT,v),be.pixelStorei(be.UNPACK_SKIP_PIXELS,x),be.pixelStorei(be.UNPACK_SKIP_ROWS,_),be.pixelStorei(be.UNPACK_SKIP_IMAGES,b),0===i&&t.generateMipmaps&&be.generateMipmap(A),Z.unbindTexture()},this.initRenderTarget=function(e){void 0===re.get(e).__webglFramebuffer&&ne.setupRenderTarget(e)},this.initTexture=function(e){e.isCubeTexture?ne.setTextureCube(e,0):e.isData3DTexture?ne.setTexture3D(e,0):e.isDataArrayTexture||e.isCompressedArrayTexture?ne.setTexture2DArray(e,0):ne.setTexture2D(e,0),Z.unbindTexture()},this.resetState=function(){E=0,M=0,S=null,Z.reset(),xe.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Qr}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===tr?"display-p3":"srgb",t.unpackColorSpace=An.workingColorSpace===rr?"display-p3":"srgb"}}class oc{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new es(e),this.density=t}clone(){return new oc(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class ac{constructor(e,t=1,r=1e3){this.isFog=!0,this.name="",this.color=new es(e),this.near=t,this.far=r}clone(){return new ac(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class lc extends Fi{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new _i,this.environmentIntensity=1,this.environmentRotation=new _i,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class cc{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=Br,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Xr()}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}get updateRange(){return dn("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,r){e*=this.stride,r*=t.stride;for(let n=0,i=this.stride;ne.far||t.push({distance:a,point:fc.clone(),uv:Xi.getInterpolation(fc,xc,_c,bc,wc,Ec,Mc,new rn),face:null,object:this})}copy(e,t){return super.copy(e,t),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}}function Cc(e,t,r,n,i,s){Ac.subVectors(e,r).addScalar(.5).multiply(n),void 0!==i?(yc.x=s*Ac.x-i*Ac.y,yc.y=i*Ac.x+s*Ac.y):yc.copy(Ac),e.copy(t),e.x+=yc.x,e.y+=yc.y,e.applyMatrix4(vc)}const Tc=new On,Ic=new On;class Rc extends Fi{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let e=0,r=t.length;e0){let r,n;for(r=1,n=t.length;r0){Tc.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(Tc);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Tc.setFromMatrixPosition(e.matrixWorld),Ic.setFromMatrixPosition(this.matrixWorld);const r=Tc.distanceTo(Ic)/e.zoom;let n,i;for(t[0].object.visible=!0,n=1,i=t.length;n=e))break;t[n-1].object.visible=!1,t[n].object.visible=!0}for(this._currentLevel=n-1;n=n.length&&n.push({start:-1,count:-1,z:-1,index:-1});const s=n[this.index];i.push(s),this.index++,s.start=e.start,s.count=e.count,s.z=t,s.index=r}reset(){this.list.length=0,this.index=0}}const iu=new hi,su=new hi,ou=new hi,au=new es(1,1,1),lu=new hi,cu=new Ao,uu=new Fn,hu=new ri,du=new On,pu=new On,fu=new On,mu=new nu,gu=new Ws,Au=[];function yu(e,t,r=0){const n=t.itemSize;if(e.isInterleavedBufferAttribute||e.array.constructor!==t.array.constructor){const i=e.count;for(let s=0;s65535?new Uint32Array(n):new Uint16Array(n);t.setIndex(new ds(e,1))}this._geometryInitialized=!0}}_validateGeometry(e){const t=this.geometry;if(Boolean(e.getIndex())!==Boolean(t.getIndex()))throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const r in t.attributes){if(!e.hasAttribute(r))throw new Error(`BatchedMesh: Added geometry missing "${r}". All geometries must have consistent attributes.`);const n=e.getAttribute(r),i=t.getAttribute(r);if(n.itemSize!==i.itemSize||n.normalized!==i.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new Fn);const e=this.boundingBox,t=this._drawInfo;e.makeEmpty();for(let r=0,n=t.length;r=this._maxInstanceCount)throw new Error("BatchedMesh: Maximum item count reached.");this._drawInfo.push({visible:!0,active:!0,geometryIndex:e});const t=this._drawInfo.length-1,r=this._matricesTexture,n=r.image.data;ou.toArray(n,16*t),r.needsUpdate=!0;const i=this._colorsTexture;return i&&(au.toArray(i.image.data,4*t),i.needsUpdate=!0),t}addGeometry(e,t=-1,r=-1){if(this._initializeGeometry(e),this._validateGeometry(e),this._drawInfo.length>=this._maxInstanceCount)throw new Error("BatchedMesh: Maximum item count reached.");const n={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let i=null;const s=this._reservedRanges,o=this._drawRanges,a=this._bounds;0!==this._geometryCount&&(i=s[s.length-1]),n.vertexCount=-1===t?e.getAttribute("position").count:t,n.vertexStart=null===i?0:i.vertexStart+i.vertexCount;const l=e.getIndex(),c=null!==l;if(c&&(n.indexCount=-1===r?l.count:r,n.indexStart=null===i?0:i.indexStart+i.indexCount),-1!==n.indexStart&&n.indexStart+n.indexCount>this._maxIndexCount||n.vertexStart+n.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const u=this._geometryCount;return this._geometryCount++,s.push(n),o.push({start:c?n.indexStart:n.vertexStart,count:-1}),a.push({boxInitialized:!1,box:new Fn,sphereInitialized:!1,sphere:new ri}),this.setGeometryAt(u,e),u}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const r=this.geometry,n=null!==r.getIndex(),i=r.getIndex(),s=t.getIndex(),o=this._reservedRanges[e];if(n&&s.count>o.indexCount||t.attributes.position.count>o.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const a=o.vertexStart,l=o.vertexCount;for(const e in r.attributes){const n=t.getAttribute(e),i=r.getAttribute(e);yu(n,i,a);const s=n.itemSize;for(let e=n.count,t=l;e=this._geometryCount)return null;const r=this._bounds[e],n=r.box,i=this.geometry;if(!1===r.boxInitialized){n.makeEmpty();const t=i.index,s=i.attributes.position,o=this._drawRanges[e];for(let e=o.start,r=o.start+o.count;e=this._geometryCount)return null;const r=this._bounds[e],n=r.sphere,i=this.geometry;if(!1===r.sphereInitialized){n.makeEmpty(),this.getBoundingBoxAt(e,uu),uu.getCenter(n.center);const t=i.index,s=i.attributes.position,o=this._drawRanges[e];let a=0;for(let e=o.start,r=o.start+o.count;e=r.length||!1===r[e].active||(t.toArray(i,16*e),n.needsUpdate=!0),this}getMatrixAt(e,t){const r=this._drawInfo,n=this._matricesTexture.image.data;return e>=r.length||!1===r[e].active?null:t.fromArray(n,16*e)}setColorAt(e,t){null===this._colorsTexture&&this._initColorsTexture();const r=this._colorsTexture,n=this._colorsTexture.image.data,i=this._drawInfo;return e>=i.length||!1===i[e].active||(t.toArray(n,4*e),r.needsUpdate=!0),this}getColorAt(e,t){const r=this._colorsTexture.image.data,n=this._drawInfo;return e>=n.length||!1===n[e].active?null:t.fromArray(r,4*e)}setVisibleAt(e,t){const r=this._drawInfo;return e>=r.length||!1===r[e].active||r[e].visible===t||(r[e].visible=t,this._visibilityChanged=!0),this}getVisibleAt(e){const t=this._drawInfo;return!(e>=t.length||!1===t[e].active)&&t[e].visible}raycast(e,t){const r=this._drawInfo,n=this._drawRanges,i=this.matrixWorld,s=this.geometry;gu.material=this.material,gu.geometry.index=s.index,gu.geometry.attributes=s.attributes,null===gu.geometry.boundingBox&&(gu.geometry.boundingBox=new Fn),null===gu.geometry.boundingSphere&&(gu.geometry.boundingSphere=new ri);for(let s=0,o=r.length;s({...e}))),this._reservedRanges=e._reservedRanges.map((e=>({...e}))),this._drawInfo=e._drawInfo.map((e=>({...e}))),this._bounds=e._bounds.map((e=>({boxInitialized:e.boxInitialized,box:e.box.clone(),sphereInitialized:e.sphereInitialized,sphere:e.sphere.clone()}))),this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),null!==this._colorsTexture&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,null!==this._colorsTexture&&(this._colorsTexture.dispose(),this._colorsTexture=null),this}onBeforeRender(e,t,r,n,i){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const s=n.getIndex(),o=null===s?1:s.array.BYTES_PER_ELEMENT,a=this._drawInfo,l=this._multiDrawStarts,c=this._multiDrawCounts,u=this._drawRanges,h=this.perObjectFrustumCulled,d=this._indirectTexture,p=d.image.data;h&&(lu.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse).multiply(this.matrixWorld),cu.setFromProjectionMatrix(lu,e.coordinateSystem));let f=0;if(this.sortObjects){su.copy(this.matrixWorld).invert(),du.setFromMatrixPosition(r.matrixWorld).applyMatrix4(su),pu.set(0,0,-1).transformDirection(r.matrixWorld).transformDirection(su);for(let e=0,t=a.length;e0){const r=e[t[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=r.length;en)return;Su.applyMatrix4(e.matrixWorld);const a=t.ray.origin.distanceTo(Su);return at.far?void 0:{distance:a,point:Cu.clone().applyMatrix4(e.matrixWorld),index:i,face:null,faceIndex:null,object:e}}const Ru=new On,Bu=new On;class Pu extends Tu{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,r=[];for(let e=0,n=t.count;e0){const r=e[t[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=r.length;ei.far)return;s.push({distance:l,distanceToRay:Math.sqrt(a),point:r,index:t,face:null,object:o})}}class Gu extends Sn{constructor(e,t,r,n,i,s,o,a,l){super(e,t,r,n,i,s,o,a,l),this.isVideoTexture=!0,this.minFilter=void 0!==s?s:Ee,this.magFilter=void 0!==i?i:Ee,this.generateMipmaps=!1;const c=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function t(){c.needsUpdate=!0,e.requestVideoFrameCallback(t)}))}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;!1=="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class Qu extends Sn{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=ve,this.minFilter=ve,this.generateMipmaps=!1,this.needsUpdate=!0}}class Vu extends Sn{constructor(e,t,r,n,i,s,o,a,l,c,u,h){super(null,s,o,a,l,c,n,i,u,h),this.isCompressedTexture=!0,this.image={width:t,height:r},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class Hu extends Vu{constructor(e,t,r,n,i,s){super(e,t,r,i,s),this.isCompressedArrayTexture=!0,this.image.depth=n,this.wrapR=Ae,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class ju extends Vu{constructor(e,t,r){super(void 0,e[0].width,e[0].height,t,r,he),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class qu extends Sn{constructor(e,t,r,n,i,s,o,a,l){super(e,t,r,n,i,s,o,a,l),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Wu{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const r=this.getUtoTmapping(e);return this.getPoint(r,t)}getPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPoint(r/e));return t}getSpacedPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPointAt(r/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let r,n=this.getPoint(0),i=0;t.push(0);for(let s=1;s<=e;s++)r=this.getPoint(s/e),i+=r.distanceTo(n),t.push(i),n=r;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const r=this.getLengths();let n=0;const i=r.length;let s;s=t||e*r[i-1];let o,a=0,l=i-1;for(;a<=l;)if(n=Math.floor(a+(l-a)/2),o=r[n]-s,o<0)a=n+1;else{if(!(o>0)){l=n;break}l=n-1}if(n=l,r[n]===s)return n/(i-1);const c=r[n];return(n+(s-c)/(r[n+1]-c))/(i-1)}getTangent(e,t){const r=1e-4;let n=e-r,i=e+r;n<0&&(n=0),i>1&&(i=1);const s=this.getPoint(n),o=this.getPoint(i),a=t||(s.isVector2?new rn:new On);return a.copy(o).sub(s).normalize(),a}getTangentAt(e,t){const r=this.getUtoTmapping(e);return this.getTangent(r,t)}computeFrenetFrames(e,t){const r=new On,n=[],i=[],s=[],o=new On,a=new hi;for(let t=0;t<=e;t++){const r=t/e;n[t]=this.getTangentAt(r,new On)}i[0]=new On,s[0]=new On;let l=Number.MAX_VALUE;const c=Math.abs(n[0].x),u=Math.abs(n[0].y),h=Math.abs(n[0].z);c<=l&&(l=c,r.set(1,0,0)),u<=l&&(l=u,r.set(0,1,0)),h<=l&&r.set(0,0,1),o.crossVectors(n[0],r).normalize(),i[0].crossVectors(n[0],o),s[0].crossVectors(n[0],i[0]);for(let t=1;t<=e;t++){if(i[t]=i[t-1].clone(),s[t]=s[t-1].clone(),o.crossVectors(n[t-1],n[t]),o.length()>Number.EPSILON){o.normalize();const e=Math.acos(Kr(n[t-1].dot(n[t]),-1,1));i[t].applyMatrix4(a.makeRotationAxis(o,e))}s[t].crossVectors(n[t],i[t])}if(!0===t){let t=Math.acos(Kr(i[0].dot(i[e]),-1,1));t/=e,n[0].dot(o.crossVectors(i[0],i[e]))>0&&(t=-t);for(let r=1;r<=e;r++)i[r].applyMatrix4(a.makeRotationAxis(n[r],t*r)),s[r].crossVectors(n[r],i[r])}return{tangents:n,normals:i,binormals:s}}clone(){return(new this.constructor).copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Yu extends Wu{constructor(e=0,t=0,r=1,n=1,i=0,s=2*Math.PI,o=!1,a=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=r,this.yRadius=n,this.aStartAngle=i,this.aEndAngle=s,this.aClockwise=o,this.aRotation=a}getPoint(e,t=new rn){const r=t,n=2*Math.PI;let i=this.aEndAngle-this.aStartAngle;const s=Math.abs(i)n;)i-=n;i0?0:(Math.floor(Math.abs(l)/i)+1)*i:0===c&&l===i-1&&(l=i-2,c=1),this.closed||l>0?o=n[(l-1)%i]:($u.subVectors(n[0],n[1]).add(n[0]),o=$u);const u=n[l%i],h=n[(l+1)%i];if(this.closed||l+2n.length-2?n.length-1:s+1],u=n[s>n.length-3?n.length-1:s+2];return r.set(rh(o,a.x,l.x,c.x,u.x),rh(o,a.y,l.y,c.y,u.y)),r}copy(e){super.copy(e),this.points=[];for(let t=0,r=e.points.length;t=r){const e=n[i]-r,s=this.curves[i],o=s.getLength(),a=0===o?0:1-e/o;return s.getPointAt(a,t)}i++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let r=0,n=this.curves.length;r1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,r=e.curves.length;t0){const e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class mh extends Is{constructor(e=[new rn(0,-.5),new rn(.5,0),new rn(0,.5)],t=12,r=0,n=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:r,phiLength:n},t=Math.floor(t),n=Kr(n,0,2*Math.PI);const i=[],s=[],o=[],a=[],l=[],c=1/t,u=new On,h=new rn,d=new On,p=new On,f=new On;let m=0,g=0;for(let t=0;t<=e.length-1;t++)switch(t){case 0:m=e[t+1].x-e[t].x,g=e[t+1].y-e[t].y,d.x=1*g,d.y=-m,d.z=0*g,f.copy(d),d.normalize(),a.push(d.x,d.y,d.z);break;case e.length-1:a.push(f.x,f.y,f.z);break;default:m=e[t+1].x-e[t].x,g=e[t+1].y-e[t].y,d.x=1*g,d.y=-m,d.z=0*g,p.copy(d),d.x+=f.x,d.y+=f.y,d.z+=f.z,d.normalize(),a.push(d.x,d.y,d.z),f.copy(p)}for(let i=0;i<=t;i++){const d=r+i*c*n,p=Math.sin(d),f=Math.cos(d);for(let r=0;r<=e.length-1;r++){u.x=e[r].x*p,u.y=e[r].y,u.z=e[r].x*f,s.push(u.x,u.y,u.z),h.x=i/t,h.y=r/(e.length-1),o.push(h.x,h.y);const n=a[3*r+0]*p,c=a[3*r+1],d=a[3*r+0]*f;l.push(n,c,d)}}for(let r=0;r0&&A(!0),t>0&&A(!1)),this.setIndex(c),this.setAttribute("position",new _s(u,3)),this.setAttribute("normal",new _s(h,3)),this.setAttribute("uv",new _s(d,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new yh(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class vh extends yh{constructor(e=1,t=1,r=32,n=1,i=!1,s=0,o=2*Math.PI){super(0,e,t,r,n,i,s,o),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:r,heightSegments:n,openEnded:i,thetaStart:s,thetaLength:o}}static fromJSON(e){return new vh(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class xh extends Is{constructor(e=[],t=[],r=1,n=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:r,detail:n};const i=[],s=[];function o(e,t,r,n){const i=n+1,s=[];for(let n=0;n<=i;n++){s[n]=[];const o=e.clone().lerp(r,n/i),a=t.clone().lerp(r,n/i),l=i-n;for(let e=0;e<=l;e++)s[n][e]=0===e&&n===i?o:o.clone().lerp(a,e/l)}for(let e=0;e.9&&o<.1&&(t<.2&&(s[e+0]+=1),r<.2&&(s[e+2]+=1),n<.2&&(s[e+4]+=1))}}()}(),this.setAttribute("position",new _s(i,3)),this.setAttribute("normal",new _s(i.slice(),3)),this.setAttribute("uv",new _s(s,2)),0===n?this.computeVertexNormals():this.normalizeNormals()}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new xh(e.vertices,e.indices,e.radius,e.details)}}class _h extends xh{constructor(e=1,t=0){const r=(1+Math.sqrt(5))/2,n=1/r;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-n,-r,0,-n,r,0,n,-r,0,n,r,-n,-r,0,-n,r,0,n,-r,0,n,r,0,-r,0,-n,r,0,-n,-r,0,n,r,0,n],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new _h(e.radius,e.detail)}}const bh=new On,wh=new On,Eh=new On,Mh=new Xi;class Sh extends Is{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},null!==e){const r=4,n=Math.pow(10,r),i=Math.cos(Wr*t),s=e.getIndex(),o=e.getAttribute("position"),a=s?s.count:o.count,l=[0,0,0],c=["a","b","c"],u=new Array(3),h={},d=[];for(let e=0;e0)for(s=t;s=t;s-=n)o=Xh(s,e[s],e[s+1],o);return o&&Vh(o,o.next)&&(Kh(o),o=o.next),o}function Ih(e,t){if(!e)return e;t||(t=e);let r,n=e;do{if(r=!1,n.steiner||!Vh(n,n.next)&&0!==Qh(n.prev,n,n.next))n=n.next;else{if(Kh(n),n=t=n.prev,n===n.next)break;r=!0}}while(r||n!==t);return t}function Rh(e,t,r,n,i,s,o){if(!e)return;!o&&s&&function(e,t,r,n){let i=e;do{0===i.z&&(i.z=Fh(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){let t,r,n,i,s,o,a,l,c=1;do{for(r=e,e=null,s=null,o=0;r;){for(o++,n=r,a=0,t=0;t0||l>0&&n;)0!==a&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,a--):(i=n,n=n.nextZ,l--),s?s.nextZ=i:e=i,i.prevZ=s,s=i;r=n}s.nextZ=null,c*=2}while(o>1)}(i)}(e,n,i,s);let a,l,c=e;for(;e.prev!==e.next;)if(a=e.prev,l=e.next,s?Ph(e,n,i,s):Bh(e))t.push(a.i/r|0),t.push(e.i/r|0),t.push(l.i/r|0),Kh(e),e=l.next,c=l.next;else if((e=l)===c){o?1===o?Rh(e=Lh(Ih(e),t,r),t,r,n,i,s,2):2===o&&Dh(e,t,r,n,i,s):Rh(Ih(e),t,r,n,i,s,1);break}}function Bh(e){const t=e.prev,r=e,n=e.next;if(Qh(t,r,n)>=0)return!1;const i=t.x,s=r.x,o=n.x,a=t.y,l=r.y,c=n.y,u=is?i>o?i:o:s>o?s:o,p=a>l?a>c?a:c:l>c?l:c;let f=n.next;for(;f!==t;){if(f.x>=u&&f.x<=d&&f.y>=h&&f.y<=p&&zh(i,a,s,l,o,c,f.x,f.y)&&Qh(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function Ph(e,t,r,n){const i=e.prev,s=e,o=e.next;if(Qh(i,s,o)>=0)return!1;const a=i.x,l=s.x,c=o.x,u=i.y,h=s.y,d=o.y,p=al?a>c?a:c:l>c?l:c,g=u>h?u>d?u:d:h>d?h:d,A=Fh(p,f,t,r,n),y=Fh(m,g,t,r,n);let v=e.prevZ,x=e.nextZ;for(;v&&v.z>=A&&x&&x.z<=y;){if(v.x>=p&&v.x<=m&&v.y>=f&&v.y<=g&&v!==i&&v!==o&&zh(a,u,l,h,c,d,v.x,v.y)&&Qh(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==i&&x!==o&&zh(a,u,l,h,c,d,x.x,x.y)&&Qh(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;v&&v.z>=A;){if(v.x>=p&&v.x<=m&&v.y>=f&&v.y<=g&&v!==i&&v!==o&&zh(a,u,l,h,c,d,v.x,v.y)&&Qh(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;x&&x.z<=y;){if(x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==i&&x!==o&&zh(a,u,l,h,c,d,x.x,x.y)&&Qh(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function Lh(e,t,r){let n=e;do{const i=n.prev,s=n.next.next;!Vh(i,s)&&Hh(i,n,n.next,s)&&Wh(i,s)&&Wh(s,i)&&(t.push(i.i/r|0),t.push(n.i/r|0),t.push(s.i/r|0),Kh(n),Kh(n.next),n=e=s),n=n.next}while(n!==e);return Ih(n)}function Dh(e,t,r,n,i,s){let o=e;do{let e=o.next.next;for(;e!==o.prev;){if(o.i!==e.i&&Gh(o,e)){let a=Yh(o,e);return o=Ih(o,o.next),a=Ih(a,a.next),Rh(o,t,r,n,i,s,0),void Rh(a,t,r,n,i,s,0)}e=e.next}o=o.next}while(o!==e)}function Oh(e,t){return e.x-t.x}function Nh(e,t){const r=function(e,t){let r,n=t,i=-1/0;const s=e.x,o=e.y;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){const e=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=s&&e>i&&(i=e,r=n.x=n.x&&n.x>=l&&s!==n.x&&zh(or.x||n.x===r.x&&Uh(r,n)))&&(r=n,h=u)),n=n.next}while(n!==a);return r}(e,t);if(!r)return t;const n=Yh(r,e);return Ih(n,n.next),Ih(r,r.next)}function Uh(e,t){return Qh(e.prev,e,t.prev)<0&&Qh(t.next,e,e.next)<0}function Fh(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function kh(e){let t=e,r=e;do{(t.x=(e-o)*(s-a)&&(e-o)*(n-a)>=(r-o)*(t-a)&&(r-o)*(s-a)>=(i-o)*(n-a)}function Gh(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&Hh(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(Wh(e,t)&&Wh(t,e)&&function(e,t){let r=e,n=!1;const i=(e.x+t.x)/2,s=(e.y+t.y)/2;do{r.y>s!=r.next.y>s&&r.next.y!==r.y&&i<(r.next.x-r.x)*(s-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(Qh(e.prev,e,t.prev)||Qh(e,t.prev,t))||Vh(e,t)&&Qh(e.prev,e,e.next)>0&&Qh(t.prev,t,t.next)>0)}function Qh(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Vh(e,t){return e.x===t.x&&e.y===t.y}function Hh(e,t,r,n){const i=qh(Qh(e,t,r)),s=qh(Qh(e,t,n)),o=qh(Qh(r,n,e)),a=qh(Qh(r,n,t));return i!==s&&o!==a||!(0!==i||!jh(e,r,t))||!(0!==s||!jh(e,n,t))||!(0!==o||!jh(r,e,n))||!(0!==a||!jh(r,t,n))}function jh(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function qh(e){return e>0?1:e<0?-1:0}function Wh(e,t){return Qh(e.prev,e,e.next)<0?Qh(e,t,e.next)>=0&&Qh(e,e.prev,t)>=0:Qh(e,t,e.prev)<0||Qh(e,e.next,t)<0}function Yh(e,t){const r=new $h(e.i,e.x,e.y),n=new $h(t.i,t.x,t.y),i=e.next,s=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,s.next=n,n.prev=s,n}function Xh(e,t,r,n){const i=new $h(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Kh(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function $h(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}class Jh{static area(e){const t=e.length;let r=0;for(let n=t-1,i=0;i80*r){a=c=e[0],l=u=e[1];for(let t=r;tc&&(c=h),d>u&&(u=d);p=Math.max(c-a,u-l),p=0!==p?32767/p:0}return Rh(s,o,r,a,l,p,0),o}(r,n);for(let e=0;e2&&e[t-1].equals(e[0])&&e.pop()}function ed(e,t){for(let r=0;rNumber.EPSILON){const h=Math.sqrt(u),d=Math.sqrt(l*l+c*c),p=t.x-a/h,f=t.y+o/h,m=((r.x-c/d-p)*c-(r.y+l/d-f)*l)/(o*c-a*l);n=p+o*m-e.x,i=f+a*m-e.y;const g=n*n+i*i;if(g<=2)return new rn(n,i);s=Math.sqrt(g/2)}else{let e=!1;o>Number.EPSILON?l>Number.EPSILON&&(e=!0):o<-Number.EPSILON?l<-Number.EPSILON&&(e=!0):Math.sign(a)===Math.sign(c)&&(e=!0),e?(n=-a,i=o,s=Math.sqrt(u)):(n=o,i=a,s=Math.sqrt(u/2))}return new rn(n/s,i/s)}const B=[];for(let e=0,t=S.length,r=t-1,n=e+1;e=0;e--){const t=e/p,r=u*Math.cos(t*Math.PI/2),n=h*Math.sin(t*Math.PI/2)+d;for(let e=0,t=S.length;e=0;){const n=r;let i=r-1;i<0&&(i=e.length-1);for(let e=0,r=a+2*p;e0)&&d.push(t,i,l),(e!==r-1||a0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class vd extends ns{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new es(16777215),this.specular=new es(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new es(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Kt,this.normalScale=new rn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new _i,this.combine=$,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(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class xd extends ns{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new es(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new es(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Kt,this.normalScale=new rn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class _d extends ns{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Kt,this.normalScale=new rn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class bd extends ns{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new es(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new es(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Kt,this.normalScale=new rn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new _i,this.combine=$,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(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class wd extends ns{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new es(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Kt,this.normalScale=new rn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Ed extends xu{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function Md(e,t,r){return!e||!r&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)}function Sd(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Cd(e){const t=e.length,r=new Array(t);for(let e=0;e!==t;++e)r[e]=e;return r.sort((function(t,r){return e[t]-e[r]})),r}function Td(e,t,r){const n=e.length,i=new e.constructor(n);for(let s=0,o=0;o!==n;++s){const n=r[s]*t;for(let r=0;r!==t;++r)i[o++]=e[n+r]}return i}function Id(e,t,r,n){let i=1,s=e[0];for(;void 0!==s&&void 0===s[n];)s=e[i++];if(void 0===s)return;let o=s[n];if(void 0!==o)if(Array.isArray(o))do{o=s[n],void 0!==o&&(t.push(s.time),r.push.apply(r,o)),s=e[i++]}while(void 0!==s);else if(void 0!==o.toArray)do{o=s[n],void 0!==o&&(t.push(s.time),o.toArray(r,r.length)),s=e[i++]}while(void 0!==s);else do{o=s[n],void 0!==o&&(t.push(s.time),r.push(o)),s=e[i++]}while(void 0!==s)}const Rd={convertArray:Md,isTypedArray:Sd,getKeyframeOrder:Cd,sortedArray:Td,flattenJSON:Id,subclip:function(e,t,r,n,i=30){const s=e.clone();s.name=t;const o=[];for(let e=0;e=n)){l.push(t.times[e]);for(let r=0;rs.tracks[e].times[0]&&(a=s.tracks[e].times[0]);for(let e=0;e=n.times[h]){const e=h*l+a,t=e+l-a;d=n.values.slice(e,t)}else{const e=n.createInterpolant(),t=a,r=l-a;e.evaluate(s),d=e.resultBuffer.slice(t,r)}"quaternion"===i&&(new Dn).fromArray(d).normalize().conjugate().toArray(d);const p=o.times.length;for(let e=0;e=i)break e;{const o=t[1];e=i)break t}s=r,r=0}}for(;r>>1;et;)--s;if(++s,0!==i||s!==n){i>=s&&(s=Math.max(s,1),i=s-1);const e=this.getValueSize();this.times=r.slice(i,s),this.values=this.values.slice(i*e,s*e)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const r=this.times,n=this.values,i=r.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let s=null;for(let t=0;t!==i;t++){const n=r[t];if("number"==typeof n&&isNaN(n)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,t,n),e=!1;break}if(null!==s&&s>n){console.error("THREE.KeyframeTrack: Out of order keys.",this,t,n,s),e=!1;break}s=n}if(void 0!==n&&Sd(n))for(let t=0,r=n.length;t!==r;++t){const r=n[t];if(isNaN(r)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,t,r),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),r=this.getValueSize(),n=this.getInterpolation()===Ut,i=e.length-1;let s=1;for(let o=1;o0){e[s]=e[i];for(let e=i*r,n=s*r,o=0;o!==r;++o)t[n+o]=t[e+o];++s}return s!==e.length?(this.times=e.slice(0,s),this.values=t.slice(0,s*r)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),r=new(0,this.constructor)(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}Od.prototype.TimeBufferType=Float32Array,Od.prototype.ValueBufferType=Float32Array,Od.prototype.DefaultInterpolation=Nt;class Nd extends Od{constructor(e,t,r){super(e,t,r)}}Nd.prototype.ValueTypeName="bool",Nd.prototype.ValueBufferType=Array,Nd.prototype.DefaultInterpolation=Ot,Nd.prototype.InterpolantFactoryMethodLinear=void 0,Nd.prototype.InterpolantFactoryMethodSmooth=void 0;class Ud extends Od{}Ud.prototype.ValueTypeName="color";class Fd extends Od{}Fd.prototype.ValueTypeName="number";class kd extends Bd{constructor(e,t,r,n){super(e,t,r,n)}interpolate_(e,t,r,n){const i=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=(r-t)/(n-t);let l=e*o;for(let e=l+o;l!==e;l+=4)Dn.slerpFlat(i,0,s,l-o,s,l,a);return i}}class zd extends Od{InterpolantFactoryMethodLinear(e){return new kd(this.times,this.values,this.getValueSize(),e)}}zd.prototype.ValueTypeName="quaternion",zd.prototype.InterpolantFactoryMethodSmooth=void 0;class Gd extends Od{constructor(e,t,r){super(e,t,r)}}Gd.prototype.ValueTypeName="string",Gd.prototype.ValueBufferType=Array,Gd.prototype.DefaultInterpolation=Ot,Gd.prototype.InterpolantFactoryMethodLinear=void 0,Gd.prototype.InterpolantFactoryMethodSmooth=void 0;class Qd extends Od{}Qd.prototype.ValueTypeName="vector";class Vd{constructor(e="",t=-1,r=[],n=Gt){this.name=e,this.tracks=r,this.duration=t,this.blendMode=n,this.uuid=Xr(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],r=e.tracks,n=1/(e.fps||1);for(let e=0,i=r.length;e!==i;++e)t.push(Hd(r[e]).scale(n));const i=new this(e.name,e.duration,t,e.blendMode);return i.uuid=e.uuid,i}static toJSON(e){const t=[],r=e.tracks,n={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let e=0,n=r.length;e!==n;++e)t.push(Od.toJSON(r[e]));return n}static CreateFromMorphTargetSequence(e,t,r,n){const i=t.length,s=[];for(let e=0;e1){const e=s[1];let t=n[e];t||(n[e]=t=[]),t.push(r)}}const s=[];for(const e in n)s.push(this.CreateFromMorphTargetSequence(e,n[e],t,r));return s}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(e,t,r,n,i){if(0!==r.length){const s=[],o=[];Id(r,s,o,n),0!==s.length&&i.push(new e(t,s,o))}},n=[],i=e.name||"default",s=e.fps||30,o=e.blendMode;let a=e.length||-1;const l=e.hierarchy||[];for(let e=0;e{t&&t(i),this.manager.itemEnd(e)}),0),i;if(void 0!==Xd[e])return void Xd[e].push({onLoad:t,onProgress:r,onError:n});Xd[e]=[],Xd[e].push({onLoad:t,onProgress:r,onError:n});const s=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,a=this.responseType;fetch(s).then((t=>{if(200===t.status||0===t.status){if(0===t.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===t.body||void 0===t.body.getReader)return t;const r=Xd[e],n=t.body.getReader(),i=t.headers.get("X-File-Size")||t.headers.get("Content-Length"),s=i?parseInt(i):0,o=0!==s;let a=0;const l=new ReadableStream({start(e){!function t(){n.read().then((({done:n,value:i})=>{if(n)e.close();else{a+=i.byteLength;const n=new ProgressEvent("progress",{lengthComputable:o,loaded:a,total:s});for(let e=0,t=r.length;e{e.error(t)}))}()}});return new Response(l)}throw new Kd(`fetch for "${t.url}" responded with ${t.status}: ${t.statusText}`,t)})).then((e=>{switch(a){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"document":return e.text().then((e=>(new DOMParser).parseFromString(e,o)));case"json":return e.json();default:if(void 0===o)return e.text();{const t=/charset="?([^;"\s]*)"?/i.exec(o),r=t&&t[1]?t[1].toLowerCase():void 0,n=new TextDecoder(r);return e.arrayBuffer().then((e=>n.decode(e)))}}})).then((t=>{jd.add(e,t);const r=Xd[e];delete Xd[e];for(let e=0,n=r.length;e{const r=Xd[e];if(void 0===r)throw this.manager.itemError(e),t;delete Xd[e];for(let e=0,n=r.length;e{this.manager.itemEnd(e)})),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class Jd extends Yd{constructor(e){super(e)}load(e,t,r,n){const i=this,s=new $d(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(r){try{t(i.parse(JSON.parse(r)))}catch(t){n?n(t):console.error(t),i.manager.itemError(e)}}),r,n)}parse(e){const t=[];for(let r=0;r0:n.vertexColors=e.vertexColors),void 0!==e.uniforms)for(const t in e.uniforms){const i=e.uniforms[t];switch(n.uniforms[t]={},i.type){case"t":n.uniforms[t].value=r(i.value);break;case"c":n.uniforms[t].value=(new es).setHex(i.value);break;case"v2":n.uniforms[t].value=(new rn).fromArray(i.value);break;case"v3":n.uniforms[t].value=(new On).fromArray(i.value);break;case"v4":n.uniforms[t].value=(new Cn).fromArray(i.value);break;case"m3":n.uniforms[t].value=(new nn).fromArray(i.value);break;case"m4":n.uniforms[t].value=(new hi).fromArray(i.value);break;default:n.uniforms[t].value=i.value}}if(void 0!==e.defines&&(n.defines=e.defines),void 0!==e.vertexShader&&(n.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(n.fragmentShader=e.fragmentShader),void 0!==e.glslVersion&&(n.glslVersion=e.glslVersion),void 0!==e.extensions)for(const t in e.extensions)n.extensions[t]=e.extensions[t];if(void 0!==e.lights&&(n.lights=e.lights),void 0!==e.clipping&&(n.clipping=e.clipping),void 0!==e.size&&(n.size=e.size),void 0!==e.sizeAttenuation&&(n.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(n.map=r(e.map)),void 0!==e.matcap&&(n.matcap=r(e.matcap)),void 0!==e.alphaMap&&(n.alphaMap=r(e.alphaMap)),void 0!==e.bumpMap&&(n.bumpMap=r(e.bumpMap)),void 0!==e.bumpScale&&(n.bumpScale=e.bumpScale),void 0!==e.normalMap&&(n.normalMap=r(e.normalMap)),void 0!==e.normalMapType&&(n.normalMapType=e.normalMapType),void 0!==e.normalScale){let t=e.normalScale;!1===Array.isArray(t)&&(t=[t,t]),n.normalScale=(new rn).fromArray(t)}return void 0!==e.displacementMap&&(n.displacementMap=r(e.displacementMap)),void 0!==e.displacementScale&&(n.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(n.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(n.roughnessMap=r(e.roughnessMap)),void 0!==e.metalnessMap&&(n.metalnessMap=r(e.metalnessMap)),void 0!==e.emissiveMap&&(n.emissiveMap=r(e.emissiveMap)),void 0!==e.emissiveIntensity&&(n.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(n.specularMap=r(e.specularMap)),void 0!==e.specularIntensityMap&&(n.specularIntensityMap=r(e.specularIntensityMap)),void 0!==e.specularColorMap&&(n.specularColorMap=r(e.specularColorMap)),void 0!==e.envMap&&(n.envMap=r(e.envMap)),void 0!==e.envMapRotation&&n.envMapRotation.fromArray(e.envMapRotation),void 0!==e.envMapIntensity&&(n.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(n.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(n.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(n.lightMap=r(e.lightMap)),void 0!==e.lightMapIntensity&&(n.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(n.aoMap=r(e.aoMap)),void 0!==e.aoMapIntensity&&(n.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(n.gradientMap=r(e.gradientMap)),void 0!==e.clearcoatMap&&(n.clearcoatMap=r(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(n.clearcoatRoughnessMap=r(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(n.clearcoatNormalMap=r(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(n.clearcoatNormalScale=(new rn).fromArray(e.clearcoatNormalScale)),void 0!==e.iridescenceMap&&(n.iridescenceMap=r(e.iridescenceMap)),void 0!==e.iridescenceThicknessMap&&(n.iridescenceThicknessMap=r(e.iridescenceThicknessMap)),void 0!==e.transmissionMap&&(n.transmissionMap=r(e.transmissionMap)),void 0!==e.thicknessMap&&(n.thicknessMap=r(e.thicknessMap)),void 0!==e.anisotropyMap&&(n.anisotropyMap=r(e.anisotropyMap)),void 0!==e.sheenColorMap&&(n.sheenColorMap=r(e.sheenColorMap)),void 0!==e.sheenRoughnessMap&&(n.sheenRoughnessMap=r(e.sheenRoughnessMap)),n}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){return new{ShadowMaterial:md,SpriteMaterial:dc,RawShaderMaterial:gd,ShaderMaterial:eo,PointsMaterial:Du,MeshPhysicalMaterial:yd,MeshStandardMaterial:Ad,MeshPhongMaterial:vd,MeshToonMaterial:xd,MeshNormalMaterial:_d,MeshLambertMaterial:bd,MeshDepthMaterial:Gl,MeshDistanceMaterial:Ql,MeshBasicMaterial:is,MeshMatcapMaterial:wd,LineDashedMaterial:Ed,LineBasicMaterial:xu,Material:ns}[e]}}class Ep{static decodeText(e){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);let t="";for(let r=0,n=e.length;r0){const r=new qd(t);i=new ep(r),i.setCrossOrigin(this.crossOrigin);for(let t=0,r=e.length;t0){n=new ep(this.manager),n.setCrossOrigin(this.crossOrigin);for(let t=0,n=e.length;t{const t=new Fn;t.min.fromArray(e.boxMin),t.max.fromArray(e.boxMax);const r=new ri;return r.radius=e.sphereRadius,r.center.fromArray(e.sphereCenter),{boxInitialized:e.boxInitialized,box:t,sphereInitialized:e.sphereInitialized,sphere:r}})),s._maxInstanceCount=e.maxInstanceCount,s._maxVertexCount=e.maxVertexCount,s._maxIndexCount=e.maxIndexCount,s._geometryInitialized=e.geometryInitialized,s._geometryCount=e.geometryCount,s._matricesTexture=u(e.matricesTexture.uuid),void 0!==e.colorsTexture&&(s._colorsTexture=u(e.colorsTexture.uuid));break;case"LOD":s=new Rc;break;case"Line":s=new Tu(l(e.geometry),c(e.material));break;case"LineLoop":s=new Lu(l(e.geometry),c(e.material));break;case"LineSegments":s=new Pu(l(e.geometry),c(e.material));break;case"PointCloud":case"Points":s=new ku(l(e.geometry),c(e.material));break;case"Sprite":s=new Sc(c(e.material));break;case"Group":s=new Kl;break;case"Bone":s=new Gc;break;default:s=new Fi}if(s.uuid=e.uuid,void 0!==e.name&&(s.name=e.name),void 0!==e.matrix?(s.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(s.matrixAutoUpdate=e.matrixAutoUpdate),s.matrixAutoUpdate&&s.matrix.decompose(s.position,s.quaternion,s.scale)):(void 0!==e.position&&s.position.fromArray(e.position),void 0!==e.rotation&&s.rotation.fromArray(e.rotation),void 0!==e.quaternion&&s.quaternion.fromArray(e.quaternion),void 0!==e.scale&&s.scale.fromArray(e.scale)),void 0!==e.up&&s.up.fromArray(e.up),void 0!==e.castShadow&&(s.castShadow=e.castShadow),void 0!==e.receiveShadow&&(s.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.intensity&&(s.shadow.intensity=e.shadow.intensity),void 0!==e.shadow.bias&&(s.shadow.bias=e.shadow.bias),void 0!==e.shadow.normalBias&&(s.shadow.normalBias=e.shadow.normalBias),void 0!==e.shadow.radius&&(s.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&s.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(s.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(s.visible=e.visible),void 0!==e.frustumCulled&&(s.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(s.renderOrder=e.renderOrder),void 0!==e.userData&&(s.userData=e.userData),void 0!==e.layers&&(s.layers.mask=e.layers),void 0!==e.children){const o=e.children;for(let e=0;e{t&&t(r),i.manager.itemEnd(e)})).catch((e=>{n&&n(e)})):(setTimeout((function(){t&&t(s),i.manager.itemEnd(e)}),0),s);const o={};o.credentials="anonymous"===this.crossOrigin?"same-origin":"include",o.headers=this.requestHeader;const a=fetch(e,o).then((function(e){return e.blob()})).then((function(e){return createImageBitmap(e,Object.assign(i.options,{colorSpaceConversion:"none"}))})).then((function(r){return jd.add(e,r),t&&t(r),i.manager.itemEnd(e),r})).catch((function(t){n&&n(t),jd.remove(e),i.manager.itemError(e),i.manager.itemEnd(e)}));jd.add(e,a),i.manager.itemStart(e)}}let Pp;class Lp{static getContext(){return void 0===Pp&&(Pp=new(window.AudioContext||window.webkitAudioContext)),Pp}static setContext(e){Pp=e}}class Dp extends Yd{constructor(e){super(e)}load(e,t,r,n){const i=this,s=new $d(this.manager);function o(t){n?n(t):console.error(t),i.manager.itemError(e)}s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(e){try{const r=e.slice(0);Lp.getContext().decodeAudioData(r,(function(e){t(e)})).catch(o)}catch(e){o(e)}}),r,n)}}const Op=new hi,Np=new hi,Up=new hi;class Fp{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new so,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new so,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,Up.copy(e.projectionMatrix);const r=t.eyeSep/2,n=r*t.near/t.focus,i=t.near*Math.tan(Wr*t.fov*.5)/t.zoom;let s,o;Np.elements[12]=-r,Op.elements[12]=r,s=-i*t.aspect+n,o=i*t.aspect+n,Up.elements[0]=2*t.near/(o-s),Up.elements[8]=(o+s)/(o-s),this.cameraL.projectionMatrix.copy(Up),s=-i*t.aspect-n,o=i*t.aspect-n,Up.elements[0]=2*t.near/(o-s),Up.elements[8]=(o+s)/(o-s),this.cameraR.projectionMatrix.copy(Up)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Np),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Op)}}class kp{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=zp(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=zp();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function zp(){return("undefined"==typeof performance?Date:performance).now()}const Gp=new On,Qp=new Dn,Vp=new On,Hp=new On;class jp extends Fi{constructor(){super(),this.type="AudioListener",this.context=Lp.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new kp}getInput(){return this.gain}removeFilter(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,r=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Gp,Qp,Vp),Hp.set(0,0,-1).applyQuaternion(Qp),t.positionX){const e=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Gp.x,e),t.positionY.linearRampToValueAtTime(Gp.y,e),t.positionZ.linearRampToValueAtTime(Gp.z,e),t.forwardX.linearRampToValueAtTime(Hp.x,e),t.forwardY.linearRampToValueAtTime(Hp.y,e),t.forwardZ.linearRampToValueAtTime(Hp.z,e),t.upX.linearRampToValueAtTime(r.x,e),t.upY.linearRampToValueAtTime(r.y,e),t.upZ.linearRampToValueAtTime(r.z,e)}else t.setPosition(Gp.x,Gp.y,Gp.z),t.setOrientation(Hp.x,Hp.y,Hp.z,r.x,r.y,r.z)}}class qp extends Fi{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}stop(){if(!1!==this.hasPlaybackControl)return this._progress=0,null!==this.source&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(r,n,this._addIndex*t,1,t);for(let e=t,i=t+t;e!==i;++e)if(r[e]!==r[e+t]){o.setValue(r,n);break}}saveOriginalState(){const e=this.binding,t=this.buffer,r=this.valueSize,n=r*this._origIndex;e.getValue(t,n);for(let e=r,i=n;e!==i;++e)t[e]=t[n+e%r];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=3*this.valueSize;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let r=e;r=.5)for(let n=0;n!==i;++n)e[t+n]=e[r+n]}_slerp(e,t,r,n){Dn.slerpFlat(e,t,e,t,e,r,n)}_slerpAdditive(e,t,r,n,i){const s=this._workIndex*i;Dn.multiplyQuaternionsFlat(e,s,e,t,e,r),Dn.slerpFlat(e,t,e,t,e,s,n)}_lerp(e,t,r,n,i){const s=1-n;for(let o=0;o!==i;++o){const i=t+o;e[i]=e[i]*s+e[r+o]*n}}_lerpAdditive(e,t,r,n,i){for(let s=0;s!==i;++s){const i=t+s;e[i]=e[i]+e[r+s]*n}}}const ef="\\[\\]\\.:\\/",tf=new RegExp("["+ef+"]","g"),rf="[^"+ef+"]",nf="[^"+ef.replace("\\.","")+"]",sf=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",rf)+/(WCOD+)?/.source.replace("WCOD",nf)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",rf)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",rf)+"$"),of=["material","materials","bones","map"];class af{constructor(e,t,r){this.path=t,this.parsedPath=r||af.parseTrackName(t),this.node=af.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,r){return e&&e.isAnimationObjectGroup?new af.Composite(e,t,r):new af(e,t,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(tf,"")}static parseTrackName(e){const t=sf.exec(e);if(null===t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const r={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},n=r.nodeName&&r.nodeName.lastIndexOf(".");if(void 0!==n&&-1!==n){const e=r.nodeName.substring(n+1);-1!==of.indexOf(e)&&(r.nodeName=r.nodeName.substring(0,n),r.objectName=e)}if(null===r.propertyName||0===r.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,t){if(void 0===t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){const r=e.skeleton.getBoneByName(t);if(void 0!==r)return r}if(e.children){const r=function(e){for(let n=0;n=i){const s=i++,c=e[s];t[c.uuid]=l,e[l]=c,t[a]=s,e[s]=o;for(let e=0,t=n;e!==t;++e){const t=r[e],n=t[s],i=t[l];t[l]=n,t[s]=i}}}this.nCachedObjects_=i}uncache(){const e=this._objects,t=this._indicesByUUID,r=this._bindings,n=r.length;let i=this.nCachedObjects_,s=e.length;for(let o=0,a=arguments.length;o!==a;++o){const a=arguments[o].uuid,l=t[a];if(void 0!==l)if(delete t[a],l0&&(t[o.uuid]=l),e[l]=o,e.pop();for(let e=0,t=n;e!==t;++e){const t=r[e];t[l]=t[i],t.pop()}}}this.nCachedObjects_=i}subscribe_(e,t){const r=this._bindingsIndicesByPath;let n=r[e];const i=this._bindings;if(void 0!==n)return i[n];const s=this._paths,o=this._parsedPaths,a=this._objects,l=a.length,c=this.nCachedObjects_,u=new Array(l);n=i.length,r[e]=n,s.push(e),o.push(t),i.push(u);for(let r=c,n=a.length;r!==n;++r){const n=a[r];u[r]=new af(n,e,t)}return u}unsubscribe_(e){const t=this._bindingsIndicesByPath,r=t[e];if(void 0!==r){const n=this._paths,i=this._parsedPaths,s=this._bindings,o=s.length-1,a=s[o];t[e[o]]=r,s[r]=a,s.pop(),i[r]=i[o],i.pop(),n[r]=n[o],n.pop()}}}class cf{constructor(e,t,r=null,n=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=r,this.blendMode=n;const i=t.tracks,s=i.length,o=new Array(s),a={endingStart:Ft,endingEnd:Ft};for(let e=0;e!==s;++e){const t=i[e].createInterpolant(null);o[e]=t,t.settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Lt,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,r){if(e.fadeOut(t),this.fadeIn(t),r){const r=this._clip.duration,n=e._clip.duration,i=n/r,s=r/n;e.warp(1,i,t),this.warp(s,1,t)}return this}crossFadeTo(e,t,r){return e.crossFadeFrom(this,t,r)}stopFading(){const e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,r){const n=this._mixer,i=n.time,s=this.timeScale;let o=this._timeScaleInterpolant;null===o&&(o=n._lendControlInterpolant(),this._timeScaleInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=i,a[1]=i+r,l[0]=e/s,l[1]=t/s,this}stopWarping(){const e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,r,n){if(!this.enabled)return void this._updateWeight(e);const i=this._startTime;if(null!==i){const n=(e-i)*r;n<0||0===r?t=0:(this._startTime=null,t=r*n)}t*=this._updateTimeScale(e);const s=this._updateTime(t),o=this._updateWeight(e);if(o>0){const e=this._interpolants,t=this._propertyBindings;if(this.blendMode===Qt)for(let r=0,n=e.length;r!==n;++r)e[r].evaluate(s),t[r].accumulateAdditive(o);else for(let r=0,i=e.length;r!==i;++r)e[r].evaluate(s),t[r].accumulate(n,o)}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const r=this._weightInterpolant;if(null!==r){const n=r.evaluate(e)[0];t*=n,e>r.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const r=this._timeScaleInterpolant;null!==r&&(t*=r.evaluate(e)[0],e>r.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,r=this.loop;let n=this.time+e,i=this._loopCount;const s=r===Dt;if(0===e)return-1===i||!s||1&~i?n:t-n;if(r===Pt){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(n>=t)n=t;else{if(!(n<0)){this.time=n;break e}n=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),n>=t||n<0){const r=Math.floor(n/t);n-=t*r,i+=Math.abs(r);const o=this.repetitions-i;if(o<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=e>0?t:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===o){const t=e<0;this._setEndings(t,!t,s)}else this._setEndings(!1,!1,s);this._loopCount=i,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:r})}}else this.time=n;if(s&&!(1&~i))return t-n}return n}_setEndings(e,t,r){const n=this._interpolantSettings;r?(n.endingStart=kt,n.endingEnd=kt):(n.endingStart=e?this.zeroSlopeAtStart?kt:Ft:zt,n.endingEnd=t?this.zeroSlopeAtEnd?kt:Ft:zt)}_scheduleFading(e,t,r){const n=this._mixer,i=n.time;let s=this._weightInterpolant;null===s&&(s=n._lendControlInterpolant(),this._weightInterpolant=s);const o=s.parameterPositions,a=s.sampleValues;return o[0]=i,a[0]=t,o[1]=i+e,a[1]=r,this}}const uf=new Float32Array(1);class hf extends Hr{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const r=e._localRoot||this._root,n=e._clip.tracks,i=n.length,s=e._propertyBindings,o=e._interpolants,a=r.uuid,l=this._bindingsByRootAndName;let c=l[a];void 0===c&&(c={},l[a]=c);for(let e=0;e!==i;++e){const i=n[e],l=i.name;let u=c[l];if(void 0!==u)++u.referenceCount,s[e]=u;else{if(u=s[e],void 0!==u){null===u._cacheIndex&&(++u.referenceCount,this._addInactiveBinding(u,a,l));continue}const n=t&&t._propertyBindings[e].binding.parsedPath;u=new Zp(af.create(r,l,n),i.ValueTypeName,i.getValueSize()),++u.referenceCount,this._addInactiveBinding(u,a,l),s[e]=u}o[e].resultBuffer=u.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){const t=(e._localRoot||this._root).uuid,r=e._clip.uuid,n=this._actionsByClip[r];this._bindAction(e,n&&n.knownActions[0]),this._addInactiveAction(e,r,t)}const t=e._propertyBindings;for(let e=0,r=t.length;e!==r;++e){const r=t[e];0==r.useCount++&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let e=0,r=t.length;e!==r;++e){const r=t[e];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return null!==t&&t=0;--t)e[t].stop();return this}update(e){e*=this.timeScale;const t=this._actions,r=this._nActiveActions,n=this.time+=e,i=Math.sign(e),s=this._accuIndex^=1;for(let o=0;o!==r;++o)t[o]._update(n,e,i,s);const o=this._bindings,a=this._nActiveBindings;for(let e=0;e!==a;++e)o[e].apply(s);return this}setTime(e){this.time=0;for(let e=0;e=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Ef).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const Sf=new On,Cf=new On;class Tf{constructor(e=new On,t=new On){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){Sf.subVectors(e,this.start),Cf.subVectors(this.end,this.start);const r=Cf.dot(Cf);let n=Cf.dot(Sf)/r;return t&&(n=Kr(n,0,1)),n}closestPointToPoint(e,t,r){const n=this.closestPointToPointParameter(e,t);return this.delta(r).multiplyScalar(n).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}}const If=new On;class Rf extends Fi{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const r=new Is,n=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let e=0,t=1,r=32;e1)for(let r=0;r.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{tm.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(tm,t)}}setLength(e,t=.2*e,r=.2*t){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(r,t,r),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class sm extends Pu{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],r=new Is;r.setAttribute("position",new _s(t,3)),r.setAttribute("color",new _s([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),super(r,new xu({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(e,t,r){const n=new es,i=this.geometry.attributes.color.array;return n.set(e),n.toArray(i,0),n.toArray(i,3),n.set(t),n.toArray(i,6),n.toArray(i,9),n.set(r),n.toArray(i,12),n.toArray(i,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class om{constructor(){this.type="ShapePath",this.color=new es,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new fh,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,r,n){return this.currentPath.quadraticCurveTo(e,t,r,n),this}bezierCurveTo(e,t,r,n,i,s){return this.currentPath.bezierCurveTo(e,t,r,n,i,s),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(e,t){const r=t.length;let n=!1;for(let i=r-1,s=0;sNumber.EPSILON){if(l<0&&(r=t[s],a=-a,o=t[i],l=-l),e.yo.y)continue;if(e.y===r.y){if(e.x===r.x)return!0}else{const t=l*(e.x-r.x)-a*(e.y-r.y);if(0===t)return!0;if(t<0)continue;n=!n}}else{if(e.y!==r.y)continue;if(o.x<=e.x&&e.x<=r.x||r.x<=e.x&&e.x<=o.x)return!0}}return n}const r=Jh.isClockWise,n=this.subPaths;if(0===n.length)return[];let i,s,o;const a=[];if(1===n.length)return s=n[0],o=new Ch,o.curves=s.curves,a.push(o),a;let l=!r(n[0].getPoints());l=e?!l:l;const c=[],u=[];let h,d,p=[],f=0;u[f]=void 0,p[f]=[];for(let t=0,o=n.length;t1){let e=!1,r=0;for(let e=0,t=u.length;e0&&!1===e&&(p=c)}for(let e=0,t=u.length;e{if(!r){var o=1/0;for(u=0;u=s)&&Object.keys(n.O).every((e=>n.O[e](r[l])))?r.splice(l--,1):(a=!1,s0&&e[u-1][2]>s;u--)e[u]=e[u-1];e[u]=[r,i,s]},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.u=e=>({343:"itowns_potree2worker",899:"itowns_lasparser"}[e]+".js"),n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var i=r.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=r[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{n.b=document.baseURI||self.location.href;var e={403:0};n.O.j=t=>0===e[t];var t=(t,r)=>{var i,s,[o,a,l]=r,c=0;if(o.some((t=>0!==e[t]))){for(i in a)n.o(a,i)&&(n.m[i]=a[i]);if(l)var u=l(n)}for(t&&t(r);c(()=>{var e,t={86406:(e,t,r)=>{"use strict";r.r(t),r.d(t,{UNIT:()=>s,axisOrder:()=>f,defs:()=>m,getUnit:()=>l,is4326:()=>o,isGeocentric:()=>h,isGeographic:()=>u,isMetricUnit:()=>c,isValid:()=>d,reasonableEpsilon:()=>p});var n=r(68721);function i(e){if(!("string"==typeof(t=e)||t instanceof String))throw new Error(`Crs parameter value must be a string: '${e}'`);var t}n.A.defs("EPSG:4978","+proj=geocent +datum=WGS84 +units=m +no_defs"),n.A.defs("EPSG:4326").axis="neu",n.A.defs("EPSG:4269").axis="neu",n.A.defs("WGS84").axis="neu";const s={DEGREE:1,METER:2,FOOT:3};function o(e){return"EPSG:4326"===e}function a(e){return"degrees"===e.units?s.DEGREE:"m"===e.units||"meter"===e.units?s.METER:"foot"===e.units?s.FOOT:void 0===e.units&&void 0===e.to_meter?s.METER:void 0}function l(e){i(e);const t=n.A.defs(e);if(t)return a(t)}function c(e){return l(e)===s.METER}function u(e){return l(e)===s.DEGREE}function h(e){i(e);const t=n.A.defs(e);return!!t&&"geocent"==t.projName}function d(e){const t=n.A.defs(e);if(!t)throw new Error(`Undefined crs '${e}'. Add it with proj4.defs('${e}', string)`);if(!a(t))throw new Error(`No valid unit found for crs '${e}', found ${t.units}`)}function p(e){return o(e)?.01:.001}function f(e){i(e);const t=n.A.defs(e);return t?t.axis:void 0}const m=(e,t)=>n.A.defs(e,t)},28611:(e,t,r)=>{"use strict";r.d(t,{r:()=>f});var n=r(39437),i=r(52404),s=r(86215);const o=Math.PI/4,a=1/(2*Math.PI),l=new n.Vector3(0,0,1),c=new n.Vector3(0,1,0),u=new n.Quaternion,h=new n.Quaternion,d=new n.Quaternion;function p(e){return 1-(.5-Math.log(Math.tan(o+.5*n.MathUtils.degToRad(e)))*a)}class f{static _crs="EPSG:4978";static _computeExtraOffset(e){const t=p(e.coordinates.latitude)*e.nbRow;return(isFinite(t)?t:0)-e.deltaUV1}get crs(){return f._crs}constructor(e){this._transform={coords:[new i.A("EPSG:4326",0,0),new i.A("EPSG:4326",0,0)],position:new n.Vector3,dimension:new n.Vector2},e.uvCount>1&&(this.computeExtraOffset=f._computeExtraOffset)}prepare(e){const t=2**(e.level+1);let r=p(e.extent.south);isFinite(r)||(r=0);const s={nbRow:t,deltaUV1:(r-r%(1/t))*t,quatNormalToZ:d.setFromAxisAngle(c,-(.5*Math.PI-n.MathUtils.degToRad(e.extent.center().latitude))),coordinates:new i.A(this.crs)};return e.extent.planarDimensions(this._transform.dimension),{...e,...s}}center(e){return e.center(this._transform.coords[0]).as(this.crs,this._transform.coords[1]).toVector3()}vertexPosition(e){return this._transform.coords[0].setFromValues(e.x,e.y).as(this.crs,this._transform.coords[1]).toVector3(this._transform.position)}vertexNormal(){return this._transform.coords[1].geodesicNormal}uProject(e,t){return t.west+e*this._transform.dimension.x}vProject(e,t){return t.south+e*this._transform.dimension.y}computeShareableExtent(e){const t=Math.abs(e.west-e.east)/2,r=new s.A(e.crs,-t,t,e.south,e.north),i=n.MathUtils.degToRad(e.west-r.west),o=n.MathUtils.degToRad(90-e.center(this._transform.coords[0]).latitude);return u.setFromAxisAngle(l,i),h.setFromAxisAngle(c,o),u.multiply(h),{shareableExtent:r,quaternion:u.clone(),position:this.center(e)}}}},22598:(e,t,r)=>{"use strict";r.d(t,{g:()=>i,t:()=>a});var n=r(39437);function i(e,t){return 3*(e*e*2+(t?0:4*e*2))}function s(e,t,r,n){e[2*t+0]=r,e[2*t+1]=n}function o(e){return(t,r)=>{t[r]=e}}function a(e,t){const r=Math.max(2,t.segments),a=r+1,l=a**2,c=l+(t.disableSkirt?0:4*r);if(c>2**32)throw new Error("Tile segments count is too big");const u=function(e,t,r,n){const{index:s,skirt:o}=function(e,t,r){if(!r.buildIndexAndUv_0)return;const n=i(t,r.disableSkirt),s=function(e){let t=null;if(e<256)t=Uint8Array;else if(e<65536)t=Uint16Array;else{if(!(e<2**32))throw new Error("Value is too high");t=Uint32Array}return t}(e),o=n,a=4*t,l=new s(new ArrayBuffer((o+(r.disableSkirt?0:a))*s.BYTES_PER_ELEMENT)),c=r.disableSkirt?void 0:l.subarray(o,o+a);return{index:l,skirt:c}}(e,t,n)??{};return{index:s,skirt:o,position:new Float32Array(3*e),normal:new Float32Array(3*e),uvs:[n.buildIndexAndUv_0?new Float32Array(2*e):void 0,void 0!==r.computeExtraOffset?new Float32Array(e):void 0]}}(c,r,e,t),h=[t.buildIndexAndUv_0?s:()=>{}];t=e.prepare(t);for(let n=0;n<=r;n++){const i=n/r;t.coordinates.y=e.vProject(i,t.extent),void 0!==e.computeExtraOffset&&(h[1]=o(e.computeExtraOffset(t)));for(let s=0;s<=r;s++){const o=s/r,l=3*(n*a+s);t.coordinates.x=e.uProject(o,t.extent);const c=e.vertexPosition(t.coordinates),d=e.vertexNormal();if(c.sub(t.center),"quatNormalToZ"in t){const e=t.quatNormalToZ;c.applyQuaternion(e),d.applyQuaternion(e)}c.toArray(u.position,l),d.toArray(u.normal,l);for(const[e,t]of h.entries())void 0!==t&&t(u.uvs[e],n*a+s,o,i)}}if(t.buildIndexAndUv_0&&!t.disableSkirt){for(let e=0;e(d(e,t,r,n),d(e+3,t,n,i),e+6),uv:(e,t,r)=>{e[2*t+0]=e[2*r+0],e[2*t+1]=e[2*r+1]}},i=l;for(let n=0;n{"use strict";r.d(t,{p:()=>o});var n=r(39437),i=r(22598),s=r(52404);class o extends n.BufferGeometry{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(e,t){const r={disableSkirt:!1,hideSkirt:!1,buildIndexAndUv_0:!0,segments:16,coordinates:new s.A(e.crs),center:e.center(t.extent).clone(),...t},o=(0,i.t)(e,r);return{index:o.index?new n.BufferAttribute(o.index,1):null,uvs:[...o.uvs[0]?[new n.BufferAttribute(o.uvs[0],2)]:[],...o.uvs[1]?[new n.BufferAttribute(o.uvs[1],1)]:[]],position:new n.BufferAttribute(o.position,3),normal:new n.BufferAttribute(o.normal,3)}}(e,t);super(),this.extent=t.extent,this.segments=t.segments,this.setIndex(r.index),this.setAttribute("position",r.position),this.setAttribute("normal",r.normal),this.setAttribute("uv",r.uvs[0]);for(let e=1;e{this._refCount.count--,this._refCount.count<=0&&(this.index=null,delete this.attributes.uv,e.delete(...t),super.dispose())}})}increaseRefCount(){if(null===this._refCount)throw new Error("[TileGeometry::increaseRefCount] Tried to increment an unitialized reference count.");this._refCount.count++}get refCount(){return this._refCount?.count}dispose(){null==this._refCount?super.dispose():this._refCount.fn()}}},50329:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hierarchyItemLength=t.infoLength=void 0,t.infoLength=160,t.hierarchyItemLength=32},86601:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Copc=void 0;const o=s(r(30549)),a=r(876),l=r(98363),c=r(15690);async function u(e,{pointDataRecordFormat:t,pointDataRecordLength:r},n,i){const s=await async function(e,{pointDataOffset:t,pointDataLength:r}){return a.Getter.create(e)(t,t+r)}(e,n),{pointCount:l}=n;return o.PointData.decompressChunk(s,{pointCount:l,pointDataRecordFormat:t,pointDataRecordLength:r},i)}t.Copc={create:async function(e){const t=a.Getter.create(e),r=t(0,65536);async function n(e,n){return n>=65536?t(e,n):(await r).slice(e,n)}const i=o.Header.parse(await n(0,o.Constants.minHeaderLength)),s=await o.Vlr.walk(n,i),l=o.Vlr.find(s,"copc",1);if(!l)throw new Error("COPC info VLR is required");const u=c.Info.parse(await o.Vlr.fetch(n,l));let h;const d=o.Vlr.find(s,"LASF_Projection",2112);d&&d.contentLength&&(h=a.Binary.toCString(await o.Vlr.fetch(n,d)),""===h&&(h=void 0));let p=[];const f=o.Vlr.find(s,"LASF_Spec",4);return f&&(p=o.ExtraBytes.parse(await o.Vlr.fetch(n,f))),{header:i,vlrs:s,info:u,wkt:h,eb:p}},loadHierarchyPage:async function(e,t){const r=a.Getter.create(e);return l.Hierarchy.load(r,t)},loadPointDataBuffer:u,loadPointDataView:async function(e,t,r,{lazPerf:n,include:i}={}){const s=await u(e,t.header,r,n);return o.View.create(s,t.header,t.eb,i)}}},98363:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Hierarchy=void 0;const n=r(876),i=r(50329);function s(e){const t=n.Binary.toDataView(e);if(t.byteLength%i.hierarchyItemLength!=0)throw new Error(`Invalid hierarchy page length: ${t.byteLength}`);const r={},s={};for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Info=void 0;const n=r(876),i=r(50329);t.Info={parse:function(e){const t=n.Binary.toDataView(e);if(t.byteLength!==i.infoLength)throw new Error(`Invalid COPC info VLR length (should be ${i.infoLength}): ${t.byteLength}`);const r=[t.getFloat64(0,!0),t.getFloat64(8,!0),t.getFloat64(16,!0)],s=t.getFloat64(24,!0);return{cube:[r[0]-s,r[1]-s,r[2]-s,r[0]+s,r[1]+s,r[2]+s],spacing:t.getFloat64(32,!0),rootHierarchyPage:{pageOffset:(0,n.parseBigInt)((0,n.getBigUint64)(t,40,!0)),pageLength:(0,n.parseBigInt)((0,n.getBigUint64)(t,48,!0))},gpsTimeRange:[t.getFloat64(56,!0),t.getFloat64(64,!0)]}}}},69545:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},24305:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Hierarchy=void 0,t.Hierarchy={parse:function(e){return Object.entries(e).reduce(((e,[t,r])=>(-1===r?e.pages[t]={}:r&&(e.nodes[t]={pointCount:r}),e)),{nodes:{},pages:{}})}}},68962:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(69545),t),i(r(24305),t)},15234:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.Las=t.Ept=void 0,t.Ept=s(r(68962)),o(r(36564),t),t.Las=s(r(30549)),o(r(876),t)},48300:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.evlrHeaderLength=t.vlrHeaderLength=t.minHeaderLength=void 0,t.minHeaderLength=375,t.vlrHeaderLength=54,t.evlrHeaderLength=60},51652:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Dimensions=void 0;const n=r(876),i=r(94553);t.Dimensions={create:function(e,t=[]){return Object.keys(e).reduce(((e,r)=>{const n=o[r];if(n)return{...e,[r]:n};const s=t.find((e=>e.name===r)),a=s&&i.ExtraBytes.getDimension(s);if(a)return{...e,[r]:a};throw new Error(`Failed to look up LAS type: ${r}`)}),{})}};const{Type:s}=n.Dimension,o={X:s.float64,Y:s.float64,Z:s.float64,Intensity:s.uint16,ReturnNumber:s.uint8,NumberOfReturns:s.uint8,ScanDirectionFlag:s.boolean,EdgeOfFlightLine:s.boolean,Classification:s.uint8,Synthetic:s.boolean,KeyPoint:s.boolean,Withheld:s.boolean,Overlap:s.boolean,ScanAngle:s.float32,UserData:s.uint8,PointSourceId:s.uint16,GpsTime:s.float64,Red:s.uint16,Green:s.uint16,Blue:s.uint16,ScannerChannel:s.uint8,Infrared:s.uint16}},94553:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtraBytes=void 0;const n=r(876);t.ExtraBytes={getDimension:function({type:e,length:t}){switch(e){case"signed":case"unsigned":switch(t){case 1:case 2:case 4:case 8:return{type:e,size:t}}case"float":switch(t){case 4:case 8:return{type:e,size:t}}}},parse:function(e){if(e.byteLength%i!=0)throw new Error(`Invalid extra bytes VLR length: ${e.byteLength}`);const t=[];for(let r=0;r=11)throw new Error(`Invalid extra bytes "type" value: ${o}`);if(0===o)return{name:r,description:s,length:a};const l=(c=a,{hasNodata:Boolean(1&c),hasMin:Boolean(c>>1&1),hasMax:Boolean(c>>2&1),hasScale:Boolean(c>>3&1),hasOffset:Boolean(c>>4&1)});var c;const u=function(e){switch(e){case 1:return n.Dimension.Type.uint8;case 2:return n.Dimension.Type.int8;case 3:return n.Dimension.Type.uint16;case 4:return n.Dimension.Type.int16;case 5:return n.Dimension.Type.uint32;case 6:return n.Dimension.Type.int32;case 7:return n.Dimension.Type.uint64;case 8:return n.Dimension.Type.int64;case 9:return n.Dimension.Type.float32;case 10:return n.Dimension.Type.float64}}(o);if(!u)throw new Error(`Failed to extract dimension type: ${o}`);const{type:h,size:d}=u;function p(e){switch(h){case"signed":return(0,n.parseBigInt)(t.getBigInt64(e,!0));case"unsigned":return(0,n.parseBigInt)((0,n.getBigUint64)(t,e,!0));case"float":return t.getFloat64(e,!0)}}const f={name:r,description:s,type:h,length:d};return l.hasNodata&&(f.nodata=p(40)),l.hasMin&&(f.min=p(64)),l.hasMax&&(f.max=p(88)),l.hasScale&&(f.scale=t.getFloat64(112)),l.hasOffset&&(f.offset=t.getFloat64(136)),f}},11677:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Extractor=void 0;const n=r(876);function i(e){const{scale:t,offset:r}=e,i=a(e);function s(e,t){return e.getUint8(i(t)+14)}function o(e,t){return e.getUint8(i(t)+15)}function l(e,t){return 31&o(e,t)}return{X:(e,s)=>n.Scale.unapply(e.getInt32(i(s),!0),t[0],r[0]),Y:(e,s)=>n.Scale.unapply(e.getInt32(i(s)+4,!0),t[1],r[1]),Z:(e,s)=>n.Scale.unapply(e.getInt32(i(s)+8,!0),t[2],r[2]),Intensity:(e,t)=>e.getUint16(i(t)+12,!0),ReturnNumber:(e,t)=>7&s(e,t),NumberOfReturns:(e,t)=>(56&s(e,t))>>3,ScanDirectionFlag:(e,t)=>(64&s(e,t))>>6,EdgeOfFlightLine:(e,t)=>(128&s(e,t))>>7,Classification:(e,t)=>{const r=l(e,t);return 12===r?0:r},Synthetic:(e,t)=>(32&o(e,t))>>5,KeyPoint:(e,t)=>(64&o(e,t))>>6,Withheld:(e,t)=>(128&o(e,t))>>7,Overlap:(e,t)=>12===l(e,t)?1:0,ScanAngle:(e,t)=>e.getInt8(i(t)+16),UserData:(e,t)=>e.getUint8(i(t)+17),PointSourceId:(e,t)=>e.getUint16(i(t)+18,!0)}}function s(e){const{scale:t,offset:r}=e,i=a(e);function s(e,t){return e.getUint8(i(t)+15)}return{X:(e,s)=>n.Scale.unapply(e.getInt32(i(s),!0),t[0],r[0]),Y:(e,s)=>n.Scale.unapply(e.getInt32(i(s)+4,!0),t[1],r[1]),Z:(e,s)=>n.Scale.unapply(e.getInt32(i(s)+8,!0),t[2],r[2]),Intensity:(e,t)=>e.getUint16(i(t)+12,!0),ReturnNumber:(e,t)=>15&e.getUint16(i(t)+14,!0),NumberOfReturns:(e,t)=>(240&e.getUint16(i(t)+14,!0))>>4,Synthetic:(e,t)=>1&s(e,t),KeyPoint:(e,t)=>(2&s(e,t))>>1,Withheld:(e,t)=>(4&s(e,t))>>2,Overlap:(e,t)=>(8&s(e,t))>>3,ScannerChannel:(e,t)=>(48&s(e,t))>>4,ScanDirectionFlag:(e,t)=>(64&s(e,t))>>6,EdgeOfFlightLine:(e,t)=>(128&s(e,t))>>7,Classification:(e,t)=>e.getUint8(i(t)+16),UserData:(e,t)=>e.getUint8(i(t)+17),ScanAngle:(e,t)=>.006*e.getInt16(i(t)+18,!0),PointSourceId:(e,t)=>e.getUint16(i(t)+20,!0),GpsTime:(e,t)=>e.getFloat64(i(t)+22,!0)}}function o(e){const t=a(e);return{...s(e),Red:(e,r)=>e.getUint16(t(r)+30,!0),Green:(e,r)=>e.getUint16(t(r)+32,!0),Blue:(e,r)=>e.getUint16(t(r)+34,!0)}}function a(e){const{pointDataRecordLength:t}=e;return function(e){return e*t}}t.Extractor={create:function(e,t=[]){const r=function(e,t){let r=function(e){switch(e){case 0:return 20;case 1:return 28;case 2:return 26;case 3:return 34;case 6:return 30;case 7:return 36;case 8:return 38;default:throw new Error(`Unsupported point data record format: ${e}`)}}(e.pointDataRecordFormat);return t.reduce(((t,i)=>{const s=r;r+=i.length;const o=function(e,t,{type:r,length:i}){const s=a(e);switch(r){case"signed":switch(i){case 1:return(e,r)=>e.getInt8(s(r)+t);case 2:return(e,r)=>e.getInt16(s(r)+t,!0);case 4:return(e,r)=>e.getInt32(s(r)+t,!0);case 8:return(e,r)=>(0,n.parseBigInt)(e.getBigInt64(s(r)+t,!0))}case"unsigned":switch(i){case 1:return(e,r)=>e.getUint8(s(r)+t);case 2:return(e,r)=>e.getUint16(s(r)+t,!0);case 4:return(e,r)=>e.getUint32(s(r)+t,!0);case 8:return(e,r)=>(0,n.parseBigInt)((0,n.getBigUint64)(e,s(r)+t,!0))}case"float":switch(i){case 4:return(e,r)=>e.getFloat32(s(r)+t,!0);case 8:return(e,r)=>e.getFloat64(s(r)+t,!0)}}}(e,s,i);if(!o)return t;return{...t,[i.name]:(e,t)=>n.Scale.unapply(o(e,t),i.scale,i.offset)}}),{})}(e,t);return{...(()=>{const{pointDataRecordFormat:t}=e;switch(t){case 0:return i(e);case 1:return function(e){const t=a(e);return{...i(e),GpsTime:(e,r)=>e.getFloat64(t(r)+20,!0)}}(e);case 2:return function(e){const t=a(e);return{...i(e),Red:(e,r)=>e.getUint16(t(r)+20,!0),Green:(e,r)=>e.getUint16(t(r)+22,!0),Blue:(e,r)=>e.getUint16(t(r)+24,!0)}}(e);case 3:return function(e){const t=a(e);return{...i(e),GpsTime:(e,r)=>e.getFloat64(t(r)+20,!0),Red:(e,r)=>e.getUint16(t(r)+28,!0),Green:(e,r)=>e.getUint16(t(r)+30,!0),Blue:(e,r)=>e.getUint16(t(r)+32,!0)}}(e);case 6:return s(e);case 7:return o(e);case 8:return function(e){const t=a(e);return{...o(e),Infrared:(e,r)=>e.getUint16(t(r)+36,!0)}}(e);default:throw new Error(`Unsupported point data record format: ${t}`)}})(),...r}}}},68916:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Header=void 0;const n=r(876),i=r(48300),s=r(47952);function o(e){const t=n.Binary.toDataView(e),r=[];for(let e=0;e<120;e+=8)r.push((0,n.getBigUint64)(t,e,!0));return r.map((e=>(0,n.parseBigInt)(e)))}function a(e){const t=n.Binary.toDataView(e),r=[];for(let e=0;e<20;e+=4)r.push(t.getUint32(e,!0));return r}t.Header={parse:function(e){if(e.byteLength{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decompressFile=t.decompressChunk=t.PointData=void 0;const n=r(26977),i=r(68916);let s;async function o(e){return e||(s||(s=(0,n.createLazPerf)()),s)}async function a(e,{pointCount:t,pointDataRecordFormat:r,pointDataRecordLength:n},i){const s=await o(i),a=new Uint8Array(t*n),l=s._malloc(e.byteLength),c=s._malloc(n),u=new s.ChunkDecoder;try{s.HEAPU8.set(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),l),u.open(r,n,l);for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatGuid=t.parsePoint=void 0;const n=r(876);t.parsePoint=function(e){const t=n.Binary.toDataView(e);if(24!==t.byteLength)throw new Error(`Invalid tuple buffer length: ${t.byteLength}`);return[t.getFloat64(0,!0),t.getFloat64(8,!0),t.getFloat64(16,!0)]},t.formatGuid=function(e){const t=n.Binary.toDataView(e);if(16!==t.byteLength)throw new Error(`Invalid GUID buffer length: ${t.byteLength}`);let r="";for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.View=void 0;const n=r(876),i=r(51652),s=r(11677);t.View={create:function(e,t,r=[],o){let a=s.Extractor.create(t,r);if(o){const e=new Set([...o]);a=Object.entries(a).reduce(((t,[r,n])=>(e.has(r)&&(t[r]=n),t)),{})}const l=i.Dimensions.create(a,r),c=n.Binary.toDataView(e),u=t.pointDataRecordLength;if(c.byteLength%u!=0)throw new Error(`Invalid buffer length (${c.byteLength}) for point length ${u}`);const h=c.byteLength/t.pointDataRecordLength;return{pointCount:h,dimensions:l,getter:function(e){const t=a[e];if(!t)throw new Error(`No extractor for dimension: ${e}`);return function(e){if(e>=h)throw new RangeError(`View index (${e}) out of range: ${h}`);return t(c,e)}}}}}},32101:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Vlr=void 0;const n=r(876),i=r(48300);function s(e,t,r){return e.find((e=>e.userId===t&&e.recordId===r))}function o(e,t){return(t?l:a)(e)}function a(e){const t=n.Binary.toDataView(e);if(t.byteLength!==i.vlrHeaderLength)throw new Error(`Invalid VLR header length (must be ${i.vlrHeaderLength}): ${t.byteLength}`);return{userId:n.Binary.toCString(e.slice(2,18)),recordId:t.getUint16(18,!0),contentLength:t.getUint16(20,!0),description:n.Binary.toCString(e.slice(22,54)),isExtended:!1}}function l(e){const t=n.Binary.toDataView(e);if(t.byteLength!==i.evlrHeaderLength)throw new Error(`Invalid EVLR header length (must be ${i.evlrHeaderLength}): ${t.byteLength}`);return{userId:n.Binary.toCString(e.slice(2,18)),recordId:t.getUint16(18,!0),contentLength:(0,n.parseBigInt)((0,n.getBigUint64)(t,20,!0)),description:n.Binary.toCString(e.slice(28,60)),isExtended:!0}}async function c({get:e,startOffset:t,count:r,isExtended:n}){const s=[];let a=t;const l=n?i.evlrHeaderLength:i.vlrHeaderLength;for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBigUint64=t.parseBigInt=void 0,t.parseBigInt=function(e){if(e>BigInt(Number.MAX_SAFE_INTEGER)||e{"use strict";function r(e){return new DataView(e.buffer,e.byteOffset,e.length)}function n(e){const t=r(e);let n="";for(let e=0;e{"use strict";function r([e,t,r,n,i,s]){return[e+(n-e)/2,t+(i-t)/2,r+(s-r)/2]}function n(e){return e[3]-e[0]}function i(e){return e[4]-e[1]}function s(e){return e[5]-e[2]}function o(e,[t,n,i]){const[s,o,a,l,c,u]=e,[h,d,p]=r(e);return[t?h:s,n?d:o,i?p:a,t?l:h,n?c:d,i?u:p]}Object.defineProperty(t,"__esModule",{value:!0}),t.Bounds=void 0,t.Bounds={min:function(e){return[e[0],e[1],e[2]]},max:function(e){return[e[3],e[4],e[5]]},mid:r,width:n,depth:i,height:s,cube:function(e){const t=r(e),o=Math.max(n(e),i(e),s(e))/2;return[t[0]-o,t[1]-o,t[2]-o,t[0]+o,t[1]+o,t[2]+o]},step:o,stepTo:function(e,[t,r,n,i]){for(let s=t-1;s>=0;--s)e=o(e,[r>>s&1,n>>s&1,i>>s&1]);return e},intersection:function(e,t){return[Math.max(e[0],t[0]),Math.max(e[1],t[1]),Math.max(e[2],t[2]),Math.min(e[3],t[3]),Math.min(e[4],t[4]),Math.min(e[5],t[5])]}}},44324:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Dimension=void 0,t.Dimension={Type:{int8:{type:"signed",size:1},int16:{type:"signed",size:2},int32:{type:"signed",size:4},int64:{type:"signed",size:8},uint8:{type:"unsigned",size:1},uint16:{type:"unsigned",size:2},uint32:{type:"unsigned",size:4},uint64:{type:"unsigned",size:8},float32:{type:"float",size:4},float64:{type:"float",size:8},float:{type:"float",size:4},double:{type:"float",size:8},bool:{type:"unsigned",size:1},boolean:{type:"unsigned",size:1}},ctype:function({type:e,size:t}){switch(e){case"signed":switch(t){case 1:return"int8";case 2:return"int16";case 4:return"int32";case 8:return"int64"}case"unsigned":switch(t){case 1:return"uint8";case 2:return"uint16";case 4:return"uint32";case 8:return"uint64"}case"float":switch(t){case 4:return"float";case 8:return"double"}}throw new Error(`Invalid dimension type/size: ${e}/${t}`)}}},27201:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Getter=void 0;const a=o(r(74945));function l(e){return async function(t,r){if(t<0||r<0||t>r)throw new Error("Invalid range");const n=await(0,a.default)(e,{headers:{Range:`bytes=${t}-${r-1}`}}),i=await n.arrayBuffer();return new Uint8Array(i)}}function c(e){return async function(t,n){const i=await Promise.resolve().then((()=>s(r(10539))));return async function(t=0,r=1/0){if(t<0||r<0||t>r)throw new Error("Invalid range");return await i.promises.access(e),async function(e){return await new Promise(((t,r)=>{const n=[];e.on("data",(e=>n.push(e))),e.on("error",r),e.on("end",(()=>t(Buffer.concat(n))))}))}(i.createReadStream(e,{start:t,end:r-1,autoClose:!0}))}(t,n)}}t.Getter={create:function(e){return"function"==typeof e?e:e.startsWith("http://")||e.startsWith("https://")?l(e):c(e)},http:l,file:c}},876:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.Step=t.Scale=t.Key=t.Getter=t.Dimension=t.Bounds=t.Binary=void 0,i(r(16882),t);var s=r(33359);Object.defineProperty(t,"Binary",{enumerable:!0,get:function(){return s.Binary}});var o=r(19459);Object.defineProperty(t,"Bounds",{enumerable:!0,get:function(){return o.Bounds}});var a=r(44324);Object.defineProperty(t,"Dimension",{enumerable:!0,get:function(){return a.Dimension}});var l=r(27201);Object.defineProperty(t,"Getter",{enumerable:!0,get:function(){return l.Getter}});var c=r(54623);Object.defineProperty(t,"Key",{enumerable:!0,get:function(){return c.Key}});var u=r(66838);Object.defineProperty(t,"Scale",{enumerable:!0,get:function(){return u.Scale}});var h=r(95192);Object.defineProperty(t,"Step",{enumerable:!0,get:function(){return h.Step}})},54623:(e,t)=>{"use strict";function r(e){if("string"!=typeof e)return e;const[t,r,n,i,...s]=e.split("-").map((e=>parseInt(e,10))),o=[t,r,n,i];if(0!==s.length||o.some((e=>"number"!=typeof e||Number.isNaN(e))))throw new Error(`Invalid key: ${e}`);return o}Object.defineProperty(t,"__esModule",{value:!0}),t.Key=void 0,t.Key={create:function(e,t=0,n=0,i=0){return"number"!=typeof e?r(e):[e,t,n,i]},parse:r,toString:function(e){return"string"==typeof e?e:e.join("-")},step:function(e,[r,n,i]){const[s,o,a,l]=t.Key.create(e);return[s+1,2*o+r,2*a+n,2*l+i]},up:function(e,r=1){const[n,i,s,o]=t.Key.create(e);return[n-r,i>>r,s>>r,o>>r]},compare:function(e,t){for(let r=0;rt[r])return 1}return 0},depth:function(e){return e[0]}}},66838:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Scale=void 0,t.Scale={apply:(e,t=1,r=0)=>(e-r)/t,unapply:(e,t=1,r=0)=>e*t+r}},95192:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Step=void 0,t.Step={fromIndex:function(e){if(e<0||e>=8)throw new Error(`Invalid step index: ${e}`);return[1&e?1:0,e>>1&1?1:0,e>>2&1?1:0]},list:function(){return[[0,0,0],[0,0,1],[0,1,0],[0,1,1],[1,0,0],[1,0,1],[1,1,0],[1,1,1]]}}},74945:function(e,t){var r="undefined"!=typeof self?self:this,n=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var r="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),s="FormData"in e,o="ArrayBuffer"in e;if(o)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(e){return e&&a.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function u(e){return"string"!=typeof e&&(e=String(e)),e}function h(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function d(e){this.map={},e instanceof d?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function p(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function f(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function m(e){var t=new FileReader,r=f(t);return t.readAsArrayBuffer(e),r}function g(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function A(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:s&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():o&&i&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=g(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o&&(ArrayBuffer.prototype.isPrototypeOf(e)||l(e))?this._bodyArrayBuffer=g(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=p(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(m)}),this.text=function(){var e,t,r,n=p(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=f(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function x(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function _(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new d(t.headers),this.url=t.url||"",this._initBody(e)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},A.call(v.prototype),A.call(_.prototype),_.prototype.clone=function(){return new _(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},_.error=function(){var e=new _(null,{status:0,statusText:""});return e.type="error",e};var b=[301,302,303,307,308];_.redirect=function(e,t){if(-1===b.indexOf(t))throw new RangeError("Invalid status code");return new _(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function w(e,r){return new Promise((function(n,s){var o=new v(e,r);if(o.signal&&o.signal.aborted)return s(new t.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function l(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new d,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}})),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var i="response"in a?a.response:a.responseText;n(new _(i,r))},a.onerror=function(){s(new TypeError("Network request failed"))},a.ontimeout=function(){s(new TypeError("Network request failed"))},a.onabort=function(){s(new t.DOMException("Aborted","AbortError"))},a.open(o.method,o.url,!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&i&&(a.responseType="blob"),o.headers.forEach((function(e,t){a.setRequestHeader(t,e)})),o.signal&&(o.signal.addEventListener("abort",l),a.onreadystatechange=function(){4===a.readyState&&o.signal.removeEventListener("abort",l)}),a.send(void 0===o._bodyInit?null:o._bodyInit)}))}w.polyfill=!0,e.fetch||(e.fetch=w,e.Headers=d,e.Request=v,e.Response=_),t.Headers=d,t.Request=v,t.Response=_,t.fetch=w,Object.defineProperty(t,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},17833:(e,t,r)=>{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))})),t.splice(i,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=r(40736)(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},40736:(e,t,r)=>{e.exports=function(e){function t(e){let r,i,s,o=null;function a(...e){if(!a.enabled)return;const n=a,i=Number(new Date),s=i-(r||i);n.diff=s,n.prev=r,n.curr=i,r=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let o=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,i)=>{if("%%"===r)return"%";o++;const s=t.formatters[i];if("function"==typeof s){const t=e[o];r=s.call(n,t),e.splice(o,1),o--}return r})),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(i!==t.namespaces&&(i=t.namespaces,s=t.enabled(e)),s),set:e=>{o=e}}),"function"==typeof t.init&&t.init(a),a}function n(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(i),...t.skips.map(i).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length;for(r=0;r{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t{"use strict";e.exports=e=>!!e&&("symbol"==typeof Symbol.observable&&"function"==typeof e[Symbol.observable]?e===e[Symbol.observable]():"function"==typeof e["@@observable"]&&e===e["@@observable"]())},80061:e=>{e.exports=function e(t,r,n){function i(o,a){if(!r[o]){if(!t[o]){if(s)return s(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[o]={exports:{}};t[o][0].call(c.exports,(function(e){return i(t[o][1][e]||e)}),c,c.exports,e,t,r,n)}return r[o].exports}for(var s=void 0,o=0;o>>1],t)>=0?i=s+1:n=s;return i},t.exports=function(){function e(e){var t;this.options=e,this.comparator=this.options.comparator,this.data=(null!=(t=this.options.initialValues)?t.slice(0):void 0)||[],this.data.sort(this.comparator).reverse()}return e.prototype.queue=function(e){var t;t=n(this.data,e,this.comparator),this.data.splice(t,0,e)},e.prototype.dequeue=function(){return this.data.pop()},e.prototype.peek=function(){return this.data[this.data.length-1]},e.prototype.clear=function(){this.data.length=0},e}()},{}],4:[function(e,t,r){t.exports=function(){function e(e){var t,r,n,i,s,o,a,l;for(this.comparator=(null!=e?e.comparator:void 0)||function(e,t){return e-t},this.pageSize=(null!=e?e.pageSize:void 0)||512,this.length=0,a=0;1<s;0<=s?++r:--r)t.push(null);if(this._memory=[],this._mask=this.pageSize-1,e.initialValues)for(n=0,i=(o=e.initialValues).length;n0&&(this._write(1,t),this._bubbleDown(1,t)),e},e.prototype.peek=function(){return this._read(1)},e.prototype.clear=function(){this.length=0,this._memory.length=0},e.prototype._write=function(e,t){var r;for(r=e>>this._shift;r>=this._memory.length;)this._memory.push(this._emptyMemoryPageTemplate.slice(0));return this._memory[r][e&this._mask]=t},e.prototype._read=function(e){return this._memory[e>>this._shift][e&this._mask]},e.prototype._bubbleUp=function(e,t){var r,n,i,s;for(r=this.comparator;e>1&&(n=e&this._mask,e3?i=e&~this._mask|n>>1:n<2?(i=e-this.pageSize>>this._shift,i+=i&~(this._mask>>1),i|=this.pageSize>>1):i=e-2,!(r(s=this._read(i),t)<0));)this._write(i,t),this._write(e,s),e=i},e.prototype._bubbleDown=function(e,t){var r,n,i,s,o;for(o=this.comparator;ethis._mask&&!(e&this._mask-1)?r=n=e+2:e&this.pageSize>>1?(r=(e&~this._mask)>>1,n=1+(r=1+(r|=e&this._mask>>1)<0)for(e=t=1,r=this.data.length;1<=r?tr;e=1<=r?++t:--t)this._bubbleUp(e)},e.prototype.queue=function(e){this.data.push(e),this._bubbleUp(this.data.length-1)},e.prototype.dequeue=function(){var e,t;return t=this.data[0],e=this.data.pop(),this.data.length>0&&(this.data[0]=e,this._bubbleDown(0)),t},e.prototype.peek=function(){return this.data[0]},e.prototype.clear=function(){this.length=0,this.data.length=0},e.prototype._bubbleUp=function(e){for(var t,r;e>0&&(t=e-1>>>1,this.comparator(this.data[e],this.data[t])<0);)r=this.data[t],this.data[t]=this.data[e],this.data[e]=r,e=t},e.prototype._bubbleDown=function(e){var t,r,n,i,s;for(t=this.data.length-1;i=1+(r=1+(e<<1)),n=e,r<=t&&this.comparator(this.data[r],this.data[n])<0&&(n=r),i<=t&&this.comparator(this.data[i],this.data[n])<0&&(n=i),n!==e;)s=this.data[n],this.data[n]=this.data[e],this.data[e]=s,e=n},e}()},{}]},{},[1])(1)},26977:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LazPerf=t.create=t.createLazPerf=void 0;const i=n(r(67316));t.createLazPerf=i.default,t.create=i.default,t.LazPerf={create:i.default}},67316:e=>{var t,r=(t="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(e){var r,n,i=void 0!==(e=e||{})?e:{};i.ready=new Promise((function(e,t){r=e,n=t})),["_main","___getTypeName","__embind_initialize_bindings","_fflush","onRuntimeInitialized"].forEach((e=>{Object.getOwnPropertyDescriptor(i.ready,e)||Object.defineProperty(i.ready,e,{get:()=>j("You are getting "+e+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js"),set:()=>j("You are setting "+e+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")})}));var s=Object.assign({},i),o=[],a="./this.program";if(i.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");var l="";if("undefined"!=typeof document&&document.currentScript&&(l=document.currentScript.src),t&&(l=t),l=0!==l.indexOf("blob:")?l.substr(0,l.replace(/[?#].*/,"").lastIndexOf("/")+1):"","object"!=typeof window&&"function"!=typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");var c,u,h,d=i.print||console.log.bind(console),p=i.printErr||console.warn.bind(console);function f(e,t){Object.getOwnPropertyDescriptor(i,e)||Object.defineProperty(i,e,{configurable:!0,get:function(){j("Module."+e+" has been replaced with plain "+t+" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}})}function m(e){return"FS_createPath"===e||"FS_createDataFile"===e||"FS_createPreloadedFile"===e||"FS_unlink"===e||"addRunDependency"===e||"FS_createLazyFile"===e||"FS_createDevice"===e||"removeRunDependency"===e}Object.assign(i,s),s=null,c="fetchSettings",Object.getOwnPropertyDescriptor(i,c)&&j("`Module."+c+"` was supplied but `"+c+"` not included in INCOMING_MODULE_JS_API"),i.arguments&&(o=i.arguments),f("arguments","arguments_"),i.thisProgram&&(a=i.thisProgram),f("thisProgram","thisProgram"),i.quit&&i.quit,f("quit","quit_"),A(void 0===i.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),A(void 0===i.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),A(void 0===i.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),A(void 0===i.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),A(void 0===i.read,"Module.read option was removed (modify read_ in JS)"),A(void 0===i.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),A(void 0===i.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),A(void 0===i.setWindowTitle,"Module.setWindowTitle option was removed (modify setWindowTitle in JS)"),A(void 0===i.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),f("read","read_"),f("readAsync","readAsync"),f("readBinary","readBinary"),f("setWindowTitle","setWindowTitle"),A(!0,"worker environment detected but not enabled at build time. Add 'worker' to `-sENVIRONMENT` to enable."),A(!0,"node environment detected but not enabled at build time. Add 'node' to `-sENVIRONMENT` to enable."),A(!0,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),i.wasmBinary&&(u=i.wasmBinary),f("wasmBinary","wasmBinary"),i.noExitRuntime,f("noExitRuntime","noExitRuntime"),"object"!=typeof WebAssembly&&j("no native wasm support detected");var g=!1;function A(e,t){e||j("Assertion failed"+(t?": "+t:""))}var y,v,x,_,b,w,E,M,S,C="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function T(e,t,r){for(var n=t+r,i=t;e[i]&&!(i>=n);)++i;if(i-t>16&&e.buffer&&C)return C.decode(e.subarray(t,i));for(var s="";t>10,56320|1023&c)}}else s+=String.fromCharCode((31&o)<<6|a)}else s+=String.fromCharCode(o)}return s}function I(e,t){return e?T(x,e,t):""}function R(e,t,r,n){if(!(n>0))return 0;for(var i=r,s=r+n-1,o=0;o=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++o)),a<=127){if(r>=s)break;t[r++]=a}else if(a<=2047){if(r+1>=s)break;t[r++]=192|a>>6,t[r++]=128|63&a}else if(a<=65535){if(r+2>=s)break;t[r++]=224|a>>12,t[r++]=128|a>>6&63,t[r++]=128|63&a}else{if(r+3>=s)break;a>1114111&&Z("Invalid Unicode code point 0x"+a.toString(16)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."),t[r++]=240|a>>18,t[r++]=128|a>>12&63,t[r++]=128|a>>6&63,t[r++]=128|63&a}}return t[r]=0,r-i}function B(e){for(var t=0,r=0;r=55296&&n<=57343?(t+=4,++r):t+=3}return t}function P(e){y=e,i.HEAP8=v=new Int8Array(e),i.HEAP16=_=new Int16Array(e),i.HEAP32=w=new Int32Array(e),i.HEAPU8=x=new Uint8Array(e),i.HEAPU16=b=new Uint16Array(e),i.HEAPU32=E=new Uint32Array(e),i.HEAPF32=M=new Float32Array(e),i.HEAPF64=S=new Float64Array(e)}var L=65536;i.TOTAL_STACK&&A(L===i.TOTAL_STACK,"the stack size can no longer be determined at runtime");var D,O=i.INITIAL_MEMORY||262144;function N(){if(!g){var e=_t(),t=E[e>>2],r=E[e+4>>2];34821223==t&&2310721022==r||j("Stack overflow! Stack cookie has been overwritten at 0x"+e.toString(16)+", expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+r.toString(16)+" 0x"+t.toString(16)),1668509029!==E[0]&&j("Runtime error: The application has corrupted its heap memory area (address zero)!")}}f("INITIAL_MEMORY","INITIAL_MEMORY"),A(O>=L,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+O+"! (TOTAL_STACK="+L+")"),A("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,"JS engine does not provide full typed array support"),A(!i.wasmMemory,"Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally"),A(262144==O,"Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically"),function(){var e=new Int16Array(1),t=new Int8Array(e.buffer);if(e[0]=25459,115!==t[0]||99!==t[1])throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"}();var U=[],F=[],k=[],z=!1;A(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),A(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),A(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),A(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var G=0,Q=null,V=null,H={};function j(e){i.onAbort&&i.onAbort(e),p(e="Aborted("+e+")"),g=!0;var t=new WebAssembly.RuntimeError(e);throw n(t),t}var q,W,Y={error:function(){j("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM")},init:function(){Y.error()},createDataFile:function(){Y.error()},createPreloadedFile:function(){Y.error()},createLazyFile:function(){Y.error()},open:function(){Y.error()},mkdev:function(){Y.error()},registerDevice:function(){Y.error()},analyzePath:function(){Y.error()},loadFilesFromDB:function(){Y.error()},ErrnoError:function(){Y.error()}};function X(e){return e.startsWith("data:application/octet-stream;base64,")}function K(e,t){return function(){var r=e,n=t;return t||(n=i.asm),A(z,"native function `"+r+"` called before runtime initialization"),n[e]||A(n[e],"exported native function `"+r+"` not found"),n[e].apply(null,arguments)}}function $(e){try{if(e==q&&u)return new Uint8Array(u);throw"both async and sync fetching of the wasm failed"}catch(e){j(e)}}function J(e){for(;e.length>0;)e.shift()(i)}function Z(e){Z.shown||(Z.shown={}),Z.shown[e]||(Z.shown[e]=1,p(e))}function ee(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){E[this.ptr+4>>2]=e},this.get_type=function(){return E[this.ptr+4>>2]},this.set_destructor=function(e){E[this.ptr+8>>2]=e},this.get_destructor=function(){return E[this.ptr+8>>2]},this.set_refcount=function(e){w[this.ptr>>2]=e},this.set_caught=function(e){e=e?1:0,v[this.ptr+12|0]=e},this.get_caught=function(){return 0!=v[this.ptr+12|0]},this.set_rethrown=function(e){e=e?1:0,v[this.ptr+13|0]=e},this.get_rethrown=function(){return 0!=v[this.ptr+13|0]},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var e=w[this.ptr>>2];w[this.ptr>>2]=e+1},this.release_ref=function(){var e=w[this.ptr>>2];return w[this.ptr>>2]=e-1,A(e>0),1===e},this.set_adjusted_ptr=function(e){E[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return E[this.ptr+16>>2]},this.get_exception_ptr=function(){if(bt(this.get_type()))return E[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}function te(e){switch(e){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+e)}}i.FS_createDataFile=Y.createDataFile,i.FS_createPreloadedFile=Y.createPreloadedFile,X(q="laz-perf.wasm")||(W=q,q=i.locateFile?i.locateFile(W,l):l+W);var re=void 0;function ne(e){for(var t="",r=e;x[r];)t+=re[x[r++]];return t}var ie={},se={},oe={};function ae(e){if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=48&&t<=57?"_"+e:e}function le(e,t){return e=ae(e),new Function("body","return function "+e+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(t)}function ce(e,t){var r=le(t,(function(e){this.name=t,this.message=e;var r=new Error(e).stack;void 0!==r&&(this.stack=this.toString()+"\n"+r.replace(/^Error(:[^\n]*)?\n/,""))}));return r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},r}var ue=void 0;function he(e){throw new ue(e)}var de=void 0;function pe(e){throw new de(e)}function fe(e,t,r){function n(t){var n=r(t);n.length!==e.length&&pe("Mismatched type converter count");for(var i=0;i{se.hasOwnProperty(e)?i[t]=se[e]:(s.push(e),ie.hasOwnProperty(e)||(ie[e]=[]),ie[e].push((()=>{i[t]=se[e],++o===s.length&&n(i)})))})),0===s.length&&n(i)}function me(e,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");var n=t.name;if(e||he('type "'+n+'" must have a positive integer typeid pointer'),se.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;he("Cannot register type '"+n+"' twice")}if(se[e]=t,delete oe[e],ie.hasOwnProperty(e)){var i=ie[e];delete ie[e],i.forEach((e=>e()))}}function ge(e){he(e.$$.ptrType.registeredClass.name+" instance already deleted")}var Ae=!1;function ye(e){}function ve(e){e.count.value-=1,0===e.count.value&&function(e){e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)}(e)}function xe(e,t,r){if(t===r)return e;if(void 0===r.baseClass)return null;var n=xe(e,t,r.baseClass);return null===n?null:r.downcast(n)}var _e={};var be=[];function we(){for(;be.length;){var e=be.pop();e.$$.deleteScheduled=!1,e.delete()}}var Ee=void 0;var Me={};function Se(e,t){return t.ptrType&&t.ptr||pe("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&pe("Both smartPtrType and smartPtr must be specified"),t.count={value:1},Te(Object.create(e,{$$:{value:t}}))}function Ce(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=function(e,t){return t=function(e,t){for(void 0===t&&he("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t}(e,t),Me[t]}(this.registeredClass,t);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function i(){return this.isSmartPointer?Se(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):Se(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var s,o=this.registeredClass.getActualType(t),a=_e[o];if(!a)return i.call(this);s=this.isConst?a.constPointerType:a.pointerType;var l=xe(t,this.registeredClass,s.registeredClass);return null===l?i.call(this):this.isSmartPointer?Se(s.registeredClass.instancePrototype,{ptrType:s,ptr:l,smartPtrType:this,smartPtr:e}):Se(s.registeredClass.instancePrototype,{ptrType:s,ptr:l})}function Te(e){return"undefined"==typeof FinalizationRegistry?(Te=e=>e,e):(Ae=new FinalizationRegistry((e=>{console.warn(e.leakWarning.stack.replace(/^Error: /,"")),ve(e.$$)})),Te=e=>{var t=e.$$;if(t.smartPtr){var r={$$:t},n=t.ptrType.registeredClass;r.leakWarning=new Error("Embind found a leaked C++ instance "+n.name+" <0x"+t.ptr.toString(16)+">.\nWe'll free it automatically in this case, but this functionality is not reliable across various environments.\nMake sure to invoke .delete() manually once you're done with the instance instead.\nOriginally allocated"),"captureStackTrace"in Error&&Error.captureStackTrace(r.leakWarning,Ce),Ae.register(e,r,e)}return e},ye=e=>Ae.unregister(e),Te(e))}function Ie(){}function Re(e,t,r){if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||he("Function '"+r+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+e[t].overloadTable+")!"),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}}function Be(e,t,r,n,i,s,o,a){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=i,this.getActualType=s,this.upcast=o,this.downcast=a,this.pureVirtualFunctions=[]}function Pe(e,t,r){for(;t!==r;)t.upcast||he("Expected null or instance of "+r.name+", got an instance of "+t.name),e=t.upcast(e),t=t.baseClass;return e}function Le(e,t){if(null===t)return this.isReference&&he("null is not a valid "+this.name),0;t.$$||he('Cannot pass "'+Ke(t)+'" as a '+this.name),t.$$.ptr||he("Cannot pass deleted object as a pointer of type "+this.name);var r=t.$$.ptrType.registeredClass;return Pe(t.$$.ptr,r,this.registeredClass)}function De(e,t){var r;if(null===t)return this.isReference&&he("null is not a valid "+this.name),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t.$$||he('Cannot pass "'+Ke(t)+'" as a '+this.name),t.$$.ptr||he("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&t.$$.ptrType.isConst&&he("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);var n=t.$$.ptrType.registeredClass;if(r=Pe(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&he("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:he("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var i=t.clone();r=this.rawShare(r,Xe.toHandle((function(){i.delete()}))),null!==e&&e.push(this.rawDestructor,r)}break;default:he("Unsupporting sharing policy")}return r}function Oe(e,t){if(null===t)return this.isReference&&he("null is not a valid "+this.name),0;t.$$||he('Cannot pass "'+Ke(t)+'" as a '+this.name),t.$$.ptr||he("Cannot pass deleted object as a pointer of type "+this.name),t.$$.ptrType.isConst&&he("Cannot convert argument of type "+t.$$.ptrType.name+" to parameter type "+this.name);var r=t.$$.ptrType.registeredClass;return Pe(t.$$.ptr,r,this.registeredClass)}function Ne(e){return this.fromWireType(w[e>>2])}function Ue(e,t,r,n,i,s,o,a,l,c,u){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=i,this.pointeeType=s,this.sharingPolicy=o,this.rawGetPointee=a,this.rawConstructor=l,this.rawShare=c,this.rawDestructor=u,i||void 0!==t.baseClass?this.toWireType=De:n?(this.toWireType=Le,this.destructorFunction=null):(this.toWireType=Oe,this.destructorFunction=null)}var Fe=[];function ke(e){var t=Fe[e];return t||(e>=Fe.length&&(Fe.length=e+1),Fe[e]=t=D.get(e)),A(D.get(e)==t,"JavaScript-side Wasm function table mirror is out of date!"),t}function ze(e,t){var r=(e=ne(e)).includes("j")?function(e,t){A(e.includes("j")||e.includes("p"),"getDynCaller should only be called with i64 sigs");var r=[];return function(){return r.length=0,Object.assign(r,arguments),function(e,t,r){return e.includes("j")?function(e,t,r){A("dynCall_"+e in i,"bad function pointer type - no table for sig '"+e+"'"),r&&r.length?A(r.length===e.substring(1).replace(/j/g,"--").length):A(1==e.length);var n=i["dynCall_"+e];return r&&r.length?n.apply(null,[t].concat(r)):n.call(null,t)}(e,t,r):(A(ke(t),"missing table entry in dynCall: "+t),ke(t).apply(null,r))}(e,t,r)}}(e,t):ke(t);return"function"!=typeof r&&he("unknown function pointer with signature "+e+": "+t),r}var Ge=void 0;function Qe(e){var t=vt(e),r=ne(t);return yt(t),r}function Ve(e,t){var r=[],n={};throw t.forEach((function e(t){n[t]||se[t]||(oe[t]?oe[t].forEach(e):(r.push(t),n[t]=!0))})),new Ge(e+": "+r.map(Qe).join([", "]))}function He(e,t){for(var r=[],n=0;n>2]);return r}function je(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function qe(e,t,r,n,i){var s=t.length;s<2&&he("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var o=null!==t[1]&&null!==r,a=!1,l=1;l0?", ":"")+h),d+=(c?"var rv = ":"")+"invoker(fn"+(h.length>0?", ":"")+h+");\n",a)d+="runDestructors(destructors);\n";else for(l=o?1:2;l(e||he("Cannot use deleted val. handle = "+e),Ye[e].value),toHandle:e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var t=We.length?We.pop():Ye.length;return Ye[t]={refcount:1,value:e},t}}};function Ke(e){if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e}function $e(e,t){switch(t){case 2:return function(e){return this.fromWireType(M[e>>2])};case 3:return function(e){return this.fromWireType(S[e>>3])};default:throw new TypeError("Unknown float type: "+e)}}function Je(e,t,r){switch(t){case 0:return r?function(e){return v[e]}:function(e){return x[e]};case 1:return r?function(e){return _[e>>1]}:function(e){return b[e>>1]};case 2:return r?function(e){return w[e>>2]}:function(e){return E[e>>2]};default:throw new TypeError("Unknown integer type: "+e)}}var Ze="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function et(e,t){A(e%2==0,"Pointer passed to UTF16ToString must be aligned to two bytes!");for(var r=e,n=r>>1,i=n+t/2;!(n>=i)&&b[n];)++n;if((r=n<<1)-e>32&&Ze)return Ze.decode(x.subarray(e,r));for(var s="",o=0;!(o>=t/2);++o){var a=_[e+2*o>>1];if(0==a)break;s+=String.fromCharCode(a)}return s}function tt(e,t,r){if(A(t%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!"),A("number"==typeof r,"stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===r&&(r=2147483647),r<2)return 0;for(var n=t,i=(r-=2)<2*e.length?r/2:e.length,s=0;s>1]=o,t+=2}return _[t>>1]=0,t-n}function rt(e){return 2*e.length}function nt(e,t){A(e%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var r=0,n="";!(r>=t/4);){var i=w[e+4*r>>2];if(0==i)break;if(++r,i>=65536){var s=i-65536;n+=String.fromCharCode(55296|s>>10,56320|1023&s)}else n+=String.fromCharCode(i)}return n}function it(e,t,r){if(A(t%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!"),A("number"==typeof r,"stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===r&&(r=2147483647),r<4)return 0;for(var n=t,i=n+r-4,s=0;s=55296&&o<=57343&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++s)),w[t>>2]=o,(t+=4)+4>i)break}return w[t>>2]=0,t-n}function st(e){for(var t=0,r=0;r=55296&&n<=57343&&++r,t+=4}return t}function ot(e){try{return h.grow(e-y.byteLength+65535>>>16),P(h.buffer),1}catch(t){p("emscripten_realloc_buffer: Attempted to grow heap from "+y.byteLength+" bytes to "+e+" bytes, but got error: "+t)}}var at={};function lt(){if(!lt.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:a||"./this.program"};for(var t in at)void 0===at[t]?delete e[t]:e[t]=at[t];var r=[];for(var t in e)r.push(t+"="+e[t]);lt.strings=r}return lt.strings}var ct=[null,[],[]];function ut(e,t){var r=ct[e];A(r),0===t||10===t?((1===e?d:p)(T(r,0)),r.length=0):r.push(t)}function ht(e){return e%4==0&&(e%100!=0||e%400==0)}var dt=[31,29,31,30,31,30,31,31,30,31,30,31],pt=[31,28,31,30,31,30,31,31,30,31,30,31];function ft(e,t,r,n){var i=w[n+40>>2],s={tm_sec:w[n>>2],tm_min:w[n+4>>2],tm_hour:w[n+8>>2],tm_mday:w[n+12>>2],tm_mon:w[n+16>>2],tm_year:w[n+20>>2],tm_wday:w[n+24>>2],tm_yday:w[n+28>>2],tm_isdst:w[n+32>>2],tm_gmtoff:w[n+36>>2],tm_zone:i?I(i):""},o=I(r),a={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var l in a)o=o.replace(new RegExp(l,"g"),a[l]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],u=["January","February","March","April","May","June","July","August","September","October","November","December"];function h(e,t,r){for(var n="number"==typeof e?e.toString():e||"";n.length0?1:0}var n;return 0===(n=r(e.getFullYear()-t.getFullYear()))&&0===(n=r(e.getMonth()-t.getMonth()))&&(n=r(e.getDate()-t.getDate())),n}function f(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function m(e){var t=function(e,t){for(var r=new Date(e.getTime());t>0;){var n=ht(r.getFullYear()),i=r.getMonth(),s=(n?dt:pt)[i];if(!(t>s-r.getDate()))return r.setDate(r.getDate()+t),r;t-=s-r.getDate()+1,r.setDate(1),i<11?r.setMonth(i+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1))}return r}(new Date(e.tm_year+1900,0,1),e.tm_yday),r=new Date(t.getFullYear(),0,4),n=new Date(t.getFullYear()+1,0,4),i=f(r),s=f(n);return p(i,t)<=0?p(s,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var g={"%a":function(e){return c[e.tm_wday].substring(0,3)},"%A":function(e){return c[e.tm_wday]},"%b":function(e){return u[e.tm_mon].substring(0,3)},"%B":function(e){return u[e.tm_mon]},"%C":function(e){return d((e.tm_year+1900)/100|0,2)},"%d":function(e){return d(e.tm_mday,2)},"%e":function(e){return h(e.tm_mday,2," ")},"%g":function(e){return m(e).toString().substring(2)},"%G":function(e){return m(e)},"%H":function(e){return d(e.tm_hour,2)},"%I":function(e){var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),d(t,2)},"%j":function(e){return d(e.tm_mday+function(e,t){for(var r=0,n=0;n<=t;r+=e[n++]);return r}(ht(e.tm_year+1900)?dt:pt,e.tm_mon-1),3)},"%m":function(e){return d(e.tm_mon+1,2)},"%M":function(e){return d(e.tm_min,2)},"%n":function(){return"\n"},"%p":function(e){return e.tm_hour>=0&&e.tm_hour<12?"AM":"PM"},"%S":function(e){return d(e.tm_sec,2)},"%t":function(){return"\t"},"%u":function(e){return e.tm_wday||7},"%U":function(e){var t=e.tm_yday+7-e.tm_wday;return d(Math.floor(t/7),2)},"%V":function(e){var t=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&t++,t){if(53==t){var r=(e.tm_wday+371-e.tm_yday)%7;4==r||3==r&&ht(e.tm_year)||(t=1)}}else{t=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&ht(e.tm_year%400-1))&&t++}return d(t,2)},"%w":function(e){return e.tm_wday},"%W":function(e){var t=e.tm_yday+7-(e.tm_wday+6)%7;return d(Math.floor(t/7),2)},"%y":function(e){return(e.tm_year+1900).toString().substring(2)},"%Y":function(e){return e.tm_year+1900},"%z":function(e){var t=e.tm_gmtoff,r=t>=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(r?"+":"-")+String("0000"+t).slice(-4)},"%Z":function(e){return e.tm_zone},"%%":function(){return"%"}};for(var l in o=o.replace(/%%/g,"\0\0"),g)o.includes(l)&&(o=o.replace(new RegExp(l,"g"),g[l](s)));var y,x,_,b=(x=B(y=o=o.replace(/\0\0/g,"%"))+1,R(y,_=new Array(x),0,_.length),_);return b.length>t?0:(function(e,t){A(e.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),v.set(e,t)}(b,e),b.length-1)}!function(){for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);re=e}(),ue=i.BindingError=ce(Error,"BindingError"),de=i.InternalError=ce(Error,"InternalError"),Ie.prototype.isAliasOf=function(e){if(!(this instanceof Ie))return!1;if(!(e instanceof Ie))return!1;for(var t=this.$$.ptrType.registeredClass,r=this.$$.ptr,n=e.$$.ptrType.registeredClass,i=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)i=n.upcast(i),n=n.baseClass;return t===n&&r===i},Ie.prototype.clone=function(){if(this.$$.ptr||ge(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=Te(Object.create(Object.getPrototypeOf(this),{$$:{value:(e=this.$$,{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType})}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t},Ie.prototype.delete=function(){this.$$.ptr||ge(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&he("Object already scheduled for deletion"),ye(this),ve(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},Ie.prototype.isDeleted=function(){return!this.$$.ptr},Ie.prototype.deleteLater=function(){return this.$$.ptr||ge(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&he("Object already scheduled for deletion"),be.push(this),1===be.length&&Ee&&Ee(we),this.$$.deleteScheduled=!0,this},i.getInheritedInstanceCount=function(){return Object.keys(Me).length},i.getLiveInheritedInstances=function(){var e=[];for(var t in Me)Me.hasOwnProperty(t)&&e.push(Me[t]);return e},i.flushPendingDeletes=we,i.setDelayFunction=function(e){Ee=e,be.length&&Ee&&Ee(we)},Ue.prototype.getPointee=function(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},Ue.prototype.destructor=function(e){this.rawDestructor&&this.rawDestructor(e)},Ue.prototype.argPackAdvance=8,Ue.prototype.readValueFromPointer=Ne,Ue.prototype.deleteObject=function(e){null!==e&&e.delete()},Ue.prototype.fromWireType=Ce,Ge=i.UnboundTypeError=ce(Error,"UnboundTypeError"),i.count_emval_handles=function(){for(var e=0,t=5;t>s])},destructorFunction:null})},_embind_register_class:function(e,t,r,n,s,o,a,l,c,u,h,d,p){h=ne(h),o=ze(s,o),l&&(l=ze(a,l)),u&&(u=ze(c,u)),p=ze(d,p);var f=ae(h);!function(e,t,r){i.hasOwnProperty(e)?(he("Cannot register public name '"+e+"' twice"),Re(i,e,e),i.hasOwnProperty(r)&&he("Cannot register multiple overloads of a function with the same number of arguments ("+r+")!"),i[e].overloadTable[void 0]=t):i[e]=t}(f,(function(){Ve("Cannot construct "+h+" due to unbound types",[n])})),fe([e,t,r],n?[n]:[],(function(t){var r,s;t=t[0],s=n?(r=t.registeredClass).instancePrototype:Ie.prototype;var a=le(f,(function(){if(Object.getPrototypeOf(this)!==c)throw new ue("Use 'new' to construct "+h);if(void 0===d.constructor_body)throw new ue(h+" has no accessible constructor");var e=d.constructor_body[arguments.length];if(void 0===e)throw new ue("Tried to invoke ctor of "+h+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(d.constructor_body).toString()+") parameters instead!");return e.apply(this,arguments)})),c=Object.create(s,{constructor:{value:a}});a.prototype=c;var d=new Be(h,a,c,p,r,o,l,u),m=new Ue(h,d,!0,!1,!1),g=new Ue(h+"*",d,!1,!1,!1),A=new Ue(h+" const*",d,!1,!0,!1);return _e[e]={pointerType:g,constPointerType:A},function(e,t,r){i.hasOwnProperty(e)||pe("Replacing nonexistant public symbol"),i[e].overloadTable,i[e]=t,i[e].argCount=r}(f,a),[m,g,A]}))},_embind_register_class_constructor:function(e,t,r,n,i,s){A(t>0);var o=He(t,r);i=ze(n,i),fe([],[e],(function(e){var r="constructor "+(e=e[0]).name;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[t-1])throw new ue("Cannot register multiple constructors with identical number of parameters ("+(t-1)+") for class '"+e.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return e.registeredClass.constructor_body[t-1]=()=>{Ve("Cannot construct "+e.name+" due to unbound types",o)},fe([],o,(function(n){return n.splice(1,0,null),e.registeredClass.constructor_body[t-1]=qe(r,n,null,i,s),[]})),[]}))},_embind_register_class_function:function(e,t,r,n,i,s,o,a){var l=He(r,n);t=ne(t),s=ze(i,s),fe([],[e],(function(e){var n=(e=e[0]).name+"."+t;function i(){Ve("Cannot call "+n+" due to unbound types",l)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),a&&e.registeredClass.pureVirtualFunctions.push(t);var c=e.registeredClass.instancePrototype,u=c[t];return void 0===u||void 0===u.overloadTable&&u.className!==e.name&&u.argCount===r-2?(i.argCount=r-2,i.className=e.name,c[t]=i):(Re(c,t,n),c[t].overloadTable[r-2]=i),fe([],l,(function(i){var a=qe(n,i,e,s,o);return void 0===c[t].overloadTable?(a.argCount=r-2,c[t]=a):c[t].overloadTable[r-2]=a,[]})),[]}))},_embind_register_emval:function(e,t){me(e,{name:t=ne(t),fromWireType:function(e){var t=Xe.toValue(e);return function(e){e>4&&0==--Ye[e].refcount&&(Ye[e]=void 0,We.push(e))}(e),t},toWireType:function(e,t){return Xe.toHandle(t)},argPackAdvance:8,readValueFromPointer:Ne,destructorFunction:null})},_embind_register_float:function(e,t,r){var n=te(r);me(e,{name:t=ne(t),fromWireType:function(e){return e},toWireType:function(e,t){if("number"!=typeof t&&"boolean"!=typeof t)throw new TypeError('Cannot convert "'+Ke(t)+'" to '+this.name);return t},argPackAdvance:8,readValueFromPointer:$e(t,n),destructorFunction:null})},_embind_register_integer:function(e,t,r,n,i){t=ne(t),-1===i&&(i=4294967295);var s=te(r),o=e=>e;if(0===n){var a=32-8*r;o=e=>e<>>a}var l=t.includes("unsigned"),c=(e,r)=>{if("number"!=typeof e&&"boolean"!=typeof e)throw new TypeError('Cannot convert "'+Ke(e)+'" to '+r);if(ei)throw new TypeError('Passing a number "'+Ke(e)+'" from JS side to C/C++ side to an argument of type "'+t+'", which is outside the valid range ['+n+", "+i+"]!")};me(e,{name:t,fromWireType:o,toWireType:l?function(e,t){return c(t,this.name),t>>>0}:function(e,t){return c(t,this.name),t},argPackAdvance:8,readValueFromPointer:Je(t,s,0!==n),destructorFunction:null})},_embind_register_memory_view:function(e,t,r){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];function i(e){var t=E,r=t[e>>=2],i=t[e+1];return new n(y,i,r)}me(e,{name:r=ne(r),fromWireType:i,argPackAdvance:8,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})},_embind_register_std_string:function(e,t){var r="std::string"===(t=ne(t));me(e,{name:t,fromWireType:function(e){var t,n=E[e>>2],i=e+4;if(r)for(var s=i,o=0;o<=n;++o){var a=i+o;if(o==n||0==x[a]){var l=I(s,a-s);void 0===t?t=l:(t+=String.fromCharCode(0),t+=l),s=a+1}}else{var c=new Array(n);for(o=0;o>2]=n,r&&i)s=t,o=c,A("number"==typeof(a=n+1),"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),R(s,x,o,a);else if(i)for(var u=0;u255&&(yt(c),he("String has UTF-16 code units that do not fit in 8 bits")),x[c+u]=h}else for(u=0;ub,a=1):4===t&&(n=nt,i=it,o=st,s=()=>E,a=2),me(e,{name:r,fromWireType:function(e){for(var r,i=E[e>>2],o=s(),l=e+4,c=0;c<=i;++c){var u=e+4+c*t;if(c==i||0==o[u>>a]){var h=n(l,u-l);void 0===r?r=h:(r+=String.fromCharCode(0),r+=h),l=u+t}}return yt(e),r},toWireType:function(e,n){"string"!=typeof n&&he("Cannot pass non-string to C++ string type "+r);var s=o(n),l=At(4+s+t);return E[l>>2]=s>>a,i(n,l+4,s+t),null!==e&&e.push(yt,l),l},argPackAdvance:8,readValueFromPointer:Ne,destructorFunction:function(e){yt(e)}})},_embind_register_void:function(e,t){me(e,{isVoid:!0,name:t=ne(t),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,t){}})},abort:function(){j("native code called abort()")},emscripten_memcpy_big:function(e,t,r){x.copyWithin(e,t,t+r)},emscripten_resize_heap:function(e){var t=x.length;A((e>>>=0)>t);var r,n=2147483648;if(e>n)return p("Cannot enlarge memory, asked to go up to "+e+" bytes, but the limit is "+n+" bytes!"),!1;for(var i=1;i<=4;i*=2){var s=t*(1+.2/i);s=Math.min(s,e+100663296);var o=Math.min(n,(r=Math.max(e,s))+(65536-r%65536)%65536);if(ot(o))return!0}return p("Failed to grow the heap from "+t+" bytes to "+o+" bytes, not enough memory!"),!1},environ_get:function(e,t){var r=0;return lt().forEach((function(n,i){var s=t+r;E[e+4*i>>2]=s,function(e,t){for(var r=0;r>2]=r.length;var n=0;return r.forEach((function(e){n+=e.length+1})),E[t>>2]=n,0},fd_close:function(e){j("fd_close called without SYSCALLS_REQUIRE_FILESYSTEM")},fd_seek:function(e,t,r,n,i){return 70},fd_write:function(e,t,r,n){for(var i=0,s=0;s>2],a=E[t+4>>2];t+=8;for(var l=0;l>2]=i,0},strftime_l:function(e,t,r,n){return ft(e,t,r,n)}},At=(function(){var e,t={env:gt,wasi_snapshot_preview1:gt};function r(e,t){var r,n=e.exports;i.asm=n,A(h=i.asm.memory,"memory not found in wasm exports"),P(h.buffer),A(D=i.asm.__indirect_function_table,"table not found in wasm exports"),r=i.asm.__wasm_call_ctors,F.unshift(r),function(e){if(G--,i.monitorRunDependencies&&i.monitorRunDependencies(G),e?(A(H[e]),delete H[e]):p("warning: run dependency removed without ID"),0==G&&(null!==Q&&(clearInterval(Q),Q=null),V)){var t=V;V=null,t()}}("wasm-instantiate")}e="wasm-instantiate",G++,i.monitorRunDependencies&&i.monitorRunDependencies(G),e?(A(!H[e]),H[e]=1,null===Q&&"undefined"!=typeof setInterval&&(Q=setInterval((function(){if(g)return clearInterval(Q),void(Q=null);var e=!1;for(var t in H)e||(e=!0,p("still waiting on run dependencies:")),p("dependency: "+t);e&&p("(end of list)")}),1e4))):p("warning: run dependency added without ID");var s=i;function o(e){A(i===s,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),s=null,r(e.instance)}function a(e){return(u||"function"!=typeof fetch?Promise.resolve().then((function(){return $(q)})):fetch(q,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+q+"'";return e.arrayBuffer()})).catch((function(){return $(q)}))).then((function(e){return WebAssembly.instantiate(e,t)})).then((function(e){return e})).then(e,(function(e){p("failed to asynchronously prepare wasm: "+e),q.startsWith("file://")&&p("warning: Loading from a file URI ("+q+") is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing"),j(e)}))}if(i.instantiateWasm)try{return i.instantiateWasm(t,r)}catch(e){return p("Module.instantiateWasm callback failed with error: "+e),!1}(u||"function"!=typeof WebAssembly.instantiateStreaming||X(q)||"function"!=typeof fetch?a(o):fetch(q,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,t).then(o,(function(e){return p("wasm streaming compile failed: "+e),p("falling back to ArrayBuffer instantiation"),a(o)}))}))).catch(n)}(),i.___wasm_call_ctors=K("__wasm_call_ctors"),i._malloc=K("malloc")),yt=i._free=K("free"),vt=i.___getTypeName=K("__getTypeName"),xt=(i.__embind_initialize_bindings=K("_embind_initialize_bindings"),i.___errno_location=K("__errno_location"),i._fflush=K("fflush"),i._emscripten_stack_init=function(){return(xt=i._emscripten_stack_init=i.asm.emscripten_stack_init).apply(null,arguments)}),_t=(i._emscripten_stack_get_free=function(){return(i._emscripten_stack_get_free=i.asm.emscripten_stack_get_free).apply(null,arguments)},i._emscripten_stack_get_base=function(){return(i._emscripten_stack_get_base=i.asm.emscripten_stack_get_base).apply(null,arguments)},i._emscripten_stack_get_end=function(){return(_t=i._emscripten_stack_get_end=i.asm.emscripten_stack_get_end).apply(null,arguments)}),bt=(i.stackSave=K("stackSave"),i.stackRestore=K("stackRestore"),i.stackAlloc=K("stackAlloc"),i.___cxa_is_pointer_type=K("__cxa_is_pointer_type"));function wt(e){function t(){mt||(mt=!0,i.calledRun=!0,g||(A(!z),z=!0,N(),J(F),r(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),A(!i._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(N(),i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)e=i.postRun.shift(),k.unshift(e);var e;J(k)}()))}var n;e=e||o,G>0||(xt(),A(!(3&(n=_t()))),E[n>>2]=34821223,E[n+4>>2]=2310721022,E[0]=1668509029,function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)e=i.preRun.shift(),U.unshift(e);var e;J(U)}(),G>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),t()}),1)):t(),N()))}if(i.dynCall_viijii=K("dynCall_viijii"),i.dynCall_ji=K("dynCall_ji"),i.dynCall_jiji=K("dynCall_jiji"),i.dynCall_iiiiij=K("dynCall_iiiiij"),i.dynCall_iiiiijj=K("dynCall_iiiiijj"),i.dynCall_iiiiiijj=K("dynCall_iiiiiijj"),["run","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","addOnPreRun","addOnInit","addOnPreMain","addOnExit","addOnPostRun","addRunDependency","removeRunDependency","FS_createFolder","FS_createPath","FS_createDataFile","FS_createPreloadedFile","FS_createLazyFile","FS_createLink","FS_createDevice","FS_unlink","getLEB","getFunctionTables","alignFunctionTables","registerFunctions","prettyPrint","getCompilerSetting","print","printErr","callMain","abort","keepRuntimeAlive","wasmMemory","stackAlloc","stackSave","stackRestore","getTempRet0","setTempRet0","writeStackCookie","checkStackCookie","ptrToString","zeroMemory","stringToNewUTF8","exitJS","getHeapMax","emscripten_realloc_buffer","ENV","ERRNO_CODES","ERRNO_MESSAGES","setErrNo","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","DNS","getHostByName","Protocols","Sockets","getRandomDevice","warnOnce","traverseStack","UNWIND_CACHE","convertPCtoSourceLocation","readAsmConstArgsArray","readAsmConstArgs","mainThreadEM_ASM","jstoi_q","jstoi_s","getExecutableName","listenOnce","autoResumeAudioContext","dynCallLegacy","getDynCaller","dynCall","handleException","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","safeSetTimeout","asmjsMangle","asyncLoad","alignMemory","mmapAlloc","writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","convertI32PairToI53","convertI32PairToI53Checked","convertU32PairToI53","getCFunc","ccall","cwrap","uleb128Encode","sigToWasmTypes","convertJsFunctionToWasm","freeTableIndexes","functionsInTableMap","getEmptyTableSlot","updateTableMap","addFunction","removeFunction","reallyNegative","unSign","strLen","reSign","formatString","setValue","getValue","PATH","PATH_FS","intArrayFromString","intArrayToString","AsciiToString","stringToAscii","UTF16Decoder","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","allocateUTF8","allocateUTF8OnStack","writeStringToMemory","writeArrayToMemory","writeAsciiToMemory","SYSCALLS","getSocketFromFD","getSocketAddress","JSEvents","registerKeyEventCallback","specialHTMLTargets","maybeCStringToJsString","findEventTarget","findCanvasEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","currentFullscreenStrategy","restoreOldWindowedStyle","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","demangle","demangleAll","jsStackTrace","stackTrace","ExitStatus","getEnvStrings","checkWasiClock","flush_NO_FILESYSTEM","dlopenMissingError","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","uncaughtExceptionCount","exceptionLast","exceptionCaught","ExceptionInfo","exception_addRef","exception_decRef","Browser","setMainLoop","wget","FS","MEMFS","TTY","PIPEFS","SOCKFS","_setNetworkCallback","tempFixedLengthArray","miniTempWebGLFloatBuffers","heapObjectForWebGLType","heapAccessShiftForWebGLHeap","GL","emscriptenWebGLGet","computeUnpackAlignedImageSize","emscriptenWebGLGetTexPixelData","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","writeGLArray","AL","SDL_unicode","SDL_ttfContext","SDL_audio","SDL","SDL_gfx","GLUT","EGL","GLFW_Window","GLFW","GLEW","IDBStore","runAndAbortIfError","ALLOC_NORMAL","ALLOC_STACK","allocate","InternalError","BindingError","UnboundTypeError","PureVirtualError","init_embind","throwInternalError","throwBindingError","throwUnboundTypeError","ensureOverloadTable","exposePublicSymbol","replacePublicSymbol","extendError","createNamedFunction","embindRepr","registeredInstances","getBasestPointer","registerInheritedInstance","unregisterInheritedInstance","getInheritedInstance","getInheritedInstanceCount","getLiveInheritedInstances","registeredTypes","awaitingDependencies","typeDependencies","registeredPointers","registerType","whenDependentTypesAreResolved","embind_charCodes","embind_init_charCodes","readLatin1String","getTypeName","heap32VectorToArray","requireRegisteredType","getShiftFromSize","integerReadValueFromPointer","enumReadValueFromPointer","floatReadValueFromPointer","simpleReadValueFromPointer","runDestructors","new_","craftInvokerFunction","embind__requireFunction","tupleRegistrations","structRegistrations","genericPointerToWireType","constNoSmartPtrRawPointerToWireType","nonConstNoSmartPtrRawPointerToWireType","init_RegisteredPointer","RegisteredPointer","RegisteredPointer_getPointee","RegisteredPointer_destructor","RegisteredPointer_deleteObject","RegisteredPointer_fromWireType","runDestructor","releaseClassHandle","finalizationRegistry","detachFinalizer_deps","detachFinalizer","attachFinalizer","makeClassHandle","init_ClassHandle","ClassHandle","ClassHandle_isAliasOf","throwInstanceAlreadyDeleted","ClassHandle_clone","ClassHandle_delete","deletionQueue","ClassHandle_isDeleted","ClassHandle_deleteLater","flushPendingDeletes","delayFunction","setDelayFunction","RegisteredClass","shallowCopyInternalPointer","downcastPointer","upcastPointer","validateThis","char_0","char_9","makeLegalFunctionName","emval_handle_array","emval_free_list","emval_symbols","init_emval","count_emval_handles","get_first_emval","getStringOrSymbol","Emval","emval_newers","craftEmvalAllocator","emval_get_global","emval_lookupTypes","emval_allocateDestructors","emval_methodCallers","emval_addMethodCaller","emval_registeredMethods"].forEach((function(e){Object.getOwnPropertyDescriptor(i,e)||Object.defineProperty(i,e,{configurable:!0,get:function(){var t="'"+e+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";m(e)&&(t+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),j(t)}})})),["ptrToString","zeroMemory","stringToNewUTF8","exitJS","setErrNo","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","getHostByName","getRandomDevice","traverseStack","convertPCtoSourceLocation","readAsmConstArgs","mainThreadEM_ASM","jstoi_q","jstoi_s","listenOnce","autoResumeAudioContext","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","safeSetTimeout","asmjsMangle","asyncLoad","alignMemory","mmapAlloc","writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","convertI32PairToI53","convertU32PairToI53","reallyNegative","unSign","strLen","reSign","formatString","getSocketFromFD","getSocketAddress","registerKeyEventCallback","maybeCStringToJsString","findEventTarget","findCanvasEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","checkWasiClock","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","exception_addRef","exception_decRef","setMainLoop","_setNetworkCallback","heapObjectForWebGLType","heapAccessShiftForWebGLHeap","emscriptenWebGLGet","computeUnpackAlignedImageSize","emscriptenWebGLGetTexPixelData","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","writeGLArray","SDL_unicode","SDL_ttfContext","SDL_audio","GLFW_Window","runAndAbortIfError","registerInheritedInstance","unregisterInheritedInstance","requireRegisteredType","enumReadValueFromPointer","validateThis","getStringOrSymbol","craftEmvalAllocator","emval_get_global","emval_lookupTypes","emval_allocateDestructors","emval_addMethodCaller"].forEach((function(e){"undefined"==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,e)||Object.defineProperty(globalThis,e,{configurable:!0,get:function(){var t="`"+e+"` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line";m(e)&&(t+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),Z(t)}})})),V=function e(){mt||wt(),mt||(V=e)},i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return wt(),e.ready});e.exports=r},6585:e=>{var t=1e3,r=60*t,n=60*r,i=24*n,s=7*i;function o(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}e.exports=function(e,a){a=a||{};var l,c,u=typeof e;if("string"===u&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(o){var a=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*a;case"weeks":case"week":case"w":return a*s;case"days":case"day":case"d":return a*i;case"hours":case"hour":case"hrs":case"hr":case"h":return a*n;case"minutes":case"minute":case"mins":case"min":case"m":return a*r;case"seconds":case"second":case"secs":case"sec":case"s":return a*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}(e);if("number"===u&&isFinite(e))return a.long?(l=e,(c=Math.abs(l))>=i?o(l,c,i,"day"):c>=n?o(l,c,n,"hour"):c>=r?o(l,c,r,"minute"):c>=t?o(l,c,t,"second"):l+" ms"):function(e){var s=Math.abs(e);return s>=i?Math.round(e/i)+"d":s>=n?Math.round(e/n)+"h":s>=r?Math.round(e/r)+"m":s>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},54527:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Observable:()=>_,Subject:()=>T,filter:()=>w,flatMap:()=>E,interval:()=>M,map:()=>S,merge:()=>C,multicast:()=>I,scan:()=>R,unsubscribe:()=>b});class n{constructor(e){this._baseObserver=e,this._pendingPromises=new Set}complete(){Promise.all(this._pendingPromises).then((()=>this._baseObserver.complete())).catch((e=>this._baseObserver.error(e)))}error(e){this._baseObserver.error(e)}schedule(e){const t=Promise.all(this._pendingPromises),r=[],n=e=>r.push(e),i=Promise.resolve().then((()=>{return s=this,o=void 0,l=function*(){yield t,yield e(n),this._pendingPromises.delete(i);for(const e of r)this._baseObserver.next(e)},new((a=void 0)||(a=Promise))((function(e,t){function r(e){try{i(l.next(e))}catch(e){t(e)}}function n(e){try{i(l.throw(e))}catch(e){t(e)}}function i(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(r,n)}i((l=l.apply(s,o||[])).next())}));var s,o,a,l})).catch((e=>{this._pendingPromises.delete(i),this._baseObserver.error(e)}));this._pendingPromises.add(i)}}const i=()=>"function"==typeof Symbol,s=e=>i()&&Boolean(Symbol[e]),o=e=>s(e)?Symbol[e]:"@@"+e;s("asyncIterator")||(Symbol.asyncIterator=Symbol.asyncIterator||Symbol.for("Symbol.asyncIterator"));const a=o("iterator"),l=o("observable"),c=o("species");function u(e,t){const r=e[t];if(null!=r){if("function"!=typeof r)throw new TypeError(r+" is not a function");return r}}function h(e){let t=e.constructor;return void 0!==t&&(t=t[c],null===t&&(t=void 0)),void 0!==t?t:x}function d(e){d.log?d.log(e):setTimeout((()=>{throw e}),0)}function p(e){Promise.resolve().then((()=>{try{e()}catch(e){d(e)}}))}function f(e){const t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{const e=u(t,"unsubscribe");e&&e.call(t)}}catch(e){d(e)}}function m(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function g(e,t,r){e._state="running";const n=e._observer;try{const i=n?u(n,t):void 0;switch(t){case"next":i&&i.call(n,r);break;case"error":if(m(e),!i)throw r;i.call(n,r);break;case"complete":m(e),i&&i.call(n)}}catch(e){d(e)}"closed"===e._state?f(e):"running"===e._state&&(e._state="ready")}function A(e,t,r){if("closed"!==e._state)return"buffering"===e._state?(e._queue=e._queue||[],void e._queue.push({type:t,value:r})):"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:r}],void p((()=>function(e){const t=e._queue;if(t){e._queue=void 0,e._state="ready";for(const r of t)if(g(e,r.type,r.value),"closed"===e._state)break}}(e)))):void g(e,t,r)}class y{constructor(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";const r=new v(this);try{this._cleanup=t.call(void 0,r)}catch(e){r.error(e)}"initializing"===this._state&&(this._state="ready")}get closed(){return"closed"===this._state}unsubscribe(){"closed"!==this._state&&(m(this),f(this))}}class v{constructor(e){this._subscription=e}get closed(){return"closed"===this._subscription._state}next(e){A(this._subscription,"next",e)}error(e){A(this._subscription,"error",e)}complete(){A(this._subscription,"complete")}}class x{constructor(e){if(!(this instanceof x))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof e)throw new TypeError("Observable initializer must be a function");this._subscriber=e}subscribe(e,t,r){return"object"==typeof e&&null!==e||(e={next:e,error:t,complete:r}),new y(e,this._subscriber)}pipe(e,...t){let r=this;for(const n of[e,...t])r=n(r);return r}tap(e,t,r){const n="object"!=typeof e||null===e?{next:e,error:t,complete:r}:e;return new x((e=>this.subscribe({next(t){n.next&&n.next(t),e.next(t)},error(t){n.error&&n.error(t),e.error(t)},complete(){n.complete&&n.complete(),e.complete()},start(e){n.start&&n.start(e)}})))}forEach(e){return new Promise(((t,r)=>{if("function"!=typeof e)return void r(new TypeError(e+" is not a function"));function n(){i.unsubscribe(),t(void 0)}const i=this.subscribe({next(t){try{e(t,n)}catch(e){r(e),i.unsubscribe()}},error(e){r(e)},complete(){t(void 0)}})}))}map(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(h(this))((t=>this.subscribe({next(r){let n=r;try{n=e(r)}catch(e){return t.error(e)}t.next(n)},error(e){t.error(e)},complete(){t.complete()}})))}filter(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(h(this))((t=>this.subscribe({next(r){try{if(!e(r))return}catch(e){return t.error(e)}t.next(r)},error(e){t.error(e)},complete(){t.complete()}})))}reduce(e,t){if("function"!=typeof e)throw new TypeError(e+" is not a function");const r=h(this),n=arguments.length>1;let i=!1,s=t;return new r((t=>this.subscribe({next(r){const o=!i;if(i=!0,!o||n)try{s=e(s,r)}catch(e){return t.error(e)}else s=r},error(e){t.error(e)},complete(){if(!i&&!n)return t.error(new TypeError("Cannot reduce an empty sequence"));t.next(s),t.complete()}})))}concat(...e){const t=h(this);return new t((r=>{let n,i=0;return function s(o){n=o.subscribe({next(e){r.next(e)},error(e){r.error(e)},complete(){i===e.length?(n=void 0,r.complete()):s(t.from(e[i++]))}})}(this),()=>{n&&(n.unsubscribe(),n=void 0)}}))}flatMap(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");const t=h(this);return new t((r=>{const n=[],i=this.subscribe({next(i){let o;if(e)try{o=e(i)}catch(e){return r.error(e)}else o=i;const a=t.from(o).subscribe({next(e){r.next(e)},error(e){r.error(e)},complete(){const e=n.indexOf(a);e>=0&&n.splice(e,1),s()}});n.push(a)},error(e){r.error(e)},complete(){s()}});function s(){i.closed&&0===n.length&&r.complete()}return()=>{n.forEach((e=>e.unsubscribe())),i.unsubscribe()}}))}[(Symbol.observable,l)](){return this}static from(e){const t="function"==typeof this?this:x;if(null==e)throw new TypeError(e+" is not an object");const r=u(e,l);if(r){const n=r.call(e);if(Object(n)!==n)throw new TypeError(n+" is not an object");return function(e){return e instanceof x}(n)&&n.constructor===t?n:new t((e=>n.subscribe(e)))}if(s("iterator")){const r=u(e,a);if(r)return new t((t=>{p((()=>{if(!t.closed){for(const n of r.call(e))if(t.next(n),t.closed)return;t.complete()}}))}))}if(Array.isArray(e))return new t((t=>{p((()=>{if(!t.closed){for(const r of e)if(t.next(r),t.closed)return;t.complete()}}))}));throw new TypeError(e+" is not observable")}static of(...e){return new("function"==typeof this?this:x)((t=>{p((()=>{if(!t.closed){for(const r of e)if(t.next(r),t.closed)return;t.complete()}}))}))}static get[c](){return this}}i()&&Object.defineProperty(x,Symbol("extensions"),{value:{symbol:l,hostReportError:d},configurable:!0});const _=x,b=function(e){"function"==typeof e?e():e&&"function"==typeof e.unsubscribe&&e.unsubscribe()};const w=function(e){return t=>new _((r=>{const i=new n(r),s=t.subscribe({complete(){i.complete()},error(e){i.error(e)},next(t){i.schedule((r=>{return n=this,i=void 0,o=function*(){(yield e(t))&&r(t)},new((s=void 0)||(s=Promise))((function(e,t){function r(e){try{l(o.next(e))}catch(e){t(e)}}function a(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof s?n:new s((function(e){e(n)}))).then(r,a)}l((o=o.apply(n,i||[])).next())}));var n,i,s,o}))}});return()=>b(s)}))};const E=function(e){return t=>new _((r=>{const i=new n(r),o=t.subscribe({complete(){i.complete()},error(e){i.error(e)},next(t){i.schedule((r=>{return n=this,i=void 0,a=function*(){var n,i;const o=yield e(t);if((c=o)&&s("iterator")&&c[Symbol.iterator]||function(e){return e&&s("asyncIterator")&&e[Symbol.asyncIterator]}(o))try{for(var a,l=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){!function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)}(n,i,(t=e[r](t)).done,t.value)}))}}}(o);!(a=yield l.next()).done;){const e=a.value;r(e)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=l.return)&&(yield i.call(l))}finally{if(n)throw n.error}}else o.map((e=>r(e)));var c},new((o=void 0)||(o=Promise))((function(e,t){function r(e){try{l(a.next(e))}catch(e){t(e)}}function s(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(r,s)}l((a=a.apply(n,i||[])).next())}));var n,i,o,a}))}});return()=>b(o)}))};function M(e){return new x((t=>{let r=0;const n=setInterval((()=>{t.next(r++)}),e);return()=>clearInterval(n)}))}const S=function(e){return t=>new _((r=>{const i=new n(r),s=t.subscribe({complete(){i.complete()},error(e){i.error(e)},next(t){i.schedule((r=>{return n=this,i=void 0,o=function*(){const n=yield e(t);r(n)},new((s=void 0)||(s=Promise))((function(e,t){function r(e){try{l(o.next(e))}catch(e){t(e)}}function a(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof s?n:new s((function(e){e(n)}))).then(r,a)}l((o=o.apply(n,i||[])).next())}));var n,i,s,o}))}});return()=>b(s)}))},C=function(...e){return 0===e.length?x.from([]):new x((t=>{let r=0;const n=e.map((n=>n.subscribe({error(e){t.error(e),i()},next(e){t.next(e)},complete(){++r===e.length&&(t.complete(),i())}}))),i=()=>{n.forEach((e=>b(e)))};return i}))},T=class extends _{constructor(){super((e=>(this._observers.add(e),()=>this._observers.delete(e)))),this._observers=new Set}next(e){for(const t of this._observers)t.next(e)}error(e){for(const t of this._observers)t.error(e)}complete(){for(const e of this._observers)e.complete()}},I=function(e){const t=new T;let r,n=0;return new _((i=>{r||(r=e.subscribe(t));const s=t.subscribe(i);return n++,()=>{n--,s.unsubscribe(),0===n&&(b(r),r=void 0)}}))};const R=function(e,t){return r=>new _((i=>{let s,o=0;const a=new n(i),l=r.subscribe({complete(){a.complete()},error(e){a.error(e)},next(r){a.schedule((n=>{return i=this,a=void 0,c=function*(){const i=0===o?void 0===t?r:t:s;s=yield e(i,r,o++),n(s)},new((l=void 0)||(l=Promise))((function(e,t){function r(e){try{s(c.next(e))}catch(e){t(e)}}function n(e){try{s(c.throw(e))}catch(e){t(e)}}function s(t){var i;t.done?e(t.value):(i=t.value,i instanceof l?i:new l((function(e){e(i)}))).then(r,n)}s((c=c.apply(i,a||[])).next())}));var i,a,l,c}))}});return()=>b(l)}))}},68721:(e,t,r)=>{"use strict";r.d(t,{A:()=>er});var n=6378137,i=.0066943799901413165,s=484813681109536e-20,o=Math.PI/2,a=1e-10,l=.017453292519943295,c=57.29577951308232,u=Math.PI/4,h=2*Math.PI,d=3.14159265359,p={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667};const f={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}};var m=/[\s_\-\/\(\)]/g;function g(e,t){if(e[t])return e[t];for(var r,n=Object.keys(e),i=t.toLowerCase().replace(m,""),s=-1;++s0?90:-90)):(e.lat0=C(e.lat1>0?90:-90),e.lat_ts=e.lat1)}(i),i}function I(e){var t=this;if(2===arguments.length){var r=arguments[1];"string"==typeof r?"+"===r.charAt(0)?I[e]=A(arguments[1]):I[e]=T(arguments[1]):I[e]=r}else if(1===arguments.length){if(Array.isArray(e))return e.map((function(e){Array.isArray(e)?I.apply(t,e):I(e)}));if("string"==typeof e){if(e in I)return I[e]}else"EPSG"in e?I["EPSG:"+e.EPSG]=e:"ESRI"in e?I["ESRI:"+e.ESRI]=e:"IAU2000"in e?I["IAU2000:"+e.IAU2000]=e:console.log(e);return}}E.prototype.readCharicter=function(){var e=this.text[this.place++];if(4!==this.state)for(;v.test(e);){if(this.place>=this.text.length)return;e=this.text[this.place++]}switch(this.state){case y:return this.neutral(e);case 2:return this.keyword(e);case 4:return this.quoted(e);case 5:return this.afterquote(e);case 3:return this.number(e);case-1:return}},E.prototype.afterquote=function(e){if('"'===e)return this.word+='"',void(this.state=4);if(b.test(e))return this.word=this.word.trim(),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in afterquote yet, index '+this.place)},E.prototype.afterItem=function(e){return","===e?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=y)):"]"===e?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=y,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},E.prototype.number=function(e){if(!w.test(e)){if(b.test(e))return this.word=parseFloat(this.word),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in number yet, index '+this.place)}this.word+=e},E.prototype.quoted=function(e){'"'!==e?this.word+=e:this.state=5},E.prototype.keyword=function(e){if(_.test(e))this.word+=e;else{if("["===e){var t=[];return t.push(this.word),this.level++,null===this.root?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,void(this.state=y)}if(!b.test(e))throw new Error("havn't handled \""+e+'" in keyword yet, index '+this.place);this.afterItem(e)}},E.prototype.neutral=function(e){if(x.test(e))return this.word=e,void(this.state=2);if('"'===e)return this.word="",void(this.state=4);if(w.test(e))return this.word=e,void(this.state=3);if(!b.test(e))throw new Error("havn't handled \""+e+'" in neutral yet, index '+this.place);this.afterItem(e)},E.prototype.output=function(){for(;this.place90&&i*c<-90&&n*c>180&&n*c<-180)return null;if(Math.abs(Math.abs(i)-o)<=a)return null;if(this.sphere)t=this.x0+this.a*this.k0*N(n-this.long0),r=this.y0+this.a*this.k0*Math.log(Math.tan(u+.5*i));else{var s=Math.sin(i),l=U(this.e,i,s);t=this.x0+this.a*this.k0*N(n-this.long0),r=this.y0-this.a*this.k0*Math.log(l)}return e.x=t,e.y=r,e},inverse:function(e){var t,r,n=e.x-this.x0,i=e.y-this.y0;if(this.sphere)r=o-2*Math.atan(Math.exp(-i/(this.a*this.k0)));else{var s=Math.exp(-i/(this.a*this.k0));if(-9999===(r=F(this.e,s)))return null}return t=N(this.long0+n/(this.a*this.k0)),e.x=t,e.y=r,e},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:k,inverse:k,names:["longlat","identity"]}],G={},Q=[];function V(e,t){var r=Q.length;return e.names?(Q[r]=e,e.names.forEach((function(e){G[e.toLowerCase()]=r})),this):(console.log(t),!0)}const H={start:function(){z.forEach(V)},add:V,get:function(e){if(!e)return!1;var t=e.toLowerCase();return void 0!==G[t]&&Q[G[t]]?Q[G[t]]:void 0}};var j={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},q=j.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};j.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var W={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},militargeographische_institut:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}};var Y={};function X(e){if(0===e.length)return null;var t="@"===e[0];return t&&(e=e.slice(1)),"null"===e?{name:"null",mandatory:!t,grid:null,isNull:!0}:{name:e,mandatory:!t,grid:Y[e]||null,isNull:!1}}function K(e){return e/3600*Math.PI/180}function $(e,t,r){return String.fromCharCode.apply(null,new Uint8Array(e.buffer.slice(t,r)))}function J(e){return e.map((function(e){return[K(e.longitudeShift),K(e.latitudeShift)]}))}function Z(e,t,r){return{name:$(e,t+8,t+16).trim(),parent:$(e,t+24,t+24+8).trim(),lowerLatitude:e.getFloat64(t+72,r),upperLatitude:e.getFloat64(t+88,r),lowerLongitude:e.getFloat64(t+104,r),upperLongitude:e.getFloat64(t+120,r),latitudeInterval:e.getFloat64(t+136,r),longitudeInterval:e.getFloat64(t+152,r),gridNodeCount:e.getInt32(t+168,r)}}function ee(e,t,r,n){for(var i=t+176,s=[],o=0;o-1}))}(e)){var t=T(e);if(function(e){var t=g(e,"authority");if(t){var r=g(t,"epsg");return r&&P.indexOf(r)>-1}}(t))return R["EPSG:3857"];var r=function(e){var t=g(e,"extension");if(t)return g(t,"proj4")}(t);return r?A(r):t}return function(e){return"+"===e[0]}(e)?A(e):void 0}(e);if("object"==typeof r){var n=te.projections.get(r.projName);if(n){if(r.datumCode&&"none"!==r.datumCode){var i=g(W,r.datumCode);i&&(r.datum_params=r.datum_params||(i.towgs84?i.towgs84.split(","):null),r.ellps=i.ellipse,r.datumName=i.datumName?i.datumName:r.datumCode)}r.k0=r.k0||1,r.axis=r.axis||"enu",r.ellps=r.ellps||"wgs84",r.lat1=r.lat1||r.lat0;var o,l,c,u,h,d,p=function(e,t,r,n,i){if(!e){var s=g(j,n);s||(s=q),e=s.a,t=s.b,r=s.rf}return r&&!t&&(t=(1-1/r)*e),(0===r||Math.abs(e-t)3&&(0===l.datum_params[3]&&0===l.datum_params[4]&&0===l.datum_params[5]&&0===l.datum_params[6]||(l.datum_type=2,l.datum_params[3]*=s,l.datum_params[4]*=s,l.datum_params[5]*=s,l.datum_params[6]=l.datum_params[6]/1e6+1))),a&&(l.datum_type=3,l.grids=a),l.a=r,l.b=n,l.es=i,l.ep2=o,l}(r.datumCode,r.datum_params,p.a,p.b,f.es,f.ep2,m);L(this,r),L(this,n),this.a=p.a,this.b=p.b,this.rf=p.rf,this.sphere=p.sphere,this.es=f.es,this.e=f.e,this.ep2=f.ep2,this.datum=y,this.init(),t(null,this)}else t("Could not get projection name from: "+e)}else t("Could not parse to valid json: "+e)}te.projections=H,te.projections.start();const re=te;function ne(e,t,r){var n,i,s,a,l=e.x,c=e.y,u=e.z?e.z:0;if(c<-o&&c>-1.001*o)c=-o;else if(c>o&&c<1.001*o)c=o;else{if(c<-o)return{x:-1/0,y:-1/0,z:e.z};if(c>o)return{x:1/0,y:1/0,z:e.z}}return l>Math.PI&&(l-=2*Math.PI),i=Math.sin(c),a=Math.cos(c),s=i*i,{x:((n=r/Math.sqrt(1-t*s))+u)*a*Math.cos(l),y:(n+u)*a*Math.sin(l),z:(n*(1-t)+u)*i}}function ie(e,t,r,n){var i,s,o,a,l,c,u,h,d,p,f,m,g,A,y,v=e.x,x=e.y,_=e.z?e.z:0;if(i=Math.sqrt(v*v+x*x),s=Math.sqrt(v*v+x*x+_*_),i/r<1e-12){if(A=0,s/r<1e-12)return y=-n,{x:e.x,y:e.y,z:e.z}}else A=Math.atan2(x,v);o=_/s,h=(a=i/s)*(1-t)*(l=1/Math.sqrt(1-t*(2-t)*a*a)),d=o*l,g=0;do{g++,c=t*(u=r/Math.sqrt(1-t*d*d))/(u+(y=i*h+_*d-u*(1-t*d*d))),m=(f=o*(l=1/Math.sqrt(1-c*(2-c)*a*a)))*h-(p=a*(1-c)*l)*d,h=p,d=f}while(m*m>1e-24&&g<30);return{x:A,y:Math.atan(f/Math.abs(p)),z:y}}function se(e){return 1===e||2===e}function oe(e,t,r){if(null===e.grids||0===e.grids.length)return console.log("Grid shift grids not found"),-1;var n={x:-r.x,y:r.y},i={x:Number.NaN,y:Number.NaN},s=[];e:for(var o=0;on.y||f>n.x||A1e-12&&Math.abs(o.y)>1e-12);if(l<0)return console.log("Inverse grid shift iterator failed to converge."),n;n.x=N(s.x+r.ll[0]),n.y=s.y+r.ll[1]}else isNaN(s.x)||(n.x=e.x+s.x,n.y=e.y+s.y);return n}function le(e,t){var r,n={x:e.x/t.del[0],y:e.y/t.del[1]},i=Math.floor(n.x),s=Math.floor(n.y),o=n.x-1*i,a=n.y-1*s,l={x:Number.NaN,y:Number.NaN};if(i<0||i>=t.lim[0])return l;if(s<0||s>=t.lim[1])return l;r=s*t.lim[0]+i;var c=t.cvs[r][0],u=t.cvs[r][1];r++;var h=t.cvs[r][0],d=t.cvs[r][1];r+=t.lim[0];var p=t.cvs[r][0],f=t.cvs[r][1];r--;var m=t.cvs[r][0],g=t.cvs[r][1],A=o*a,y=o*(1-a),v=(1-o)*(1-a),x=(1-o)*a;return l.x=v*c+y*h+x*m+A*p,l.y=v*u+y*d+x*g+A*f,l}function ce(e,t,r){var n,i,s,o=r.x,a=r.y,l=r.z||0,c={};for(s=0;s<3;s++)if(!t||2!==s||void 0!==r.z)switch(0===s?(n=o,i=-1!=="ew".indexOf(e.axis[s])?"x":"y"):1===s?(n=a,i=-1!=="ns".indexOf(e.axis[s])?"y":"x"):(n=l,i="z"),e.axis[s]){case"e":case"n":c[i]=n;break;case"w":case"s":c[i]=-n;break;case"u":void 0!==r[i]&&(c.z=n);break;case"d":void 0!==r[i]&&(c.z=-n);break;default:return null}return c}function ue(e){var t={x:e[0],y:e[1]};return e.length>2&&(t.z=e[2]),e.length>3&&(t.m=e[3]),t}function he(e){if("function"==typeof Number.isFinite){if(Number.isFinite(e))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof e||e!=e||!isFinite(e))throw new TypeError("coordinates must be finite numbers")}function de(e,t,r,s){var o,a=void 0!==(r=Array.isArray(r)?ue(r):{x:r.x,y:r.y,z:r.z,m:r.m}).z;if(function(e){he(e.x),he(e.y)}(r),e.datum&&t.datum&&function(e,t){return(1===e.datum.datum_type||2===e.datum.datum_type||3===e.datum.datum_type)&&"WGS84"!==t.datumCode||(1===t.datum.datum_type||2===t.datum.datum_type||3===t.datum.datum_type)&&"WGS84"!==e.datumCode}(e,t)&&(r=de(e,o=new re("WGS84"),r,s),e=o),s&&"enu"!==e.axis&&(r=ce(e,!1,r)),"longlat"===e.projName)r={x:r.x*l,y:r.y*l,z:r.z||0};else if(e.to_meter&&(r={x:r.x*e.to_meter,y:r.y*e.to_meter,z:r.z||0}),!(r=e.inverse(r)))return;if(e.from_greenwich&&(r.x+=e.from_greenwich),r=function(e,t,r){if(function(e,t){return e.datum_type===t.datum_type&&!(e.a!==t.a||Math.abs(e.es-t.es)>5e-11)&&(1===e.datum_type?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]:2!==e.datum_type||e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]&&e.datum_params[3]===t.datum_params[3]&&e.datum_params[4]===t.datum_params[4]&&e.datum_params[5]===t.datum_params[5]&&e.datum_params[6]===t.datum_params[6])}(e,t))return r;if(5===e.datum_type||5===t.datum_type)return r;var s=e.a,o=e.es;if(3===e.datum_type){if(0!==oe(e,!1,r))return;s=n,o=i}var a=t.a,l=t.b,c=t.es;return 3===t.datum_type&&(a=n,l=6356752.314,c=i),o!==c||s!==a||se(e.datum_type)||se(t.datum_type)?(r=ne(r,o,s),se(e.datum_type)&&(r=function(e,t,r){if(1===t)return{x:e.x+r[0],y:e.y+r[1],z:e.z+r[2]};if(2===t){var n=r[0],i=r[1],s=r[2],o=r[3],a=r[4],l=r[5],c=r[6];return{x:c*(e.x-l*e.y+a*e.z)+n,y:c*(l*e.x+e.y-o*e.z)+i,z:c*(-a*e.x+o*e.y+e.z)+s}}}(r,e.datum_type,e.datum_params)),se(t.datum_type)&&(r=function(e,t,r){if(1===t)return{x:e.x-r[0],y:e.y-r[1],z:e.z-r[2]};if(2===t){var n=r[0],i=r[1],s=r[2],o=r[3],a=r[4],l=r[5],c=r[6],u=(e.x-n)/c,h=(e.y-i)/c,d=(e.z-s)/c;return{x:u+l*h-a*d,y:-l*u+h+o*d,z:a*u-o*h+d}}}(r,t.datum_type,t.datum_params)),r=ie(r,c,a,l),3!==t.datum_type||0===oe(t,!0,r)?r:void 0):r}(e.datum,t.datum,r))return t.from_greenwich&&(r={x:r.x-t.from_greenwich,y:r.y,z:r.z||0}),"longlat"===t.projName?r={x:r.x*c,y:r.y*c,z:r.z||0}:(r=t.forward(r),t.to_meter&&(r={x:r.x/t.to_meter,y:r.y/t.to_meter,z:r.z||0})),s&&"enu"!==t.axis?ce(t,!0,r):(r&&!a&&delete r.z,r)}var pe=re("WGS84");function fe(e,t,r,n){var i,s,o;return Array.isArray(r)?(i=de(e,t,r,n)||{x:NaN,y:NaN},r.length>2?void 0!==e.name&&"geocent"===e.name||void 0!==t.name&&"geocent"===t.name?"number"==typeof i.z?[i.x,i.y,i.z].concat(r.slice(3)):[i.x,i.y,r[2]].concat(r.slice(3)):[i.x,i.y].concat(r.slice(2)):[i.x,i.y]):(s=de(e,t,r,n),2===(o=Object.keys(r)).length||o.forEach((function(n){if(void 0!==e.name&&"geocent"===e.name||void 0!==t.name&&"geocent"===t.name){if("x"===n||"y"===n||"z"===n)return}else if("x"===n||"y"===n)return;s[n]=r[n]})),s)}function me(e){return e instanceof re?e:e.oProj?e.oProj:re(e)}const ge=function(e,t,r){e=me(e);var n,i=!1;return void 0===t?(t=e,e=pe,i=!0):(void 0!==t.x||Array.isArray(t))&&(r=t,t=e,e=pe,i=!0),t=me(t),r?fe(e,t,r):(n={forward:function(r,n){return fe(e,t,r,n)},inverse:function(r,n){return fe(t,e,r,n)}},i&&(n.oProj=t),n)};var Ae="AJSAJS",ye="AFAFAF",ve=65,xe=73,_e=79;const be={forward:we,inverse:function(e){var t=Ce(Ie(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat,t.lon,t.lat]:[t.left,t.bottom,t.right,t.top]},toPoint:Ee};function we(e,t){return t=t||5,function(e,t){var r,n,i,s,o,a,l,c,u,h,d,p="00000"+e.easting,f="00000"+e.northing;return e.zoneNumber+e.zoneLetter+(u=e.easting,h=e.northing,d=Te(e.zoneNumber),r=Math.floor(u/1e5),n=Math.floor(h/1e5)%20,s=Ae.charCodeAt(i=d-1),o=ye.charCodeAt(i),c=!1,(a=s+r-1)>90&&(a=a-90+ve-1,c=!0),(a===xe||sxe||(a>xe||s_e||(a>_e||s<_e)&&c)&&++a===xe&&a++,a>90&&(a=a-90+ve-1),(l=o+n)>86?(l=l-86+ve-1,c=!0):c=!1,(l===xe||oxe||(l>xe||o_e||(l>_e||o<_e)&&c)&&++l===xe&&l++,l>86&&(l=l-86+ve-1),String.fromCharCode(a)+String.fromCharCode(l))+p.substr(p.length-5,t)+f.substr(f.length-5,t)}(function(e){var t,r,n,i,s,o,a,l=e.lat,c=e.lon,u=6378137,h=.00669438,d=.9996,p=Me(l),f=Me(c);a=Math.floor((c+180)/6)+1,180===c&&(a=60),l>=56&&l<64&&c>=3&&c<12&&(a=32),l>=72&&l<84&&(c>=0&&c<9?a=31:c>=9&&c<21?a=33:c>=21&&c<33?a=35:c>=33&&c<42&&(a=37)),o=Me(6*(a-1)-180+3),t=.006739496752268451,r=u/Math.sqrt(1-h*Math.sin(p)*Math.sin(p)),n=Math.tan(p)*Math.tan(p),i=t*Math.cos(p)*Math.cos(p);var m,g,A=d*r*((s=Math.cos(p)*(f-o))+(1-n+i)*s*s*s/6+(5-18*n+n*n+72*i-58*t)*s*s*s*s*s/120)+5e5,y=d*(u*(.9983242984503243*p-.002514607064228144*Math.sin(2*p)+2639046602129982e-21*Math.sin(4*p)-3.418046101696858e-9*Math.sin(6*p))+r*Math.tan(p)*(s*s/2+(5-n+9*i+4*i*i)*s*s*s*s/24+(61-58*n+n*n+600*i-2.2240339282485886)*s*s*s*s*s*s/720));return l<0&&(y+=1e7),{northing:Math.round(y),easting:Math.round(A),zoneNumber:a,zoneLetter:(m=l,g="Z",84>=m&&m>=72?g="X":72>m&&m>=64?g="W":64>m&&m>=56?g="V":56>m&&m>=48?g="U":48>m&&m>=40?g="T":40>m&&m>=32?g="S":32>m&&m>=24?g="R":24>m&&m>=16?g="Q":16>m&&m>=8?g="P":8>m&&m>=0?g="N":0>m&&m>=-8?g="M":-8>m&&m>=-16?g="L":-16>m&&m>=-24?g="K":-24>m&&m>=-32?g="J":-32>m&&m>=-40?g="H":-40>m&&m>=-48?g="G":-48>m&&m>=-56?g="F":-56>m&&m>=-64?g="E":-64>m&&m>=-72?g="D":-72>m&&m>=-80&&(g="C"),g)}}({lat:e[1],lon:e[0]}),t)}function Ee(e){var t=Ce(Ie(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function Me(e){return e*(Math.PI/180)}function Se(e){return e/Math.PI*180}function Ce(e){var t=e.northing,r=e.easting,n=e.zoneLetter,i=e.zoneNumber;if(i<0||i>60)return null;var s,o,a,l,c,u,h,d,p,f=.9996,m=6378137,g=.00669438,A=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),y=r-5e5,v=t;n<"N"&&(v-=1e7),h=6*(i-1)-180+3,s=.006739496752268451,p=(d=v/f/6367449.145945056)+(3*A/2-27*A*A*A/32)*Math.sin(2*d)+(21*A*A/16-55*A*A*A*A/32)*Math.sin(4*d)+151*A*A*A/96*Math.sin(6*d),o=m/Math.sqrt(1-g*Math.sin(p)*Math.sin(p)),a=Math.tan(p)*Math.tan(p),l=s*Math.cos(p)*Math.cos(p),c=.99330562*m/Math.pow(1-g*Math.sin(p)*Math.sin(p),1.5),u=y/(o*f);var x=p-o*Math.tan(p)/c*(u*u/2-(5+3*a+10*l-4*l*l-9*s)*u*u*u*u/24+(61+90*a+298*l+45*a*a-1.6983531815716497-3*l*l)*u*u*u*u*u*u/720);x=Se(x);var _,b=(u-(1+2*a+l)*u*u*u/6+(5-2*l+28*a-3*l*l+8*s+24*a*a)*u*u*u*u*u/120)/Math.cos(p);if(b=h+Se(b),e.accuracy){var w=Ce({northing:e.northing+e.accuracy,easting:e.easting+e.accuracy,zoneLetter:e.zoneLetter,zoneNumber:e.zoneNumber});_={top:w.lat,right:w.lon,bottom:x,left:b}}else _={lat:x,lon:b};return _}function Te(e){var t=e%6;return 0===t&&(t=6),t}function Ie(e){if(e&&0===e.length)throw"MGRSPoint coverting from nothing";for(var t,r=e.length,n=null,i="",s=0;!/[A-Z]/.test(t=e.charAt(s));){if(s>=2)throw"MGRSPoint bad conversion from: "+e;i+=t,s++}var o=parseInt(i,10);if(0===s||s+3>r)throw"MGRSPoint bad conversion from: "+e;var a=e.charAt(s++);if(a<="A"||"B"===a||"Y"===a||a>="Z"||"I"===a||"O"===a)throw"MGRSPoint zone letter "+a+" not handled: "+e;n=e.substring(s,s+=2);for(var l=Te(o),c=function(e,t){for(var r=Ae.charCodeAt(t-1),n=1e5,i=!1;r!==e.charCodeAt(0);){if(++r===xe&&r++,r===_e&&r++,r>90){if(i)throw"Bad character: "+e;r=ve,i=!0}n+=1e5}return n}(n.charAt(0),l),u=function(e,t){if(e>"V")throw"MGRSPoint given invalid Northing "+e;for(var r=ye.charCodeAt(t-1),n=0,i=!1;r!==e.charCodeAt(0);){if(++r===xe&&r++,r===_e&&r++,r>86){if(i)throw"Bad character: "+e;r=ve,i=!0}n+=1e5}return n}(n.charAt(1),l);u0&&(d=1e5/Math.pow(10,m),p=e.substring(s,s+m),g=parseFloat(p)*d,f=e.substring(s+m),A=parseFloat(f)*d),{easting:g+c,northing:A+u,zoneLetter:a,zoneNumber:o,accuracy:d}}function Re(e){var t;switch(e){case"C":t=11e5;break;case"D":t=2e6;break;case"E":t=28e5;break;case"F":t=37e5;break;case"G":t=46e5;break;case"H":t=55e5;break;case"J":t=64e5;break;case"K":t=73e5;break;case"L":t=82e5;break;case"M":t=91e5;break;case"N":t=0;break;case"P":t=8e5;break;case"Q":t=17e5;break;case"R":t=26e5;break;case"S":t=35e5;break;case"T":t=44e5;break;case"U":t=53e5;break;case"V":t=62e5;break;case"W":t=7e6;break;case"X":t=79e5;break;default:t=-1}if(t>=0)return t;throw"Invalid zone letter: "+e}function Be(e,t,r){if(!(this instanceof Be))return new Be(e,t,r);if(Array.isArray(e))this.x=e[0],this.y=e[1],this.z=e[2]||0;else if("object"==typeof e)this.x=e.x,this.y=e.y,this.z=e.z||0;else if("string"==typeof e&&void 0===t){var n=e.split(",");this.x=parseFloat(n[0],10),this.y=parseFloat(n[1],10),this.z=parseFloat(n[2],10)||0}else this.x=e,this.y=t,this.z=r||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Be.fromMGRS=function(e){return new Be(Ee(e))},Be.prototype.toMGRS=function(e){return we([this.x,this.y],e)};const Pe=Be;var Le=.046875,De=.01953125,Oe=.01068115234375;function Ne(e){var t=[];t[0]=1-e*(.25+e*(Le+e*(De+e*Oe))),t[1]=e*(.75-e*(Le+e*(De+e*Oe)));var r=e*e;return t[2]=r*(.46875-e*(.013020833333333334+.007120768229166667*e)),r*=e,t[3]=r*(.3645833333333333-.005696614583333333*e),t[4]=r*e*.3076171875,t}function Ue(e,t,r,n){return r*=t,t*=t,n[0]*e-r*(n[1]+t*(n[2]+t*(n[3]+t*n[4])))}function Fe(e,t,r){for(var n=1/(1-t),i=e,s=20;s;--s){var o=Math.sin(i),l=1-t*o*o;if(i-=l=(Ue(i,o,Math.cos(i),r)-e)*(l*Math.sqrt(l))*n,Math.abs(l)a?Math.tan(s):0,m=Math.pow(f,2),g=Math.pow(m,2);t=1-this.es*Math.pow(l,2),u/=Math.sqrt(t);var A=Ue(s,l,c,this.en);r=this.a*(this.k0*u*(1+h/6*(1-m+d+h/20*(5-18*m+g+14*d-58*m*d+h/42*(61+179*g-g*m-479*m)))))+this.x0,n=this.a*(this.k0*(A-this.ml0+l*o*u/2*(1+h/12*(5-m+9*d+4*p+h/30*(61+g-58*m+270*d-330*m*d+h/56*(1385+543*g-g*m-3111*m))))))+this.y0}else{var y=c*Math.sin(o);if(Math.abs(Math.abs(y)-1)=1){if(y-1>a)return 93;n=0}else n=Math.acos(n);s<0&&(n=-n),n=this.a*this.k0*(n-this.lat0)+this.y0}return e.x=r,e.y=n,e},inverse:function(e){var t,r,n,i,s=(e.x-this.x0)*(1/this.a),l=(e.y-this.y0)*(1/this.a);if(this.es)if(r=Fe(t=this.ml0+l/this.k0,this.es,this.en),Math.abs(r)a?Math.tan(r):0,d=this.ep2*Math.pow(u,2),p=Math.pow(d,2),f=Math.pow(h,2),m=Math.pow(f,2);t=1-this.es*Math.pow(c,2);var g=s*Math.sqrt(t)/this.k0,A=Math.pow(g,2);n=r-(t*=h)*A/(1-this.es)*.5*(1-A/12*(5+3*f-9*d*f+d-4*p-A/30*(61+90*f-252*d*f+45*m+46*d-A/56*(1385+3633*f+4095*m+1574*m*f)))),i=N(this.long0+g*(1-A/6*(1+2*f+d-A/20*(5+28*f+24*m+8*d*f+6*d-A/42*(61+662*f+1320*m+720*m*f))))/u)}else n=o*O(l),i=0;else{var y=Math.exp(s/this.k0),v=.5*(y-1/y),x=this.lat0+l/this.k0,_=Math.cos(x);t=Math.sqrt((1-Math.pow(_,2))/(1+Math.pow(v,2))),n=Math.asin(t),l<0&&(n=-n),i=0===v&&0===_?0:N(Math.atan2(v,_)+this.long0)}return e.x=i,e.y=n,e},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]};function ze(e){var t=Math.exp(e);return(t-1/t)/2}function Ge(e,t){e=Math.abs(e),t=Math.abs(t);var r=Math.max(e,t),n=Math.min(e,t)/(r||1);return r*Math.sqrt(1+Math.pow(n,2))}function Qe(e,t){for(var r,n=2*Math.cos(2*t),i=e.length-1,s=e[i],o=0;--i>=0;)r=n*s-o+e[i],o=s,s=r;return t+r*Math.sin(2*t)}function Ve(e,t,r){for(var n,i,s=Math.sin(t),o=Math.cos(t),a=ze(r),l=function(e){var t=Math.exp(e);return(t+1/t)/2}(r),c=2*o*l,u=-2*s*a,h=e.length-1,d=e[h],p=0,f=0,m=0;--h>=0;)n=f,i=p,d=c*(f=d)-n-u*(p=m)+e[h],m=u*f-i+c*p;return[(c=s*l)*d-(u=o*a)*m,c*m+u*d]}const He={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(ke.init.apply(this),this.forward=ke.forward,this.inverse=ke.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var e=this.es/(1+Math.sqrt(1-this.es)),t=e/(2-e),r=t;this.cgb[0]=t*(2+t*(-2/3+t*(t*(116/45+t*(26/45+t*(-2854/675)))-2))),this.cbg[0]=t*(t*(2/3+t*(4/3+t*(-82/45+t*(32/45+t*(4642/4725)))))-2),r*=t,this.cgb[1]=r*(7/3+t*(t*(-227/45+t*(2704/315+t*(2323/945)))-1.6)),this.cbg[1]=r*(5/3+t*(-16/15+t*(-13/9+t*(904/315+t*(-1522/945))))),r*=t,this.cgb[2]=r*(56/15+t*(-136/35+t*(-1262/105+t*(73814/2835)))),this.cbg[2]=r*(-26/15+t*(34/21+t*(1.6+t*(-12686/2835)))),r*=t,this.cgb[3]=r*(4279/630+t*(-332/35+t*(-399572/14175))),this.cbg[3]=r*(1237/630+t*(t*(-24832/14175)-2.4)),r*=t,this.cgb[4]=r*(4174/315+t*(-144838/6237)),this.cbg[4]=r*(-734/315+t*(109598/31185)),r*=t,this.cgb[5]=r*(601676/22275),this.cbg[5]=r*(444337/155925),r=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+r*(1/4+r*(1/64+r/256))),this.utg[0]=t*(t*(2/3+t*(-37/96+t*(1/360+t*(81/512+t*(-96199/604800)))))-.5),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+t*(7891/37800)))))),this.utg[1]=r*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+t*(1118711/3870720))))),this.gtu[1]=r*(13/48+t*(t*(557/1440+t*(281/630+t*(-1983433/1935360)))-.6)),r*=t,this.utg[2]=r*(-17/480+t*(37/840+t*(209/4480+t*(-5569/90720)))),this.gtu[2]=r*(61/240+t*(-103/140+t*(15061/26880+t*(167603/181440)))),r*=t,this.utg[3]=r*(-4397/161280+t*(11/504+t*(830251/7257600))),this.gtu[3]=r*(49561/161280+t*(-179/168+t*(6601661/7257600))),r*=t,this.utg[4]=r*(-4583/161280+t*(108847/3991680)),this.gtu[4]=r*(34729/80640+t*(-3418889/1995840)),r*=t,this.utg[5]=r*(-20648693/638668800),this.gtu[5]=.6650675310896665*r;var n=Qe(this.cbg,this.lat0);this.Zb=-this.Qn*(n+function(e,t){for(var r,n=2*Math.cos(t),i=e.length-1,s=e[i],o=0;--i>=0;)r=n*s-o+e[i],o=s,s=r;return Math.sin(t)*r}(this.gtu,2*n))},forward:function(e){var t=N(e.x-this.long0),r=e.y;r=Qe(this.cbg,r);var n=Math.sin(r),i=Math.cos(r),s=Math.sin(t),o=Math.cos(t);r=Math.atan2(n,o*i),t=Math.atan2(s*i,Ge(n,i*o)),t=function(e){var t=Math.abs(e);return t=function(e){var t=1+e,r=t-1;return 0===r?e:e*Math.log(t)/r}(t*(1+t/(Ge(1,t)+1))),e<0?-t:t}(Math.tan(t));var a,l,c=Ve(this.gtu,2*r,2*t);return r+=c[0],t+=c[1],Math.abs(t)<=2.623395162778?(a=this.a*(this.Qn*t)+this.x0,l=this.a*(this.Qn*r+this.Zb)+this.y0):(a=1/0,l=1/0),e.x=a,e.y=l,e},inverse:function(e){var t,r,n=(e.x-this.x0)*(1/this.a),i=(e.y-this.y0)*(1/this.a);if(i=(i-this.Zb)/this.Qn,n/=this.Qn,Math.abs(n)<=2.623395162778){var s=Ve(this.utg,2*i,2*n);i+=s[0],n+=s[1],n=Math.atan(ze(n));var o=Math.sin(i),a=Math.cos(i),l=Math.sin(n),c=Math.cos(n);i=Math.atan2(o*c,Ge(l,c*a)),t=N((n=Math.atan2(l,c*a))+this.long0),r=Qe(this.cgb,i)}else t=1/0,r=1/0;return e.x=t,e.y=r,e},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"]},je={init:function(){var e=function(e,t){if(void 0===e){if((e=Math.floor(30*(N(t)+Math.PI)/Math.PI)+1)<0)return 0;if(e>60)return 60}return e}(this.zone,this.long0);if(void 0===e)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(e)-183)*l,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,He.init.apply(this),this.forward=He.forward,this.inverse=He.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function qe(e,t){return Math.pow((1-e)/(1+e),t)}const We={init:function(){var e=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*e*e),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(e/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+u)/(Math.pow(Math.tan(.5*this.lat0+u),this.C)*qe(this.e*e,this.ratexp))},forward:function(e){var t=e.x,r=e.y;return e.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*r+u),this.C)*qe(this.e*Math.sin(r),this.ratexp))-o,e.x=this.C*t,e},inverse:function(e){for(var t=e.x/this.C,r=e.y,n=Math.pow(Math.tan(.5*r+u)/this.K,1/this.C),i=20;i>0&&(r=2*Math.atan(n*qe(this.e*Math.sin(e.y),-.5*this.e))-o,!(Math.abs(r-e.y)<1e-14));--i)e.y=r;return i?(e.x=t,e.y=r,e):null},names:["gauss"]},Ye={init:function(){We.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(e){var t,r,n,i;return e.x=N(e.x-this.long0),We.forward.apply(this,[e]),t=Math.sin(e.y),r=Math.cos(e.y),n=Math.cos(e.x),i=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*r*n),e.x=i*r*Math.sin(e.x),e.y=i*(this.cosc0*t-this.sinc0*r*n),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e},inverse:function(e){var t,r,n,i,s;if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,s=Ge(e.x,e.y)){var o=2*Math.atan2(s,this.R2);t=Math.sin(o),r=Math.cos(o),i=Math.asin(r*this.sinc0+e.y*t*this.cosc0/s),n=Math.atan2(e.x*t,s*this.cosc0*r-e.y*this.sinc0*t)}else i=this.phic0,n=0;return e.x=n,e.y=i,We.inverse.apply(this,[e]),e.x=N(e.x+this.long0),e},names:["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]},Xe={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=a&&(this.k0=.5*(1+O(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=a&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=a&&Math.abs(Math.cos(this.lat_ts))>a&&(this.k0=.5*this.cons*D(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/U(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=D(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-o,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(e){var t,r,n,i,s,l,c=e.x,u=e.y,h=Math.sin(u),d=Math.cos(u),p=N(c-this.long0);return Math.abs(Math.abs(c-this.long0)-Math.PI)<=a&&Math.abs(u+this.lat0)<=a?(e.x=NaN,e.y=NaN,e):this.sphere?(t=2*this.k0/(1+this.sinlat0*h+this.coslat0*d*Math.cos(p)),e.x=this.a*t*d*Math.sin(p)+this.x0,e.y=this.a*t*(this.coslat0*h-this.sinlat0*d*Math.cos(p))+this.y0,e):(r=2*Math.atan(this.ssfn_(u,h,this.e))-o,i=Math.cos(r),n=Math.sin(r),Math.abs(this.coslat0)<=a?(s=U(this.e,u*this.con,this.con*h),l=2*this.a*this.k0*s/this.cons,e.x=this.x0+l*Math.sin(c-this.long0),e.y=this.y0-this.con*l*Math.cos(c-this.long0),e):(Math.abs(this.sinlat0)0?N(this.long0+Math.atan2(e.x,-1*e.y)):N(this.long0+Math.atan2(e.x,e.y)):N(this.long0+Math.atan2(e.x*Math.sin(c),l*this.coslat0*Math.cos(c)-e.y*this.sinlat0*Math.sin(c))),e.x=t,e.y=r,e)}if(Math.abs(this.coslat0)<=a){if(l<=a)return r=this.lat0,t=this.long0,e.x=t,e.y=r,e;e.x*=this.con,e.y*=this.con,n=l*this.cons/(2*this.a*this.k0),r=this.con*F(this.e,n),t=this.con*N(this.con*this.long0+Math.atan2(e.x,-1*e.y))}else i=2*Math.atan(l*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,l<=a?s=this.X0:(s=Math.asin(Math.cos(i)*this.sinX0+e.y*Math.sin(i)*this.cosX0/l),t=N(this.long0+Math.atan2(e.x*Math.sin(i),l*this.cosX0*Math.cos(i)-e.y*this.sinX0*Math.sin(i)))),r=-1*F(this.e,Math.tan(.5*(o+s)));return e.x=t,e.y=r,e},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"],ssfn_:function(e,t,r){return t*=r,Math.tan(.5*(o+e))*Math.pow((1-t)/(1+t),.5*r)}},Ke={init:function(){var e=this.lat0;this.lambda0=this.long0;var t=Math.sin(e),r=this.a,n=1/this.rf,i=2*n-Math.pow(n,2),s=this.e=Math.sqrt(i);this.R=this.k0*r*Math.sqrt(1-i)/(1-i*Math.pow(t,2)),this.alpha=Math.sqrt(1+i/(1-i)*Math.pow(Math.cos(e),4)),this.b0=Math.asin(t/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),a=Math.log(Math.tan(Math.PI/4+e/2)),l=Math.log((1+s*t)/(1-s*t));this.K=o-this.alpha*a+this.alpha*s/2*l},forward:function(e){var t=Math.log(Math.tan(Math.PI/4-e.y/2)),r=this.e/2*Math.log((1+this.e*Math.sin(e.y))/(1-this.e*Math.sin(e.y))),n=-this.alpha*(t+r)+this.K,i=2*(Math.atan(Math.exp(n))-Math.PI/4),s=this.alpha*(e.x-this.lambda0),o=Math.atan(Math.sin(s)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(s))),a=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(s));return e.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0,e.x=this.R*o+this.x0,e},inverse:function(e){for(var t=e.x-this.x0,r=e.y-this.y0,n=t/this.R,i=2*(Math.atan(Math.exp(r/this.R))-Math.PI/4),s=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(n)),o=Math.atan(Math.sin(n)/(Math.cos(this.b0)*Math.cos(n)-Math.sin(this.b0)*Math.tan(i))),a=this.lambda0+o/this.alpha,l=0,c=s,u=-1e3,h=0;Math.abs(c-u)>1e-7;){if(++h>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+s/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(c))/2)),u=c,c=2*Math.atan(Math.exp(l))-Math.PI/2}return e.x=a,e.y=c,e},names:["somerc"]};var $e=1e-7;const Je={init:function(){var e,t,r,n,i,s,c,d,p,f,m,g,A,y=0,v=0,x=0,_=0,b=0,w=0,E=0;this.no_off=(A="object"==typeof(g=this).PROJECTION?Object.keys(g.PROJECTION)[0]:g.PROJECTION,"no_uoff"in g||"no_off"in g||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(A)),this.no_rot="no_rot"in this;var M=!1;"alpha"in this&&(M=!0);var S=!1;if("rectified_grid_angle"in this&&(S=!0),M&&(E=this.alpha),S&&(y=this.rectified_grid_angle*l),M||S)v=this.longc;else if(x=this.long1,b=this.lat1,_=this.long2,w=this.lat2,Math.abs(b-w)<=$e||(e=Math.abs(b))<=$e||Math.abs(e-o)<=$e||Math.abs(Math.abs(this.lat0)-o)<=$e||Math.abs(Math.abs(w)-o)<=$e)throw new Error;var C=1-this.es;t=Math.sqrt(C),Math.abs(this.lat0)>a?(d=Math.sin(this.lat0),r=Math.cos(this.lat0),e=1-this.es*d*d,this.B=r*r,this.B=Math.sqrt(1+this.es*this.B*this.B/C),this.A=this.B*this.k0*t/e,(i=(n=this.B*t/(r*Math.sqrt(e)))*n-1)<=0?i=0:(i=Math.sqrt(i),this.lat0<0&&(i=-i)),this.E=i+=n,this.E*=Math.pow(U(this.e,this.lat0,d),this.B)):(this.B=1/t,this.A=this.k0,this.E=n=i=1),M||S?(M?(m=Math.asin(Math.sin(E)/n),S||(y=E)):(m=y,E=Math.asin(n*Math.sin(m))),this.lam0=v-Math.asin(.5*(i-1/i)*Math.tan(m))/this.B):(s=Math.pow(U(this.e,b,Math.sin(b)),this.B),c=Math.pow(U(this.e,w,Math.sin(w)),this.B),i=this.E/s,p=(c-s)/(c+s),f=((f=this.E*this.E)-c*s)/(f+c*s),(e=x-_)<-Math.pi?_-=h:e>Math.pi&&(_+=h),this.lam0=N(.5*(x+_)-Math.atan(f*Math.tan(.5*this.B*(x-_))/p)/this.B),m=Math.atan(2*Math.sin(this.B*N(x-this.lam0))/(i-1/i)),y=E=Math.asin(n*Math.sin(m))),this.singam=Math.sin(m),this.cosgam=Math.cos(m),this.sinrot=Math.sin(y),this.cosrot=Math.cos(y),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A,this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(n*n-1)/Math.cos(E))),this.lat0<0&&(this.u_0=-this.u_0)),i=.5*m,this.v_pole_n=this.ArB*Math.log(Math.tan(u-i)),this.v_pole_s=this.ArB*Math.log(Math.tan(u+i))},forward:function(e){var t,r,n,i,s,l,c,u,h={};if(e.x=e.x-this.lam0,Math.abs(Math.abs(e.y)-o)>a){if(t=.5*((s=this.E/Math.pow(U(this.e,e.y,Math.sin(e.y)),this.B))-(l=1/s)),r=.5*(s+l),i=Math.sin(this.B*e.x),n=(t*this.singam-i*this.cosgam)/r,Math.abs(Math.abs(n)-1)0?this.v_pole_n:this.v_pole_s,c=this.ArB*e.y;return this.no_rot?(h.x=c,h.y=u):(c-=this.u_0,h.x=u*this.cosrot+c*this.sinrot,h.y=c*this.cosrot-u*this.sinrot),h.x=this.a*h.x+this.x0,h.y=this.a*h.y+this.y0,h},inverse:function(e){var t,r,n,i,s,l,c,u={};if(e.x=(e.x-this.x0)*(1/this.a),e.y=(e.y-this.y0)*(1/this.a),this.no_rot?(r=e.y,t=e.x):(r=e.x*this.cosrot-e.y*this.sinrot,t=e.y*this.cosrot+e.x*this.sinrot+this.u_0),i=.5*((n=Math.exp(-this.BrA*r))-1/n),s=.5*(n+1/n),c=((l=Math.sin(this.BrA*t))*this.cosgam+i*this.singam)/s,Math.abs(Math.abs(c)-1)a?this.ns=Math.log(n/l)/Math.log(i/c):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=n/(this.ns*Math.pow(i,this.ns)),this.rh=this.a*this.f0*Math.pow(u,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(e){var t=e.x,r=e.y;Math.abs(2*Math.abs(r)-Math.PI)<=a&&(r=O(r)*(o-2e-10));var n,i,s=Math.abs(Math.abs(r)-o);if(s>a)n=U(this.e,r,Math.sin(r)),i=this.a*this.f0*Math.pow(n,this.ns);else{if((s=r*this.ns)<=0)return null;i=0}var l=this.ns*N(t-this.long0);return e.x=this.k0*(i*Math.sin(l))+this.x0,e.y=this.k0*(this.rh-i*Math.cos(l))+this.y0,e},inverse:function(e){var t,r,n,i,s,a=(e.x-this.x0)/this.k0,l=this.rh-(e.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(a*a+l*l),r=1):(t=-Math.sqrt(a*a+l*l),r=-1);var c=0;if(0!==t&&(c=Math.atan2(r*a,r*l)),0!==t||this.ns>0){if(r=1/this.ns,n=Math.pow(t/(this.a*this.f0),r),-9999===(i=F(this.e,n)))return null}else i=-o;return s=N(c/this.ns+this.long0),e.x=s,e.y=i,e},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]},et={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(e){var t,r,n,i,s,o,a,l=e.x,c=e.y,u=N(l-this.long0);return t=Math.pow((1+this.e*Math.sin(c))/(1-this.e*Math.sin(c)),this.alfa*this.e/2),r=2*(Math.atan(this.k*Math.pow(Math.tan(c/2+this.s45),this.alfa)/t)-this.s45),n=-u*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(r)+Math.sin(this.ad)*Math.cos(r)*Math.cos(n)),s=Math.asin(Math.cos(r)*Math.sin(n)/Math.cos(i)),o=this.n*s,a=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(i/2+this.s45),this.n),e.y=a*Math.cos(o)/1,e.x=a*Math.sin(o)/1,this.czech||(e.y*=-1,e.x*=-1),e},inverse:function(e){var t,r,n,i,s,o,a,l=e.x;e.x=e.y,e.y=l,this.czech||(e.y*=-1,e.x*=-1),s=Math.sqrt(e.x*e.x+e.y*e.y),i=Math.atan2(e.y,e.x)/Math.sin(this.s0),n=2*(Math.atan(Math.pow(this.ro0/s,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(n)-Math.sin(this.ad)*Math.cos(n)*Math.cos(i)),r=Math.asin(Math.cos(n)*Math.sin(i)/Math.cos(t)),e.x=this.long0-r/this.alfa,o=t,a=0;var c=0;do{e.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(t/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-e.y)<1e-10&&(a=1),o=e.y,c+=1}while(0===a&&c<15);return c>=15?null:e},names:["Krovak","krovak"]};function tt(e,t,r,n,i){return e*i-t*Math.sin(2*i)+r*Math.sin(4*i)-n*Math.sin(6*i)}function rt(e){return 1-.25*e*(1+e/16*(3+1.25*e))}function nt(e){return.375*e*(1+.25*e*(1+.46875*e))}function it(e){return.05859375*e*e*(1+.75*e)}function st(e){return e*e*e*(35/3072)}function ot(e,t,r){var n=t*r;return e/Math.sqrt(1-n*n)}function at(e){return Math.abs(e)1e-7?(1-e*e)*(t/(1-(r=e*t)*r)-.5/e*Math.log((1-r)/(1+r))):2*t}const ht={init:function(){var e,t=Math.abs(this.lat0);if(Math.abs(t-o)0)switch(this.qp=ut(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(e){var t,r=[];return r[0]=.3333333333333333*e,t=e*e,r[0]+=.17222222222222222*t,r[1]=.06388888888888888*t,t*=e,r[0]+=.10257936507936508*t,r[1]+=.0664021164021164*t,r[2]=.016415012942191543*t,r}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=ut(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(e){var t,r,n,i,s,l,c,h,d,p,f=e.x,m=e.y;if(f=N(f-this.long0),this.sphere){if(s=Math.sin(m),p=Math.cos(m),n=Math.cos(f),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((r=this.mode===this.EQUIT?1+p*n:1+this.sinph0*s+this.cosph0*p*n)<=a)return null;t=(r=Math.sqrt(2/r))*p*Math.sin(f),r*=this.mode===this.EQUIT?s:this.cosph0*s-this.sinph0*p*n}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(n=-n),Math.abs(m+this.lat0)=0?(t=(d=Math.sqrt(l))*i,r=n*(this.mode===this.S_POLE?d:-d)):t=r=0}}return e.x=this.a*t+this.x0,e.y=this.a*r+this.y0,e},inverse:function(e){e.x-=this.x0,e.y-=this.y0;var t,r,n,i,s,l,c,u,h,d,p=e.x/this.a,f=e.y/this.a;if(this.sphere){var m,g=0,A=0;if((r=.5*(m=Math.sqrt(p*p+f*f)))>1)return null;switch(r=2*Math.asin(r),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(A=Math.sin(r),g=Math.cos(r)),this.mode){case this.EQUIT:r=Math.abs(m)<=a?0:Math.asin(f*A/m),p*=A,f=g*m;break;case this.OBLIQ:r=Math.abs(m)<=a?this.lat0:Math.asin(g*this.sinph0+f*A*this.cosph0/m),p*=A*this.cosph0,f=(g-Math.sin(r)*this.sinph0)*m;break;case this.N_POLE:f=-f,r=o-r;break;case this.S_POLE:r-=o}t=0!==f||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(p,f):0}else{if(c=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(p/=this.dd,f*=this.dd,(l=Math.sqrt(p*p+f*f))1&&(e=e>1?1:-1),Math.asin(e)}const pt={init:function(){Math.abs(this.lat1+this.lat2)a?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(e){var t=e.x,r=e.y;this.sin_phi=Math.sin(r),this.cos_phi=Math.cos(r);var n=ut(this.e3,this.sin_phi),i=this.a*Math.sqrt(this.c-this.ns0*n)/this.ns0,s=this.ns0*N(t-this.long0),o=i*Math.sin(s)+this.x0,a=this.rh-i*Math.cos(s)+this.y0;return e.x=o,e.y=a,e},inverse:function(e){var t,r,n,i,s,o;return e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns0>=0?(t=Math.sqrt(e.x*e.x+e.y*e.y),n=1):(t=-Math.sqrt(e.x*e.x+e.y*e.y),n=-1),i=0,0!==t&&(i=Math.atan2(n*e.x,n*e.y)),n=t*this.ns0/this.a,this.sphere?o=Math.asin((this.c-n*n)/(2*this.ns0)):(r=(this.c-n*n)/this.ns0,o=this.phi1z(this.e3,r)),s=N(i/this.ns0+this.long0),e.x=s,e.y=o,e},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(e,t){var r,n,i,s,o=dt(.5*t);if(e0||Math.abs(s)<=a?(o=this.x0+1*this.a*r*Math.sin(n)/s,l=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*r*i)/s):(o=this.x0+this.infinity_dist*r*Math.sin(n),l=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*r*i)),e.x=o,e.y=l,e},inverse:function(e){var t,r,n,i,s,o;return e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,(t=Math.sqrt(e.x*e.x+e.y*e.y))?(i=Math.atan2(t,this.rc),r=Math.sin(i),o=dt((n=Math.cos(i))*this.sin_p14+e.y*r*this.cos_p14/t),s=Math.atan2(e.x*r,t*this.cos_p14*n-e.y*this.sin_p14*r),s=N(this.long0+s)):(o=this.phic0,s=0),e.x=s,e.y=o,e},names:["gnom"]},mt={init:function(){this.sphere||(this.k0=D(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(e){var t,r,n=e.x,i=e.y,s=N(n-this.long0);if(this.sphere)t=this.x0+this.a*s*Math.cos(this.lat_ts),r=this.y0+this.a*Math.sin(i)/Math.cos(this.lat_ts);else{var o=ut(this.e,Math.sin(i));t=this.x0+this.a*this.k0*s,r=this.y0+this.a*o*.5/this.k0}return e.x=t,e.y=r,e},inverse:function(e){var t,r;return e.x-=this.x0,e.y-=this.y0,this.sphere?(t=N(this.long0+e.x/this.a/Math.cos(this.lat_ts)),r=Math.asin(e.y/this.a*Math.cos(this.lat_ts))):(r=function(e,t){var r=1-(1-e*e)/(2*e)*Math.log((1-e)/(1+e));if(Math.abs(Math.abs(t)-r)<1e-6)return t<0?-1*o:o;for(var n,i,s,a,l=Math.asin(.5*t),c=0;c<30;c++)if(i=Math.sin(l),s=Math.cos(l),a=e*i,l+=n=Math.pow(1-a*a,2)/(2*s)*(t/(1-e*e)-i/(1-a*a)+.5/e*Math.log((1-a)/(1+a))),Math.abs(n)<=1e-10)return l;return NaN}(this.e,2*e.y*this.k0/this.a),t=N(this.long0+e.x/(this.a*this.k0))),e.x=t,e.y=r,e},names:["cea"]},gt={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(e){var t=e.x,r=e.y,n=N(t-this.long0),i=at(r-this.lat0);return e.x=this.x0+this.a*n*this.rc,e.y=this.y0+this.a*i,e},inverse:function(e){var t=e.x,r=e.y;return e.x=N(this.long0+(t-this.x0)/(this.a*this.rc)),e.y=at(this.lat0+(r-this.y0)/this.a),e},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},At={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=rt(this.es),this.e1=nt(this.es),this.e2=it(this.es),this.e3=st(this.es),this.ml0=this.a*tt(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(e){var t,r,n,i=e.x,s=e.y,o=N(i-this.long0);if(n=o*Math.sin(s),this.sphere)Math.abs(s)<=a?(t=this.a*o,r=-1*this.a*this.lat0):(t=this.a*Math.sin(n)/Math.tan(s),r=this.a*(at(s-this.lat0)+(1-Math.cos(n))/Math.tan(s)));else if(Math.abs(s)<=a)t=this.a*o,r=-1*this.ml0;else{var l=ot(this.a,this.e,Math.sin(s))/Math.tan(s);t=l*Math.sin(n),r=this.a*tt(this.e0,this.e1,this.e2,this.e3,s)-this.ml0+l*(1-Math.cos(n))}return e.x=t+this.x0,e.y=r+this.y0,e},inverse:function(e){var t,r,n,i,s,o,l,c,u;if(n=e.x-this.x0,i=e.y-this.y0,this.sphere)if(Math.abs(i+this.a*this.lat0)<=a)t=N(n/this.a+this.long0),r=0;else{var h;for(o=this.lat0+i/this.a,l=n*n/this.a/this.a+o*o,c=o,s=20;s;--s)if(c+=u=-1*(o*(c*(h=Math.tan(c))+1)-c-.5*(c*c+l)*h)/((c-o)/h-1),Math.abs(u)<=a){r=c;break}t=N(this.long0+Math.asin(n*Math.tan(c)/this.a)/Math.sin(r))}else if(Math.abs(i+this.ml0)<=a)r=0,t=N(this.long0+n/this.a);else{var d,p,f,m,g;for(o=(this.ml0+i)/this.a,l=n*n/this.a/this.a+o*o,c=o,s=20;s;--s)if(g=this.e*Math.sin(c),d=Math.sqrt(1-g*g)*Math.tan(c),p=this.a*tt(this.e0,this.e1,this.e2,this.e3,c),f=this.e0-2*this.e1*Math.cos(2*c)+4*this.e2*Math.cos(4*c)-6*this.e3*Math.cos(6*c),c-=u=(o*(d*(m=p/this.a)+1)-m-.5*d*(m*m+l))/(this.es*Math.sin(2*c)*(m*m+l-2*o*m)/(4*d)+(o-m)*(d*f-2/Math.sin(2*c))-f),Math.abs(u)<=a){r=c;break}d=Math.sqrt(1-this.es*Math.pow(Math.sin(r),2))*Math.tan(r),t=N(this.long0+Math.asin(n*d/this.a)/Math.sin(r))}return e.x=t,e.y=r,e},names:["Polyconic","poly"]},yt={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(e){var t,r=e.x,n=e.y-this.lat0,i=r-this.long0,o=n/s*1e-5,a=i,l=1,c=0;for(t=1;t<=10;t++)l*=o,c+=this.A[t]*l;var u,h=c,d=a,p=1,f=0,m=0,g=0;for(t=1;t<=6;t++)u=f*h+p*d,p=p*h-f*d,f=u,m=m+this.B_re[t]*p-this.B_im[t]*f,g=g+this.B_im[t]*p+this.B_re[t]*f;return e.x=g*this.a+this.x0,e.y=m*this.a+this.y0,e},inverse:function(e){var t,r,n=e.x,i=e.y,o=n-this.x0,a=(i-this.y0)/this.a,l=o/this.a,c=1,u=0,h=0,d=0;for(t=1;t<=6;t++)r=u*a+c*l,c=c*a-u*l,u=r,h=h+this.C_re[t]*c-this.C_im[t]*u,d=d+this.C_im[t]*c+this.C_re[t]*u;for(var p=0;p.999999999999&&(r=.999999999999),t=Math.asin(r);var n=N(this.long0+e.x/(.900316316158*this.a*Math.cos(t)));n<-Math.PI&&(n=-Math.PI),n>Math.PI&&(n=Math.PI),r=(2*t+Math.sin(2*t))/Math.PI,Math.abs(r)>1&&(r=1);var i=Math.asin(r);return e.x=n,e.y=i,e},names:["Mollweide","moll"]},bt={init:function(){Math.abs(this.lat1+this.lat2)=0?(r=Math.sqrt(e.x*e.x+e.y*e.y),t=1):(r=-Math.sqrt(e.x*e.x+e.y*e.y),t=-1);var s=0;return 0!==r&&(s=Math.atan2(t*e.x,t*e.y)),this.sphere?(i=N(this.long0+s/this.ns),n=at(this.g-r/this.a),e.x=i,e.y=n,e):(n=lt(this.g-r/this.a,this.e0,this.e1,this.e2,this.e3),i=N(this.long0+s/this.ns),e.x=i,e.y=n,e)},names:["Equidistant_Conic","eqdc"]},wt={init:function(){this.R=this.a},forward:function(e){var t,r,n=e.x,i=e.y,s=N(n-this.long0);Math.abs(i)<=a&&(t=this.x0+this.R*s,r=this.y0);var l=dt(2*Math.abs(i/Math.PI));(Math.abs(s)<=a||Math.abs(Math.abs(i)-o)<=a)&&(t=this.x0,r=i>=0?this.y0+Math.PI*this.R*Math.tan(.5*l):this.y0+Math.PI*this.R*-Math.tan(.5*l));var c=.5*Math.abs(Math.PI/s-s/Math.PI),u=c*c,h=Math.sin(l),d=Math.cos(l),p=d/(h+d-1),f=p*p,m=p*(2/h-1),g=m*m,A=Math.PI*this.R*(c*(p-g)+Math.sqrt(u*(p-g)*(p-g)-(g+u)*(f-g)))/(g+u);s<0&&(A=-A),t=this.x0+A;var y=u+p;return A=Math.PI*this.R*(m*y-c*Math.sqrt((g+u)*(u+1)-y*y))/(g+u),r=i>=0?this.y0+A:this.y0-A,e.x=t,e.y=r,e},inverse:function(e){var t,r,n,i,s,o,l,c,u,h,d,p;return e.x-=this.x0,e.y-=this.y0,d=Math.PI*this.R,s=(n=e.x/d)*n+(i=e.y/d)*i,d=3*(i*i/(c=-2*(o=-Math.abs(i)*(1+s))+1+2*i*i+s*s)+(2*(l=o-2*i*i+n*n)*l*l/c/c/c-9*o*l/c/c)/27)/(u=(o-l*l/3/c)/c)/(h=2*Math.sqrt(-u/3)),Math.abs(d)>1&&(d=d>=0?1:-1),p=Math.acos(d)/3,r=e.y>=0?(-h*Math.cos(p+Math.PI/3)-l/3/c)*Math.PI:-(-h*Math.cos(p+Math.PI/3)-l/3/c)*Math.PI,t=Math.abs(n)2*o*this.a)return;return r=t/this.a,n=Math.sin(r),i=Math.cos(r),s=this.long0,Math.abs(t)<=a?l=this.lat0:(l=dt(i*this.sin_p12+e.y*n*this.cos_p12/t),c=Math.abs(this.lat0)-o,s=Math.abs(c)<=a?this.lat0>=0?N(this.long0+Math.atan2(e.x,-e.y)):N(this.long0-Math.atan2(-e.x,e.y)):N(this.long0+Math.atan2(e.x*n,t*this.cos_p12*i-e.y*this.sin_p12*n))),e.x=s,e.y=l,e}return u=rt(this.es),h=nt(this.es),d=it(this.es),p=st(this.es),Math.abs(this.sin_p12-1)<=a?(l=lt(((f=this.a*tt(u,h,d,p,o))-(t=Math.sqrt(e.x*e.x+e.y*e.y)))/this.a,u,h,d,p),s=N(this.long0+Math.atan2(e.x,-1*e.y)),e.x=s,e.y=l,e):Math.abs(this.sin_p12+1)<=a?(f=this.a*tt(u,h,d,p,o),l=lt(((t=Math.sqrt(e.x*e.x+e.y*e.y))-f)/this.a,u,h,d,p),s=N(this.long0+Math.atan2(e.x,e.y)),e.x=s,e.y=l,e):(t=Math.sqrt(e.x*e.x+e.y*e.y),A=Math.atan2(e.x,e.y),m=ot(this.a,this.e,this.sin_p12),y=Math.cos(A),x=-(v=this.e*this.cos_p12*y)*v/(1-this.es),_=3*this.es*(1-x)*this.sin_p12*this.cos_p12*y/(1-this.es),E=1-x*(w=(b=t/m)-x*(1+x)*Math.pow(b,3)/6-_*(1+3*x)*Math.pow(b,4)/24)*w/2-b*w*w*w/6,g=Math.asin(this.sin_p12*Math.cos(w)+this.cos_p12*Math.sin(w)*y),s=N(this.long0+Math.asin(Math.sin(A)*Math.sin(w)/Math.cos(g))),M=Math.sin(g),l=Math.atan2((M-this.es*E*this.sin_p12)*Math.tan(g),M*(1-this.es)),e.x=s,e.y=l,e)},names:["Azimuthal_Equidistant","aeqd"]},Mt={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(e){var t,r,n,i,s,o,l,c=e.x,u=e.y;return n=N(c-this.long0),t=Math.sin(u),r=Math.cos(u),i=Math.cos(n),((s=this.sin_p14*t+this.cos_p14*r*i)>0||Math.abs(s)<=a)&&(o=1*this.a*r*Math.sin(n),l=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*r*i)),e.x=o,e.y=l,e},inverse:function(e){var t,r,n,i,s,l,c;return e.x-=this.x0,e.y-=this.y0,r=dt((t=Math.sqrt(e.x*e.x+e.y*e.y))/this.a),n=Math.sin(r),i=Math.cos(r),l=this.long0,Math.abs(t)<=a?(c=this.lat0,e.x=l,e.y=c,e):(c=dt(i*this.sin_p14+e.y*n*this.cos_p14/t),s=Math.abs(this.lat0)-o,Math.abs(s)<=a?(l=this.lat0>=0?N(this.long0+Math.atan2(e.x,-e.y)):N(this.long0-Math.atan2(-e.x,e.y)),e.x=l,e.y=c,e):(l=N(this.long0+Math.atan2(e.x*n,t*this.cos_p14*i-e.y*this.sin_p14*n)),e.x=l,e.y=c,e))},names:["ortho"]};function St(e,t,r,n){var i;return eu&&i<=o+u?(n.value=2,i-=o):i>o+u||i<=-(o+u)?(n.value=3,i=i>=0?i-d:i+d):(n.value=4,i+=o)),i}function Ct(e,t){var r=e+t;return r<-d?r+=h:r>+d&&(r-=h),r}const Tt={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=o-u/2?this.face=5:this.lat0<=-(o-u/2)?this.face=6:Math.abs(this.long0)<=u?this.face=1:Math.abs(this.long0)<=o+u?this.face=this.long0>0?2:4:this.face=3,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(e){var t,r,n,i,s,a,l={x:0,y:0},c={value:0};if(e.x-=this.long0,t=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(e.y)):e.y,r=e.x,5===this.face)i=o-t,r>=u&&r<=o+u?(c.value=1,n=r-o):r>o+u||r<=-(o+u)?(c.value=2,n=r>0?r-d:r+d):r>-(o+u)&&r<=-u?(c.value=3,n=r+o):(c.value=4,n=r);else if(6===this.face)i=o+t,r>=u&&r<=o+u?(c.value=1,n=-r+o):r=-u?(c.value=2,n=-r):r<-u&&r>=-(o+u)?(c.value=3,n=-r-o):(c.value=4,n=r>0?-r+d:-r-d);else{var h,p,f,m,g,A;2===this.face?r=Ct(r,+o):3===this.face?r=Ct(r,+d):4===this.face&&(r=Ct(r,-o)),m=Math.sin(t),g=Math.cos(t),A=Math.sin(r),h=g*Math.cos(r),p=g*A,f=m,1===this.face?n=St(i=Math.acos(h),f,p,c):2===this.face?n=St(i=Math.acos(p),f,-h,c):3===this.face?n=St(i=Math.acos(-h),f,-p,c):4===this.face?n=St(i=Math.acos(-p),f,h,c):(i=n=0,c.value=1)}return a=Math.atan(12/d*(n+Math.acos(Math.sin(n)*Math.cos(u))-o)),s=Math.sqrt((1-Math.cos(i))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(n))))),2===c.value?a+=o:3===c.value?a+=d:4===c.value&&(a+=1.5*d),l.x=s*Math.cos(a),l.y=s*Math.sin(a),l.x=l.x*this.a+this.x0,l.y=l.y*this.a+this.y0,e.x=l.x,e.y=l.y,e},inverse:function(e){var t,r,n,i,s,a,l,c,u,h,p,f,m={lam:0,phi:0},g={value:0};if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,r=Math.atan(Math.sqrt(e.x*e.x+e.y*e.y)),t=Math.atan2(e.y,e.x),e.x>=0&&e.x>=Math.abs(e.y)?g.value=1:e.y>=0&&e.y>=Math.abs(e.x)?(g.value=2,t-=o):e.x<0&&-e.x>=Math.abs(e.y)?(g.value=3,t=t<0?t+d:t-d):(g.value=4,t+=o),u=d/12*Math.tan(t),s=Math.sin(u)/(Math.cos(u)-1/Math.sqrt(2)),a=Math.atan(s),(l=1-(n=Math.cos(t))*n*(i=Math.tan(r))*i*(1-Math.cos(Math.atan(1/Math.cos(a)))))<-1?l=-1:l>1&&(l=1),5===this.face)c=Math.acos(l),m.phi=o-c,1===g.value?m.lam=a+o:2===g.value?m.lam=a<0?a+d:a-d:3===g.value?m.lam=a-o:m.lam=a;else if(6===this.face)c=Math.acos(l),m.phi=c-o,1===g.value?m.lam=-a+o:2===g.value?m.lam=-a:3===g.value?m.lam=-a-o:m.lam=a<0?-a-d:-a+d;else{var A,y,v;u=(A=l)*A,y=(u+=(v=u>=1?0:Math.sqrt(1-u)*Math.sin(a))*v)>=1?0:Math.sqrt(1-u),2===g.value?(u=y,y=-v,v=u):3===g.value?(y=-y,v=-v):4===g.value&&(u=y,y=v,v=-u),2===this.face?(u=A,A=-y,y=u):3===this.face?(A=-A,y=-y):4===this.face&&(u=A,A=y,y=-u),m.phi=Math.acos(-v)-o,m.lam=Math.atan2(y,A),2===this.face?m.lam=Ct(m.lam,-o):3===this.face?m.lam=Ct(m.lam,-d):4===this.face&&(m.lam=Ct(m.lam,+o))}return 0!==this.es&&(h=m.phi<0?1:0,p=Math.tan(m.phi),f=this.b/Math.sqrt(p*p+this.one_minus_f_squared),m.phi=Math.atan(Math.sqrt(this.a*this.a-f*f)/(this.one_minus_f*f)),h&&(m.phi=-m.phi)),m.lam+=this.long0,e.x=m.lam,e.y=m.phi,e},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]};var It=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Rt=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],Bt=.8487,Pt=1.3523,Lt=c/5,Dt=1/Lt,Ot=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))};const Nt={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(e){var t=N(e.x-this.long0),r=Math.abs(e.y),n=Math.floor(r*Lt);n<0?n=0:n>=18&&(n=17);var i={x:Ot(It[n],r=c*(r-Dt*n))*t,y:Ot(Rt[n],r)};return e.y<0&&(i.y=-i.y),i.x=i.x*this.a*Bt+this.x0,i.y=i.y*this.a*Pt+this.y0,i},inverse:function(e){var t={x:(e.x-this.x0)/(this.a*Bt),y:Math.abs(e.y-this.y0)/(this.a*Pt)};if(t.y>=1)t.x/=It[18][0],t.y=e.y<0?-o:o;else{var r=Math.floor(18*t.y);for(r<0?r=0:r>=18&&(r=17);;)if(Rt[r][0]>t.y)--r;else{if(!(Rt[r+1][0]<=t.y))break;++r}var n=Rt[r],i=5*(t.y-n[0])/(Rt[r+1][0]-n[0]);i=function(e,t,r,n){for(var i=t;n;--n){var s=e(i);if(i-=s,Math.abs(s)<1e-10)break}return i}((function(e){return(Ot(n,e)-t.y)/function(e,t){return e[1]+t*(2*e[2]+3*t*e[3])}(n,e)}),i,0,100),t.x/=Ot(It[r],i),t.y=(5*r+i)*l,e.y<0&&(t.y=-t.y)}return t.x=N(t.x+this.long0),t},names:["Robinson","robin"]},Ut={init:function(){this.name="geocent"},forward:function(e){return ne(e,this.es,this.a)},inverse:function(e){return ie(e,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]};var Ft={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};const kt={init:function(){if(Object.keys(Ft).forEach(function(e){if(void 0===this[e])this[e]=Ft[e].def;else{if(Ft[e].num&&isNaN(this[e]))throw new Error("Invalid parameter value, must be numeric "+e+" = "+this[e]);Ft[e].num&&(this[e]=parseFloat(this[e]))}Ft[e].degrees&&(this[e]=this[e]*l)}.bind(this)),Math.abs(Math.abs(this.lat0)-o)1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var e=this.tilt,t=this.azi;this.cg=Math.cos(t),this.sg=Math.sin(t),this.cw=Math.cos(e),this.sw=Math.sin(e)},forward:function(e){e.x-=this.long0;var t,r,n,i,s=Math.sin(e.y),o=Math.cos(e.y),a=Math.cos(e.x);switch(this.mode){case 3:r=this.sinph0*s+this.cosph0*o*a;break;case 2:r=o*a;break;case 1:r=-s;break;case 0:r=s}switch(t=(r=this.pn1/(this.p-r))*o*Math.sin(e.x),this.mode){case 3:r*=this.cosph0*s-this.sinph0*o*a;break;case 2:r*=s;break;case 0:r*=-o*a;break;case 1:r*=o*a}return i=1/((n=r*this.cg+t*this.sg)*this.sw*this.h1+this.cw),t=(t*this.cg-r*this.sg)*this.cw*i,r=n*i,e.x=t*this.a,e.y=r*this.a,e},inverse:function(e){e.x/=this.a,e.y/=this.a;var t,r,n,i={x:e.x,y:e.y};n=1/(this.pn1-e.y*this.sw),t=this.pn1*e.x*n,r=this.pn1*e.y*this.cw*n,e.x=t*this.cg+r*this.sg,e.y=r*this.cg-t*this.sg;var s=Ge(e.x,e.y);if(Math.abs(s)1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var e=1-this.es,t=1/e;this.radius_p=Math.sqrt(e),this.radius_p2=e,this.radius_p_inv2=t,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")},forward:function(e){var t,r,n,i,s=e.x,o=e.y;if(s-=this.long0,"ellipse"===this.shape){o=Math.atan(this.radius_p2*Math.tan(o));var a=this.radius_p/Ge(this.radius_p*Math.cos(o),Math.sin(o));if(r=a*Math.cos(s)*Math.cos(o),n=a*Math.sin(s)*Math.cos(o),i=a*Math.sin(o),(this.radius_g-r)*r-n*n-i*i*this.radius_p_inv2<0)return e.x=Number.NaN,e.y=Number.NaN,e;t=this.radius_g-r,this.flip_axis?(e.x=this.radius_g_1*Math.atan(n/Ge(i,t)),e.y=this.radius_g_1*Math.atan(i/t)):(e.x=this.radius_g_1*Math.atan(n/t),e.y=this.radius_g_1*Math.atan(i/Ge(n,t)))}else"sphere"===this.shape&&(t=Math.cos(o),r=Math.cos(s)*t,n=Math.sin(s)*t,i=Math.sin(o),t=this.radius_g-r,this.flip_axis?(e.x=this.radius_g_1*Math.atan(n/Ge(i,t)),e.y=this.radius_g_1*Math.atan(i/t)):(e.x=this.radius_g_1*Math.atan(n/t),e.y=this.radius_g_1*Math.atan(i/Ge(n,t))));return e.x=e.x*this.a,e.y=e.y*this.a,e},inverse:function(e){var t,r,n,i,s=-1,o=0,a=0;if(e.x=e.x/this.a,e.y=e.y/this.a,"ellipse"===this.shape){this.flip_axis?(a=Math.tan(e.y/this.radius_g_1),o=Math.tan(e.x/this.radius_g_1)*Ge(1,a)):(o=Math.tan(e.x/this.radius_g_1),a=Math.tan(e.y/this.radius_g_1)*Ge(1,o));var l=a/this.radius_p;if(t=o*o+l*l+s*s,(n=(r=2*this.radius_g*s)*r-4*t*this.C)<0)return e.x=Number.NaN,e.y=Number.NaN,e;i=(-r-Math.sqrt(n))/(2*t),s=this.radius_g+i*s,o*=i,a*=i,e.x=Math.atan2(o,s),e.y=Math.atan(a*Math.cos(e.x)/s),e.y=Math.atan(this.radius_p_inv2*Math.tan(e.y))}else if("sphere"===this.shape){if(this.flip_axis?(a=Math.tan(e.y/this.radius_g_1),o=Math.tan(e.x/this.radius_g_1)*Math.sqrt(1+a*a)):(o=Math.tan(e.x/this.radius_g_1),a=Math.tan(e.y/this.radius_g_1)*Math.sqrt(1+o*o)),t=o*o+a*a+s*s,(n=(r=2*this.radius_g*s)*r-4*t*this.C)<0)return e.x=Number.NaN,e.y=Number.NaN,e;i=(-r-Math.sqrt(n))/(2*t),s=this.radius_g+i*s,o*=i,a*=i,e.x=Math.atan2(o,s),e.y=Math.atan(a*Math.cos(e.x)/s)}return e.x=e.x+this.long0,e},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]};var Gt=1.340264,Qt=-.081106,Vt=893e-6,Ht=.003796,jt=Math.sqrt(3)/2;const qt={init:function(){this.es=0,this.long0=void 0!==this.long0?this.long0:0},forward:function(e){var t=N(e.x-this.long0),r=e.y,n=Math.asin(jt*Math.sin(r)),i=n*n,s=i*i*i;return e.x=t*Math.cos(n)/(jt*(Gt+3*Qt*i+s*(7*Vt+9*Ht*i))),e.y=n*(Gt+Qt*i+s*(Vt+Ht*i)),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e},inverse:function(e){e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a;var t,r,n,i,s=e.y;for(i=0;i<12&&(s-=n=(s*(Gt+Qt*(t=s*s)+(r=t*t*t)*(Vt+Ht*t))-e.y)/(Gt+3*Qt*t+r*(7*Vt+9*Ht*t)),!(Math.abs(n)<1e-9));++i);return r=(t=s*s)*t*t,e.x=jt*e.x*(Gt+3*Qt*t+r*(7*Vt+9*Ht*t))/Math.cos(s),e.y=Math.asin(Math.sin(s)/jt),e.x=N(e.x+this.long0),e},names:["eqearth","Equal Earth","Equal_Earth"]};var Wt=1e-10;function Yt(e){var t,r,n,i=N(e.x-(this.long0||0)),s=e.y;return t=this.am1+this.m1-Ue(s,r=Math.sin(s),n=Math.cos(s),this.en),r=n*i/(t*Math.sqrt(1-this.es*r*r)),e.x=t*Math.sin(r),e.y=this.am1-t*Math.cos(r),e.x=this.a*e.x+(this.x0||0),e.y=this.a*e.y+(this.y0||0),e}function Xt(e){var t,r,n,i;if(e.x=(e.x-(this.x0||0))/this.a,e.y=(e.y-(this.y0||0))/this.a,r=Ge(e.x,e.y=this.am1-e.y),i=Fe(this.am1+this.m1-r,this.es,this.en),(t=Math.abs(i))Wt?(e.x=r*Math.sin(t=n*Math.cos(i)/r),e.y=this.cphi1-r*Math.cos(t)):e.x=e.y=0,e.x=this.a*e.x+(this.x0||0),e.y=this.a*e.y+(this.y0||0),e}function $t(e){var t,r;e.x=(e.x-(this.x0||0))/this.a,e.y=(e.y-(this.y0||0))/this.a;var n=Ge(e.x,e.y=this.cphi1-e.y);if(r=this.cphi1+this.phi1-n,Math.abs(r)>o)throw new Error;return t=Math.abs(Math.abs(r)-o)<=Wt?0:n*Math.atan2(e.x,e.y)/Math.cos(r),e.x=N(t+(this.long0||0)),e.y=at(r),e}const Jt={init:function(){var e;if(this.phi1=this.lat1,Math.abs(this.phi1)=o?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=$t,this.forward=Kt)},names:["bonne","Bonne (Werner lat_1=90)"]};var Zt;ge.defaultDatum="WGS84",ge.Proj=re,ge.WGS84=new ge.Proj("WGS84"),ge.Point=Pe,ge.toPoint=ue,ge.defs=R,ge.nadgrid=function(e,t){var r=new DataView(t),n=function(e){var t=e.getInt32(8,!1);return 11!==t&&(11!==(t=e.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}(r),i=function(e,t){return{nFields:e.getInt32(8,t),nSubgridFields:e.getInt32(24,t),nSubgrids:e.getInt32(40,t),shiftType:$(e,56,64).trim(),fromSemiMajorAxis:e.getFloat64(120,t),fromSemiMinorAxis:e.getFloat64(136,t),toSemiMajorAxis:e.getFloat64(152,t),toSemiMinorAxis:e.getFloat64(168,t)}}(r,n),s=function(e,t,r){for(var n=176,i=[],s=0;s{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serialize=t.deserialize=t.registerSerializer=void 0;const n=r(25914);let i=n.DefaultSerializer;t.registerSerializer=function(e){i=n.extendSerializer(i,e)},t.deserialize=function(e){return i.deserialize(e)},t.serialize=function(e){return i.serialize(e)}},40447:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.Transfer=t.DefaultSerializer=t.expose=t.registerSerializer=void 0;var s=r(99278);Object.defineProperty(t,"registerSerializer",{enumerable:!0,get:function(){return s.registerSerializer}}),i(r(26838),t);var o=r(11854);Object.defineProperty(t,"expose",{enumerable:!0,get:function(){return o.expose}});var a=r(25914);Object.defineProperty(t,"DefaultSerializer",{enumerable:!0,get:function(){return a.DefaultSerializer}});var l=r(66712);Object.defineProperty(t,"Transfer",{enumerable:!0,get:function(){return l.Transfer}})},11029:(e,t)=>{"use strict";let r;function n(e){return(""+e).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\/\/.+)?\/[^/]+(?:\?.*)?$/,"$1")+"/"}Object.defineProperty(t,"__esModule",{value:!0}),t.getBundleURL=t.getBaseURL=void 0,t.getBundleURL=function(){return r||(r=function(){try{throw new Error}catch(e){const t=(""+e.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\/\/[^)\n]+/g);if(t)return n(t[0])}return"/"}()),r},t.getBaseURL=n},81592:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isWorkerRuntime=t.getWorkerImplementation=t.defaultPoolSize=void 0;const n=r(11029);t.defaultPoolSize="undefined"!=typeof navigator&&navigator.hardwareConcurrency?navigator.hardwareConcurrency:4;const i=e=>/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e);function s(e){const t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}let o;t.getWorkerImplementation=function(){return o||(o=function(){if("undefined"==typeof Worker)return class{constructor(){throw Error("No web worker implementation available. You might have tried to spawn a worker within a worker in a browser that doesn't support workers in workers.")}};class e extends Worker{constructor(e,t){var r,o;"string"==typeof e&&t&&t._baseURL?e=new URL(e,t._baseURL):"string"==typeof e&&!i(e)&&n.getBundleURL().match(/^file:\/\//i)&&(e=new URL(e,n.getBundleURL().replace(/\/[^\/]+$/,"/")),(null===(r=null==t?void 0:t.CORSWorkaround)||void 0===r||r)&&(e=s(`importScripts(${JSON.stringify(e)});`))),"string"==typeof e&&i(e)&&(null===(o=null==t?void 0:t.CORSWorkaround)||void 0===o||o)&&(e=s(`importScripts(${JSON.stringify(e)});`)),super(e,t)}}class t extends e{constructor(e,t){super(window.URL.createObjectURL(e),t)}static fromText(e,r){const n=new window.Blob([e],{type:"text/javascript"});return new t(n,r)}}return{blob:t,default:e}}()),o},t.isWorkerRuntime=function(){const e="undefined"!=typeof self&&"undefined"!=typeof Window&&self instanceof Window;return!("undefined"==typeof self||!self.postMessage||e)}},26838:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Worker=t.BlobWorker=t.isWorkerRuntime=t.Thread=t.spawn=t.Pool=void 0;const n=r(81592);Object.defineProperty(t,"isWorkerRuntime",{enumerable:!0,get:function(){return n.isWorkerRuntime}});var i=r(52734);Object.defineProperty(t,"Pool",{enumerable:!0,get:function(){return i.Pool}});var s=r(24949);Object.defineProperty(t,"spawn",{enumerable:!0,get:function(){return s.spawn}});var o=r(62996);Object.defineProperty(t,"Thread",{enumerable:!0,get:function(){return o.Thread}}),t.BlobWorker=n.getWorkerImplementation().blob,t.Worker=n.getWorkerImplementation().default},48215:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createProxyModule=t.createProxyFunction=void 0;const i=n(r(17833)),s=r(54527),o=r(99278),a=r(41898),l=r(66712),c=r(12781),u=i.default("threads:master:messages");let h=1;function d(e,t){return(...r)=>{const n=h++,{args:i,transferables:d}=function(e){if(0===e.length)return{args:[],transferables:[]};const t=[],r=[];for(const n of e)l.isTransferDescriptor(n)?(t.push(o.serialize(n.send)),r.push(...n.transferables)):t.push(o.serialize(n));return{args:t,transferables:0===r.length?r:(n=r,Array.from(new Set(n)))};var n}(r),p={type:c.MasterMessageType.run,uid:n,method:t,args:i};u("Sending command to run function to worker:",p);try{e.postMessage(p,d)}catch(e){return a.ObservablePromise.from(Promise.reject(e))}return a.ObservablePromise.from(s.multicast(function(e,t){return new s.Observable((r=>{let n;const i=s=>{var a;if(u("Message from worker:",s.data),s.data&&s.data.uid===t)if((a=s.data)&&a.type===c.WorkerMessageType.running)n=s.data.resultType;else if((e=>e&&e.type===c.WorkerMessageType.result)(s.data))"promise"===n?(void 0!==s.data.payload&&r.next(o.deserialize(s.data.payload)),r.complete(),e.removeEventListener("message",i)):(s.data.payload&&r.next(o.deserialize(s.data.payload)),s.data.complete&&(r.complete(),e.removeEventListener("message",i)));else if((e=>e&&e.type===c.WorkerMessageType.error)(s.data)){const t=o.deserialize(s.data.error);r.error(t),e.removeEventListener("message",i)}};return e.addEventListener("message",i),()=>{if("observable"===n||!n){const r={type:c.MasterMessageType.cancel,uid:t};e.postMessage(r)}e.removeEventListener("message",i)}}))}(e,n)))}}t.createProxyFunction=d,t.createProxyModule=function(e,t){const r={};for(const n of t)r[n]=d(e,n);return r}},72882:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.PoolEventType=void 0,(r=t.PoolEventType||(t.PoolEventType={})).initialized="initialized",r.taskCanceled="taskCanceled",r.taskCompleted="taskCompleted",r.taskFailed="taskFailed",r.taskQueued="taskQueued",r.taskQueueDrained="taskQueueDrained",r.taskStart="taskStart",r.terminated="terminated"},52734:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}l((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Pool=t.Thread=t.PoolEventType=void 0;const s=i(r(17833)),o=r(54527),a=r(7709),l=r(81592),c=r(72882);Object.defineProperty(t,"PoolEventType",{enumerable:!0,get:function(){return c.PoolEventType}});const u=r(62996);Object.defineProperty(t,"Thread",{enumerable:!0,get:function(){return u.Thread}});let h=1;class d{constructor(e,t){this.eventSubject=new o.Subject,this.initErrors=[],this.isClosing=!1,this.nextTaskID=1,this.taskQueue=[];const r="number"==typeof t?{size:t}:t||{},{size:n=l.defaultPoolSize}=r;var i;this.debug=s.default(`threads:pool:${i=r.name||String(h++),i.replace(/\W/g," ").trim().replace(/\s+/g,"-")}`),this.options=r,this.workers=function(e,t){return function(e){const t=[];for(let r=0;r({init:e(),runningTasks:[]})))}(e,n),this.eventObservable=o.multicast(o.Observable.from(this.eventSubject)),Promise.all(this.workers.map((e=>e.init))).then((()=>this.eventSubject.next({type:c.PoolEventType.initialized,size:this.workers.length})),(e=>{this.debug("Error while initializing pool worker:",e),this.eventSubject.error(e),this.initErrors.push(e)}))}findIdlingWorker(){const{concurrency:e=1}=this.options;return this.workers.find((t=>t.runningTasks.lengthn(this,void 0,void 0,(function*(){yield new Promise((e=>setTimeout(e,0)));try{yield this.runPoolTask(e,t)}finally{e.runningTasks=e.runningTasks.filter((e=>e!==r)),this.isClosing||this.scheduleWork()}})))();e.runningTasks.push(r)}))}scheduleWork(){this.debug("Attempt de-queueing a task in order to run it...");const e=this.findIdlingWorker();if(!e)return;const t=this.taskQueue.shift();if(!t)return this.debug("Task queue is empty"),void this.eventSubject.next({type:c.PoolEventType.taskQueueDrained});this.run(e,t)}taskCompletion(e){return new Promise(((t,r)=>{const n=this.events().subscribe((i=>{i.type===c.PoolEventType.taskCompleted&&i.taskID===e?(n.unsubscribe(),t(i.returnValue)):i.type===c.PoolEventType.taskFailed&&i.taskID===e?(n.unsubscribe(),r(i.error)):i.type===c.PoolEventType.terminated&&(n.unsubscribe(),r(Error("Pool has been terminated before task was run.")))}))}))}settled(e=!1){return n(this,void 0,void 0,(function*(){const t=()=>{return e=this.workers,t=e=>e.runningTasks,e.reduce(((e,r)=>[...e,...t(r)]),[]);var e,t},r=[],n=this.eventObservable.subscribe((e=>{e.type===c.PoolEventType.taskFailed&&r.push(e.error)}));return this.initErrors.length>0?Promise.reject(this.initErrors[0]):e&&0===this.taskQueue.length?(yield a.allSettled(t()),r):(yield new Promise(((e,t)=>{const r=this.eventObservable.subscribe({next(t){t.type===c.PoolEventType.taskQueueDrained&&(r.unsubscribe(),e(void 0))},error:t})})),yield a.allSettled(t()),n.unsubscribe(),r)}))}completed(e=!1){return n(this,void 0,void 0,(function*(){const t=this.settled(e),r=new Promise(((e,r)=>{const n=this.eventObservable.subscribe({next(i){i.type===c.PoolEventType.taskQueueDrained?(n.unsubscribe(),e(t)):i.type===c.PoolEventType.taskFailed&&(n.unsubscribe(),r(i.error))},error:r})})),n=yield Promise.race([t,r]);if(n.length>0)throw n[0]}))}events(){return this.eventObservable}queue(e){const{maxQueuedJobs:t=1/0}=this.options;if(this.isClosing)throw Error("Cannot schedule pool tasks after terminate() has been called.");if(this.initErrors.length>0)throw this.initErrors[0];const r=this.nextTaskID++,n=this.taskCompletion(r);n.catch((e=>{this.debug(`Task #${r} errored:`,e)}));const i={id:r,run:e,cancel:()=>{-1!==this.taskQueue.indexOf(i)&&(this.taskQueue=this.taskQueue.filter((e=>e!==i)),this.eventSubject.next({type:c.PoolEventType.taskCanceled,taskID:i.id}))},then:n.then.bind(n)};if(this.taskQueue.length>=t)throw Error("Maximum number of pool tasks queued. Refusing to queue another one.\nThis usually happens for one of two reasons: We are either at peak workload right now or some tasks just won't finish, thus blocking the pool.");return this.debug(`Queueing task #${i.id}...`),this.taskQueue.push(i),this.eventSubject.next({type:c.PoolEventType.taskQueued,taskID:i.id}),this.scheduleWork(),i}terminate(e){return n(this,void 0,void 0,(function*(){this.isClosing=!0,e||(yield this.completed(!0)),this.eventSubject.next({type:c.PoolEventType.terminated,remainingQueue:[...this.taskQueue]}),this.eventSubject.complete(),yield Promise.all(this.workers.map((e=>n(this,void 0,void 0,(function*(){return u.Thread.terminate(yield e.init)})))))}))}}function p(e,t){return new d(e,t)}d.EventType=c.PoolEventType,p.EventType=c.PoolEventType,t.Pool=p},24949:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}l((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.spawn=void 0;const s=i(r(17833)),o=r(54527),a=r(99278),l=r(54238),c=r(83682),u=r(72931),h=r(48215),d=s.default("threads:master:messages"),p=s.default("threads:master:spawn"),f=s.default("threads:master:thread-utils"),m="undefined"!=typeof process&&process.env.THREADS_WORKER_INIT_TIMEOUT?Number.parseInt(process.env.THREADS_WORKER_INIT_TIMEOUT,10):1e4;function g(e,t,r,n){const i=r.filter((e=>e.type===u.WorkerEventType.internalError)).map((e=>e.error));return Object.assign(e,{[c.$errors]:i,[c.$events]:r,[c.$terminate]:n,[c.$worker]:t})}t.spawn=function(e,t){return n(this,void 0,void 0,(function*(){p("Initializing new thread");const r=t&&t.timeout?t.timeout:m,i=yield function(e,t,r){return n(this,void 0,void 0,(function*(){let n;const i=new Promise(((e,i)=>{n=setTimeout((()=>i(Error(r))),t)})),s=yield Promise.race([e,i]);return clearTimeout(n),s}))}(function(e){return new Promise(((t,r)=>{const n=i=>{var s;d("Message from worker before finishing initialization:",i.data),(s=i.data)&&"init"===s.type?(e.removeEventListener("message",n),t(i.data)):(e=>e&&"uncaughtError"===e.type)(i.data)&&(e.removeEventListener("message",n),r(a.deserialize(i.data.error)))};e.addEventListener("message",n)}))}(e),r,`Timeout: Did not receive an init message from worker after ${r}ms. Make sure the worker calls expose().`),s=i.exposed,{termination:c,terminate:A}=function(e){const[t,r]=l.createPromiseWithResolver();return{terminate:()=>n(this,void 0,void 0,(function*(){f("Terminating worker"),yield e.terminate(),r()})),termination:t}}(e),y=function(e,t){return new o.Observable((r=>{const n=e=>{const t={type:u.WorkerEventType.message,data:e.data};r.next(t)},i=e=>{f("Unhandled promise rejection event in thread:",e);const t={type:u.WorkerEventType.internalError,error:Error(e.reason)};r.next(t)};e.addEventListener("message",n),e.addEventListener("unhandledrejection",i),t.then((()=>{const t={type:u.WorkerEventType.termination};e.removeEventListener("message",n),e.removeEventListener("unhandledrejection",i),r.next(t),r.complete()}))}))}(e,c);if("function"===s.type)return g(h.createProxyFunction(e),e,y,A);if("module"===s.type)return g(h.createProxyModule(e,s.methods),e,y,A);{const e=s.type;throw Error(`Worker init message states unexpected type of expose(): ${e}`)}}))}},62996:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Thread=void 0;const n=r(83682);function i(e){throw Error(e)}t.Thread={errors:e=>e[n.$errors]||i("Error observable not found. Make sure to pass a thread instance as returned by the spawn() promise."),events:e=>e[n.$events]||i("Events observable not found. Make sure to pass a thread instance as returned by the spawn() promise."),terminate:e=>e[n.$terminate]()}},41898:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObservablePromise=void 0;const n=r(54527),i=()=>{},s=e=>e,o=e=>Promise.resolve().then(e);function a(e){throw e}class l extends n.Observable{constructor(e){super((t=>{const r=this,n=Object.assign(Object.assign({},t),{complete(){t.complete(),r.onCompletion()},error(e){t.error(e),r.onError(e)},next(e){t.next(e),r.onNext(e)}});try{return this.initHasRun=!0,e(n)}catch(e){n.error(e)}})),this.initHasRun=!1,this.fulfillmentCallbacks=[],this.rejectionCallbacks=[],this.firstValueSet=!1,this.state="pending"}onNext(e){this.firstValueSet||(this.firstValue=e,this.firstValueSet=!0)}onError(e){this.state="rejected",this.rejection=e;for(const t of this.rejectionCallbacks)o((()=>t(e)))}onCompletion(){this.state="fulfilled";for(const e of this.fulfillmentCallbacks)o((()=>e(this.firstValue)))}then(e,t){const r=e||s,n=t||a;let i=!1;return new Promise(((e,t)=>{const s=r=>{if(!i){i=!0;try{e(n(r))}catch(e){t(e)}}};return this.initHasRun||this.subscribe({error:s}),"fulfilled"===this.state?e(r(this.firstValue)):"rejected"===this.state?(i=!0,e(n(this.rejection))):(this.fulfillmentCallbacks.push((t=>{try{e(r(t))}catch(e){s(e)}})),void this.rejectionCallbacks.push(s))}))}catch(e){return this.then(void 0,e)}finally(e){const t=e||i;return this.then((e=>(t(),e)),(()=>t()))}static from(e){return function(e){return e&&"function"==typeof e.then}(e)?new l((t=>{e.then((e=>{t.next(e),t.complete()}),(e=>{t.error(e)}))})):super.from(e)}}t.ObservablePromise=l},7709:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.allSettled=void 0,t.allSettled=function(e){return Promise.all(e.map((e=>{const t=e=>({status:"fulfilled",value:e}),r=e=>({status:"rejected",reason:e}),n=Promise.resolve(e);try{return n.then(t,r)}catch(e){return Promise.reject(e)}})))}},54238:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPromiseWithResolver=void 0;const r=()=>{};t.createPromiseWithResolver=function(){let e,t=!1,n=r;return[new Promise((r=>{t?r(e):n=r})),r=>{t=!0,e=r,n(e)}]}},25914:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultSerializer=t.extendSerializer=void 0,t.extendSerializer=function(e,t){const r=e.deserialize.bind(e),n=e.serialize.bind(e);return{deserialize:e=>t.deserialize(e,r),serialize:e=>t.serialize(e,n)}};const r=e=>Object.assign(Error(e.message),{name:e.name,stack:e.stack}),n=e=>({__error_marker:"$$error",message:e.message,name:e.name,stack:e.stack});t.DefaultSerializer={deserialize(e){return(t=e)&&"object"==typeof t&&"__error_marker"in t&&"$$error"===t.__error_marker?r(e):e;var t},serialize:e=>e instanceof Error?n(e):e}},83682:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.$worker=t.$transferable=t.$terminate=t.$events=t.$errors=void 0,t.$errors=Symbol("thread.errors"),t.$events=Symbol("thread.events"),t.$terminate=Symbol("thread.terminate"),t.$transferable=Symbol("thread.transferable"),t.$worker=Symbol("thread.worker")},66712:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Transfer=t.isTransferDescriptor=void 0;const n=r(83682);t.isTransferDescriptor=function(e){return e&&"object"==typeof e&&e[n.$transferable]},t.Transfer=function(e,t){if(!t){if(!(r=e)||"object"!=typeof r)throw Error();t=[e]}var r;return{[n.$transferable]:!0,send:e,transferables:t}}},72931:(e,t,r)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerEventType=void 0,r(83682),(n=t.WorkerEventType||(t.WorkerEventType={})).internalError="internalError",n.message="message",n.termination="termination"},12781:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerMessageType=t.MasterMessageType=void 0,(n=t.MasterMessageType||(t.MasterMessageType={})).cancel="cancel",n.run="run",(r=t.WorkerMessageType||(t.WorkerMessageType={})).error="error",r.init="init",r.result="result",r.running="running",r.uncaughtError="uncaughtError"},64304:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={isWorkerRuntime:function(){const e="undefined"!=typeof self&&"undefined"!=typeof Window&&self instanceof Window;return!("undefined"==typeof self||!self.postMessage||e)},postMessageToMaster:function(e,t){self.postMessage(e,t)},subscribeToMasterMessages:function(e){const t=t=>{e(t.data)};return self.addEventListener("message",t),()=>{self.removeEventListener("message",t)}}}},11854:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}l((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.expose=t.isWorkerRuntime=t.Transfer=t.registerSerializer=void 0;const s=i(r(95409)),o=r(99278),a=r(66712),l=r(12781),c=i(r(64304));var u=r(99278);Object.defineProperty(t,"registerSerializer",{enumerable:!0,get:function(){return u.registerSerializer}});var h=r(66712);Object.defineProperty(t,"Transfer",{enumerable:!0,get:function(){return h.Transfer}}),t.isWorkerRuntime=c.default.isWorkerRuntime;let d=!1;const p=new Map,f=e=>e&&e.type===l.MasterMessageType.run,m=e=>s.default(e)||function(e){return e&&"object"==typeof e&&"function"==typeof e.subscribe}(e);function g(e){return a.isTransferDescriptor(e)?{payload:e.send,transferables:e.transferables}:{payload:e,transferables:void 0}}function A(e,t){const{payload:r,transferables:n}=g(t),i={type:l.WorkerMessageType.error,uid:e,error:o.serialize(r)};c.default.postMessageToMaster(i,n)}function y(e,t,r){const{payload:n,transferables:i}=g(r),s={type:l.WorkerMessageType.result,uid:e,complete:!!t||void 0,payload:n};c.default.postMessageToMaster(s,i)}function v(e){try{const t={type:l.WorkerMessageType.uncaughtError,error:o.serialize(e)};c.default.postMessageToMaster(t)}catch(t){console.error("Not reporting uncaught error back to master thread as it occured while reporting an uncaught error already.\nLatest error:",t,"\nOriginal error:",e)}}function x(e,t,r){return n(this,void 0,void 0,(function*(){let n;try{n=t(...r)}catch(t){return A(e,t)}const i=m(n)?"observable":"promise";if(function(e,t){const r={type:l.WorkerMessageType.running,uid:e,resultType:t};c.default.postMessageToMaster(r)}(e,i),m(n)){const t=n.subscribe((t=>y(e,!1,o.serialize(t))),(t=>{A(e,o.serialize(t)),p.delete(e)}),(()=>{y(e,!0),p.delete(e)}));p.set(e,t)}else try{const t=yield n;y(e,!0,o.serialize(t))}catch(t){A(e,o.serialize(t))}}))}t.expose=function(e){if(!c.default.isWorkerRuntime())throw Error("expose() called in the master thread.");if(d)throw Error("expose() called more than once. This is not possible. Pass an object to expose() if you want to expose multiple functions.");if(d=!0,"function"==typeof e)c.default.subscribeToMasterMessages((t=>{f(t)&&!t.method&&x(t.uid,e,t.args.map(o.deserialize))})),function(){const e={type:l.WorkerMessageType.init,exposed:{type:"function"}};c.default.postMessageToMaster(e)}();else{if("object"!=typeof e||!e)throw Error(`Invalid argument passed to expose(). Expected a function or an object, got: ${e}`);c.default.subscribeToMasterMessages((t=>{f(t)&&t.method&&x(t.uid,e[t.method],t.args.map(o.deserialize))})),function(e){const t={type:l.WorkerMessageType.init,exposed:{type:"module",methods:e}};c.default.postMessageToMaster(t)}(Object.keys(e).filter((t=>"function"==typeof e[t])))}c.default.subscribeToMasterMessages((e=>{if((t=e)&&t.type===l.MasterMessageType.cancel){const t=e.uid,r=p.get(t);r&&(r.unsubscribe(),p.delete(t))}var t}))},"undefined"!=typeof self&&"function"==typeof self.addEventListener&&c.default.isWorkerRuntime()&&(self.addEventListener("error",(e=>{setTimeout((()=>v(e.error||e)),250)})),self.addEventListener("unhandledrejection",(e=>{const t=e.reason;t&&"string"==typeof t.message&&setTimeout((()=>v(t)),250)}))),"undefined"!=typeof process&&"function"==typeof process.on&&c.default.isWorkerRuntime()&&(process.on("uncaughtException",(e=>{setTimeout((()=>v(e)),250)})),process.on("unhandledRejection",(e=>{e&&"string"==typeof e.message&&setTimeout((()=>v(e)),250)})))},10539:()=>{},11025:(e,t,r)=>{"use strict";r(52675),r(89463),r(66412),r(60193),r(92168),r(2259),r(86964),r(83142),r(83237),r(61833),r(67947),r(31073),r(45700),r(78125),r(20326),r(16280),r(76918),r(30067),r(4294),r(18107),r(28706),r(26835),r(88431),r(33771),r(2008),r(50113),r(48980),r(10838),r(13451),r(46449),r(78350),r(51629),r(23418),r(74423),r(25276),r(64346),r(23792),r(48598),r(8921),r(62062),r(31051),r(44114),r(72712),r(18863),r(94490),r(34782),r(15086),r(26910),r(87478),r(54554),r(9678),r(57145),r(71658),r(93514),r(30237),r(13609),r(11558),r(54743),r(46761),r(11745),r(38309),r(16573),r(78100),r(77936),r(61699),r(59089),r(91191),r(93515),r(1688),r(60739),r(89572),r(23288),r(36456),r(94170),r(48957),r(62010),r(55081),r(33110),r(4731),r(36033),r(47072),r(93153),r(82326),r(36389),r(64444),r(8085),r(77762),r(65070),r(60605),r(39469),r(72152),r(75376),r(56624),r(11367),r(5914),r(78553),r(98690),r(60479),r(70761),r(2892),r(45374),r(25428),r(32637),r(40150),r(59149),r(64601),r(44435),r(87220),r(25843),r(62337),r(9868),r(80630),r(69085),r(59904),r(17427),r(67945),r(84185),r(87607),r(5506),r(52811),r(53921),r(83851),r(81278),r(1480),r(40875),r(77691),r(78347),r(29908),r(94052),r(94003),r(221),r(79432),r(9220),r(7904),r(93967),r(63548),r(93941),r(10287),r(26099),r(16034),r(78459),r(58940),r(3362),r(96167),r(93518),r(9391),r(14628),r(39796),r(60825),r(87411),r(21211),r(40888),r(9065),r(86565),r(32812),r(84634),r(71137),r(30985),r(34268),r(34873),r(15472),r(84864),r(57465),r(27495),r(69479),r(87745),r(90906),r(38781),r(31415),r(17642),r(58004),r(33853),r(45876),r(32475),r(15024),r(31698),r(67357),r(23860),r(99449),r(27337),r(21699),r(42043),r(47764),r(71761),r(28543),r(35701),r(68156),r(85906),r(42781),r(25440),r(79978),r(5746),r(90744),r(11392),r(50375),r(67438),r(42762),r(39202),r(43359),r(89907),r(11898),r(35490),r(5745),r(94298),r(60268),r(69546),r(20781),r(50778),r(89195),r(46276),r(48718),r(16308),r(34594),r(29833),r(46594),r(72107),r(95477),r(21489),r(22134),r(3690),r(61740),r(48140),r(81630),r(72170),r(75044),r(69539),r(31694),r(89955),r(21903),r(91134),r(33206),r(48345),r(44496),r(66651),r(12887),r(19369),r(66812),r(8995),r(52568),r(31575),r(36072),r(88747),r(28845),r(29423),r(57301),r(373),r(86614),r(41405),r(37467),r(44732),r(33684),r(79577),r(88267),r(73772),r(30958),r(49806),r(39687),r(26148),r(34504),r(87370),r(31659),r(95115),r(17978),r(46058),r(6986),r(88177),r(80081),r(45490),r(17656),r(55105),r(54151),r(72400),r(73677),r(61938),r(85901),r(26280),r(27913),r(47801),r(82750),r(33811),r(84847),r(74147),r(29150),r(74648),r(17333),r(3064),r(32679),r(9920),r(46967),r(45182),r(41393),r(14905),r(8159),r(39320),r(86994),r(24964),r(7467),r(10586),r(47390),r(81332),r(9730),r(56192),r(66557),r(83354),r(98225),r(37998),r(16401),r(18640),r(62480),r(98992),r(51098),r(16037),r(64743),r(23215),r(54520),r(72577),r(30670),r(3949),r(45882),r(76913),r(81454),r(75289),r(8872),r(37550),r(27413),r(41795),r(81730),r(67296),r(58335),r(33981),r(71517),r(11379),r(93777),r(14190),r(12359),r(86097),r(39172),r(57019),r(17273),r(81723),r(27415),r(19929),r(37583),r(55122),r(16385),r(20230),r(57268),r(79733),r(19717),r(52231),r(58179),r(30456),r(74017),r(79310),r(16453),r(83062),r(96369),r(15637),r(2848),r(24842),r(24746),r(33454),r(6660),r(4235),r(15941),r(82101),r(79926),r(84208),r(91550),r(9156),r(48918),r(66090),r(2917),r(35874),r(47575),r(47628),r(43799),r(65186),r(42978),r(72527),r(79852),r(42376),r(40617),r(73067),r(66820),r(8288),r(37108),r(25509),r(65223),r(43375),r(60321),r(41927),r(11632),r(64377),r(49522),r(39225),r(66771),r(13972),r(12516),r(99209),r(68931),r(25714),r(52514),r(35694),r(52774),r(23283),r(49536),r(21926),r(17561),r(16864),r(66197),r(16215),r(78898),r(84114),r(74176),r(66337),r(44590),r(38344),r(12041),r(51755),r(81202),r(49604),r(43275),r(13070),r(87153),r(53032),r(53803),r(13976),r(30465),r(18999),r(42793),r(77208),r(73440),r(13195),r(51839),r(14037),r(47350),r(91706),r(96847),r(23241),r(43250),r(10149),r(67302),r(55871),r(24082),r(57051),r(27650),r(41549),r(49797),r(49631),r(35623),r(67348),r(26957),r(79732),r(35644),r(49634),r(83742),r(56422),r(82451),r(46270),r(2945),r(42207),r(23500),r(62953),r(55815),r(64979),r(79739),r(59848),r(122),r(13611),r(71678),r(76031),r(3296),r(2222),r(45781),r(27208),r(48408),r(14603),r(47566),r(98721),r(19167)},44847:(e,t,r)=>{"use strict";r(11025)},79306:(e,t,r)=>{"use strict";var n=r(94901),i=r(16823),s=TypeError;e.exports=function(e){if(n(e))return e;throw new s(i(e)+" is not a function")}},35548:(e,t,r)=>{"use strict";var n=r(33517),i=r(16823),s=TypeError;e.exports=function(e){if(n(e))return e;throw new s(i(e)+" is not a constructor")}},24194:(e,t,r)=>{"use strict";var n=r(36955),i=TypeError;e.exports=function(e){if("DataView"===n(e))return e;throw new i("Argument is not a DataView")}},36194:(e,t,r)=>{"use strict";var n=r(72248).has;e.exports=function(e){return n(e),e}},73506:(e,t,r)=>{"use strict";var n=r(13925),i=String,s=TypeError;e.exports=function(e){if(n(e))return e;throw new s("Can't set "+i(e)+" as a prototype")}},97080:(e,t,r)=>{"use strict";var n=r(94402).has;e.exports=function(e){return n(e),e}},63463:e=>{"use strict";var t=TypeError;e.exports=function(e){if("string"==typeof e)return e;throw new t("Argument is not a string")}},76557:(e,t,r)=>{"use strict";var n=r(44995).has;e.exports=function(e){return n(e),e}},23755:(e,t,r)=>{"use strict";var n=r(88205).has;e.exports=function(e){return n(e),e}},91021:(e,t,r)=>{"use strict";var n=r(69565),i=r(79504),s=r(76080),o=r(28551),a=r(79306),l=r(64117),c=r(55966),u=r(78227),h=u("asyncDispose"),d=u("dispose"),p=i([].push),f=function(e,t,r){return arguments.length<3&&!l(e)&&(r=a(function(e,t){if("async-dispose"===t){var r=c(e,h);return void 0!==r||void 0===(r=c(e,d))?r:function(){n(r,this)}}return c(e,d)}(o(e),t))),void 0===r?function(){}:s(r,e)};e.exports=function(e,t,r,n){var i;if(arguments.length<4){if(l(t)&&"sync-dispose"===r)return;i=f(t,r)}else i=f(void 0,r,n);p(e.stack,i)}},6469:(e,t,r)=>{"use strict";var n=r(78227),i=r(2360),s=r(24913).f,o=n("unscopables"),a=Array.prototype;void 0===a[o]&&s(a,o,{configurable:!0,value:i(null)}),e.exports=function(e){a[o][e]=!0}},57829:(e,t,r)=>{"use strict";var n=r(68183).charAt;e.exports=function(e,t,r){return t+(r?n(e,t).length:1)}},90679:(e,t,r)=>{"use strict";var n=r(1625),i=TypeError;e.exports=function(e,t){if(n(t,e))return e;throw new i("Incorrect invocation")}},83972:(e,t,r)=>{"use strict";var n=r(20034),i=String,s=TypeError;e.exports=function(e){if(void 0===e||n(e))return e;throw new s(i(e)+" is not an object or undefined")}},28551:(e,t,r)=>{"use strict";var n=r(20034),i=String,s=TypeError;e.exports=function(e){if(n(e))return e;throw new s(i(e)+" is not an object")}},34154:(e,t,r)=>{"use strict";var n=r(36955),i=TypeError;e.exports=function(e){if("Uint8Array"===n(e))return e;throw new i("Argument is not an Uint8Array")}},77811:e=>{"use strict";e.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},67394:(e,t,r)=>{"use strict";var n=r(44576),i=r(46706),s=r(22195),o=n.ArrayBuffer,a=n.TypeError;e.exports=o&&i(o.prototype,"byteLength","get")||function(e){if("ArrayBuffer"!==s(e))throw new a("ArrayBuffer expected");return e.byteLength}},3238:(e,t,r)=>{"use strict";var n=r(44576),i=r(27476),s=r(67394),o=n.ArrayBuffer,a=o&&o.prototype,l=a&&i(a.slice);e.exports=function(e){if(0!==s(e))return!1;if(!l)return!1;try{return l(e,0,0),!1}catch(e){return!0}}},15652:(e,t,r)=>{"use strict";var n=r(79039);e.exports=n((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}))},55169:(e,t,r)=>{"use strict";var n=r(3238),i=TypeError;e.exports=function(e){if(n(e))throw new i("ArrayBuffer is detached");return e}},95636:(e,t,r)=>{"use strict";var n=r(44576),i=r(79504),s=r(46706),o=r(57696),a=r(55169),l=r(67394),c=r(94483),u=r(1548),h=n.structuredClone,d=n.ArrayBuffer,p=n.DataView,f=Math.min,m=d.prototype,g=p.prototype,A=i(m.slice),y=s(m,"resizable","get"),v=s(m,"maxByteLength","get"),x=i(g.getInt8),_=i(g.setInt8);e.exports=(u||c)&&function(e,t,r){var n,i=l(e),s=void 0===t?i:o(t),m=!y||!y(e);if(a(e),u&&(e=h(e,{transfer:[e]}),i===s&&(r||m)))return e;if(i>=s&&(!r||m))n=A(e,0,s);else{var g=r&&!m&&v?{maxByteLength:v(e)}:void 0;n=new d(s,g);for(var b=new p(e),w=new p(n),E=f(s,i),M=0;M{"use strict";var n,i,s,o=r(77811),a=r(43724),l=r(44576),c=r(94901),u=r(20034),h=r(39297),d=r(36955),p=r(16823),f=r(66699),m=r(36840),g=r(62106),A=r(1625),y=r(42787),v=r(52967),x=r(78227),_=r(33392),b=r(91181),w=b.enforce,E=b.get,M=l.Int8Array,S=M&&M.prototype,C=l.Uint8ClampedArray,T=C&&C.prototype,I=M&&y(M),R=S&&y(S),B=Object.prototype,P=l.TypeError,L=x("toStringTag"),D=_("TYPED_ARRAY_TAG"),O="TypedArrayConstructor",N=o&&!!v&&"Opera"!==d(l.opera),U=!1,F={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},k={BigInt64Array:8,BigUint64Array:8},z=function(e){var t=y(e);if(u(t)){var r=E(t);return r&&h(r,O)?r[O]:z(t)}},G=function(e){if(!u(e))return!1;var t=d(e);return h(F,t)||h(k,t)};for(n in F)(s=(i=l[n])&&i.prototype)?w(s)[O]=i:N=!1;for(n in k)(s=(i=l[n])&&i.prototype)&&(w(s)[O]=i);if((!N||!c(I)||I===Function.prototype)&&(I=function(){throw new P("Incorrect invocation")},N))for(n in F)l[n]&&v(l[n],I);if((!N||!R||R===B)&&(R=I.prototype,N))for(n in F)l[n]&&v(l[n].prototype,R);if(N&&y(T)!==R&&v(T,R),a&&!h(R,L))for(n in U=!0,g(R,L,{configurable:!0,get:function(){return u(this)?this[D]:void 0}}),F)l[n]&&f(l[n],D,n);e.exports={NATIVE_ARRAY_BUFFER_VIEWS:N,TYPED_ARRAY_TAG:U&&D,aTypedArray:function(e){if(G(e))return e;throw new P("Target is not a typed array")},aTypedArrayConstructor:function(e){if(c(e)&&(!v||A(I,e)))return e;throw new P(p(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r,n){if(a){if(r)for(var i in F){var s=l[i];if(s&&h(s.prototype,e))try{delete s.prototype[e]}catch(r){try{s.prototype[e]=t}catch(e){}}}R[e]&&!r||m(R,e,r?t:N&&S[e]||t,n)}},exportTypedArrayStaticMethod:function(e,t,r){var n,i;if(a){if(v){if(r)for(n in F)if((i=l[n])&&h(i,e))try{delete i[e]}catch(e){}if(I[e]&&!r)return;try{return m(I,e,r?t:N&&I[e]||t)}catch(e){}}for(n in F)!(i=l[n])||i[e]&&!r||m(i,e,t)}},getTypedArrayConstructor:z,isView:function(e){if(!u(e))return!1;var t=d(e);return"DataView"===t||h(F,t)||h(k,t)},isTypedArray:G,TypedArray:I,TypedArrayPrototype:R}},66346:(e,t,r)=>{"use strict";var n=r(44576),i=r(79504),s=r(43724),o=r(77811),a=r(10350),l=r(66699),c=r(62106),u=r(56279),h=r(79039),d=r(90679),p=r(91291),f=r(18014),m=r(57696),g=r(15617),A=r(88490),y=r(42787),v=r(52967),x=r(84373),_=r(67680),b=r(23167),w=r(77740),E=r(10687),M=r(91181),S=a.PROPER,C=a.CONFIGURABLE,T="ArrayBuffer",I="DataView",R="prototype",B="Wrong index",P=M.getterFor(T),L=M.getterFor(I),D=M.set,O=n[T],N=O,U=N&&N[R],F=n[I],k=F&&F[R],z=Object.prototype,G=n.Array,Q=n.RangeError,V=i(x),H=i([].reverse),j=A.pack,q=A.unpack,W=function(e){return[255&e]},Y=function(e){return[255&e,e>>8&255]},X=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},K=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},$=function(e){return j(g(e),23,4)},J=function(e){return j(e,52,8)},Z=function(e,t,r){c(e[R],t,{configurable:!0,get:function(){return r(this)[t]}})},ee=function(e,t,r,n){var i=L(e),s=m(r),o=!!n;if(s+t>i.byteLength)throw new Q(B);var a=i.bytes,l=s+i.byteOffset,c=_(a,l,l+t);return o?c:H(c)},te=function(e,t,r,n,i,s){var o=L(e),a=m(r),l=n(+i),c=!!s;if(a+t>o.byteLength)throw new Q(B);for(var u=o.bytes,h=a+o.byteOffset,d=0;d>24)},setUint8:function(e,t){ie(this,e,t<<24>>24)}},{unsafe:!0})}else U=(N=function(e){d(this,U);var t=m(e);D(this,{type:T,bytes:V(G(t),0),byteLength:t}),s||(this.byteLength=t,this.detached=!1)})[R],k=(F=function(e,t,r){d(this,k),d(e,U);var n=P(e),i=n.byteLength,o=p(t);if(o<0||o>i)throw new Q("Wrong offset");if(o+(r=void 0===r?i-o:f(r))>i)throw new Q("Wrong length");D(this,{type:I,buffer:e,byteLength:r,byteOffset:o,bytes:n.bytes}),s||(this.buffer=e,this.byteLength=r,this.byteOffset=o)})[R],s&&(Z(N,"byteLength",P),Z(F,"buffer",L),Z(F,"byteLength",L),Z(F,"byteOffset",L)),u(k,{getInt8:function(e){return ee(this,1,e)[0]<<24>>24},getUint8:function(e){return ee(this,1,e)[0]},getInt16:function(e){var t=ee(this,2,e,arguments.length>1&&arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=ee(this,2,e,arguments.length>1&&arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return K(ee(this,4,e,arguments.length>1&&arguments[1]))},getUint32:function(e){return K(ee(this,4,e,arguments.length>1&&arguments[1]))>>>0},getFloat32:function(e){return q(ee(this,4,e,arguments.length>1&&arguments[1]),23)},getFloat64:function(e){return q(ee(this,8,e,arguments.length>1&&arguments[1]),52)},setInt8:function(e,t){te(this,1,e,W,t)},setUint8:function(e,t){te(this,1,e,W,t)},setInt16:function(e,t){te(this,2,e,Y,t,arguments.length>2&&arguments[2])},setUint16:function(e,t){te(this,2,e,Y,t,arguments.length>2&&arguments[2])},setInt32:function(e,t){te(this,4,e,X,t,arguments.length>2&&arguments[2])},setUint32:function(e,t){te(this,4,e,X,t,arguments.length>2&&arguments[2])},setFloat32:function(e,t){te(this,4,e,$,t,arguments.length>2&&arguments[2])},setFloat64:function(e,t){te(this,8,e,J,t,arguments.length>2&&arguments[2])}});E(N,T),E(F,I),e.exports={ArrayBuffer:N,DataView:F}},57029:(e,t,r)=>{"use strict";var n=r(48981),i=r(35610),s=r(26198),o=r(84606),a=Math.min;e.exports=[].copyWithin||function(e,t){var r=n(this),l=s(r),c=i(e,l),u=i(t,l),h=arguments.length>2?arguments[2]:void 0,d=a((void 0===h?l:i(h,l))-u,l-c),p=1;for(u0;)u in r?r[c]=r[u]:o(r,c),c+=p,u+=p;return r}},84373:(e,t,r)=>{"use strict";var n=r(48981),i=r(35610),s=r(26198);e.exports=function(e){for(var t=n(this),r=s(t),o=arguments.length,a=i(o>1?arguments[1]:void 0,r),l=o>2?arguments[2]:void 0,c=void 0===l?r:i(l,r);c>a;)t[a++]=e;return t}},90235:(e,t,r)=>{"use strict";var n=r(59213).forEach,i=r(34598)("forEach");e.exports=i?[].forEach:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}},8045:(e,t,r)=>{"use strict";var n=r(76080),i=r(79504),s=r(48981),o=r(33517),a=r(1886),l=r(70081),c=r(1767),u=r(50851),h=r(55966),d=r(97751),p=r(44124),f=r(78227),m=r(24074),g=r(36639).toArray,A=f("asyncIterator"),y=i(p("Array","values")),v=i(y([]).next),x=function(){return new _(this)},_=function(e){this.iterator=y(e)};_.prototype.next=function(){return v(this.iterator)},e.exports=function(e){var t=this,r=arguments.length,i=r>1?arguments[1]:void 0,p=r>2?arguments[2]:void 0;return new(d("Promise"))((function(r){var d=s(e);void 0!==i&&(i=n(i,p));var f=h(d,A),y=f?void 0:u(d)||x,v=o(t)?new t:[],_=f?a(d,f):new m(c(l(d,y)));r(g(_,i,v))}))}},35370:(e,t,r)=>{"use strict";var n=r(26198);e.exports=function(e,t,r){for(var i=0,s=arguments.length>2?r:n(t),o=new e(s);s>i;)o[i]=t[i++];return o}},97916:(e,t,r)=>{"use strict";var n=r(76080),i=r(69565),s=r(48981),o=r(96319),a=r(44209),l=r(33517),c=r(26198),u=r(97040),h=r(70081),d=r(50851),p=Array;e.exports=function(e){var t=s(e),r=l(this),f=arguments.length,m=f>1?arguments[1]:void 0,g=void 0!==m;g&&(m=n(m,f>2?arguments[2]:void 0));var A,y,v,x,_,b,w=d(t),E=0;if(!w||this===p&&a(w))for(A=c(t),y=r?new this(A):p(A);A>E;E++)b=g?m(t[E],E):t[E],u(y,E,b);else for(y=r?new this:[],_=(x=h(t,w)).next;!(v=i(_,x)).done;E++)b=g?o(x,m,[v.value,E],!0):v.value,u(y,E,b);return y.length=E,y}},2952:(e,t,r)=>{"use strict";var n=r(76080),i=r(79504),s=r(47055),o=r(48981),a=r(26198),l=r(72248),c=l.Map,u=l.get,h=l.has,d=l.set,p=i([].push);e.exports=function(e){for(var t,r,i=o(this),l=s(i),f=n(e,arguments.length>1?arguments[1]:void 0),m=new c,g=a(l),A=0;g>A;A++)t=f(r=l[A],A,i),h(m,t)?p(u(m,t),r):d(m,t,[r]);return m}},77957:(e,t,r)=>{"use strict";var n=r(76080),i=r(79504),s=r(47055),o=r(48981),a=r(56969),l=r(26198),c=r(2360),u=r(35370),h=Array,d=i([].push);e.exports=function(e,t,r,i){for(var p,f,m,g=o(e),A=s(g),y=n(t,r),v=c(null),x=l(A),_=0;x>_;_++)m=A[_],(f=a(y(m,_,g)))in v?d(v[f],m):v[f]=[m];if(i&&(p=i(g))!==h)for(f in v)v[f]=u(p,v[f]);return v}},19617:(e,t,r)=>{"use strict";var n=r(25397),i=r(35610),s=r(26198),o=function(e){return function(t,r,o){var a=n(t),l=s(a);if(0===l)return!e&&-1;var c,u=i(o,l);if(e&&r!=r){for(;l>u;)if((c=a[u++])!=c)return!0}else for(;l>u;u++)if((e||u in a)&&a[u]===r)return e||u||0;return!e&&-1}};e.exports={includes:o(!0),indexOf:o(!1)}},43839:(e,t,r)=>{"use strict";var n=r(76080),i=r(47055),s=r(48981),o=r(26198),a=function(e){var t=1===e;return function(r,a,l){for(var c,u=s(r),h=i(u),d=o(h),p=n(a,l);d-- >0;)if(p(c=h[d],d,u))switch(e){case 0:return c;case 1:return d}return t?-1:void 0}};e.exports={findLast:a(0),findLastIndex:a(1)}},59213:(e,t,r)=>{"use strict";var n=r(76080),i=r(79504),s=r(47055),o=r(48981),a=r(26198),l=r(1469),c=i([].push),u=function(e){var t=1===e,r=2===e,i=3===e,u=4===e,h=6===e,d=7===e,p=5===e||h;return function(f,m,g,A){for(var y,v,x=o(f),_=s(x),b=a(_),w=n(m,g),E=0,M=A||l,S=t?M(f,b):r||d?M(f,0):void 0;b>E;E++)if((p||E in _)&&(v=w(y=_[E],E,x),e))if(t)S[E]=v;else if(v)switch(e){case 3:return!0;case 5:return y;case 6:return E;case 2:c(S,y)}else switch(e){case 4:return!1;case 7:c(S,y)}return h?-1:i||u?u:S}};e.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6),filterReject:u(7)}},8379:(e,t,r)=>{"use strict";var n=r(18745),i=r(25397),s=r(91291),o=r(26198),a=r(34598),l=Math.min,c=[].lastIndexOf,u=!!c&&1/[1].lastIndexOf(1,-0)<0,h=a("lastIndexOf"),d=u||!h;e.exports=d?function(e){if(u)return n(c,this,arguments)||0;var t=i(this),r=o(t);if(0===r)return-1;var a=r-1;for(arguments.length>1&&(a=l(a,s(arguments[1]))),a<0&&(a=r+a);a>=0;a--)if(a in t&&t[a]===e)return a||0;return-1}:c},70597:(e,t,r)=>{"use strict";var n=r(79039),i=r(78227),s=r(39519),o=i("species");e.exports=function(e){return s>=51||!n((function(){var t=[];return(t.constructor={})[o]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},34598:(e,t,r)=>{"use strict";var n=r(79039);e.exports=function(e,t){var r=[][e];return!!r&&n((function(){r.call(null,t||function(){return 1},1)}))}},80926:(e,t,r)=>{"use strict";var n=r(79306),i=r(48981),s=r(47055),o=r(26198),a=TypeError,l="Reduce of empty array with no initial value",c=function(e){return function(t,r,c,u){var h=i(t),d=s(h),p=o(h);if(n(r),0===p&&c<2)throw new a(l);var f=e?p-1:0,m=e?-1:1;if(c<2)for(;;){if(f in d){u=d[f],f+=m;break}if(f+=m,e?f<0:p<=f)throw new a(l)}for(;e?f>=0:p>f;f+=m)f in d&&(u=r(u,d[f],f,h));return u}};e.exports={left:c(!1),right:c(!0)}},34527:(e,t,r)=>{"use strict";var n=r(43724),i=r(34376),s=TypeError,o=Object.getOwnPropertyDescriptor,a=n&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=a?function(e,t){if(i(e)&&!o(e,"length").writable)throw new s("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},67680:(e,t,r)=>{"use strict";var n=r(79504);e.exports=n([].slice)},74488:(e,t,r)=>{"use strict";var n=r(67680),i=Math.floor,s=function(e,t){var r=e.length;if(r<8)for(var o,a,l=1;l0;)e[a]=e[--a];a!==l++&&(e[a]=o)}else for(var c=i(r/2),u=s(n(e,0,c),t),h=s(n(e,c),t),d=u.length,p=h.length,f=0,m=0;f{"use strict";var n=r(34376),i=r(33517),s=r(20034),o=r(78227)("species"),a=Array;e.exports=function(e){var t;return n(e)&&(t=e.constructor,(i(t)&&(t===a||n(t.prototype))||s(t)&&null===(t=t[o]))&&(t=void 0)),void 0===t?a:t}},1469:(e,t,r)=>{"use strict";var n=r(87433);e.exports=function(e,t){return new(n(e))(0===t?0:t)}},37628:(e,t,r)=>{"use strict";var n=r(26198);e.exports=function(e,t){for(var r=n(e),i=new t(r),s=0;s{"use strict";var n=r(79504),i=r(79306),s=r(64117),o=r(26198),a=r(48981),l=r(72248),c=r(26223),u=l.Map,h=l.has,d=l.set,p=n([].push);e.exports=function(e){var t,r,n,l=a(this),f=o(l),m=[],g=new u,A=s(e)?function(e){return e}:i(e);for(t=0;t{"use strict";var n=r(26198),i=r(91291),s=RangeError;e.exports=function(e,t,r,o){var a=n(e),l=i(r),c=l<0?a+l:l;if(c>=a||c<0)throw new s("Incorrect index");for(var u=new t(a),h=0;h{"use strict";var n=r(69565),i=r(28551),s=r(2360),o=r(55966),a=r(56279),l=r(91181),c=r(97751),u=r(53982),h=r(62529),d=c("Promise"),p="AsyncFromSyncIterator",f=l.set,m=l.getterFor(p),g=function(e,t,r){var n=e.done;d.resolve(e.value).then((function(e){t(h(e,n))}),r)},A=function(e){e.type=p,f(this,e)};A.prototype=a(s(u),{next:function(){var e=m(this);return new d((function(t,r){var s=i(n(e.next,e.iterator));g(s,t,r)}))},return:function(){var e=m(this).iterator;return new d((function(t,r){var s=o(e,"return");if(void 0===s)return t(h(void 0,!0));var a=i(n(s,e));g(a,t,r)}))}}),e.exports=A},20772:(e,t,r)=>{"use strict";var n=r(69565),i=r(97751),s=r(55966);e.exports=function(e,t,r,o){try{var a=s(e,"return");if(a)return i("Promise").resolve(n(a,e)).then((function(){t(r)}),(function(e){o(e)}))}catch(e){return o(e)}t(r)}},92059:(e,t,r)=>{"use strict";var n=r(69565),i=r(1103),s=r(28551),o=r(2360),a=r(66699),l=r(56279),c=r(78227),u=r(91181),h=r(97751),d=r(55966),p=r(53982),f=r(62529),m=r(9539),g=h("Promise"),A=c("toStringTag"),y="AsyncIteratorHelper",v="WrapForValidAsyncIterator",x=u.set,_=function(e){var t=!e,r=u.getterFor(e?v:y),a=function(e){var n=i((function(){return r(e)})),s=n.error,o=n.value;return s||t&&o.done?{exit:!0,value:s?g.reject(o):g.resolve(f(void 0,!0))}:{exit:!1,value:o}};return l(o(p),{next:function(){var e=a(this),t=e.value;if(e.exit)return t;var r=i((function(){return s(t.nextHandler(g))})),n=r.error,o=r.value;return n&&(t.done=!0),n?g.reject(o):g.resolve(o)},return:function(){var t=a(this),r=t.value;if(t.exit)return r;r.done=!0;var o,l,c=r.iterator,u=i((function(){if(r.inner)try{m(r.inner.iterator,"normal")}catch(e){return m(c,"throw",e)}return d(c,"return")}));return o=l=u.value,u.error?g.reject(l):void 0===o?g.resolve(f(void 0,!0)):(l=(u=i((function(){return n(o,c)}))).value,u.error?g.reject(l):e?g.resolve(l):g.resolve(l).then((function(e){return s(e),f(void 0,!0)})))}})},b=_(!0),w=_(!1);a(w,A,"Async Iterator Helper"),e.exports=function(e,t){var r=function(r,n){n?(n.iterator=r.iterator,n.next=r.next):n=r,n.type=t?v:y,n.nextHandler=e,n.counter=0,n.done=!1,x(this,n)};return r.prototype=t?b:w,r}},87481:(e,t,r)=>{"use strict";var n=r(69565),i=r(41750),s=function(e,t){return[t,e]};e.exports=function(){return n(i,this,s)}},36639:(e,t,r)=>{"use strict";var n=r(69565),i=r(79306),s=r(28551),o=r(20034),a=r(96837),l=r(97751),c=r(1767),u=r(20772),h=function(e){var t=0===e,r=1===e,h=2===e,d=3===e;return function(e,p,f){s(e);var m=void 0!==p;!m&&t||i(p);var g=c(e),A=l("Promise"),y=g.iterator,v=g.next,x=0;return new A((function(e,i){var l=function(e){u(y,i,e,i)},c=function(){try{if(m)try{a(x)}catch(e){l(e)}A.resolve(s(n(v,y))).then((function(n){try{if(s(n).done)t?(f.length=x,e(f)):e(!d&&(h||void 0));else{var a=n.value;try{if(m){var g=p(a,x),v=function(n){if(r)c();else if(h)n?c():u(y,e,!1,i);else if(t)try{f[x++]=n,c()}catch(e){l(e)}else n?u(y,e,d||a,i):c()};o(g)?A.resolve(g).then(v,l):v(g)}else f[x++]=a,c()}catch(e){l(e)}}}catch(e){i(e)}}),i)}catch(e){i(e)}};c()}))}};e.exports={toArray:h(0),forEach:h(1),every:h(2),some:h(3),find:h(4)}},41750:(e,t,r)=>{"use strict";var n=r(69565),i=r(79306),s=r(28551),o=r(20034),a=r(1767),l=r(92059),c=r(62529),u=r(20772),h=l((function(e){var t=this,r=t.iterator,i=t.mapper;return new e((function(a,l){var h=function(e){t.done=!0,l(e)},d=function(e){u(r,h,e,h)};e.resolve(s(n(t.next,r))).then((function(r){try{if(s(r).done)t.done=!0,a(c(void 0,!0));else{var n=r.value;try{var l=i(n,t.counter++),u=function(e){a(c(e,!1))};o(l)?e.resolve(l).then(u,d):u(l)}catch(e){d(e)}}}catch(e){h(e)}}),h)}))}));e.exports=function(e){return s(this),i(e),new h(a(this),{mapper:e})}},53982:(e,t,r)=>{"use strict";var n,i,s=r(44576),o=r(77629),a=r(94901),l=r(2360),c=r(42787),u=r(36840),h=r(78227),d=r(96395),p="USE_FUNCTION_CONSTRUCTOR",f=h("asyncIterator"),m=s.AsyncIterator,g=o.AsyncIteratorPrototype;if(g)n=g;else if(a(m))n=m.prototype;else if(o[p]||s[p])try{i=c(c(c(Function("return async function*(){}()")()))),c(i)===Object.prototype&&(n=i)}catch(e){}n?d&&(n=l(n)):n={},a(n[f])||u(n,f,(function(){return this})),e.exports=n},44690:(e,t,r)=>{"use strict";var n=r(69565),i=r(92059);e.exports=i((function(){return n(this.next,this.iterator)}),!0)},92804:e=>{"use strict";var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=t+"+/",n=t+"-_",i=function(e){for(var t={},r=0;r<64;r++)t[e.charAt(r)]=r;return t};e.exports={i2c:r,c2i:i(r),i2cUrl:n,c2iUrl:i(n)}},96319:(e,t,r)=>{"use strict";var n=r(28551),i=r(9539);e.exports=function(e,t,r,s){try{return s?t(n(r)[0],r[1]):t(r)}catch(t){i(e,"throw",t)}}},84428:(e,t,r)=>{"use strict";var n=r(78227)("iterator"),i=!1;try{var s=0,o={next:function(){return{done:!!s++}},return:function(){i=!0}};o[n]=function(){return this},Array.from(o,(function(){throw 2}))}catch(e){}e.exports=function(e,t){try{if(!t&&!i)return!1}catch(e){return!1}var r=!1;try{var s={};s[n]=function(){return{next:function(){return{done:r=!0}}}},e(s)}catch(e){}return r}},22195:(e,t,r)=>{"use strict";var n=r(79504),i=n({}.toString),s=n("".slice);e.exports=function(e){return s(i(e),8,-1)}},36955:(e,t,r)=>{"use strict";var n=r(92140),i=r(94901),s=r(22195),o=r(78227)("toStringTag"),a=Object,l="Arguments"===s(function(){return arguments}());e.exports=n?s:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=a(e),o))?r:l?s(t):"Object"===(n=s(t))&&i(t.callee)?"Arguments":n}},70933:(e,t,r)=>{"use strict";var n=r(76080),i=r(28551),s=r(48981),o=r(72652);e.exports=function(e,t,r){return function(a){var l=s(a),c=arguments.length,u=c>1?arguments[1]:void 0,h=void 0!==u,d=h?n(u,c>2?arguments[2]:void 0):void 0,p=new e,f=0;return o(l,(function(e){var n=h?d(e,f++):e;r?t(p,i(n)[0],n[1]):t(p,n)})),p}}},87500:(e,t,r)=>{"use strict";var n=r(28551);e.exports=function(e,t,r){return function(){for(var i=new e,s=arguments.length,o=0;o{"use strict";var n=r(2360),i=r(62106),s=r(56279),o=r(76080),a=r(90679),l=r(64117),c=r(72652),u=r(51088),h=r(62529),d=r(87633),p=r(43724),f=r(3451).fastKey,m=r(91181),g=m.set,A=m.getterFor;e.exports={getConstructor:function(e,t,r,u){var h=e((function(e,i){a(e,d),g(e,{type:t,index:n(null),first:null,last:null,size:0}),p||(e.size=0),l(i)||c(i,e[u],{that:e,AS_ENTRIES:r})})),d=h.prototype,m=A(t),y=function(e,t,r){var n,i,s=m(e),o=v(e,t);return o?o.value=r:(s.last=o={index:i=f(t,!0),key:t,value:r,previous:n=s.last,next:null,removed:!1},s.first||(s.first=o),n&&(n.next=o),p?s.size++:e.size++,"F"!==i&&(s.index[i]=o)),e},v=function(e,t){var r,n=m(e),i=f(t);if("F"!==i)return n.index[i];for(r=n.first;r;r=r.next)if(r.key===t)return r};return s(d,{clear:function(){for(var e=m(this),t=e.first;t;)t.removed=!0,t.previous&&(t.previous=t.previous.next=null),t=t.next;e.first=e.last=null,e.index=n(null),p?e.size=0:this.size=0},delete:function(e){var t=this,r=m(t),n=v(t,e);if(n){var i=n.next,s=n.previous;delete r.index[n.index],n.removed=!0,s&&(s.next=i),i&&(i.previous=s),r.first===n&&(r.first=i),r.last===n&&(r.last=s),p?r.size--:t.size--}return!!n},forEach:function(e){for(var t,r=m(this),n=o(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:r.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!v(this,e)}}),s(d,r?{get:function(e){var t=v(this,e);return t&&t.value},set:function(e,t){return y(this,0===e?0:e,t)}}:{add:function(e){return y(this,e=0===e?0:e,e)}}),p&&i(d,"size",{configurable:!0,get:function(){return m(this).size}}),h},setStrong:function(e,t,r){var n=t+" Iterator",i=A(t),s=A(n);u(e,t,(function(e,t){g(this,{type:n,target:e,state:i(e),kind:t,last:null})}),(function(){for(var e=s(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?h("keys"===t?r.key:"values"===t?r.value:[r.key,r.value],!1):(e.target=null,h(void 0,!0))}),r?"entries":"values",!r,!0),d(t)}}},91625:(e,t,r)=>{"use strict";var n=r(79504),i=r(56279),s=r(3451).getWeakData,o=r(90679),a=r(28551),l=r(64117),c=r(20034),u=r(72652),h=r(59213),d=r(39297),p=r(91181),f=p.set,m=p.getterFor,g=h.find,A=h.findIndex,y=n([].splice),v=0,x=function(e){return e.frozen||(e.frozen=new _)},_=function(){this.entries=[]},b=function(e,t){return g(e.entries,(function(e){return e[0]===t}))};_.prototype={get:function(e){var t=b(this,e);if(t)return t[1]},has:function(e){return!!b(this,e)},set:function(e,t){var r=b(this,e);r?r[1]=t:this.entries.push([e,t])},delete:function(e){var t=A(this.entries,(function(t){return t[0]===e}));return~t&&y(this.entries,t,1),!!~t}},e.exports={getConstructor:function(e,t,r,n){var h=e((function(e,i){o(e,p),f(e,{type:t,id:v++,frozen:null}),l(i)||u(i,e[n],{that:e,AS_ENTRIES:r})})),p=h.prototype,g=m(t),A=function(e,t,r){var n=g(e),i=s(a(t),!0);return!0===i?x(n).set(t,r):i[n.id]=r,e};return i(p,{delete:function(e){var t=g(this);if(!c(e))return!1;var r=s(e);return!0===r?x(t).delete(e):r&&d(r,t.id)&&delete r[t.id]},has:function(e){var t=g(this);if(!c(e))return!1;var r=s(e);return!0===r?x(t).has(e):r&&d(r,t.id)}}),i(p,r?{get:function(e){var t=g(this);if(c(e)){var r=s(e);if(!0===r)return x(t).get(e);if(r)return r[t.id]}},set:function(e,t){return A(this,e,t)}}:{add:function(e){return A(this,e,!0)}}),h}}},16468:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(79504),o=r(92796),a=r(36840),l=r(3451),c=r(72652),u=r(90679),h=r(94901),d=r(64117),p=r(20034),f=r(79039),m=r(84428),g=r(10687),A=r(23167);e.exports=function(e,t,r){var y=-1!==e.indexOf("Map"),v=-1!==e.indexOf("Weak"),x=y?"set":"add",_=i[e],b=_&&_.prototype,w=_,E={},M=function(e){var t=s(b[e]);a(b,e,"add"===e?function(e){return t(this,0===e?0:e),this}:"delete"===e?function(e){return!(v&&!p(e))&&t(this,0===e?0:e)}:"get"===e?function(e){return v&&!p(e)?void 0:t(this,0===e?0:e)}:"has"===e?function(e){return!(v&&!p(e))&&t(this,0===e?0:e)}:function(e,r){return t(this,0===e?0:e,r),this})};if(o(e,!h(_)||!(v||b.forEach&&!f((function(){(new _).entries().next()})))))w=r.getConstructor(t,e,y,x),l.enable();else if(o(e,!0)){var S=new w,C=S[x](v?{}:-0,1)!==S,T=f((function(){S.has(1)})),I=m((function(e){new _(e)})),R=!v&&f((function(){for(var e=new _,t=5;t--;)e[x](t,t);return!e.has(-0)}));I||((w=t((function(e,t){u(e,b);var r=A(new _,e,w);return d(t)||c(t,r[x],{that:r,AS_ENTRIES:y}),r}))).prototype=b,b.constructor=w),(T||R)&&(M("delete"),M("has"),y&&M("get")),(R||C)&&M(x),v&&b.clear&&delete b.clear}return E[e]=w,n({global:!0,constructor:!0,forced:w!==_},E),g(w,e),v||r.setStrong(w,e,y),w}},59323:(e,t,r)=>{"use strict";r(36033),r(73772);var n=r(97751),i=r(2360),s=r(20034),o=Object,a=TypeError,l=n("Map"),c=n("WeakMap"),u=function(){this.object=null,this.symbol=null,this.primitives=null,this.objectsByIndex=i(null)};u.prototype.get=function(e,t){return this[e]||(this[e]=t())},u.prototype.next=function(e,t,r){var n=r?this.objectsByIndex[e]||(this.objectsByIndex[e]=new c):this.primitives||(this.primitives=new l),i=n.get(t);return i||n.set(t,i=new u),i};var h=new u;e.exports=function(){var e,t,r=h,n=arguments.length;for(e=0;e{"use strict";var n=r(39297),i=r(35031),s=r(77347),o=r(24913);e.exports=function(e,t,r){for(var a=i(t),l=o.f,c=s.f,u=0;u{"use strict";var n=r(78227)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[n]=!1,"/./"[e](t)}catch(e){}}return!1}},12211:(e,t,r)=>{"use strict";var n=r(79039);e.exports=!n((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},77240:(e,t,r)=>{"use strict";var n=r(79504),i=r(67750),s=r(655),o=/"/g,a=n("".replace);e.exports=function(e,t,r,n){var l=s(i(e)),c="<"+t;return""!==r&&(c+=" "+r+'="'+a(s(n),o,""")+'"'),c+">"+l+""}},62529:e=>{"use strict";e.exports=function(e,t){return{value:e,done:t}}},66699:(e,t,r)=>{"use strict";var n=r(43724),i=r(24913),s=r(6980);e.exports=n?function(e,t,r){return i.f(e,t,s(1,r))}:function(e,t,r){return e[t]=r,e}},6980:e=>{"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},97040:(e,t,r)=>{"use strict";var n=r(43724),i=r(24913),s=r(6980);e.exports=function(e,t,r){n?i.f(e,t,s(0,r)):e[t]=r}},70380:(e,t,r)=>{"use strict";var n=r(79504),i=r(79039),s=r(60533).start,o=RangeError,a=isFinite,l=Math.abs,c=Date.prototype,u=c.toISOString,h=n(c.getTime),d=n(c.getUTCDate),p=n(c.getUTCFullYear),f=n(c.getUTCHours),m=n(c.getUTCMilliseconds),g=n(c.getUTCMinutes),A=n(c.getUTCMonth),y=n(c.getUTCSeconds);e.exports=i((function(){return"0385-07-25T07:06:39.999Z"!==u.call(new Date(-50000000000001))}))||!i((function(){u.call(new Date(NaN))}))?function(){if(!a(h(this)))throw new o("Invalid time value");var e=this,t=p(e),r=m(e),n=t<0?"-":t>9999?"+":"";return n+s(l(t),n?6:4,0)+"-"+s(A(e)+1,2,0)+"-"+s(d(e),2,0)+"T"+s(f(e),2,0)+":"+s(g(e),2,0)+":"+s(y(e),2,0)+"."+s(r,3,0)+"Z"}:u},53640:(e,t,r)=>{"use strict";var n=r(28551),i=r(84270),s=TypeError;e.exports=function(e){if(n(this),"string"===e||"default"===e)e="string";else if("number"!==e)throw new s("Incorrect hint");return i(this,e)}},62106:(e,t,r)=>{"use strict";var n=r(50283),i=r(24913);e.exports=function(e,t,r){return r.get&&n(r.get,t,{getter:!0}),r.set&&n(r.set,t,{setter:!0}),i.f(e,t,r)}},36840:(e,t,r)=>{"use strict";var n=r(94901),i=r(24913),s=r(50283),o=r(39433);e.exports=function(e,t,r,a){a||(a={});var l=a.enumerable,c=void 0!==a.name?a.name:t;if(n(r)&&s(r,c,a),a.global)l?e[t]=r:o(t,r);else{try{a.unsafe?e[t]&&(l=!0):delete e[t]}catch(e){}l?e[t]=r:i.f(e,t,{value:r,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return e}},56279:(e,t,r)=>{"use strict";var n=r(36840);e.exports=function(e,t,r){for(var i in t)n(e,i,t[i],r);return e}},39433:(e,t,r)=>{"use strict";var n=r(44576),i=Object.defineProperty;e.exports=function(e,t){try{i(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}},84606:(e,t,r)=>{"use strict";var n=r(16823),i=TypeError;e.exports=function(e,t){if(!delete e[t])throw new i("Cannot delete property "+n(t)+" of "+n(e))}},43724:(e,t,r)=>{"use strict";var n=r(79039);e.exports=!n((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},94483:(e,t,r)=>{"use strict";var n,i,s,o,a=r(44576),l=r(89429),c=r(1548),u=a.structuredClone,h=a.ArrayBuffer,d=a.MessageChannel,p=!1;if(c)p=function(e){u(e,{transfer:[e]})};else if(h)try{d||(n=l("worker_threads"))&&(d=n.MessageChannel),d&&(i=new d,s=new h(2),o=function(e){i.port1.postMessage(null,[e])},2===s.byteLength&&(o(s),0===s.byteLength&&(p=o)))}catch(e){}e.exports=p},4055:(e,t,r)=>{"use strict";var n=r(44576),i=r(20034),s=n.document,o=i(s)&&i(s.createElement);e.exports=function(e){return o?s.createElement(e):{}}},96837:e=>{"use strict";var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},55002:e=>{"use strict";e.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},67400:e=>{"use strict";e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},79296:(e,t,r)=>{"use strict";var n=r(4055)("span").classList,i=n&&n.constructor&&n.constructor.prototype;e.exports=i===Object.prototype?void 0:i},88727:e=>{"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},13709:(e,t,r)=>{"use strict";var n=r(82839).match(/firefox\/(\d+)/i);e.exports=!!n&&+n[1]},13763:(e,t,r)=>{"use strict";var n=r(82839);e.exports=/MSIE|Trident/.test(n)},44265:(e,t,r)=>{"use strict";var n=r(82839);e.exports=/ipad|iphone|ipod/i.test(n)&&"undefined"!=typeof Pebble},89544:(e,t,r)=>{"use strict";var n=r(82839);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},38574:(e,t,r)=>{"use strict";var n=r(84215);e.exports="NODE"===n},7860:(e,t,r)=>{"use strict";var n=r(82839);e.exports=/web0s(?!.*chrome)/i.test(n)},82839:(e,t,r)=>{"use strict";var n=r(44576).navigator,i=n&&n.userAgent;e.exports=i?String(i):""},39519:(e,t,r)=>{"use strict";var n,i,s=r(44576),o=r(82839),a=s.process,l=s.Deno,c=a&&a.versions||l&&l.version,u=c&&c.v8;u&&(i=(n=u.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!i&&o&&(!(n=o.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=o.match(/Chrome\/(\d+)/))&&(i=+n[1]),e.exports=i},3607:(e,t,r)=>{"use strict";var n=r(82839).match(/AppleWebKit\/(\d+)\./);e.exports=!!n&&+n[1]},84215:(e,t,r)=>{"use strict";var n=r(44576),i=r(82839),s=r(22195),o=function(e){return i.slice(0,e.length)===e};e.exports=o("Bun/")?"BUN":o("Cloudflare-Workers")?"CLOUDFLARE":o("Deno/")?"DENO":o("Node.js/")?"NODE":n.Bun&&"string"==typeof Bun.version?"BUN":n.Deno&&"object"==typeof Deno.version?"DENO":"process"===s(n.process)?"NODE":n.window&&n.document?"BROWSER":"REST"},16193:(e,t,r)=>{"use strict";var n=r(79504),i=Error,s=n("".replace),o=String(new i("zxcasd").stack),a=/\n\s*at [^:]*:[^\n]*/,l=a.test(o);e.exports=function(e,t){if(l&&"string"==typeof e&&!i.prepareStackTrace)for(;t--;)e=s(e,a,"");return e}},80747:(e,t,r)=>{"use strict";var n=r(66699),i=r(16193),s=r(24659),o=Error.captureStackTrace;e.exports=function(e,t,r,a){s&&(o?o(e,t):n(e,"stack",i(r,a)))}},24659:(e,t,r)=>{"use strict";var n=r(79039),i=r(6980);e.exports=!n((function(){var e=new Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",i(1,7)),7!==e.stack)}))},77536:(e,t,r)=>{"use strict";var n=r(43724),i=r(79039),s=r(28551),o=r(32603),a=Error.prototype.toString,l=i((function(){if(n){var e=Object.create(Object.defineProperty({},"name",{get:function(){return this===e}}));if("true"!==a.call(e))return!0}return"2: 1"!==a.call({message:1,name:2})||"Error"!==a.call({})}));e.exports=l?function(){var e=s(this),t=o(e.name,"Error"),r=o(e.message);return t?r?t+": "+r:t:r}:a},46518:(e,t,r)=>{"use strict";var n=r(44576),i=r(77347).f,s=r(66699),o=r(36840),a=r(39433),l=r(77740),c=r(92796);e.exports=function(e,t){var r,u,h,d,p,f=e.target,m=e.global,g=e.stat;if(r=m?n:g?n[f]||a(f,{}):n[f]&&n[f].prototype)for(u in t){if(d=t[u],h=e.dontCallGetSet?(p=i(r,u))&&p.value:r[u],!c(m?u:f+(g?".":"#")+u,e.forced)&&void 0!==h){if(typeof d==typeof h)continue;l(d,h)}(e.sham||h&&h.sham)&&s(d,"sham",!0),o(r,u,d,e)}}},79039:e=>{"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},89228:(e,t,r)=>{"use strict";r(27495);var n=r(69565),i=r(36840),s=r(57323),o=r(79039),a=r(78227),l=r(66699),c=a("species"),u=RegExp.prototype;e.exports=function(e,t,r,h){var d=a(e),p=!o((function(){var t={};return t[d]=function(){return 7},7!==""[e](t)})),f=p&&!o((function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[c]=function(){return r},r.flags="",r[d]=/./[d]),r.exec=function(){return t=!0,null},r[d](""),!t}));if(!p||!f||r){var m=/./[d],g=t(d,""[e],(function(e,t,r,i,o){var a=t.exec;return a===s||a===u.exec?p&&!o?{done:!0,value:n(m,t,r,i)}:{done:!0,value:n(e,r,t,i)}:{done:!1}}));i(String.prototype,e,g[0]),i(u,d,g[1])}h&&l(u[d],"sham",!0)}},70259:(e,t,r)=>{"use strict";var n=r(34376),i=r(26198),s=r(96837),o=r(76080),a=function(e,t,r,l,c,u,h,d){for(var p,f,m=c,g=0,A=!!h&&o(h,d);g0&&n(p)?(f=i(p),m=a(e,t,p,f,m,u-1)-1):(s(m+1),e[m]=p),m++),g++;return m};e.exports=a},92744:(e,t,r)=>{"use strict";var n=r(79039);e.exports=!n((function(){return Object.isExtensible(Object.preventExtensions({}))}))},18745:(e,t,r)=>{"use strict";var n=r(40616),i=Function.prototype,s=i.apply,o=i.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?o.bind(s):function(){return o.apply(s,arguments)})},76080:(e,t,r)=>{"use strict";var n=r(27476),i=r(79306),s=r(40616),o=n(n.bind);e.exports=function(e,t){return i(e),void 0===t?e:s?o(e,t):function(){return e.apply(t,arguments)}}},40616:(e,t,r)=>{"use strict";var n=r(79039);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},30566:(e,t,r)=>{"use strict";var n=r(79504),i=r(79306),s=r(20034),o=r(39297),a=r(67680),l=r(40616),c=Function,u=n([].concat),h=n([].join),d={};e.exports=l?c.bind:function(e){var t=i(this),r=t.prototype,n=a(arguments,1),l=function(){var r=u(n,a(arguments));return this instanceof l?function(e,t,r){if(!o(d,t)){for(var n=[],i=0;i{"use strict";var n=r(40616),i=Function.prototype.call;e.exports=n?i.bind(i):function(){return i.apply(i,arguments)}},12865:(e,t,r)=>{"use strict";var n=r(79504),i=r(79306);e.exports=function(){return n(i(this))}},10350:(e,t,r)=>{"use strict";var n=r(43724),i=r(39297),s=Function.prototype,o=n&&Object.getOwnPropertyDescriptor,a=i(s,"name"),l=a&&"something"===function(){}.name,c=a&&(!n||n&&o(s,"name").configurable);e.exports={EXISTS:a,PROPER:l,CONFIGURABLE:c}},46706:(e,t,r)=>{"use strict";var n=r(79504),i=r(79306);e.exports=function(e,t,r){try{return n(i(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}}},27476:(e,t,r)=>{"use strict";var n=r(22195),i=r(79504);e.exports=function(e){if("Function"===n(e))return i(e)}},79504:(e,t,r)=>{"use strict";var n=r(40616),i=Function.prototype,s=i.call,o=n&&i.bind.bind(s,s);e.exports=n?o:function(e){return function(){return s.apply(e,arguments)}}},944:e=>{"use strict";var t=TypeError;e.exports=function(e){var r=e&&e.alphabet;if(void 0===r||"base64"===r||"base64url"===r)return r||"base64";throw new t("Incorrect `alphabet` option")}},50133:(e,t,r)=>{"use strict";var n=r(69565),i=r(94901),s=r(28551),o=r(1767),a=r(50851),l=r(55966),c=r(78227),u=r(24074),h=c("asyncIterator");e.exports=function(e){var t,r=s(e),c=!0,d=l(r,h);return i(d)||(d=a(r),c=!1),void 0!==d?t=n(d,r):(t=r,c=!0),s(t),o(c?t:new u(o(t)))}},1886:(e,t,r)=>{"use strict";var n=r(69565),i=r(24074),s=r(28551),o=r(70081),a=r(1767),l=r(55966),c=r(78227)("asyncIterator");e.exports=function(e,t){var r=arguments.length<2?l(e,c):t;return r?s(n(r,e)):new i(a(o(e)))}},89429:(e,t,r)=>{"use strict";var n=r(44576),i=r(38574);e.exports=function(e){if(i){try{return n.process.getBuiltinModule(e)}catch(e){}try{return Function('return require("'+e+'")')()}catch(e){}}}},44124:(e,t,r)=>{"use strict";var n=r(44576);e.exports=function(e,t){var r=n[e],i=r&&r.prototype;return i&&i[t]}},97751:(e,t,r)=>{"use strict";var n=r(44576),i=r(94901);e.exports=function(e,t){return arguments.length<2?(r=n[e],i(r)?r:void 0):n[e]&&n[e][t];var r}},1767:e=>{"use strict";e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},48646:(e,t,r)=>{"use strict";var n=r(69565),i=r(28551),s=r(1767),o=r(50851);e.exports=function(e,t){t&&"string"==typeof e||i(e);var r=o(e);return s(i(void 0!==r?n(r,e):e))}},50851:(e,t,r)=>{"use strict";var n=r(36955),i=r(55966),s=r(64117),o=r(26269),a=r(78227)("iterator");e.exports=function(e){if(!s(e))return i(e,a)||i(e,"@@iterator")||o[n(e)]}},70081:(e,t,r)=>{"use strict";var n=r(69565),i=r(79306),s=r(28551),o=r(16823),a=r(50851),l=TypeError;e.exports=function(e,t){var r=arguments.length<2?a(e):t;if(i(r))return s(n(r,e));throw new l(o(e)+" is not iterable")}},66933:(e,t,r)=>{"use strict";var n=r(79504),i=r(34376),s=r(94901),o=r(22195),a=r(655),l=n([].push);e.exports=function(e){if(s(e))return e;if(i(e)){for(var t=e.length,r=[],n=0;n{"use strict";var n=r(79306),i=r(64117);e.exports=function(e,t){var r=e[t];return i(r)?void 0:n(r)}},83789:(e,t,r)=>{"use strict";var n=r(79306),i=r(28551),s=r(69565),o=r(91291),a=r(1767),l="Invalid size",c=RangeError,u=TypeError,h=Math.max,d=function(e,t){this.set=e,this.size=h(t,0),this.has=n(e.has),this.keys=n(e.keys)};d.prototype={getIterator:function(){return a(i(s(this.keys,this.set)))},includes:function(e){return s(this.has,this.set,e)}},e.exports=function(e){i(e);var t=+e.size;if(t!=t)throw new u(l);var r=o(t);if(r<0)throw new c(l);return new d(e,r)}},2478:(e,t,r)=>{"use strict";var n=r(79504),i=r(48981),s=Math.floor,o=n("".charAt),a=n("".replace),l=n("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,u=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,r,n,h,d){var p=r+e.length,f=n.length,m=u;return void 0!==h&&(h=i(h),m=c),a(d,m,(function(i,a){var c;switch(o(a,0)){case"$":return"$";case"&":return e;case"`":return l(t,0,r);case"'":return l(t,p);case"<":c=h[l(a,1,-1)];break;default:var u=+a;if(0===u)return i;if(u>f){var d=s(u/10);return 0===d?i:d<=f?void 0===n[d-1]?o(a,1):n[d-1]+o(a,1):i}c=n[u-1]}return void 0===c?"":c}))}},44576:function(e,t,r){"use strict";var n=function(e){return e&&e.Math===Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||n("object"==typeof this&&this)||function(){return this}()||Function("return this")()},39297:(e,t,r)=>{"use strict";var n=r(79504),i=r(48981),s=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return s(i(e),t)}},30421:e=>{"use strict";e.exports={}},90757:e=>{"use strict";e.exports=function(e,t){try{1===arguments.length?console.error(e):console.error(e,t)}catch(e){}}},20397:(e,t,r)=>{"use strict";var n=r(97751);e.exports=n("document","documentElement")},35917:(e,t,r)=>{"use strict";var n=r(43724),i=r(79039),s=r(4055);e.exports=!n&&!i((function(){return 7!==Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a}))},88490:e=>{"use strict";var t=Array,r=Math.abs,n=Math.pow,i=Math.floor,s=Math.log,o=Math.LN2;e.exports={pack:function(e,a,l){var c,u,h,d=t(l),p=8*l-a-1,f=(1<>1,g=23===a?n(2,-24)-n(2,-77):0,A=e<0||0===e&&1/e<0?1:0,y=0;for((e=r(e))!=e||e===1/0?(u=e!=e?1:0,c=f):(c=i(s(e)/o),e*(h=n(2,-c))<1&&(c--,h*=2),(e+=c+m>=1?g/h:g*n(2,1-m))*h>=2&&(c++,h/=2),c+m>=f?(u=0,c=f):c+m>=1?(u=(e*h-1)*n(2,a),c+=m):(u=e*n(2,m-1)*n(2,a),c=0));a>=8;)d[y++]=255&u,u/=256,a-=8;for(c=c<0;)d[y++]=255&c,c/=256,p-=8;return d[y-1]|=128*A,d},unpack:function(e,t){var r,i=e.length,s=8*i-t-1,o=(1<>1,l=s-7,c=i-1,u=e[c--],h=127&u;for(u>>=7;l>0;)h=256*h+e[c--],l-=8;for(r=h&(1<<-l)-1,h>>=-l,l+=t;l>0;)r=256*r+e[c--],l-=8;if(0===h)h=1-a;else{if(h===o)return r?NaN:u?-1/0:1/0;r+=n(2,t),h-=a}return(u?-1:1)*r*n(2,h-t)}}},47055:(e,t,r)=>{"use strict";var n=r(79504),i=r(79039),s=r(22195),o=Object,a=n("".split);e.exports=i((function(){return!o("z").propertyIsEnumerable(0)}))?function(e){return"String"===s(e)?a(e,""):o(e)}:o},23167:(e,t,r)=>{"use strict";var n=r(94901),i=r(20034),s=r(52967);e.exports=function(e,t,r){var o,a;return s&&n(o=t.constructor)&&o!==r&&i(a=o.prototype)&&a!==r.prototype&&s(e,a),e}},33706:(e,t,r)=>{"use strict";var n=r(79504),i=r(94901),s=r(77629),o=n(Function.toString);i(s.inspectSource)||(s.inspectSource=function(e){return o(e)}),e.exports=s.inspectSource},77584:(e,t,r)=>{"use strict";var n=r(20034),i=r(66699);e.exports=function(e,t){n(t)&&"cause"in t&&i(e,"cause",t.cause)}},3451:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(30421),o=r(20034),a=r(39297),l=r(24913).f,c=r(38480),u=r(10298),h=r(34124),d=r(33392),p=r(92744),f=!1,m=d("meta"),g=0,A=function(e){l(e,m,{value:{objectID:"O"+g++,weakData:{}}})},y=e.exports={enable:function(){y.enable=function(){},f=!0;var e=c.f,t=i([].splice),r={};r[m]=1,e(r).length&&(c.f=function(r){for(var n=e(r),i=0,s=n.length;i{"use strict";var n,i,s,o=r(58622),a=r(44576),l=r(20034),c=r(66699),u=r(39297),h=r(77629),d=r(66119),p=r(30421),f="Object already initialized",m=a.TypeError,g=a.WeakMap;if(o||h.state){var A=h.state||(h.state=new g);A.get=A.get,A.has=A.has,A.set=A.set,n=function(e,t){if(A.has(e))throw new m(f);return t.facade=e,A.set(e,t),t},i=function(e){return A.get(e)||{}},s=function(e){return A.has(e)}}else{var y=d("state");p[y]=!0,n=function(e,t){if(u(e,y))throw new m(f);return t.facade=e,c(e,y,t),t},i=function(e){return u(e,y)?e[y]:{}},s=function(e){return u(e,y)}}e.exports={set:n,get:i,has:s,enforce:function(e){return s(e)?i(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!l(t)||(r=i(t)).type!==e)throw new m("Incompatible receiver, "+e+" required");return r}}}},44209:(e,t,r)=>{"use strict";var n=r(78227),i=r(26269),s=n("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||o[s]===e)}},34376:(e,t,r)=>{"use strict";var n=r(22195);e.exports=Array.isArray||function(e){return"Array"===n(e)}},18727:(e,t,r)=>{"use strict";var n=r(36955);e.exports=function(e){var t=n(e);return"BigInt64Array"===t||"BigUint64Array"===t}},94901:e=>{"use strict";var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},33517:(e,t,r)=>{"use strict";var n=r(79504),i=r(79039),s=r(94901),o=r(36955),a=r(97751),l=r(33706),c=function(){},u=a("Reflect","construct"),h=/^\s*(?:class|function)\b/,d=n(h.exec),p=!h.test(c),f=function(e){if(!s(e))return!1;try{return u(c,[],e),!0}catch(e){return!1}},m=function(e){if(!s(e))return!1;switch(o(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return p||!!d(h,l(e))}catch(e){return!0}};m.sham=!0,e.exports=!u||i((function(){var e;return f(f.call)||!f(Object)||!f((function(){e=!0}))||e}))?m:f},16575:(e,t,r)=>{"use strict";var n=r(39297);e.exports=function(e){return void 0!==e&&(n(e,"value")||n(e,"writable"))}},92796:(e,t,r)=>{"use strict";var n=r(79039),i=r(94901),s=/#|\.prototype\./,o=function(e,t){var r=l[a(e)];return r===u||r!==c&&(i(t)?n(t):!!t)},a=o.normalize=function(e){return String(e).replace(s,".").toLowerCase()},l=o.data={},c=o.NATIVE="N",u=o.POLYFILL="P";e.exports=o},2087:(e,t,r)=>{"use strict";var n=r(20034),i=Math.floor;e.exports=Number.isInteger||function(e){return!n(e)&&isFinite(e)&&i(e)===e}},31563:(e,t,r)=>{"use strict";var n=r(36955),i=r(39297),s=r(64117),o=r(78227),a=r(26269),l=o("iterator"),c=Object;e.exports=function(e){if(s(e))return!1;var t=c(e);return void 0!==t[l]||"@@iterator"in t||i(a,n(t))}},64117:e=>{"use strict";e.exports=function(e){return null==e}},20034:(e,t,r)=>{"use strict";var n=r(94901);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},13925:(e,t,r)=>{"use strict";var n=r(20034);e.exports=function(e){return n(e)||null===e}},96395:e=>{"use strict";e.exports=!1},65810:(e,t,r)=>{"use strict";var n=r(20034),i=r(91181).get;e.exports=function(e){if(!n(e))return!1;var t=i(e);return!!t&&"RawJSON"===t.type}},60788:(e,t,r)=>{"use strict";var n=r(20034),i=r(22195),s=r(78227)("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[s])?!!t:"RegExp"===i(e))}},10757:(e,t,r)=>{"use strict";var n=r(97751),i=r(94901),s=r(1625),o=r(7040),a=Object;e.exports=o?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return i(t)&&s(t.prototype,a(e))}},40507:(e,t,r)=>{"use strict";var n=r(69565);e.exports=function(e,t,r){for(var i,s,o=r?e:e.iterator,a=e.next;!(i=n(a,o)).done;)if(void 0!==(s=t(i.value)))return s}},72652:(e,t,r)=>{"use strict";var n=r(76080),i=r(69565),s=r(28551),o=r(16823),a=r(44209),l=r(26198),c=r(1625),u=r(70081),h=r(50851),d=r(9539),p=TypeError,f=function(e,t){this.stopped=e,this.result=t},m=f.prototype;e.exports=function(e,t,r){var g,A,y,v,x,_,b,w=r&&r.that,E=!(!r||!r.AS_ENTRIES),M=!(!r||!r.IS_RECORD),S=!(!r||!r.IS_ITERATOR),C=!(!r||!r.INTERRUPTED),T=n(t,w),I=function(e){return g&&d(g,"normal",e),new f(!0,e)},R=function(e){return E?(s(e),C?T(e[0],e[1],I):T(e[0],e[1])):C?T(e,I):T(e)};if(M)g=e.iterator;else if(S)g=e;else{if(!(A=h(e)))throw new p(o(e)+" is not iterable");if(a(A)){for(y=0,v=l(e);v>y;y++)if((x=R(e[y]))&&c(m,x))return x;return new f(!1)}g=u(e,A)}for(_=M?e.next:g.next;!(b=i(_,g)).done;){try{x=R(b.value)}catch(e){d(g,"throw",e)}if("object"==typeof x&&x&&c(m,x))return x}return new f(!1)}},9539:(e,t,r)=>{"use strict";var n=r(69565),i=r(28551),s=r(55966);e.exports=function(e,t,r){var o,a;i(e);try{if(!(o=s(e,"return"))){if("throw"===t)throw r;return r}o=n(o,e)}catch(e){a=!0,o=e}if("throw"===t)throw r;if(a)throw o;return i(o),r}},33994:(e,t,r)=>{"use strict";var n=r(57657).IteratorPrototype,i=r(2360),s=r(6980),o=r(10687),a=r(26269),l=function(){return this};e.exports=function(e,t,r,c){var u=t+" Iterator";return e.prototype=i(n,{next:s(+!c,r)}),o(e,u,!1,!0),a[u]=l,e}},19462:(e,t,r)=>{"use strict";var n=r(69565),i=r(2360),s=r(66699),o=r(56279),a=r(78227),l=r(91181),c=r(55966),u=r(57657).IteratorPrototype,h=r(62529),d=r(9539),p=a("toStringTag"),f="IteratorHelper",m="WrapForValidIterator",g=l.set,A=function(e){var t=l.getterFor(e?m:f);return o(i(u),{next:function(){var r=t(this);if(e)return r.nextHandler();try{var n=r.done?void 0:r.nextHandler();return h(n,r.done)}catch(e){throw r.done=!0,e}},return:function(){var r=t(this),i=r.iterator;if(r.done=!0,e){var s=c(i,"return");return s?n(s,i):h(void 0,!0)}if(r.inner)try{d(r.inner.iterator,"normal")}catch(e){return d(i,"throw",e)}return d(i,"normal"),h(void 0,!0)}})},y=A(!0),v=A(!1);s(v,p,"Iterator Helper"),e.exports=function(e,t){var r=function(r,n){n?(n.iterator=r.iterator,n.next=r.next):n=r,n.type=t?m:f,n.nextHandler=e,n.counter=0,n.done=!1,g(this,n)};return r.prototype=t?y:v,r}},51088:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(96395),o=r(10350),a=r(94901),l=r(33994),c=r(42787),u=r(52967),h=r(10687),d=r(66699),p=r(36840),f=r(78227),m=r(26269),g=r(57657),A=o.PROPER,y=o.CONFIGURABLE,v=g.IteratorPrototype,x=g.BUGGY_SAFARI_ITERATORS,_=f("iterator"),b="keys",w="values",E="entries",M=function(){return this};e.exports=function(e,t,r,o,f,g,S){l(r,t,o);var C,T,I,R=function(e){if(e===f&&O)return O;if(!x&&e&&e in L)return L[e];switch(e){case b:case w:case E:return function(){return new r(this,e)}}return function(){return new r(this)}},B=t+" Iterator",P=!1,L=e.prototype,D=L[_]||L["@@iterator"]||f&&L[f],O=!x&&D||R(f),N="Array"===t&&L.entries||D;if(N&&(C=c(N.call(new e)))!==Object.prototype&&C.next&&(s||c(C)===v||(u?u(C,v):a(C[_])||p(C,_,M)),h(C,B,!0,!0),s&&(m[B]=M)),A&&f===w&&D&&D.name!==w&&(!s&&y?d(L,"name",w):(P=!0,O=function(){return i(D,this)})),f)if(T={values:R(w),keys:g?O:R(b),entries:R(E)},S)for(I in T)(x||P||!(I in L))&&p(L,I,T[I]);else n({target:t,proto:!0,forced:x||P},T);return s&&!S||L[_]===O||p(L,_,O,{name:f}),m[t]=O,T}},47958:(e,t,r)=>{"use strict";var n=r(69565),i=r(20713),s=function(e,t){return[t,e]};e.exports=function(){return n(i,this,s)}},20713:(e,t,r)=>{"use strict";var n=r(69565),i=r(79306),s=r(28551),o=r(1767),a=r(19462),l=r(96319),c=a((function(){var e=this.iterator,t=s(n(this.next,e));if(!(this.done=!!t.done))return l(e,this.mapper,[t.value,this.counter++],!0)}));e.exports=function(e){return s(this),i(e),new c(o(this),{mapper:e})}},57657:(e,t,r)=>{"use strict";var n,i,s,o=r(79039),a=r(94901),l=r(20034),c=r(2360),u=r(42787),h=r(36840),d=r(78227),p=r(96395),f=d("iterator"),m=!1;[].keys&&("next"in(s=[].keys())?(i=u(u(s)))!==Object.prototype&&(n=i):m=!0),!l(n)||o((function(){var e={};return n[f].call(e)!==e}))?n={}:p&&(n=c(n)),a(n[f])||h(n,f,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:m}},26269:e=>{"use strict";e.exports={}},26198:(e,t,r)=>{"use strict";var n=r(18014);e.exports=function(e){return n(e.length)}},50283:(e,t,r)=>{"use strict";var n=r(79504),i=r(79039),s=r(94901),o=r(39297),a=r(43724),l=r(10350).CONFIGURABLE,c=r(33706),u=r(91181),h=u.enforce,d=u.get,p=String,f=Object.defineProperty,m=n("".slice),g=n("".replace),A=n([].join),y=a&&!i((function(){return 8!==f((function(){}),"length",{value:8}).length})),v=String(String).split("String"),x=e.exports=function(e,t,r){"Symbol("===m(p(t),0,7)&&(t="["+g(p(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!o(e,"name")||l&&e.name!==t)&&(a?f(e,"name",{value:t,configurable:!0}):e.name=t),y&&r&&o(r,"arity")&&e.length!==r.arity&&f(e,"length",{value:r.arity});try{r&&o(r,"constructor")&&r.constructor?a&&f(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=h(e);return o(n,"source")||(n.source=A(v,"string"==typeof t?t:"")),e};Function.prototype.toString=x((function(){return s(this)&&d(this).source||c(this)}),"toString")},72248:(e,t,r)=>{"use strict";var n=r(79504),i=Map.prototype;e.exports={Map,set:n(i.set),get:n(i.get),has:n(i.has),remove:n(i.delete),proto:i}},26223:(e,t,r)=>{"use strict";var n=r(79504),i=r(40507),s=r(72248),o=s.Map,a=s.proto,l=n(a.forEach),c=n(a.entries),u=c(new o).next;e.exports=function(e,t,r){return r?i({iterator:c(e),next:u},(function(e){return t(e[1],e[0])})):l(e,t)}},162:(e,t,r)=>{"use strict";var n=r(69565),i=r(79306),s=r(94901),o=r(28551),a=TypeError;e.exports=function(e,t){var r,l=o(this),c=i(l.get),u=i(l.has),h=i(l.set),d=arguments.length>2?arguments[2]:void 0;if(!s(t)&&!s(d))throw new a("At least one callback required");return n(u,l,e)?(r=n(c,l,e),s(t)&&(r=t(r),n(h,l,e,r))):s(d)&&(r=d(),n(h,l,e,r)),r}},53250:e=>{"use strict";var t=Math.expm1,r=Math.exp;e.exports=!t||t(10)>22025.465794806718||t(10)<22025.465794806718||-2e-17!==t(-2e-17)?function(e){var t=+e;return 0===t?t:t>-1e-6&&t<1e-6?t+t*t/2:r(t)-1}:t},62724:(e,t,r)=>{"use strict";var n=r(33164);e.exports=Math.f16round||function(e){return n(e,.0009765625,65504,6103515625e-14)}},33164:(e,t,r)=>{"use strict";var n=r(77782),i=Math.abs,s=2220446049250313e-31,o=1/s;e.exports=function(e,t,r,a){var l=+e,c=i(l),u=n(l);if(cr||d!=d?u*(1/0):u*d}},15617:(e,t,r)=>{"use strict";var n=r(33164);e.exports=Math.fround||function(e){return n(e,1.1920928955078125e-7,34028234663852886e22,11754943508222875e-54)}},49340:e=>{"use strict";var t=Math.log,r=Math.LOG10E;e.exports=Math.log10||function(e){return t(e)*r}},7740:e=>{"use strict";var t=Math.log;e.exports=Math.log1p||function(e){var r=+e;return r>-1e-8&&r<1e-8?r-r*r/2:t(1+r)}},77905:e=>{"use strict";e.exports=Math.scale||function(e,t,r,n,i){var s=+e,o=+t,a=+r,l=+n,c=+i;return s!=s||o!=o||a!=a||l!=l||c!=c?NaN:s===1/0||s===-1/0?s:(s-o)*(c-l)/(a-o)+l}},77782:e=>{"use strict";e.exports=Math.sign||function(e){var t=+e;return 0===t||t!=t?t:t<0?-1:1}},80741:e=>{"use strict";var t=Math.ceil,r=Math.floor;e.exports=Math.trunc||function(e){var n=+e;return(n>0?r:t)(n)}},91955:(e,t,r)=>{"use strict";var n,i,s,o,a,l=r(44576),c=r(93389),u=r(76080),h=r(59225).set,d=r(18265),p=r(89544),f=r(44265),m=r(7860),g=r(38574),A=l.MutationObserver||l.WebKitMutationObserver,y=l.document,v=l.process,x=l.Promise,_=c("queueMicrotask");if(!_){var b=new d,w=function(){var e,t;for(g&&(e=v.domain)&&e.exit();t=b.get();)try{t()}catch(e){throw b.head&&n(),e}e&&e.enter()};p||g||m||!A||!y?!f&&x&&x.resolve?((o=x.resolve(void 0)).constructor=x,a=u(o.then,o),n=function(){a(w)}):g?n=function(){v.nextTick(w)}:(h=u(h,l),n=function(){h(w)}):(i=!0,s=y.createTextNode(""),new A(w).observe(s,{characterData:!0}),n=function(){s.data=i=!i}),_=function(e){b.head||n(),b.add(e)}}e.exports=_},27819:(e,t,r)=>{"use strict";var n=r(79039);e.exports=!n((function(){var e="9007199254740993",t=JSON.rawJSON(e);return!JSON.isRawJSON(t)||JSON.stringify(t)!==e}))},36043:(e,t,r)=>{"use strict";var n=r(79306),i=TypeError,s=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw new i("Bad Promise constructor");t=e,r=n})),this.resolve=n(t),this.reject=n(r)};e.exports.f=function(e){return new s(e)}},32603:(e,t,r)=>{"use strict";var n=r(655);e.exports=function(e,t){return void 0===e?arguments.length<2?"":t:n(e)}},24149:e=>{"use strict";var t=RangeError;e.exports=function(e){if(e==e)return e;throw new t("NaN is not allowed")}},60511:(e,t,r)=>{"use strict";var n=r(60788),i=TypeError;e.exports=function(e){if(n(e))throw new i("The method doesn't accept regular expressions");return e}},50360:(e,t,r)=>{"use strict";var n=r(44576).isFinite;e.exports=Number.isFinite||function(e){return"number"==typeof e&&n(e)}},33904:(e,t,r)=>{"use strict";var n=r(44576),i=r(79039),s=r(79504),o=r(655),a=r(43802).trim,l=r(47452),c=s("".charAt),u=n.parseFloat,h=n.Symbol,d=h&&h.iterator,p=1/u(l+"-0")!=-1/0||d&&!i((function(){u(Object(d))}));e.exports=p?function(e){var t=a(o(e)),r=u(t);return 0===r&&"-"===c(t,0)?-0:r}:u},52703:(e,t,r)=>{"use strict";var n=r(44576),i=r(79039),s=r(79504),o=r(655),a=r(43802).trim,l=r(47452),c=n.parseInt,u=n.Symbol,h=u&&u.iterator,d=/^[+-]?0x/i,p=s(d.exec),f=8!==c(l+"08")||22!==c(l+"0x16")||h&&!i((function(){c(Object(h))}));e.exports=f?function(e,t){var r=a(o(e));return c(r,t>>>0||(p(d,r)?16:10))}:c},14468:(e,t,r)=>{"use strict";var n=r(91181),i=r(33994),s=r(62529),o=r(64117),a=r(20034),l=r(62106),c=r(43724),u="Incorrect Iterator.range arguments",h="NumericRangeIterator",d=n.set,p=n.getterFor(h),f=RangeError,m=TypeError,g=i((function(e,t,r,n,i,s){if(typeof e!=n||t!==1/0&&t!==-1/0&&typeof t!=n)throw new m(u);if(e===1/0||e===-1/0)throw new f(u);var l,p=t>e,g=!1;if(void 0===r)l=void 0;else if(a(r))l=r.step,g=!!r.inclusive;else{if(typeof r!=n)throw new m(u);l=r}if(o(l)&&(l=p?s:-s),typeof l!=n)throw new m(u);if(l===1/0||l===-1/0||l===i&&e!==t)throw new f(u);d(this,{type:h,start:e,end:t,step:l,inclusive:g,hitsEnd:e!=e||t!=t||l!=l||t>e!=l>i,currentCount:i,zero:i}),c||(this.start=e,this.end=t,this.step=l,this.inclusive=g)}),h,(function(){var e=p(this);if(e.hitsEnd)return s(void 0,!0);var t=e.start,r=e.end,n=t+e.step*e.currentCount++;n===r&&(e.hitsEnd=!0);var i=e.inclusive;return(r>t?i?n>r:n>=r:i?r>n:r>=n)?(e.hitsEnd=!0,s(void 0,!0)):s(n,!1)})),A=function(e){l(g.prototype,e,{get:function(){return p(this)[e]},set:function(){},configurable:!0,enumerable:!1})};c&&(A("start"),A("end"),A("inclusive"),A("step")),e.exports=g},44213:(e,t,r)=>{"use strict";var n=r(43724),i=r(79504),s=r(69565),o=r(79039),a=r(71072),l=r(33717),c=r(48773),u=r(48981),h=r(47055),d=Object.assign,p=Object.defineProperty,f=i([].concat);e.exports=!d||o((function(){if(n&&1!==d({b:1},d(p({},"a",{enumerable:!0,get:function(){p(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol("assign detection"),i="abcdefghijklmnopqrst";return e[r]=7,i.split("").forEach((function(e){t[e]=e})),7!==d({},e)[r]||a(d({},t)).join("")!==i}))?function(e,t){for(var r=u(e),i=arguments.length,o=1,d=l.f,p=c.f;i>o;)for(var m,g=h(arguments[o++]),A=d?f(a(g),d(g)):a(g),y=A.length,v=0;y>v;)m=A[v++],n&&!s(p,g,m)||(r[m]=g[m]);return r}:d},2360:(e,t,r)=>{"use strict";var n,i=r(28551),s=r(96801),o=r(88727),a=r(30421),l=r(20397),c=r(4055),u=r(66119),h="prototype",d="script",p=u("IE_PROTO"),f=function(){},m=function(e){return"<"+d+">"+e+""},g=function(e){e.write(m("")),e.close();var t=e.parentWindow.Object;return e=null,t},A=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t,r;A="undefined"!=typeof document?document.domain&&n?g(n):(t=c("iframe"),r="java"+d+":",t.style.display="none",l.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(m("document.F=Object")),e.close(),e.F):g(n);for(var i=o.length;i--;)delete A[h][o[i]];return A()};a[p]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(f[h]=i(e),r=new f,f[h]=null,r[p]=e):r=A(),void 0===t?r:s.f(r,t)}},96801:(e,t,r)=>{"use strict";var n=r(43724),i=r(48686),s=r(24913),o=r(28551),a=r(25397),l=r(71072);t.f=n&&!i?Object.defineProperties:function(e,t){o(e);for(var r,n=a(t),i=l(t),c=i.length,u=0;c>u;)s.f(e,r=i[u++],n[r]);return e}},24913:(e,t,r)=>{"use strict";var n=r(43724),i=r(35917),s=r(48686),o=r(28551),a=r(56969),l=TypeError,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,h="enumerable",d="configurable",p="writable";t.f=n?s?function(e,t,r){if(o(e),t=a(t),o(r),"function"==typeof e&&"prototype"===t&&"value"in r&&p in r&&!r[p]){var n=u(e,t);n&&n[p]&&(e[t]=r.value,r={configurable:d in r?r[d]:n[d],enumerable:h in r?r[h]:n[h],writable:!1})}return c(e,t,r)}:c:function(e,t,r){if(o(e),t=a(t),o(r),i)try{return c(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new l("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},77347:(e,t,r)=>{"use strict";var n=r(43724),i=r(69565),s=r(48773),o=r(6980),a=r(25397),l=r(56969),c=r(39297),u=r(35917),h=Object.getOwnPropertyDescriptor;t.f=n?h:function(e,t){if(e=a(e),t=l(t),u)try{return h(e,t)}catch(e){}if(c(e,t))return o(!i(s.f,e,t),e[t])}},10298:(e,t,r)=>{"use strict";var n=r(22195),i=r(25397),s=r(38480).f,o=r(67680),a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"Window"===n(e)?function(e){try{return s(e)}catch(e){return o(a)}}(e):s(i(e))}},38480:(e,t,r)=>{"use strict";var n=r(61828),i=r(88727).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,i)}},33717:(e,t)=>{"use strict";t.f=Object.getOwnPropertySymbols},42787:(e,t,r)=>{"use strict";var n=r(39297),i=r(94901),s=r(48981),o=r(66119),a=r(12211),l=o("IE_PROTO"),c=Object,u=c.prototype;e.exports=a?c.getPrototypeOf:function(e){var t=s(e);if(n(t,l))return t[l];var r=t.constructor;return i(r)&&t instanceof r?r.prototype:t instanceof c?u:null}},34124:(e,t,r)=>{"use strict";var n=r(79039),i=r(20034),s=r(22195),o=r(15652),a=Object.isExtensible,l=n((function(){a(1)}));e.exports=l||o?function(e){return!!i(e)&&(!o||"ArrayBuffer"!==s(e))&&(!a||a(e))}:a},1625:(e,t,r)=>{"use strict";var n=r(79504);e.exports=n({}.isPrototypeOf)},91354:(e,t,r)=>{"use strict";var n=r(91181),i=r(33994),s=r(62529),o=r(39297),a=r(71072),l=r(48981),c="Object Iterator",u=n.set,h=n.getterFor(c);e.exports=i((function(e,t){var r=l(e);u(this,{type:c,mode:t,object:r,keys:a(r),index:0})}),"Object",(function(){for(var e=h(this),t=e.keys;;){if(null===t||e.index>=t.length)return e.object=e.keys=null,s(void 0,!0);var r=t[e.index++],n=e.object;if(o(n,r)){switch(e.mode){case"keys":return s(r,!1);case"values":return s(n[r],!1)}return s([r,n[r]],!1)}}}))},61828:(e,t,r)=>{"use strict";var n=r(79504),i=r(39297),s=r(25397),o=r(19617).indexOf,a=r(30421),l=n([].push);e.exports=function(e,t){var r,n=s(e),c=0,u=[];for(r in n)!i(a,r)&&i(n,r)&&l(u,r);for(;t.length>c;)i(n,r=t[c++])&&(~o(u,r)||l(u,r));return u}},71072:(e,t,r)=>{"use strict";var n=r(61828),i=r(88727);e.exports=Object.keys||function(e){return n(e,i)}},48773:(e,t)=>{"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,i=n&&!r.call({1:2},1);t.f=i?function(e){var t=n(this,e);return!!t&&t.enumerable}:r},42551:(e,t,r)=>{"use strict";var n=r(96395),i=r(44576),s=r(79039),o=r(3607);e.exports=n||!s((function(){if(!(o&&o<535)){var e=Math.random();__defineSetter__.call(null,e,(function(){})),delete i[e]}}))},52967:(e,t,r)=>{"use strict";var n=r(46706),i=r(20034),s=r(67750),o=r(73506);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=n(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return s(r),o(n),i(r)?(t?e(r,n):r.__proto__=n,r):r}}():void 0)},32357:(e,t,r)=>{"use strict";var n=r(43724),i=r(79039),s=r(79504),o=r(42787),a=r(71072),l=r(25397),c=s(r(48773).f),u=s([].push),h=n&&i((function(){var e=Object.create(null);return e[2]=2,!c(e,2)})),d=function(e){return function(t){for(var r,i=l(t),s=a(i),d=h&&null===o(i),p=s.length,f=0,m=[];p>f;)r=s[f++],n&&!(d?r in i:c(i,r))||u(m,e?[r,i[r]]:i[r]);return m}};e.exports={entries:d(!0),values:d(!1)}},53179:(e,t,r)=>{"use strict";var n=r(92140),i=r(36955);e.exports=n?{}.toString:function(){return"[object "+i(this)+"]"}},84270:(e,t,r)=>{"use strict";var n=r(69565),i=r(94901),s=r(20034),o=TypeError;e.exports=function(e,t){var r,a;if("string"===t&&i(r=e.toString)&&!s(a=n(r,e)))return a;if(i(r=e.valueOf)&&!s(a=n(r,e)))return a;if("string"!==t&&i(r=e.toString)&&!s(a=n(r,e)))return a;throw new o("Can't convert object to primitive value")}},35031:(e,t,r)=>{"use strict";var n=r(97751),i=r(79504),s=r(38480),o=r(33717),a=r(28551),l=i([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=s.f(a(e)),r=o.f;return r?l(t,r(e)):t}},616:(e,t,r)=>{"use strict";var n=r(79504),i=r(39297),s=SyntaxError,o=parseInt,a=String.fromCharCode,l=n("".charAt),c=n("".slice),u=n(/./.exec),h={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":"\n","\\r":"\r","\\t":"\t"},d=/^[\da-f]{4}$/i,p=/^[\u0000-\u001F]$/;e.exports=function(e,t){for(var r=!0,n="";t{"use strict";var n=r(44576);e.exports=n},1103:e=>{"use strict";e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},10916:(e,t,r)=>{"use strict";var n=r(44576),i=r(80550),s=r(94901),o=r(92796),a=r(33706),l=r(78227),c=r(84215),u=r(96395),h=r(39519),d=i&&i.prototype,p=l("species"),f=!1,m=s(n.PromiseRejectionEvent),g=o("Promise",(function(){var e=a(i),t=e!==String(i);if(!t&&66===h)return!0;if(u&&(!d.catch||!d.finally))return!0;if(!h||h<51||!/native code/.test(e)){var r=new i((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};if((r.constructor={})[p]=n,!(f=r.then((function(){}))instanceof n))return!0}return!(t||"BROWSER"!==c&&"DENO"!==c||m)}));e.exports={CONSTRUCTOR:g,REJECTION_EVENT:m,SUBCLASSING:f}},80550:(e,t,r)=>{"use strict";var n=r(44576);e.exports=n.Promise},93438:(e,t,r)=>{"use strict";var n=r(28551),i=r(20034),s=r(36043);e.exports=function(e,t){if(n(e),i(t)&&t.constructor===e)return t;var r=s.f(e);return(0,r.resolve)(t),r.promise}},90537:(e,t,r)=>{"use strict";var n=r(80550),i=r(84428),s=r(10916).CONSTRUCTOR;e.exports=s||!i((function(e){n.all(e).then(void 0,(function(){}))}))},11056:(e,t,r)=>{"use strict";var n=r(24913).f;e.exports=function(e,t,r){r in e||n(e,r,{configurable:!0,get:function(){return t[r]},set:function(e){t[r]=e}})}},18265:e=>{"use strict";var t=function(){this.head=null,this.tail=null};t.prototype={add:function(e){var t={item:e,next:null},r=this.tail;r?r.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}},e.exports=t},18449:(e,t,r)=>{"use strict";r(36033),r(73772);var n=r(97751),i=r(79504),s=r(25745),o=n("Map"),a=n("WeakMap"),l=i([].push),c=s("metadata"),u=c.store||(c.store=new a),h=function(e,t,r){var n=u.get(e);if(!n){if(!r)return;u.set(e,n=new o)}var i=n.get(t);if(!i){if(!r)return;n.set(t,i=new o)}return i};e.exports={store:u,getMap:h,has:function(e,t,r){var n=h(t,r,!1);return void 0!==n&&n.has(e)},get:function(e,t,r){var n=h(t,r,!1);return void 0===n?void 0:n.get(e)},set:function(e,t,r,n){h(r,n,!0).set(e,t)},keys:function(e,t){var r=h(e,t,!1),n=[];return r&&r.forEach((function(e,t){l(n,t)})),n},toKey:function(e){return void 0===e||"symbol"==typeof e?e:String(e)}}},56682:(e,t,r)=>{"use strict";var n=r(69565),i=r(28551),s=r(94901),o=r(22195),a=r(57323),l=TypeError;e.exports=function(e,t){var r=e.exec;if(s(r)){var c=n(r,e,t);return null!==c&&i(c),c}if("RegExp"===o(e))return n(a,e,t);throw new l("RegExp#exec called on incompatible receiver")}},57323:(e,t,r)=>{"use strict";var n,i,s=r(69565),o=r(79504),a=r(655),l=r(67979),c=r(58429),u=r(25745),h=r(2360),d=r(91181).get,p=r(83635),f=r(18814),m=u("native-string-replace",String.prototype.replace),g=RegExp.prototype.exec,A=g,y=o("".charAt),v=o("".indexOf),x=o("".replace),_=o("".slice),b=(i=/b*/g,s(g,n=/a/,"a"),s(g,i,"a"),0!==n.lastIndex||0!==i.lastIndex),w=c.BROKEN_CARET,E=void 0!==/()??/.exec("")[1];(b||E||w||p||f)&&(A=function(e){var t,r,n,i,o,c,u,p=this,f=d(p),M=a(e),S=f.raw;if(S)return S.lastIndex=p.lastIndex,t=s(A,S,M),p.lastIndex=S.lastIndex,t;var C=f.groups,T=w&&p.sticky,I=s(l,p),R=p.source,B=0,P=M;if(T&&(I=x(I,"y",""),-1===v(I,"g")&&(I+="g"),P=_(M,p.lastIndex),p.lastIndex>0&&(!p.multiline||p.multiline&&"\n"!==y(M,p.lastIndex-1))&&(R="(?: "+R+")",P=" "+P,B++),r=new RegExp("^(?:"+R+")",I)),E&&(r=new RegExp("^"+R+"$(?!\\s)",I)),b&&(n=p.lastIndex),i=s(g,T?r:p,P),T?i?(i.input=_(i.input,B),i[0]=_(i[0],B),i.index=p.lastIndex,p.lastIndex+=i[0].length):p.lastIndex=0:b&&i&&(p.lastIndex=p.global?i.index+i[0].length:n),E&&i&&i.length>1&&s(m,i[0],r,(function(){for(o=1;o{"use strict";var n=r(28551);e.exports=function(){var e=n(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},61034:(e,t,r)=>{"use strict";var n=r(69565),i=r(39297),s=r(1625),o=r(67979),a=RegExp.prototype;e.exports=function(e){var t=e.flags;return void 0!==t||"flags"in a||i(e,"flags")||!s(a,e)?t:n(o,e)}},58429:(e,t,r)=>{"use strict";var n=r(79039),i=r(44576).RegExp,s=n((function(){var e=i("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),o=s||n((function(){return!i("a","y").sticky})),a=s||n((function(){var e=i("^r","gy");return e.lastIndex=2,null!==e.exec("str")}));e.exports={BROKEN_CARET:a,MISSED_STICKY:o,UNSUPPORTED_Y:s}},83635:(e,t,r)=>{"use strict";var n=r(79039),i=r(44576).RegExp;e.exports=n((function(){var e=i(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)}))},18814:(e,t,r)=>{"use strict";var n=r(79039),i=r(44576).RegExp;e.exports=n((function(){var e=i("(?b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$c")}))},67750:(e,t,r)=>{"use strict";var n=r(64117),i=TypeError;e.exports=function(e){if(n(e))throw new i("Can't call method on "+e);return e}},93389:(e,t,r)=>{"use strict";var n=r(44576),i=r(43724),s=Object.getOwnPropertyDescriptor;e.exports=function(e){if(!i)return n[e];var t=s(n,e);return t&&t.value}},33317:e=>{"use strict";e.exports=function(e,t){return e===t||e!=e&&t!=t}},3470:e=>{"use strict";e.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},79472:(e,t,r)=>{"use strict";var n,i=r(44576),s=r(18745),o=r(94901),a=r(84215),l=r(82839),c=r(67680),u=r(22812),h=i.Function,d=/MSIE .\./.test(l)||"BUN"===a&&((n=i.Bun.version.split(".")).length<3||"0"===n[0]&&(n[1]<3||"3"===n[1]&&"0"===n[2]));e.exports=function(e,t){var r=t?2:1;return d?function(n,i){var a=u(arguments.length,1)>r,l=o(n)?n:h(n),d=a?c(arguments,r):[],p=a?function(){s(l,this,d)}:l;return t?e(p,i):e(p)}:e}},89286:(e,t,r)=>{"use strict";var n=r(94402),i=r(38469),s=n.Set,o=n.add;e.exports=function(e){var t=new s;return i(e,(function(e){o(t,e)})),t}},83440:(e,t,r)=>{"use strict";var n=r(97080),i=r(94402),s=r(89286),o=r(25170),a=r(83789),l=r(38469),c=r(40507),u=i.has,h=i.remove;e.exports=function(e){var t=n(this),r=a(e),i=s(t);return o(t)<=r.size?l(t,(function(e){r.includes(e)&&h(i,e)})):c(r.getIterator(),(function(e){u(t,e)&&h(i,e)})),i}},94402:(e,t,r)=>{"use strict";var n=r(79504),i=Set.prototype;e.exports={Set,add:n(i.add),has:n(i.has),remove:n(i.delete),proto:i}},68750:(e,t,r)=>{"use strict";var n=r(97080),i=r(94402),s=r(25170),o=r(83789),a=r(38469),l=r(40507),c=i.Set,u=i.add,h=i.has;e.exports=function(e){var t=n(this),r=o(e),i=new c;return s(t)>r.size?l(r.getIterator(),(function(e){h(t,e)&&u(i,e)})):a(t,(function(e){r.includes(e)&&u(i,e)})),i}},64449:(e,t,r)=>{"use strict";var n=r(97080),i=r(94402).has,s=r(25170),o=r(83789),a=r(38469),l=r(40507),c=r(9539);e.exports=function(e){var t=n(this),r=o(e);if(s(t)<=r.size)return!1!==a(t,(function(e){if(r.includes(e))return!1}),!0);var u=r.getIterator();return!1!==l(u,(function(e){if(i(t,e))return c(u,"normal",!1)}))}},53838:(e,t,r)=>{"use strict";var n=r(97080),i=r(25170),s=r(38469),o=r(83789);e.exports=function(e){var t=n(this),r=o(e);return!(i(t)>r.size)&&!1!==s(t,(function(e){if(!r.includes(e))return!1}),!0)}},28527:(e,t,r)=>{"use strict";var n=r(97080),i=r(94402).has,s=r(25170),o=r(83789),a=r(40507),l=r(9539);e.exports=function(e){var t=n(this),r=o(e);if(s(t){"use strict";var n=r(79504),i=r(40507),s=r(94402),o=s.Set,a=s.proto,l=n(a.forEach),c=n(a.keys),u=c(new o).next;e.exports=function(e,t,r){return r?i({iterator:c(e),next:u},t):l(e,t)}},84916:(e,t,r)=>{"use strict";var n=r(97751),i=function(e){return{size:e,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};e.exports=function(e){var t=n("Set");try{(new t)[e](i(0));try{return(new t)[e](i(-1)),!1}catch(e){return!0}}catch(e){return!1}}},25170:(e,t,r)=>{"use strict";var n=r(46706),i=r(94402);e.exports=n(i.proto,"size","get")||function(e){return e.size}},87633:(e,t,r)=>{"use strict";var n=r(97751),i=r(62106),s=r(78227),o=r(43724),a=s("species");e.exports=function(e){var t=n(e);o&&t&&!t[a]&&i(t,a,{configurable:!0,get:function(){return this}})}},83650:(e,t,r)=>{"use strict";var n=r(97080),i=r(94402),s=r(89286),o=r(83789),a=r(40507),l=i.add,c=i.has,u=i.remove;e.exports=function(e){var t=n(this),r=o(e).getIterator(),i=s(t);return a(r,(function(e){c(t,e)?u(i,e):l(i,e)})),i}},10687:(e,t,r)=>{"use strict";var n=r(24913).f,i=r(39297),s=r(78227)("toStringTag");e.exports=function(e,t,r){e&&!r&&(e=e.prototype),e&&!i(e,s)&&n(e,s,{configurable:!0,value:t})}},44204:(e,t,r)=>{"use strict";var n=r(97080),i=r(94402).add,s=r(89286),o=r(83789),a=r(40507);e.exports=function(e){var t=n(this),r=o(e).getIterator(),l=s(t);return a(r,(function(e){i(l,e)})),l}},66119:(e,t,r)=>{"use strict";var n=r(25745),i=r(33392),s=n("keys");e.exports=function(e){return s[e]||(s[e]=i(e))}},77629:(e,t,r)=>{"use strict";var n=r(96395),i=r(44576),s=r(39433),o="__core-js_shared__",a=e.exports=i[o]||s(o,{});(a.versions||(a.versions=[])).push({version:"3.38.1",mode:n?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE",source:"https://github.com/zloirock/core-js"})},25745:(e,t,r)=>{"use strict";var n=r(77629);e.exports=function(e,t){return n[e]||(n[e]=t||{})}},2293:(e,t,r)=>{"use strict";var n=r(28551),i=r(35548),s=r(64117),o=r(78227)("species");e.exports=function(e,t){var r,a=n(e).constructor;return void 0===a||s(r=n(a)[o])?t:i(r)}},74615:(e,t,r)=>{"use strict";var n=r(79504),i=r(25397),s=r(655),o=r(26198),a=TypeError,l=n([].push),c=n([].join);e.exports=function(e){var t=i(e),r=o(t);if(!r)return"";for(var n=arguments.length,u=[],h=0;;){var d=t[h++];if(void 0===d)throw new a("Incorrect template");if(l(u,s(d)),h===r)return c(u,"");h{"use strict";var n=r(79039);e.exports=function(e){return n((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}))}},68183:(e,t,r)=>{"use strict";var n=r(79504),i=r(91291),s=r(655),o=r(67750),a=n("".charAt),l=n("".charCodeAt),c=n("".slice),u=function(e){return function(t,r){var n,u,h=s(o(t)),d=i(r),p=h.length;return d<0||d>=p?e?"":void 0:(n=l(h,d))<55296||n>56319||d+1===p||(u=l(h,d+1))<56320||u>57343?e?a(h,d):n:e?c(h,d,d+2):u-56320+(n-55296<<10)+65536}};e.exports={codeAt:u(!1),charAt:u(!0)}},83063:(e,t,r)=>{"use strict";var n=r(82839);e.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(n)},60533:(e,t,r)=>{"use strict";var n=r(79504),i=r(18014),s=r(655),o=r(72333),a=r(67750),l=n(o),c=n("".slice),u=Math.ceil,h=function(e){return function(t,r,n){var o,h,d=s(a(t)),p=i(r),f=d.length,m=void 0===n?" ":s(n);return p<=f||""===m?d:((h=l(m,u((o=p-f)/m.length))).length>o&&(h=c(h,0,o)),e?d+h:h+d)}};e.exports={start:h(!1),end:h(!0)}},58523:(e,t,r)=>{"use strict";var n=r(97751),i=r(79504),s=String.fromCharCode,o=n("String","fromCodePoint"),a=i("".charAt),l=i("".charCodeAt),c=i("".indexOf),u=i("".slice),h=function(e,t){var r=l(e,t);return r>=48&&r<=57},d=function(e,t,r){if(r>=e.length)return-1;for(var n=0;t=48&&e<=57?e-48:e>=97&&e<=102?e-97+10:e>=65&&e<=70?e-65+10:-1};e.exports=function(e){for(var t,r="",n=0,i=0;(i=c(e,"\\",i))>-1;){if(r+=u(e,n,i),++i===e.length)return;var l=a(e,i++);switch(l){case"b":r+="\b";break;case"t":r+="\t";break;case"n":r+="\n";break;case"v":r+="\v";break;case"f":r+="\f";break;case"r":r+="\r";break;case"\r":i1114111)return;r+=o(t);break;default:if(h(l,0))return;r+=l}n=i}return r+u(e,n)}},3717:(e,t,r)=>{"use strict";var n=r(79504),i=2147483647,s=/[^\0-\u007E]/,o=/[.\u3002\uFF0E\uFF61]/g,a="Overflow: input needs wider integers to process",l=RangeError,c=n(o.exec),u=Math.floor,h=String.fromCharCode,d=n("".charCodeAt),p=n([].join),f=n([].push),m=n("".replace),g=n("".split),A=n("".toLowerCase),y=function(e){return e+22+75*(e<26)},v=function(e,t,r){var n=0;for(e=r?u(e/700):e>>1,e+=u(e/t);e>455;)e=u(e/35),n+=36;return u(n+36*e/(e+38))},x=function(e){var t=[];e=function(e){for(var t=[],r=0,n=e.length;r=55296&&i<=56319&&r=o&&nu((i-c)/_))throw new l(a);for(c+=(x-o)*_,o=x,r=0;ri)throw new l(a);if(n===o){for(var b=c,w=36;;){var E=w<=m?1:w>=m+26?26:w-m;if(b{"use strict";var n=r(91291),i=r(655),s=r(67750),o=RangeError;e.exports=function(e){var t=i(s(this)),r="",a=n(e);if(a<0||a===1/0)throw new o("Wrong number of repetitions");for(;a>0;(a>>>=1)&&(t+=t))1&a&&(r+=t);return r}},18866:(e,t,r)=>{"use strict";var n=r(43802).end,i=r(60706);e.exports=i("trimEnd")?function(){return n(this)}:"".trimEnd},60706:(e,t,r)=>{"use strict";var n=r(10350).PROPER,i=r(79039),s=r(47452);e.exports=function(e){return i((function(){return!!s[e]()||"​…᠎"!=="​…᠎"[e]()||n&&s[e].name!==e}))}},53487:(e,t,r)=>{"use strict";var n=r(43802).start,i=r(60706);e.exports=i("trimStart")?function(){return n(this)}:"".trimStart},43802:(e,t,r)=>{"use strict";var n=r(79504),i=r(67750),s=r(655),o=r(47452),a=n("".replace),l=RegExp("^["+o+"]+"),c=RegExp("(^|[^"+o+"])["+o+"]+$"),u=function(e){return function(t){var r=s(i(t));return 1&e&&(r=a(r,l,"")),2&e&&(r=a(r,c,"$1")),r}};e.exports={start:u(1),end:u(2),trim:u(3)}},1548:(e,t,r)=>{"use strict";var n=r(44576),i=r(79039),s=r(39519),o=r(84215),a=n.structuredClone;e.exports=!!a&&!i((function(){if("DENO"===o&&s>92||"NODE"===o&&s>94||"BROWSER"===o&&s>97)return!1;var e=new ArrayBuffer(8),t=a(e,{transfer:[e]});return 0!==e.byteLength||8!==t.byteLength}))},4495:(e,t,r)=>{"use strict";var n=r(39519),i=r(79039),s=r(44576).String;e.exports=!!Object.getOwnPropertySymbols&&!i((function(){var e=Symbol("symbol detection");return!s(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},58242:(e,t,r)=>{"use strict";var n=r(69565),i=r(97751),s=r(78227),o=r(36840);e.exports=function(){var e=i("Symbol"),t=e&&e.prototype,r=t&&t.valueOf,a=s("toPrimitive");t&&!t[a]&&o(t,a,(function(e){return n(r,this)}),{arity:1})}},12586:(e,t,r)=>{"use strict";var n=r(97751),i=r(79504),s=n("Symbol"),o=s.keyFor,a=i(s.prototype.valueOf);e.exports=s.isRegisteredSymbol||function(e){try{return void 0!==o(a(e))}catch(e){return!1}}},52104:(e,t,r)=>{"use strict";for(var n=r(25745),i=r(97751),s=r(79504),o=r(10757),a=r(78227),l=i("Symbol"),c=l.isWellKnownSymbol,u=i("Object","getOwnPropertyNames"),h=s(l.prototype.valueOf),d=n("wks"),p=0,f=u(l),m=f.length;p{"use strict";var n=r(4495);e.exports=n&&!!Symbol.for&&!!Symbol.keyFor},59225:(e,t,r)=>{"use strict";var n,i,s,o,a=r(44576),l=r(18745),c=r(76080),u=r(94901),h=r(39297),d=r(79039),p=r(20397),f=r(67680),m=r(4055),g=r(22812),A=r(89544),y=r(38574),v=a.setImmediate,x=a.clearImmediate,_=a.process,b=a.Dispatch,w=a.Function,E=a.MessageChannel,M=a.String,S=0,C={},T="onreadystatechange";d((function(){n=a.location}));var I=function(e){if(h(C,e)){var t=C[e];delete C[e],t()}},R=function(e){return function(){I(e)}},B=function(e){I(e.data)},P=function(e){a.postMessage(M(e),n.protocol+"//"+n.host)};v&&x||(v=function(e){g(arguments.length,1);var t=u(e)?e:w(e),r=f(arguments,1);return C[++S]=function(){l(t,void 0,r)},i(S),S},x=function(e){delete C[e]},y?i=function(e){_.nextTick(R(e))}:b&&b.now?i=function(e){b.now(R(e))}:E&&!A?(o=(s=new E).port2,s.port1.onmessage=B,i=c(o.postMessage,o)):a.addEventListener&&u(a.postMessage)&&!a.importScripts&&n&&"file:"!==n.protocol&&!d(P)?(i=P,a.addEventListener("message",B,!1)):i=T in m("script")?function(e){p.appendChild(m("script"))[T]=function(){p.removeChild(this),I(e)}}:function(e){setTimeout(R(e),0)}),e.exports={set:v,clear:x}},31240:(e,t,r)=>{"use strict";var n=r(79504);e.exports=n(1..valueOf)},35610:(e,t,r)=>{"use strict";var n=r(91291),i=Math.max,s=Math.min;e.exports=function(e,t){var r=n(e);return r<0?i(r+t,0):s(r,t)}},75854:(e,t,r)=>{"use strict";var n=r(72777),i=TypeError;e.exports=function(e){var t=n(e,"number");if("number"==typeof t)throw new i("Can't convert number to bigint");return BigInt(t)}},57696:(e,t,r)=>{"use strict";var n=r(91291),i=r(18014),s=RangeError;e.exports=function(e){if(void 0===e)return 0;var t=n(e),r=i(t);if(t!==r)throw new s("Wrong length or index");return r}},25397:(e,t,r)=>{"use strict";var n=r(47055),i=r(67750);e.exports=function(e){return n(i(e))}},91291:(e,t,r)=>{"use strict";var n=r(80741);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},18014:(e,t,r)=>{"use strict";var n=r(91291),i=Math.min;e.exports=function(e){var t=n(e);return t>0?i(t,9007199254740991):0}},48981:(e,t,r)=>{"use strict";var n=r(67750),i=Object;e.exports=function(e){return i(n(e))}},58229:(e,t,r)=>{"use strict";var n=r(99590),i=RangeError;e.exports=function(e,t){var r=n(e);if(r%t)throw new i("Wrong offset");return r}},99590:(e,t,r)=>{"use strict";var n=r(91291),i=RangeError;e.exports=function(e){var t=n(e);if(t<0)throw new i("The argument can't be less than 0");return t}},72777:(e,t,r)=>{"use strict";var n=r(69565),i=r(20034),s=r(10757),o=r(55966),a=r(84270),l=r(78227),c=TypeError,u=l("toPrimitive");e.exports=function(e,t){if(!i(e)||s(e))return e;var r,l=o(e,u);if(l){if(void 0===t&&(t="default"),r=n(l,e,t),!i(r)||s(r))return r;throw new c("Can't convert object to primitive value")}return void 0===t&&(t="number"),a(e,t)}},56969:(e,t,r)=>{"use strict";var n=r(72777),i=r(10757);e.exports=function(e){var t=n(e,"string");return i(t)?t:t+""}},47650:(e,t,r)=>{"use strict";var n=r(97751),i=r(94901),s=r(31563),o=r(20034),a=n("Set");e.exports=function(e){return function(e){return o(e)&&"number"==typeof e.size&&i(e.has)&&i(e.keys)}(e)?e:s(e)?new a(e):e}},92140:(e,t,r)=>{"use strict";var n={};n[r(78227)("toStringTag")]="z",e.exports="[object z]"===String(n)},655:(e,t,r)=>{"use strict";var n=r(36955),i=String;e.exports=function(e){if("Symbol"===n(e))throw new TypeError("Cannot convert a Symbol value to a string");return i(e)}},58319:e=>{"use strict";var t=Math.round;e.exports=function(e){var r=t(e);return r<0?0:r>255?255:255&r}},16823:e=>{"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},15823:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(69565),o=r(43724),a=r(72805),l=r(94644),c=r(66346),u=r(90679),h=r(6980),d=r(66699),p=r(2087),f=r(18014),m=r(57696),g=r(58229),A=r(58319),y=r(56969),v=r(39297),x=r(36955),_=r(20034),b=r(10757),w=r(2360),E=r(1625),M=r(52967),S=r(38480).f,C=r(43251),T=r(59213).forEach,I=r(87633),R=r(62106),B=r(24913),P=r(77347),L=r(35370),D=r(91181),O=r(23167),N=D.get,U=D.set,F=D.enforce,k=B.f,z=P.f,G=i.RangeError,Q=c.ArrayBuffer,V=Q.prototype,H=c.DataView,j=l.NATIVE_ARRAY_BUFFER_VIEWS,q=l.TYPED_ARRAY_TAG,W=l.TypedArray,Y=l.TypedArrayPrototype,X=l.isTypedArray,K="BYTES_PER_ELEMENT",$="Wrong length",J=function(e,t){R(e,t,{configurable:!0,get:function(){return N(this)[t]}})},Z=function(e){var t;return E(V,e)||"ArrayBuffer"===(t=x(e))||"SharedArrayBuffer"===t},ee=function(e,t){return X(e)&&!b(t)&&t in e&&p(+t)&&t>=0},te=function(e,t){return t=y(t),ee(e,t)?h(2,e[t]):z(e,t)},re=function(e,t,r){return t=y(t),!(ee(e,t)&&_(r)&&v(r,"value"))||v(r,"get")||v(r,"set")||r.configurable||v(r,"writable")&&!r.writable||v(r,"enumerable")&&!r.enumerable?k(e,t,r):(e[t]=r.value,e)};o?(j||(P.f=te,B.f=re,J(Y,"buffer"),J(Y,"byteOffset"),J(Y,"byteLength"),J(Y,"length")),n({target:"Object",stat:!0,forced:!j},{getOwnPropertyDescriptor:te,defineProperty:re}),e.exports=function(e,t,r){var o=e.match(/\d+/)[0]/8,l=e+(r?"Clamped":"")+"Array",c="get"+e,h="set"+e,p=i[l],y=p,v=y&&y.prototype,x={},b=function(e,t){k(e,t,{get:function(){return function(e,t){var r=N(e);return r.view[c](t*o+r.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,n){var i=N(e);i.view[h](t*o+i.byteOffset,r?A(n):n,!0)}(this,t,e)},enumerable:!0})};j?a&&(y=t((function(e,t,r,n){return u(e,v),O(_(t)?Z(t)?void 0!==n?new p(t,g(r,o),n):void 0!==r?new p(t,g(r,o)):new p(t):X(t)?L(y,t):s(C,y,t):new p(m(t)),e,y)})),M&&M(y,W),T(S(p),(function(e){e in y||d(y,e,p[e])})),y.prototype=v):(y=t((function(e,t,r,n){u(e,v);var i,a,l,c=0,h=0;if(_(t)){if(!Z(t))return X(t)?L(y,t):s(C,y,t);i=t,h=g(r,o);var d=t.byteLength;if(void 0===n){if(d%o)throw new G($);if((a=d-h)<0)throw new G($)}else if((a=f(n)*o)+h>d)throw new G($);l=a/o}else l=m(t),i=new Q(a=l*o);for(U(e,{buffer:i,byteOffset:h,byteLength:a,length:l,view:new H(i)});c{"use strict";var n=r(44576),i=r(79039),s=r(84428),o=r(94644).NATIVE_ARRAY_BUFFER_VIEWS,a=n.ArrayBuffer,l=n.Int8Array;e.exports=!o||!i((function(){l(1)}))||!i((function(){new l(-1)}))||!s((function(e){new l,new l(null),new l(1.5),new l(e)}),!0)||i((function(){return 1!==new l(new a(2),1,void 0).length}))},26357:(e,t,r)=>{"use strict";var n=r(35370),i=r(61412);e.exports=function(e,t){return n(i(e),t)}},43251:(e,t,r)=>{"use strict";var n=r(76080),i=r(69565),s=r(35548),o=r(48981),a=r(26198),l=r(70081),c=r(50851),u=r(44209),h=r(18727),d=r(94644).aTypedArrayConstructor,p=r(75854);e.exports=function(e){var t,r,f,m,g,A,y,v,x=s(this),_=o(e),b=arguments.length,w=b>1?arguments[1]:void 0,E=void 0!==w,M=c(_);if(M&&!u(M))for(v=(y=l(_,M)).next,_=[];!(A=i(v,y)).done;)_.push(A.value);for(E&&b>2&&(w=n(w,arguments[2])),r=a(_),f=new(d(x))(r),m=h(f),t=0;r>t;t++)g=E?w(_[t],t):_[t],f[t]=m?p(g):+g;return f}},61412:(e,t,r)=>{"use strict";var n=r(94644),i=r(2293),s=n.aTypedArrayConstructor,o=n.getTypedArrayConstructor;e.exports=function(e){return s(i(e,o(e)))}},33392:(e,t,r)=>{"use strict";var n=r(79504),i=0,s=Math.random(),o=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+o(++i+s,36)}},59143:(e,t,r)=>{"use strict";var n=r(44576),i=r(79504),s=r(83972),o=r(63463),a=r(39297),l=r(92804),c=r(944),u=r(55169),h=l.c2i,d=l.c2iUrl,p=n.SyntaxError,f=n.TypeError,m=i("".charAt),g=function(e,t){for(var r=e.length;t>16&255,i>>8&255,255&i];if(2===n){if(r&&0!==s[1])throw new p("Extra bits");return[s[0]]}if(3===n){if(r&&0!==s[2])throw new p("Extra bits");return[s[0],s[1]]}return s},y=function(e,t,r){for(var n=t.length,i=0;i0){if("stop-before-partial"===l)break;if("loose"!==l)throw new p("Missing padding");if(1===b.length)throw new p("Malformed padding: exactly one additional character");x=y(v,A(b,i,!1),x)}_=e.length;break}var E=m(e,w);if(++w,"="===E){if(b.length<2)throw new p("Padding is too early");if(w=g(e,w),2===b.length){if(w===e.length){if("stop-before-partial"===l)break;throw new p("Malformed padding: only one =")}"="===m(e,w)&&(++w,w=g(e,w))}if(w{"use strict";var n=r(44576),i=r(79504),s=n.Uint8Array,o=n.SyntaxError,a=n.parseInt,l=Math.min,c=/[^\da-f]/i,u=i(c.exec),h=i("".slice);e.exports=function(e,t){var r=e.length;if(r%2!=0)throw new o("String should be an even number of characters");for(var n=t?l(t.length,r/2):r/2,i=t||new s(n),d=0,p=0;p{"use strict";var n=r(79039),i=r(78227),s=r(43724),o=r(96395),a=i("iterator");e.exports=!n((function(){var e=new URL("b?a=1&b=2&c=3","https://a"),t=e.searchParams,r=new URLSearchParams("a=1&a=2&b=3"),n="";return e.pathname="c%20d",t.forEach((function(e,r){t.delete("b"),n+=r+e})),r.delete("a",2),r.delete("b",void 0),o&&(!e.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!t.size&&(o||!s)||!t.sort||"https://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[a]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("https://тест").host||"#%D0%B1"!==new URL("https://a#б").hash||"a1c3"!==n||"x"!==new URL("https://x",void 0).host}))},7040:(e,t,r)=>{"use strict";var n=r(4495);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},48686:(e,t,r)=>{"use strict";var n=r(43724),i=r(79039);e.exports=n&&i((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},22812:e=>{"use strict";var t=TypeError;e.exports=function(e,r){if(e{"use strict";var n=r(44576),i=r(94901),s=n.WeakMap;e.exports=i(s)&&/native code/.test(String(s))},44995:(e,t,r)=>{"use strict";var n=r(79504),i=WeakMap.prototype;e.exports={WeakMap,set:n(i.set),get:n(i.get),has:n(i.has),remove:n(i.delete)}},88205:(e,t,r)=>{"use strict";var n=r(79504),i=WeakSet.prototype;e.exports={WeakSet,add:n(i.add),has:n(i.has),remove:n(i.delete)}},70511:(e,t,r)=>{"use strict";var n=r(19167),i=r(39297),s=r(1951),o=r(24913).f;e.exports=function(e){var t=n.Symbol||(n.Symbol={});i(t,e)||o(t,e,{value:s.f(e)})}},1951:(e,t,r)=>{"use strict";var n=r(78227);t.f=n},78227:(e,t,r)=>{"use strict";var n=r(44576),i=r(25745),s=r(39297),o=r(33392),a=r(4495),l=r(7040),c=n.Symbol,u=i("wks"),h=l?c.for||c:c&&c.withoutSetter||o;e.exports=function(e){return s(u,e)||(u[e]=a&&s(c,e)?c[e]:h("Symbol."+e)),u[e]}},47452:e=>{"use strict";e.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},14601:(e,t,r)=>{"use strict";var n=r(97751),i=r(39297),s=r(66699),o=r(1625),a=r(52967),l=r(77740),c=r(11056),u=r(23167),h=r(32603),d=r(77584),p=r(80747),f=r(43724),m=r(96395);e.exports=function(e,t,r,g){var A="stackTraceLimit",y=g?2:1,v=e.split("."),x=v[v.length-1],_=n.apply(null,v);if(_){var b=_.prototype;if(!m&&i(b,"cause")&&delete b.cause,!r)return _;var w=n("Error"),E=t((function(e,t){var r=h(g?t:e,void 0),n=g?new _(e):new _;return void 0!==r&&s(n,"message",r),p(n,E,n.stack,2),this&&o(b,this)&&u(n,this,E),arguments.length>y&&d(n,arguments[y]),n}));if(E.prototype=b,"Error"!==x?a?a(E,w):l(E,w,{name:!0}):f&&A in _&&(c(E,_,A),c(E,_,"prepareStackTrace")),l(E,_),!m)try{b.name!==x&&s(b,"name",x),b.constructor=E}catch(e){}return E}}},4294:(e,t,r)=>{"use strict";var n=r(46518),i=r(97751),s=r(18745),o=r(79039),a=r(14601),l="AggregateError",c=i(l),u=!o((function(){return 1!==c([1]).errors[0]}))&&o((function(){return 7!==c([1],l,{cause:7}).cause}));n({global:!0,constructor:!0,arity:2,forced:u},{AggregateError:a(l,(function(e){return function(t,r){return s(e,this,arguments)}}),u,!0)})},17145:(e,t,r)=>{"use strict";var n=r(46518),i=r(1625),s=r(42787),o=r(52967),a=r(77740),l=r(2360),c=r(66699),u=r(6980),h=r(77584),d=r(80747),p=r(72652),f=r(32603),m=r(78227)("toStringTag"),g=Error,A=[].push,y=function(e,t){var r,n=i(v,this);o?r=o(new g,n?s(this):v):(r=n?this:l(v),c(r,m,"Error")),void 0!==t&&c(r,"message",f(t)),d(r,y,r.stack,1),arguments.length>2&&h(r,arguments[2]);var a=[];return p(e,A,{that:a}),c(r,"errors",a),r};o?o(y,g):a(y,g,{name:!0});var v=y.prototype=l(g.prototype,{constructor:u(1,y),message:u(1,""),name:u(1,"AggregateError")});n({global:!0,constructor:!0,arity:2},{AggregateError:y})},30067:(e,t,r)=>{"use strict";r(17145)},54743:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(66346),o=r(87633),a="ArrayBuffer",l=s[a];n({global:!0,constructor:!0,forced:i[a]!==l},{ArrayBuffer:l}),o(a)},16573:(e,t,r)=>{"use strict";var n=r(43724),i=r(62106),s=r(3238),o=ArrayBuffer.prototype;n&&!("detached"in o)&&i(o,"detached",{configurable:!0,get:function(){return s(this)}})},46761:(e,t,r)=>{"use strict";var n=r(46518),i=r(94644);n({target:"ArrayBuffer",stat:!0,forced:!i.NATIVE_ARRAY_BUFFER_VIEWS},{isView:i.isView})},11745:(e,t,r)=>{"use strict";var n=r(46518),i=r(27476),s=r(79039),o=r(66346),a=r(28551),l=r(35610),c=r(18014),u=r(2293),h=o.ArrayBuffer,d=o.DataView,p=d.prototype,f=i(h.prototype.slice),m=i(p.getUint8),g=i(p.setUint8);n({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:s((function(){return!new h(2).slice(1,void 0).byteLength}))},{slice:function(e,t){if(f&&void 0===t)return f(a(this),e);for(var r=a(this).byteLength,n=l(e,r),i=l(void 0===t?r:t,r),s=new(u(this,h))(c(i-n)),o=new d(this),p=new d(s),A=0;n{"use strict";var n=r(46518),i=r(95636);i&&n({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return i(this,arguments.length?arguments[0]:void 0,!1)}})},78100:(e,t,r)=>{"use strict";var n=r(46518),i=r(95636);i&&n({target:"ArrayBuffer",proto:!0},{transfer:function(){return i(this,arguments.length?arguments[0]:void 0,!0)}})},18107:(e,t,r)=>{"use strict";var n=r(46518),i=r(48981),s=r(26198),o=r(91291),a=r(6469);n({target:"Array",proto:!0},{at:function(e){var t=i(this),r=s(t),n=o(e),a=n>=0?n:r+n;return a<0||a>=r?void 0:t[a]}}),a("at")},28706:(e,t,r)=>{"use strict";var n=r(46518),i=r(79039),s=r(34376),o=r(20034),a=r(48981),l=r(26198),c=r(96837),u=r(97040),h=r(1469),d=r(70597),p=r(78227),f=r(39519),m=p("isConcatSpreadable"),g=f>=51||!i((function(){var e=[];return e[m]=!1,e.concat()[0]!==e})),A=function(e){if(!o(e))return!1;var t=e[m];return void 0!==t?!!t:s(e)};n({target:"Array",proto:!0,arity:1,forced:!g||!d("concat")},{concat:function(e){var t,r,n,i,s,o=a(this),d=h(o,0),p=0;for(t=-1,n=arguments.length;t{"use strict";var n=r(46518),i=r(57029),s=r(6469);n({target:"Array",proto:!0},{copyWithin:i}),s("copyWithin")},88431:(e,t,r)=>{"use strict";var n=r(46518),i=r(59213).every;n({target:"Array",proto:!0,forced:!r(34598)("every")},{every:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},33771:(e,t,r)=>{"use strict";var n=r(46518),i=r(84373),s=r(6469);n({target:"Array",proto:!0},{fill:i}),s("fill")},2008:(e,t,r)=>{"use strict";var n=r(46518),i=r(59213).filter;n({target:"Array",proto:!0,forced:!r(70597)("filter")},{filter:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},48980:(e,t,r)=>{"use strict";var n=r(46518),i=r(59213).findIndex,s=r(6469),o="findIndex",a=!0;o in[]&&Array(1)[o]((function(){a=!1})),n({target:"Array",proto:!0,forced:a},{findIndex:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),s(o)},13451:(e,t,r)=>{"use strict";var n=r(46518),i=r(43839).findLastIndex,s=r(6469);n({target:"Array",proto:!0},{findLastIndex:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),s("findLastIndex")},10838:(e,t,r)=>{"use strict";var n=r(46518),i=r(43839).findLast,s=r(6469);n({target:"Array",proto:!0},{findLast:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),s("findLast")},50113:(e,t,r)=>{"use strict";var n=r(46518),i=r(59213).find,s=r(6469),o="find",a=!0;o in[]&&Array(1)[o]((function(){a=!1})),n({target:"Array",proto:!0,forced:a},{find:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),s(o)},78350:(e,t,r)=>{"use strict";var n=r(46518),i=r(70259),s=r(79306),o=r(48981),a=r(26198),l=r(1469);n({target:"Array",proto:!0},{flatMap:function(e){var t,r=o(this),n=a(r);return s(e),(t=l(r,0)).length=i(t,r,r,n,0,1,e,arguments.length>1?arguments[1]:void 0),t}})},46449:(e,t,r)=>{"use strict";var n=r(46518),i=r(70259),s=r(48981),o=r(26198),a=r(91291),l=r(1469);n({target:"Array",proto:!0},{flat:function(){var e=arguments.length?arguments[0]:void 0,t=s(this),r=o(t),n=l(t,0);return n.length=i(n,t,t,r,0,void 0===e?1:a(e)),n}})},51629:(e,t,r)=>{"use strict";var n=r(46518),i=r(90235);n({target:"Array",proto:!0,forced:[].forEach!==i},{forEach:i})},23418:(e,t,r)=>{"use strict";var n=r(46518),i=r(97916);n({target:"Array",stat:!0,forced:!r(84428)((function(e){Array.from(e)}))},{from:i})},74423:(e,t,r)=>{"use strict";var n=r(46518),i=r(19617).includes,s=r(79039),o=r(6469);n({target:"Array",proto:!0,forced:s((function(){return!Array(1).includes()}))},{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),o("includes")},25276:(e,t,r)=>{"use strict";var n=r(46518),i=r(27476),s=r(19617).indexOf,o=r(34598),a=i([].indexOf),l=!!a&&1/a([1],1,-0)<0;n({target:"Array",proto:!0,forced:l||!o("indexOf")},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return l?a(this,e,t)||0:s(this,e,t)}})},64346:(e,t,r)=>{"use strict";r(46518)({target:"Array",stat:!0},{isArray:r(34376)})},23792:(e,t,r)=>{"use strict";var n=r(25397),i=r(6469),s=r(26269),o=r(91181),a=r(24913).f,l=r(51088),c=r(62529),u=r(96395),h=r(43724),d="Array Iterator",p=o.set,f=o.getterFor(d);e.exports=l(Array,"Array",(function(e,t){p(this,{type:d,target:n(e),index:0,kind:t})}),(function(){var e=f(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,c(void 0,!0);switch(e.kind){case"keys":return c(r,!1);case"values":return c(t[r],!1)}return c([r,t[r]],!1)}),"values");var m=s.Arguments=s.Array;if(i("keys"),i("values"),i("entries"),!u&&h&&"values"!==m.name)try{a(m,"name",{value:"values"})}catch(e){}},48598:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(47055),o=r(25397),a=r(34598),l=i([].join);n({target:"Array",proto:!0,forced:s!==Object||!a("join",",")},{join:function(e){return l(o(this),void 0===e?",":e)}})},8921:(e,t,r)=>{"use strict";var n=r(46518),i=r(8379);n({target:"Array",proto:!0,forced:i!==[].lastIndexOf},{lastIndexOf:i})},62062:(e,t,r)=>{"use strict";var n=r(46518),i=r(59213).map;n({target:"Array",proto:!0,forced:!r(70597)("map")},{map:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},31051:(e,t,r)=>{"use strict";var n=r(46518),i=r(79039),s=r(33517),o=r(97040),a=Array;n({target:"Array",stat:!0,forced:i((function(){function e(){}return!(a.of.call(e)instanceof e)}))},{of:function(){for(var e=0,t=arguments.length,r=new(s(this)?this:a)(t);t>e;)o(r,e,arguments[e++]);return r.length=t,r}})},44114:(e,t,r)=>{"use strict";var n=r(46518),i=r(48981),s=r(26198),o=r(34527),a=r(96837);n({target:"Array",proto:!0,arity:1,forced:r(79039)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=i(this),r=s(t),n=arguments.length;a(r+n);for(var l=0;l{"use strict";var n=r(46518),i=r(80926).right,s=r(34598),o=r(39519);n({target:"Array",proto:!0,forced:!r(38574)&&o>79&&o<83||!s("reduceRight")},{reduceRight:function(e){return i(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}})},72712:(e,t,r)=>{"use strict";var n=r(46518),i=r(80926).left,s=r(34598),o=r(39519);n({target:"Array",proto:!0,forced:!r(38574)&&o>79&&o<83||!s("reduce")},{reduce:function(e){var t=arguments.length;return i(this,e,t,t>1?arguments[1]:void 0)}})},94490:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(34376),o=i([].reverse),a=[1,2];n({target:"Array",proto:!0,forced:String(a)===String(a.reverse())},{reverse:function(){return s(this)&&(this.length=this.length),o(this)}})},34782:(e,t,r)=>{"use strict";var n=r(46518),i=r(34376),s=r(33517),o=r(20034),a=r(35610),l=r(26198),c=r(25397),u=r(97040),h=r(78227),d=r(70597),p=r(67680),f=d("slice"),m=h("species"),g=Array,A=Math.max;n({target:"Array",proto:!0,forced:!f},{slice:function(e,t){var r,n,h,d=c(this),f=l(d),y=a(e,f),v=a(void 0===t?f:t,f);if(i(d)&&(r=d.constructor,(s(r)&&(r===g||i(r.prototype))||o(r)&&null===(r=r[m]))&&(r=void 0),r===g||void 0===r))return p(d,y,v);for(n=new(void 0===r?g:r)(A(v-y,0)),h=0;y{"use strict";var n=r(46518),i=r(59213).some;n({target:"Array",proto:!0,forced:!r(34598)("some")},{some:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},26910:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(79306),o=r(48981),a=r(26198),l=r(84606),c=r(655),u=r(79039),h=r(74488),d=r(34598),p=r(13709),f=r(13763),m=r(39519),g=r(3607),A=[],y=i(A.sort),v=i(A.push),x=u((function(){A.sort(void 0)})),_=u((function(){A.sort(null)})),b=d("sort"),w=!u((function(){if(m)return m<70;if(!(p&&p>3)){if(f)return!0;if(g)return g<603;var e,t,r,n,i="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)A.push({k:t+n,v:r})}for(A.sort((function(e,t){return t.v-e.v})),n=0;nc(r)?1:-1}}(e)),r=a(i),n=0;n{"use strict";r(87633)("Array")},54554:(e,t,r)=>{"use strict";var n=r(46518),i=r(48981),s=r(35610),o=r(91291),a=r(26198),l=r(34527),c=r(96837),u=r(1469),h=r(97040),d=r(84606),p=r(70597)("splice"),f=Math.max,m=Math.min;n({target:"Array",proto:!0,forced:!p},{splice:function(e,t){var r,n,p,g,A,y,v=i(this),x=a(v),_=s(e,x),b=arguments.length;for(0===b?r=n=0:1===b?(r=0,n=x-_):(r=b-2,n=m(f(o(t),0),x-_)),c(x+r-n),p=u(v,n),g=0;gx-n+r;g--)d(v,g-1)}else if(r>n)for(g=x-n;g>_;g--)y=g+r-1,(A=g+n-1)in v?v[y]=v[A]:d(v,y);for(g=0;g{"use strict";var n=r(46518),i=r(37628),s=r(25397),o=r(6469),a=Array;n({target:"Array",proto:!0},{toReversed:function(){return i(s(this),a)}}),o("toReversed")},57145:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(79306),o=r(25397),a=r(35370),l=r(44124),c=r(6469),u=Array,h=i(l("Array","sort"));n({target:"Array",proto:!0},{toSorted:function(e){void 0!==e&&s(e);var t=o(this),r=a(u,t);return h(r,e)}}),c("toSorted")},71658:(e,t,r)=>{"use strict";var n=r(46518),i=r(6469),s=r(96837),o=r(26198),a=r(35610),l=r(25397),c=r(91291),u=Array,h=Math.max,d=Math.min;n({target:"Array",proto:!0},{toSpliced:function(e,t){var r,n,i,p,f=l(this),m=o(f),g=a(e,m),A=arguments.length,y=0;for(0===A?r=n=0:1===A?(r=0,n=m-g):(r=A-2,n=d(h(c(t),0),m-g)),i=s(m+r-n),p=u(i);y{"use strict";r(6469)("flatMap")},93514:(e,t,r)=>{"use strict";r(6469)("flat")},13609:(e,t,r)=>{"use strict";var n=r(46518),i=r(48981),s=r(26198),o=r(34527),a=r(84606),l=r(96837);n({target:"Array",proto:!0,arity:1,forced:1!==[].unshift(0)||!function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(e){return e instanceof TypeError}}()},{unshift:function(e){var t=i(this),r=s(t),n=arguments.length;if(n){l(r+n);for(var c=r;c--;){var u=c+n;c in t?t[u]=t[c]:a(t,u)}for(var h=0;h{"use strict";var n=r(46518),i=r(39928),s=r(25397),o=Array;n({target:"Array",proto:!0},{with:function(e,t){return i(s(this),o,e,t)}})},24359:(e,t,r)=>{"use strict";var n=r(46518),i=r(66346);n({global:!0,constructor:!0,forced:!r(77811)},{DataView:i.DataView})},38309:(e,t,r)=>{"use strict";r(24359)},61699:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(79039)((function(){return 120!==new Date(16e11).getYear()})),o=i(Date.prototype.getFullYear);n({target:"Date",proto:!0,forced:s},{getYear:function(){return o(this)-1900}})},59089:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=Date,o=i(s.prototype.getTime);n({target:"Date",stat:!0},{now:function(){return o(new s)}})},91191:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(91291),o=Date.prototype,a=i(o.getTime),l=i(o.setFullYear);n({target:"Date",proto:!0},{setYear:function(e){a(this);var t=s(e);return l(this,t>=0&&t<=99?t+1900:t)}})},93515:(e,t,r)=>{"use strict";r(46518)({target:"Date",proto:!0},{toGMTString:Date.prototype.toUTCString})},1688:(e,t,r)=>{"use strict";var n=r(46518),i=r(70380);n({target:"Date",proto:!0,forced:Date.prototype.toISOString!==i},{toISOString:i})},60739:(e,t,r)=>{"use strict";var n=r(46518),i=r(79039),s=r(48981),o=r(72777);n({target:"Date",proto:!0,arity:1,forced:i((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}))},{toJSON:function(e){var t=s(this),r=o(t,"number");return"number"!=typeof r||isFinite(r)?t.toISOString():null}})},89572:(e,t,r)=>{"use strict";var n=r(39297),i=r(36840),s=r(53640),o=r(78227)("toPrimitive"),a=Date.prototype;n(a,o)||i(a,o,s)},23288:(e,t,r)=>{"use strict";var n=r(79504),i=r(36840),s=Date.prototype,o="Invalid Date",a="toString",l=n(s[a]),c=n(s.getTime);String(new Date(NaN))!==o&&i(s,a,(function(){var e=c(this);return e==e?l(this):o}))},16280:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(18745),o=r(14601),a="WebAssembly",l=i[a],c=7!==new Error("e",{cause:7}).cause,u=function(e,t){var r={};r[e]=o(e,t,c),n({global:!0,constructor:!0,arity:1,forced:c},r)},h=function(e,t){if(l&&l[e]){var r={};r[e]=o(a+"."+e,t,c),n({target:a,stat:!0,constructor:!0,arity:1,forced:c},r)}};u("Error",(function(e){return function(t){return s(e,this,arguments)}})),u("EvalError",(function(e){return function(t){return s(e,this,arguments)}})),u("RangeError",(function(e){return function(t){return s(e,this,arguments)}})),u("ReferenceError",(function(e){return function(t){return s(e,this,arguments)}})),u("SyntaxError",(function(e){return function(t){return s(e,this,arguments)}})),u("TypeError",(function(e){return function(t){return s(e,this,arguments)}})),u("URIError",(function(e){return function(t){return s(e,this,arguments)}})),h("CompileError",(function(e){return function(t){return s(e,this,arguments)}})),h("LinkError",(function(e){return function(t){return s(e,this,arguments)}})),h("RuntimeError",(function(e){return function(t){return s(e,this,arguments)}}))},76918:(e,t,r)=>{"use strict";var n=r(36840),i=r(77536),s=Error.prototype;s.toString!==i&&n(s,"toString",i)},36456:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(655),o=i("".charAt),a=i("".charCodeAt),l=i(/./.exec),c=i(1..toString),u=i("".toUpperCase),h=/[\w*+\-./@]/,d=function(e,t){for(var r=c(e,16);r.length{"use strict";var n=r(46518),i=r(30566);n({target:"Function",proto:!0,forced:Function.bind!==i},{bind:i})},48957:(e,t,r)=>{"use strict";var n=r(94901),i=r(20034),s=r(24913),o=r(1625),a=r(78227),l=r(50283),c=a("hasInstance"),u=Function.prototype;c in u||s.f(u,c,{value:l((function(e){if(!n(this)||!i(e))return!1;var t=this.prototype;return i(t)?o(t,e):e instanceof this}),c)})},62010:(e,t,r)=>{"use strict";var n=r(43724),i=r(10350).EXISTS,s=r(79504),o=r(62106),a=Function.prototype,l=s(a.toString),c=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,u=s(c.exec);n&&!i&&o(a,"name",{configurable:!0,get:function(){try{return u(c,l(this))[1]}catch(e){return""}}})},55081:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576);n({global:!0,forced:i.globalThis!==i},{globalThis:i})},33110:(e,t,r)=>{"use strict";var n=r(46518),i=r(97751),s=r(18745),o=r(69565),a=r(79504),l=r(79039),c=r(94901),u=r(10757),h=r(67680),d=r(66933),p=r(4495),f=String,m=i("JSON","stringify"),g=a(/./.exec),A=a("".charAt),y=a("".charCodeAt),v=a("".replace),x=a(1..toString),_=/[\uD800-\uDFFF]/g,b=/^[\uD800-\uDBFF]$/,w=/^[\uDC00-\uDFFF]$/,E=!p||l((function(){var e=i("Symbol")("stringify detection");return"[null]"!==m([e])||"{}"!==m({a:e})||"{}"!==m(Object(e))})),M=l((function(){return'"\\udf06\\ud834"'!==m("\udf06\ud834")||'"\\udead"'!==m("\udead")})),S=function(e,t){var r=h(arguments),n=d(t);if(c(n)||void 0!==e&&!u(e))return r[1]=function(e,t){if(c(n)&&(t=o(n,this,f(e),t)),!u(t))return t},s(m,null,r)},C=function(e,t,r){var n=A(r,t-1),i=A(r,t+1);return g(b,e)&&!g(w,i)||g(w,e)&&!g(b,n)?"\\u"+x(y(e,0),16):e};m&&n({target:"JSON",stat:!0,arity:3,forced:E||M},{stringify:function(e,t,r){var n=h(arguments),i=s(E?S:m,null,n);return M&&"string"==typeof i?v(i,_,C):i}})},4731:(e,t,r)=>{"use strict";var n=r(44576);r(10687)(n.JSON,"JSON",!0)},48523:(e,t,r)=>{"use strict";r(16468)("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),r(86938))},47072:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(79306),o=r(67750),a=r(72652),l=r(72248),c=r(96395),u=r(79039),h=l.Map,d=l.has,p=l.get,f=l.set,m=i([].push),g=c||u((function(){return 1!==h.groupBy("ab",(function(e){return e})).get("a").length}));n({target:"Map",stat:!0,forced:c||g},{groupBy:function(e,t){o(e),s(t);var r=new h,n=0;return a(e,(function(e){var i=t(e,n++);d(r,i)?m(p(r,i),e):f(r,i,[e])})),r}})},36033:(e,t,r)=>{"use strict";r(48523)},93153:(e,t,r)=>{"use strict";var n=r(46518),i=r(7740),s=Math.acosh,o=Math.log,a=Math.sqrt,l=Math.LN2;n({target:"Math",stat:!0,forced:!s||710!==Math.floor(s(Number.MAX_VALUE))||s(1/0)!==1/0},{acosh:function(e){var t=+e;return t<1?NaN:t>94906265.62425156?o(t)+l:i(t-1+a(t-1)*a(t+1))}})},82326:(e,t,r)=>{"use strict";var n=r(46518),i=Math.asinh,s=Math.log,o=Math.sqrt;n({target:"Math",stat:!0,forced:!(i&&1/i(0)>0)},{asinh:function e(t){var r=+t;return isFinite(r)&&0!==r?r<0?-e(-r):s(r+o(r*r+1)):r}})},36389:(e,t,r)=>{"use strict";var n=r(46518),i=Math.atanh,s=Math.log;n({target:"Math",stat:!0,forced:!(i&&1/i(-0)<0)},{atanh:function(e){var t=+e;return 0===t?t:s((1+t)/(1-t))/2}})},64444:(e,t,r)=>{"use strict";var n=r(46518),i=r(77782),s=Math.abs,o=Math.pow;n({target:"Math",stat:!0},{cbrt:function(e){var t=+e;return i(t)*o(s(t),1/3)}})},8085:(e,t,r)=>{"use strict";var n=r(46518),i=Math.floor,s=Math.log,o=Math.LOG2E;n({target:"Math",stat:!0},{clz32:function(e){var t=e>>>0;return t?31-i(s(t+.5)*o):32}})},77762:(e,t,r)=>{"use strict";var n=r(46518),i=r(53250),s=Math.cosh,o=Math.abs,a=Math.E;n({target:"Math",stat:!0,forced:!s||s(710)===1/0},{cosh:function(e){var t=i(o(e)-1)+1;return(t+1/(t*a*a))*(a/2)}})},65070:(e,t,r)=>{"use strict";var n=r(46518),i=r(53250);n({target:"Math",stat:!0,forced:i!==Math.expm1},{expm1:i})},60605:(e,t,r)=>{"use strict";r(46518)({target:"Math",stat:!0},{fround:r(15617)})},39469:(e,t,r)=>{"use strict";var n=r(46518),i=Math.hypot,s=Math.abs,o=Math.sqrt;n({target:"Math",stat:!0,arity:2,forced:!!i&&i(1/0,NaN)!==1/0},{hypot:function(e,t){for(var r,n,i=0,a=0,l=arguments.length,c=0;a0?(n=r/c)*n:r;return c===1/0?1/0:c*o(i)}})},72152:(e,t,r)=>{"use strict";var n=r(46518),i=r(79039),s=Math.imul;n({target:"Math",stat:!0,forced:i((function(){return-5!==s(4294967295,5)||2!==s.length}))},{imul:function(e,t){var r=65535,n=+e,i=+t,s=r&n,o=r&i;return 0|s*o+((r&n>>>16)*o+s*(r&i>>>16)<<16>>>0)}})},75376:(e,t,r)=>{"use strict";r(46518)({target:"Math",stat:!0},{log10:r(49340)})},56624:(e,t,r)=>{"use strict";r(46518)({target:"Math",stat:!0},{log1p:r(7740)})},11367:(e,t,r)=>{"use strict";var n=r(46518),i=Math.log,s=Math.LN2;n({target:"Math",stat:!0},{log2:function(e){return i(e)/s}})},5914:(e,t,r)=>{"use strict";r(46518)({target:"Math",stat:!0},{sign:r(77782)})},78553:(e,t,r)=>{"use strict";var n=r(46518),i=r(79039),s=r(53250),o=Math.abs,a=Math.exp,l=Math.E;n({target:"Math",stat:!0,forced:i((function(){return-2e-17!==Math.sinh(-2e-17)}))},{sinh:function(e){var t=+e;return o(t)<1?(s(t)-s(-t))/2:(a(t-1)-a(-t-1))*(l/2)}})},98690:(e,t,r)=>{"use strict";var n=r(46518),i=r(53250),s=Math.exp;n({target:"Math",stat:!0},{tanh:function(e){var t=+e,r=i(t),n=i(-t);return r===1/0?1:n===1/0?-1:(r-n)/(s(t)+s(-t))}})},60479:(e,t,r)=>{"use strict";r(10687)(Math,"Math",!0)},70761:(e,t,r)=>{"use strict";r(46518)({target:"Math",stat:!0},{trunc:r(80741)})},2892:(e,t,r)=>{"use strict";var n=r(46518),i=r(96395),s=r(43724),o=r(44576),a=r(19167),l=r(79504),c=r(92796),u=r(39297),h=r(23167),d=r(1625),p=r(10757),f=r(72777),m=r(79039),g=r(38480).f,A=r(77347).f,y=r(24913).f,v=r(31240),x=r(43802).trim,_="Number",b=o[_],w=a[_],E=b.prototype,M=o.TypeError,S=l("".slice),C=l("".charCodeAt),T=c(_,!b(" 0o1")||!b("0b1")||b("+0x1")),I=function(e){var t,r=arguments.length<1?0:b(function(e){var t=f(e,"number");return"bigint"==typeof t?t:function(e){var t,r,n,i,s,o,a,l,c=f(e,"number");if(p(c))throw new M("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(c=x(c),43===(t=C(c,0))||45===t){if(88===(r=C(c,2))||120===r)return NaN}else if(48===t){switch(C(c,1)){case 66:case 98:n=2,i=49;break;case 79:case 111:n=8,i=55;break;default:return+c}for(o=(s=S(c,2)).length,a=0;ai)return NaN;return parseInt(s,n)}return+c}(t)}(e));return d(E,t=this)&&m((function(){v(t)}))?h(Object(r),this,I):r};I.prototype=E,T&&!i&&(E.constructor=I),n({global:!0,constructor:!0,wrap:!0,forced:T},{Number:I});var R=function(e,t){for(var r,n=s?g(t):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),i=0;n.length>i;i++)u(t,r=n[i])&&!u(e,r)&&y(e,r,A(t,r))};i&&w&&R(a[_],w),(T||i)&&R(a[_],b)},45374:(e,t,r)=>{"use strict";r(46518)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{EPSILON:Math.pow(2,-52)})},25428:(e,t,r)=>{"use strict";r(46518)({target:"Number",stat:!0},{isFinite:r(50360)})},32637:(e,t,r)=>{"use strict";r(46518)({target:"Number",stat:!0},{isInteger:r(2087)})},40150:(e,t,r)=>{"use strict";r(46518)({target:"Number",stat:!0},{isNaN:function(e){return e!=e}})},59149:(e,t,r)=>{"use strict";var n=r(46518),i=r(2087),s=Math.abs;n({target:"Number",stat:!0},{isSafeInteger:function(e){return i(e)&&s(e)<=9007199254740991}})},64601:(e,t,r)=>{"use strict";r(46518)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MAX_SAFE_INTEGER:9007199254740991})},44435:(e,t,r)=>{"use strict";r(46518)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MIN_SAFE_INTEGER:-9007199254740991})},87220:(e,t,r)=>{"use strict";var n=r(46518),i=r(33904);n({target:"Number",stat:!0,forced:Number.parseFloat!==i},{parseFloat:i})},25843:(e,t,r)=>{"use strict";var n=r(46518),i=r(52703);n({target:"Number",stat:!0,forced:Number.parseInt!==i},{parseInt:i})},62337:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(91291),o=r(31240),a=r(72333),l=r(49340),c=r(79039),u=RangeError,h=String,d=isFinite,p=Math.abs,f=Math.floor,m=Math.pow,g=Math.round,A=i(1..toExponential),y=i(a),v=i("".slice),x="-6.9000e-11"===A(-69e-12,4)&&"1.25e+0"===A(1.255,2)&&"1.235e+4"===A(12345,3)&&"3e+1"===A(25,0);n({target:"Number",proto:!0,forced:!x||!(c((function(){A(1,1/0)}))&&c((function(){A(1,-1/0)})))||!!c((function(){A(1/0,1/0),A(NaN,1/0)}))},{toExponential:function(e){var t=o(this);if(void 0===e)return A(t);var r=s(e);if(!d(t))return String(t);if(r<0||r>20)throw new u("Incorrect fraction digits");if(x)return A(t,r);var n,i,a,c,_="";if(t<0&&(_="-",t=-t),0===t)i=0,n=y("0",r+1);else{var b=l(t);i=f(b);var w=m(10,i-r),E=g(t/w);2*t>=(2*E+1)*w&&(E+=1),E>=m(10,r+1)&&(E/=10,i+=1),n=h(E)}return 0!==r&&(n=v(n,0,1)+"."+v(n,1)),0===i?(a="+",c="0"):(a=i>0?"+":"-",c=h(p(i))),_+(n+"e")+a+c}})},9868:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(91291),o=r(31240),a=r(72333),l=r(79039),c=RangeError,u=String,h=Math.floor,d=i(a),p=i("".slice),f=i(1..toFixed),m=function(e,t,r){return 0===t?r:t%2==1?m(e,t-1,r*e):m(e*e,t/2,r)},g=function(e,t,r){for(var n=-1,i=r;++n<6;)i+=t*e[n],e[n]=i%1e7,i=h(i/1e7)},A=function(e,t){for(var r=6,n=0;--r>=0;)n+=e[r],e[r]=h(n/t),n=n%t*1e7},y=function(e){for(var t=6,r="";--t>=0;)if(""!==r||0===t||0!==e[t]){var n=u(e[t]);r=""===r?n:r+d("0",7-n.length)+n}return r};n({target:"Number",proto:!0,forced:l((function(){return"0.000"!==f(8e-5,3)||"1"!==f(.9,0)||"1.25"!==f(1.255,2)||"1000000000000000128"!==f(0xde0b6b3a7640080,0)}))||!l((function(){f({})}))},{toFixed:function(e){var t,r,n,i,a=o(this),l=s(e),h=[0,0,0,0,0,0],f="",v="0";if(l<0||l>20)throw new c("Incorrect fraction digits");if(a!=a)return"NaN";if(a<=-1e21||a>=1e21)return u(a);if(a<0&&(f="-",a=-a),a>1e-21)if(r=(t=function(e){for(var t=0,r=e;r>=4096;)t+=12,r/=4096;for(;r>=2;)t+=1,r/=2;return t}(a*m(2,69,1))-69)<0?a*m(2,-t,1):a/m(2,t,1),r*=4503599627370496,(t=52-t)>0){for(g(h,0,r),n=l;n>=7;)g(h,1e7,0),n-=7;for(g(h,m(10,n,1),0),n=t-1;n>=23;)A(h,1<<23),n-=23;A(h,1<0?f+((i=v.length)<=l?"0."+d("0",l-i)+v:p(v,0,i-l)+"."+p(v,i-l)):f+v}})},80630:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(79039),o=r(31240),a=i(1..toPrecision);n({target:"Number",proto:!0,forced:s((function(){return"1"!==a(1,void 0)}))||!s((function(){a({})}))},{toPrecision:function(e){return void 0===e?a(o(this)):a(o(this),e)}})},69085:(e,t,r)=>{"use strict";var n=r(46518),i=r(44213);n({target:"Object",stat:!0,arity:2,forced:Object.assign!==i},{assign:i})},59904:(e,t,r)=>{"use strict";r(46518)({target:"Object",stat:!0,sham:!r(43724)},{create:r(2360)})},17427:(e,t,r)=>{"use strict";var n=r(46518),i=r(43724),s=r(42551),o=r(79306),a=r(48981),l=r(24913);i&&n({target:"Object",proto:!0,forced:s},{__defineGetter__:function(e,t){l.f(a(this),e,{get:o(t),enumerable:!0,configurable:!0})}})},67945:(e,t,r)=>{"use strict";var n=r(46518),i=r(43724),s=r(96801).f;n({target:"Object",stat:!0,forced:Object.defineProperties!==s,sham:!i},{defineProperties:s})},84185:(e,t,r)=>{"use strict";var n=r(46518),i=r(43724),s=r(24913).f;n({target:"Object",stat:!0,forced:Object.defineProperty!==s,sham:!i},{defineProperty:s})},87607:(e,t,r)=>{"use strict";var n=r(46518),i=r(43724),s=r(42551),o=r(79306),a=r(48981),l=r(24913);i&&n({target:"Object",proto:!0,forced:s},{__defineSetter__:function(e,t){l.f(a(this),e,{set:o(t),enumerable:!0,configurable:!0})}})},5506:(e,t,r)=>{"use strict";var n=r(46518),i=r(32357).entries;n({target:"Object",stat:!0},{entries:function(e){return i(e)}})},52811:(e,t,r)=>{"use strict";var n=r(46518),i=r(92744),s=r(79039),o=r(20034),a=r(3451).onFreeze,l=Object.freeze;n({target:"Object",stat:!0,forced:s((function(){l(1)})),sham:!i},{freeze:function(e){return l&&o(e)?l(a(e)):e}})},53921:(e,t,r)=>{"use strict";var n=r(46518),i=r(72652),s=r(97040);n({target:"Object",stat:!0},{fromEntries:function(e){var t={};return i(e,(function(e,r){s(t,e,r)}),{AS_ENTRIES:!0}),t}})},83851:(e,t,r)=>{"use strict";var n=r(46518),i=r(79039),s=r(25397),o=r(77347).f,a=r(43724);n({target:"Object",stat:!0,forced:!a||i((function(){o(1)})),sham:!a},{getOwnPropertyDescriptor:function(e,t){return o(s(e),t)}})},81278:(e,t,r)=>{"use strict";var n=r(46518),i=r(43724),s=r(35031),o=r(25397),a=r(77347),l=r(97040);n({target:"Object",stat:!0,sham:!i},{getOwnPropertyDescriptors:function(e){for(var t,r,n=o(e),i=a.f,c=s(n),u={},h=0;c.length>h;)void 0!==(r=i(n,t=c[h++]))&&l(u,t,r);return u}})},1480:(e,t,r)=>{"use strict";var n=r(46518),i=r(79039),s=r(10298).f;n({target:"Object",stat:!0,forced:i((function(){return!Object.getOwnPropertyNames(1)}))},{getOwnPropertyNames:s})},49773:(e,t,r)=>{"use strict";var n=r(46518),i=r(4495),s=r(79039),o=r(33717),a=r(48981);n({target:"Object",stat:!0,forced:!i||s((function(){o.f(1)}))},{getOwnPropertySymbols:function(e){var t=o.f;return t?t(a(e)):[]}})},40875:(e,t,r)=>{"use strict";var n=r(46518),i=r(79039),s=r(48981),o=r(42787),a=r(12211);n({target:"Object",stat:!0,forced:i((function(){o(1)})),sham:!a},{getPrototypeOf:function(e){return o(s(e))}})},77691:(e,t,r)=>{"use strict";var n=r(46518),i=r(97751),s=r(79504),o=r(79306),a=r(67750),l=r(56969),c=r(72652),u=r(79039),h=Object.groupBy,d=i("Object","create"),p=s([].push);n({target:"Object",stat:!0,forced:!h||u((function(){return 1!==h("ab",(function(e){return e})).a.length}))},{groupBy:function(e,t){a(e),o(t);var r=d(null),n=0;return c(e,(function(e){var i=l(t(e,n++));i in r?p(r[i],e):r[i]=[e]})),r}})},78347:(e,t,r)=>{"use strict";r(46518)({target:"Object",stat:!0},{hasOwn:r(39297)})},94052:(e,t,r)=>{"use strict";var n=r(46518),i=r(34124);n({target:"Object",stat:!0,forced:Object.isExtensible!==i},{isExtensible:i})},94003:(e,t,r)=>{"use strict";var n=r(46518),i=r(79039),s=r(20034),o=r(22195),a=r(15652),l=Object.isFrozen;n({target:"Object",stat:!0,forced:a||i((function(){l(1)}))},{isFrozen:function(e){return!s(e)||!(!a||"ArrayBuffer"!==o(e))||!!l&&l(e)}})},221:(e,t,r)=>{"use strict";var n=r(46518),i=r(79039),s=r(20034),o=r(22195),a=r(15652),l=Object.isSealed;n({target:"Object",stat:!0,forced:a||i((function(){l(1)}))},{isSealed:function(e){return!s(e)||!(!a||"ArrayBuffer"!==o(e))||!!l&&l(e)}})},29908:(e,t,r)=>{"use strict";r(46518)({target:"Object",stat:!0},{is:r(3470)})},79432:(e,t,r)=>{"use strict";var n=r(46518),i=r(48981),s=r(71072);n({target:"Object",stat:!0,forced:r(79039)((function(){s(1)}))},{keys:function(e){return s(i(e))}})},9220:(e,t,r)=>{"use strict";var n=r(46518),i=r(43724),s=r(42551),o=r(48981),a=r(56969),l=r(42787),c=r(77347).f;i&&n({target:"Object",proto:!0,forced:s},{__lookupGetter__:function(e){var t,r=o(this),n=a(e);do{if(t=c(r,n))return t.get}while(r=l(r))}})},7904:(e,t,r)=>{"use strict";var n=r(46518),i=r(43724),s=r(42551),o=r(48981),a=r(56969),l=r(42787),c=r(77347).f;i&&n({target:"Object",proto:!0,forced:s},{__lookupSetter__:function(e){var t,r=o(this),n=a(e);do{if(t=c(r,n))return t.set}while(r=l(r))}})},93967:(e,t,r)=>{"use strict";var n=r(46518),i=r(20034),s=r(3451).onFreeze,o=r(92744),a=r(79039),l=Object.preventExtensions;n({target:"Object",stat:!0,forced:a((function(){l(1)})),sham:!o},{preventExtensions:function(e){return l&&i(e)?l(s(e)):e}})},63548:(e,t,r)=>{"use strict";var n=r(43724),i=r(62106),s=r(20034),o=r(13925),a=r(48981),l=r(67750),c=Object.getPrototypeOf,u=Object.setPrototypeOf,h=Object.prototype,d="__proto__";if(n&&c&&u&&!(d in h))try{i(h,d,{configurable:!0,get:function(){return c(a(this))},set:function(e){var t=l(this);o(e)&&s(t)&&u(t,e)}})}catch(e){}},93941:(e,t,r)=>{"use strict";var n=r(46518),i=r(20034),s=r(3451).onFreeze,o=r(92744),a=r(79039),l=Object.seal;n({target:"Object",stat:!0,forced:a((function(){l(1)})),sham:!o},{seal:function(e){return l&&i(e)?l(s(e)):e}})},10287:(e,t,r)=>{"use strict";r(46518)({target:"Object",stat:!0},{setPrototypeOf:r(52967)})},26099:(e,t,r)=>{"use strict";var n=r(92140),i=r(36840),s=r(53179);n||i(Object.prototype,"toString",s,{unsafe:!0})},16034:(e,t,r)=>{"use strict";var n=r(46518),i=r(32357).values;n({target:"Object",stat:!0},{values:function(e){return i(e)}})},78459:(e,t,r)=>{"use strict";var n=r(46518),i=r(33904);n({global:!0,forced:parseFloat!==i},{parseFloat:i})},58940:(e,t,r)=>{"use strict";var n=r(46518),i=r(52703);n({global:!0,forced:parseInt!==i},{parseInt:i})},96167:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(79306),o=r(36043),a=r(1103),l=r(72652);n({target:"Promise",stat:!0,forced:r(90537)},{allSettled:function(e){var t=this,r=o.f(t),n=r.resolve,c=r.reject,u=a((function(){var r=s(t.resolve),o=[],a=0,c=1;l(e,(function(e){var s=a++,l=!1;c++,i(r,t,e).then((function(e){l||(l=!0,o[s]={status:"fulfilled",value:e},--c||n(o))}),(function(e){l||(l=!0,o[s]={status:"rejected",reason:e},--c||n(o))}))})),--c||n(o)}));return u.error&&c(u.value),r.promise}})},16499:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(79306),o=r(36043),a=r(1103),l=r(72652);n({target:"Promise",stat:!0,forced:r(90537)},{all:function(e){var t=this,r=o.f(t),n=r.resolve,c=r.reject,u=a((function(){var r=s(t.resolve),o=[],a=0,u=1;l(e,(function(e){var s=a++,l=!1;u++,i(r,t,e).then((function(e){l||(l=!0,o[s]=e,--u||n(o))}),c)})),--u||n(o)}));return u.error&&c(u.value),r.promise}})},93518:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(79306),o=r(97751),a=r(36043),l=r(1103),c=r(72652),u=r(90537),h="No one promise resolved";n({target:"Promise",stat:!0,forced:u},{any:function(e){var t=this,r=o("AggregateError"),n=a.f(t),u=n.resolve,d=n.reject,p=l((function(){var n=s(t.resolve),o=[],a=0,l=1,p=!1;c(e,(function(e){var s=a++,c=!1;l++,i(n,t,e).then((function(e){c||p||(p=!0,u(e))}),(function(e){c||p||(c=!0,o[s]=e,--l||d(new r(o,h)))}))})),--l||d(new r(o,h))}));return p.error&&d(p.value),n.promise}})},82003:(e,t,r)=>{"use strict";var n=r(46518),i=r(96395),s=r(10916).CONSTRUCTOR,o=r(80550),a=r(97751),l=r(94901),c=r(36840),u=o&&o.prototype;if(n({target:"Promise",proto:!0,forced:s,real:!0},{catch:function(e){return this.then(void 0,e)}}),!i&&l(o)){var h=a("Promise").prototype.catch;u.catch!==h&&c(u,"catch",h,{unsafe:!0})}},10436:(e,t,r)=>{"use strict";var n,i,s,o=r(46518),a=r(96395),l=r(38574),c=r(44576),u=r(69565),h=r(36840),d=r(52967),p=r(10687),f=r(87633),m=r(79306),g=r(94901),A=r(20034),y=r(90679),v=r(2293),x=r(59225).set,_=r(91955),b=r(90757),w=r(1103),E=r(18265),M=r(91181),S=r(80550),C=r(10916),T=r(36043),I="Promise",R=C.CONSTRUCTOR,B=C.REJECTION_EVENT,P=C.SUBCLASSING,L=M.getterFor(I),D=M.set,O=S&&S.prototype,N=S,U=O,F=c.TypeError,k=c.document,z=c.process,G=T.f,Q=G,V=!!(k&&k.createEvent&&c.dispatchEvent),H="unhandledrejection",j=function(e){var t;return!(!A(e)||!g(t=e.then))&&t},q=function(e,t){var r,n,i,s=t.value,o=1===t.state,a=o?e.ok:e.fail,l=e.resolve,c=e.reject,h=e.domain;try{a?(o||(2===t.rejection&&$(t),t.rejection=1),!0===a?r=s:(h&&h.enter(),r=a(s),h&&(h.exit(),i=!0)),r===e.promise?c(new F("Promise-chain cycle")):(n=j(r))?u(n,r,l,c):l(r)):c(s)}catch(e){h&&!i&&h.exit(),c(e)}},W=function(e,t){e.notified||(e.notified=!0,_((function(){for(var r,n=e.reactions;r=n.get();)q(r,e);e.notified=!1,t&&!e.rejection&&X(e)})))},Y=function(e,t,r){var n,i;V?((n=k.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),c.dispatchEvent(n)):n={promise:t,reason:r},!B&&(i=c["on"+e])?i(n):e===H&&b("Unhandled promise rejection",r)},X=function(e){u(x,c,(function(){var t,r=e.facade,n=e.value;if(K(e)&&(t=w((function(){l?z.emit("unhandledRejection",n,r):Y(H,r,n)})),e.rejection=l||K(e)?2:1,t.error))throw t.value}))},K=function(e){return 1!==e.rejection&&!e.parent},$=function(e){u(x,c,(function(){var t=e.facade;l?z.emit("rejectionHandled",t):Y("rejectionhandled",t,e.value)}))},J=function(e,t,r){return function(n){e(t,n,r)}},Z=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,W(e,!0))},ee=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw new F("Promise can't be resolved itself");var n=j(t);n?_((function(){var r={done:!1};try{u(n,t,J(ee,r,e),J(Z,r,e))}catch(t){Z(r,t,e)}})):(e.value=t,e.state=1,W(e,!1))}catch(t){Z({done:!1},t,e)}}};if(R&&(U=(N=function(e){y(this,U),m(e),u(n,this);var t=L(this);try{e(J(ee,t),J(Z,t))}catch(e){Z(t,e)}}).prototype,(n=function(e){D(this,{type:I,done:!1,notified:!1,parent:!1,reactions:new E,rejection:!1,state:0,value:null})}).prototype=h(U,"then",(function(e,t){var r=L(this),n=G(v(this,N));return r.parent=!0,n.ok=!g(e)||e,n.fail=g(t)&&t,n.domain=l?z.domain:void 0,0===r.state?r.reactions.add(n):_((function(){q(n,r)})),n.promise})),i=function(){var e=new n,t=L(e);this.promise=e,this.resolve=J(ee,t),this.reject=J(Z,t)},T.f=G=function(e){return e===N||void 0===e?new i(e):Q(e)},!a&&g(S)&&O!==Object.prototype)){s=O.then,P||h(O,"then",(function(e,t){var r=this;return new N((function(e,t){u(s,r,e,t)})).then(e,t)}),{unsafe:!0});try{delete O.constructor}catch(e){}d&&d(O,U)}o({global:!0,constructor:!0,wrap:!0,forced:R},{Promise:N}),p(N,I,!1,!0),f(I)},9391:(e,t,r)=>{"use strict";var n=r(46518),i=r(96395),s=r(80550),o=r(79039),a=r(97751),l=r(94901),c=r(2293),u=r(93438),h=r(36840),d=s&&s.prototype;if(n({target:"Promise",proto:!0,real:!0,forced:!!s&&o((function(){d.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=c(this,a("Promise")),r=l(e);return this.then(r?function(r){return u(t,e()).then((function(){return r}))}:e,r?function(r){return u(t,e()).then((function(){throw r}))}:e)}}),!i&&l(s)){var p=a("Promise").prototype.finally;d.finally!==p&&h(d,"finally",p,{unsafe:!0})}},3362:(e,t,r)=>{"use strict";r(10436),r(16499),r(82003),r(7743),r(51481),r(40280)},7743:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(79306),o=r(36043),a=r(1103),l=r(72652);n({target:"Promise",stat:!0,forced:r(90537)},{race:function(e){var t=this,r=o.f(t),n=r.reject,c=a((function(){var o=s(t.resolve);l(e,(function(e){i(o,t,e).then(r.resolve,n)}))}));return c.error&&n(c.value),r.promise}})},51481:(e,t,r)=>{"use strict";var n=r(46518),i=r(36043);n({target:"Promise",stat:!0,forced:r(10916).CONSTRUCTOR},{reject:function(e){var t=i.f(this);return(0,t.reject)(e),t.promise}})},40280:(e,t,r)=>{"use strict";var n=r(46518),i=r(97751),s=r(96395),o=r(80550),a=r(10916).CONSTRUCTOR,l=r(93438),c=i("Promise"),u=s&&!a;n({target:"Promise",stat:!0,forced:s||a},{resolve:function(e){return l(u&&this===c?o:this,e)}})},14628:(e,t,r)=>{"use strict";var n=r(46518),i=r(36043);n({target:"Promise",stat:!0},{withResolvers:function(){var e=i.f(this);return{promise:e.promise,resolve:e.resolve,reject:e.reject}}})},39796:(e,t,r)=>{"use strict";var n=r(46518),i=r(18745),s=r(79306),o=r(28551);n({target:"Reflect",stat:!0,forced:!r(79039)((function(){Reflect.apply((function(){}))}))},{apply:function(e,t,r){return i(s(e),t,o(r))}})},60825:(e,t,r)=>{"use strict";var n=r(46518),i=r(97751),s=r(18745),o=r(30566),a=r(35548),l=r(28551),c=r(20034),u=r(2360),h=r(79039),d=i("Reflect","construct"),p=Object.prototype,f=[].push,m=h((function(){function e(){}return!(d((function(){}),[],e)instanceof e)})),g=!h((function(){d((function(){}))})),A=m||g;n({target:"Reflect",stat:!0,forced:A,sham:A},{construct:function(e,t){a(e),l(t);var r=arguments.length<3?e:a(arguments[2]);if(g&&!m)return d(e,t,r);if(e===r){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var n=[null];return s(f,n,t),new(s(o,e,n))}var i=r.prototype,h=u(c(i)?i:p),A=s(e,h,t);return c(A)?A:h}})},87411:(e,t,r)=>{"use strict";var n=r(46518),i=r(43724),s=r(28551),o=r(56969),a=r(24913);n({target:"Reflect",stat:!0,forced:r(79039)((function(){Reflect.defineProperty(a.f({},1,{value:1}),1,{value:2})})),sham:!i},{defineProperty:function(e,t,r){s(e);var n=o(t);s(r);try{return a.f(e,n,r),!0}catch(e){return!1}}})},21211:(e,t,r)=>{"use strict";var n=r(46518),i=r(28551),s=r(77347).f;n({target:"Reflect",stat:!0},{deleteProperty:function(e,t){var r=s(i(e),t);return!(r&&!r.configurable)&&delete e[t]}})},9065:(e,t,r)=>{"use strict";var n=r(46518),i=r(43724),s=r(28551),o=r(77347);n({target:"Reflect",stat:!0,sham:!i},{getOwnPropertyDescriptor:function(e,t){return o.f(s(e),t)}})},86565:(e,t,r)=>{"use strict";var n=r(46518),i=r(28551),s=r(42787);n({target:"Reflect",stat:!0,sham:!r(12211)},{getPrototypeOf:function(e){return s(i(e))}})},40888:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(20034),o=r(28551),a=r(16575),l=r(77347),c=r(42787);n({target:"Reflect",stat:!0},{get:function e(t,r){var n,u,h=arguments.length<3?t:arguments[2];return o(t)===h?t[r]:(n=l.f(t,r))?a(n)?n.value:void 0===n.get?void 0:i(n.get,h):s(u=c(t))?e(u,r,h):void 0}})},32812:(e,t,r)=>{"use strict";r(46518)({target:"Reflect",stat:!0},{has:function(e,t){return t in e}})},84634:(e,t,r)=>{"use strict";var n=r(46518),i=r(28551),s=r(34124);n({target:"Reflect",stat:!0},{isExtensible:function(e){return i(e),s(e)}})},71137:(e,t,r)=>{"use strict";r(46518)({target:"Reflect",stat:!0},{ownKeys:r(35031)})},30985:(e,t,r)=>{"use strict";var n=r(46518),i=r(97751),s=r(28551);n({target:"Reflect",stat:!0,sham:!r(92744)},{preventExtensions:function(e){s(e);try{var t=i("Object","preventExtensions");return t&&t(e),!0}catch(e){return!1}}})},34873:(e,t,r)=>{"use strict";var n=r(46518),i=r(28551),s=r(73506),o=r(52967);o&&n({target:"Reflect",stat:!0},{setPrototypeOf:function(e,t){i(e),s(t);try{return o(e,t),!0}catch(e){return!1}}})},34268:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(28551),o=r(20034),a=r(16575),l=r(79039),c=r(24913),u=r(77347),h=r(42787),d=r(6980);n({target:"Reflect",stat:!0,forced:l((function(){var e=function(){},t=c.f(new e,"a",{configurable:!0});return!1!==Reflect.set(e.prototype,"a",1,t)}))},{set:function e(t,r,n){var l,p,f,m=arguments.length<4?t:arguments[3],g=u.f(s(t),r);if(!g){if(o(p=h(t)))return e(p,r,n,m);g=d(0)}if(a(g)){if(!1===g.writable||!o(m))return!1;if(l=u.f(m,r)){if(l.get||l.set||!1===l.writable)return!1;l.value=n,c.f(m,r,l)}else c.f(m,r,d(0,n))}else{if(void 0===(f=g.set))return!1;i(f,m,n)}return!0}})},15472:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(10687);n({global:!0},{Reflect:{}}),s(i.Reflect,"Reflect",!0)},84864:(e,t,r)=>{"use strict";var n=r(43724),i=r(44576),s=r(79504),o=r(92796),a=r(23167),l=r(66699),c=r(2360),u=r(38480).f,h=r(1625),d=r(60788),p=r(655),f=r(61034),m=r(58429),g=r(11056),A=r(36840),y=r(79039),v=r(39297),x=r(91181).enforce,_=r(87633),b=r(78227),w=r(83635),E=r(18814),M=b("match"),S=i.RegExp,C=S.prototype,T=i.SyntaxError,I=s(C.exec),R=s("".charAt),B=s("".replace),P=s("".indexOf),L=s("".slice),D=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,O=/a/g,N=/a/g,U=new S(O)!==O,F=m.MISSED_STICKY,k=m.UNSUPPORTED_Y;if(o("RegExp",n&&(!U||F||w||E||y((function(){return N[M]=!1,S(O)!==O||S(N)===N||"/a/i"!==String(S(O,"i"))}))))){for(var z=function(e,t){var r,n,i,s,o,u,m=h(C,this),g=d(e),A=void 0===t,y=[],_=e;if(!m&&g&&A&&e.constructor===z)return e;if((g||h(C,e))&&(e=e.source,A&&(t=f(_))),e=void 0===e?"":p(e),t=void 0===t?"":p(t),_=e,w&&"dotAll"in O&&(n=!!t&&P(t,"s")>-1)&&(t=B(t,/s/g,"")),r=t,F&&"sticky"in O&&(i=!!t&&P(t,"y")>-1)&&k&&(t=B(t,/y/g,"")),E&&(s=function(e){for(var t,r=e.length,n=0,i="",s=[],o=c(null),a=!1,l=!1,u=0,h="";n<=r;n++){if("\\"===(t=R(e,n)))t+=R(e,++n);else if("]"===t)a=!1;else if(!a)switch(!0){case"["===t:a=!0;break;case"("===t:if(i+=t,"?:"===L(e,n+1,n+3))continue;I(D,L(e,n+1))&&(n+=2,l=!0),u++;continue;case">"===t&&l:if(""===h||v(o,h))throw new T("Invalid capture group name");o[h]=!0,s[s.length]=[h,u],l=!1,h="";continue}l?h+=t:i+=t}return[i,s]}(e),e=s[0],y=s[1]),o=a(S(e,t),m?this:C,z),(n||i||y.length)&&(u=x(o),n&&(u.dotAll=!0,u.raw=z(function(e){for(var t,r=e.length,n=0,i="",s=!1;n<=r;n++)"\\"!==(t=R(e,n))?s||"."!==t?("["===t?s=!0:"]"===t&&(s=!1),i+=t):i+="[\\s\\S]":i+=t+R(e,++n);return i}(e),r)),i&&(u.sticky=!0),y.length&&(u.groups=y)),e!==_)try{l(o,"source",""===_?"(?:)":_)}catch(e){}return o},G=u(S),Q=0;G.length>Q;)g(z,S,G[Q++]);C.constructor=z,z.prototype=C,A(i,"RegExp",z,{constructor:!0})}_("RegExp")},57465:(e,t,r)=>{"use strict";var n=r(43724),i=r(83635),s=r(22195),o=r(62106),a=r(91181).get,l=RegExp.prototype,c=TypeError;n&&i&&o(l,"dotAll",{configurable:!0,get:function(){if(this!==l){if("RegExp"===s(this))return!!a(this).dotAll;throw new c("Incompatible receiver, RegExp required")}}})},27495:(e,t,r)=>{"use strict";var n=r(46518),i=r(57323);n({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},69479:(e,t,r)=>{"use strict";var n=r(44576),i=r(43724),s=r(62106),o=r(67979),a=r(79039),l=n.RegExp,c=l.prototype;i&&a((function(){var e=!0;try{l(".","d")}catch(t){e=!1}var t={},r="",n=e?"dgimsy":"gimsy",i=function(e,n){Object.defineProperty(t,e,{get:function(){return r+=n,!0}})},s={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var o in e&&(s.hasIndices="d"),s)i(o,s[o]);return Object.getOwnPropertyDescriptor(c,"flags").get.call(t)!==n||r!==n}))&&s(c,"flags",{configurable:!0,get:o})},87745:(e,t,r)=>{"use strict";var n=r(43724),i=r(58429).MISSED_STICKY,s=r(22195),o=r(62106),a=r(91181).get,l=RegExp.prototype,c=TypeError;n&&i&&o(l,"sticky",{configurable:!0,get:function(){if(this!==l){if("RegExp"===s(this))return!!a(this).sticky;throw new c("Incompatible receiver, RegExp required")}}})},90906:(e,t,r)=>{"use strict";r(27495);var n,i,s=r(46518),o=r(69565),a=r(94901),l=r(28551),c=r(655),u=(n=!1,(i=/[ac]/).exec=function(){return n=!0,/./.exec.apply(this,arguments)},!0===i.test("abc")&&n),h=/./.test;s({target:"RegExp",proto:!0,forced:!u},{test:function(e){var t=l(this),r=c(e),n=t.exec;if(!a(n))return o(h,t,r);var i=o(n,t,r);return null!==i&&(l(i),!0)}})},38781:(e,t,r)=>{"use strict";var n=r(10350).PROPER,i=r(36840),s=r(28551),o=r(655),a=r(79039),l=r(61034),c="toString",u=RegExp.prototype,h=u[c],d=a((function(){return"/a/b"!==h.call({source:"a",flags:"b"})})),p=n&&h.name!==c;(d||p)&&i(u,c,(function(){var e=s(this);return"/"+o(e.source)+"/"+o(l(e))}),{unsafe:!0})},92405:(e,t,r)=>{"use strict";r(16468)("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),r(86938))},17642:(e,t,r)=>{"use strict";var n=r(46518),i=r(83440);n({target:"Set",proto:!0,real:!0,forced:!r(84916)("difference")},{difference:i})},58004:(e,t,r)=>{"use strict";var n=r(46518),i=r(79039),s=r(68750);n({target:"Set",proto:!0,real:!0,forced:!r(84916)("intersection")||i((function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))}))},{intersection:s})},33853:(e,t,r)=>{"use strict";var n=r(46518),i=r(64449);n({target:"Set",proto:!0,real:!0,forced:!r(84916)("isDisjointFrom")},{isDisjointFrom:i})},45876:(e,t,r)=>{"use strict";var n=r(46518),i=r(53838);n({target:"Set",proto:!0,real:!0,forced:!r(84916)("isSubsetOf")},{isSubsetOf:i})},32475:(e,t,r)=>{"use strict";var n=r(46518),i=r(28527);n({target:"Set",proto:!0,real:!0,forced:!r(84916)("isSupersetOf")},{isSupersetOf:i})},31415:(e,t,r)=>{"use strict";r(92405)},15024:(e,t,r)=>{"use strict";var n=r(46518),i=r(83650);n({target:"Set",proto:!0,real:!0,forced:!r(84916)("symmetricDifference")},{symmetricDifference:i})},31698:(e,t,r)=>{"use strict";var n=r(46518),i=r(44204);n({target:"Set",proto:!0,real:!0,forced:!r(84916)("union")},{union:i})},89907:(e,t,r)=>{"use strict";var n=r(46518),i=r(77240);n({target:"String",proto:!0,forced:r(23061)("anchor")},{anchor:function(e){return i(this,"a","name",e)}})},67357:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(67750),o=r(91291),a=r(655),l=r(79039),c=i("".charAt);n({target:"String",proto:!0,forced:l((function(){return"\ud842"!=="𠮷".at(-2)}))},{at:function(e){var t=a(s(this)),r=t.length,n=o(e),i=n>=0?n:r+n;return i<0||i>=r?void 0:c(t,i)}})},11898:(e,t,r)=>{"use strict";var n=r(46518),i=r(77240);n({target:"String",proto:!0,forced:r(23061)("big")},{big:function(){return i(this,"big","","")}})},35490:(e,t,r)=>{"use strict";var n=r(46518),i=r(77240);n({target:"String",proto:!0,forced:r(23061)("blink")},{blink:function(){return i(this,"blink","","")}})},5745:(e,t,r)=>{"use strict";var n=r(46518),i=r(77240);n({target:"String",proto:!0,forced:r(23061)("bold")},{bold:function(){return i(this,"b","","")}})},23860:(e,t,r)=>{"use strict";var n=r(46518),i=r(68183).codeAt;n({target:"String",proto:!0},{codePointAt:function(e){return i(this,e)}})},99449:(e,t,r)=>{"use strict";var n,i=r(46518),s=r(27476),o=r(77347).f,a=r(18014),l=r(655),c=r(60511),u=r(67750),h=r(41436),d=r(96395),p=s("".slice),f=Math.min,m=h("endsWith");i({target:"String",proto:!0,forced:!(!d&&!m&&(n=o(String.prototype,"endsWith"),n&&!n.writable)||m)},{endsWith:function(e){var t=l(u(this));c(e);var r=arguments.length>1?arguments[1]:void 0,n=t.length,i=void 0===r?n:f(a(r),n),s=l(e);return p(t,i-s.length,i)===s}})},94298:(e,t,r)=>{"use strict";var n=r(46518),i=r(77240);n({target:"String",proto:!0,forced:r(23061)("fixed")},{fixed:function(){return i(this,"tt","","")}})},60268:(e,t,r)=>{"use strict";var n=r(46518),i=r(77240);n({target:"String",proto:!0,forced:r(23061)("fontcolor")},{fontcolor:function(e){return i(this,"font","color",e)}})},69546:(e,t,r)=>{"use strict";var n=r(46518),i=r(77240);n({target:"String",proto:!0,forced:r(23061)("fontsize")},{fontsize:function(e){return i(this,"font","size",e)}})},27337:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(35610),o=RangeError,a=String.fromCharCode,l=String.fromCodePoint,c=i([].join);n({target:"String",stat:!0,arity:1,forced:!!l&&1!==l.length},{fromCodePoint:function(e){for(var t,r=[],n=arguments.length,i=0;n>i;){if(t=+arguments[i++],s(t,1114111)!==t)throw new o(t+" is not a valid code point");r[i]=t<65536?a(t):a(55296+((t-=65536)>>10),t%1024+56320)}return c(r,"")}})},21699:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(60511),o=r(67750),a=r(655),l=r(41436),c=i("".indexOf);n({target:"String",proto:!0,forced:!l("includes")},{includes:function(e){return!!~c(a(o(this)),a(s(e)),arguments.length>1?arguments[1]:void 0)}})},42043:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(67750),o=r(655),a=i("".charCodeAt);n({target:"String",proto:!0},{isWellFormed:function(){for(var e=o(s(this)),t=e.length,r=0;r=56320||++r>=t||56320!=(64512&a(e,r))))return!1}return!0}})},20781:(e,t,r)=>{"use strict";var n=r(46518),i=r(77240);n({target:"String",proto:!0,forced:r(23061)("italics")},{italics:function(){return i(this,"i","","")}})},47764:(e,t,r)=>{"use strict";var n=r(68183).charAt,i=r(655),s=r(91181),o=r(51088),a=r(62529),l="String Iterator",c=s.set,u=s.getterFor(l);o(String,"String",(function(e){c(this,{type:l,string:i(e),index:0})}),(function(){var e,t=u(this),r=t.string,i=t.index;return i>=r.length?a(void 0,!0):(e=n(r,i),t.index+=e.length,a(e,!1))}))},50778:(e,t,r)=>{"use strict";var n=r(46518),i=r(77240);n({target:"String",proto:!0,forced:r(23061)("link")},{link:function(e){return i(this,"a","href",e)}})},28543:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(27476),o=r(33994),a=r(62529),l=r(67750),c=r(18014),u=r(655),h=r(28551),d=r(64117),p=r(22195),f=r(60788),m=r(61034),g=r(55966),A=r(36840),y=r(79039),v=r(78227),x=r(2293),_=r(57829),b=r(56682),w=r(91181),E=r(96395),M=v("matchAll"),S="RegExp String",C=S+" Iterator",T=w.set,I=w.getterFor(C),R=RegExp.prototype,B=TypeError,P=s("".indexOf),L=s("".matchAll),D=!!L&&!y((function(){L("a",/./)})),O=o((function(e,t,r,n){T(this,{type:C,regexp:e,string:t,global:r,unicode:n,done:!1})}),S,(function(){var e=I(this);if(e.done)return a(void 0,!0);var t=e.regexp,r=e.string,n=b(t,r);return null===n?(e.done=!0,a(void 0,!0)):e.global?(""===u(n[0])&&(t.lastIndex=_(r,c(t.lastIndex),e.unicode)),a(n,!1)):(e.done=!0,a(n,!1))})),N=function(e){var t,r,n,i=h(this),s=u(e),o=x(i,RegExp),a=u(m(i));return t=new o(o===RegExp?i.source:i,a),r=!!~P(a,"g"),n=!!~P(a,"u"),t.lastIndex=c(i.lastIndex),new O(t,s,r,n)};n({target:"String",proto:!0,forced:D},{matchAll:function(e){var t,r,n,s,o=l(this);if(d(e)){if(D)return L(o,e)}else{if(f(e)&&(t=u(l(m(e))),!~P(t,"g")))throw new B("`.matchAll` does not allow non-global regexes");if(D)return L(o,e);if(void 0===(n=g(e,M))&&E&&"RegExp"===p(e)&&(n=N),n)return i(n,e,o)}return r=u(o),s=new RegExp(e,"g"),E?i(N,s,r):s[M](r)}}),E||M in R||A(R,M,N)},71761:(e,t,r)=>{"use strict";var n=r(69565),i=r(89228),s=r(28551),o=r(64117),a=r(18014),l=r(655),c=r(67750),u=r(55966),h=r(57829),d=r(56682);i("match",(function(e,t,r){return[function(t){var r=c(this),i=o(t)?void 0:u(t,e);return i?n(i,t,r):new RegExp(t)[e](l(r))},function(e){var n=s(this),i=l(e),o=r(t,n,i);if(o.done)return o.value;if(!n.global)return d(n,i);var c=n.unicode;n.lastIndex=0;for(var u,p=[],f=0;null!==(u=d(n,i));){var m=l(u[0]);p[f]=m,""===m&&(n.lastIndex=h(i,a(n.lastIndex),c)),f++}return 0===f?null:p}]}))},35701:(e,t,r)=>{"use strict";var n=r(46518),i=r(60533).end;n({target:"String",proto:!0,forced:r(83063)},{padEnd:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},68156:(e,t,r)=>{"use strict";var n=r(46518),i=r(60533).start;n({target:"String",proto:!0,forced:r(83063)},{padStart:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},85906:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(25397),o=r(48981),a=r(655),l=r(26198),c=i([].push),u=i([].join);n({target:"String",stat:!0},{raw:function(e){var t=s(o(e).raw),r=l(t);if(!r)return"";for(var n=arguments.length,i=[],h=0;;){if(c(i,a(t[h++])),h===r)return u(i,"");h{"use strict";r(46518)({target:"String",proto:!0},{repeat:r(72333)})},79978:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(79504),o=r(67750),a=r(94901),l=r(64117),c=r(60788),u=r(655),h=r(55966),d=r(61034),p=r(2478),f=r(78227),m=r(96395),g=f("replace"),A=TypeError,y=s("".indexOf),v=s("".replace),x=s("".slice),_=Math.max;n({target:"String",proto:!0},{replaceAll:function(e,t){var r,n,s,f,b,w,E,M,S,C,T=o(this),I=0,R="";if(!l(e)){if((r=c(e))&&(n=u(o(d(e))),!~y(n,"g")))throw new A("`.replaceAll` does not allow non-global regexes");if(s=h(e,g))return i(s,e,T,t);if(m&&r)return v(u(T),e,t)}for(f=u(T),b=u(e),(w=a(t))||(t=u(t)),E=b.length,M=_(1,E),S=y(f,b);-1!==S;)C=w?u(t(b,S,f)):p(b,f,S,[],void 0,t),R+=x(f,I,S)+C,I=S+E,S=S+M>f.length?-1:y(f,b,S+M);return I{"use strict";var n=r(18745),i=r(69565),s=r(79504),o=r(89228),a=r(79039),l=r(28551),c=r(94901),u=r(64117),h=r(91291),d=r(18014),p=r(655),f=r(67750),m=r(57829),g=r(55966),A=r(2478),y=r(56682),v=r(78227)("replace"),x=Math.max,_=Math.min,b=s([].concat),w=s([].push),E=s("".indexOf),M=s("".slice),S="$0"==="a".replace(/./,"$0"),C=!!/./[v]&&""===/./[v]("a","$0");o("replace",(function(e,t,r){var s=C?"$":"$0";return[function(e,r){var n=f(this),s=u(e)?void 0:g(e,v);return s?i(s,e,n,r):i(t,p(n),e,r)},function(e,i){var o=l(this),a=p(e);if("string"==typeof i&&-1===E(i,s)&&-1===E(i,"$<")){var u=r(t,o,a,i);if(u.done)return u.value}var f=c(i);f||(i=p(i));var g,v=o.global;v&&(g=o.unicode,o.lastIndex=0);for(var S,C=[];null!==(S=y(o,a))&&(w(C,S),v);)""===p(S[0])&&(o.lastIndex=m(a,d(o.lastIndex),g));for(var T,I="",R=0,B=0;B=R&&(I+=M(a,R,D)+P,R=D+L.length)}return I+M(a,R)}]}),!!a((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")}))||!S||C)},5746:(e,t,r)=>{"use strict";var n=r(69565),i=r(89228),s=r(28551),o=r(64117),a=r(67750),l=r(3470),c=r(655),u=r(55966),h=r(56682);i("search",(function(e,t,r){return[function(t){var r=a(this),i=o(t)?void 0:u(t,e);return i?n(i,t,r):new RegExp(t)[e](c(r))},function(e){var n=s(this),i=c(e),o=r(t,n,i);if(o.done)return o.value;var a=n.lastIndex;l(a,0)||(n.lastIndex=0);var u=h(n,i);return l(n.lastIndex,a)||(n.lastIndex=a),null===u?-1:u.index}]}))},89195:(e,t,r)=>{"use strict";var n=r(46518),i=r(77240);n({target:"String",proto:!0,forced:r(23061)("small")},{small:function(){return i(this,"small","","")}})},90744:(e,t,r)=>{"use strict";var n=r(69565),i=r(79504),s=r(89228),o=r(28551),a=r(64117),l=r(67750),c=r(2293),u=r(57829),h=r(18014),d=r(655),p=r(55966),f=r(56682),m=r(58429),g=r(79039),A=m.UNSUPPORTED_Y,y=Math.min,v=i([].push),x=i("".slice),_=!g((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return 2!==r.length||"a"!==r[0]||"b"!==r[1]})),b="c"==="abbc".split(/(b)*/)[1]||4!=="test".split(/(?:)/,-1).length||2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length;s("split",(function(e,t,r){var i="0".split(void 0,0).length?function(e,r){return void 0===e&&0===r?[]:n(t,this,e,r)}:t;return[function(t,r){var s=l(this),o=a(t)?void 0:p(t,e);return o?n(o,t,s,r):n(i,d(s),t,r)},function(e,n){var s=o(this),a=d(e);if(!b){var l=r(i,s,a,n,i!==t);if(l.done)return l.value}var p=c(s,RegExp),m=s.unicode,g=(s.ignoreCase?"i":"")+(s.multiline?"m":"")+(s.unicode?"u":"")+(A?"g":"y"),_=new p(A?"^(?:"+s.source+")":s,g),w=void 0===n?4294967295:n>>>0;if(0===w)return[];if(0===a.length)return null===f(_,a)?[a]:[];for(var E=0,M=0,S=[];M{"use strict";var n,i=r(46518),s=r(27476),o=r(77347).f,a=r(18014),l=r(655),c=r(60511),u=r(67750),h=r(41436),d=r(96395),p=s("".slice),f=Math.min,m=h("startsWith");i({target:"String",proto:!0,forced:!(!d&&!m&&(n=o(String.prototype,"startsWith"),n&&!n.writable)||m)},{startsWith:function(e){var t=l(u(this));c(e);var r=a(f(arguments.length>1?arguments[1]:void 0,t.length)),n=l(e);return p(t,r,r+n.length)===n}})},46276:(e,t,r)=>{"use strict";var n=r(46518),i=r(77240);n({target:"String",proto:!0,forced:r(23061)("strike")},{strike:function(){return i(this,"strike","","")}})},48718:(e,t,r)=>{"use strict";var n=r(46518),i=r(77240);n({target:"String",proto:!0,forced:r(23061)("sub")},{sub:function(){return i(this,"sub","","")}})},50375:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(67750),o=r(91291),a=r(655),l=i("".slice),c=Math.max,u=Math.min;n({target:"String",proto:!0,forced:!"".substr||"b"!=="ab".substr(-1)},{substr:function(e,t){var r,n,i=a(s(this)),h=i.length,d=o(e);return d===1/0&&(d=0),d<0&&(d=c(h+d,0)),(r=void 0===t?h:o(t))<=0||r===1/0||d>=(n=u(d+r,h))?"":l(i,d,n)}})},16308:(e,t,r)=>{"use strict";var n=r(46518),i=r(77240);n({target:"String",proto:!0,forced:r(23061)("sup")},{sup:function(){return i(this,"sup","","")}})},67438:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(79504),o=r(67750),a=r(655),l=r(79039),c=Array,u=s("".charAt),h=s("".charCodeAt),d=s([].join),p="".toWellFormed,f=p&&l((function(){return"1"!==i(p,1)}));n({target:"String",proto:!0,forced:f},{toWellFormed:function(){var e=a(o(this));if(f)return i(p,e);for(var t=e.length,r=c(t),n=0;n=56320||n+1>=t||56320!=(64512&h(e,n+1))?r[n]="�":(r[n]=u(e,n),r[++n]=u(e,n))}return d(r,"")}})},39202:(e,t,r)=>{"use strict";r(33313);var n=r(46518),i=r(18866);n({target:"String",proto:!0,name:"trimEnd",forced:"".trimEnd!==i},{trimEnd:i})},58934:(e,t,r)=>{"use strict";var n=r(46518),i=r(53487);n({target:"String",proto:!0,name:"trimStart",forced:"".trimLeft!==i},{trimLeft:i})},33313:(e,t,r)=>{"use strict";var n=r(46518),i=r(18866);n({target:"String",proto:!0,name:"trimEnd",forced:"".trimRight!==i},{trimRight:i})},43359:(e,t,r)=>{"use strict";r(58934);var n=r(46518),i=r(53487);n({target:"String",proto:!0,name:"trimStart",forced:"".trimStart!==i},{trimStart:i})},42762:(e,t,r)=>{"use strict";var n=r(46518),i=r(43802).trim;n({target:"String",proto:!0,forced:r(60706)("trim")},{trim:function(){return i(this)}})},66412:(e,t,r)=>{"use strict";r(70511)("asyncIterator")},6761:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(69565),o=r(79504),a=r(96395),l=r(43724),c=r(4495),u=r(79039),h=r(39297),d=r(1625),p=r(28551),f=r(25397),m=r(56969),g=r(655),A=r(6980),y=r(2360),v=r(71072),x=r(38480),_=r(10298),b=r(33717),w=r(77347),E=r(24913),M=r(96801),S=r(48773),C=r(36840),T=r(62106),I=r(25745),R=r(66119),B=r(30421),P=r(33392),L=r(78227),D=r(1951),O=r(70511),N=r(58242),U=r(10687),F=r(91181),k=r(59213).forEach,z=R("hidden"),G="Symbol",Q="prototype",V=F.set,H=F.getterFor(G),j=Object[Q],q=i.Symbol,W=q&&q[Q],Y=i.RangeError,X=i.TypeError,K=i.QObject,$=w.f,J=E.f,Z=_.f,ee=S.f,te=o([].push),re=I("symbols"),ne=I("op-symbols"),ie=I("wks"),se=!K||!K[Q]||!K[Q].findChild,oe=function(e,t,r){var n=$(j,t);n&&delete j[t],J(e,t,r),n&&e!==j&&J(j,t,n)},ae=l&&u((function(){return 7!==y(J({},"a",{get:function(){return J(this,"a",{value:7}).a}})).a}))?oe:J,le=function(e,t){var r=re[e]=y(W);return V(r,{type:G,tag:e,description:t}),l||(r.description=t),r},ce=function(e,t,r){e===j&&ce(ne,t,r),p(e);var n=m(t);return p(r),h(re,n)?(r.enumerable?(h(e,z)&&e[z][n]&&(e[z][n]=!1),r=y(r,{enumerable:A(0,!1)})):(h(e,z)||J(e,z,A(1,y(null))),e[z][n]=!0),ae(e,n,r)):J(e,n,r)},ue=function(e,t){p(e);var r=f(t),n=v(r).concat(fe(r));return k(n,(function(t){l&&!s(he,r,t)||ce(e,t,r[t])})),e},he=function(e){var t=m(e),r=s(ee,this,t);return!(this===j&&h(re,t)&&!h(ne,t))&&(!(r||!h(this,t)||!h(re,t)||h(this,z)&&this[z][t])||r)},de=function(e,t){var r=f(e),n=m(t);if(r!==j||!h(re,n)||h(ne,n)){var i=$(r,n);return!i||!h(re,n)||h(r,z)&&r[z][n]||(i.enumerable=!0),i}},pe=function(e){var t=Z(f(e)),r=[];return k(t,(function(e){h(re,e)||h(B,e)||te(r,e)})),r},fe=function(e){var t=e===j,r=Z(t?ne:f(e)),n=[];return k(r,(function(e){!h(re,e)||t&&!h(j,e)||te(n,re[e])})),n};c||(C(W=(q=function(){if(d(W,this))throw new X("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?g(arguments[0]):void 0,t=P(e),r=function(e){var n=void 0===this?i:this;n===j&&s(r,ne,e),h(n,z)&&h(n[z],t)&&(n[z][t]=!1);var o=A(1,e);try{ae(n,t,o)}catch(e){if(!(e instanceof Y))throw e;oe(n,t,o)}};return l&&se&&ae(j,t,{configurable:!0,set:r}),le(t,e)})[Q],"toString",(function(){return H(this).tag})),C(q,"withoutSetter",(function(e){return le(P(e),e)})),S.f=he,E.f=ce,M.f=ue,w.f=de,x.f=_.f=pe,b.f=fe,D.f=function(e){return le(L(e),e)},l&&(T(W,"description",{configurable:!0,get:function(){return H(this).description}}),a||C(j,"propertyIsEnumerable",he,{unsafe:!0}))),n({global:!0,constructor:!0,wrap:!0,forced:!c,sham:!c},{Symbol:q}),k(v(ie),(function(e){O(e)})),n({target:G,stat:!0,forced:!c},{useSetter:function(){se=!0},useSimple:function(){se=!1}}),n({target:"Object",stat:!0,forced:!c,sham:!l},{create:function(e,t){return void 0===t?y(e):ue(y(e),t)},defineProperty:ce,defineProperties:ue,getOwnPropertyDescriptor:de}),n({target:"Object",stat:!0,forced:!c},{getOwnPropertyNames:pe}),N(),U(q,G),B[z]=!0},89463:(e,t,r)=>{"use strict";var n=r(46518),i=r(43724),s=r(44576),o=r(79504),a=r(39297),l=r(94901),c=r(1625),u=r(655),h=r(62106),d=r(77740),p=s.Symbol,f=p&&p.prototype;if(i&&l(p)&&(!("description"in f)||void 0!==p().description)){var m={},g=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:u(arguments[0]),t=c(f,this)?new p(e):void 0===e?p():p(e);return""===e&&(m[t]=!0),t};d(g,p),g.prototype=f,f.constructor=g;var A="Symbol(description detection)"===String(p("description detection")),y=o(f.valueOf),v=o(f.toString),x=/^Symbol\((.*)\)[^)]+$/,_=o("".replace),b=o("".slice);h(f,"description",{configurable:!0,get:function(){var e=y(this);if(a(m,e))return"";var t=v(e),r=A?b(t,7,-1):_(t,x,"$1");return""===r?void 0:r}}),n({global:!0,constructor:!0,forced:!0},{Symbol:g})}},81510:(e,t,r)=>{"use strict";var n=r(46518),i=r(97751),s=r(39297),o=r(655),a=r(25745),l=r(91296),c=a("string-to-symbol-registry"),u=a("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!l},{for:function(e){var t=o(e);if(s(c,t))return c[t];var r=i("Symbol")(t);return c[t]=r,u[r]=t,r}})},60193:(e,t,r)=>{"use strict";r(70511)("hasInstance")},92168:(e,t,r)=>{"use strict";r(70511)("isConcatSpreadable")},2259:(e,t,r)=>{"use strict";r(70511)("iterator")},52675:(e,t,r)=>{"use strict";r(6761),r(81510),r(97812),r(33110),r(49773)},97812:(e,t,r)=>{"use strict";var n=r(46518),i=r(39297),s=r(10757),o=r(16823),a=r(25745),l=r(91296),c=a("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!l},{keyFor:function(e){if(!s(e))throw new TypeError(o(e)+" is not a symbol");if(i(c,e))return c[e]}})},83142:(e,t,r)=>{"use strict";r(70511)("matchAll")},86964:(e,t,r)=>{"use strict";r(70511)("match")},83237:(e,t,r)=>{"use strict";r(70511)("replace")},61833:(e,t,r)=>{"use strict";r(70511)("search")},67947:(e,t,r)=>{"use strict";r(70511)("species")},31073:(e,t,r)=>{"use strict";r(70511)("split")},45700:(e,t,r)=>{"use strict";var n=r(70511),i=r(58242);n("toPrimitive"),i()},78125:(e,t,r)=>{"use strict";var n=r(97751),i=r(70511),s=r(10687);i("toStringTag"),s(n("Symbol"),"Symbol")},20326:(e,t,r)=>{"use strict";r(70511)("unscopables")},48140:(e,t,r)=>{"use strict";var n=r(94644),i=r(26198),s=r(91291),o=n.aTypedArray;(0,n.exportTypedArrayMethod)("at",(function(e){var t=o(this),r=i(t),n=s(e),a=n>=0?n:r+n;return a<0||a>=r?void 0:t[a]}))},81630:(e,t,r)=>{"use strict";var n=r(79504),i=r(94644),s=n(r(57029)),o=i.aTypedArray;(0,i.exportTypedArrayMethod)("copyWithin",(function(e,t){return s(o(this),e,t,arguments.length>2?arguments[2]:void 0)}))},72170:(e,t,r)=>{"use strict";var n=r(94644),i=r(59213).every,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("every",(function(e){return i(s(this),e,arguments.length>1?arguments[1]:void 0)}))},75044:(e,t,r)=>{"use strict";var n=r(94644),i=r(84373),s=r(75854),o=r(36955),a=r(69565),l=r(79504),c=r(79039),u=n.aTypedArray,h=n.exportTypedArrayMethod,d=l("".slice);h("fill",(function(e){var t=arguments.length;u(this);var r="Big"===d(o(this),0,3)?s(e):+e;return a(i,this,r,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)}),c((function(){var e=0;return new Int8Array(2).fill({valueOf:function(){return e++}}),1!==e})))},69539:(e,t,r)=>{"use strict";var n=r(94644),i=r(59213).filter,s=r(26357),o=n.aTypedArray;(0,n.exportTypedArrayMethod)("filter",(function(e){var t=i(o(this),e,arguments.length>1?arguments[1]:void 0);return s(this,t)}))},89955:(e,t,r)=>{"use strict";var n=r(94644),i=r(59213).findIndex,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("findIndex",(function(e){return i(s(this),e,arguments.length>1?arguments[1]:void 0)}))},91134:(e,t,r)=>{"use strict";var n=r(94644),i=r(43839).findLastIndex,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("findLastIndex",(function(e){return i(s(this),e,arguments.length>1?arguments[1]:void 0)}))},21903:(e,t,r)=>{"use strict";var n=r(94644),i=r(43839).findLast,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("findLast",(function(e){return i(s(this),e,arguments.length>1?arguments[1]:void 0)}))},31694:(e,t,r)=>{"use strict";var n=r(94644),i=r(59213).find,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("find",(function(e){return i(s(this),e,arguments.length>1?arguments[1]:void 0)}))},34594:(e,t,r)=>{"use strict";r(15823)("Float32",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},29833:(e,t,r)=>{"use strict";r(15823)("Float64",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},33206:(e,t,r)=>{"use strict";var n=r(94644),i=r(59213).forEach,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("forEach",(function(e){i(s(this),e,arguments.length>1?arguments[1]:void 0)}))},48345:(e,t,r)=>{"use strict";var n=r(72805);(0,r(94644).exportTypedArrayStaticMethod)("from",r(43251),n)},44496:(e,t,r)=>{"use strict";var n=r(94644),i=r(19617).includes,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("includes",(function(e){return i(s(this),e,arguments.length>1?arguments[1]:void 0)}))},66651:(e,t,r)=>{"use strict";var n=r(94644),i=r(19617).indexOf,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("indexOf",(function(e){return i(s(this),e,arguments.length>1?arguments[1]:void 0)}))},72107:(e,t,r)=>{"use strict";r(15823)("Int16",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},95477:(e,t,r)=>{"use strict";r(15823)("Int32",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},46594:(e,t,r)=>{"use strict";r(15823)("Int8",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},12887:(e,t,r)=>{"use strict";var n=r(44576),i=r(79039),s=r(79504),o=r(94644),a=r(23792),l=r(78227)("iterator"),c=n.Uint8Array,u=s(a.values),h=s(a.keys),d=s(a.entries),p=o.aTypedArray,f=o.exportTypedArrayMethod,m=c&&c.prototype,g=!i((function(){m[l].call([1])})),A=!!m&&m.values&&m[l]===m.values&&"values"===m.values.name,y=function(){return u(p(this))};f("entries",(function(){return d(p(this))}),g),f("keys",(function(){return h(p(this))}),g),f("values",y,g||!A,{name:"values"}),f(l,y,g||!A,{name:"values"})},19369:(e,t,r)=>{"use strict";var n=r(94644),i=r(79504),s=n.aTypedArray,o=n.exportTypedArrayMethod,a=i([].join);o("join",(function(e){return a(s(this),e)}))},66812:(e,t,r)=>{"use strict";var n=r(94644),i=r(18745),s=r(8379),o=n.aTypedArray;(0,n.exportTypedArrayMethod)("lastIndexOf",(function(e){var t=arguments.length;return i(s,o(this),t>1?[e,arguments[1]]:[e])}))},8995:(e,t,r)=>{"use strict";var n=r(94644),i=r(59213).map,s=r(61412),o=n.aTypedArray;(0,n.exportTypedArrayMethod)("map",(function(e){return i(o(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(s(e))(t)}))}))},52568:(e,t,r)=>{"use strict";var n=r(94644),i=r(72805),s=n.aTypedArrayConstructor;(0,n.exportTypedArrayStaticMethod)("of",(function(){for(var e=0,t=arguments.length,r=new(s(this))(t);t>e;)r[e]=arguments[e++];return r}),i)},36072:(e,t,r)=>{"use strict";var n=r(94644),i=r(80926).right,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("reduceRight",(function(e){var t=arguments.length;return i(s(this),e,t,t>1?arguments[1]:void 0)}))},31575:(e,t,r)=>{"use strict";var n=r(94644),i=r(80926).left,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("reduce",(function(e){var t=arguments.length;return i(s(this),e,t,t>1?arguments[1]:void 0)}))},88747:(e,t,r)=>{"use strict";var n=r(94644),i=n.aTypedArray,s=n.exportTypedArrayMethod,o=Math.floor;s("reverse",(function(){for(var e,t=this,r=i(t).length,n=o(r/2),s=0;s{"use strict";var n=r(44576),i=r(69565),s=r(94644),o=r(26198),a=r(58229),l=r(48981),c=r(79039),u=n.RangeError,h=n.Int8Array,d=h&&h.prototype,p=d&&d.set,f=s.aTypedArray,m=s.exportTypedArrayMethod,g=!c((function(){var e=new Uint8ClampedArray(2);return i(p,e,{length:1,0:3},1),3!==e[1]})),A=g&&s.NATIVE_ARRAY_BUFFER_VIEWS&&c((function(){var e=new h(2);return e.set(1),e.set("2",1),0!==e[0]||2!==e[1]}));m("set",(function(e){f(this);var t=a(arguments.length>1?arguments[1]:void 0,1),r=l(e);if(g)return i(p,this,r,t);var n=this.length,s=o(r),c=0;if(s+t>n)throw new u("Wrong length");for(;c{"use strict";var n=r(94644),i=r(61412),s=r(79039),o=r(67680),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("slice",(function(e,t){for(var r=o(a(this),e,t),n=i(this),s=0,l=r.length,c=new n(l);l>s;)c[s]=r[s++];return c}),s((function(){new Int8Array(1).slice()})))},57301:(e,t,r)=>{"use strict";var n=r(94644),i=r(59213).some,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("some",(function(e){return i(s(this),e,arguments.length>1?arguments[1]:void 0)}))},373:(e,t,r)=>{"use strict";var n=r(44576),i=r(27476),s=r(79039),o=r(79306),a=r(74488),l=r(94644),c=r(13709),u=r(13763),h=r(39519),d=r(3607),p=l.aTypedArray,f=l.exportTypedArrayMethod,m=n.Uint16Array,g=m&&i(m.prototype.sort),A=!(!g||s((function(){g(new m(2),null)}))&&s((function(){g(new m(2),{})}))),y=!!g&&!s((function(){if(h)return h<74;if(c)return c<67;if(u)return!0;if(d)return d<602;var e,t,r=new m(516),n=Array(516);for(e=0;e<516;e++)t=e%4,r[e]=515-e,n[e]=e-2*t+3;for(g(r,(function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(r[e]!==n[e])return!0}));f("sort",(function(e){return void 0!==e&&o(e),y?g(this,e):a(p(this),function(e){return function(t,r){return void 0!==e?+e(t,r)||0:r!=r?-1:t!=t?1:0===t&&0===r?1/t>0&&1/r<0?1:-1:t>r}}(e))}),!y||A)},86614:(e,t,r)=>{"use strict";var n=r(94644),i=r(18014),s=r(35610),o=r(61412),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("subarray",(function(e,t){var r=a(this),n=r.length,l=s(e,n);return new(o(r))(r.buffer,r.byteOffset+l*r.BYTES_PER_ELEMENT,i((void 0===t?n:s(t,n))-l))}))},41405:(e,t,r)=>{"use strict";var n=r(44576),i=r(18745),s=r(94644),o=r(79039),a=r(67680),l=n.Int8Array,c=s.aTypedArray,u=s.exportTypedArrayMethod,h=[].toLocaleString,d=!!l&&o((function(){h.call(new l(1))}));u("toLocaleString",(function(){return i(h,d?a(c(this)):c(this),a(arguments))}),o((function(){return[1,2].toLocaleString()!==new l([1,2]).toLocaleString()}))||!o((function(){l.prototype.toLocaleString.call([1,2])})))},37467:(e,t,r)=>{"use strict";var n=r(37628),i=r(94644),s=i.aTypedArray,o=i.exportTypedArrayMethod,a=i.getTypedArrayConstructor;o("toReversed",(function(){return n(s(this),a(this))}))},44732:(e,t,r)=>{"use strict";var n=r(94644),i=r(79504),s=r(79306),o=r(35370),a=n.aTypedArray,l=n.getTypedArrayConstructor,c=n.exportTypedArrayMethod,u=i(n.TypedArrayPrototype.sort);c("toSorted",(function(e){void 0!==e&&s(e);var t=a(this),r=o(l(t),t);return u(r,e)}))},33684:(e,t,r)=>{"use strict";var n=r(94644).exportTypedArrayMethod,i=r(79039),s=r(44576),o=r(79504),a=s.Uint8Array,l=a&&a.prototype||{},c=[].toString,u=o([].join);i((function(){c.call({})}))&&(c=function(){return u(this)});var h=l.toString!==c;n("toString",c,h)},3690:(e,t,r)=>{"use strict";r(15823)("Uint16",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},61740:(e,t,r)=>{"use strict";r(15823)("Uint32",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},21489:(e,t,r)=>{"use strict";r(15823)("Uint8",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},22134:(e,t,r)=>{"use strict";r(15823)("Uint8",(function(e){return function(t,r,n){return e(this,t,r,n)}}),!0)},79577:(e,t,r)=>{"use strict";var n=r(39928),i=r(94644),s=r(18727),o=r(91291),a=r(75854),l=i.aTypedArray,c=i.getTypedArrayConstructor,u=i.exportTypedArrayMethod,h=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(e){return 8===e}}();u("with",{with:function(e,t){var r=l(this),i=o(e),u=s(r)?a(t):+t;return n(r,c(r),i,u)}}.with,!h)},88267:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(655),o=String.fromCharCode,a=i("".charAt),l=i(/./.exec),c=i("".slice),u=/^[\da-f]{2}$/i,h=/^[\da-f]{4}$/i;n({global:!0},{unescape:function(e){for(var t,r,n=s(e),i="",d=n.length,p=0;p{"use strict";var n,i=r(92744),s=r(44576),o=r(79504),a=r(56279),l=r(3451),c=r(16468),u=r(91625),h=r(20034),d=r(91181).enforce,p=r(79039),f=r(58622),m=Object,g=Array.isArray,A=m.isExtensible,y=m.isFrozen,v=m.isSealed,x=m.freeze,_=m.seal,b=!s.ActiveXObject&&"ActiveXObject"in s,w=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},E=c("WeakMap",w,u),M=E.prototype,S=o(M.set);if(f)if(b){n=u.getConstructor(w,"WeakMap",!0),l.enable();var C=o(M.delete),T=o(M.has),I=o(M.get);a(M,{delete:function(e){if(h(e)&&!A(e)){var t=d(this);return t.frozen||(t.frozen=new n),C(this,e)||t.frozen.delete(e)}return C(this,e)},has:function(e){if(h(e)&&!A(e)){var t=d(this);return t.frozen||(t.frozen=new n),T(this,e)||t.frozen.has(e)}return T(this,e)},get:function(e){if(h(e)&&!A(e)){var t=d(this);return t.frozen||(t.frozen=new n),T(this,e)?I(this,e):t.frozen.get(e)}return I(this,e)},set:function(e,t){if(h(e)&&!A(e)){var r=d(this);r.frozen||(r.frozen=new n),T(this,e)?S(this,e,t):r.frozen.set(e,t)}else S(this,e,t);return this}})}else i&&p((function(){var e=x([]);return S(new E,e,1),!y(e)}))&&a(M,{set:function(e,t){var r;return g(e)&&(y(e)?r=x:v(e)&&(r=_)),S(this,e,t),r&&r(e),this}})},73772:(e,t,r)=>{"use strict";r(65746)},5240:(e,t,r)=>{"use strict";r(16468)("WeakSet",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),r(91625))},30958:(e,t,r)=>{"use strict";r(5240)},49806:(e,t,r)=>{"use strict";r(30067)},26280:(e,t,r)=>{"use strict";r(16573)},47801:(e,t,r)=>{"use strict";r(77936)},27913:(e,t,r)=>{"use strict";r(78100)},34504:(e,t,r)=>{"use strict";r(18107)},87370:(e,t,r)=>{"use strict";var n=r(46518),i=r(59213).filterReject,s=r(6469);n({target:"Array",proto:!0,forced:!0},{filterOut:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),s("filterOut")},31659:(e,t,r)=>{"use strict";var n=r(46518),i=r(59213).filterReject,s=r(6469);n({target:"Array",proto:!0,forced:!0},{filterReject:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),s("filterReject")},17978:(e,t,r)=>{"use strict";r(13451)},95115:(e,t,r)=>{"use strict";r(10838)},26148:(e,t,r)=>{"use strict";var n=r(46518),i=r(8045),s=r(79039),o=Array.fromAsync;n({target:"Array",stat:!0,forced:!o||s((function(){var e=0;return o.call((function(){return e++,[]}),{length:0}),1!==e}))},{fromAsync:i})},88177:(e,t,r)=>{"use strict";var n=r(46518),i=r(34598),s=r(6469),o=r(2952);n({target:"Array",proto:!0,name:"groupToMap",forced:r(96395)||!i("groupByToMap")},{groupByToMap:o}),s("groupByToMap")},6986:(e,t,r)=>{"use strict";var n=r(46518),i=r(77957),s=r(34598),o=r(6469);n({target:"Array",proto:!0,forced:!s("groupBy")},{groupBy:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),o("groupBy")},80081:(e,t,r)=>{"use strict";var n=r(46518),i=r(6469),s=r(2952);n({target:"Array",proto:!0,forced:r(96395)},{groupToMap:s}),i("groupToMap")},46058:(e,t,r)=>{"use strict";var n=r(46518),i=r(77957),s=r(6469);n({target:"Array",proto:!0},{group:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),s("group")},45490:(e,t,r)=>{"use strict";var n=r(46518),i=r(34376),s=Object.isFrozen,o=function(e,t){if(!s||!i(e)||!s(e))return!1;for(var r,n=0,o=e.length;n{"use strict";var n=r(43724),i=r(6469),s=r(48981),o=r(26198),a=r(62106);n&&(a(Array.prototype,"lastIndex",{configurable:!0,get:function(){var e=s(this),t=o(e);return 0===t?0:t-1}}),i("lastIndex"))},55105:(e,t,r)=>{"use strict";var n=r(43724),i=r(6469),s=r(48981),o=r(26198),a=r(62106);n&&(a(Array.prototype,"lastItem",{configurable:!0,get:function(){var e=s(this),t=o(e);return 0===t?void 0:e[t-1]},set:function(e){var t=s(this),r=o(t);return t[0===r?0:r-1]=e}}),i("lastItem"))},54151:(e,t,r)=>{"use strict";r(9678)},72400:(e,t,r)=>{"use strict";r(57145)},73677:(e,t,r)=>{"use strict";r(71658)},61938:(e,t,r)=>{"use strict";var n=r(46518),i=r(6469);n({target:"Array",proto:!0,forced:!0},{uniqueBy:r(79565)}),i("uniqueBy")},85901:(e,t,r)=>{"use strict";r(11558)},82750:(e,t,r)=>{"use strict";var n=r(46518),i=r(43724),s=r(97751),o=r(79306),a=r(90679),l=r(36840),c=r(56279),u=r(62106),h=r(78227),d=r(91181),p=r(91021),f=s("Promise"),m=s("SuppressedError"),g=ReferenceError,A=h("asyncDispose"),y=h("toStringTag"),v="AsyncDisposableStack",x=d.set,_=d.getterFor(v),b="async-dispose",w="disposed",E=function(e){var t=_(e);if(t.state===w)throw new g(v+" already disposed");return t},M=function(){x(a(this,S),{type:v,state:"pending",stack:[]}),i||(this.disposed=!1)},S=M.prototype;c(S,{disposeAsync:function(){var e=this;return new f((function(t,r){var n=_(e);if(n.state===w)return t(void 0);n.state=w,i||(e.disposed=!0);var s,o=n.stack,a=o.length,l=!1,c=function(e){l?s=new m(e,s):(l=!0,s=e),u()},u=function(){if(a){var e=o[--a];o[a]=null;try{f.resolve(e()).then(u,c)}catch(e){c(e)}}else n.stack=null,l?r(s):t(void 0)};u()}))},use:function(e){return p(E(this),e,b),e},adopt:function(e,t){var r=E(this);return o(t),p(r,void 0,b,(function(){return t(e)})),e},defer:function(e){var t=E(this);o(e),p(t,void 0,b,e)},move:function(){var e=E(this),t=new M;return _(t).stack=e.stack,e.stack=[],e.state=w,i||(this.disposed=!0),t}}),i&&u(S,"disposed",{configurable:!0,get:function(){return _(this).state===w}}),l(S,A,S.disposeAsync,{name:"disposeAsync"}),l(S,y,v,{nonWritable:!0}),n({global:!0,constructor:!0},{AsyncDisposableStack:M})},84847:(e,t,r)=>{"use strict";r(46518)({target:"AsyncIterator",name:"indexed",proto:!0,real:!0,forced:!0},{asIndexedPairs:r(87481)})},74147:(e,t,r)=>{"use strict";var n=r(69565),i=r(36840),s=r(97751),o=r(55966),a=r(39297),l=r(78227),c=r(53982),u=l("asyncDispose"),h=s("Promise");a(c,u)||i(c,u,(function(){var e=this;return new h((function(t,r){var i=o(e,"return");i?h.resolve(n(i,e)).then((function(){t(void 0)}),r):t(void 0)}))}))},33811:(e,t,r)=>{"use strict";var n=r(46518),i=r(90679),s=r(42787),o=r(66699),a=r(39297),l=r(78227),c=r(53982),u=r(96395),h=l("toStringTag"),d=TypeError,p=function(){if(i(this,c),s(this)===c)throw new d("Abstract class AsyncIterator not directly constructable")};p.prototype=c,a(c,h)||o(c,h,"AsyncIterator"),!u&&a(c,"constructor")&&c.constructor!==Object||o(c,"constructor",p),n({global:!0,constructor:!0,forced:u},{AsyncIterator:p})},29150:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(28551),o=r(1767),a=r(24149),l=r(99590),c=r(92059),u=r(62529),h=r(96395),d=c((function(e){var t=this;return new e((function(r,n){var o=function(e){t.done=!0,n(e)},a=function(){try{e.resolve(s(i(t.next,t.iterator))).then((function(e){try{s(e).done?(t.done=!0,r(u(void 0,!0))):t.remaining?(t.remaining--,a()):r(u(e.value,!1))}catch(e){o(e)}}),o)}catch(e){o(e)}};a()}))}));n({target:"AsyncIterator",proto:!0,real:!0,forced:h},{drop:function(e){s(this);var t=l(a(+e));return new d(o(this),{remaining:t})}})},74648:(e,t,r)=>{"use strict";var n=r(46518),i=r(36639).every;n({target:"AsyncIterator",proto:!0,real:!0},{every:function(e){return i(this,e)}})},17333:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(79306),o=r(28551),a=r(20034),l=r(1767),c=r(92059),u=r(62529),h=r(20772),d=r(96395),p=c((function(e){var t=this,r=t.iterator,n=t.predicate;return new e((function(s,l){var c=function(e){t.done=!0,l(e)},d=function(e){h(r,c,e,c)},p=function(){try{e.resolve(o(i(t.next,r))).then((function(r){try{if(o(r).done)t.done=!0,s(u(void 0,!0));else{var i=r.value;try{var l=n(i,t.counter++),h=function(e){e?s(u(i,!1)):p()};a(l)?e.resolve(l).then(h,d):h(l)}catch(e){d(e)}}}catch(e){c(e)}}),c)}catch(e){c(e)}};p()}))}));n({target:"AsyncIterator",proto:!0,real:!0,forced:d},{filter:function(e){return o(this),s(e),new p(l(this),{predicate:e})}})},3064:(e,t,r)=>{"use strict";var n=r(46518),i=r(36639).find;n({target:"AsyncIterator",proto:!0,real:!0},{find:function(e){return i(this,e)}})},32679:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(79306),o=r(28551),a=r(20034),l=r(1767),c=r(92059),u=r(62529),h=r(50133),d=r(20772),p=r(96395),f=c((function(e){var t=this,r=t.iterator,n=t.mapper;return new e((function(s,l){var c=function(e){t.done=!0,l(e)},p=function(e){d(r,c,e,c)},f=function(){try{e.resolve(o(i(t.next,r))).then((function(r){try{if(o(r).done)t.done=!0,s(u(void 0,!0));else{var i=r.value;try{var l=n(i,t.counter++),d=function(e){try{t.inner=h(e),m()}catch(e){p(e)}};a(l)?e.resolve(l).then(d,p):d(l)}catch(e){p(e)}}}catch(e){c(e)}}),c)}catch(e){c(e)}},m=function(){var r=t.inner;if(r)try{e.resolve(o(i(r.next,r.iterator))).then((function(e){try{o(e).done?(t.inner=null,f()):s(u(e.value,!1))}catch(e){p(e)}}),p)}catch(e){p(e)}else f()};m()}))}));n({target:"AsyncIterator",proto:!0,real:!0,forced:p},{flatMap:function(e){return o(this),s(e),new f(l(this),{mapper:e,inner:null})}})},9920:(e,t,r)=>{"use strict";var n=r(46518),i=r(36639).forEach;n({target:"AsyncIterator",proto:!0,real:!0},{forEach:function(e){return i(this,e)}})},46967:(e,t,r)=>{"use strict";var n=r(46518),i=r(48981),s=r(1625),o=r(50133),a=r(53982),l=r(44690);n({target:"AsyncIterator",stat:!0,forced:r(96395)},{from:function(e){var t=o("string"==typeof e?i(e):e);return s(a,t.iterator)?t.iterator:new l(t)}})},45182:(e,t,r)=>{"use strict";r(46518)({target:"AsyncIterator",proto:!0,real:!0,forced:!0},{indexed:r(87481)})},41393:(e,t,r)=>{"use strict";var n=r(46518),i=r(41750);n({target:"AsyncIterator",proto:!0,real:!0,forced:r(96395)},{map:i})},14905:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(79306),o=r(28551),a=r(20034),l=r(97751),c=r(1767),u=r(20772),h=l("Promise"),d=TypeError;n({target:"AsyncIterator",proto:!0,real:!0},{reduce:function(e){o(this),s(e);var t=c(this),r=t.iterator,n=t.next,l=arguments.length<2,p=l?void 0:arguments[1],f=0;return new h((function(t,s){var c=function(e){u(r,s,e,s)},m=function(){try{h.resolve(o(i(n,r))).then((function(r){try{if(o(r).done)l?s(new d("Reduce of empty iterator with no initial value")):t(p);else{var n=r.value;if(l)l=!1,p=n,m();else try{var i=e(p,n,f),u=function(e){p=e,m()};a(i)?h.resolve(i).then(u,c):u(i)}catch(e){c(e)}}f++}catch(e){s(e)}}),s)}catch(e){s(e)}};m()}))}})},8159:(e,t,r)=>{"use strict";var n=r(46518),i=r(36639).some;n({target:"AsyncIterator",proto:!0,real:!0},{some:function(e){return i(this,e)}})},39320:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(28551),o=r(1767),a=r(24149),l=r(99590),c=r(92059),u=r(62529),h=r(96395),d=c((function(e){var t,r=this,n=r.iterator;if(!r.remaining--){var o=u(void 0,!0);return r.done=!0,void 0!==(t=n.return)?e.resolve(i(t,n,void 0)).then((function(){return o})):o}return e.resolve(i(r.next,n)).then((function(e){return s(e).done?(r.done=!0,u(void 0,!0)):u(e.value,!1)})).then(null,(function(e){throw r.done=!0,e}))}));n({target:"AsyncIterator",proto:!0,real:!0,forced:h},{take:function(e){s(this);var t=l(a(+e));return new d(o(this),{remaining:t})}})},86994:(e,t,r)=>{"use strict";var n=r(46518),i=r(36639).toArray;n({target:"AsyncIterator",proto:!0,real:!0},{toArray:function(){return i(this,void 0,[])}})},24964:(e,t,r)=>{"use strict";var n=r(46518),i=r(14468);"function"==typeof BigInt&&n({target:"BigInt",stat:!0,forced:!0},{range:function(e,t,r){return new i(e,t,r,"bigint",BigInt(0),BigInt(1))}})},7467:(e,t,r)=>{"use strict";var n=r(46518),i=r(18745),s=r(59323),o=r(97751),a=r(2360),l=Object,c=function(){var e=o("Object","freeze");return e?e(a(null)):a(null)};n({global:!0,forced:!0},{compositeKey:function(){return i(s,l,arguments).get("object",c)}})},10586:(e,t,r)=>{"use strict";var n=r(46518),i=r(59323),s=r(97751),o=r(18745);n({global:!0,forced:!0},{compositeSymbol:function(){return 1===arguments.length&&"string"==typeof arguments[0]?s("Symbol").for(arguments[0]):o(i,null,arguments).get("symbol",s("Symbol"))}})},47390:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(88490).unpack,o=i(DataView.prototype.getUint16);n({target:"DataView",proto:!0},{getFloat16:function(e){var t=o(this,e,arguments.length>1&&arguments[1]);return s([255&t,t>>8&255],10)}})},81332:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504)(DataView.prototype.getUint8);n({target:"DataView",proto:!0,forced:!0},{getUint8Clamped:function(e){return i(this,e)}})},9730:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(24194),o=r(57696),a=r(88490).pack,l=r(62724),c=i(DataView.prototype.setUint16);n({target:"DataView",proto:!0},{setFloat16:function(e,t){s(this);var r=o(e),n=a(l(t),10,2);return c(this,r,n[1]<<8|n[0],arguments.length>2&&arguments[2])}})},56192:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(24194),o=r(57696),a=r(58319),l=i(DataView.prototype.setUint8);n({target:"DataView",proto:!0,forced:!0},{setUint8Clamped:function(e,t){s(this);var r=o(e);return l(this,r,a(t))}})},66557:(e,t,r)=>{"use strict";var n=r(46518),i=r(43724),s=r(97751),o=r(79306),a=r(90679),l=r(36840),c=r(56279),u=r(62106),h=r(78227),d=r(91181),p=r(91021),f=s("SuppressedError"),m=ReferenceError,g=h("dispose"),A=h("toStringTag"),y="DisposableStack",v=d.set,x=d.getterFor(y),_="sync-dispose",b="disposed",w=function(e){var t=x(e);if(t.state===b)throw new m(y+" already disposed");return t},E=function(){v(a(this,M),{type:y,state:"pending",stack:[]}),i||(this.disposed=!1)},M=E.prototype;c(M,{dispose:function(){var e=x(this);if(e.state!==b){e.state=b,i||(this.disposed=!0);for(var t,r=e.stack,n=r.length,s=!1;n;){var o=r[--n];r[n]=null;try{o()}catch(e){s?t=new f(e,t):(s=!0,t=e)}}if(e.stack=null,s)throw t}},use:function(e){return p(w(this),e,_),e},adopt:function(e,t){var r=w(this);return o(t),p(r,void 0,_,(function(){t(e)})),e},defer:function(e){var t=w(this);o(e),p(t,void 0,_,e)},move:function(){var e=w(this),t=new E;return x(t).stack=e.stack,e.stack=[],e.state=b,i||(this.disposed=!0),t}}),i&&u(M,"disposed",{configurable:!0,get:function(){return x(this).state===b}}),l(M,g,M.dispose,{name:"dispose"}),l(M,A,y,{nonWritable:!0}),n({global:!0,constructor:!0},{DisposableStack:E})},83354:(e,t,r)=>{"use strict";r(46518)({target:"Function",proto:!0,forced:!0},{demethodize:r(12865)})},98225:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(94901),o=r(33706),a=r(39297),l=r(43724),c=Object.getOwnPropertyDescriptor,u=/^\s*class\b/,h=i(u.exec);n({target:"Function",stat:!0,sham:!0,forced:!0},{isCallable:function(e){return s(e)&&!function(e){try{if(!l||!h(u,o(e)))return!1}catch(e){}var t=c(e,"prototype");return!!t&&a(t,"writable")&&!t.writable}(e)}})},37998:(e,t,r)=>{"use strict";r(46518)({target:"Function",stat:!0,forced:!0},{isConstructor:r(33517)})},16401:(e,t,r)=>{"use strict";var n=r(78227),i=r(24913).f,s=n("metadata"),o=Function.prototype;void 0===o[s]&&i(o,s,{value:null})},18640:(e,t,r)=>{"use strict";r(46518)({target:"Function",proto:!0,forced:!0,name:"demethodize"},{unThis:r(12865)})},62480:(e,t,r)=>{"use strict";r(55081)},51098:(e,t,r)=>{"use strict";r(46518)({target:"Iterator",name:"indexed",proto:!0,real:!0,forced:!0},{asIndexedPairs:r(47958)})},98992:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(90679),o=r(28551),a=r(94901),l=r(42787),c=r(62106),u=r(97040),h=r(79039),d=r(39297),p=r(78227),f=r(57657).IteratorPrototype,m=r(43724),g=r(96395),A="constructor",y="Iterator",v=p("toStringTag"),x=TypeError,_=i[y],b=g||!a(_)||_.prototype!==f||!h((function(){_({})})),w=function(){if(s(this,f),l(this)===f)throw new x("Abstract class Iterator not directly constructable")},E=function(e,t){m?c(f,e,{configurable:!0,get:function(){return t},set:function(t){if(o(this),this===f)throw new x("You can't redefine this property");d(this,e)?this[e]=t:u(this,e,t)}}):f[e]=t};d(f,v)||E(v,y),!b&&d(f,A)&&f[A]!==Object||E(A,w),w.prototype=f,n({global:!0,constructor:!0,forced:b},{Iterator:w})},16037:(e,t,r)=>{"use strict";var n=r(69565),i=r(36840),s=r(55966),o=r(39297),a=r(78227),l=r(57657).IteratorPrototype,c=a("dispose");o(l,c)||i(l,c,(function(){var e=s(this,"return");e&&n(e,this)}))},64743:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(28551),o=r(1767),a=r(24149),l=r(99590),c=r(19462),u=r(96395),h=c((function(){for(var e,t=this.iterator,r=this.next;this.remaining;)if(this.remaining--,e=s(i(r,t)),this.done=!!e.done)return;if(e=s(i(r,t)),!(this.done=!!e.done))return e.value}));n({target:"Iterator",proto:!0,real:!0,forced:u},{drop:function(e){s(this);var t=l(a(+e));return new h(o(this),{remaining:t})}})},23215:(e,t,r)=>{"use strict";var n=r(46518),i=r(72652),s=r(79306),o=r(28551),a=r(1767);n({target:"Iterator",proto:!0,real:!0},{every:function(e){o(this),s(e);var t=a(this),r=0;return!i(t,(function(t,n){if(!e(t,r++))return n()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},54520:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(79306),o=r(28551),a=r(1767),l=r(19462),c=r(96319),u=r(96395),h=l((function(){for(var e,t,r=this.iterator,n=this.predicate,s=this.next;;){if(e=o(i(s,r)),this.done=!!e.done)return;if(t=e.value,c(r,n,[t,this.counter++],!0))return t}}));n({target:"Iterator",proto:!0,real:!0,forced:u},{filter:function(e){return o(this),s(e),new h(a(this),{predicate:e})}})},72577:(e,t,r)=>{"use strict";var n=r(46518),i=r(72652),s=r(79306),o=r(28551),a=r(1767);n({target:"Iterator",proto:!0,real:!0},{find:function(e){o(this),s(e);var t=a(this),r=0;return i(t,(function(t,n){if(e(t,r++))return n(t)}),{IS_RECORD:!0,INTERRUPTED:!0}).result}})},30670:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(79306),o=r(28551),a=r(1767),l=r(48646),c=r(19462),u=r(9539),h=r(96395),d=c((function(){for(var e,t,r=this.iterator,n=this.mapper;;){if(t=this.inner)try{if(!(e=o(i(t.next,t.iterator))).done)return e.value;this.inner=null}catch(e){u(r,"throw",e)}if(e=o(i(this.next,r)),this.done=!!e.done)return;try{this.inner=l(n(e.value,this.counter++),!1)}catch(e){u(r,"throw",e)}}}));n({target:"Iterator",proto:!0,real:!0,forced:h},{flatMap:function(e){return o(this),s(e),new d(a(this),{mapper:e,inner:null})}})},3949:(e,t,r)=>{"use strict";var n=r(46518),i=r(72652),s=r(79306),o=r(28551),a=r(1767);n({target:"Iterator",proto:!0,real:!0},{forEach:function(e){o(this),s(e);var t=a(this),r=0;i(t,(function(t){e(t,r++)}),{IS_RECORD:!0})}})},45882:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(48981),o=r(1625),a=r(57657).IteratorPrototype,l=r(19462),c=r(48646),u=r(96395),h=l((function(){return i(this.next,this.iterator)}),!0);n({target:"Iterator",stat:!0,forced:u},{from:function(e){var t=c("string"==typeof e?s(e):e,!0);return o(a,t.iterator)?t.iterator:new h(t)}})},76913:(e,t,r)=>{"use strict";r(46518)({target:"Iterator",proto:!0,real:!0,forced:!0},{indexed:r(47958)})},81454:(e,t,r)=>{"use strict";var n=r(46518),i=r(20713);n({target:"Iterator",proto:!0,real:!0,forced:r(96395)},{map:i})},75289:(e,t,r)=>{"use strict";var n=r(46518),i=r(14468),s=TypeError;n({target:"Iterator",stat:!0,forced:!0},{range:function(e,t,r){if("number"==typeof e)return new i(e,t,r,"number",0,1);if("bigint"==typeof e)return new i(e,t,r,"bigint",BigInt(0),BigInt(1));throw new s("Incorrect Iterator.range arguments")}})},8872:(e,t,r)=>{"use strict";var n=r(46518),i=r(72652),s=r(79306),o=r(28551),a=r(1767),l=TypeError;n({target:"Iterator",proto:!0,real:!0},{reduce:function(e){o(this),s(e);var t=a(this),r=arguments.length<2,n=r?void 0:arguments[1],c=0;if(i(t,(function(t){r?(r=!1,n=t):n=e(n,t,c),c++}),{IS_RECORD:!0}),r)throw new l("Reduce of empty iterator with no initial value");return n}})},37550:(e,t,r)=>{"use strict";var n=r(46518),i=r(72652),s=r(79306),o=r(28551),a=r(1767);n({target:"Iterator",proto:!0,real:!0},{some:function(e){o(this),s(e);var t=a(this),r=0;return i(t,(function(t,n){if(e(t,r++))return n()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},27413:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(28551),o=r(1767),a=r(24149),l=r(99590),c=r(19462),u=r(9539),h=r(96395),d=c((function(){var e=this.iterator;if(!this.remaining--)return this.done=!0,u(e,"normal",void 0);var t=s(i(this.next,e));return(this.done=!!t.done)?void 0:t.value}));n({target:"Iterator",proto:!0,real:!0,forced:h},{take:function(e){s(this);var t=l(a(+e));return new d(o(this),{remaining:t})}})},41795:(e,t,r)=>{"use strict";var n=r(46518),i=r(28551),s=r(72652),o=r(1767),a=[].push;n({target:"Iterator",proto:!0,real:!0},{toArray:function(){var e=[];return s(o(i(this)),a,{that:e,IS_RECORD:!0}),e}})},81730:(e,t,r)=>{"use strict";var n=r(46518),i=r(28551),s=r(24074),o=r(44690),a=r(1767);n({target:"Iterator",proto:!0,real:!0,forced:r(96395)},{toAsync:function(){return new o(a(new s(a(i(this)))))}})},67296:(e,t,r)=>{"use strict";r(46518)({target:"JSON",stat:!0,forced:!r(27819)},{isRawJSON:r(65810)})},58335:(e,t,r)=>{"use strict";var n=r(46518),i=r(43724),s=r(44576),o=r(97751),a=r(79504),l=r(69565),c=r(94901),u=r(20034),h=r(34376),d=r(39297),p=r(655),f=r(26198),m=r(97040),g=r(79039),A=r(616),y=r(4495),v=s.JSON,x=s.Number,_=s.SyntaxError,b=v&&v.parse,w=o("Object","keys"),E=Object.getOwnPropertyDescriptor,M=a("".charAt),S=a("".slice),C=a(/./.exec),T=a([].push),I=/^\d$/,R=/^[1-9]$/,B=/^[\d-]$/,P=/^[\t\n\r ]$/,L=function(e,t,r,n){var i,s,o,a,c,p=e[t],m=n&&p===n.value,g=m&&"string"==typeof n.source?{source:n.source}:{};if(u(p)){var A=h(p),y=m?n.nodes:A?[]:{};if(A)for(i=y.length,o=f(p),a=0;a{"use strict";var n=r(46518),i=r(92744),s=r(27819),o=r(97751),a=r(69565),l=r(79504),c=r(94901),u=r(65810),h=r(655),d=r(97040),p=r(616),f=r(66933),m=r(33392),g=r(91181).set,A=String,y=SyntaxError,v=o("JSON","parse"),x=o("JSON","stringify"),_=o("Object","create"),b=o("Object","freeze"),w=l("".charAt),E=l("".slice),M=l([].push),S=m(),C=S.length,T="Unacceptable as raw JSON",I=function(e){return" "===e||"\t"===e||"\n"===e||"\r"===e};n({target:"JSON",stat:!0,forced:!s},{rawJSON:function(e){var t=h(e);if(""===t||I(w(t,0))||I(w(t,t.length-1)))throw new y(T);var r=v(t);if("object"==typeof r&&null!==r)throw new y(T);var n=_(null);return g(n,{type:"RawJSON"}),d(n,"rawJSON",t),i?b(n):n}}),x&&n({target:"JSON",stat:!0,arity:3,forced:!s},{stringify:function(e,t,r){var n=f(t),i=[],s=x(e,(function(e,t){var r=c(n)?a(n,this,A(e),t):t;return u(r)?S+(M(i,r.rawJSON)-1):r}),r);if("string"!=typeof s)return s;for(var o="",l=s.length,h=0;h{"use strict";var n=r(46518),i=r(36194),s=r(72248).remove;n({target:"Map",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var e,t=i(this),r=!0,n=0,o=arguments.length;n{"use strict";var n=r(46518),i=r(36194),s=r(72248),o=s.get,a=s.has,l=s.set;n({target:"Map",proto:!0,real:!0,forced:!0},{emplace:function(e,t){var r,n,s=i(this);return a(s,e)?(r=o(s,e),"update"in t&&(r=t.update(r,e,s),l(s,e,r)),r):(n=t.insert(e,s),l(s,e,n),n)}})},93777:(e,t,r)=>{"use strict";var n=r(46518),i=r(76080),s=r(36194),o=r(26223);n({target:"Map",proto:!0,real:!0,forced:!0},{every:function(e){var t=s(this),r=i(e,arguments.length>1?arguments[1]:void 0);return!1!==o(t,(function(e,n){if(!r(e,n,t))return!1}),!0)}})},14190:(e,t,r)=>{"use strict";var n=r(46518),i=r(76080),s=r(36194),o=r(72248),a=r(26223),l=o.Map,c=o.set;n({target:"Map",proto:!0,real:!0,forced:!0},{filter:function(e){var t=s(this),r=i(e,arguments.length>1?arguments[1]:void 0),n=new l;return a(t,(function(e,i){r(e,i,t)&&c(n,i,e)})),n}})},86097:(e,t,r)=>{"use strict";var n=r(46518),i=r(76080),s=r(36194),o=r(26223);n({target:"Map",proto:!0,real:!0,forced:!0},{findKey:function(e){var t=s(this),r=i(e,arguments.length>1?arguments[1]:void 0),n=o(t,(function(e,n){if(r(e,n,t))return{key:n}}),!0);return n&&n.key}})},12359:(e,t,r)=>{"use strict";var n=r(46518),i=r(76080),s=r(36194),o=r(26223);n({target:"Map",proto:!0,real:!0,forced:!0},{find:function(e){var t=s(this),r=i(e,arguments.length>1?arguments[1]:void 0),n=o(t,(function(e,n){if(r(e,n,t))return{value:e}}),!0);return n&&n.value}})},39172:(e,t,r)=>{"use strict";var n=r(46518),i=r(72248);n({target:"Map",stat:!0,forced:!0},{from:r(70933)(i.Map,i.set,!0)})},57019:(e,t,r)=>{"use strict";r(47072)},17273:(e,t,r)=>{"use strict";var n=r(46518),i=r(33317),s=r(36194),o=r(26223);n({target:"Map",proto:!0,real:!0,forced:!0},{includes:function(e){return!0===o(s(this),(function(t){if(i(t,e))return!0}),!0)}})},81723:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(72652),o=r(94901),a=r(79306),l=r(72248).Map;n({target:"Map",stat:!0,forced:!0},{keyBy:function(e,t){var r=new(o(this)?this:l);a(t);var n=a(r.set);return s(e,(function(e){i(n,r,t(e),e)})),r}})},27415:(e,t,r)=>{"use strict";var n=r(46518),i=r(36194),s=r(26223);n({target:"Map",proto:!0,real:!0,forced:!0},{keyOf:function(e){var t=s(i(this),(function(t,r){if(t===e)return{key:r}}),!0);return t&&t.key}})},19929:(e,t,r)=>{"use strict";var n=r(46518),i=r(76080),s=r(36194),o=r(72248),a=r(26223),l=o.Map,c=o.set;n({target:"Map",proto:!0,real:!0,forced:!0},{mapKeys:function(e){var t=s(this),r=i(e,arguments.length>1?arguments[1]:void 0),n=new l;return a(t,(function(e,i){c(n,r(e,i,t),e)})),n}})},37583:(e,t,r)=>{"use strict";var n=r(46518),i=r(76080),s=r(36194),o=r(72248),a=r(26223),l=o.Map,c=o.set;n({target:"Map",proto:!0,real:!0,forced:!0},{mapValues:function(e){var t=s(this),r=i(e,arguments.length>1?arguments[1]:void 0),n=new l;return a(t,(function(e,i){c(n,i,r(e,i,t))})),n}})},55122:(e,t,r)=>{"use strict";var n=r(46518),i=r(36194),s=r(72652),o=r(72248).set;n({target:"Map",proto:!0,real:!0,arity:1,forced:!0},{merge:function(e){for(var t=i(this),r=arguments.length,n=0;n{"use strict";var n=r(46518),i=r(72248);n({target:"Map",stat:!0,forced:!0},{of:r(87500)(i.Map,i.set,!0)})},20230:(e,t,r)=>{"use strict";var n=r(46518),i=r(79306),s=r(36194),o=r(26223),a=TypeError;n({target:"Map",proto:!0,real:!0,forced:!0},{reduce:function(e){var t=s(this),r=arguments.length<2,n=r?void 0:arguments[1];if(i(e),o(t,(function(i,s){r?(r=!1,n=i):n=e(n,i,s,t)})),r)throw new a("Reduce of empty map with no initial value");return n}})},57268:(e,t,r)=>{"use strict";var n=r(46518),i=r(76080),s=r(36194),o=r(26223);n({target:"Map",proto:!0,real:!0,forced:!0},{some:function(e){var t=s(this),r=i(e,arguments.length>1?arguments[1]:void 0);return!0===o(t,(function(e,n){if(r(e,n,t))return!0}),!0)}})},19717:(e,t,r)=>{"use strict";r(46518)({target:"Map",proto:!0,real:!0,name:"upsert",forced:!0},{updateOrInsert:r(162)})},79733:(e,t,r)=>{"use strict";var n=r(46518),i=r(79306),s=r(36194),o=r(72248),a=TypeError,l=o.get,c=o.has,u=o.set;n({target:"Map",proto:!0,real:!0,forced:!0},{update:function(e,t){var r=s(this),n=arguments.length;i(t);var o=c(r,e);if(!o&&n<3)throw new a("Updating absent value");var h=o?l(r,e):i(n>2?arguments[2]:void 0)(e,r);return u(r,e,t(h,e,r)),r}})},52231:(e,t,r)=>{"use strict";r(46518)({target:"Map",proto:!0,real:!0,forced:!0},{upsert:r(162)})},58179:(e,t,r)=>{"use strict";var n=r(46518),i=Math.min,s=Math.max;n({target:"Math",stat:!0,forced:!0},{clamp:function(e,t,r){return i(r,s(t,e))}})},30456:(e,t,r)=>{"use strict";r(46518)({target:"Math",stat:!0,nonConfigurable:!0,nonWritable:!0},{DEG_PER_RAD:Math.PI/180})},74017:(e,t,r)=>{"use strict";var n=r(46518),i=180/Math.PI;n({target:"Math",stat:!0,forced:!0},{degrees:function(e){return e*i}})},16453:(e,t,r)=>{"use strict";r(46518)({target:"Math",stat:!0},{f16round:r(62724)})},79310:(e,t,r)=>{"use strict";var n=r(46518),i=r(77905),s=r(15617);n({target:"Math",stat:!0,forced:!0},{fscale:function(e,t,r,n,o){return s(i(e,t,r,n,o))}})},83062:(e,t,r)=>{"use strict";r(46518)({target:"Math",stat:!0,forced:!0},{iaddh:function(e,t,r,n){var i=e>>>0,s=r>>>0;return(t>>>0)+(n>>>0)+((i&s|(i|s)&~(i+s>>>0))>>>31)|0}})},96369:(e,t,r)=>{"use strict";r(46518)({target:"Math",stat:!0,forced:!0},{imulh:function(e,t){var r=65535,n=+e,i=+t,s=n&r,o=i&r,a=n>>16,l=i>>16,c=(a*o>>>0)+(s*o>>>16);return a*l+(c>>16)+((s*l>>>0)+(c&r)>>16)}})},15637:(e,t,r)=>{"use strict";r(46518)({target:"Math",stat:!0,forced:!0},{isubh:function(e,t,r,n){var i=e>>>0,s=r>>>0;return(t>>>0)-(n>>>0)-((~i&s|(i^~s)&i-s>>>0)>>>31)|0}})},2848:(e,t,r)=>{"use strict";r(46518)({target:"Math",stat:!0,nonConfigurable:!0,nonWritable:!0},{RAD_PER_DEG:180/Math.PI})},24842:(e,t,r)=>{"use strict";var n=r(46518),i=Math.PI/180;n({target:"Math",stat:!0,forced:!0},{radians:function(e){return e*i}})},24746:(e,t,r)=>{"use strict";r(46518)({target:"Math",stat:!0,forced:!0},{scale:r(77905)})},33454:(e,t,r)=>{"use strict";var n=r(46518),i=r(28551),s=r(50360),o=r(33994),a=r(62529),l=r(91181),c="Seeded Random",u=c+" Generator",h=l.set,d=l.getterFor(u),p=TypeError,f=o((function(e){h(this,{type:u,seed:e%2147483647})}),c,(function(){var e=d(this),t=e.seed=(1103515245*e.seed+12345)%2147483647;return a((1073741823&t)/1073741823,!1)}));n({target:"Math",stat:!0,forced:!0},{seededPRNG:function(e){var t=i(e).seed;if(!s(t))throw new p('Math.seededPRNG() argument should have a "seed" field with a finite value.');return new f(t)}})},6660:(e,t,r)=>{"use strict";r(46518)({target:"Math",stat:!0,forced:!0},{signbit:function(e){var t=+e;return t==t&&0===t?1/t==-1/0:t<0}})},4235:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(72652),o=RangeError,a=TypeError,l=1/0,c=Math.abs,u=Math.pow,h=i([].push),d=u(2,1023),p=u(2,53)-1,f=Number.MAX_VALUE,m=u(2,971),g={},A={},y={},v={},x={},_=function(e,t){var r=e+t;return{hi:r,lo:t-(r-e)}};n({target:"Math",stat:!0,forced:!0},{sumPrecise:function(e){var t=[],r=0,n=v;switch(s(e,(function(e){if(++r>=p)throw new o("Maximum allowed index exceeded");if("number"!=typeof e)throw new a("Value is not a number");n!==g&&(e!=e?n=g:e===l?n=n===A?g:y:e===-1/0?n=n===y?g:A:0===e&&1/e!==l||n!==v&&n!==x||(n=x,h(t,e)))})),n){case g:return NaN;case A:return-1/0;case y:return l;case v:return-0}for(var i,u,b,w,E,M,S=[],C=0,T=0;T=0?S[P]:0;if(P--,c(C)>1||C>0&&L>0||C<0&&L<0)return C>0?l:-1/0;if(w=(b=_(C*d,L/2)).hi,E=b.lo,E*=2,c(2*w)===l)return w>0?w===d&&E===-m/2&&P>=0&&S[P]<0?f:l:w===-d&&E===m/2&&P>=0&&S[P]>0?-f:-1/0;0!==E&&(S[++P]=E,E=0),w*=2}for(;P>=0&&(w=(b=_(w,S[P--])).hi,0===(E=b.lo)););return P>=0&&(E<0&&S[P]<0||E>0&&S[P]>0)&&(u=2*E)==(i=w+u)-w&&(w=i),w}})},15941:(e,t,r)=>{"use strict";r(46518)({target:"Math",stat:!0,forced:!0},{umulh:function(e,t){var r=65535,n=+e,i=+t,s=n&r,o=i&r,a=n>>>16,l=i>>>16,c=(a*o>>>0)+(s*o>>>16);return a*l+(c>>>16)+((s*l>>>0)+(c&r)>>>16)}})},82101:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(91291),o="Invalid number representation",a=RangeError,l=SyntaxError,c=TypeError,u=parseInt,h=Math.pow,d=/^[\d.a-z]+$/,p=i("".charAt),f=i(d.exec),m=i(1..toString),g=i("".slice),A=i("".split);n({target:"Number",stat:!0,forced:!0},{fromString:function(e,t){var r=1;if("string"!=typeof e)throw new c(o);if(!e.length)throw new l(o);if("-"===p(e,0)&&(r=-1,!(e=g(e,1)).length))throw new l(o);var n=void 0===t?10:s(t);if(n<2||n>36)throw new a("Invalid radix");if(!f(d,e))throw new l(o);var i=A(e,"."),y=u(i[0],n);if(i.length>1&&(y+=u(i[1],n)/h(n,i[1].length)),10===n&&m(y,n)!==e)throw new l(o);return r*y}})},79926:(e,t,r)=>{"use strict";var n=r(46518),i=r(14468);n({target:"Number",stat:!0,forced:!0},{range:function(e,t,r){return new i(e,t,r,"number",0,1)}})},66090:(e,t,r)=>{"use strict";r(77691)},84208:(e,t,r)=>{"use strict";r(78347)},91550:(e,t,r)=>{"use strict";var n=r(46518),i=r(91354);n({target:"Object",stat:!0,forced:!0},{iterateEntries:function(e){return new i(e,"entries")}})},9156:(e,t,r)=>{"use strict";var n=r(46518),i=r(91354);n({target:"Object",stat:!0,forced:!0},{iterateKeys:function(e){return new i(e,"keys")}})},48918:(e,t,r)=>{"use strict";var n=r(46518),i=r(91354);n({target:"Object",stat:!0,forced:!0},{iterateValues:function(e){return new i(e,"values")}})},15239:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(43724),o=r(87633),a=r(79306),l=r(28551),c=r(90679),u=r(94901),h=r(64117),d=r(20034),p=r(55966),f=r(36840),m=r(56279),g=r(62106),A=r(90757),y=r(78227),v=r(91181),x=y("observable"),_="Observable",b="Subscription",w="SubscriptionObserver",E=v.getterFor,M=v.set,S=E(_),C=E(b),T=E(w),I=function(e){this.observer=l(e),this.cleanup=null,this.subscriptionObserver=null};I.prototype={type:b,clean:function(){var e=this.cleanup;if(e){this.cleanup=null;try{e()}catch(e){A(e)}}},close:function(){if(!s){var e=this.facade,t=this.subscriptionObserver;e.closed=!0,t&&(t.closed=!0)}this.observer=null},isClosed:function(){return null===this.observer}};var R=function(e,t){var r,n=M(this,new I(e));s||(this.closed=!1);try{(r=p(e,"start"))&&i(r,e,this)}catch(e){A(e)}if(!n.isClosed()){var o=n.subscriptionObserver=new B(n);try{var l=t(o),c=l;h(l)||(n.cleanup=u(l.unsubscribe)?function(){c.unsubscribe()}:a(l))}catch(e){return void o.error(e)}n.isClosed()&&n.clean()}};R.prototype=m({},{unsubscribe:function(){var e=C(this);e.isClosed()||(e.close(),e.clean())}}),s&&g(R.prototype,"closed",{configurable:!0,get:function(){return C(this).isClosed()}});var B=function(e){M(this,{type:w,subscriptionState:e}),s||(this.closed=!1)};B.prototype=m({},{next:function(e){var t=T(this).subscriptionState;if(!t.isClosed()){var r=t.observer;try{var n=p(r,"next");n&&i(n,r,e)}catch(e){A(e)}}},error:function(e){var t=T(this).subscriptionState;if(!t.isClosed()){var r=t.observer;t.close();try{var n=p(r,"error");n?i(n,r,e):A(e)}catch(e){A(e)}t.clean()}},complete:function(){var e=T(this).subscriptionState;if(!e.isClosed()){var t=e.observer;e.close();try{var r=p(t,"complete");r&&i(r,t)}catch(e){A(e)}e.clean()}}}),s&&g(B.prototype,"closed",{configurable:!0,get:function(){return T(this).subscriptionState.isClosed()}});var P=function(e){c(this,L),M(this,{type:_,subscriber:a(e)})},L=P.prototype;m(L,{subscribe:function(e){var t=arguments.length;return new R(u(e)?{next:e,error:t>1?arguments[1]:void 0,complete:t>2?arguments[2]:void 0}:d(e)?e:{},S(this).subscriber)}}),f(L,x,(function(){return this})),n({global:!0,constructor:!0,forced:!0},{Observable:P}),o(_)},9035:(e,t,r)=>{"use strict";var n=r(46518),i=r(97751),s=r(69565),o=r(28551),a=r(33517),l=r(70081),c=r(55966),u=r(72652),h=r(78227)("observable");n({target:"Observable",stat:!0,forced:!0},{from:function(e){var t=a(this)?this:i("Observable"),r=c(o(e),h);if(r){var n=o(s(r,e));return n.constructor===t?n:new t((function(e){return n.subscribe(e)}))}var d=l(e);return new t((function(e){u(d,(function(t,r){if(e.next(t),e.closed)return r()}),{IS_ITERATOR:!0,INTERRUPTED:!0}),e.complete()}))}})},2917:(e,t,r)=>{"use strict";r(15239),r(9035),r(78662)},78662:(e,t,r)=>{"use strict";var n=r(46518),i=r(97751),s=r(33517),o=i("Array");n({target:"Observable",stat:!0,forced:!0},{of:function(){for(var e=s(this)?this:i("Observable"),t=arguments.length,r=o(t),n=0;n{"use strict";r(96167)},47575:(e,t,r)=>{"use strict";r(93518)},47628:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(18745),o=r(67680),a=r(36043),l=r(79306),c=r(1103),u=i.Promise,h=!1;n({target:"Promise",stat:!0,forced:!u||!u.try||c((function(){u.try((function(e){h=8===e}),8)})).error||!h},{try:function(e){var t=arguments.length>1?o(arguments,1):[],r=a.f(this),n=c((function(){return s(l(e),void 0,t)}));return(n.error?r.reject:r.resolve)(n.value),r.promise}})},43799:(e,t,r)=>{"use strict";r(14628)},65186:(e,t,r)=>{"use strict";var n=r(46518),i=r(18449),s=r(28551),o=i.toKey,a=i.set;n({target:"Reflect",stat:!0},{defineMetadata:function(e,t,r){var n=arguments.length<4?void 0:o(arguments[3]);a(e,t,s(r),n)}})},42978:(e,t,r)=>{"use strict";var n=r(46518),i=r(18449),s=r(28551),o=i.toKey,a=i.getMap,l=i.store;n({target:"Reflect",stat:!0},{deleteMetadata:function(e,t){var r=arguments.length<3?void 0:o(arguments[2]),n=a(s(t),r,!1);if(void 0===n||!n.delete(e))return!1;if(n.size)return!0;var i=l.get(t);return i.delete(r),!!i.size||l.delete(t)}})},79852:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(18449),o=r(28551),a=r(42787),l=i(r(79565)),c=i([].concat),u=s.keys,h=s.toKey,d=function(e,t){var r=u(e,t),n=a(e);if(null===n)return r;var i=d(n,t);return i.length?r.length?l(c(r,i)):i:r};n({target:"Reflect",stat:!0},{getMetadataKeys:function(e){var t=arguments.length<2?void 0:h(arguments[1]);return d(o(e),t)}})},72527:(e,t,r)=>{"use strict";var n=r(46518),i=r(18449),s=r(28551),o=r(42787),a=i.has,l=i.get,c=i.toKey,u=function(e,t,r){if(a(e,t,r))return l(e,t,r);var n=o(t);return null!==n?u(e,n,r):void 0};n({target:"Reflect",stat:!0},{getMetadata:function(e,t){var r=arguments.length<3?void 0:c(arguments[2]);return u(e,s(t),r)}})},40617:(e,t,r)=>{"use strict";var n=r(46518),i=r(18449),s=r(28551),o=i.keys,a=i.toKey;n({target:"Reflect",stat:!0},{getOwnMetadataKeys:function(e){var t=arguments.length<2?void 0:a(arguments[1]);return o(s(e),t)}})},42376:(e,t,r)=>{"use strict";var n=r(46518),i=r(18449),s=r(28551),o=i.get,a=i.toKey;n({target:"Reflect",stat:!0},{getOwnMetadata:function(e,t){var r=arguments.length<3?void 0:a(arguments[2]);return o(e,s(t),r)}})},73067:(e,t,r)=>{"use strict";var n=r(46518),i=r(18449),s=r(28551),o=r(42787),a=i.has,l=i.toKey,c=function(e,t,r){if(a(e,t,r))return!0;var n=o(t);return null!==n&&c(e,n,r)};n({target:"Reflect",stat:!0},{hasMetadata:function(e,t){var r=arguments.length<3?void 0:l(arguments[2]);return c(e,s(t),r)}})},66820:(e,t,r)=>{"use strict";var n=r(46518),i=r(18449),s=r(28551),o=i.has,a=i.toKey;n({target:"Reflect",stat:!0},{hasOwnMetadata:function(e,t){var r=arguments.length<3?void 0:a(arguments[2]);return o(e,s(t),r)}})},8288:(e,t,r)=>{"use strict";var n=r(46518),i=r(18449),s=r(28551),o=i.toKey,a=i.set;n({target:"Reflect",stat:!0},{metadata:function(e,t){return function(r,n){a(e,t,s(r),o(n))}}})},37108:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(63463),o=r(39297),a=r(60533).start,l=r(47452),c=Array,u=RegExp.escape,h=i("".charAt),d=i("".charCodeAt),p=i(1.1.toString),f=i([].join),m=/^[0-9a-z]/i,g=/^[$()*+./?[\\\]^{|}]/,A=RegExp("^[!\"#%&',\\-:;<=>@`~"+l+"]"),y=i(m.exec),v={"\t":"t","\n":"n","\v":"v","\f":"f","\r":"r"},x=function(e){var t=p(d(e,0),16);return t.length<3?"\\x"+a(t,2,"0"):"\\u"+a(t,4,"0")};n({target:"RegExp",stat:!0,forced:!u||"\\x61b"!==u("ab")},{escape:function(e){s(e);for(var t=e.length,r=c(t),n=0;n=56320||n+1>=t||56320!=(64512&d(e,n+1))?r[n]=x(i):(r[n]=i,r[++n]=h(e,n))}}return f(r,"")}})},25509:(e,t,r)=>{"use strict";var n=r(46518),i=r(97080),s=r(94402).add;n({target:"Set",proto:!0,real:!0,forced:!0},{addAll:function(){for(var e=i(this),t=0,r=arguments.length;t{"use strict";var n=r(46518),i=r(97080),s=r(94402).remove;n({target:"Set",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var e,t=i(this),r=!0,n=0,o=arguments.length;n{"use strict";var n=r(46518),i=r(69565),s=r(47650),o=r(83440);n({target:"Set",proto:!0,real:!0,forced:!0},{difference:function(e){return i(o,this,s(e))}})},43375:(e,t,r)=>{"use strict";r(17642)},41927:(e,t,r)=>{"use strict";var n=r(46518),i=r(76080),s=r(97080),o=r(38469);n({target:"Set",proto:!0,real:!0,forced:!0},{every:function(e){var t=s(this),r=i(e,arguments.length>1?arguments[1]:void 0);return!1!==o(t,(function(e){if(!r(e,e,t))return!1}),!0)}})},11632:(e,t,r)=>{"use strict";var n=r(46518),i=r(76080),s=r(97080),o=r(94402),a=r(38469),l=o.Set,c=o.add;n({target:"Set",proto:!0,real:!0,forced:!0},{filter:function(e){var t=s(this),r=i(e,arguments.length>1?arguments[1]:void 0),n=new l;return a(t,(function(e){r(e,e,t)&&c(n,e)})),n}})},64377:(e,t,r)=>{"use strict";var n=r(46518),i=r(76080),s=r(97080),o=r(38469);n({target:"Set",proto:!0,real:!0,forced:!0},{find:function(e){var t=s(this),r=i(e,arguments.length>1?arguments[1]:void 0),n=o(t,(function(e){if(r(e,e,t))return{value:e}}),!0);return n&&n.value}})},49522:(e,t,r)=>{"use strict";var n=r(46518),i=r(94402);n({target:"Set",stat:!0,forced:!0},{from:r(70933)(i.Set,i.add,!1)})},66771:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(47650),o=r(68750);n({target:"Set",proto:!0,real:!0,forced:!0},{intersection:function(e){return i(o,this,s(e))}})},39225:(e,t,r)=>{"use strict";r(58004)},12516:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(47650),o=r(64449);n({target:"Set",proto:!0,real:!0,forced:!0},{isDisjointFrom:function(e){return i(o,this,s(e))}})},13972:(e,t,r)=>{"use strict";r(33853)},68931:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(47650),o=r(53838);n({target:"Set",proto:!0,real:!0,forced:!0},{isSubsetOf:function(e){return i(o,this,s(e))}})},99209:(e,t,r)=>{"use strict";r(45876)},52514:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(47650),o=r(28527);n({target:"Set",proto:!0,real:!0,forced:!0},{isSupersetOf:function(e){return i(o,this,s(e))}})},25714:(e,t,r)=>{"use strict";r(32475)},35694:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),s=r(97080),o=r(38469),a=r(655),l=i([].join),c=i([].push);n({target:"Set",proto:!0,real:!0,forced:!0},{join:function(e){var t=s(this),r=void 0===e?",":a(e),n=[];return o(t,(function(e){c(n,e)})),l(n,r)}})},52774:(e,t,r)=>{"use strict";var n=r(46518),i=r(76080),s=r(97080),o=r(94402),a=r(38469),l=o.Set,c=o.add;n({target:"Set",proto:!0,real:!0,forced:!0},{map:function(e){var t=s(this),r=i(e,arguments.length>1?arguments[1]:void 0),n=new l;return a(t,(function(e){c(n,r(e,e,t))})),n}})},23283:(e,t,r)=>{"use strict";var n=r(46518),i=r(94402);n({target:"Set",stat:!0,forced:!0},{of:r(87500)(i.Set,i.add,!1)})},49536:(e,t,r)=>{"use strict";var n=r(46518),i=r(79306),s=r(97080),o=r(38469),a=TypeError;n({target:"Set",proto:!0,real:!0,forced:!0},{reduce:function(e){var t=s(this),r=arguments.length<2,n=r?void 0:arguments[1];if(i(e),o(t,(function(i){r?(r=!1,n=i):n=e(n,i,i,t)})),r)throw new a("Reduce of empty set with no initial value");return n}})},21926:(e,t,r)=>{"use strict";var n=r(46518),i=r(76080),s=r(97080),o=r(38469);n({target:"Set",proto:!0,real:!0,forced:!0},{some:function(e){var t=s(this),r=i(e,arguments.length>1?arguments[1]:void 0);return!0===o(t,(function(e){if(r(e,e,t))return!0}),!0)}})},16864:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(47650),o=r(83650);n({target:"Set",proto:!0,real:!0,forced:!0},{symmetricDifference:function(e){return i(o,this,s(e))}})},17561:(e,t,r)=>{"use strict";r(15024)},16215:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),s=r(47650),o=r(44204);n({target:"Set",proto:!0,real:!0,forced:!0},{union:function(e){return i(o,this,s(e))}})},66197:(e,t,r)=>{"use strict";r(31698)},78898:(e,t,r)=>{"use strict";var n=r(46518),i=r(68183).charAt,s=r(67750),o=r(91291),a=r(655);n({target:"String",proto:!0,forced:!0},{at:function(e){var t=a(s(this)),r=t.length,n=o(e),l=n>=0?n:r+n;return l<0||l>=r?void 0:i(t,l)}})},74176:(e,t,r)=>{"use strict";var n=r(46518),i=r(33994),s=r(62529),o=r(67750),a=r(655),l=r(91181),c=r(68183),u=c.codeAt,h=c.charAt,d="String Iterator",p=l.set,f=l.getterFor(d),m=i((function(e){p(this,{type:d,string:e,index:0})}),"String",(function(){var e,t=f(this),r=t.string,n=t.index;return n>=r.length?s(void 0,!0):(e=h(r,n),t.index+=e.length,s({codePoint:u(e,0),position:n},!1))}));n({target:"String",proto:!0,forced:!0},{codePoints:function(){return new m(a(o(this)))}})},84114:(e,t,r)=>{"use strict";r(46518)({target:"String",stat:!0,forced:!0},{cooked:r(74615)})},66337:(e,t,r)=>{"use strict";var n=r(92744),i=r(46518),s=r(50283),o=r(79504),a=r(18745),l=r(28551),c=r(48981),u=r(94901),h=r(26198),d=r(24913).f,p=r(67680),f=r(44995),m=r(74615),g=r(58523),A=r(47452),y=new f.WeakMap,v=f.get,x=f.has,_=f.set,b=Array,w=TypeError,E=Object.freeze||Object,M=Object.isFrozen,S=Math.min,C=o("".charAt),T=o("".slice),I=o("".split),R=o(/./.exec),B=/([\n\u2028\u2029]|\r\n?)/g,P=RegExp("^["+A+"]*"),L=RegExp("[^"+A+"]"),D="Invalid tag",O=function(e,t){if(void 0===t||e===t)return e;for(var r=0,n=S(e.length,t.length);r0)throw new w("Invalid opening line");t[1]=""}if(p){if(1===t.length||R(L,t[t.length-1]))throw new w("Invalid closing line");t[t.length-2]="",t[t.length-1]=""}for(var f=2;f{"use strict";r(42043)},38344:(e,t,r)=>{"use strict";r(28543)},12041:(e,t,r)=>{"use strict";r(79978)},51755:(e,t,r)=>{"use strict";r(67438)},39687:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(1625),o=r(42787),a=r(52967),l=r(77740),c=r(2360),u=r(66699),h=r(6980),d=r(80747),p=r(32603),f=r(78227),m=r(79039),g=r(96395),A=i.SuppressedError,y=f("toStringTag"),v=Error,x=!!A&&3!==A.length,_=!!A&&m((function(){return 4===new A(1,2,3,{cause:4}).cause})),b=x||_,w=function(e,t,r){var n,i=s(E,this);return a?n=!b||i&&o(this)!==E?a(new v,i?o(this):E):new A:(n=i?this:c(E),u(n,y,"Error")),void 0!==r&&u(n,"message",p(r)),d(n,w,n.stack,1),u(n,"error",e),u(n,"suppressed",t),n};a?a(w,v):l(w,v,{name:!0});var E=w.prototype=b?A.prototype:c(v.prototype,{constructor:h(1,w),message:h(1,""),name:h(1,"SuppressedError")});b&&!g&&(E.constructor=w),n({global:!0,constructor:!0,arity:3,forced:b},{SuppressedError:w})},81202:(e,t,r)=>{"use strict";var n=r(44576),i=r(70511),s=r(24913).f,o=r(77347).f,a=n.Symbol;if(i("asyncDispose"),a){var l=o(a,"asyncDispose");l.enumerable&&l.configurable&&l.writable&&s(a,"asyncDispose",{value:l.value,enumerable:!1,configurable:!1,writable:!1})}},49604:(e,t,r)=>{"use strict";r(70511)("customMatcher")},43275:(e,t,r)=>{"use strict";var n=r(44576),i=r(70511),s=r(24913).f,o=r(77347).f,a=n.Symbol;if(i("dispose"),a){var l=o(a,"dispose");l.enumerable&&l.configurable&&l.writable&&s(a,"dispose",{value:l.value,enumerable:!1,configurable:!1,writable:!1})}},13070:(e,t,r)=>{"use strict";r(46518)({target:"Symbol",stat:!0},{isRegisteredSymbol:r(12586)})},87153:(e,t,r)=>{"use strict";r(46518)({target:"Symbol",stat:!0,name:"isRegisteredSymbol"},{isRegistered:r(12586)})},53032:(e,t,r)=>{"use strict";r(46518)({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:r(52104)})},53803:(e,t,r)=>{"use strict";r(46518)({target:"Symbol",stat:!0,name:"isWellKnownSymbol",forced:!0},{isWellKnown:r(52104)})},13976:(e,t,r)=>{"use strict";r(70511)("matcher")},18999:(e,t,r)=>{"use strict";r(70511)("metadataKey")},30465:(e,t,r)=>{"use strict";r(70511)("metadata")},42793:(e,t,r)=>{"use strict";r(70511)("observable")},77208:(e,t,r)=>{"use strict";r(70511)("patternMatch")},73440:(e,t,r)=>{"use strict";r(70511)("replaceAll")},51839:(e,t,r)=>{"use strict";r(48140)},14037:(e,t,r)=>{"use strict";var n=r(94644),i=r(59213).filterReject,s=r(26357),o=n.aTypedArray;(0,n.exportTypedArrayMethod)("filterOut",(function(e){var t=i(o(this),e,arguments.length>1?arguments[1]:void 0);return s(this,t)}),!0)},47350:(e,t,r)=>{"use strict";var n=r(94644),i=r(59213).filterReject,s=r(26357),o=n.aTypedArray;(0,n.exportTypedArrayMethod)("filterReject",(function(e){var t=i(o(this),e,arguments.length>1?arguments[1]:void 0);return s(this,t)}),!0)},96847:(e,t,r)=>{"use strict";r(91134)},91706:(e,t,r)=>{"use strict";r(21903)},13195:(e,t,r)=>{"use strict";var n=r(97751),i=r(35548),s=r(8045),o=r(94644),a=r(35370),l=o.aTypedArrayConstructor;(0,o.exportTypedArrayStaticMethod)("fromAsync",(function(e){var t=this,r=arguments.length,o=r>1?arguments[1]:void 0,c=r>2?arguments[2]:void 0;return new(n("Promise"))((function(r){i(t),r(s(e,o,c))})).then((function(e){return a(l(t),e)}))}),!0)},23241:(e,t,r)=>{"use strict";var n=r(94644),i=r(77957),s=r(61412),o=n.aTypedArray;(0,n.exportTypedArrayMethod)("groupBy",(function(e){var t=arguments.length>1?arguments[1]:void 0;return i(o(this),e,t,s)}),!0)},43250:(e,t,r)=>{"use strict";r(37467)},10149:(e,t,r)=>{"use strict";r(44732)},67302:(e,t,r)=>{"use strict";var n=r(94644),i=r(26198),s=r(18727),o=r(35610),a=r(75854),l=r(91291),c=r(79039),u=n.aTypedArray,h=n.getTypedArrayConstructor,d=n.exportTypedArrayMethod,p=Math.max,f=Math.min;d("toSpliced",(function(e,t){var r,n,c,d,m,g,A,y=u(this),v=h(y),x=i(y),_=o(e,x),b=arguments.length,w=0;if(0===b)r=n=0;else if(1===b)r=0,n=x-_;else if(n=f(p(l(t),0),x-_),r=b-2){d=new v(r),c=s(d);for(var E=2;E{"use strict";var n=r(79504),i=r(94644),s=r(35370),o=r(79565),a=i.aTypedArray,l=i.getTypedArrayConstructor,c=i.exportTypedArrayMethod,u=n(o);c("uniqueBy",(function(e){return a(this),s(l(this),u(this,e))}),!0)},24082:(e,t,r)=>{"use strict";r(79577)},57051:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(35370),o=r(59143),a=i.Uint8Array;a&&n({target:"Uint8Array",stat:!0},{fromBase64:function(e){var t=o(e,arguments.length>1?arguments[1]:void 0,null,9007199254740991);return s(a,t.bytes)}})},27650:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(63463),o=r(42303);i.Uint8Array&&n({target:"Uint8Array",stat:!0},{fromHex:function(e){return o(s(e)).bytes}})},41549:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(59143),o=r(34154);i.Uint8Array&&n({target:"Uint8Array",proto:!0},{setFromBase64:function(e){o(this);var t=s(e,arguments.length>1?arguments[1]:void 0,this,this.length);return{read:t.read,written:t.written}}})},49797:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(63463),o=r(34154),a=r(55169),l=r(42303);i.Uint8Array&&n({target:"Uint8Array",proto:!0},{setFromHex:function(e){o(this),s(e),a(this.buffer);var t=l(e,this).read;return{read:t,written:t/2}}})},49631:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(79504),o=r(83972),a=r(34154),l=r(55169),c=r(92804),u=r(944),h=c.i2c,d=c.i2cUrl,p=s("".charAt);i.Uint8Array&&n({target:"Uint8Array",proto:!0},{toBase64:function(){var e=a(this),t=arguments.length?o(arguments[0]):void 0,r="base64"===u(t)?h:d,n=!!t&&!!t.omitPadding;l(this.buffer);for(var i,s="",c=0,f=e.length,m=function(e){return p(r,i>>6*e&63)};c+2{"use strict";var n=r(46518),i=r(44576),s=r(79504),o=r(34154),a=r(55169),l=s(1..toString);i.Uint8Array&&n({target:"Uint8Array",proto:!0},{toHex:function(){o(this),a(this.buffer);for(var e="",t=0,r=this.length;t{"use strict";var n=r(46518),i=r(76557),s=r(44995).remove;n({target:"WeakMap",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var e,t=i(this),r=!0,n=0,o=arguments.length;n{"use strict";var n=r(46518),i=r(76557),s=r(44995),o=s.get,a=s.has,l=s.set;n({target:"WeakMap",proto:!0,real:!0,forced:!0},{emplace:function(e,t){var r,n,s=i(this);return a(s,e)?(r=o(s,e),"update"in t&&(r=t.update(r,e,s),l(s,e,r)),r):(n=t.insert(e,s),l(s,e,n),n)}})},26957:(e,t,r)=>{"use strict";var n=r(46518),i=r(44995);n({target:"WeakMap",stat:!0,forced:!0},{from:r(70933)(i.WeakMap,i.set,!0)})},79732:(e,t,r)=>{"use strict";var n=r(46518),i=r(44995);n({target:"WeakMap",stat:!0,forced:!0},{of:r(87500)(i.WeakMap,i.set,!0)})},49634:(e,t,r)=>{"use strict";r(46518)({target:"WeakMap",proto:!0,real:!0,forced:!0},{upsert:r(162)})},83742:(e,t,r)=>{"use strict";var n=r(46518),i=r(23755),s=r(88205).add;n({target:"WeakSet",proto:!0,real:!0,forced:!0},{addAll:function(){for(var e=i(this),t=0,r=arguments.length;t{"use strict";var n=r(46518),i=r(23755),s=r(88205).remove;n({target:"WeakSet",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var e,t=i(this),r=!0,n=0,o=arguments.length;n{"use strict";var n=r(46518),i=r(88205);n({target:"WeakSet",stat:!0,forced:!0},{from:r(70933)(i.WeakSet,i.add,!1)})},46270:(e,t,r)=>{"use strict";var n=r(46518),i=r(88205);n({target:"WeakSet",stat:!0,forced:!0},{of:r(87500)(i.WeakSet,i.add,!1)})},2945:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(97751),o=r(79504),a=r(69565),l=r(79039),c=r(655),u=r(22812),h=r(92804).c2i,d=/[^\d+/a-z]/i,p=/[\t\n\f\r ]+/g,f=/[=]{1,2}$/,m=s("atob"),g=String.fromCharCode,A=o("".charAt),y=o("".replace),v=o(d.exec),x=!!m&&!l((function(){return"hi"!==m("aGk=")})),_=x&&l((function(){return""!==m(" ")})),b=x&&!l((function(){m("a")})),w=x&&!l((function(){m()})),E=x&&1!==m.length;n({global:!0,bind:!0,enumerable:!0,forced:!x||_||b||w||E},{atob:function(e){if(u(arguments.length,1),x&&!_&&!b)return a(m,i,e);var t,r,n,o=y(c(e),p,""),l="",w=0,E=0;if(o.length%4==0&&(o=y(o,f,"")),(t=o.length)%4==1||v(d,o))throw new(s("DOMException"))("The string is not correctly encoded","InvalidCharacterError");for(;w>(-2*E&6)));return l}})},42207:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(97751),o=r(79504),a=r(69565),l=r(79039),c=r(655),u=r(22812),h=r(92804).i2c,d=s("btoa"),p=o("".charAt),f=o("".charCodeAt),m=!!d&&!l((function(){return"aGk="!==d("hi")})),g=m&&!l((function(){d()})),A=m&&l((function(){return"bnVsbA=="!==d(null)})),y=m&&1!==d.length;n({global:!0,bind:!0,enumerable:!0,forced:!m||g||A||y},{btoa:function(e){if(u(arguments.length,1),m)return a(d,i,c(e));for(var t,r,n=c(e),o="",l=0,g=h;p(n,l)||(g="=",l%1);){if((r=f(n,l+=3/4))>255)throw new(s("DOMException"))("The string contains characters outside of the Latin1 range","InvalidCharacterError");o+=p(g,63&(t=t<<8|r)>>8-l%1*8)}return o}})},86368:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(59225).clear;n({global:!0,bind:!0,enumerable:!0,forced:i.clearImmediate!==s},{clearImmediate:s})},23500:(e,t,r)=>{"use strict";var n=r(44576),i=r(67400),s=r(79296),o=r(90235),a=r(66699),l=function(e){if(e&&e.forEach!==o)try{a(e,"forEach",o)}catch(t){e.forEach=o}};for(var c in i)i[c]&&l(n[c]&&n[c].prototype);l(s)},62953:(e,t,r)=>{"use strict";var n=r(44576),i=r(67400),s=r(79296),o=r(23792),a=r(66699),l=r(10687),c=r(78227)("iterator"),u=o.values,h=function(e,t){if(e){if(e[c]!==u)try{a(e,c,u)}catch(t){e[c]=u}if(l(e,t,!0),i[t])for(var r in o)if(e[r]!==o[r])try{a(e,r,o[r])}catch(t){e[r]=o[r]}}};for(var d in i)h(n[d]&&n[d].prototype,d);h(s,"DOMTokenList")},55815:(e,t,r)=>{"use strict";var n=r(46518),i=r(97751),s=r(89429),o=r(79039),a=r(2360),l=r(6980),c=r(24913).f,u=r(36840),h=r(62106),d=r(39297),p=r(90679),f=r(28551),m=r(77536),g=r(32603),A=r(55002),y=r(16193),v=r(91181),x=r(43724),_=r(96395),b="DOMException",w="DATA_CLONE_ERR",E=i("Error"),M=i(b)||function(){try{(new(i("MessageChannel")||s("worker_threads").MessageChannel)).port1.postMessage(new WeakMap)}catch(e){if(e.name===w&&25===e.code)return e.constructor}}(),S=M&&M.prototype,C=E.prototype,T=v.set,I=v.getterFor(b),R="stack"in new E(b),B=function(e){return d(A,e)&&A[e].m?A[e].c:0},P=function(){p(this,L);var e=arguments.length,t=g(e<1?void 0:arguments[0]),r=g(e<2?void 0:arguments[1],"Error"),n=B(r);if(T(this,{type:b,name:r,message:t,code:n}),x||(this.name=r,this.message=t,this.code=n),R){var i=new E(t);i.name=b,c(this,"stack",l(1,y(i.stack,1)))}},L=P.prototype=a(C),D=function(e){return{enumerable:!0,configurable:!0,get:e}},O=function(e){return D((function(){return I(this)[e]}))};x&&(h(L,"code",O("code")),h(L,"message",O("message")),h(L,"name",O("name"))),c(L,"constructor",l(1,P));var N=o((function(){return!(new M instanceof E)})),U=N||o((function(){return C.toString!==m||"2: 1"!==String(new M(1,2))})),F=N||o((function(){return 25!==new M(1,"DataCloneError").code})),k=N||25!==M[w]||25!==S[w],z=_?U||F||k:N;n({global:!0,constructor:!0,forced:z},{DOMException:z?P:M});var G=i(b),Q=G.prototype;for(var V in U&&(_||M===G)&&u(Q,"toString",m),F&&x&&M===G&&h(Q,"code",D((function(){return B(f(this).name)}))),A)if(d(A,V)){var H=A[V],j=H.s,q=l(6,H.c);d(G,j)||c(G,j,q),d(Q,j)||c(Q,j,q)}},64979:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(97751),o=r(6980),a=r(24913).f,l=r(39297),c=r(90679),u=r(23167),h=r(32603),d=r(55002),p=r(16193),f=r(43724),m=r(96395),g="DOMException",A=s("Error"),y=s(g),v=function(){c(this,x);var e=arguments.length,t=h(e<1?void 0:arguments[0]),r=h(e<2?void 0:arguments[1],"Error"),n=new y(t,r),i=new A(t);return i.name=g,a(n,"stack",o(1,p(i.stack,1))),u(n,this,v),n},x=v.prototype=y.prototype,_="stack"in new A(g),b="stack"in new y(1,2),w=y&&f&&Object.getOwnPropertyDescriptor(i,g),E=!(!w||w.writable&&w.configurable),M=_&&!E&&!b;n({global:!0,constructor:!0,forced:m||M},{DOMException:M?v:y});var S=s(g),C=S.prototype;if(C.constructor!==S)for(var T in m||a(C,"constructor",o(1,S)),d)if(l(d,T)){var I=d[T],R=I.s;l(S,R)||a(S,R,o(6,I.c))}},79739:(e,t,r)=>{"use strict";var n=r(97751),i="DOMException";r(10687)(n(i),i)},59848:(e,t,r)=>{"use strict";r(86368),r(29309)},122:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(91955),o=r(79306),a=r(22812),l=r(79039),c=r(43724);n({global:!0,enumerable:!0,dontCallGetSet:!0,forced:l((function(){return c&&1!==Object.getOwnPropertyDescriptor(i,"queueMicrotask").value.length}))},{queueMicrotask:function(e){a(arguments.length,1),s(o(e))}})},13611:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(62106),o=r(43724),a=TypeError,l=Object.defineProperty,c=i.self!==i;try{if(o){var u=Object.getOwnPropertyDescriptor(i,"self");!c&&u&&u.get&&u.enumerable||s(i,"self",{get:function(){return i},set:function(e){if(this!==i)throw new a("Illegal invocation");l(i,"self",{value:e,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}else n({global:!0,simple:!0,forced:c},{self:i})}catch(e){}},29309:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(59225).set,o=r(79472),a=i.setImmediate?o(s,!1):s;n({global:!0,bind:!0,enumerable:!0,forced:i.setImmediate!==a},{setImmediate:a})},15575:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(79472)(i.setInterval,!0);n({global:!0,bind:!0,forced:i.setInterval!==s},{setInterval:s})},24599:(e,t,r)=>{"use strict";var n=r(46518),i=r(44576),s=r(79472)(i.setTimeout,!0);n({global:!0,bind:!0,forced:i.setTimeout!==s},{setTimeout:s})},71678:(e,t,r)=>{"use strict";var n,i=r(96395),s=r(46518),o=r(44576),a=r(97751),l=r(79504),c=r(79039),u=r(33392),h=r(94901),d=r(33517),p=r(64117),f=r(20034),m=r(10757),g=r(72652),A=r(28551),y=r(36955),v=r(39297),x=r(97040),_=r(66699),b=r(26198),w=r(22812),E=r(61034),M=r(72248),S=r(94402),C=r(38469),T=r(94483),I=r(24659),R=r(1548),B=o.Object,P=o.Array,L=o.Date,D=o.Error,O=o.TypeError,N=o.PerformanceMark,U=a("DOMException"),F=M.Map,k=M.has,z=M.get,G=M.set,Q=S.Set,V=S.add,H=S.has,j=a("Object","keys"),q=l([].push),W=l((!0).valueOf),Y=l(1..valueOf),X=l("".valueOf),K=l(L.prototype.getTime),$=u("structuredClone"),J="DataCloneError",Z="Transferring",ee=function(e){return!c((function(){var t=new o.Set([7]),r=e(t),n=e(B(7));return r===t||!r.has(7)||!f(n)||7!=+n}))&&e},te=function(e,t){return!c((function(){var r=new t,n=e({a:r,b:r});return!(n&&n.a===n.b&&n.a instanceof t&&n.a.stack===r.stack)}))},re=o.structuredClone,ne=i||!te(re,D)||!te(re,U)||(n=re,!!c((function(){var e=n(new o.AggregateError([1],$,{cause:3}));return"AggregateError"!==e.name||1!==e.errors[0]||e.message!==$||3!==e.cause}))),ie=!re&&ee((function(e){return new N($,{detail:e}).detail})),se=ee(re)||ie,oe=function(e){throw new U("Uncloneable type: "+e,J)},ae=function(e,t){throw new U((t||"Cloning")+" of "+e+" cannot be properly polyfilled in this engine",J)},le=function(e,t){return se||ae(t),se(e)},ce=function(e,t,r){if(k(t,e))return z(t,e);var n,i,s,a,l,c;if("SharedArrayBuffer"===(r||y(e)))n=se?se(e):e;else{var u=o.DataView;u||h(e.slice)||ae("ArrayBuffer");try{if(h(e.slice)&&!e.resizable)n=e.slice(0);else{i=e.byteLength,s="maxByteLength"in e?{maxByteLength:e.maxByteLength}:void 0,n=new ArrayBuffer(i,s),a=new u(e),l=new u(n);for(c=0;c1&&!p(arguments[1])?A(arguments[1]):void 0,i=n?n.transfer:void 0;void 0!==i&&(r=function(e,t){if(!f(e))throw new O("Transfer option cannot be converted to a sequence");var r=[];g(e,(function(e){q(r,A(e))}));for(var n,i,s,a,l,c=0,u=b(r),p=new Q;c{"use strict";r(15575),r(24599)},98406:(e,t,r)=>{"use strict";r(23792),r(27337);var n=r(46518),i=r(44576),s=r(93389),o=r(97751),a=r(69565),l=r(79504),c=r(43724),u=r(67416),h=r(36840),d=r(62106),p=r(56279),f=r(10687),m=r(33994),g=r(91181),A=r(90679),y=r(94901),v=r(39297),x=r(76080),_=r(36955),b=r(28551),w=r(20034),E=r(655),M=r(2360),S=r(6980),C=r(70081),T=r(50851),I=r(62529),R=r(22812),B=r(78227),P=r(74488),L=B("iterator"),D="URLSearchParams",O=D+"Iterator",N=g.set,U=g.getterFor(D),F=g.getterFor(O),k=s("fetch"),z=s("Request"),G=s("Headers"),Q=z&&z.prototype,V=G&&G.prototype,H=i.TypeError,j=i.encodeURIComponent,q=String.fromCharCode,W=o("String","fromCodePoint"),Y=parseInt,X=l("".charAt),K=l([].join),$=l([].push),J=l("".replace),Z=l([].shift),ee=l([].splice),te=l("".split),re=l("".slice),ne=l(/./.exec),ie=/\+/g,se=/^[0-9a-f]+$/i,oe=function(e,t){var r=re(e,t,t+2);return ne(se,r)?Y(r,16):NaN},ae=function(e){for(var t=0,r=128;r>0&&e&r;r>>=1)t++;return t},le=function(e){var t=null;switch(e.length){case 1:t=e[0];break;case 2:t=(31&e[0])<<6|63&e[1];break;case 3:t=(15&e[0])<<12|(63&e[1])<<6|63&e[2];break;case 4:t=(7&e[0])<<18|(63&e[1])<<12|(63&e[2])<<6|63&e[3]}return t>1114111?null:t},ce=function(e){for(var t=(e=J(e,ie," ")).length,r="",n=0;nt){r+="%",n++;continue}var s=oe(e,n+1);if(s!=s){r+=i,n++;continue}n+=2;var o=ae(s);if(0===o)i=q(s);else{if(1===o||o>4){r+="�",n++;continue}for(var a=[s],l=1;lt||"%"!==X(e,n));){var c=oe(e,n+1);if(c!=c){n+=3;break}if(c>191||c<128)break;$(a,c),n+=2,l++}if(a.length!==o){r+="�";continue}var u=le(a);null===u?r+="�":i=W(u)}}r+=i,n++}return r},ue=/[!'()~]|%20/g,he={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},de=function(e){return he[e]},pe=function(e){return J(j(e),ue,de)},fe=m((function(e,t){N(this,{type:O,target:U(e).entries,index:0,kind:t})}),D,(function(){var e=F(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,I(void 0,!0);var n=t[r];switch(e.kind){case"keys":return I(n.key,!1);case"values":return I(n.value,!1)}return I([n.key,n.value],!1)}),!0),me=function(e){this.entries=[],this.url=null,void 0!==e&&(w(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===X(e,0)?re(e,1):e:E(e)))};me.prototype={type:D,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,r,n,i,s,o,l,c=this.entries,u=T(e);if(u)for(r=(t=C(e,u)).next;!(n=a(r,t)).done;){if(s=(i=C(b(n.value))).next,(o=a(s,i)).done||(l=a(s,i)).done||!a(s,i).done)throw new H("Expected sequence with length 2");$(c,{key:E(o.value),value:E(l.value)})}else for(var h in e)v(e,h)&&$(c,{key:h,value:E(e[h])})},parseQuery:function(e){if(e)for(var t,r,n=this.entries,i=te(e,"&"),s=0;s0?arguments[0]:void 0));c||(this.size=e.entries.length)},Ae=ge.prototype;if(p(Ae,{append:function(e,t){var r=U(this);R(arguments.length,2),$(r.entries,{key:E(e),value:E(t)}),c||this.length++,r.updateURL()},delete:function(e){for(var t=U(this),r=R(arguments.length,1),n=t.entries,i=E(e),s=r<2?void 0:arguments[1],o=void 0===s?s:E(s),a=0;at.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,r=U(this).entries,n=x(e,arguments.length>1?arguments[1]:void 0),i=0;i1?xe(arguments[1]):{})}}),y(z)){var _e=function(e){return A(this,Q),new z(e,arguments.length>1?xe(arguments[1]):{})};Q.constructor=_e,_e.prototype=Q,n({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:_e})}}e.exports={URLSearchParams:ge,getState:U}},14603:(e,t,r)=>{"use strict";var n=r(36840),i=r(79504),s=r(655),o=r(22812),a=URLSearchParams,l=a.prototype,c=i(l.append),u=i(l.delete),h=i(l.forEach),d=i([].push),p=new a("a=1&a=2&b=3");p.delete("a",1),p.delete("b",void 0),p+""!="a=2"&&n(l,"delete",(function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&void 0===r)return u(this,e);var n=[];h(this,(function(e,t){d(n,{key:t,value:e})})),o(t,1);for(var i,a=s(e),l=s(r),p=0,f=0,m=!1,g=n.length;p{"use strict";var n=r(36840),i=r(79504),s=r(655),o=r(22812),a=URLSearchParams,l=a.prototype,c=i(l.getAll),u=i(l.has),h=new a("a=1");!h.has("a",2)&&h.has("a",void 0)||n(l,"has",(function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&void 0===r)return u(this,e);var n=c(this,e);o(t,1);for(var i=s(r),a=0;a{"use strict";r(98406)},98721:(e,t,r)=>{"use strict";var n=r(43724),i=r(79504),s=r(62106),o=URLSearchParams.prototype,a=i(o.forEach);n&&!("size"in o)&&s(o,"size",{get:function(){var e=0;return a(this,(function(){e++})),e},configurable:!0,enumerable:!0})},2222:(e,t,r)=>{"use strict";var n=r(46518),i=r(97751),s=r(79039),o=r(22812),a=r(655),l=r(67416),c=i("URL"),u=l&&s((function(){c.canParse()})),h=s((function(){return 1!==c.canParse.length}));n({target:"URL",stat:!0,forced:!u||h},{canParse:function(e){var t=o(arguments.length,1),r=a(e),n=t<2||void 0===arguments[1]?void 0:a(arguments[1]);try{return!!new c(r,n)}catch(e){return!1}}})},45806:(e,t,r)=>{"use strict";r(47764);var n,i=r(46518),s=r(43724),o=r(67416),a=r(44576),l=r(76080),c=r(79504),u=r(36840),h=r(62106),d=r(90679),p=r(39297),f=r(44213),m=r(97916),g=r(67680),A=r(68183).codeAt,y=r(3717),v=r(655),x=r(10687),_=r(22812),b=r(98406),w=r(91181),E=w.set,M=w.getterFor("URL"),S=b.URLSearchParams,C=b.getState,T=a.URL,I=a.TypeError,R=a.parseInt,B=Math.floor,P=Math.pow,L=c("".charAt),D=c(/./.exec),O=c([].join),N=c(1..toString),U=c([].pop),F=c([].push),k=c("".replace),z=c([].shift),G=c("".split),Q=c("".slice),V=c("".toLowerCase),H=c([].unshift),j="Invalid scheme",q="Invalid host",W="Invalid port",Y=/[a-z]/i,X=/[\d+-.a-z]/i,K=/\d/,$=/^0x/i,J=/^[0-7]+$/,Z=/^\d+$/,ee=/^[\da-f]+$/i,te=/[\0\t\n\r #%/:<>?@[\\\]^|]/,re=/[\0\t\n\r #/:<>?@[\\\]^|]/,ne=/^[\u0000-\u0020]+/,ie=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,se=/[\t\n\r]/g,oe=function(e){var t,r,n,i;if("number"==typeof e){for(t=[],r=0;r<4;r++)H(t,e%256),e=B(e/256);return O(t,".")}if("object"==typeof e){for(t="",n=function(e){for(var t=null,r=1,n=null,i=0,s=0;s<8;s++)0!==e[s]?(i>r&&(t=n,r=i),n=null,i=0):(null===n&&(n=s),++i);return i>r?n:t}(e),r=0;r<8;r++)i&&0===e[r]||(i&&(i=!1),n===r?(t+=r?":":"::",i=!0):(t+=N(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},ae={},le=f({},ae,{" ":1,'"':1,"<":1,">":1,"`":1}),ce=f({},le,{"#":1,"?":1,"{":1,"}":1}),ue=f({},ce,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),he=function(e,t){var r=A(e,0);return r>32&&r<127&&!p(t,e)?e:encodeURIComponent(e)},de={ftp:21,file:null,http:80,https:443,ws:80,wss:443},pe=function(e,t){var r;return 2===e.length&&D(Y,L(e,0))&&(":"===(r=L(e,1))||!t&&"|"===r)},fe=function(e){var t;return e.length>1&&pe(Q(e,0,2))&&(2===e.length||"/"===(t=L(e,2))||"\\"===t||"?"===t||"#"===t)},me=function(e){return"."===e||"%2e"===V(e)},ge={},Ae={},ye={},ve={},xe={},_e={},be={},we={},Ee={},Me={},Se={},Ce={},Te={},Ie={},Re={},Be={},Pe={},Le={},De={},Oe={},Ne={},Ue=function(e,t,r){var n,i,s,o=v(e);if(t){if(i=this.parse(o))throw new I(i);this.searchParams=null}else{if(void 0!==r&&(n=new Ue(r,!0)),i=this.parse(o,null,n))throw new I(i);(s=C(new S)).bindURL(this),this.searchParams=s}};Ue.prototype={type:"URL",parse:function(e,t,r){var i,s,o,a,l,c=this,u=t||ge,h=0,d="",f=!1,A=!1,y=!1;for(e=v(e),t||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,e=k(e,ne,""),e=k(e,ie,"$1")),e=k(e,se,""),i=m(e);h<=i.length;){switch(s=i[h],u){case ge:if(!s||!D(Y,s)){if(t)return j;u=ye;continue}d+=V(s),u=Ae;break;case Ae:if(s&&(D(X,s)||"+"===s||"-"===s||"."===s))d+=V(s);else{if(":"!==s){if(t)return j;d="",u=ye,h=0;continue}if(t&&(c.isSpecial()!==p(de,d)||"file"===d&&(c.includesCredentials()||null!==c.port)||"file"===c.scheme&&!c.host))return;if(c.scheme=d,t)return void(c.isSpecial()&&de[c.scheme]===c.port&&(c.port=null));d="","file"===c.scheme?u=Ie:c.isSpecial()&&r&&r.scheme===c.scheme?u=ve:c.isSpecial()?u=we:"/"===i[h+1]?(u=xe,h++):(c.cannotBeABaseURL=!0,F(c.path,""),u=De)}break;case ye:if(!r||r.cannotBeABaseURL&&"#"!==s)return j;if(r.cannotBeABaseURL&&"#"===s){c.scheme=r.scheme,c.path=g(r.path),c.query=r.query,c.fragment="",c.cannotBeABaseURL=!0,u=Ne;break}u="file"===r.scheme?Ie:_e;continue;case ve:if("/"!==s||"/"!==i[h+1]){u=_e;continue}u=Ee,h++;break;case xe:if("/"===s){u=Me;break}u=Le;continue;case _e:if(c.scheme=r.scheme,s===n)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=g(r.path),c.query=r.query;else if("/"===s||"\\"===s&&c.isSpecial())u=be;else if("?"===s)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=g(r.path),c.query="",u=Oe;else{if("#"!==s){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=g(r.path),c.path.length--,u=Le;continue}c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=g(r.path),c.query=r.query,c.fragment="",u=Ne}break;case be:if(!c.isSpecial()||"/"!==s&&"\\"!==s){if("/"!==s){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,u=Le;continue}u=Me}else u=Ee;break;case we:if(u=Ee,"/"!==s||"/"!==L(d,h+1))continue;h++;break;case Ee:if("/"!==s&&"\\"!==s){u=Me;continue}break;case Me:if("@"===s){f&&(d="%40"+d),f=!0,o=m(d);for(var x=0;x65535)return W;c.port=c.isSpecial()&&w===de[c.scheme]?null:w,d=""}if(t)return;u=Pe;continue}return W}d+=s;break;case Ie:if(c.scheme="file","/"===s||"\\"===s)u=Re;else{if(!r||"file"!==r.scheme){u=Le;continue}switch(s){case n:c.host=r.host,c.path=g(r.path),c.query=r.query;break;case"?":c.host=r.host,c.path=g(r.path),c.query="",u=Oe;break;case"#":c.host=r.host,c.path=g(r.path),c.query=r.query,c.fragment="",u=Ne;break;default:fe(O(g(i,h),""))||(c.host=r.host,c.path=g(r.path),c.shortenPath()),u=Le;continue}}break;case Re:if("/"===s||"\\"===s){u=Be;break}r&&"file"===r.scheme&&!fe(O(g(i,h),""))&&(pe(r.path[0],!0)?F(c.path,r.path[0]):c.host=r.host),u=Le;continue;case Be:if(s===n||"/"===s||"\\"===s||"?"===s||"#"===s){if(!t&&pe(d))u=Le;else if(""===d){if(c.host="",t)return;u=Pe}else{if(a=c.parseHost(d))return a;if("localhost"===c.host&&(c.host=""),t)return;d="",u=Pe}continue}d+=s;break;case Pe:if(c.isSpecial()){if(u=Le,"/"!==s&&"\\"!==s)continue}else if(t||"?"!==s)if(t||"#"!==s){if(s!==n&&(u=Le,"/"!==s))continue}else c.fragment="",u=Ne;else c.query="",u=Oe;break;case Le:if(s===n||"/"===s||"\\"===s&&c.isSpecial()||!t&&("?"===s||"#"===s)){if(".."===(l=V(l=d))||"%2e."===l||".%2e"===l||"%2e%2e"===l?(c.shortenPath(),"/"===s||"\\"===s&&c.isSpecial()||F(c.path,"")):me(d)?"/"===s||"\\"===s&&c.isSpecial()||F(c.path,""):("file"===c.scheme&&!c.path.length&&pe(d)&&(c.host&&(c.host=""),d=L(d,0)+":"),F(c.path,d)),d="","file"===c.scheme&&(s===n||"?"===s||"#"===s))for(;c.path.length>1&&""===c.path[0];)z(c.path);"?"===s?(c.query="",u=Oe):"#"===s&&(c.fragment="",u=Ne)}else d+=he(s,ce);break;case De:"?"===s?(c.query="",u=Oe):"#"===s?(c.fragment="",u=Ne):s!==n&&(c.path[0]+=he(s,ae));break;case Oe:t||"#"!==s?s!==n&&("'"===s&&c.isSpecial()?c.query+="%27":c.query+="#"===s?"%23":he(s,ae)):(c.fragment="",u=Ne);break;case Ne:s!==n&&(c.fragment+=he(s,le))}h++}},parseHost:function(e){var t,r,n;if("["===L(e,0)){if("]"!==L(e,e.length-1))return q;if(t=function(e){var t,r,n,i,s,o,a,l=[0,0,0,0,0,0,0,0],c=0,u=null,h=0,d=function(){return L(e,h)};if(":"===d()){if(":"!==L(e,1))return;h+=2,u=++c}for(;d();){if(8===c)return;if(":"!==d()){for(t=r=0;r<4&&D(ee,d());)t=16*t+R(d(),16),h++,r++;if("."===d()){if(0===r)return;if(h-=r,c>6)return;for(n=0;d();){if(i=null,n>0){if(!("."===d()&&n<4))return;h++}if(!D(K,d()))return;for(;D(K,d());){if(s=R(d(),10),null===i)i=s;else{if(0===i)return;i=10*i+s}if(i>255)return;h++}l[c]=256*l[c]+i,2!=++n&&4!==n||c++}if(4!==n)return;break}if(":"===d()){if(h++,!d())return}else if(d())return;l[c++]=t}else{if(null!==u)return;h++,u=++c}}if(null!==u)for(o=c-u,c=7;0!==c&&o>0;)a=l[c],l[c--]=l[u+o-1],l[u+--o]=a;else if(8!==c)return;return l}(Q(e,1,-1)),!t)return q;this.host=t}else if(this.isSpecial()){if(e=y(e),D(te,e))return q;if(t=function(e){var t,r,n,i,s,o,a,l=G(e,".");if(l.length&&""===l[l.length-1]&&l.length--,(t=l.length)>4)return e;for(r=[],n=0;n1&&"0"===L(i,0)&&(s=D($,i)?16:8,i=Q(i,8===s?1:2)),""===i)o=0;else{if(!D(10===s?Z:8===s?J:ee,i))return e;o=R(i,s)}F(r,o)}for(n=0;n=P(256,5-t))return null}else if(o>255)return null;for(a=U(r),n=0;n1?arguments[1]:void 0,n=E(t,new Ue(e,!1,r));s||(t.href=n.serialize(),t.origin=n.getOrigin(),t.protocol=n.getProtocol(),t.username=n.getUsername(),t.password=n.getPassword(),t.host=n.getHost(),t.hostname=n.getHostname(),t.port=n.getPort(),t.pathname=n.getPathname(),t.search=n.getSearch(),t.searchParams=n.getSearchParams(),t.hash=n.getHash())},ke=Fe.prototype,ze=function(e,t){return{get:function(){return M(this)[e]()},set:t&&function(e){return M(this)[t](e)},configurable:!0,enumerable:!0}};if(s&&(h(ke,"href",ze("serialize","setHref")),h(ke,"origin",ze("getOrigin")),h(ke,"protocol",ze("getProtocol","setProtocol")),h(ke,"username",ze("getUsername","setUsername")),h(ke,"password",ze("getPassword","setPassword")),h(ke,"host",ze("getHost","setHost")),h(ke,"hostname",ze("getHostname","setHostname")),h(ke,"port",ze("getPort","setPort")),h(ke,"pathname",ze("getPathname","setPathname")),h(ke,"search",ze("getSearch","setSearch")),h(ke,"searchParams",ze("getSearchParams")),h(ke,"hash",ze("getHash","setHash"))),u(ke,"toJSON",(function(){return M(this).serialize()}),{enumerable:!0}),u(ke,"toString",(function(){return M(this).serialize()}),{enumerable:!0}),T){var Ge=T.createObjectURL,Qe=T.revokeObjectURL;Ge&&u(Fe,"createObjectURL",l(Ge,T)),Qe&&u(Fe,"revokeObjectURL",l(Qe,T))}x(Fe,"URL"),i({global:!0,constructor:!0,forced:!o,sham:!s},{URL:Fe})},3296:(e,t,r)=>{"use strict";r(45806)},45781:(e,t,r)=>{"use strict";var n=r(46518),i=r(97751),s=r(22812),o=r(655),a=r(67416),l=i("URL");n({target:"URL",stat:!0,forced:!a},{parse:function(e){var t=s(arguments.length,1),r=o(e),n=t<2||void 0===arguments[1]?void 0:o(arguments[1]);try{return new l(r,n)}catch(e){return null}}})},27208:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565);n({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return i(URL.prototype.toString,this)}})},52219:(e,t,r)=>{"use strict";r.d(t,{C1:()=>y});var n=r(39437);new n.Spherical,new n.Vector3;const i=new n.Spherical,s=new n.Vector3,o=new n.Vector3,a=new n.Vector3,l=new n.Vector3,c=new n.Matrix4,u=new n.Matrix4,h=new n.Sphere,d=new n.Euler,p=new n.Vector3,f=new n.Vector3,m=new n.Vector3,g=new n.Vector3,A=new n.Ray;class y{constructor(e=1,t=1,r=1){this.radius=new n.Vector3(e,t,r)}intersectRay(e,t){return c.makeScale(...this.radius).invert(),h.center.set(0,0,0),h.radius=1,A.copy(e).applyMatrix4(c),A.intersectSphere(h,t)?(c.makeScale(...this.radius),t.applyMatrix4(c),t):null}getEastNorthUpFrame(e,t,r){return this.getEastNorthUpAxes(e,t,p,f,m,g),r.makeBasis(p,f,m).setPosition(g)}getEastNorthUpAxes(e,t,r,n,i,s=g){this.getCartographicToPosition(e,t,0,s),this.getCartographicToNormal(e,t,i),r.set(-s.y,s.x,0).normalize(),n.crossVectors(i,r).normalize()}getNorthernTangent(e,t,r,n=l){return console.log("Ellipsoid: getNorthernTangent has been deprecated. Use getEastNorthUpAxes instead."),this.getEastNorthUpAxes(e,t,n,r,m),n.multiplyScalar(-1),r}getAzElRollFromRotationMatrix(e,t,r,n,i=0){return 1===i?(d.set(-Math.PI/2,0,0,"XYZ"),u.makeRotationFromEuler(d).premultiply(r)):2===i?(d.set(-Math.PI/2,0,Math.PI,"XYZ"),u.makeRotationFromEuler(d).premultiply(r)):u.copy(r),this.getEastNorthUpFrame(e,t,c).invert(),u.premultiply(c),d.setFromRotationMatrix(u,"ZXY"),n.azimuth=-d.z,n.elevation=d.x,n.roll=d.y,n}getRotationMatrixFromAzElRoll(e,t,r,n,i,s,o=0){return this.getEastNorthUpFrame(e,t,c),d.set(n,i,-r,"ZXY"),s.makeRotationFromEuler(d).premultiply(c).setPosition(0,0,0),1===o?(d.set(Math.PI/2,0,0,"XYZ"),u.makeRotationFromEuler(d),s.multiply(u)):2===o&&(d.set(-Math.PI/2,0,Math.PI,"XYZ"),u.makeRotationFromEuler(d),s.multiply(u)),s}getCartographicToPosition(e,t,r,n){this.getCartographicToNormal(e,t,s);const i=this.radius;o.copy(s),o.x*=i.x**2,o.y*=i.y**2,o.z*=i.z**2;const a=Math.sqrt(s.dot(o));return o.divideScalar(a),n.copy(o).addScaledVector(s,r)}getPositionToCartographic(e,t){this.getPositionToSurfacePoint(e,o),this.getPositionToNormal(e,s);const r=a.subVectors(e,o);return t.lon=Math.atan2(s.y,s.x),t.lat=Math.asin(s.z),t.height=Math.sign(r.dot(e))*r.length(),t}getCartographicToNormal(e,t,r){return i.set(1,-e+Math.PI/2,t),r.setFromSpherical(i).normalize(),function(e){const{x:t,y:r,z:n}=e;e.x=n,e.y=t,e.z=r}(r),r}getPositionToNormal(e,t){const r=this.radius;return t.copy(e),t.x/=r.x**2,t.y/=r.y**2,t.z/=r.z**2,t.normalize(),t}getPositionToSurfacePoint(e,t){const r=this.radius,n=1/r.x**2,i=1/r.y**2,s=1/r.z**2,l=e.x*e.x*n,c=e.y*e.y*i,u=e.z*e.z*s,h=l+c+u,d=Math.sqrt(1/h),p=o.copy(e).multiplyScalar(d);if(h<.1)return isFinite(d)?t.copy(p):null;const f=a.set(p.x*n*2,p.y*i*2,p.z*s*2);let m,g,A,y,v,x,_,b,w,E,M,S=(1-d)*e.length()/(.5*f.length()),C=0;do{S-=C,A=1/(1+S*n),y=1/(1+S*i),v=1/(1+S*s),x=A*A,_=y*y,b=v*v,w=x*A,E=_*y,M=b*v,m=l*x+c*_+u*b-1,g=l*w*n+c*E*i+u*M*s,C=m/(-2*g)}while(Math.abs(m)>1e-12);return t.set(e.x*A,e.y*y,e.z*v)}calculateHorizonDistance(e,t){const r=this.calculateEffectiveRadius(e);return Math.sqrt(2*r*t+t**2)}calculateEffectiveRadius(e){const t=this.radius.x,r=1-this.radius.z**2/t**2,i=e*n.MathUtils.DEG2RAD,s=Math.sin(i)**2;return t/Math.sqrt(1-r*s)}getPositionElevation(e){this.getPositionToSurfacePoint(e,o);const t=a.subVectors(e,o);return Math.sign(t.dot(e))*t.length()}copy(e){return this.radius.copy(e.radius),this}clone(){return(new this.constructor).copy(this)}}},5247:(e,t,r)=>{"use strict";r.d(t,{M:()=>m});var n=r(39437),i=r(52219);const s=Math.PI,o=s/2,a=new n.Vector3,l=new n.Vector3,c=new n.Vector3,u=new n.Matrix4;let h=0;const d=[];function p(e=!1){return e?(d[h]||(d[h]=new n.Vector3),h++,d[h-1]):new n.Vector3}function f(){h=0}class m extends i.C1{constructor(e,t,r,n=-o,i=o,a=0,l=2*s,c=0,u=0){super(e,t,r),this.latStart=n,this.latEnd=i,this.lonStart=a,this.lonEnd=l,this.heightStart=c,this.heightEnd=u}_getPoints(e=!1){const{latStart:t,latEnd:r,lonStart:i,lonEnd:a,heightStart:l,heightEnd:c}=this,u=n.MathUtils.mapLinear(.5,0,1,t,r),h=n.MathUtils.mapLinear(.5,0,1,i,a),d=Math.floor(i/o)*o,f=[[-s/2,0],[s/2,0],[0,d],[0,d+s/2],[0,d+s],[0,d+3*s/2],[t,a],[r,a],[t,i],[r,i],[0,i],[0,a],[u,h],[t,h],[r,h],[u,i],[u,a]],m=[],g=f.length;for(let s=0;s<=1;s++){const o=n.MathUtils.mapLinear(s,0,1,l,c);for(let n=0,s=g;n=t&&s<=r&&l>=i&&l<=a){const t=p(e);m.push(t),this.getCartographicToPosition(s,l,o,t)}}}return m}getBoundingBox(e,t){f();const{latStart:r,latEnd:i,lonStart:o,lonEnd:h}=this;if(i-r{"use strict";r.d(t,{dn:()=>cn,fC:()=>Mr});var n={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};class i{constructor(e,t,r,n){this.message=(e?`${e}: `:"")+r,n&&(this.identifier=n),null!=t&&t.__line__&&(this.line=t.__line__)}}function s(e,...t){for(const r of t)for(const t in r)e[t]=r[t];return e}class o extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}class a{constructor(e,t=[]){this.parent=e,this.bindings={};for(const[e,r]of t)this.bindings[e]=r}concat(e){return new a(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}const l={kind:"null"},c={kind:"number"},u={kind:"string"},h={kind:"boolean"},d={kind:"color"},p={kind:"projectionDefinition"},f={kind:"object"},m={kind:"value"},g={kind:"collator"},A={kind:"formatted"},y={kind:"padding"},v={kind:"resolvedImage"},x={kind:"variableAnchorOffsetCollection"};function _(e,t){return{kind:"array",itemType:e,N:t}}function b(e){if("array"===e.kind){const t=b(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}const w=[l,c,u,h,d,p,A,f,_(m),y,v,x];function E(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!E(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(const e of w)if(!E(e,t))return null}return`Expected ${b(e)} but found ${b(t)} instead.`}function M(e,t){return t.some((t=>t.kind===e.kind))}function S(e,t){return t.some((t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e))}function C(e,t){return"array"===e.kind&&"array"===t.kind?e.itemType.kind===t.itemType.kind&&"number"==typeof e.N:e.kind===t.kind}const T=.96422,I=.82521,R=4/29,B=6/29,P=3*B*B,L=B*B*B,D=Math.PI/180,O=180/Math.PI;function N(e){return(e%=360)<0&&(e+=360),e}function U([e,t,r,n]){let i,s;const o=k((.2225045*(e=F(e))+.7168786*(t=F(t))+.0606169*(r=F(r)))/1);e===t&&t===r?i=s=o:(i=k((.4360747*e+.3850649*t+.1430804*r)/T),s=k((.0139322*e+.0971045*t+.7141733*r)/I));const a=116*o-16;return[a<0?0:a,500*(i-o),200*(o-s),n]}function F(e){return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function k(e){return e>L?Math.pow(e,1/3):e/P+R}function z([e,t,r,n]){let i=(e+16)/116,s=isNaN(t)?i:i+t/500,o=isNaN(r)?i:i-r/200;return i=1*Q(i),s=T*Q(s),o=I*Q(o),[G(3.1338561*s-1.6168667*i-.4906146*o),G(-.9787684*s+1.9161415*i+.033454*o),G(.0719453*s-.2289914*i+1.4052427*o),n]}function G(e){return(e=e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055)<0?0:e>1?1:e}function Q(e){return e>B?e*e*e:P*(e-R)}function V(e){return parseInt(e.padEnd(2,e),16)/255}function H(e,t){return j(t?e/100:e,0,1)}function j(e,t,r){return Math.min(Math.max(t,e),r)}function q(e){return!e.some(Number.isNaN)}const W={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function Y(e,t,r){return e+r*(t-e)}function X(e,t,r){return e.map(((e,n)=>Y(e,t[n],r)))}class K{constructor(e,t,r,n=1,i=!0){this.r=e,this.g=t,this.b=r,this.a=n,i||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter("rgb",[e,t,r,n]))}static parse(e){if(e instanceof K)return e;if("string"!=typeof e)return;const t=function(e){if("transparent"===(e=e.toLowerCase().trim()))return[0,0,0,0];const t=W[e];if(t){const[e,r,n]=t;return[e/255,r/255,n/255,1]}if(e.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e)){const t=e.length<6?1:2;let r=1;return[V(e.slice(r,r+=t)),V(e.slice(r,r+=t)),V(e.slice(r,r+=t)),V(e.slice(r,r+t)||"ff")]}if(e.startsWith("rgb")){const t=/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,r=e.match(t);if(r){const[e,t,n,i,s,o,a,l,c,u,h,d]=r,p=[i||" ",a||" ",u].join("");if(" "===p||" /"===p||",,"===p||",,,"===p){const e=[n,o,c].join(""),r="%%%"===e?100:""===e?255:0;if(r){const e=[j(+t/r,0,1),j(+s/r,0,1),j(+l/r,0,1),h?H(+h,d):1];if(q(e))return e}}return}}const r=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(r){const[e,t,n,i,s,o,a,l,c]=r,u=[n||" ",s||" ",a].join("");if(" "===u||" /"===u||",,"===u||",,,"===u){const e=[+t,j(+i,0,100),j(+o,0,100),l?H(+l,c):1];if(q(e))return function([e,t,r,n]){function i(n){const i=(n+e/30)%12,s=t*Math.min(r,1-r);return r-s*Math.max(-1,Math.min(i-3,9-i,1))}return e=N(e),t/=100,r/=100,[i(0),i(8),i(4),n]}(e)}}}(e);return t?new K(...t,!1):void 0}get rgb(){const{r:e,g:t,b:r,a:n}=this,i=n||1/0;return this.overwriteGetter("rgb",[e/i,t/i,r/i,n])}get hcl(){return this.overwriteGetter("hcl",function(e){const[t,r,n,i]=U(e),s=Math.sqrt(r*r+n*n);return[Math.round(1e4*s)?N(Math.atan2(n,r)*O):NaN,s,t,i]}(this.rgb))}get lab(){return this.overwriteGetter("lab",U(this.rgb))}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){const[e,t,r,n]=this.rgb;return`rgba(${[e,t,r].map((e=>Math.round(255*e))).join(",")},${n})`}static interpolate(e,t,r,n="rgb"){switch(n){case"rgb":{const[n,i,s,o]=X(e.rgb,t.rgb,r);return new K(n,i,s,o,!1)}case"hcl":{const[n,i,s,o]=e.hcl,[a,l,c,u]=t.hcl;let h,d;if(isNaN(n)||isNaN(a))isNaN(n)?isNaN(a)?h=NaN:(h=a,1!==s&&0!==s||(d=l)):(h=n,1!==c&&0!==c||(d=i));else{let e=a-n;a>n&&e>180?e-=360:a180&&(e+=360),h=n+r*e}const[p,f,m,g]=function([e,t,r,n]){return e=isNaN(e)?0:e*D,z([r,Math.cos(e)*t,Math.sin(e)*t,n])}([h,null!=d?d:Y(i,l,r),Y(s,c,r),Y(o,u,r)]);return new K(p,f,m,g,!1)}case"lab":{const[n,i,s,o]=z(X(e.lab,t.lab,r));return new K(n,i,s,o,!1)}}}}K.black=new K(0,0,0,1),K.white=new K(1,1,1,1),K.transparent=new K(0,0,0,0),K.red=new K(1,0,0,1);class ${constructor(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class J{constructor(e,t,r,n,i){this.text=e,this.image=t,this.scale=r,this.fontStack=n,this.textColor=i}}class Z{constructor(e){this.sections=e}static fromString(e){return new Z([new J(e,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((e=>0!==e.text.length||e.image&&0!==e.image.name.length))}static factory(e){return e instanceof Z?e:Z.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map((e=>e.text)).join("")}}class ee{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof ee)return e;if("number"==typeof e)return new ee([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const t of e)if("number"!=typeof t)return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new ee(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r){return new ee(X(e.values,t.values,r))}}class te{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const re=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class ne{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof ne)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let t=0;t=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[e,t,r,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof n?[e,t,r,n]:[e,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function ae(e){if(null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e||e instanceof se||e instanceof K||e instanceof $||e instanceof Z||e instanceof ee||e instanceof ne||e instanceof ie)return!0;if(Array.isArray(e)){for(const t of e)if(!ae(t))return!1;return!0}if("object"==typeof e){for(const t in e)if(!ae(e[t]))return!1;return!0}return!1}function le(e){if(null===e)return l;if("string"==typeof e)return u;if("boolean"==typeof e)return h;if("number"==typeof e)return c;if(e instanceof K)return d;if(e instanceof se)return p;if(e instanceof $)return g;if(e instanceof Z)return A;if(e instanceof ee)return y;if(e instanceof ne)return x;if(e instanceof ie)return v;if(Array.isArray(e)){const t=e.length;let r;for(const t of e){const e=le(t);if(r){if(r===e)continue;r=m;break}r=e}return _(r||m,t)}return f}function ce(e){const t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof K||e instanceof se||e instanceof Z||e instanceof ee||e instanceof ne||e instanceof ie?e.toString():JSON.stringify(e)}class ue{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(2!==e.length)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!ae(e[1]))return t.error("invalid value");const r=e[1];let n=le(r);const i=t.expectedType;return"array"!==n.kind||0!==n.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(n=i),new ue(n,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}const he={string:u,number:c,boolean:h,object:f};class de{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r,n=1;const i=e[0];if("array"===i){let i,s;if(e.length>2){const r=e[1];if("string"!=typeof r||!(r in he)||"object"===r)return t.error('The item type argument of "array" must be one of string, number, boolean',1);i=he[r],n++}else i=m;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);s=e[2],n++}r=_(i,s)}else{if(!he[i])throw new Error(`Types doesn't contain name = ${i}`);r=he[i]}const s=[];for(;ne.outputDefined()))}}const pe={"to-boolean":h,"to-color":d,"to-number":c,"to-string":u};class fe{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[0];if(!pe[r])throw new Error(`Can't parse ${r} as it is not part of the known types`);if(("to-boolean"===r||"to-string"===r)&&2!==e.length)return t.error("Expected one argument.");const n=pe[r],i=[];for(let r=1;r4?`Invalid rgba value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:oe(t[0],t[1],t[2],t[3]),!r))return new K(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new te(r||`Could not parse color from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"padding":{let t;for(const r of this.args){t=r.evaluate(e);const n=ee.parse(t);if(n)return n}throw new te(`Could not parse padding from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"variableAnchorOffsetCollection":{let t;for(const r of this.args){t=r.evaluate(e);const n=ne.parse(t);if(n)return n}throw new te(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"number":{let t=null;for(const r of this.args){if(t=r.evaluate(e),null===t)return 0;const n=Number(t);if(!isNaN(n))return n}throw new te(`Could not convert ${JSON.stringify(t)} to number.`)}case"formatted":return Z.fromString(ce(this.args[0].evaluate(e)));case"resolvedImage":return ie.fromString(ce(this.args[0].evaluate(e)));case"projectionDefinition":return this.args[0].evaluate(e);default:return ce(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}function me(e){let t=0;for(let r,n,i=0,s=e.length,o=s-1;i`[${e}]`)).join(""),this.scope=i,this.errors=s,this.expectedType=n,this._isConstant=t}parse(e,t,r,n,i={}){return t?this.concat(t,r,n)._parse(e,i):this._parse(e,i)}_parse(e,t){function r(e,t,r){return"assert"===r?new de(t,[e]):"coerce"===r?new fe(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const n=e[0];if("string"!=typeof n)return this.error(`Expression name must be a string, but found ${typeof n} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const i=this.registry[n];if(i){let n=i.parse(e,this);if(!n)return null;if(this.expectedType){const e=this.expectedType,i=n.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==i.kind)if("projectionDefinition"!==e.kind||"string"!==i.kind&&"array"!==i.kind)if("color"!==e.kind&&"formatted"!==e.kind&&"resolvedImage"!==e.kind||"value"!==i.kind&&"string"!==i.kind)if("padding"!==e.kind||"value"!==i.kind&&"number"!==i.kind&&"array"!==i.kind)if("variableAnchorOffsetCollection"!==e.kind||"value"!==i.kind&&"array"!==i.kind){if(this.checkSubtype(e,i))return null}else n=r(n,e,t.typeAnnotation||"coerce");else n=r(n,e,t.typeAnnotation||"coerce");else n=r(n,e,t.typeAnnotation||"coerce");else n=r(n,e,t.typeAnnotation||"coerce");else n=r(n,e,t.typeAnnotation||"assert")}if(!(n instanceof ue)&&"resolvedImage"!==n.type.kind&&this._isConstant(n)){const e=new ye;try{n=new ue(n.type,n.evaluate(e))}catch(e){return this.error(e.message),null}}return n}return this.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0)}return void 0===e?this.error("'undefined' value invalid. Use null instead."):"object"==typeof e?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(e,t,r){const n="number"==typeof e?this.path.concat(e):this.path,i=r?this.scope.concat(r):this.scope;return new ve(this.registry,this._isConstant,n,t||null,i,this.errors)}error(e,...t){const r=`${this.key}${t.map((e=>`[${e}]`)).join("")}`;this.errors.push(new o(r,e))}checkSubtype(e,t){const r=E(e,t);return r&&this.error(r),r}}class xe{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const r=[];for(let n=1;n=r.length)throw new te(`Array index out of bounds: ${t} > ${r.length-1}.`);if(t!==Math.floor(t))throw new te(`Array index must be an integer, but found ${t} instead.`);return r[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class we{constructor(e,t){this.type=h,this.needle=e,this.haystack=t}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,m),n=t.parse(e[2],2,m);return r&&n?M(r.type,[h,u,c,l,m])?new we(r,n):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${b(r.type)} instead`):null}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!S(t,["boolean","string","number","null"]))throw new te(`Expected first argument to be of type boolean, string, number or null, but found ${b(le(t))} instead.`);if(!S(r,["string","array"]))throw new te(`Expected second argument to be of type array or string, but found ${b(le(r))} instead.`);return r.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class Ee{constructor(e,t,r){this.type=c,this.needle=e,this.haystack=t,this.fromIndex=r}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,m),n=t.parse(e[2],2,m);if(!r||!n)return null;if(!M(r.type,[h,u,c,l,m]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${b(r.type)} instead`);if(4===e.length){const i=t.parse(e[3],3,c);return i?new Ee(r,n,i):null}return new Ee(r,n)}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!S(t,["boolean","string","number","null"]))throw new te(`Expected first argument to be of type boolean, string, number or null, but found ${b(le(t))} instead.`);let n;if(this.fromIndex&&(n=this.fromIndex.evaluate(e)),S(r,["string"])){const e=r.indexOf(t,n);return-1===e?-1:[...r.slice(0,e)].length}if(S(r,["array"]))return r.indexOf(t,n);throw new te(`Expected second argument to be of type array or string, but found ${b(le(r))} instead.`)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class Me{constructor(e,t,r,n,i,s){this.inputType=e,this.type=t,this.input=r,this.cases=n,this.outputs=i,this.otherwise=s}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return t.error("Expected an even number of arguments.");let r,n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);const i={},s=[];for(let o=2;oNumber.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof e&&Math.floor(e)!==e)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,le(e)))return null}else r=le(e);if(void 0!==i[String(e)])return c.error("Branch labels must be unique.");i[String(e)]=s.length}const u=t.parse(l,o,n);if(!u)return null;n=n||u.type,s.push(u)}const o=t.parse(e[1],1,m);if(!o)return null;const a=t.parse(e[e.length-1],e.length-1,n);return a?"value"!==o.type.kind&&t.concat(1).checkSubtype(r,o.type)?null:new Me(r,n,o,i,s,a):null}evaluate(e){const t=this.input.evaluate(e);return(le(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))&&this.otherwise.outputDefined()}}class Se{constructor(e,t,r){this.type=e,this.branches=t,this.otherwise=r}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return t.error("Expected an odd number of arguments.");let r;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);const n=[];for(let i=1;it.outputDefined()))&&this.otherwise.outputDefined()}}class Ce{constructor(e,t,r,n){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=n}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,m),n=t.parse(e[2],2,c);if(!r||!n)return null;if(!M(r.type,[_(m),u,m]))return t.error(`Expected first argument to be of type array or string, but found ${b(r.type)} instead`);if(4===e.length){const i=t.parse(e[3],3,c);return i?new Ce(r.type,r,n,i):null}return new Ce(r.type,r,n)}evaluate(e){const t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);let n;if(this.endIndex&&(n=this.endIndex.evaluate(e)),S(t,["string"]))return[...t].slice(r,n).join("");if(S(t,["array"]))return t.slice(r,n);throw new te(`Expected first argument to be of type array or string, but found ${b(le(t))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function Te(e,t){const r=e.length-1;let n,i,s=0,o=r,a=0;for(;s<=o;)if(a=Math.floor((s+o)/2),n=e[a],i=e[a+1],n<=t){if(a===r||tt))throw new te("Input is not a number.");o=a-1}return 0}class Ie{constructor(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[e,t]of r)this.labels.push(e),this.outputs.push(t)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");const r=t.parse(e[1],1,c);if(!r)return null;const n=[];let i=null;t.expectedType&&"value"!==t.expectedType.kind&&(i=t.expectedType);for(let r=1;r=s)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',a);const c=t.parse(o,l,i);if(!c)return null;i=i||c.type,n.push([s,c])}return new Ie(i,r,n)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const i=t.length;return n>=t[i-1]?r[i-1].evaluate(e):r[Te(t,n)].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function Re(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Be,Pe,Le=function(){if(Pe)return Be;function e(e,t,r,n){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=r,this.p2y=n}return Pe=1,Be=e,e.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(void 0===t&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var r=e,n=0;n<8;n++){var i=this.sampleCurveX(r)-e;if(Math.abs(i)i?o=r:a=r,r=.5*(a-o)+o;return r},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}},Be}(),De=Re(Le);class Oe{constructor(e,t,r,n,i){this.type=e,this.operator=t,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(const[e,t]of i)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,r,n){let i=0;if("exponential"===e.name)i=Ne(t,e.base,r,n);else if("linear"===e.name)i=Ne(t,1,r,n);else if("cubic-bezier"===e.name){const s=e.controlPoints;i=new De(s[0],s[1],s[2],s[3]).solve(Ne(t,1,r,n))}return i}static parse(e,t){let[r,n,i,...s]=e;if(!Array.isArray(n)||0===n.length)return t.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){const e=n[1];if("number"!=typeof e)return t.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:e}}else{if("cubic-bezier"!==n[0])return t.error(`Unknown interpolation type ${String(n[0])}`,1,0);{const e=n.slice(1);if(4!==e.length||e.some((e=>"number"!=typeof e||e<0||e>1)))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:e}}}if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(i=t.parse(i,2,c),!i)return null;const o=[];let a=null;"interpolate-hcl"===r||"interpolate-lab"===r?a=d:t.expectedType&&"value"!==t.expectedType.kind&&(a=t.expectedType);for(let e=0;e=r)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',i);const c=t.parse(n,l,a);if(!c)return null;a=a||c.type,o.push([r,c])}return C(a,c)||C(a,p)||C(a,d)||C(a,y)||C(a,x)||C(a,_(c))?new Oe(a,r,n,i,o):t.error(`Type ${b(a)} is not interpolatable.`)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const i=t.length;if(n>=t[i-1])return r[i-1].evaluate(e);const s=Te(t,n),o=t[s],a=t[s+1],l=Oe.interpolationFactor(this.interpolation,n,o,a),c=r[s].evaluate(e),u=r[s+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return Y(c,u,l);case"color":return K.interpolate(c,u,l);case"padding":return ee.interpolate(c,u,l);case"variableAnchorOffsetCollection":return ne.interpolate(c,u,l);case"array":return X(c,u,l);case"projectionDefinition":return se.interpolate(c,u,l)}case"interpolate-hcl":return K.interpolate(c,u,l,"hcl");case"interpolate-lab":return K.interpolate(c,u,l,"lab")}}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function Ne(e,t,r,n){const i=n-r,s=e-r;return 0===i?0:1===t?s/i:(Math.pow(t,s)-1)/(Math.pow(t,i)-1)}const Ue={color:K.interpolate,number:Y,padding:ee.interpolate,variableAnchorOffsetCollection:ne.interpolate,array:X};class Fe{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r=null;const n=t.expectedType;n&&"value"!==n.kind&&(r=n);const i=[];for(const n of e.slice(1)){const e=t.parse(n,1+i.length,r,void 0,{typeAnnotation:"omit"});if(!e)return null;r=r||e.type,i.push(e)}if(!r)throw new Error("No output type");const s=n&&i.some((e=>E(n,e.type)));return new Fe(s?m:r,i)}evaluate(e){let t,r=null,n=0;for(const i of this.args)if(n++,r=i.evaluate(e),r&&r instanceof ie&&!r.available&&(t||(t=r.name),r=null,n===this.args.length&&(r=t)),null!==r)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}function ke(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function ze(e,t,r,n){return 0===n.compare(t,r)}function Ge(e,t,r){const n="=="!==e&&"!="!==e;return class i{constructor(e,t,r){this.type=h,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}static parse(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");const r=e[0];let s=t.parse(e[1],1,m);if(!s)return null;if(!ke(r,s.type))return t.concat(1).error(`"${r}" comparisons are not supported for type '${b(s.type)}'.`);let o=t.parse(e[2],2,m);if(!o)return null;if(!ke(r,o.type))return t.concat(2).error(`"${r}" comparisons are not supported for type '${b(o.type)}'.`);if(s.type.kind!==o.type.kind&&"value"!==s.type.kind&&"value"!==o.type.kind)return t.error(`Cannot compare types '${b(s.type)}' and '${b(o.type)}'.`);n&&("value"===s.type.kind&&"value"!==o.type.kind?s=new de(o.type,[s]):"value"!==s.type.kind&&"value"===o.type.kind&&(o=new de(s.type,[o])));let a=null;if(4===e.length){if("string"!==s.type.kind&&"string"!==o.type.kind&&"value"!==s.type.kind&&"value"!==o.type.kind)return t.error("Cannot use collator to compare non-string types.");if(a=t.parse(e[3],3,g),!a)return null}return new i(s,o,a)}evaluate(i){const s=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){const t=le(s),r=le(o);if(t.kind!==r.kind||"string"!==t.kind&&"number"!==t.kind)throw new te(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${r.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const e=le(s),r=le(o);if("string"!==e.kind||"string"!==r.kind)return t(i,s,o)}return this.collator?r(i,s,o,this.collator.evaluate(i)):t(i,s,o)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}}}const Qe=Ge("==",(function(e,t,r){return t===r}),ze),Ve=Ge("!=",(function(e,t,r){return t!==r}),(function(e,t,r,n){return!ze(0,t,r,n)})),He=Ge("<",(function(e,t,r){return t",(function(e,t,r){return t>r}),(function(e,t,r,n){return n.compare(t,r)>0})),qe=Ge("<=",(function(e,t,r){return t<=r}),(function(e,t,r,n){return n.compare(t,r)<=0})),We=Ge(">=",(function(e,t,r){return t>=r}),(function(e,t,r,n){return n.compare(t,r)>=0}));class Ye{constructor(e,t,r){this.type=g,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(2!==e.length)return t.error("Expected one argument.");const r=e[1];if("object"!=typeof r||Array.isArray(r))return t.error("Collator options argument must be an object.");const n=t.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,h);if(!n)return null;const i=t.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,h);if(!i)return null;let s=null;return r.locale&&(s=t.parse(r.locale,1,u),!s)?null:new Ye(n,i,s)}evaluate(e){return new $(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}class Xe{constructor(e,t,r,n,i){this.type=u,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i}static parse(e,t){if(3!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,c);if(!r)return null;const n=e[2];if("object"!=typeof n||Array.isArray(n))return t.error("NumberFormat options argument must be an object.");let i=null;if(n.locale&&(i=t.parse(n.locale,1,u),!i))return null;let s=null;if(n.currency&&(s=t.parse(n.currency,1,u),!s))return null;let o=null;if(n["min-fraction-digits"]&&(o=t.parse(n["min-fraction-digits"],1,c),!o))return null;let a=null;return n["max-fraction-digits"]&&(a=t.parse(n["max-fraction-digits"],1,c),!a)?null:new Xe(r,i,s,o,a)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class Ke{constructor(e){this.type=A,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[1];if(!Array.isArray(r)&&"object"==typeof r)return t.error("First argument must be an image or text section.");const n=[];let i=!1;for(let r=1;r<=e.length-1;++r){const s=e[r];if(i&&"object"==typeof s&&!Array.isArray(s)){i=!1;let e=null;if(s["font-scale"]&&(e=t.parse(s["font-scale"],1,c),!e))return null;let r=null;if(s["text-font"]&&(r=t.parse(s["text-font"],1,_(u)),!r))return null;let o=null;if(s["text-color"]&&(o=t.parse(s["text-color"],1,d),!o))return null;const a=n[n.length-1];a.scale=e,a.font=r,a.textColor=o}else{const s=t.parse(e[r],1,m);if(!s)return null;const o=s.type.kind;if("string"!==o&&"value"!==o&&"null"!==o&&"resolvedImage"!==o)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:s,scale:null,font:null,textColor:null})}}return new Ke(n)}evaluate(e){return new Z(this.sections.map((t=>{const r=t.content.evaluate(e);return le(r)===v?new J("",r,null,null,null):new J(ce(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)})))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor)}outputDefined(){return!1}}class $e{constructor(e){this.type=v,this.input=e}static parse(e,t){if(2!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,u);return r?new $e(r):t.error("No image name provided.")}evaluate(e){const t=this.input.evaluate(e),r=ie.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r}eachChild(e){e(this.input)}outputDefined(){return!1}}class Je{constructor(e){this.type=c,this.input=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const r=t.parse(e[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?t.error(`Expected argument of type string or array, but found ${b(r.type)} instead.`):new Je(r):null}evaluate(e){const t=this.input.evaluate(e);if("string"==typeof t)return[...t].length;if(Array.isArray(t))return t.length;throw new te(`Expected value to be of type string or array, but found ${b(le(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const Ze=8192;function et(e,t){const r=(180+e[0])/360,n=(i=e[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360);var i;const s=Math.pow(2,t.z);return[Math.round(r*s*Ze),Math.round(n*s*Ze)]}function tt(e,t){const r=Math.pow(2,t.z);return[(i=(e[0]/Ze+t.x)/r,360*i-180),(n=(e[1]/Ze+t.y)/r,360/Math.PI*Math.atan(Math.exp((180-360*n)*Math.PI/180))-90)];var n,i}function rt(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function nt(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function it(e,t,r){const n=e[0]-t[0],i=e[1]-t[1],s=e[0]-r[0],o=e[1]-r[1];return n*o-s*i==0&&n*s<=0&&i*o<=0}function st(e,t,r,n){const i=[t[0]-e[0],t[1]-e[1]];return 0!=(s=[n[0]-r[0],n[1]-r[1]])[0]*(o=i)[1]-s[1]*o[0]&&!(!ht(e,t,r,n)||!ht(r,n,e,t));var s,o}function ot(e,t,r){for(const n of r)for(let r=0;ri[1]!=o[1]>i[1]&&i[0]<(o[0]-s[0])*(i[1]-s[1])/(o[1]-s[1])+s[0]&&(n=!n)}var i,s,o;return n}function lt(e,t){for(const r of t)if(at(e,r))return!0;return!1}function ct(e,t){for(const r of e)if(!at(r,t))return!1;for(let r=0;r0&&h<0||u<0&&h>0}function dt(e,t,r){const n=[];for(let i=0;ir[2]){const t=.5*n;let i=e[0]-r[0]>t?-n:r[0]-e[0]>t?n:0;0===i&&(i=e[0]-r[2]>t?-n:r[2]-e[0]>t?n:0),e[0]+=i}rt(t,e)}function mt(e,t,r,n){const i=Math.pow(2,n.z)*Ze,s=[n.x*Ze,n.y*Ze],o=[];for(const n of e)for(const e of n){const n=[e.x+s[0],e.y+s[1]];ft(n,t,r,i),o.push(n)}return o}function gt(e,t,r,n){const i=Math.pow(2,n.z)*Ze,s=[n.x*Ze,n.y*Ze],o=[];for(const r of e){const e=[];for(const n of r){const r=[n.x+s[0],n.y+s[1]];rt(t,r),e.push(r)}o.push(e)}if(t[2]-t[0]<=i/2){(a=t)[0]=a[1]=1/0,a[2]=a[3]=-1/0;for(const e of o)for(const n of e)ft(n,t,r,i)}var a;return o}class At{constructor(e,t){this.type=h,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(ae(e[1])){const t=e[1];if("FeatureCollection"===t.type){const e=[];for(const r of t.features){const{type:t,coordinates:n}=r.geometry;"Polygon"===t&&e.push(n),"MultiPolygon"===t&&e.push(...n)}if(e.length)return new At(t,{type:"MultiPolygon",coordinates:e})}else if("Feature"===t.type){const e=t.geometry.type;if("Polygon"===e||"MultiPolygon"===e)return new At(t,t.geometry)}else if("Polygon"===t.type||"MultiPolygon"===t.type)return new At(t,t)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryDollarType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if("Polygon"===t.type){const s=dt(t.coordinates,n,i),o=mt(e.geometry(),r,n,i);if(!nt(r,n))return!1;for(const e of o)if(!at(e,s))return!1}if("MultiPolygon"===t.type){const s=pt(t.coordinates,n,i),o=mt(e.geometry(),r,n,i);if(!nt(r,n))return!1;for(const e of o)if(!lt(e,s))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryDollarType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if("Polygon"===t.type){const s=dt(t.coordinates,n,i),o=gt(e.geometry(),r,n,i);if(!nt(r,n))return!1;for(const e of o)if(!ct(e,s))return!1}if("MultiPolygon"===t.type){const s=pt(t.coordinates,n,i),o=gt(e.geometry(),r,n,i);if(!nt(r,n))return!1;for(const e of o)if(!ut(e,s))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class yt{constructor(e=[],t=(e,t)=>et?1:0){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(0===this.length)return;const e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:r}=this,n=t[e];for(;e>0;){const i=e-1>>1,s=t[i];if(r(n,s)>=0)break;t[e]=s,e=i}t[e]=n}_down(e){const{data:t,compare:r}=this,n=this.length>>1,i=t[e];for(;e=0)break;t[e]=t[n],e=n}t[e]=i}}const vt=1/298.257223563,xt=vt*(2-vt),_t=Math.PI/180;class bt{constructor(e){const t=6378.137*_t*1e3,r=Math.cos(e*_t),n=1/(1-xt*(1-r*r)),i=Math.sqrt(n);this.kx=t*i*r,this.ky=t*i*n*(1-xt)}distance(e,t){const r=this.wrap(e[0]-t[0])*this.kx,n=(e[1]-t[1])*this.ky;return Math.sqrt(r*r+n*n)}pointOnLine(e,t){let r,n,i,s,o=1/0;for(let a=0;a1?(l=e[a+1][0],c=e[a+1][1]):d>0&&(l+=u/this.kx*d,c+=h/this.ky*d)),u=this.wrap(t[0]-l)*this.kx,h=(t[1]-c)*this.ky;const p=u*u+h*h;p180;)e-=360;return e}}function wt(e,t){return t[0]-e[0]}function Et(e){return e[1]-e[0]+1}function Mt(e,t){return e[1]>=e[0]&&e[1]e[1])return[null,null];const r=Et(e);if(t){if(2===r)return[e,null];const t=Math.floor(r/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}if(1===r)return[e,null];const n=Math.floor(r/2)-1;return[[e[0],e[0]+n],[e[0]+n+1,e[1]]]}function Ct(e,t){if(!Mt(t,e.length))return[1/0,1/0,-1/0,-1/0];const r=[1/0,1/0,-1/0,-1/0];for(let n=t[0];n<=t[1];++n)rt(r,e[n]);return r}function Tt(e){const t=[1/0,1/0,-1/0,-1/0];for(const r of e)for(const e of r)rt(t,e);return t}function It(e){return e[0]!==-1/0&&e[1]!==-1/0&&e[2]!==1/0&&e[3]!==1/0}function Rt(e,t,r){if(!It(e)||!It(t))return NaN;let n=0,i=0;return e[2]t[2]&&(n=e[0]-t[2]),e[1]>t[3]&&(i=e[1]-t[3]),e[3]=n)return n;if(nt(i,s)){if(Ut(e,t))return 0}else if(Ut(t,e))return 0;let o=1/0;for(const n of e)for(let e=0,i=n.length,s=i-1;e0;){const i=o.pop();if(i[0]>=s)continue;const l=i[1],c=t?50:100;if(Et(l)<=c){if(!Mt(l,e.length))return NaN;if(t){const t=Nt(e,l,r,n);if(isNaN(t)||0===t)return t;s=Math.min(s,t)}else for(let t=l[0];t<=l[1];++t){const i=Ot(e[t],r,n);if(s=Math.min(s,i),0===s)return 0}}else{const r=St(l,t);kt(o,s,n,e,a,r[0]),kt(o,s,n,e,a,r[1])}}return s}function Qt(e,t,r,n,i,s=1/0){let o=Math.min(s,i.distance(e[0],r[0]));if(0===o)return o;const a=new yt([[0,[0,e.length-1],[0,r.length-1]]],wt);for(;a.length>0;){const s=a.pop();if(s[0]>=o)continue;const l=s[1],c=s[2],u=t?50:100,h=n?50:100;if(Et(l)<=u&&Et(c)<=h){if(!Mt(l,e.length)&&Mt(c,r.length))return NaN;let s;if(t&&n)s=Lt(e,l,r,c,i),o=Math.min(o,s);else if(t&&!n){const t=e.slice(l[0],l[1]+1);for(let e=c[0];e<=c[1];++e)if(s=Bt(r[e],t,i),o=Math.min(o,s),0===o)return o}else if(!t&&n){const t=r.slice(c[0],c[1]+1);for(let r=l[0];r<=l[1];++r)if(s=Bt(e[r],t,i),o=Math.min(o,s),0===o)return o}else s=Dt(e,l,r,c,i),o=Math.min(o,s)}else{const s=St(l,t),u=St(c,n);zt(a,o,i,e,r,s[0],u[0]),zt(a,o,i,e,r,s[0],u[1]),zt(a,o,i,e,r,s[1],u[0]),zt(a,o,i,e,r,s[1],u[1])}}return o}function Vt(e){return"MultiPolygon"===e.type?e.coordinates.map((e=>({type:"Polygon",coordinates:e}))):"MultiLineString"===e.type?e.coordinates.map((e=>({type:"LineString",coordinates:e}))):"MultiPoint"===e.type?e.coordinates.map((e=>({type:"Point",coordinates:e}))):[e]}class Ht{constructor(e,t){this.type=c,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(ae(e[1])){const t=e[1];if("FeatureCollection"===t.type)return new Ht(t,t.features.map((e=>Vt(e.geometry))).flat());if("Feature"===t.type)return new Ht(t,Vt(t.geometry));if("type"in t&&"coordinates"in t)return new Ht(t,Vt(t))}return t.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){const r=e.geometry(),n=r.flat().map((t=>tt([t.x,t.y],e.canonical)));if(0===r.length)return NaN;const i=new bt(n[0][1]);let s=1/0;for(const e of t){switch(e.type){case"Point":s=Math.min(s,Qt(n,!1,[e.coordinates],!1,i,s));break;case"LineString":s=Math.min(s,Qt(n,!1,e.coordinates,!0,i,s));break;case"Polygon":s=Math.min(s,Gt(n,!1,e.coordinates,i,s))}if(0===s)return s}return s}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){const r=e.geometry(),n=r.flat().map((t=>tt([t.x,t.y],e.canonical)));if(0===r.length)return NaN;const i=new bt(n[0][1]);let s=1/0;for(const e of t){switch(e.type){case"Point":s=Math.min(s,Qt(n,!0,[e.coordinates],!1,i,s));break;case"LineString":s=Math.min(s,Qt(n,!0,e.coordinates,!0,i,s));break;case"Polygon":s=Math.min(s,Gt(n,!0,e.coordinates,i,s))}if(0===s)return s}return s}(e,this.geometries);if("Polygon"===e.geometryType())return function(e,t){const r=e.geometry();if(0===r.length||0===r[0].length)return NaN;const n=function(e){if(e.length<=1)return[e];const t=[];let r,n;for(const i of e){const e=me(i);0!==e&&(i.area=Math.abs(e),void 0===n&&(n=e<0),n===e<0?(r&&t.push(r),r=[i]):r.push(i))}return r&&t.push(r),t}(r).map((t=>t.map((t=>t.map((t=>tt([t.x,t.y],e.canonical))))))),i=new bt(n[0][0][0][1]);let s=1/0;for(const e of t)for(const t of n){switch(e.type){case"Point":s=Math.min(s,Gt([e.coordinates],!1,t,i,s));break;case"LineString":s=Math.min(s,Gt(e.coordinates,!0,t,i,s));break;case"Polygon":s=Math.min(s,Ft(t,e.coordinates,i,s))}if(0===s)return s}return s}(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const jt={"==":Qe,"!=":Ve,">":je,"<":He,">=":We,"<=":qe,array:de,at:be,boolean:de,case:Se,coalesce:Fe,collator:Ye,format:Ke,image:$e,in:we,"index-of":Ee,interpolate:Oe,"interpolate-hcl":Oe,"interpolate-lab":Oe,length:Je,let:xe,literal:ue,match:Me,number:de,"number-format":Xe,object:de,slice:Ce,step:Ie,string:de,"to-boolean":fe,"to-color":fe,"to-number":fe,"to-string":fe,var:_e,within:At,distance:Ht};class qt{constructor(e,t,r,n){this.name=e,this.type=t,this._evaluate=r,this.args=n}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,t){const r=e[0],n=qt.definitions[r];if(!n)return t.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);const i=Array.isArray(n)?n[0]:n.type,s=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,o=s.filter((([t])=>!Array.isArray(t)||t.length===e.length-1));let a=null;for(const[n,s]of o){a=new ve(t.registry,$t,t.path,null,t.scope);const o=[];let l=!1;for(let t=1;t{return t=e,Array.isArray(t)?`(${t.map(b).join(", ")})`:`(${b(t.type)}...)`;var t})).join(" | "),n=[];for(let r=1;r{r=t?r&&$t(e):r&&e instanceof ue})),!!r&&Jt(e)&&er(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Jt(e){if(e instanceof qt){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof At)return!1;if(e instanceof Ht)return!1;let t=!0;return e.eachChild((e=>{t&&!Jt(e)&&(t=!1)})),t}function Zt(e){if(e instanceof qt&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild((e=>{t&&!Zt(e)&&(t=!1)})),t}function er(e,t){if(e instanceof qt&&t.indexOf(e.name)>=0)return!1;let r=!0;return e.eachChild((e=>{r&&!er(e,t)&&(r=!1)})),r}function tr(e){return{result:"success",value:e}}function rr(e){return{result:"error",value:e}}function nr(e){return"data-driven"===e["property-type"]||"cross-faded-data-driven"===e["property-type"]}function ir(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function sr(e){return!!e.expression&&e.expression.interpolated}function or(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}function ar(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function lr(e){return e}function cr(e,t){const r="color"===t.type,n=e.stops&&"object"==typeof e.stops[0][0],i=n||void 0!==e.property,o=n||!i,a=e.type||(sr(t)?"exponential":"interval");if(r||"padding"===t.type){const n=r?K.parse:ee.parse;(e=s({},e)).stops&&(e.stops=e.stops.map((e=>[e[0],n(e[1])]))),e.default?e.default=n(e.default):e.default=n(t.default)}if(e.colorSpace&&"rgb"!==(l=e.colorSpace)&&"hcl"!==l&&"lab"!==l)throw new Error(`Unknown color space: "${e.colorSpace}"`);var l;let c,u,h;if("exponential"===a)c=pr;else if("interval"===a)c=dr;else if("categorical"===a){c=hr,u=Object.create(null);for(const t of e.stops)u[t[0]]=t[1];h=typeof e.stops[0][0]}else{if("identity"!==a)throw new Error(`Unknown function type "${a}"`);c=fr}if(n){const r={},n=[];for(let t=0;te[0])),evaluate:({zoom:r},n)=>pr({stops:i,base:e.base},t,r).evaluate(r,n)}}if(o){const r="exponential"===a?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:r,interpolationFactor:Oe.interpolationFactor.bind(void 0,r),zoomStops:e.stops.map((e=>e[0])),evaluate:({zoom:r})=>c(e,t,r,u,h)}}return{kind:"source",evaluate(r,n){const i=n&&n.properties?n.properties[e.property]:void 0;return void 0===i?ur(e.default,t.default):c(e,t,i,u,h)}}}function ur(e,t,r){return void 0!==e?e:void 0!==t?t:void 0!==r?r:void 0}function hr(e,t,r,n,i){return ur(typeof r===i?n[r]:void 0,e.default,t.default)}function dr(e,t,r){if("number"!==or(r))return ur(e.default,t.default);const n=e.stops.length;if(1===n)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[n-1][0])return e.stops[n-1][1];const i=Te(e.stops.map((e=>e[0])),r);return e.stops[i][1]}function pr(e,t,r){const n=void 0!==e.base?e.base:1;if("number"!==or(r))return ur(e.default,t.default);const i=e.stops.length;if(1===i)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[i-1][0])return e.stops[i-1][1];const s=Te(e.stops.map((e=>e[0])),r),o=function(e,t,r,n){const i=n-r,s=e-r;return 0===i?0:1===t?s/i:(Math.pow(t,s)-1)/(Math.pow(t,i)-1)}(r,n,e.stops[s][0],e.stops[s+1][0]),a=e.stops[s][1],l=e.stops[s+1][1],c=Ue[t.type]||lr;return"function"==typeof a.evaluate?{evaluate(...t){const r=a.evaluate.apply(void 0,t),n=l.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return c(r,n,o,e.colorSpace)}}:c(a,l,o,e.colorSpace)}function fr(e,t,r){switch(t.type){case"color":r=K.parse(r);break;case"formatted":r=Z.fromString(r.toString());break;case"resolvedImage":r=ie.fromString(r.toString());break;case"padding":r=ee.parse(r);break;default:or(r)===t.type||"enum"===t.type&&t.values[r]||(r=void 0)}return ur(r,e.default,t.default)}qt.register(jt,{error:[{kind:"error"},[u],(e,[t])=>{throw new te(t.evaluate(e))}],typeof:[u,[m],(e,[t])=>b(le(t.evaluate(e)))],"to-rgba":[_(c,4),[d],(e,[t])=>{const[r,n,i,s]=t.evaluate(e).rgb;return[255*r,255*n,255*i,s]}],rgb:[d,[c,c,c],Wt],rgba:[d,[c,c,c,c],Wt],has:{type:h,overloads:[[[u],(e,[t])=>Yt(t.evaluate(e),e.properties())],[[u,f],(e,[t,r])=>Yt(t.evaluate(e),r.evaluate(e))]]},get:{type:m,overloads:[[[u],(e,[t])=>Xt(t.evaluate(e),e.properties())],[[u,f],(e,[t,r])=>Xt(t.evaluate(e),r.evaluate(e))]]},"feature-state":[m,[u],(e,[t])=>Xt(t.evaluate(e),e.featureState||{})],properties:[f,[],e=>e.properties()],"geometry-type":[u,[],e=>e.geometryType()],id:[m,[],e=>e.id()],zoom:[c,[],e=>e.globals.zoom],"heatmap-density":[c,[],e=>e.globals.heatmapDensity||0],"line-progress":[c,[],e=>e.globals.lineProgress||0],accumulated:[m,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[c,Kt(c),(e,t)=>{let r=0;for(const n of t)r+=n.evaluate(e);return r}],"*":[c,Kt(c),(e,t)=>{let r=1;for(const n of t)r*=n.evaluate(e);return r}],"-":{type:c,overloads:[[[c,c],(e,[t,r])=>t.evaluate(e)-r.evaluate(e)],[[c],(e,[t])=>-t.evaluate(e)]]},"/":[c,[c,c],(e,[t,r])=>t.evaluate(e)/r.evaluate(e)],"%":[c,[c,c],(e,[t,r])=>t.evaluate(e)%r.evaluate(e)],ln2:[c,[],()=>Math.LN2],pi:[c,[],()=>Math.PI],e:[c,[],()=>Math.E],"^":[c,[c,c],(e,[t,r])=>Math.pow(t.evaluate(e),r.evaluate(e))],sqrt:[c,[c],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[c,[c],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[c,[c],(e,[t])=>Math.log(t.evaluate(e))],log2:[c,[c],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[c,[c],(e,[t])=>Math.sin(t.evaluate(e))],cos:[c,[c],(e,[t])=>Math.cos(t.evaluate(e))],tan:[c,[c],(e,[t])=>Math.tan(t.evaluate(e))],asin:[c,[c],(e,[t])=>Math.asin(t.evaluate(e))],acos:[c,[c],(e,[t])=>Math.acos(t.evaluate(e))],atan:[c,[c],(e,[t])=>Math.atan(t.evaluate(e))],min:[c,Kt(c),(e,t)=>Math.min(...t.map((t=>t.evaluate(e))))],max:[c,Kt(c),(e,t)=>Math.max(...t.map((t=>t.evaluate(e))))],abs:[c,[c],(e,[t])=>Math.abs(t.evaluate(e))],round:[c,[c],(e,[t])=>{const r=t.evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[c,[c],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[c,[c],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[h,[u,m],(e,[t,r])=>e.properties()[t.value]===r.value],"filter-id-==":[h,[m],(e,[t])=>e.id()===t.value],"filter-type-==":[h,[u],(e,[t])=>e.geometryDollarType()===t.value],"filter-<":[h,[u,m],(e,[t,r])=>{const n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n{const r=e.id(),n=t.value;return typeof r==typeof n&&r":[h,[u,m],(e,[t,r])=>{const n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n>i}],"filter-id->":[h,[m],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r>n}],"filter-<=":[h,[u,m],(e,[t,r])=>{const n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n<=i}],"filter-id-<=":[h,[m],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r<=n}],"filter->=":[h,[u,m],(e,[t,r])=>{const n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n>=i}],"filter-id->=":[h,[m],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r>=n}],"filter-has":[h,[m],(e,[t])=>t.value in e.properties()],"filter-has-id":[h,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[h,[_(u)],(e,[t])=>t.value.indexOf(e.geometryDollarType())>=0],"filter-id-in":[h,[_(m)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[h,[u,_(m)],(e,[t,r])=>r.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[h,[u,_(m)],(e,[t,r])=>function(e,t,r,n){for(;r<=n;){const i=r+n>>1;if(t[i]===e)return!0;t[i]>e?n=i-1:r=i+1}return!1}(e.properties()[t.value],r.value,0,r.value.length-1)],all:{type:h,overloads:[[[h,h],(e,[t,r])=>t.evaluate(e)&&r.evaluate(e)],[Kt(h),(e,t)=>{for(const r of t)if(!r.evaluate(e))return!1;return!0}]]},any:{type:h,overloads:[[[h,h],(e,[t,r])=>t.evaluate(e)||r.evaluate(e)],[Kt(h),(e,t)=>{for(const r of t)if(r.evaluate(e))return!0;return!1}]]},"!":[h,[h],(e,[t])=>!t.evaluate(e)],"is-supported-script":[h,[u],(e,[t])=>{const r=e.globals&&e.globals.isSupportedScript;return!r||r(t.evaluate(e))}],upcase:[u,[u],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[u,[u],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[u,Kt(m),(e,t)=>t.map((t=>ce(t.evaluate(e)))).join("")],"resolved-locale":[u,[g],(e,[t])=>t.evaluate(e).resolvedLocale()]});class mr{constructor(e,t){var r;this.expression=e,this._warningHistory={},this._evaluator=new ye,this._defaultValue=t?"color"===(r=t).type&&ar(r.default)?new K(0,0,0,0):"color"===r.type?K.parse(r.default)||null:"padding"===r.type?ee.parse(r.default)||null:"variableAnchorOffsetCollection"===r.type?ne.parse(r.default)||null:"projectionDefinition"===r.type?se.parse(r.default)||null:void 0===r.default?null:r.default:null,this._enumValues=t&&"enum"===t.type?t.values:null}evaluateWithoutErrorHandling(e,t,r,n,i,s){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=s,this.expression.evaluate(this._evaluator)}evaluate(e,t,r,n,i,s){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=s||null;try{const e=this.expression.evaluate(this._evaluator);if(null==e||"number"==typeof e&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new te(`Expected value to be one of ${Object.keys(this._enumValues).map((e=>JSON.stringify(e))).join(", ")}, but found ${JSON.stringify(e)} instead.`);return e}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,"undefined"!=typeof console&&console.warn(e.message)),this._defaultValue}}}function gr(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in jt}function Ar(e,t){const r=new ve(jt,$t,[],t?function(e){const t={color:d,string:u,number:c,enum:u,boolean:h,formatted:A,padding:y,projectionDefinition:p,resolvedImage:v,variableAnchorOffsetCollection:x};return"array"===e.type?_(t[e.value]||m,e.length):t[e.type]}(t):void 0),n=r.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return n?tr(new mr(n,t)):rr(r.errors)}class yr{constructor(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!Zt(t.expression)}evaluateWithoutErrorHandling(e,t,r,n,i,s){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,s)}evaluate(e,t,r,n,i,s){return this._styleExpression.evaluate(e,t,r,n,i,s)}}class vr{constructor(e,t,r,n){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!Zt(t.expression),this.interpolationType=n}evaluateWithoutErrorHandling(e,t,r,n,i,s){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,s)}evaluate(e,t,r,n,i,s){return this._styleExpression.evaluate(e,t,r,n,i,s)}interpolationFactor(e,t,r){return this.interpolationType?Oe.interpolationFactor(this.interpolationType,e,t,r):0}}function xr(e,t){const r=Ar(e,t);if("error"===r.result)return r;const n=r.value.expression,i=Jt(n);if(!i&&!nr(t))return rr([new o("","data expressions not supported")]);const s=er(n,["zoom"]);if(!s&&!ir(t))return rr([new o("","zoom expressions not supported")]);const a=br(n);if(!a&&!s)return rr([new o("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof o)return rr([a]);if(a instanceof Oe&&!sr(t))return rr([new o("",'"interpolate" expressions cannot be used with this property')]);if(!a)return tr(new yr(i?"constant":"source",r.value));const l=a instanceof Oe?a.interpolation:void 0;return tr(new vr(i?"camera":"composite",r.value,a.labels,l))}class _r{constructor(e,t){this._parameters=e,this._specification=t,s(this,cr(this._parameters,this._specification))}static deserialize(e){return new _r(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function br(e){let t=null;if(e instanceof xe)t=br(e.result);else if(e instanceof Fe){for(const r of e.args)if(t=br(r),t)break}else(e instanceof Ie||e instanceof Oe)&&e.input instanceof qt&&"zoom"===e.input.name&&(t=e);return t instanceof o||e.eachChild((e=>{const r=br(e);r instanceof o?t=r:!t&&r?t=new o("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&r&&t!==r&&(t=new o("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),t}function wr(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(const t of e.slice(1))if(!wr(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}}const Er={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Mr(e){if(null==e)return{filter:()=>!0,needGeometry:!1};wr(e)||(e=Tr(e));const t=Ar(e,Er);if("error"===t.result)throw new Error(t.value.map((e=>`${e.key}: ${e.message}`)).join(", "));return{filter:(e,r,n)=>t.value.evaluate(e,r,{},n),needGeometry:Cr(e)}}function Sr(e,t){return et?1:0}function Cr(e){if(!Array.isArray(e))return!1;if("within"===e[0]||"distance"===e[0])return!0;for(let t=1;t"===t||"<="===t||">="===t?Ir(e[1],e[2],t):"any"===t?(r=e.slice(1),["any"].concat(r.map(Tr))):"all"===t?["all"].concat(e.slice(1).map(Tr)):"none"===t?["all"].concat(e.slice(1).map(Tr).map(Pr)):"in"===t?Rr(e[1],e.slice(2)):"!in"===t?Pr(Rr(e[1],e.slice(2))):"has"===t?Br(e[1]):"!has"!==t||Pr(Br(e[1]));var r}function Ir(e,t,r){switch(e){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,e,t]}}function Rr(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((e=>typeof e!=typeof t[0]))?["filter-in-large",e,["literal",t.sort(Sr)]]:["filter-in-small",e,["literal",t]]}}function Br(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function Pr(e){return["!",e]}function Lr(e){const t=e.key,r=e.value;return r?[new i(t,r,"constants have been deprecated as of v8")]:[]}function Dr(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function Or(e){if(Array.isArray(e))return e.map(Or);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){const t={};for(const r in e)t[r]=Or(e[r]);return t}return Dr(e)}function Nr(e){const t=e.key,r=e.value,n=e.valueSpec||{},s=e.objectElementValidators||{},o=e.style,a=e.styleSpec,l=e.validateSpec;let c=[];const u=or(r);if("object"!==u)return[new i(t,r,`object expected, ${u} found`)];for(const e in r){const u=e.split(".")[0],h=n[u]||n["*"];let d;if(s[u])d=s[u];else if(n[u])d=l;else if(s["*"])d=s["*"];else{if(!n["*"]){c.push(new i(t,r[e],`unknown property "${e}"`));continue}d=l}c=c.concat(d({key:(t?`${t}.`:t)+e,value:r[e],valueSpec:h,style:o,styleSpec:a,object:r,objectKey:e,validateSpec:l},r))}for(const e in n)s[e]||n[e].required&&void 0===n[e].default&&void 0===r[e]&&c.push(new i(t,r,`missing required property "${e}"`));return c}function Ur(e){const t=e.value,r=e.valueSpec,n=e.validateSpec,s=e.style,o=e.styleSpec,a=e.key,l=e.arrayElementValidator||n;if("array"!==or(t))return[new i(a,t,`array expected, ${or(t)} found`)];if(r.length&&t.length!==r.length)return[new i(a,t,`array length ${r.length} expected, length ${t.length} found`)];if(r["min-length"]&&t.lengthn.maximum?[new i(t,r,`${r} is greater than the maximum value ${n.maximum}`)]:[]}function kr(e){const t=e.valueSpec,r=Dr(e.value.type);let n,s,o,a={};const l="categorical"!==r&&void 0===e.value.property,c=!l,u="array"===or(e.value.stops)&&"array"===or(e.value.stops[0])&&"object"===or(e.value.stops[0][0]),h=Nr({key:e.key,value:e.value,valueSpec:e.styleSpec.function,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(e){if("identity"===r)return[new i(e.key,e.value,'identity function may not have a "stops" property')];let t=[];const n=e.value;return t=t.concat(Ur({key:e.key,value:n,valueSpec:e.valueSpec,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:d})),"array"===or(n)&&0===n.length&&t.push(new i(e.key,n,"array must have at least one stop")),t},default:function(e){return e.validateSpec({key:e.key,value:e.value,valueSpec:t,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===r&&l&&h.push(new i(e.key,e.value,'missing required property "property"')),"identity"===r||e.value.stops||h.push(new i(e.key,e.value,'missing required property "stops"')),"exponential"===r&&e.valueSpec.expression&&!sr(e.valueSpec)&&h.push(new i(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(c&&!nr(e.valueSpec)?h.push(new i(e.key,e.value,"property functions not supported")):l&&!ir(e.valueSpec)&&h.push(new i(e.key,e.value,"zoom functions not supported"))),"categorical"!==r&&!u||void 0!==e.value.property||h.push(new i(e.key,e.value,'"property" property is required')),h;function d(e){let r=[];const n=e.value,l=e.key;if("array"!==or(n))return[new i(l,n,`array expected, ${or(n)} found`)];if(2!==n.length)return[new i(l,n,`array length 2 expected, length ${n.length} found`)];if(u){if("object"!==or(n[0]))return[new i(l,n,`object expected, ${or(n[0])} found`)];if(void 0===n[0].zoom)return[new i(l,n,"object stop key must have zoom")];if(void 0===n[0].value)return[new i(l,n,"object stop key must have value")];if(o&&o>Dr(n[0].zoom))return[new i(l,n[0].zoom,"stop zoom values must appear in ascending order")];Dr(n[0].zoom)!==o&&(o=Dr(n[0].zoom),s=void 0,a={}),r=r.concat(Nr({key:`${l}[0]`,value:n[0],valueSpec:{zoom:{}},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:Fr,value:p}}))}else r=r.concat(p({key:`${l}[0]`,value:n[0],valueSpec:{},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec},n));return gr(Or(n[1]))?r.concat([new i(`${l}[1]`,n[1],"expressions are not allowed in function stops.")]):r.concat(e.validateSpec({key:`${l}[1]`,value:n[1],valueSpec:t,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec}))}function p(e,o){const l=or(e.value),c=Dr(e.value),u=null!==e.value?e.value:o;if(n){if(l!==n)return[new i(e.key,u,`${l} stop domain type must match previous stop domain type ${n}`)]}else n=l;if("number"!==l&&"string"!==l&&"boolean"!==l)return[new i(e.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==l&&"categorical"!==r){let n=`number expected, ${l} found`;return nr(t)&&void 0===r&&(n+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new i(e.key,u,n)]}return"categorical"!==r||"number"!==l||isFinite(c)&&Math.floor(c)===c?"categorical"!==r&&"number"===l&&void 0!==s&&cnew i(`${e.key}${t.key}`,e.value,t.message)));const r=t.value.expression||t.value._styleExpression.expression;if("property"===e.expressionContext&&"text-font"===e.propertyKey&&!r.outputDefined())return[new i(e.key,e.value,`Invalid data expression for "${e.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===e.expressionContext&&"layout"===e.propertyType&&!Zt(r))return[new i(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===e.expressionContext&&!Zt(r))return[new i(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&0===e.expressionContext.indexOf("cluster")){if(!er(r,["zoom","feature-state"]))return[new i(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===e.expressionContext&&!Jt(r))return[new i(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Gr(e){const t=e.key,r=e.value,n=e.valueSpec,s=[];return Array.isArray(n.values)?-1===n.values.indexOf(Dr(r))&&s.push(new i(t,r,`expected one of [${n.values.join(", ")}], ${JSON.stringify(r)} found`)):-1===Object.keys(n.values).indexOf(Dr(r))&&s.push(new i(t,r,`expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(r)} found`)),s}function Qr(e){return wr(Or(e.value))?zr(s({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Vr(e)}function Vr(e){const t=e.value,r=e.key;if("array"!==or(t))return[new i(r,t,`array expected, ${or(t)} found`)];const n=e.styleSpec;let s,o=[];if(t.length<1)return[new i(r,t,"filter array must have at least 1 element")];switch(o=o.concat(Gr({key:`${r}[0]`,value:t[0],valueSpec:n.filter_operator,style:e.style,styleSpec:e.styleSpec})),Dr(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&"$type"===Dr(t[1])&&o.push(new i(r,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":3!==t.length&&o.push(new i(r,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(s=or(t[1]),"string"!==s&&o.push(new i(`${r}[1]`,t[1],`string expected, ${s} found`)));for(let a=2;a{e in r&&t.push(new i(n,r[e],`"${e}" is prohibited for ref layers`))})),o.layers.forEach((t=>{Dr(t.id)===c&&(e=t)})),e?e.ref?t.push(new i(n,r.ref,"ref cannot reference another ref layer")):l=Dr(e.type):t.push(new i(n,r.ref,`ref layer "${c}" not found`))}else if("background"!==l)if(r.source){const e=o.sources&&o.sources[r.source],s=e&&Dr(e.type);e?"vector"===s&&"raster"===l?t.push(new i(n,r.source,`layer "${r.id}" requires a raster source`)):"raster-dem"!==s&&"hillshade"===l?t.push(new i(n,r.source,`layer "${r.id}" requires a raster-dem source`)):"raster"===s&&"raster"!==l?t.push(new i(n,r.source,`layer "${r.id}" requires a vector source`)):"vector"!==s||r["source-layer"]?"raster-dem"===s&&"hillshade"!==l?t.push(new i(n,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==l||!r.paint||!r.paint["line-gradient"]||"geojson"===s&&e.lineMetrics||t.push(new i(n,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new i(n,r,`layer "${r.id}" must specify a "source-layer"`)):t.push(new i(n,r.source,`source "${r.source}" not found`))}else t.push(new i(n,r,'missing required property "source"'));return t=t.concat(Nr({key:n,value:r,valueSpec:a.layer,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":()=>[],type:()=>e.validateSpec({key:`${n}.type`,value:r.type,valueSpec:a.layer.type,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,object:r,objectKey:"type"}),filter:Qr,layout:e=>Nr({layer:r,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":e=>qr(s({layerType:l},e))}}),paint:e=>Nr({layer:r,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":e=>jr(s({layerType:l},e))}})}})),t}function Yr(e){const t=e.value,r=e.key,n=or(t);return"string"!==n?[new i(r,t,`string expected, ${n} found`)]:[]}const Xr={promoteId:function({key:e,value:t}){if("string"===or(t))return Yr({key:e,value:t});{const r=[];for(const n in t)r.push(...Yr({key:`${e}.${n}`,value:t[n]}));return r}}};function Kr(e){const t=e.value,r=e.key,n=e.styleSpec,s=e.style,o=e.validateSpec;if(!t.type)return[new i(r,t,'"type" is required')];const a=Dr(t.type);let l;switch(a){case"vector":case"raster":return l=Nr({key:r,value:t,valueSpec:n[`source_${a.replace("-","_")}`],style:e.style,styleSpec:n,objectElementValidators:Xr,validateSpec:o}),l;case"raster-dem":return l=function(e){var t;const r=null!==(t=e.sourceName)&&void 0!==t?t:"",n=e.value,s=e.styleSpec,o=s.source_raster_dem,a=e.style;let l=[];const c=or(n);if(void 0===n)return l;if("object"!==c)return l.push(new i("source_raster_dem",n,`object expected, ${c} found`)),l;const u="custom"===Dr(n.encoding),h=["redFactor","greenFactor","blueFactor","baseShift"],d=e.value.encoding?`"${e.value.encoding}"`:"Default";for(const t in n)!u&&h.includes(t)?l.push(new i(t,n[t],`In "${r}": "${t}" is only valid when "encoding" is set to "custom". ${d} encoding found`)):o[t]?l=l.concat(e.validateSpec({key:t,value:n[t],valueSpec:o[t],validateSpec:e.validateSpec,style:a,styleSpec:s})):l.push(new i(t,n[t],`unknown property "${t}"`));return l}({sourceName:r,value:t,style:e.style,styleSpec:n,validateSpec:o}),l;case"geojson":if(l=Nr({key:r,value:t,valueSpec:n.source_geojson,style:s,styleSpec:n,validateSpec:o,objectElementValidators:Xr}),t.cluster)for(const e in t.clusterProperties){const[n,i]=t.clusterProperties[e],s="string"==typeof n?[n,["accumulated"],["get",e]]:n;l.push(...zr({key:`${r}.${e}.map`,value:i,validateSpec:o,expressionContext:"cluster-map"})),l.push(...zr({key:`${r}.${e}.reduce`,value:s,validateSpec:o,expressionContext:"cluster-reduce"}))}return l;case"video":return Nr({key:r,value:t,valueSpec:n.source_video,style:s,validateSpec:o,styleSpec:n});case"image":return Nr({key:r,value:t,valueSpec:n.source_image,style:s,validateSpec:o,styleSpec:n});case"canvas":return[new i(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Gr({key:`${r}.type`,value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:s,validateSpec:o,styleSpec:n})}}function $r(e){const t=e.value,r=e.styleSpec,n=r.light,s=e.style;let o=[];const a=or(t);if(void 0===t)return o;if("object"!==a)return o=o.concat([new i("light",t,`object expected, ${a} found`)]),o;for(const a in t){const l=a.match(/^(.*)-transition$/);o=l&&n[l[1]]&&n[l[1]].transition?o.concat(e.validateSpec({key:a,value:t[a],valueSpec:r.transition,validateSpec:e.validateSpec,style:s,styleSpec:r})):n[a]?o.concat(e.validateSpec({key:a,value:t[a],valueSpec:n[a],validateSpec:e.validateSpec,style:s,styleSpec:r})):o.concat([new i(a,t[a],`unknown property "${a}"`)])}return o}function Jr(e){const t=e.value,r=e.styleSpec,n=r.sky,s=e.style,o=or(t);if(void 0===t)return[];if("object"!==o)return[new i("sky",t,`object expected, ${o} found`)];let a=[];for(const o in t)a=n[o]?a.concat(e.validateSpec({key:o,value:t[o],valueSpec:n[o],style:s,styleSpec:r})):a.concat([new i(o,t[o],`unknown property "${o}"`)]);return a}function Zr(e){const t=e.value,r=e.styleSpec,n=r.terrain,s=e.style;let o=[];const a=or(t);if(void 0===t)return o;if("object"!==a)return o=o.concat([new i("terrain",t,`object expected, ${a} found`)]),o;for(const a in t)o=n[a]?o.concat(e.validateSpec({key:a,value:t[a],valueSpec:n[a],validateSpec:e.validateSpec,style:s,styleSpec:r})):o.concat([new i(a,t[a],`unknown property "${a}"`)]);return o}function en(e){let t=[];const r=e.value,n=e.key;if(Array.isArray(r)){const s=[],o=[];for(const a in r){r[a].id&&s.includes(r[a].id)&&t.push(new i(n,r,`all the sprites' ids must be unique, but ${r[a].id} is duplicated`)),s.push(r[a].id),r[a].url&&o.includes(r[a].url)&&t.push(new i(n,r,`all the sprites' URLs must be unique, but ${r[a].url} is duplicated`)),o.push(r[a].url);const l={id:{type:"string",required:!0},url:{type:"string",required:!0}};t=t.concat(Nr({key:`${n}[${a}]`,value:r[a],valueSpec:l,validateSpec:e.validateSpec}))}return t}return Yr({key:n,value:r})}const tn={"*":()=>[],array:Ur,boolean:function(e){const t=e.value,r=e.key,n=or(t);return"boolean"!==n?[new i(r,t,`boolean expected, ${n} found`)]:[]},number:Fr,color:function(e){const t=e.key,r=e.value,n=or(r);return"string"!==n?[new i(t,r,`color expected, ${n} found`)]:K.parse(String(r))?[]:[new i(t,r,`color expected, "${r}" found`)]},constants:Lr,enum:Gr,filter:Qr,function:kr,layer:Wr,object:Nr,source:Kr,light:$r,sky:Jr,terrain:Zr,projection:function(e){const t=e.value,r=e.styleSpec,n=r.projection,s=e.style,o=or(t);if(void 0===t)return[];if("object"!==o)return[new i("projection",t,`object expected, ${o} found`)];let a=[];for(const o in t)a=n[o]?a.concat(e.validateSpec({key:o,value:t[o],valueSpec:n[o],style:s,styleSpec:r})):a.concat([new i(o,t[o],`unknown property "${o}"`)]);return a},projectionDefinition:function(e){const t=e.key;let r=e.value;r=r instanceof String?r.valueOf():r;const n=or(r);return"array"!==n||function(e){return Array.isArray(e)&&3===e.length&&"string"==typeof e[0]&&"string"==typeof e[1]&&"number"==typeof e[2]}(r)||function(e){return!!["interpolate","step","literal"].includes(e[0])}(r)?["array","string"].includes(n)?[]:[new i(t,r,`projection expected, invalid type "${n}" found`)]:[new i(t,r,`projection expected, invalid array ${JSON.stringify(r)} found`)]},string:Yr,formatted:function(e){return 0===Yr(e).length?[]:zr(e)},resolvedImage:function(e){return 0===Yr(e).length?[]:zr(e)},padding:function(e){const t=e.key,r=e.value;if("array"===or(r)){if(r.length<1||r.length>4)return[new i(t,r,`padding requires 1 to 4 values; ${r.length} values found`)];const n={type:"number"};let s=[];for(let i=0;i[]}})),e.constants&&(r=r.concat(Lr({key:"constants",value:e.constants,style:e,styleSpec:t,validateSpec:rn}))),an(r)}function on(e){return function(t){return e({...t,validateSpec:rn})}}function an(e){return[].concat(e).sort(((e,t)=>e.line-t.line))}function ln(e){return function(...t){return an(e.apply(this,t))}}sn.source=ln(on(Kr)),sn.sprite=ln(on(en)),sn.glyphs=ln(on(nn)),sn.light=ln(on($r)),sn.sky=ln(on(Jr)),sn.terrain=ln(on(Zr)),sn.layer=ln(on(Wr)),sn.filter=ln(on(Qr)),sn.paintProperty=ln(on(jr)),sn.layoutProperty=ln(on(qr));const cn={StyleExpression:mr,StylePropertyFunction:_r,ZoomConstantExpression:yr,ZoomDependentExpression:vr,createExpression:Ar,createPropertyExpression:xr,isExpression:gr,isExpressionFilter:wr,isZoomExpression:function(e){return void 0!==e._styleExpression},normalizePropertyExpression:function(e,t){if(ar(e))return new _r(e,t);if(gr(e)){const r=xr(e,t);if("error"===r.result)throw new Error(r.value.map((e=>`${e.key}: ${e.message}`)).join(", "));return r.value}{let r=e;return"color"===t.type&&"string"==typeof e?r=K.parse(e):"padding"!==t.type||"number"!=typeof e&&!Array.isArray(e)?"variableAnchorOffsetCollection"===t.type&&Array.isArray(e)?r=ne.parse(e):"projectionDefinition"===t.type&&"string"==typeof e&&(r=se.parse(e)):r=ee.parse(e),{kind:"constant",evaluate:()=>r}}}}},20992:(e,t,r)=>{"use strict";function n(e,t){return Array.from(e.getElementsByTagName(t))}function i(e){return"#"===e[0]?e:`#${e}`}function s(e){return e?.normalize(),e&&e.textContent||""}function o(e,t,r){const n=e.getElementsByTagName(t),i=n.length?n[0]:null;return i&&r&&r(i),i}function a(e,t,r){const n={};if(!e)return n;const i=e.getElementsByTagName(t),s=i.length?i[0]:null;return s&&r?r(s,n):n}function l(e,t,r){const n=s(o(e,t));return n&&r&&r(n)||{}}function c(e,t,r){const n=parseFloat(s(o(e,t)));if(!isNaN(n))return n&&r&&r(n)||{}}function u(e,t,r){const n=parseFloat(s(o(e,t)));if(!isNaN(n))return r&&r(n),n}function h(e,t){const r={};for(const n of t)l(e,n,(e=>{r[n]=e}));return r}function d(e){return 1===e?.nodeType}function p(e){return a(e,"line",(e=>Object.assign({},l(e,"color",(e=>({stroke:`#${e}`}))),c(e,"opacity",(e=>({"stroke-opacity":e}))),c(e,"width",(e=>({"stroke-width":96*e/25.4}))))))}function f(e){let t=[];if(null===e)return t;for(const r of Array.from(e.childNodes)){if(!d(r))continue;const e=m(r.nodeName);if("gpxtpx:TrackPointExtension"===e)t=t.concat(f(r));else{const n=s(r);t.push([e,g(n)])}}return t}function m(e){return["heart","gpxtpx:hr","hr"].includes(e)?"heart":e}function g(e){const t=parseFloat(e);return isNaN(t)?e:t}function A(e){const t=[parseFloat(e.getAttribute("lon")||""),parseFloat(e.getAttribute("lat")||"")];if(isNaN(t[0])||isNaN(t[1]))return null;u(e,"ele",(e=>{t.push(e)}));const r=o(e,"time");return{coordinates:t,time:r?s(r):null,extendedValues:f(o(e,"extensions"))}}function y(e){const t=h(e,["name","cmt","desc","type","time","keywords"]),r=Array.from(e.getElementsByTagNameNS("http://www.garmin.com/xmlschemas/GpxExtensions/v3","*"));for(const n of r)n.parentNode?.parentNode===e&&(t[n.tagName.replace(":","_")]=s(n));const i=n(e,"link");return i.length&&(t.links=i.map((e=>Object.assign({href:e.getAttribute("href")},h(e,["text","type"]))))),t}function v(e,t){const r=n(e,t),i=[],s=[],o={};for(let e=0;e1,l=Object.assign({_gpxType:"trk"},y(e),p(o(e,"extensions")),i.length?{coordinateProperties:{times:a?i:i[0]}}:{});for(const e of s){r.push(e.line),l.coordinateProperties||(l.coordinateProperties={});const t=l.coordinateProperties,n=Object.entries(e.extendedValues);for(let e=0;enew Array(e.line.length).fill(null)))),t[r][e]=i):t[r]=i}}return{type:"Feature",properties:l,geometry:a?{type:"MultiLineString",coordinates:r}:{type:"LineString",coordinates:r[0]}}}function b(e){const t=Object.assign(y(e),h(e,["sym"])),r=A(e);return r?{type:"Feature",properties:t,geometry:{type:"Point",coordinates:r.coordinates}}:null}function*w(e){for(const t of n(e,"trk")){const e=_(t);e&&(yield e)}for(const t of n(e,"rte")){const e=x(t);e&&(yield e)}for(const t of n(e,"wpt")){const e=b(t);e&&(yield e)}}function E(e){return{type:"FeatureCollection",features:Array.from(w(e))}}function M(e,t){const r={},n="stroke"==t||"fill"===t?t:t+"-color";return"#"===e[0]&&(e=e.substring(1)),6===e.length||3===e.length?r[n]="#"+e:8===e.length&&(r[t+"-opacity"]=parseInt(e.substring(0,2),16)/255,r[n]="#"+e.substring(6,8)+e.substring(4,6)+e.substring(2,4)),r}function S(e,t,r){const n={};return u(e,t,(e=>{n[r]=e})),n}function C(e,t){return a(e,"color",(e=>M(s(e),t)))}function T(e){return a(e,"Icon",((e,t)=>(l(e,"href",(e=>{t.icon=e})),t)))}function I(e){return Object.assign({},function(e){return a(e,"PolyStyle",((e,t)=>Object.assign(t,a(e,"color",(e=>M(s(e),"fill"))),l(e,"fill",(e=>{if("0"===e)return{"fill-opacity":0}})),l(e,"outline",(e=>{if("0"===e)return{"stroke-opacity":0}})))))}(e),function(e){return a(e,"LineStyle",(e=>Object.assign(C(e,"stroke"),S(e,"width","stroke-width"))))}(e),function(e){return a(e,"LabelStyle",(e=>Object.assign(C(e,"label"),S(e,"scale","label-scale"))))}(e),function(e){return a(e,"IconStyle",(e=>Object.assign(C(e,"icon"),S(e,"scale","icon-scale"),S(e,"heading","icon-heading"),a(e,"hotSpot",(e=>{const t=parseFloat(e.getAttribute("x")||""),r=parseFloat(e.getAttribute("y")||""),n=e.getAttribute("xunits")||"",i=e.getAttribute("yunits")||"";return isNaN(t)||isNaN(r)?{}:{"icon-offset":[t,r],"icon-offset-units":[n,i]}})),T(e))))}(e))}r.d(t,{GN:()=>E,bW:()=>$});const R=e=>Number(e),B={string:e=>e,int:R,uint:R,short:R,ushort:R,float:R,double:R,bool:e=>Boolean(e)};function P(e,t){return a(e,"ExtendedData",((e,r)=>{for(const t of n(e,"Data"))r[t.getAttribute("name")||""]=s(o(t,"value"));for(const i of n(e,"SimpleData")){const e=i.getAttribute("name")||"",n=t[e]||B.string;r[e]=n(s(i))}return r}))}function L(e){const t=o(e,"description");for(const e of Array.from(t?.childNodes||[]))if(4===e.nodeType)return{description:{"@type":"html",value:s(e)}};return{}}function D(e){return a(e,"TimeSpan",(e=>({timespan:{begin:s(o(e,"begin")),end:s(o(e,"end"))}})))}function O(e){return a(e,"TimeStamp",(e=>({timestamp:s(o(e,"when"))})))}function N(e,t){return l(e,"styleUrl",(e=>(e=i(e),t[e]?Object.assign({styleUrl:e},t[e]):{styleUrl:e})))}const U=/\s*/g,F=/^\s*|\s*$/g,k=/\s+/;function z(e){return e.replace(U,"").split(",").map(parseFloat).filter((e=>!isNaN(e))).slice(0,3)}function G(e){return e.replace(F,"").split(k).map(z).filter((e=>e.length>=2))}function Q(e){let t=n(e,"coord");var r;0===t.length&&(r=e,t=Array.from(r.getElementsByTagNameNS("*","coord")));const i=t.map((e=>s(e).split(" ").map(parseFloat)));return 0===i.length?null:{geometry:i.length>2?{type:"LineString",coordinates:i}:{type:"Point",coordinates:i[0]},times:n(e,"when").map((e=>s(e)))}}function V(e){if(0===e.length)return e;const t=e[0],r=e[e.length-1];let n=!0;for(let e=0;e=2&&t.push({type:"Point",coordinates:e});break}case"LinearRing":case"LineString":{const e=G(H(s));e.length>=2&&t.push({type:"LineString",coordinates:e});break}case"Polygon":{const e=[];for(const t of n(s,"LinearRing")){const r=V(G(H(t)));r.length>=4&&e.push(r)}e.length&&t.push({type:"Polygon",coordinates:e});break}case"Track":case"gx:Track":{const e=Q(s);if(!e)break;const{times:n,geometry:i}=e;t.push(i),n.length&&r.push(n);break}}}return{geometries:t,coordTimes:r}}function q(e,t,r,n){const{coordTimes:i,geometries:s}=j(e),o=function(e){return 0===e.length?null:1===e.length?e[0]:{type:"GeometryCollection",geometries:e}}(s);if(!o&&n.skipNullGeometry)return null;const a={type:"Feature",geometry:o,properties:Object.assign(h(e,["name","address","visibility","open","phoneNumber","description"]),L(e),N(e,t),I(e),P(e,r),D(e),O(e),i.length?{coordinateProperties:{times:1===i.length?i[0]:i}}:{})};void 0!==a.properties?.visibility&&(a.properties.visibility="0"!==a.properties.visibility);const l=e.getAttribute("id");return null!==l&&""!==l&&(a.id=l),a}const W=Math.PI/180;function Y(e,t,r,n){const i=function(e){return o(e,"gx:LatLonQuad")?{geometry:{type:"Polygon",coordinates:[V(G(H(e)))]}}:function(e){const t=o(e,"LatLonBox");if(t){const e=u(t,"north"),r=u(t,"west"),n=u(t,"east"),i=u(t,"south"),s=u(t,"rotation");if("number"==typeof e&&"number"==typeof i&&"number"==typeof r&&"number"==typeof n){const t=[r,i,n,e];let o=[[[r,e],[n,e],[n,i],[r,i],[r,e]]];return"number"==typeof s&&(o=function(e,t,r){const n=[(e[0]+e[2])/2,(e[1]+e[3])/2];return[t[0].map((e=>{const t=e[1]-n[1],i=e[0]-n[0],s=Math.sqrt(Math.pow(t,2)+Math.pow(i,2)),o=Math.atan2(t,i)+r*W;return[n[0]+Math.cos(o)*s,n[1]+Math.sin(o)*s]}))]}(t,o,s)),{bbox:t,geometry:{type:"Polygon",coordinates:o}}}}return null}(e)}(e),s=i?.geometry||null;if(!s&&n.skipNullGeometry)return null;const a={type:"Feature",geometry:s,properties:Object.assign({"@geometry-type":"groundoverlay"},h(e,["name","address","visibility","open","phoneNumber","description"]),L(e),N(e,t),I(e),T(e),P(e,r),D(e),O(e))};i?.bbox&&(a.bbox=i.bbox),void 0!==a.properties?.visibility&&(a.properties.visibility="0"!==a.properties.visibility);const l=e.getAttribute("id");return null!==l&&""!==l&&(a.id=l),a}function X(e){let t=e.getAttribute("id");const r=e.parentNode;return!t&&d(r)&&"CascadingStyle"===r.localName&&(t=r.getAttribute("kml:id")||r.getAttribute("id")),i(t||"")}function*K(e,t={skipNullGeometry:!1}){const r=function(e){const t={};for(const r of n(e,"Style"))t[X(r)]=I(r);for(const r of n(e,"StyleMap")){const e=i(r.getAttribute("id")||"");l(r,"styleUrl",(r=>{r=i(r),t[r]&&(t[e]=t[r])}))}return t}(e),s=function(e){const t={};for(const r of n(e,"SimpleField"))t[r.getAttribute("name")||""]=B[r.getAttribute("type")||""]||B.string;return t}(e);for(const i of n(e,"Placemark")){const e=q(i,r,s,t);e&&(yield e)}for(const i of n(e,"GroundOverlay")){const e=Y(i,r,s,t);e&&(yield e)}}function $(e,t={skipNullGeometry:!1}){return{type:"FeatureCollection",features:Array.from(K(e,t))}}},50040:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>y});var n,i=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return.5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return 0===e?0:Math.pow(1024,e-1)},Out:function(e){return 1===e?1:1-Math.pow(2,-10*e)},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return 0===e?0:1===e?1:-Math.pow(2,10*(e-1))*Math.sin(5*(e-1.1)*Math.PI)},Out:function(e){return 0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin(5*(e-.1)*Math.PI)+1},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?-.5*Math.pow(2,10*(e-1))*Math.sin(5*(e-1.1)*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin(5*(e-1.1)*Math.PI)+1}}),Back:Object.freeze({In:function(e){var t=1.70158;return 1===e?1:e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return 0===e?0:--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}}),Bounce:Object.freeze({In:function(e){return 1-i.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?.5*i.Bounce.In(2*e):.5*i.Bounce.Out(2*e-1)+.5}}),generatePow:function(e){return void 0===e&&(e=4),e=(e=e1e4?1e4:e,{In:function(t){return Math.pow(t,e)},Out:function(t){return 1-Math.pow(1-t,e)},InOut:function(t){return t<.5?Math.pow(2*t,e)/2:(1-Math.pow(2-2*t,e))/2+.5}}}}),s=function(){return performance.now()},o=function(){function e(){for(var e=[],t=0;t0;){this._tweensAddedDuringUpdate={};for(var n=0;n1?s(e[r],e[r-1],r-n):s(e[i],e[i+1>r?r:i+1],n-i)},Bezier:function(e,t){for(var r=0,n=e.length-1,i=Math.pow,s=a.Utils.Bernstein,o=0;o<=n;o++)r+=i(1-t,n-o)*i(t,o)*e[o]*s(n,o);return r},CatmullRom:function(e,t){var r=e.length-1,n=r*t,i=Math.floor(n),s=a.Utils.CatmullRom;return e[0]===e[r]?(t<0&&(i=Math.floor(n=r*(1+t))),s(e[(i-1+r)%r],e[i],e[(i+1)%r],e[(i+2)%r],n-i)):t<0?e[0]-(s(e[0],e[0],e[1],e[1],-n)-e[0]):t>1?e[r]-(s(e[r],e[r],e[r-1],e[r-1],n-r)-e[r]):s(e[i?i-1:0],e[i],e[r1;r--)t*=r;return n[e]=t,t}),CatmullRom:function(e,t,r,n,i){var s=.5*(r-e),o=.5*(n-t),a=i*i;return(2*t-2*r+s+o)*(i*a)+(-3*t+3*r-2*s-o)*a+s*i+t}}},l=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),c=new o,u=function(){function e(e,t){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=i.Linear.None,this._interpolationFunction=a.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=l.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=e,"object"==typeof t?(this._group=t,t.add(this)):!0===t&&(this._group=c,c.add(this))}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(e,t){if(void 0===t&&(t=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=e,this._propertiesAreSetUp=!1,this._duration=t<0?0:t,this},e.prototype.duration=function(e){return void 0===e&&(e=1e3),this._duration=e<0?0:e,this},e.prototype.dynamic=function(e){return void 0===e&&(e=!1),this._isDynamic=e,this},e.prototype.start=function(e,t){if(void 0===e&&(e=s()),void 0===t&&(t=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed)for(var r in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=e,this._startTime+=this._delayTime,!this._propertiesAreSetUp||t){if(this._propertiesAreSetUp=!0,!this._isDynamic){var n={};for(var i in this._valuesEnd)n[i]=this._valuesEnd[i];this._valuesEnd=n}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,t)}return this},e.prototype.startFromCurrentValues=function(e){return this.start(e,!0)},e.prototype._setupProperties=function(e,t,r,n,i){for(var s in r){var o=e[s],a=Array.isArray(o),l=a?"array":typeof o,c=!a&&Array.isArray(r[s]);if("undefined"!==l&&"function"!==l){if(c){if(0===(g=r[s]).length)continue;for(var u=[o],h=0,d=g.length;hc)return 1;var e=Math.trunc(a/l),t=a-e*l,r=Math.min(t/o._duration,1);return 0===r&&a===o._duration?1:r}(),h=this._easingFunction(u);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,h),this._onUpdateCallback&&this._onUpdateCallback(this._object,u),0===this._duration||a>=this._duration){if(this._repeat>0){var d=Math.min(Math.trunc((a-this._duration)/l)+1,this._repeat);for(i in isFinite(this._repeat)&&(this._repeat-=d),this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[i]||(this._valuesStartRepeat[i]=this._valuesStartRepeat[i]+parseFloat(this._valuesEnd[i])),this._yoyo&&this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=l*d,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var p=0,f=this._chainedTweens.length;p{"use strict";r.d(t,{W:()=>X,A:()=>le});var n=r(39437);const i=1e3/60,s=function(e){e.id&&(clearInterval(e.id),e.id=void 0),e.waitTimer&&(clearInterval(e.waitTimer),e.waitTimer=void 0),e.keyframe=0},o=function(e){s(e),e.isEnded()&&e.dispatchEvent({type:"animation-ended"}),e.dispatchEvent({type:"animation-stopped"}),e.duration=0};class a extends n.EventDispatcher{constructor(){super(),this.id=null,this.keyframe=0,this.duration=0,this.state=0,this.waitTimer=null,this.callback=()=>{}}isPlaying(){return 1===this.state}isStopped(){return 0===this.state}isEnded(){return 2===this.state}setCallback(e){this.callback=e}play(e){this.duration=e,this.dispatchEvent({type:"animation-started"}),this.state=1,s(this),this.id=setInterval(this.frame.bind(this),i)}playLater(e,t){const r=Math.floor(i*t);window.clearInterval(this.waitTimer);const n=this;this.waitTimer=window.setTimeout((()=>{n.play(e)}),r)}stop(){this.state=0,o(this)}frame(){this.keyframe1&&void 0!==arguments[1]?arguments[1]:{};super(),this._view=e,this._domElement=e.domElement;let r=!0;Object.defineProperty(this,"enabled",{get:()=>r,set:e=>{e||(this.onKeyUp(),this.onPointerUp()),r=e}});let i=!0;Object.defineProperty(this,"enableKeys",{get:()=>i,set:e=>{e||this.onKeyUp(),i=e}}),this.NONE={};let s=this.NONE;Object.defineProperty(this,"currentState",{get:()=>s,set:e=>{if(s!==e){const t=s;s=e,this.dispatchEvent({type:"state-changed",viewCoords:p,previous:t})}}}),this._clickTimeStamp=0,this._lastMousePressed={viewCoords:new n.Vector2},this._currentMousePressed=void 0,this._currentKeyPressed=void 0,this._onPointerDown=this.onPointerDown.bind(this),this._onPointerMove=this.onPointerMove.bind(this),this._onPointerUp=this.onPointerUp.bind(this),this._onMouseWheel=this.onMouseWheel.bind(this),this._onKeyDown=this.onKeyDown.bind(this),this._onKeyUp=this.onKeyUp.bind(this),this._onBlur=this.onBlur.bind(this),this._onContextMenu=this.onContextMenu.bind(this),this._domElement.addEventListener("pointerdown",this._onPointerDown,!1),this._domElement.addEventListener("wheel",this._onMouseWheel,!1),this._domElement.addEventListener("keydown",this._onKeyDown,!1),this._domElement.addEventListener("keyup",this._onKeyUp,!1),this._domElement.addEventListener("blur",this._onBlur),this._domElement.addEventListener("contextmenu",this._onContextMenu,!1),this.setFromOptions(t)}inputToState(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(const n of Object.keys(d)){const i=this[n];if(i.enable&&i.mouseButton===e&&i.keyboard===t&&i.double===r){if(!i._trigger)return i;this.dispatchEvent({type:i._event,viewCoords:void 0!==e&&p,direction:i._direction})}}return this.NONE}touchToState(e){for(const t of Object.keys(d)){const r=this[t];if(r.enable&&e===r.finger)return r}return this.NONE}setFromOptions(e){for(const t in d)if({}.hasOwnProperty.call(d,t)){let r={};r=e[t]||this[t]||Object.assign(r,d[t]),e[t]&&void 0===e[t].enable&&(r.enable=this[t].enable),r.double=!!r.double,r._event=d[t]._event,r._trigger=d[t]._trigger,r._direction=d[t]._direction,this[t]=r}}onPointerDown(e){this.enabled&&(p.copy(this._view.eventToViewCoords(e)),"mouse"===e.pointerType&&(this._currentMousePressed=e.button,void 0===this._currentKeyPressed&&(e.ctrlKey?this._currentKeyPressed=17:e.shiftKey?this._currentKeyPressed=16:e.metaKey&&(this._currentKeyPressed=91)),this.currentState=this.inputToState(this._currentMousePressed,this._currentKeyPressed,e.timeStamp-this._clickTimeStamp<500&&this._lastMousePressed.button===this._currentMousePressed&&this._lastMousePressed.viewCoords.distanceTo(p)<5),this._clickTimeStamp=e.timeStamp,this._lastMousePressed.button=this._currentMousePressed,this._lastMousePressed.viewCoords.copy(p)),this._domElement.addEventListener("pointermove",this._onPointerMove,!1),this._domElement.addEventListener("pointerup",this._onPointerUp,!1),this._domElement.addEventListener("mouseleave",this._onPointerUp,!1))}onPointerMove(e){e.preventDefault(),this.enabled&&(p.copy(this._view.eventToViewCoords(e)),"mouse"===e.pointerType)&&this.dispatchEvent({type:this.currentState._event,viewCoords:p})}onPointerUp(){this.enabled&&(this._currentMousePressed=void 0,this._domElement.removeEventListener("pointermove",this._onPointerMove,!1),this._domElement.removeEventListener("pointerup",this._onPointerUp,!1),this._domElement.removeEventListener("mouseleave",this._onPointerUp,!1),this.currentState=this.NONE)}onMouseWheel(e){e.preventDefault(),this.enabled&&this.ZOOM.enable&&(p.copy(this._view.eventToViewCoords(e)),this.currentState=this.ZOOM,this.dispatchEvent({type:this.ZOOM._event,delta:e.deltaY,viewCoords:p}))}onKeyDown(e){this.enabled&&this.enableKeys&&(this._currentKeyPressed=e.keyCode,this.inputToState(this._currentMousePressed,this._currentKeyPressed))}onKeyUp(){this.enabled&&this.enableKeys&&(this._currentKeyPressed=void 0,void 0===this._currentMousePressed&&(this.currentState=this.NONE))}onBlur(){this.onKeyUp(),this.onPointerUp()}onContextMenu(e){e.preventDefault()}dispose(){this._clickTimeStamp=0,this._lastMousePressed=void 0,this._currentKeyPressed=void 0,this._domElement.removeEventListener("pointerdown",this._onPointerDown,!1),this._domElement.removeEventListener("pointermove",this._onPointerMove,!1),this._domElement.removeEventListener("pointerup",this._onPointerUp,!1),this._domElement.removeEventListener("wheel",this._onMouseWheel,!1),this._domElement.removeEventListener("keydown",this._onKeyDown,!1),this._domElement.removeEventListener("keyup",this._onKeyUp,!1),this._domElement.removeEventListener("blur",this._onBlur),this._domElement.removeEventListener("contextmenu",this._onContextMenu,!1)}}const m=f;var g=r(84354);const A=1e-6,y={up:new n.Vector2(0,1),bottom:new n.Vector2(0,-1),left:new n.Vector2(1,0),right:new n.Vector2(-1,0)},v=new n.Vector2,x=new n.Vector2,_=new n.Vector2,b=new n.Spherical(1,.01,0),w=new n.Spherical(1,0,0);let E=1;const M=new n.Vector2,S=new n.Vector2,C=new n.Vector2,T=new n.Vector3,I=new n.Vector2,R=new n.Vector2,B=new n.Vector2;let P;const L=new n.Quaternion,D=new n.Object3D,O=new c.A("EPSG:4978");D.matrixWorldInverse=new n.Matrix4;const N=new c.A("EPSG:4978",0,0,0),U=new c.A("EPSG:4326",0,0,0);function F(e,t){N.setFromVector3(e).as("EPSG:4326",U),t.position.copy(e),t.lookAt(U.geodesicNormal.add(e)),t.rotateX(.5*Math.PI),t.updateMatrixWorld(!0)}let k=0,z=!0;const G=new n.Quaternion(0,0,0,1),Q=new n.Vector3,V=new n.Vector3,H=new n.Quaternion,j=new n.Sphere,q=new n.Vector3,W=new n.Vector3,Y={},X={PAN_CHANGED:"pan-changed",ORIENTATION_CHANGED:"orientation-changed",RANGE_CHANGED:"range-changed",CAMERA_TARGET_CHANGED:"camera-target-changed"},K=new n.Quaternion,$=new n.Quaternion,J=new n.Vector3(1,0,0);let Z=1/0;const ee=new n.Vector3,te=new n.Vector3,re=new n.Raycaster,ne=new n.Vector3,ie=new n.Vector3,se=new n.Sphere;let oe;class ae extends n.EventDispatcher{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(),this.player=new l,this.view=e,this.camera=e.camera3D,this.states=new m(this.view,r.stateControl),Object.defineProperty(this,"enabled",{get:()=>this.states.enabled,set:e=>{console.warn("GlobeControls.enabled property is deprecated. Use StateControl.enabled instead - which you can access with GlobeControls.states.enabled."),this.states.enabled=e}}),r.zoomSpeed&&(console.warn("Controls zoomSpeed parameter is deprecated. Use zoomFactor instead."),r.zoomFactor=r.zoomFactor||r.zoomSpeed),this.zoomFactor=r.zoomFactor||1.1,this.minDistance=r.minDistance||250,this.maxDistance=r.maxDistance||8*u.Q.x,this.minZoom=r.minZoom||0,this.maxZoom=r.maxZoom||1/0,this.rotateSpeed=r.rotateSpeed||.25,this.keyPanSpeed=r.keyPanSpeed||7,this.minPolarAngle=n.MathUtils.degToRad(r.minPolarAngle??.5),this.maxPolarAngle=n.MathUtils.degToRad(r.minPolarAngle??86),this.minAzimuthAngle=r.minAzimuthAngle?n.MathUtils.degToRad(r.minAzimuthAngle):-1/0,this.maxAzimuthAngle=r.maxAzimuthAngle?n.MathUtils.degToRad(r.maxAzimuthAngle):1/0,this.handleCollision=void 0===r.handleCollision||r.handleCollision,this.minDistanceCollision=60,Object.defineProperty(this,"enableKeys",{get:()=>this.states.enableKeys,set:e=>{console.warn("GlobeControls.enableKeys property is deprecated. Use StateControl.enableKeys instead - which you can access with GlobeControls.states.enableKeys."),this.states.enableKeys=e}}),this.enableDamping=!1!==r.enableDamping,this.dampingMoveFactor=null!=r.dampingMoveFactor?r.dampingMoveFactor:.25,this.startEvent={type:"start"},this.endEvent={type:"end"},this.updateHelper=function(){},this._onEndingMove=null,this._onTravel=this.travel.bind(this),this._onTouchStart=this.onTouchStart.bind(this),this._onTouchEnd=this.onTouchEnd.bind(this),this._onTouchMove=this.onTouchMove.bind(this),this._onStateChange=this.onStateChange.bind(this),this._onRotation=this.handleRotation.bind(this),this._onDrag=this.handleDrag.bind(this),this._onDolly=this.handleDolly.bind(this),this._onPan=this.handlePan.bind(this),this._onPanoramic=this.handlePanoramic.bind(this),this._onZoom=this.handleZoom.bind(this),this.states.addEventListener("state-changed",this._onStateChange,!1),this.states.addEventListener(this.states.ORBIT._event,this._onRotation,!1),this.states.addEventListener(this.states.MOVE_GLOBE._event,this._onDrag,!1),this.states.addEventListener(this.states.DOLLY._event,this._onDolly,!1),this.states.addEventListener(this.states.PAN._event,this._onPan,!1),this.states.addEventListener(this.states.PANORAMIC._event,this._onPanoramic,!1),this.states.addEventListener("zoom",this._onZoom,!1),this.view.domElement.addEventListener("touchstart",this._onTouchStart,!1),this.view.domElement.addEventListener("touchend",this._onTouchEnd,!1),this.view.domElement.addEventListener("touchmove",this._onTouchMove,!1),this.states.addEventListener(this.states.TRAVEL_IN._event,this._onTravel,!1),this.states.addEventListener(this.states.TRAVEL_OUT._event,this._onTravel,!1),e.scene.add(D),t.isExtent?t.center().as("EPSG:4978",N):(t.coord.as("EPSG:4978",N),t.tilt=t.tilt||89.5,t.heading=t.heading||0),F(N,D),this.lookAtCoordinate(t,!1),O.crs=this.view.referenceCrs}get zoomInScale(){return this.zoomFactor}get zoomOutScale(){return 1/this.zoomFactor}get isPaused(){return this.states.currentState===this.states.NONE&&!this.player.isPlaying()}onEndingMove(e){this._onEndingMove&&(this.player.removeEventListener("animation-stopped",this._onEndingMove),this._onEndingMove=null),this.handlingEvent(e)}rotateLeft(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;w.theta-=e}rotateUp(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;w.phi-=e}panLeft(e){const t=this.camera.matrix.elements;T.fromArray(t),T.multiplyScalar(-e),Q.add(T)}panUp(e){const t=this.camera.matrix.elements;T.fromArray(t,4),T.multiplyScalar(e),Q.add(T)}mouseToPan(e,t){const r=this.view.mainLoop.gfxEngine;if(this.camera.isPerspectiveCamera){let i=this.camera.position.distanceTo(this.getCameraTargetPosition());i*=2*Math.tan(n.MathUtils.degToRad(.5*this.camera.fov)),this.panLeft(e*i/r.width*this.camera.aspect),this.panUp(t*i/r.height)}else this.camera.isOrthographicCamera&&(this.panLeft(e*(this.camera.right-this.camera.left)/r.width),this.panUp(t*(this.camera.top-this.camera.bottom)/r.height))}dolly(e){0!==e&&(P=e>0?this.zoomInScale:this.zoomOutScale,this.camera.isPerspectiveCamera?E/=P:this.camera.isOrthographicCamera&&(this.camera.zoom=n.MathUtils.clamp(this.camera.zoom*P,this.minZoom,this.maxZoom),this.camera.updateProjectionMatrix(),this.view.notifyChange(this.camera)))}getMinDistanceCameraBoundingSphereObbsUp(e){if(e.level>10&&1==e.children.length&&e.geometry){const t=e.obb;se.center.copy(this.camera.position),se.radius=this.minDistanceCollision,t.isSphereAboveXYBox(se)&&(Z=Math.min(se.center.z-t.box3D.max.z,Z))}}update(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.states.currentState;if(Z=1/0,this.handleCollision&&this.view.tileLayer)for(const e of this.view.tileLayer.level0Nodes)e.traverse(this.getMinDistanceCameraBoundingSphereObbsUp.bind(this));switch(e){case this.states.MOVE_GLOBE:if(Z<0)D.translateY(-Z),this.camera.position.setLength(this.camera.position.length()-Z);else if(Zr&&w.phi>0){const e=t-r,n=1-(e-(Z-r))/e;w.phi*=n*n}else if(Z-r&&w.phi>i){let e=-Math.asin(.25*(r-Z)/b.radius);e=n.MathUtils.clamp(e,i,0);const t=1-(r-Z)/(2*r);w.phi=n.MathUtils.lerp(w.phi,e,t),Z-=Math.sin(w.phi)*b.radius}b.theta+=w.theta,b.phi+=w.phi,b.theta=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,b.theta)),b.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,b.phi)),b.radius=this.camera.position.length()*E,b.makeSafe(),b.radius=Math.max(this.minDistance,Math.min(this.maxDistance,b.radius)),this.camera.position.setFromSpherical(b),Z<0&&(this.camera.position.y-=Z,b.setFromVector3(this.camera.position),w.phi=0),D.localToWorld(this.camera.position)}}this.camera.up.copy(D.position).normalize(),this.camera.lookAt(D.position),this.enableDamping?(w.theta*=.75,w.phi*=.75,L.slerp(G,.2*this.dampingMoveFactor)):(w.theta=0,w.phi=0,L.set(0,0,0,1)),E=1,Q.set(0,0,0),(V.distanceToSquared(this.camera.position)>A||8*(1-H.dot(this.camera.quaternion))>A)&&(this.view.notifyChange(this.camera),V.copy(this.camera.position),H.copy(this.camera.quaternion)),this.enableDamping&&e===this.states.ORBIT&&this.player.isStopped()&&(w.theta>A||w.phi>A)&&(this.player.setCallback((()=>{this.update(this.states.ORBIT)})),this.player.playLater(60,2)),this.view.dispatchEvent({type:g.G.CAMERA_MOVED,coord:O.setFromVector3(D.position),range:b.radius,heading:-n.MathUtils.radToDeg(b.theta),tilt:90-n.MathUtils.radToDeg(b.phi)})}onStateChange(e){this.states.currentState!==this.states.NONE?(h.Ay.stop(this.view,this.camera),this.onEndingMove(),this.player.stop(),this.updateTarget(),oe=h.Ay.getTransformCameraLookingAtTarget(this.view,this.camera,ie),v.copy(e.viewCoords),this.view.getPickingPositionFromDepth(e.viewCoords,q)&&(j.radius=q.length(),ee.copy(q).normalize(),this.updateHelper(q,Y.picking)),I.copy(e.viewCoords),this.view.getPickingPositionFromDepth(e.viewCoords,ie),M.copy(e.viewCoords)):this.handleEndMovement(e)}handleRotation(e){this.player.stop(),this.handlePanoramic(e)}handleDrag(e){const t=this.view.viewToNormalizedCoords(e.viewCoords);this.camera.updateMatrixWorld(),re.setFromCamera(t,this.camera),re.ray.intersectSphere(j,W)?(te.copy(W).normalize(),L.setFromUnitVectors(te,ee),k=Date.now(),this.update()):this.states.onPointerUp()}handleDolly(e){R.copy(e.viewCoords),B.subVectors(R,I),I.copy(R),e.delta=B.y,0!=e.delta&&this.handleZoom(e)}handlePan(e){e.viewCoords?(S.copy(e.viewCoords),C.subVectors(S,M),M.copy(S)):e.direction&&C.copy(y[e.direction]).multiplyScalar(this.keyPanSpeed),this.mouseToPan(C.x,C.y),this.update(this.states.PAN)}handlePanoramic(e){x.copy(e.viewCoords),_.subVectors(x,v);const t=this.view.mainLoop.gfxEngine;w.theta-=2*Math.PI*_.x/t.width*this.rotateSpeed,w.phi-=2*Math.PI*_.y/t.height*this.rotateSpeed,v.copy(x),this.update()}handleEndMovement(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.dispatchEvent(this.endEvent),this.player.stop(),this.enableDamping?e.previous===this.states.ORBIT&&(w.theta>A||w.phi>A)?(this.player.setCallback((()=>{this.update(this.states.ORBIT)})),this.player.play(60),this._onEndingMove=()=>this.onEndingMove(),this.player.addEventListener("animation-stopped",this._onEndingMove)):e.previous===this.states.MOVE_GLOBE&&Date.now()-k<50?(this.player.setCallback((()=>{this.update(this.states.MOVE_GLOBE)})),this.player.play(120),this._onEndingMove=()=>this.onEndingMove(),this.player.addEventListener("animation-stopped",this._onEndingMove)):this.onEndingMove():this.onEndingMove()}updateTarget(){if(this.view.getPickingPositionFromDepth(null,ie)){const e=isNaN(ie.x)?100:this.camera.position.distanceTo(ie);ne.set(0,0,-e),this.camera.localToWorld(ne),F(ne,D),D.matrixWorldInverse.copy(D.matrixWorld).invert(),ne.copy(this.camera.position),ne.applyMatrix4(D.matrixWorldInverse),b.setFromVector3(ne)}}handlingEvent(e){e=e||h.Ay.getTransformCameraLookingAtTarget(this.view,this.camera);const t=h.Ay.getDiffParams(oe,e);if(t&&(t.range&&this.dispatchEvent({type:X.RANGE_CHANGED,previous:t.range.previous,new:t.range.new}),t.coord&&this.dispatchEvent({type:X.CAMERA_TARGET_CHANGED,previous:t.coord.previous,new:t.coord.new}),t.tilt||t.heading)){const e={type:X.ORIENTATION_CHANGED};t.tilt&&(e.previous={tilt:t.tilt.previous},e.new={tilt:t.tilt.new}),t.heading&&(e.previous=e.previous||{},e.new=e.new||{},e.new.heading=t.heading.new,e.previous.heading=t.heading.previous),this.dispatchEvent(e)}}travel(e){this.player.stop();const t=this.view.getPickingPositionFromDepth(e.viewCoords),r=this.getRange(t);if(t&&r>this.minDistance)return this.lookAtCoordinate({coord:new c.A("EPSG:4978",t),range:r*("out"===e.direction?1/.6:.6),time:1500})}handleZoom(e){this.player.stop(),h.Ay.stop(this.view,this.camera);const t=e.delta>0?this.zoomInScale:this.zoomOutScale;let r="dolly"===e.type?ie:this.view.getPickingPositionFromDepth(e.viewCoords),n=this.getRange();if(n*=t,r&&n>this.minDistance&&n180?r.x+=360:r.x-e.x>180&&(e.x+=360)),r.lerp(e,t),r=U.setFromVector3(r).as("EPSG:4978",N),this.lookAtCoordinate({coord:r,range:n},!1)}}onTouchStart(e){if(this.player.stop(),!1!==this.states.enabled&&(this.state=this.states.touchToState(e.touches.length),this.updateTarget(),this.state!==this.states.NONE)){switch(this.state){case this.states.MOVE_GLOBE:{const t=this.view.eventToViewCoords(e);this.view.getPickingPositionFromDepth(t,q)?(j.radius=q.length(),ee.copy(q).normalize(),this.updateHelper(q,Y.picking)):this.state=this.states.NONE;break}case this.states.ORBIT:case this.states.DOLLY:{const t=e.touches[0].pageX,r=e.touches[0].pageY,n=t-e.touches[1].pageX,i=r-e.touches[1].pageY,s=Math.sqrt(n*n+i*i);I.set(0,s),v.set(t,r);break}case this.states.PAN:M.set(e.touches[0].pageX,e.touches[0].pageY)}this.dispatchEvent(this.startEvent)}}onTouchMove(e){if(this.player.isPlaying()&&this.player.stop(),!1!==this.states.enabled){switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case this.states.MOVE_GLOBE.finger:{const t=this.view.eventToViewCoords(e),r=this.view.viewToNormalizedCoords(t);this.camera.updateMatrixWorld(),re.setFromCamera(r,this.camera),re.ray.intersectSphere(j,W)?(te.copy(W).normalize(),L.setFromUnitVectors(te,ee),k=Date.now()):this.onTouchEnd();break}case this.states.ORBIT.finger:case this.states.DOLLY.finger:{const t=this.view.mainLoop.gfxEngine;x.set(e.touches[0].pageX,e.touches[0].pageY),_.subVectors(x,v),this.rotateLeft(2*Math.PI*_.x/t.width*this.rotateSpeed),this.rotateUp(2*Math.PI*_.y/t.height*this.rotateSpeed),v.copy(x);const r=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,i=Math.sqrt(r*r+n*n);R.set(0,i),B.subVectors(R,I),this.dolly(B.y),I.copy(R);break}case this.states.PAN.finger:S.set(e.touches[0].pageX,e.touches[0].pageY),C.subVectors(S,M),this.mouseToPan(C.x,C.y),M.copy(S);break;default:this.state=this.states.NONE}this.state!==this.states.NONE&&this.update(this.state)}}onTouchEnd(){this.handleEndMovement({previous:this.state}),this.state=this.states.NONE}dispose(){this.view.domElement.removeEventListener("touchstart",this._onTouchStart,!1),this.view.domElement.removeEventListener("touchend",this._onTouchEnd,!1),this.view.domElement.removeEventListener("touchmove",this._onTouchMove,!1),this.states.dispose(),this.states.removeEventListener("state-changed",this._onStateChange,!1),this.states.removeEventListener(this.states.ORBIT._event,this._onRotation,!1),this.states.removeEventListener(this.states.MOVE_GLOBE._event,this._onDrag,!1),this.states.removeEventListener(this.states.DOLLY._event,this._onDolly,!1),this.states.removeEventListener(this.states.PAN._event,this._onPan,!1),this.states.removeEventListener(this.states.PANORAMIC._event,this._onPanoramic,!1),this.states.removeEventListener("zoom",this._onZoom,!1),this.states.removeEventListener(this.states.TRAVEL_IN._event,this._onTravel,!1),this.states.removeEventListener(this.states.TRAVEL_OUT._event,this._onTravel,!1),this.dispatchEvent({type:"dispose"})}setTilt(e,t){return this.lookAtCoordinate({tilt:e},t)}setHeading(e,t){return this.lookAtCoordinate({heading:e},t)}setRange(e,t){return this.lookAtCoordinate({range:e},t)}getCameraTargetPosition(){return D.position}getRange(e){return h.Ay.getTransformCameraLookingAtTarget(this.view,this.camera,e).range}getTilt(e){return h.Ay.getTransformCameraLookingAtTarget(this.view,this.camera,e).tilt}getHeading(e){return h.Ay.getTransformCameraLookingAtTarget(this.view,this.camera,e).heading}pan(e){return this.mouseToPan(e.x,e.y),this.update(this.states.PAN),Promise.resolve()}getCameraOrientation(){return this.view.getPickingPositionFromDepth(null,ie),[this.getTilt(ie),this.getHeading(ie)]}getCameraCoordinate(){return new c.A("EPSG:4978",this.camera.position).as("EPSG:4326")}getLookAtCoordinate(){return h.Ay.getTransformCameraLookingAtTarget(this.view,this.camera).coord}setAnimationEnabled(e){z=e}isAnimationEnabled(){return z}getZoom(){return this.view.tileLayer.computeTileZoomFromDistanceCamera(this.getRange(),this.view.camera)}setZoom(e,t){return this.lookAtCoordinate({zoom:e},t)}getScale(e){return console.warn("Deprecated, use View#getScale instead."),this.view.getScale(e)}pixelsToMeters(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.28;return console.warn("Deprecated use View#getPixelsToMeters instead."),e*t/this.getScale(t)/1e3}pixelsToDegrees(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.28;console.warn("Deprecated, use View#getPixelsToMeters and GlobeControls#getMetersToDegrees instead.");const r=this.pixelsToMeters(e,t);return n.MathUtils.radToDeg(2*Math.asin(r/(2*u.Q.x)))}metersToPixels(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.28;console.warn("Deprecated, use View#getMetersToPixels instead.");const r=this.getScale(t);return t/=1e3,e*r/t}setScale(e,t,r){return this.lookAtCoordinate({scale:e,pitch:t},r)}lookAtCoordinate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.isAnimationEnabled();if(this.player.stop(),!e.isExtent&&(e.zoom?e.range=this.view.tileLayer.computeDistanceCameraFromTileZoom(e.zoom,this.view.camera):e.scale&&(e.range=this.view.getScaleFromDistance(e.pitch,e.scale),(e.rangethis.maxDistance)&&(console.warn(`This scale ${e.scale} can not be reached`),e.range=n.MathUtils.clamp(e.range,this.minDistance,this.maxDistance))),void 0!==e.tilt)){const t=90-n.MathUtils.radToDeg(this.maxPolarAngle),r=90-n.MathUtils.radToDeg(this.minPolarAngle);(e.tiltr)&&(e.tilt=n.MathUtils.clamp(e.tilt,t,r),console.warn("Tilt was clamped to ",e.tilt,` the interval is between ${t} and ${r} degree`))}return oe=h.Ay.getTransformCameraLookingAtTarget(this.view,this.camera),t?(e.callback=e=>D.position.copy(e.targetWorldPosition),this.dispatchEvent({type:"animation-started"}),h.Ay.animateCameraToLookAtTarget(this.view,this.camera,e).then((e=>(this.dispatchEvent({type:"animation-ended"}),this.handlingEvent(e),e)))):h.Ay.transformCameraToLookAtTarget(this.view,this.camera,e).then((e=>(D.position.copy(e.targetWorldPosition),this.handlingEvent(e),e)))}pickGeoPosition(e){const t=this.view.getPickingPositionFromDepth(e);if(t)return new c.A("EPSG:4978",t).as("EPSG:4326")}}const le=ae},72682:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>Q,w7:()=>z});var n=r(39437),i=r(87196);const s=n.MOUSE.LEFT,o=n.MOUSE.MIDDLE,a=n.MOUSE.RIGHT;let l;const c=new n.Vector3,u=new n.Quaternion;let h=0;const d=new n.Vector3,p=-1,f={default:"auto",drag:"move",pan:"cell",travel:"wait",rotate:"move",ortho_zoom:"wait"},m=new n.Vector3,g=new n.Vector2,A=new n.Vector2,y=new n.Vector2(0,0),v=new n.Vector3,x=new n.Vector3,_=new n.Vector3,b=new n.Vector3(0,0,0);let w=0;const E=new n.Vector3,M=new n.Quaternion,S=new n.Vector2,C=new n.Vector3,T=new n.Vector3,I=new n.Quaternion,R=new n.Quaternion;let B=0,P=0,L=!1,D=!1,O=0,N=0;const U=new n.Raycaster,F=new n.Plane(new n.Vector3(0,0,-1)),k={enabled:!0,enableRotation:!0,rotateSpeed:2,minPanSpeed:.05,maxPanSpeed:15,zoomTravelTime:.2,zoomFactor:2,maxResolution:0,minResolution:1/0,maxAltitude:5e7,groundLevel:200,autoTravelTimeMin:1.5,autoTravelTimeMax:4,autoTravelTimeDist:5e4,smartTravelHeightMin:75,smartTravelHeightMax:500,instantTravel:!1,minZenithAngle:0,maxZenithAngle:82.5,handleCollision:!0,minDistanceCollision:30,enableSmartTravel:!0,enablePan:!0},z={MOVED:"moved"};class G extends n.EventDispatcher{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),this.view=e,this.camera=e.camera3D,this.enabled="boolean"==typeof t.enabled?t.enabled:k.enabled,this.camera.isOrthographicCamera?(h=this.camera.zoom,this.enableRotation=!1,this.enablePan=!1,this.maxAltitude=1/0,this.zoomTravelTime="number"==typeof t.zoomTravelTime?t.zoomTravelTime:k.zoomTravelTime):(this.enableRotation=void 0===t.enableRotation?k.enableRotation:t.enableRotation,this.rotateSpeed=t.rotateSpeed||k.rotateSpeed,this.enablePan=void 0===t.enablePan?k.enablePan:t.enablePan,this.minPanSpeed=t.minPanSpeed||k.minPanSpeed,this.maxPanSpeed=t.maxPanSpeed||k.maxPanSpeed,this.maxAltitude=t.maxAltitude||k.maxAltitude,this.zoomTravelTime=t.zoomTravelTime||k.zoomTravelTime),t.zoomInFactor&&(console.warn("Controls zoomInFactor parameter is deprecated. Use zoomFactor instead."),t.zoomFactor=t.zoomFactor||t.zoomInFactor),t.zoomOutFactor&&(console.warn("Controls zoomOutFactor parameter is deprecated. Use zoomFactor instead."),t.zoomFactor=t.zoomFactor||t.zoomInFactor||1/t.zoomOutFactor),0===t.zoomFactor&&(console.warn("Controls zoomFactor parameter can not be equal to 0. Its value will be set to default."),t.zoomFactor=k.zoomFactor),this.zoomInFactor=t.zoomFactor||k.zoomFactor,this.zoomOutFactor=1/(t.zoomFactor||k.zoomFactor),this.maxResolution=t.maxResolution||k.maxResolution,this.minResolution=t.minResolution||k.minResolution,this.groundLevel=t.groundLevel||k.groundLevel,this.autoTravelTimeMin=t.autoTravelTimeMin||k.autoTravelTimeMin,this.autoTravelTimeMax=t.autoTravelTimeMax||k.autoTravelTimeMax,this.autoTravelTimeDist=t.autoTravelTimeDist||k.autoTravelTimeDist,t.smartZoomHeightMin&&(console.warn("Controls smartZoomHeightMin parameter is deprecated. Use smartTravelHeightMin instead."),t.smartTravelHeightMin=t.smartTravelHeightMin||t.smartZoomHeightMin),t.smartZoomHeightMax&&(console.warn("Controls smartZoomHeightMax parameter is deprecated. Use smartTravelHeightMax instead."),t.smartTravelHeightMax=t.smartTravelHeightMax||t.smartZoomHeightMax),this.smartTravelHeightMin=t.smartTravelHeightMin||k.smartTravelHeightMin,this.smartTravelHeightMax=t.smartTravelHeightMax||k.smartTravelHeightMax,this.instantTravel=t.instantTravel||k.instantTravel,this.minZenithAngle=(t.minZenithAngle||k.minZenithAngle)*Math.PI/180,this.maxZenithAngle=(t.maxZenithAngle||k.maxZenithAngle)*Math.PI/180,t.focusOnMouseOver&&console.warn("Planar controls 'focusOnMouseOver' optional parameter has been removed."),t.focusOnMouseClick&&console.warn("Planar controls 'focusOnMouseClick' optional parameter has been removed."),this.handleCollision=void 0===t.handleCollision?k.handleCollision:t.handleCollision,this.minDistanceCollision=k.minDistanceCollision,this.enableSmartTravel=void 0===t.enableSmartTravel?k.enableSmartTravel:t.enableSmartTravel,c.copy(this.camera.position),u.copy(this.camera.quaternion),this.state=p,this.cursor=f,this.view.controls&&(console.warn("Deprecated use of PlanarControls. See examples to correct PlanarControls implementation."),this.view.controls.dispose()),this.view.controls=this,this._handlerOnKeyDown=this.onKeyDown.bind(this),this._handlerOnMouseDown=this.onMouseDown.bind(this),this._handlerOnMouseUp=this.onMouseUp.bind(this),this._handlerOnMouseMove=this.onMouseMove.bind(this),this._handlerOnMouseWheel=this.onMouseWheel.bind(this),this._handlerContextMenu=this.onContextMenu.bind(this),this._handlerUpdate=this.update.bind(this),this.view.addFrameRequester(i.n7.AFTER_CAMERA_UPDATE,this._handlerUpdate),this.addInputListeners()}dispose(){this.removeInputListeners(),this.view.removeFrameRequester(i.n7.AFTER_CAMERA_UPDATE,this._handlerUpdate)}update(e,t){t&&(e=16);const r=this.state!==p;switch(this.state){case 3:this.handleTravel(e),this.view.notifyChange(this.camera);break;case 4:this.handleZoomOrtho(e),this.view.notifyChange(this.camera);break;case 0:this.handleDragMovement(),this.view.notifyChange(this.camera);break;case 2:this.handleRotation(),this.view.notifyChange(this.camera);break;case 1:this.handlePanMovement(),this.view.notifyChange(this.camera)}this.handleCollision&&this.view.camera.adjustAltitudeToAvoidCollisionWithLayer(this.view,this.view.tileLayer,this.minDistanceCollision),r&&this.view.dispatchEvent({type:z.MOVED}),y.set(0,0)}initiateDrag(){this.state=0,v.copy(this.getWorldPointAtScreenXY(g)),_.set(0,0,0)}handleDragMovement(){this.getWorldPointFromMathPlaneAtScreenXY(g,v.z,x),_.subVectors(v,x),this.camera.position.add(_),_.set(0,0,0)}initiatePan(){this.state=1}handlePanMovement(){E.set(-y.x,y.y,0),this.camera.localToWorld(E),this.camera.position.copy(E)}initiateRotation(){this.state=2,b.copy(this.getWorldPointAtScreenXY(new n.Vector2(.5*this.view.mainLoop.gfxEngine.width,.5*this.view.mainLoop.gfxEngine.height)));const e=this.camera.position.distanceTo(b);w=Math.acos((this.camera.position.z-b.z)/e)}handleRotation(){const e=-this.rotateSpeed*y.x/this.view.mainLoop.gfxEngine.width,t=-this.rotateSpeed*y.y/this.view.mainLoop.gfxEngine.height,r=this.camera.position.clone().sub(b);0===e&&0===t||(w+t>=this.minZenithAngle&&w+t<=this.maxZenithAngle&&0!==t&&(w+=t,E.set(0,0,1),M.setFromUnitVectors(this.camera.up,E),r.applyQuaternion(M),E.setFromMatrixColumn(this.camera.matrix,0),M.setFromAxisAngle(E,t),r.applyQuaternion(M),E.set(0,0,1),M.setFromUnitVectors(this.camera.up,E).invert(),r.applyQuaternion(M)),0!==e&&(E.set(0,0,1),M.setFromAxisAngle(E,e),r.applyQuaternion(M))),this.camera.position.copy(r),this.camera.lookAt(m),this.camera.position.add(b),this.camera.updateMatrixWorld()}initiateZoom(e){const t=-e.deltaY;d.copy(this.getWorldPointAtScreenXY(g));const r=new n.Vector3;if(t>0||t<0&&this.maxAltitude>this.camera.position.z){const e=t>0?this.zoomInFactor:this.zoomOutFactor,n=this.view.getPixelsToMeters()/e;if(this.maxResolution>n||n>this.minResolution)return;this.camera.isOrthographicCamera?(this.state=4,this.view.notifyChange(this.camera),O=this.camera.zoom,N=O*e,d.z=this.camera.position.z,B=0,P=this.zoomTravelTime,this.updateMouseCursorType()):(r.lerpVectors(this.camera.position,d,1-1/e),this.initiateTravel(r,this.zoomTravelTime,null,!1))}}handleZoomOrtho(e){B=Math.min(B+e/1e3/P,1);const t=O+B*(N-O);this.camera.zoom!==t&&(this.camera.zoom=t,this.camera.updateProjectionMatrix(),this.view.viewToNormalizedCoords(g,E),E.z=0,E.unproject(this.camera),this.camera.position.x+=d.x-E.x,this.camera.position.y+=d.y-E.y,this.camera.updateMatrixWorld(!0)),this.testAnimationEnd()}initiateSmartTravel(){const e=this.getWorldPointAtScreenXY(g),t=new n.Vector3;t.copy(e).sub(this.camera.position),t.z=0,t.normalize();const r=this.camera.position.distanceTo(e),i=n.MathUtils.lerp(this.smartTravelHeightMin,this.smartTravelHeightMax,Math.min(r/5e3,1)),s=new n.Vector3;s.copy(e),this.enableRotation&&s.add(t.multiplyScalar(2*-i)),s.z=e.z+i,this.camera.isOrthographicCamera&&(O=this.camera.zoom,N=O*(1+Math.min(r/5e3,1)),s.z=this.camera.position.z),this.initiateTravel(s,"auto",e,!0)}initiateTravel(e,t,r,i){if(this.state=3,this.view.notifyChange(this.camera),B=0,this.updateMouseCursorType(),L=this.enableRotation&&r&&(r.isQuaternion||r.isVector3),D=i,T.copy(this.camera.position),I.copy(this.camera.quaternion),L&&(r.isQuaternion?R.copy(r):r.isVector3&&(e===r?(this.camera.lookAt(r),R.copy(this.camera.quaternion),this.camera.quaternion.copy(I)):(this.camera.position.copy(e),this.camera.lookAt(r),R.copy(this.camera.quaternion),this.camera.quaternion.copy(I),this.camera.position.copy(T)))),C.copy(e),this.instantTravel)P=0;else if("auto"===t){const t=Math.min(1,e.distanceTo(this.camera.position)/this.autoTravelTimeDist);if(P=n.MathUtils.lerp(this.autoTravelTimeMin,this.autoTravelTimeMax,t),L){const e=.5-.5*R.normalize().dot(this.camera.quaternion.normalize());P*=1+2*e,P=Math.min(P,this.autoTravelTimeMax)}}else P=t}handleTravel(e){B=Math.min(B+e/1e3/P,1);const t=D?this.smooth(B):B;this.camera.position.lerpVectors(T,C,t);const r=O+t*(N-O);this.camera.isOrthographicCamera&&this.camera.zoom!==r&&(this.camera.zoom=r,this.camera.updateProjectionMatrix()),!0===L&&this.camera.quaternion.slerpQuaternions(I,R,t),this.testAnimationEnd()}testAnimationEnd(){1===B&&(this.state=p,this.updateMouseCursorType())}goToTopView(){const e=new n.Vector3,t=new n.Quaternion;e.copy(this.getWorldPointAtScreenXY(new n.Vector2(.5*this.view.mainLoop.gfxEngine.width,.5*this.view.mainLoop.gfxEngine.height))),e.z+=Math.min(this.maxAltitude,this.camera.position.distanceTo(e)),t.setFromAxisAngle(new n.Vector3(1,0,0),0),this.initiateTravel(e,"auto",t,!0)}goToStartView(){this.camera.isOrthographicCamera&&(O=this.camera.zoom,N=h),this.initiateTravel(c,"auto",u,!0)}getWorldPointFromMathPlaneAtScreenXY(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new n.Vector3;return S.copy(this.view.viewToNormalizedCoords(e)),U.setFromCamera(S,this.camera),F.constant=t,U.ray.intersectPlane(F,r),r}getWorldPointAtScreenXY(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Vector3;return this.view.getPickingPositionFromDepth(e,t)||this.getWorldPointFromMathPlaneAtScreenXY(e,this.groundLevel,t),t}addInputListeners(){this.view.domElement.addEventListener("keydown",this._handlerOnKeyDown,!1),this.view.domElement.addEventListener("mousedown",this._handlerOnMouseDown,!1),this.view.domElement.addEventListener("mouseup",this._handlerOnMouseUp,!1),this.view.domElement.addEventListener("mouseleave",this._handlerOnMouseUp,!1),this.view.domElement.addEventListener("mousemove",this._handlerOnMouseMove,!1),this.view.domElement.addEventListener("wheel",this._handlerOnMouseWheel,!1),this.view.domElement.addEventListener("contextmenu",this._handlerContextMenu,!1)}removeInputListeners(){this.view.domElement.removeEventListener("keydown",this._handlerOnKeyDown,!0),this.view.domElement.removeEventListener("mousedown",this._handlerOnMouseDown,!1),this.view.domElement.removeEventListener("mouseup",this._handlerOnMouseUp,!1),this.view.domElement.removeEventListener("mouseleave",this._handlerOnMouseUp,!1),this.view.domElement.removeEventListener("mousemove",this._handlerOnMouseMove,!1),this.view.domElement.removeEventListener("wheel",this._handlerOnMouseWheel,!1),this.view.domElement.removeEventListener("contextmenu",this._handlerContextMenu,!1)}updateMouseCursorType(){switch(this.state){case p:this.view.domElement.style.cursor=this.cursor.default;break;case 0:this.view.domElement.style.cursor=this.cursor.drag;break;case 1:this.view.domElement.style.cursor=this.cursor.pan;break;case 3:this.view.domElement.style.cursor=this.cursor.travel;break;case 4:this.view.domElement.style.cursor=this.cursor.ortho_zoom;break;case 2:this.view.domElement.style.cursor=this.cursor.rotate}}updateMousePositionAndDelta(e){this.view.eventToViewCoords(e,g),y.copy(g).sub(A),A.copy(g)}setCursor(e,t){this.cursor[e]=t,this.updateMouseCursorType()}onMouseDown(e){if(this.enabled&&(e.preventDefault(),this.view.domElement.focus(),p===this.state)){if(l=e.button,this.updateMousePositionAndDelta(e),s===e.button)if(e.ctrlKey){if(!this.enableRotation)return;this.initiateRotation()}else this.initiateDrag();else if(o===e.button){if(!this.enableSmartTravel)return;this.initiateSmartTravel()}else if(a===e.button){if(!this.enablePan)return;this.initiatePan()}this.updateMouseCursorType()}}onMouseUp(e){e.preventDefault(),3!==this.state&&4!==this.state&&l===e.button&&(this.state=p),this.updateMouseCursorType()}onMouseMove(e){this.enabled&&(e.preventDefault(),this.updateMousePositionAndDelta(e),p!==this.state&&this.view.notifyChange())}onKeyDown(e){if(p===this.state&&this.enabled)switch(e.keyCode){case 84:this.camera.isOrthographicCamera||this.goToTopView();break;case 89:this.goToStartView();break;case 32:this.enableSmartTravel&&this.initiateSmartTravel(e)}}onMouseWheel(e){this.enabled&&(e.preventDefault(),e.stopPropagation(),p===this.state&&this.initiateZoom(e))}onContextMenu(e){e.preventDefault()}smooth(e){return(e**2*(3-2*e))**1.2}}const Q=G},34993:(e,t,r)=>{"use strict";r.d(t,{A:()=>h});var n=r(39437);const i={BYTE:1,UNSIGNED_BYTE:1,SHORT:2,UNSIGNED_SHORT:2,INT:4,UNSIGNED_INT:4,FLOAT:4,DOUBLE:8},s={BYTE:Int8Array,UNSIGNED_BYTE:Uint8Array,SHORT:Int16Array,UNSIGNED_SHORT:Uint16Array,INT:Int32Array,UNSIGNED_INT:Uint32Array,FLOAT:Float32Array,DOUBLE:Float64Array},o={SCALAR:1,VEC2:2,VEC3:3,VEC4:4},a={VEC2:n.Vector2,VEC3:n.Vector3,VEC4:n.Vector4},l=function(e,t,r,n,l){if(!e)throw new Error("Buffer is mandatory to parse binary property.");if(null==t)throw new Error("batchLength is mandatory to parse binary property.");if(null==r)throw new Error("byteOffset is mandatory to parse binary property.");if(!i[n])throw new Error(`Uknown component type: ${n}. Cannot access binary property.`);if(!o[l])throw new Error(`Uknown type: ${l}. Cannot access binary property.`);const c=o[l],u=new s[n](e,r,t*c);if("SCALAR"===l)return Array.from(u);{const e=[];for(let t=0;t<=u.length-c;t+=c){const r=new a[l];r.fromArray(u,t),e.push(r)}return e}};var c=r(25847);const u=new TextDecoder,h=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new ArrayBuffer,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4?arguments[4]:void 0;4!==arguments.length||"object"!=typeof n||Array.isArray(n)||null===n||console.warn("You most likely used a deprecated constructor of C3DTBatchTable."),t+r!==e.byteLength&&console.error("3DTiles batch table json length and binary length are not consistent with total buffer length. The batch table may be wrong."),this.type=c.A.batchtable,this.batchLength=n;const s=e.slice(0,t),o=u.decode(new Uint8Array(s)),a=""===o?null:JSON.parse(o);if(r>0){const n=e.slice(t,t+r);for(const e in a){if(!Object.prototype.hasOwnProperty.call(a,e))continue;const t=a[e];Array.isArray(t)||(void 0!==t?.byteOffset&&void 0!==t?.componentType&&void 0!==t?.type?a[e]=l(n,this.batchLength,t.byteOffset,t.componentType,t.type):console.error("Invalid 3D Tiles batch table property that is neither a JSON array nor a valid accessor to a binary body"))}}a&&a.extensions&&(this.extensions=i.parseExtensions(a.extensions,this.type),delete a.extensions),this.content=a}getInfoById(e){if(e<0&&e{"use strict";r.d(t,{A:()=>g});var n=r(39437),i=r(96027),s=r(52404),o=r(25847);const a=new i.A,l=new n.Vector3,c=new n.Vector3,u=new s.A("EPSG:4326"),h=new n.Vector3,d=new s.A("EPSG:4326"),p=new n.Vector3,f=new n.Vector3,m=new n.Vector3,g=class{constructor(e,t,r){if(this.type=o.A.boundingVolume,e.region)this.initialVolumeType=o.h.region,this.volume=function(e,t){const r=e[2],i=e[0],s=e[1],o=e[3],l=e[4],c=e[5],m=n.MathUtils.radToDeg(r),g=n.MathUtils.radToDeg(i),A=n.MathUtils.radToDeg(s),y=n.MathUtils.radToDeg(o);d.setFromValues(g,y,l),a.cartographicToCartesian(d,p),u.setFromValues(m,A,c),a.cartographicToCartesian(u,h);const v=new n.Vector3;v.lerpVectors(p,h,.5);const x=f.subVectors(p,h).length()/2,_=new n.Sphere(v,x);return _.applyMatrix4(t),_}(e.region,t);else if(e.box)this.initialVolumeType=o.h.box,this.volume=function(e){c.set(e[0],e[1],e[2]),l.set(e[3],e[7],e[11]).multiplyScalar(2);const t=new n.Box3;return t.setFromCenterAndSize(c,l),t}(e.box);else{if(!e.sphere)throw new Error(`Unknown bounding volume type: ${e}. 3D Tiles nodes must have a bounding volume of type\n region, box or sphere.`);this.initialVolumeType=o.h.sphere,this.volume=function(e){const t=new n.Vector3;return t.set(e[0],e[1],e[2]),new n.Sphere(t,e[3])}(e.sphere)}e.extensions&&(this.extensions=r.parseExtensions(e.extensions,this.type))}boundingVolumeCulling(e,t){if(this.initialVolumeType===o.h.box)return!e.isBox3Visible(this.volume,t);if(this.initialVolumeType===o.h.sphere||this.initialVolumeType===o.h.region)return!e.isSphereVisible(this.volume,t);throw new Error("Unknown bounding volume type.")}viewerRequestVolumeCulling(e,t){return this.initialVolumeType===o.h.region?(console.warn("Region viewerRequestVolume not yet supported"),!0):this.initialVolumeType===o.h.box?(console.warn("Bounding box viewerRequestVolume not yet supported"),!0):this.initialVolumeType===o.h.sphere&&(m.copy(this.volume.center),m.applyMatrix4(t),!(e.camera3D.position.distanceTo(m)<=this.volume.radius))}}},706:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});const n=class{registerExtension(e,t){this[e]=t}getExtension(e,t){if(this[e]&&this[e][t])return this[e][t];console.error(`No extension manager registered for extension ${e} and for class ${t}`)}isExtensionRegistered(e){return this[e]}parseExtensions(e,t){const r={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=new(this.getExtension(n,t))(e[n]));return r}}},55536:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n=r(39437);function i(e){return e.batchTable?e.batchTable:e.parent?i(e.parent):null}const s=class{#e;constructor(e,t,r,n,i){this.object3d=i,this.batchId=t,this.groups=r,this.userData=n,this.tileId=e,this.#e=null}computeWorldBox3(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new n.Box3;return e.max.x=-1/0,e.max.y=-1/0,e.max.z=-1/0,e.min.x=1/0,e.min.y=1/0,e.min.z=1/0,this.groups.forEach((t=>{const r=t.start*this.object3d.geometry.attributes.position.itemSize,n=(t.start+t.count)*this.object3d.geometry.attributes.position.itemSize;for(let t=r;t{"use strict";r.d(t,{A:()=>n,h:()=>i});const n={tileset:"tileset",batchtable:"batchtable",boundingVolume:"boundingVolume"},i={region:"region",box:"box",sphere:"sphere"}},80264:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(39437),i=r(34422),s=r(25847);const o=new n.Matrix4,a=class{constructor(e,t,r){this.type=s.A.tileset,this.asset=e.asset,this.properties=e.properties,this.geometricError=e.geometricError,this.extensionsUsed=e.extensionsUsed,this.extensionsRequired=e.extensionsRequired,this.tiles=[],this.parseTiles(e.root,t,void 0,r),e.extensions&&(this.extensions=r.parseExtensions(e.extensions,this.type))}parseTiles(e,t,r,s){if(e.transform=e.transform?(new n.Matrix4).fromArray(e.transform):void 0,e._worldFromLocalTransform=e.transform,r&&r._worldFromLocalTransform&&(e.transform?e._worldFromLocalTransform=(new n.Matrix4).multiplyMatrices(r._worldFromLocalTransform,e.transform):e._worldFromLocalTransform=r._worldFromLocalTransform),(e.viewerRequestVolume&&e.viewerRequestVolume.region||e.boundingVolume&&e.boundingVolume.region)&&(e._worldFromLocalTransform?o.copy(e._worldFromLocalTransform).invert():o.identity()),e.viewerRequestVolume=e.viewerRequestVolume?new i.A(e.viewerRequestVolume,o,s):null,e.boundingVolume=e.boundingVolume?new i.A(e.boundingVolume,o,s):null,this.tiles.push(e),e.tileId=this.tiles.length-1,e.baseURL=t,e.children)for(const r of e.children)this.parseTiles(r,t,e,s)}extendTileset(e,t,r,n){this.parseTiles(e.root,r,this.tiles[t],n),this.tiles[t].children=[e.root],this.tiles[t].isTileset=!0}}},47155:(e,t,r)=>{"use strict";r.d(t,{K3:()=>i,bf:()=>a,nt:()=>o,zv:()=>s});var n=r(99234);const i=e=>(e.fx&&(console.warn("ColorLayer fx is deprecated, use ColorLayer.effect_type and ColorLayer.effect_parameter instead."),e.fx>2?(e.effect_parameter=e.fx,e.effect_type=n.Ll.removeLightColor):e.fx>0&&(e.effect_parameter=e.fx,e.effect_type=n.Ll.removeWhiteColor)),e),s=e=>{if(e.crsOut||e.crsIn){console.warn("Parsing options with crsIn and crsOut are deprecated, use { in, out } structure.");const t={in:{},out:{}};return t.in.crs=e.crsIn,t.in.isInverted=e.isInverted,t.in.styles=e.styles,t.in.layers=e.layers,t.in.filter=e.filter,t.out.crs=e.crsOut,t.out.mergeFeatures=e.mergeFeatures,e.withAltitude&&e.withNormal?(console.warn("Parsing options withAltitude and withNormal is deprecated, use out.structure: 2d or 3d."),t.out.structure="3d"):t.out.structure="2d",t.out.filteringExtent=e.filteringExtent,t.out.style=e.style,void 0!==e.crsOut.overrideAltitudeInToZero&&console.error("Parsing options out.overrideAltitudeInToZero is removed, use Style.xxx.base_altitude instead"),t.out.filter=e.filter,t}return e.out&&(void 0===e.out.withAltitude&&void 0===e.out.withNormal||(console.warn("Parsing options out.withAltitude and out.withNormal is deprecated, use out.structure: 2d or 3d."),e.out.withAltitude&&e.out.withNormal?e.out.structure="3d":e.out.structure="2d"),void 0!==e.out.overrideAltitudeInToZero&&console.error("Parsing options out.overrideAltitudeInToZero is removed, use Style.xxx.base_altitude instead")),e},o=e=>{e.color&&console.error("Color convert option is removed, use Style.xxx.color"),e.extrude&&console.error("extrude convert option is removed, use Style.fill.extrusion_height instead"),e.altitude&&console.error("altitude convert option is removed, use Style.xxx.base_altitude instead")},a=e=>{!1===e.isWebGL2&&console.error("WebGL1 support ended in 2.43.0. Falling-back to the WebGL2 renderer.")}},36845:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>m,Xs:()=>u,ZC:()=>_,fj:()=>h});var n=r(39437),i=r(86215),s=r(52404),o=r(48306);function a(e){return new i.A(e,1/0,-1/0,1/0,-1/0)}function l(e,t){e.normals&&t.geodesicNormal.toArray(e.normals,e._pos),e._pushValues(t.x,t.y,t.z)}const c=new s.A("EPSG:4326",0,0,0),u={POINT:0,LINE:1,POLYGON:2};class h{#t;constructor(e){this.indices=[],this.properties={},this.size=e.size,e.extent&&(this.extent=a(e.extent.crs),this.#t=a(e.extent.crs))}startSubGeometry(e,t){const r=this.indices.length-1,n=this.extent?a(this.extent.crs):void 0,i=r>-1?this.indices[r].offset+this.indices[r].count:t.vertices.length/this.size;this.indices.push({offset:i,count:e,extent:n}),this.#t=n,function(e,t){e.vertices.length+=t*e.size,e.normals&&(e.normals.length=e.vertices.length)}(t,e)}closeSubGeometry(e,t){const r=this.indices.length-1,n=r>-1?this.indices[r].offset+this.indices[r].count:t.vertices.length/this.size-e;this.indices.push({offset:n,count:e,extent:this.#t}),this.extent&&(this.extent.union(this.#t),this.#t=a(this.extent.crs))}getLastSubGeometry(){const e=this.indices.length-1;return this.indices[e]}pushCoordinates(e,t){if(e.isCoordinates)return console.warn("Deprecated: change in arguments order, use pushCoordinates(feature, coordIn) instead"),void this.pushCoordinates(t,e);t.as(e.crs,c),e.transformToLocalSystem(c),l(e,c),this.#t&&this.#t.expandByCoordinates(e.useCrsOut?c:t)}pushCoordinatesValues(e,t,r){if((arguments.length<=3?0:arguments.length-3)>0)return console.warn("Deprecated: change in arguments, use pushCoordinatesValues(feature, {x: long, y: lat, normal}, coordProj) instead"),void this.pushCoordinatesValues(e,{x:t,y:r,normal:arguments.length<=3?void 0:arguments[3]},arguments.length<=4?void 0:arguments[4]);l(e,t),this.#t&&this.#t.expandByValuesCoordinates(t.x,t.y)}updateExtent(){if(this.extent){const e=this.indices[this.indices.length-1];e&&this.extent.union(e.extent)}}}function d(e,t){this.vertices[this._pos++]=e,this.vertices[this._pos++]=t}function p(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.vertices[this._pos++]=e,this.vertices[this._pos++]=t,this.vertices[this._pos++]=r}class f{constructor(e,t){if(!Object.keys(u).find((t=>u[t]===e)))throw new Error(`Unsupported Feature type: ${e}`);this.type=e,this.geometries=[],this.vertices=[],this.crs=t.crs,this.size=t.size,this.normals="EPSG:4978"==t.crs?[]:void 0,this.hasRawElevationData=!1,this.transformToLocalSystem=t.transformToLocalSystem.bind(t),t.extent&&(this.extent=a(t.extent.crs),this.useCrsOut=this.extent.crs==this.crs),this._pos=0,this._pushValues=(3===this.size?p:d).bind(this),this.style=o.Ay.setFromProperties}bindNewGeometry(){const e=new h(this);return this.geometries.push(e),e}updateExtent(e){this.extent&&this.extent.union(e.extent)}get geometryCount(){return this.geometries.length}}const m=f,g=()=>{},A=(e,t)=>(e.geodesicNormal.applyNormalMatrix(t.normalMatrixInverse),e.applyMatrix4(t.matrixWorldInverse)),y=(e,t)=>e.applyMatrix4(t.matrixWorldInverse),v=new n.Vector3(0,0,1),x=new n.Quaternion;class _ extends n.Object3D{#r=(()=>y)();#n=(()=>g)();constructor(e){super(),this.isFeatureCollection=!0,this.crs=e.accurate||!e.source?.crs?e.crs:e.source.crs,this.features=[],this.mergeFeatures=void 0===e.mergeFeatures||e.mergeFeatures,this.size="3d"==e.structure?3:2,this.filterExtent=e.filterExtent,this.style=e.style,this.isInverted=!1,this.matrixWorldInverse=new n.Matrix4,this.center=new s.A("EPSG:4326",0,0),2==this.size?(this.extent=!1===e.buildExtent?void 0:a(e.forcedExtentCrs||this.crs),this.#n=e=>{e.as(this.crs,this.center),this.position.copy(e),this.updateMatrixWorld(),this.#n=g}):(this.extent=e.buildExtent?a(e.forcedExtentCrs||this.crs):void 0,this.#n=e=>{e.as("EPSG:4326",this.center),"EPSG:4978"==this.crs&&(this.quaternion.setFromUnitVectors(v,e.geodesicNormal),x.setFromAxisAngle(v,n.MathUtils.degToRad(90+this.center.longitude)),this.quaternion.multiply(x)),this.position.copy(e),this.updateMatrixWorld(),this.normalMatrix.getNormalMatrix(this.matrix),this.normalMatrixInverse=(new n.Matrix3).copy(this.normalMatrix).invert(),this.#n=g},this.#r=A)}transformToLocalSystem(e){return this.#n(e),this.#r(e,this)}updateExtent(e){if(this.extent){const t=e?[e]:this.features.map((e=>e.extent));for(const e of t)this.extent.union(e)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}removeEmptyFeature(){this.features=this.features.filter((e=>e.geometries.length))}pushFeature(e){this.features.push(e),this.updateExtent(e.extent)}requestFeature(e,t){const r=this.features.find(t);if(r&&this.mergeFeatures)return r;{const t=new f(e,this);return this.features.push(t),t}}requestFeatureByType(e){return this.requestFeature(e,(t=>t.type===e))}requestFeatureById(e,t){return this.requestFeature(t,(t=>t.id===e))}newFeatureByReference(e){const t=new f(e.type,this);return t.extent=e.extent,t.geometries=e.geometries,t.normals=e.normals,t.size=e.size,t.vertices=e.vertices,t._pos=e._pos,this.features.push(t),t}}},52404:(e,t,r)=>{"use strict";r.d(t,{A:()=>f});var n=r(39437),i=r(68721),s=r(86406),o=r(96027);i.A.defs("EPSG:4978","+proj=geocent +datum=WGS84 +units=m +no_defs");const a=new o.A,l={},c=new n.Vector3,u=new n.Vector3;let h,d;class p{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.isCoordinates=!0,s.isValid(e),this.crs=e,this.x=0,this.y=0,this.z=0,this._normal=new n.Vector3,t.length>0?this.setFromArray(t):t.isVector3||t.isCoordinates?this.setFromVector3(t):this.setFromValues(t,r,i),this._normalNeedsUpdate=!0}setCrs(e){s.isValid(e),this.crs=e}setFromValues(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.x=null==e?0:e,this.y=null==t?0:t,this.z=null==r?0:r,this._normalNeedsUpdate=!0,this}setFromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.setFromValues(e[t],e[t+1],e[t+2])}setFromVector3(e){return this.setFromValues(e.x,e.y,e.z)}clone(){return new p(this.crs,this)}copy(e){return this.crs=e.crs,this.setFromVector3(e)}get longitude(){return this.x}get latitude(){return this.y}get altitude(){return this.z}set altitude(e){this.z=e}get geodesicNormal(){return this._normalNeedsUpdate&&(this._normalNeedsUpdate=!1,s.is4326(this.crs)?a.geodeticSurfaceNormalCartographic(this,this._normal):"EPSG:4978"==this.crs?a.geodeticSurfaceNormal(this,this._normal):this._normal.set(0,0,1)),this._normal}toVector3(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:new n.Vector3).copy(this)}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return n.Vector3.prototype.toArray.call(this,e,t)}planarDistanceTo(e){return this.toVector3(c).setZ(0),e.toVector3(u).setZ(0),c.distanceTo(u)}geodeticDistanceTo(e){return this.as("EPSG:4326",h),e.as("EPSG:4326",d),a.geodesicDistance(h,d)}spatialEuclideanDistanceTo(e){return this.as("EPSG:4978",h).toVector3(c),e.as("EPSG:4978",d).toVector3(u),c.distanceTo(u)}applyMatrix4(e){return n.Vector3.prototype.applyMatrix4.call(this,e)}as(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new p(e);var r,o;return this.crs==e?t.copy(this):(s.is4326(this.crs)&&"EPSG:3857"==e&&(this.y=n.MathUtils.clamp(this.y,-89.999999,89.999999)),t.setFromArray((r=this.crs,o=e,l[r]||(l[r]={}),l[r][o]||(l[r][o]=(0,i.A)(r,o)),l[r][o]).forward([this.x,this.y,this.z]))),t.crs=e,t}}h=new p("EPSG:4326",0,0,0),d=new p("EPSG:4326",0,0,0);const f=p},86215:(e,t,r)=>{"use strict";r.d(t,{A:()=>v});var n=r(39437),i=r(86406),s=r(52404);const o=new n.Vector2,a=new n.Vector2,l=new n.Box3,c=new n.Vector2(2,2),u=new s.A("EPSG:4326",0,0,0),h=new s.A("EPSG:4326",0,0,0),d=new s.A("EPSG:4326",0,0,0),p=new n.Vector3,f=new n.Vector3;let m;const g=new Array(8);for(let e=g.length-1;e>=0;e--)g[e]=new s.A("EPSG:4326",0,0,0);const A=new s.A("EPSG:4326",0,0);class y{constructor(e,t,r,n,s){if(i.isGeocentric(e))throw new Error(`${e} is a geocentric projection, it doesn't make sense with a geographical extent`);this.isExtent=!0,this.crs=e,this.west=0,this.east=0,this.south=0,this.north=0,this.set(t,r,n,s)}clone(){return new y(this.crs,this.west,this.east,this.south,this.north)}as(e,t){if(i.isValid(e),t=t||new y("EPSG:4326",[0,0,0,0]),this.crs!=e){const r=this.center(A);g[0].setFromValues(this.west,this.north),g[1].setFromValues(r.x,this.north),g[2].setFromValues(this.east,this.north),g[3].setFromValues(this.east,r.y),g[4].setFromValues(this.east,this.south),g[5].setFromValues(r.x,this.south),g[6].setFromValues(this.west,this.south),g[7].setFromValues(this.west,r.y),t.set(1/0,-1/0,1/0,-1/0);for(let r=0;r0&&void 0!==arguments[0]?arguments[0]:new s.A(this.crs);return this.planarDimensions(o),e.crs=this.crs,e.setFromValues(this.west+.5*o.x,this.south+.5*o.y),e}dimensions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new n.Vector2;return console.warn("Extent.dimensions is deprecated, use planarDimensions, geodeticDimensions or spatialEuclideanDimensions"),e.x=Math.abs(this.east-this.west),e.y=Math.abs(this.north-this.south),e}planarDimensions(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:new n.Vector2).set(Math.abs(this.east-this.west),Math.abs(this.north-this.south))}geodeticDimensions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new n.Vector2;return u.crs=this.crs,h.crs=this.crs,d.crs=this.crs,u.setFromValues(this.west,this.north,0),h.setFromValues(this.west,this.south,0),d.setFromValues(this.east,this.north,0),e.set(u.geodeticDistanceTo(d),u.geodeticDistanceTo(h))}spatialEuclideanDimensions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new n.Vector2;return u.crs=this.crs,h.crs=this.crs,d.crs=this.crs,u.setFromValues(this.west,this.north,0),h.setFromValues(this.west,this.south,0),d.setFromValues(this.east,this.north,0),e.set(u.spatialEuclideanDistanceTo(d),u.spatialEuclideanDistanceTo(h))}isPointInside(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.crs==e.crs?A.copy(e):e.as(this.crs,A),A.x<=this.east+t&&A.x>=this.west-t&&A.y<=this.north+t&&A.y>=this.south-t}isInside(e,t){return e.as(this.crs,m),t=t??i.reasonableEpsilon(this.crs),this.east-m.east<=t&&m.west-this.west<=t&&this.north-m.north<=t&&m.south-this.south<=t}offsetToParent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Vector4;if(this.crs!=e.crs)throw new Error("unsupported mix");e.planarDimensions(o),this.planarDimensions(a);const r=(this.west-e.west)/o.x,i=(e.north-this.north)/o.y,s=a.x/o.x,l=a.y/o.y;return t.set(r,i,s,l)}intersectsExtent(e){return y.intersectsExtent(this,e)}static intersectsExtent(e,t){const r=t.crs==e.crs?t:t.as(e.crs,m);return!(e.west>=r.east||e.east<=r.west||e.south>=r.north||e.north<=r.south)}intersect(e){return this.intersectsExtent(e)?(e.crs!=this.crs&&(e=e.as(this.crs,m)),new y(this.crs,Math.max(this.west,e.west),Math.min(this.east,e.east),Math.max(this.south,e.south),Math.min(this.north,e.north))):new y(this.crs,0,0,0,0)}set(e,t,r,n){if(null==e)throw new Error("No values to set in the extent");return e.isExtent&&(t=e.east,r=e.south,n=e.north,e=e.west),e.isCoordinates?(this.west=e.x,this.east=t.x,this.south=e.y,this.north=t.y):void 0!==e.west?(this.west=e.west,this.east=e.east,this.south=e.south,this.north=e.north):4==e.length?(this.west=e[0],this.east=e[1],this.south=e[2],this.north=e[3]):void 0!==n&&(this.west=e,this.east=t,this.south=r,this.north=n),this}copy(e){return this.crs=e.crs,this.set(e)}union(e){if(e.crs!=this.crs)throw new Error("unsupported union between 2 diff crs");if(this.west===1/0)this.copy(e);else{const t=e.west;tthis.east&&(this.east=r);const n=e.south;nthis.north&&(this.north=i)}}expandByCoordinates(e){const t=e.crs==this.crs?e:e.as(this.crs,A);this.expandByValuesCoordinates(t.x,t.y)}expandByValuesCoordinates(e,t){ethis.east&&(this.east=e),tthis.north&&(this.north=t)}static fromBox3(e,t){return i.isGeocentric(e)&&(e="EPSG:4326",t=l.copy(t),h.crs=e,h.setFromVector3(t.min).as(e,h).toVector3(t.min),d.crs=e,d.setFromVector3(t.max).as(e,d).toVector3(t.max)),new y(e,{west:t.min.x,east:t.max.x,south:t.min.y,north:t.max.y})}toString(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return`${this.east}${e}${this.north}${e}${this.west}${e}${this.south}`}subdivision(){return this.subdivisionByScheme()}subdivisionByScheme(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c;const t=[],r=this.planarDimensions(o).divide(e);for(let n=e.x-1;n>=0;n--)for(let i=e.y-1;i>=0;i--){const e=this.west+n*r.x,s=this.south+i*r.y;t.push(new y(this.crs,e,e+r.x,s,s+r.y))}return t}applyMatrix4(e){if(p.set(this.west,this.south,0).applyMatrix4(e),f.set(this.east,this.north,0).applyMatrix4(e),this.west=p.x,this.east=f.x,this.south=p.y,this.north=f.y,this.west>this.east){const e=this.west;this.west=this.east,this.east=e}if(this.south>this.north){const e=this.south;this.south=this.north,this.north=e}return this}clampSouthNorth(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.south,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.north;return this.south=Math.max(this.south,e),this.north=Math.min(this.north,t),this}clampWestEast(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.west,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.east;return this.west=Math.max(this.west,e),this.east=Math.min(this.east,t),this}clampByExtent(e){return this.clampSouthNorth(e.south,e.north),this.clampWestEast(e.west,e.east)}}m=new y("EPSG:4326",[0,0,0,0]);const v=y},77855:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(39437),i=r(86406);const s=new(r(52404).A)("EPSG:4326"),o=new n.Vector2,a=class{constructor(e,t,r){i.isGeographic(e.crs),this.extent=e,this.step=new n.Vector2(t.x,t.y||t.x),this.dimensions=this.extent.planarDimensions(),this.dataSize=(new n.Vector2).addVectors(this.step,this.dimensions).divide(this.step).round(),this.getData=r}getHeightAtCoordinates(e){return e.as(this.extent.crs,s),o.set((this.dataSize.x-1)*(s.x-this.extent.west)/this.dimensions.x,(this.dataSize.y-1)*(s.y-this.extent.south)/this.dimensions.y),o.x<0||o.x>=this.dataSize.x-1||o.y<0||o.y>=this.dataSize.y-1?0:function(e,t){const r=Math.floor(e.x),n=Math.floor(e.y),i=e.x-r,s=e.y-n;return(1-i)*((1-s)*t(n,r)+s*t(n+1,r))+i*((1-s)*t(n,r+1)+s*t(n+1,r+1))}(o,this.getData)}}},3837:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var n=r(39437),i=r(18590);const s=new(r(52404).A)("EPSG:4326");let o,a="";a=void 0!==document.documentElement.style.transform?"transform":void 0!==document.documentElement.style.webkitTransform?"webkitTransform":void 0!==document.documentElement.style.mozTransform?"mozTransform":void 0!==document.documentElement.style.oTransform?"oTransform":"transform";class l extends n.Object3D{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null==t)throw new Error("coordinates are mandatory to add a Label");arguments.length>3&&console.warn("Deprecated argument sprites in Label constructor. Sprites must be configured in style argument."),super();let n=this.visible;Object.defineProperty(this,"visible",{set(e){e!=n&&(n=e,this.content.style.display=e?"block":"none")},get:()=>n}),this.isLabel=!0,this.coordinates=t,this.projectedPosition={x:0,y:0},this.boundaries={left:0,right:0,top:0,bottom:0},"string"==typeof e?(this.content=document.createElement("div"),this.content.textContent=r.text.field):this.content=e.cloneNode(!0),this.content.classList.add("itowns-label"),this.content.style.userSelect="none",this.content.style.position="absolute",r.isStyle?(this.anchor=r.getTextAnchorPosition(),this.styleOffset=r.text.offset,"string"==typeof e&&(r.text.haloWidth>0&&this.content.classList.add("itowns-stroke-single"),r.applyToHTML(this.content).then((e=>{e&&(this.icon=e)})))):(this.anchor=[0,0],this.styleOffset=[0,0]),this.iconOffset={left:0,right:0,top:0,bottom:0},this.zoom={min:r.zoom&&null!=r.zoom.min?r.zoom.min:2,max:r.zoom&&null!=r.zoom.max?r.zoom.max:24},this.order=r.order||0,this.padding=2}updateProjectedPosition(e,t){const r=Math.round(e),n=Math.round(t);r==this.projectedPosition.x&&n==this.projectedPosition.y||(this.projectedPosition.x=r,this.projectedPosition.y=n,this.boundaries.left=e+this.offset.left-this.padding,this.boundaries.right=e+this.offset.right+this.padding,this.boundaries.top=t+this.offset.top-this.padding,this.boundaries.bottom=t+this.offset.bottom+this.padding,0===this.iconOffset.left&&0===this.iconOffset.right&&0===this.iconOffset.top&&0===this.iconOffset.bottom||(this.boundaries.left=Math.min(this.boundaries.left,e+this.iconOffset.left),this.boundaries.right=Math.max(this.boundaries.right,e+this.iconOffset.right),this.boundaries.top=Math.min(this.boundaries.top,t+this.iconOffset.top),this.boundaries.bottom=Math.max(this.boundaries.bottom,t+this.iconOffset.bottom)))}updateCSSPosition(){this.content.style[a]=`translate(${this.projectedPosition.x+this.offset.left}px, ${this.projectedPosition.y+this.offset.top}px)`,this.icon&&(this.icon.style[a]=`translate(${-this.offset.left}px, ${-this.offset.top}px)`)}initDimensions(){if(!this.offset){o=this.content.getBoundingClientRect();const e=Math.round(o.width),t=Math.round(o.height);this.offset={left:e*this.anchor[0]+this.styleOffset[0],top:t*this.anchor[1]+this.styleOffset[1]},this.offset.right=this.offset.left+e,this.offset.bottom=this.offset.top+t,this.icon&&(o=this.icon.getBoundingClientRect(),this.iconOffset={left:Math.floor(o.x),top:Math.floor(o.y),right:Math.ceil(o.x+o.width),bottom:Math.ceil(o.y+o.height)})}}update3dPosition(e){this.coordinates.as(e,s).toVector3(this.position),this.updateMatrixWorld()}updateElevationFromLayer(e,t){if(0==e.attachedLayers.filter((e=>e.isElevationLayer)).length)return;let r=Math.max(0,i.A.getElevationValueAt(e,this.coordinates,i.A.FAST_READ_Z,t));isNaN(r)&&(r=Math.max(0,i.A.getElevationValueAt(e,this.coordinates,i.A.FAST_READ_Z))),isNaN(r)||r==this.coordinates.z||(this.coordinates.z=r)}updateHorizonCullingPoint(){this.horizonCullingPoint&&this.getWorldPosition(this.horizonCullingPoint)}}const c=l},87196:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>c,Es:()=>i,n7:()=>s});var n=r(39437);const i=0,s={UPDATE_START:"update_start",BEFORE_CAMERA_UPDATE:"before_camera_update",AFTER_CAMERA_UPDATE:"after_camera_update",BEFORE_LAYER_UPDATE:"before_layer_update",AFTER_LAYER_UPDATE:"after_layer_update",BEFORE_RENDER:"before_render",AFTER_RENDER:"after_render",UPDATE_END:"update_end"};function o(e,t,r){if(r)for(const n of r){const r=t.update(e,t,n),i=t.getObjectToUpdateForAttachedLayers(n);if(i)if(i.element)for(const r of t.attachedLayers)r.ready&&(r.update(e,r,i.element,i.parent),r.cache.flush());else if(i.elements)for(let r=0;r{e===t||e.isCamera?(t.info.clear(),r=!0):e.layer===t&&n.add(e)})),r?new Set([t]):n}class l extends n.EventDispatcher{#i=!1;#s=!0;#o=0;constructor(e,t){super(),this.renderingState=i,this.scheduler=e,this.gfxEngine=t}scheduleViewUpdate(e,t){this.#i|=t,1!==this.renderingState&&(this.renderingState=1,this.gfxEngine.renderer.xr.isPresenting||requestAnimationFrame((t=>{this.step(e,t)})))}#a(e,t,r){const n={camera:e.camera,engine:this.gfxEngine,scheduler:this.scheduler,view:e};t.forEach((e=>{const r=e.layer||e;r.isLayer&&r.parent&&t.add(r.parent)}));for(const i of e.getLayers(((e,t)=>!t)))if(n.geometryLayer=i,i.ready&&i.visible&&!i.frozen){e.execFrameRequesters(s.BEFORE_LAYER_UPDATE,r,this.#s,i);const l=a(t,i);if(l.size>0){for(const e of i.attachedLayers)e.ready&&e.preUpdate&&e.preUpdate(n,l);const e=i.preUpdate(n,l);o(n,i,e),i.postUpdate(n,i,t)}i.cache.flush(),e.execFrameRequesters(s.AFTER_LAYER_UPDATE,r,this.#s,i)}}step(e,t){const r=t-this.#o;e._executeFrameRequestersRemovals(),e.execFrameRequesters(s.UPDATE_START,r,this.#s);const n=this.#i;this.#o=t,this.#i=!1,this.renderingState=i;const o=new Set(e._changeSources);e._changeSources.clear();const a=this.gfxEngine.getWindowSize();e.execFrameRequesters(s.BEFORE_CAMERA_UPDATE,r,this.#s),e.camera.update(a.x,a.y),e.execFrameRequesters(s.AFTER_CAMERA_UPDATE,r,this.#s);const l=e.camera3D.matrixAutoUpdate;e.camera3D.matrixAutoUpdate=!1,this.#a(e,o,r),0==this.scheduler.commandsWaitingExecutionCount()&&this.dispatchEvent({type:"command-queue-empty"}),n&&this.#l(e,r),this.#s=this.renderingState===i,e.camera3D.matrixAutoUpdate=l,e.execFrameRequesters(s.UPDATE_END,r,this.#s)}#l(e,t){e.execFrameRequesters(s.BEFORE_RENDER,t,this.#s),e.render?e.render():this.gfxEngine.renderView(e),e.execFrameRequesters(s.AFTER_RENDER,t,this.#s)}}const c=l},96027:(e,t,r)=>{"use strict";r.d(t,{A:()=>l,Q:()=>o});var n=r(39437),i=r(68721),s=r(52404);const o=new n.Vector3(i.A.WGS84.a,i.A.WGS84.a,i.A.WGS84.b),a=new n.Vector3,l=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o;this.size=new n.Vector3,this._radiiSquared=new n.Vector3,this._invRadiiSquared=new n.Vector3,this.eccentricity=0,this.setSize(e)}geodeticSurfaceNormal(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Vector3;return e.toVector3(t).multiply(this._invRadiiSquared).normalize()}geodeticSurfaceNormalCartographic(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Vector3;const r=n.MathUtils.degToRad(e.longitude),i=n.MathUtils.degToRad(e.latitude),s=Math.cos(i);return t.set(s*Math.cos(r),s*Math.sin(r),Math.sin(i))}setSize(e){this.size.set(e.x,e.y,e.z),this._radiiSquared.multiplyVectors(e,e),this._invRadiiSquared.x=0==e.x?0:1/this._radiiSquared.x,this._invRadiiSquared.y=0==e.y?0:1/this._radiiSquared.y,this._invRadiiSquared.z=0==e.z?0:1/this._radiiSquared.z,this.eccentricity=Math.sqrt(this._radiiSquared.x-this._radiiSquared.z)/this.size.x}cartographicToCartesian(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Vector3;a.copy(e.geodesicNormal),t.multiplyVectors(this._radiiSquared,a);const r=Math.sqrt(a.dot(t));return t.divideScalar(r),a.multiplyScalar(e.altitude),t.add(a)}cartesianToCartographic(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new s.A("EPSG:4326",0,0,0);const r=Math.sqrt(e.x*e.x+e.y*e.y+e.z*e.z),i=this.size.x,o=this.size.z,a=Math.abs((i*i-o*o)/(i*i)),l=1-Math.sqrt(1-a),c=Math.sqrt(e.x*e.x+e.y*e.y),u=Math.atan2(e.y,e.x),h=Math.atan(e.z/c*(1-l+a*i/r)),d=Math.sin(h),p=Math.cos(h),f=Math.atan((e.z*(1-l)+a*i*d*d*d)/((1-l)*(c-a*i*p*p*p))),m=c*Math.cos(f)+e.z*Math.sin(f)-i*Math.sqrt(1-a*Math.sin(f)*Math.sin(f));return t.setFromValues(n.MathUtils.radToDeg(u),n.MathUtils.radToDeg(f),m)}cartographicToCartesianArray(e){const t=[];for(let r=0;r{"use strict";r.d(t,{A:()=>g});var n=r(39437),i=r(12980),s=r(99234),o=r(52404);const a=new n.Vector4;function l(e,t){let r;for(let n=0;n<=e;n++){const e=n*n;for(let i=-n;i<=n;i++){const s=i*i;for(let o=-n;o<=n;o++){const n=s+o*o;if(!(n>e||n<=r||!1!==t(i,o)))return}}r=e}}function c(e){return e.layer?e.layer:e.parent?c(e.parent):void 0}const u=new n.Raycaster,h=new n.Vector2,d=new n.Vector3,p=new o.A("EPSG:4978"),f=new n.Vector3,m=new o.A("EPSG:4978"),g={pickTilesAt(e,t,r,o){let c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const u=function(e,t,r){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const c=e.mainLoop.gfxEngine.getWindowSize();r=r||new n.Vector2(Math.floor(c.x/2),Math.floor(c.y/2));const u=t.level0Nodes.map((e=>i.A.push(e,i.A.MODES.ID))),h=e.mainLoop.gfxEngine.renderViewToBuffer({camera:e.camera,scene:t.object3d},{x:r.x-o,y:r.y-o,width:1+2*o,height:1+2*o});u.forEach((e=>e()));const d=[];return l(o,((e,t)=>{const r=4*(2*t*o+e),n=h.slice(r,r+4||void 0);a.fromArray(n).divideScalar(255);const i=(0,s.RN)(a,256**3),l=Math.round(i);d.includes(l)||d.push(l)})),d}(e,o,t,r),h=e=>{u.includes(e.id)&&e.isTileMesh&&c.push({object:e,layer:o})};for(const e of o.level0Nodes)e.traverse(h);return c},pickPointsAt(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];if(!n.root)return;n.object3d.traverse((e=>{e.isPoints&&e.baseId&&e.material.enablePicking(!0)}));const s=e.mainLoop.gfxEngine.renderViewToBuffer({camera:e.camera,scene:n.object3d},{x:t.x-r,y:t.y-r,width:1+2*r,height:1+2*r}),o=[];return l(r,((e,t)=>{const n=4*(2*t*r+e),i=s.slice(n,n+4),a={objId:i[0]<<8|i[1],index:i[2]<<8|i[3]};for(let e=0;e{if(t.isPoints&&t.baseId){t.material.enablePicking(!1);for(let r=0;r4&&void 0!==arguments[4]?arguments[4]:[];if(e.viewToNormalizedCoords(t,h),r<0){u.setFromCamera(h,e.camera3D);const t=u.intersectObject(i,!0);for(const e of t)e.layer=c(e.object),s.push(e);return s}const o={x:t.x-r,y:t.y-r,width:1+2*r,height:1+2*r},a=e.mainLoop.gfxEngine.renderViewToBuffer({scene:i,camera:e.camera},o),d=new n.Color;e.mainLoop.gfxEngine.renderer.getClearColor(d);const p=Math.round(255*d.r),f=Math.round(255*d.g),m=Math.round(255*d.b),g=h.clone();return l(r,((t,n)=>{const o=4*((n+r)*(2*r+1)+(t+r)),l=a[o],d=a[o+1],A=a[o+2];if(Math.abs(p-l)<=1&&Math.abs(f-d)<=1&&Math.abs(m-A)<=1)return;g.setX(h.x+t/e.camera.width).setY(h.y+n/e.camera.height),u.setFromCamera(g,e.camera3D);const y=u.intersectObject(i,!0);for(const e of y)e.layer=c(e.object),s.push(e);return 0==s.length})),s}}},4660:(e,t,r)=>{"use strict";r.d(t,{A:()=>p});var n=r(39437),i=r(76932),s=r(96027),o=r(48150),a=r(28611);const l=new n.Matrix4,c=new n.Vector3;let u=0;const h=new n.Vector3;class d extends i.A{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{minSubdivisionLevel:i=2,maxSubdivisionLevel:c=19,...u}=r,h=o.fm.get("EPSG:4326"),d=o.af.get("EPSG:4326").subdivisionByScheme(h),p=["EPSG:4326","EPSG:3857"],f=p.length,m=new a.r({uvCount:f});super(e,t||new n.Group,d,m,{tileMatrixSets:p,...u}),this.isGlobeLayer=!0,this.options.defaultPickingRadius=5,this.minSubdivisionLevel=i,this.maxSubdivisionLevel=c,this.extent=this.schemeTile[0].clone();for(let e=1;e0:u{"use strict";r.d(t,{S:()=>I,A:()=>B});var n=r(39437),i=r(84354),s=r(98211),o=r(52404),a=r(4660),l=r(80736),c=r(96027);const u={getSunPosition(){const e=Math,t=e.PI,r=e.sin,n=e.cos,i=e.tan,s=e.asin,o=e.atan2,a=t/180,l=23.4397*a;function c(e,t,s){return o(r(e),n(e)*r(t)-i(s)*n(t))}function u(e,t,i){return s(r(t)*r(i)+n(t)*n(i)*n(e))}return function(e,h,d){const p=a*h,f=function(e){return function(e){return e.valueOf()/864e5-.5+2440588}(e)-2451545}(e),m=function(e){return a*(357.5291+.98560028*e)}(f),g=function(e){return a*(1.9148*r(e)+.02*r(2*e)+3e-4*r(3*e))}(m),A=function(e,r){return e+r+102.9372*a+t}(m,g),y=(v=A,s(r(0)*n(l)+n(0)*r(l)*r(v)));var v;const x=function(e){return o(r(e)*n(l)-i(0)*r(l),n(e))}(A),_=function(e,t){return a*(280.16+360.9856235*e)-t}(f,a*-d),b=_-x;return{EclipticLongitude:A,declinaison:y,ascension:x,H:b,SiderealTime:_,altitude:u(b,p,y),azimuth:c(b,p,y)+t/2}}},getSunPositionInScene(e,t,r){const n=864e5,i=u.getSunPosition()(e,t,r).ascension+e%n/n*-360+180;return new o.A("EPSG:4326",i,t,5e7).as("EPSG:4978").toVector3()}},h=u,d={uniforms:{luminance:{type:"f",value:1},turbidity:{type:"f",value:2},reileigh:{type:"f",value:1},mieCoefficient:{type:"f",value:.005},mieDirectionalG:{type:"f",value:.8},v3LightPosition:{type:"v3",value:new n.Vector3},up:{type:"v3",value:new n.Vector3(0,1,0)}},vertexShader:["varying vec3 vWorldPosition;","void main() {","vec4 worldPosition = modelMatrix * vec4( cameraPosition + position, 1.0 );","vWorldPosition = worldPosition.xyz;","gl_Position = projectionMatrix * modelViewMatrix * vec4( cameraPosition + position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D skySampler;","uniform vec3 v3LightPosition;","uniform vec3 up;","varying vec3 vWorldPosition;","// uniform sampler2D sDiffuse;","// const float turbidity = 10.0; //","// const float reileigh = 2.; //","// const float luminance = 1.0; //","// const float mieCoefficient = 0.005;","// const float mieDirectionalG = 0.8;","uniform float luminance;","uniform float turbidity;","uniform float reileigh;","uniform float mieCoefficient;","uniform float mieDirectionalG;","// constants for atmospheric scattering","const float e = 2.71828182845904523536028747135266249775724709369995957;","const float pi = 3.141592653589793238462643383279502884197169;","const float n = 1.0003; // refractive index of air","const float N = 2.545E25; // number of molecules per unit volume for air at","// 288.15K and 1013mb (sea level -45 celsius)","const float pn = 0.035; // depolatization factor for standard air","// wavelength of used primaries, according to preetham","const vec3 lambda = vec3(680E-9, 550E-9, 450E-9);","// mie stuff","// K coefficient for the primaries","const vec3 K = vec3(0.686, 0.678, 0.666);","const float v = 4.0;","// optical length at zenith for molecules","const float rayleighZenithLength = 8.4E3;","const float mieZenithLength = 1.25E3;","const float EE = 1000.0;","const float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324;","// 66 arc seconds -> degrees, and the cosine of that","// earth shadow hack","const float cutoffAngle = pi/1.95;","const float steepness = 1.5;","vec3 totalRayleigh(vec3 lambda)","{","return (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));","}","// A simplied version of the total Reayleigh scattering to works on browsers that use ANGLE","vec3 simplifiedRayleigh()","{","return 0.0005 / vec3(94, 40, 18);","}","float rayleighPhase(float cosTheta)","{ ","return (3.0 / (16.0*pi)) * (1.0 + pow(cosTheta, 2.0));","// return (1.0 / (3.0*pi)) * (1.0 + pow(cosTheta, 2.0));","// return (3.0 / 4.0) * (1.0 + pow(cosTheta, 2.0));","}","vec3 totalMie(vec3 lambda, vec3 K, float T)","{","float c = (0.2 * T ) * 10E-18;","return 0.434 * c * pi * pow((2.0 * pi) / lambda, vec3(v - 2.0)) * K;","}","float hgPhase(float cosTheta, float g)","{","return (1.0 / (4.0*pi)) * ((1.0 - pow(g, 2.0)) / pow(1.0 - 2.0*g*cosTheta + pow(g, 2.0), 1.5));","}","float sunIntensity(float zenithAngleCos)","{","return EE * max(0.0, 1.0 - exp(-((cutoffAngle - acos(zenithAngleCos))/steepness)));","}","// float logLuminance(vec3 c)","// {","// return log(c.r * 0.2126 + c.g * 0.7152 + c.b * 0.0722);","// }","// Filmic ToneMapping http://filmicgames.com/archives/75","float A = 0.15;","float B = 0.50;","float C = 0.10;","float D = 0.20;","float E = 0.02;","float F = 0.30;","float W = 1000.0;","vec3 Uncharted2Tonemap(vec3 x)","{","return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;","}","void main() ","{","vec3 up2 = normalize(cameraPosition.xyz);","float sunfade = 1.0-clamp(1.0-exp((v3LightPosition.y/450000.0)),0.0,1.0);","float reileighCoefficient = reileigh - (1.0* (1.0-sunfade));","vec3 sunDirection = normalize(v3LightPosition);","float sunE = sunIntensity(dot(sunDirection, up2));","// extinction (absorbtion + out scattering) ","// rayleigh coefficients","vec3 betaR = simplifiedRayleigh() * reileighCoefficient;","// mie coefficients","vec3 betaM = totalMie(lambda, K, turbidity) * mieCoefficient;","// optical length","// cutoff angle at 90 to avoid singularity in next formula.","float zenithAngle = acos(max(0.0, dot(up2, normalize(vWorldPosition - cameraPosition))));","float sR = rayleighZenithLength / (cos(zenithAngle) + 0.15 * pow(93.885 - ((zenithAngle * 180.0) / pi), -1.253));","float sM = mieZenithLength / (cos(zenithAngle) + 0.15 * pow(93.885 - ((zenithAngle * 180.0) / pi), -1.253));","// combined extinction factor","vec3 Fex = exp(-(betaR * sR + betaM * sM));","// in scattering","float cosTheta = dot(normalize(vWorldPosition - cameraPosition), sunDirection);","float rPhase = rayleighPhase(cosTheta*0.5+0.5);","vec3 betaRTheta = betaR * rPhase;","float mPhase = hgPhase(cosTheta, mieDirectionalG);","vec3 betaMTheta = betaM * mPhase;","vec3 Lin = pow(sunE * ((betaRTheta + betaMTheta) / (betaR + betaM)) * (1.0 - Fex),vec3(1.5));","Lin *= mix(vec3(1.0),pow(sunE * ((betaRTheta + betaMTheta) / (betaR + betaM)) * Fex,vec3(1.0/2.0)),clamp(pow(1.0-dot(up2, sunDirection),5.0),0.0,1.0));","//nightsky","vec3 direction = normalize(vWorldPosition - cameraPosition);","float theta = acos(direction.y); // elevation --\x3e y-axis, [-pi/2, pi/2]","float phi = atan(direction.z, direction.x); // azimuth --\x3e x-axis [-pi/2, pi/2]","vec2 uv = vec2(phi, theta) / vec2(2.0*pi, pi) + vec2(0.5, 0.0);","// vec3 L0 = texture2D(skySampler, uv).rgb+0.1 * Fex;","vec3 L0 = vec3(0.1) * Fex;","// composition + solar disc","//if (cosTheta > sunAngularDiameterCos)","float sundisk = smoothstep(sunAngularDiameterCos,sunAngularDiameterCos+0.00002,cosTheta);","// if (normalize(vWorldPosition - cameraPosition).y>0.0)","L0 += (sunE * 19000.0 * Fex)*sundisk;","vec3 whiteScale = 1.0/Uncharted2Tonemap(vec3(W));","vec3 texColor = (Lin+L0); ","texColor *= 0.04 ;","texColor += vec3(0.0,0.001,0.0025)*0.3;","float g_fMaxLuminance = 1.0;","float fLumScaled = 0.1 / luminance; ","float fLumCompressed = (fLumScaled * (1.0 + (fLumScaled / (g_fMaxLuminance * g_fMaxLuminance)))) / (1.0 + fLumScaled); ","float ExposureBias = fLumCompressed;","vec3 curr = Uncharted2Tonemap((log2(2.0/pow(luminance,4.0)))*texColor);","vec3 color = curr*whiteScale;","vec3 retColor = pow(color,vec3(1.0/(1.2+(1.2*sunfade))));","gl_FragColor.rgb = retColor;","gl_FragColor.a = 1. - ( (length(cameraPosition) - 6400000.) / 1000.);","}"].join("\n")};class p extends n.Mesh{constructor(){const e=n.UniformsUtils.clone(d.uniforms),t=new n.ShaderMaterial({fragmentShader:d.fragmentShader,vertexShader:d.vertexShader,uniforms:e,side:n.BackSide,transparent:!0,depthWrite:!1});super(new n.SphereGeometry(4e4,32,15),t)}}const f=p,m="#include \n\nuniform int atmoIN;\nvarying float intensity;\n\nvec4 glowColor = vec4(0.45, 0.74, 1. ,1.0);\n\nvoid main() {\n #include \n gl_FragColor = glowColor * intensity;\n}\n\n",g="#include \n#include \n\nuniform int atmoIN;\nvarying float intensity;\n\nvoid main()\n{\n vec3 normalES = normalize( normalMatrix * normal );\n vec3 normalCAMES = normalize( normalMatrix * cameraPosition );\n\n if(atmoIN == 0) {\n intensity = pow(0.666 - dot(normalES, normalCAMES), 4. );\n } else {\n intensity = pow( 1. - dot(normalES, normalCAMES), 0.8 );\n }\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n #include \n}\n\n\n",A=new n.Vector3(1,0,0),y=new n.Vector3,v=new o.A("EPSG:4326"),x=new o.A("EPSG:4326"),_=new n.Color(9688568),b=new n.Color,w=new n.Color(197896),E=6e5,M=160*c.Q.x;class S extends l.A{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"atmosphere",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.source=!1,super(e,new n.Object3D,t),this.isAtmosphere=!0;const r=new n.ShaderMaterial({uniforms:{atmoIN:{type:"i",value:0},screenSize:{type:"v2",value:new n.Vector2(window.innerWidth,window.innerHeight)}},vertexShader:g,fragmentShader:m,side:n.BackSide,blending:n.AdditiveBlending,transparent:!0,wireframe:!1}),i=new n.SphereGeometry(1,64,64),s=new n.Mesh(i,r);s.scale.copy(c.Q).multiplyScalar(1.14),this.basicAtmosphere=new n.Object3D,this.realisticAtmosphere=new n.Object3D,this.realisticAtmosphere.visible=!1,this.object3d.add(this.basicAtmosphere),this.object3d.add(this.realisticAtmosphere),this.basicAtmosphere.add(s);const o=new n.ShaderMaterial({uniforms:{atmoIN:{type:"i",value:1},screenSize:{type:"v2",value:new n.Vector2(window.innerWidth,window.innerHeight)}},vertexShader:g,fragmentShader:m,side:n.FrontSide,blending:n.AdditiveBlending,transparent:!0,depthWrite:!1}),a=new n.Mesh(i,o);a.scale.copy(c.Q).multiplyScalar(1.002),this.basicAtmosphere.add(a),this.realisticLightingPosition={x:-.5,y:0,z:1},this.fog={enable:!0,distance:M},this.realisticAtmosphereInitParams=t.Kr?t:{Kr:.0025,Km:.0015,ESun:20,g:-.95,innerRadius:64e5,outerRadius:67e5,wavelength:[.65,.57,.475],scaleDepth:.25},this.object3d.updateMatrixWorld()}update(e,t,r){r.material.fogDistance=this.fog.distance,r.material.lightingEnabled=this.realisticAtmosphere.visible,r.material.lightPosition=this.realisticLightingPosition}preUpdate(e){const t=e.view.camera3D.position;if(this.fog.enable){y.setFromMatrixPosition(e.view.tileLayer.object3d.matrixWorld);const r=y.distanceTo(t);this.fog.distance=M*(.25*(r-.99*c.Q.x)/c.Q.x)**1.5}else this.fog.distance=1e11;const r=e.view.mainLoop.gfxEngine.renderer;v.crs=e.view.referenceCrs,v.setFromVector3(t).as("EPSG:4326",x);const n=x.altitude;ne.material.uniforms.v3LightPosition.value.copy(this.realisticLightingPosition)))),this.basicAtmosphere.visible=!e,this.realisticAtmosphere.visible=e}}const C=S;var T=r(10733);const I={GLOBE_INITIALIZED:i.G.INITIALIZED,LAYER_ADDED:i.G.LAYER_ADDED,LAYER_REMOVED:i.G.LAYER_REMOVED,COLOR_LAYERS_ORDER_CHANGED:i.G.COLOR_LAYERS_ORDER_CHANGED};class R extends i.A{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n.Object3D.DEFAULT_UP.set(0,0,1),super("EPSG:4978",e,r),this.isGlobeView=!0,this.camera3D.near=Math.max(15,2352e-9*c.Q.x),this.camera3D.far=10*c.Q.x;const i=new a.A("globe",r.object3d,r);this.mainLoop.gfxEngine.label2dRenderer.infoTileLayer=i.info,this.addLayer(i),this.tileLayer=i,t.isExtent||(t.coord=t.coord||new o.A("EPSG:4326",0,0),t.tilt=t.tilt||89.5,t.heading=t.heading||0,t.range=t.range||2*c.Q.x),r.noControls?T.Ay.transformCameraToLookAtTarget(this,this.camera3D,t):(this.controls=new s.A(this,t,r.controls),this.controls.handleCollision=void 0===r.handleCollision||r.handleCollision),this.addLayer(new C("atmosphere",r.atmosphere)),this.camera.resize(e.clientWidth,e.clientHeight)}addLayer(e){if(!e||!e.isLayer)return Promise.reject(new Error("Add Layer type object"));if(e.isColorLayer){if(!this.tileLayer.tileMatrixSets.includes(e.source.crs))return e._reject(`Only ${this.tileLayer.tileMatrixSets} tileMatrixSet are currently supported for color layers`)}else if(e.isElevationLayer&&e.source.crs!==this.tileLayer.tileMatrixSets[0])return e._reject(`Only ${this.tileLayer.tileMatrixSets[0]} tileMatrixSet is currently supported for elevation layers`);return super.addLayer(e,this.tileLayer)}getPixelsToDegrees(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1?arguments[1]:void 0;return this.getMetersToDegrees(this.getPixelsToMeters(e,t))}getPixelsToDegreesFromDistance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.getMetersToDegrees(this.getPixelsToMetersFromDistance(e,t))}getMetersToDegrees(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return n.MathUtils.radToDeg(2*Math.asin(e/(2*c.Q.x)))}}const B=R},78682:(e,t,r)=>{"use strict";r.d(t,{A:()=>d});var n=r(39437),i=r(76932),s=r(48150),o=r(52404),a=r(86215);const l=new n.Quaternion,c=new n.Vector3;class u{constructor(e){e.projection&&(console.warn("PlanarTileBuilder projection parameter is deprecated, use crs instead."),e.crs??=e.projection),this._crs=e.crs,this._transform={coords:new o.A("EPSG:4326",0,0),position:new n.Vector3,normal:new n.Vector3(0,0,1)},this._uvCount=e.uvCount??1}get uvCount(){return this._uvCount}get crs(){return this._crs}prepare(e){const t=e;return t.nbRow=2**(e.level+1),t.coordinates=new o.A(this.crs),t}center(e){return e.center(this._transform.coords),c.set(this._transform.coords.x,this._transform.coords.y,0),c}vertexPosition(e){return this._transform.position.set(e.x,e.y,0),this._transform.position}vertexNormal(){return this._transform.normal}uProject(e,t){return t.west+e*(t.east-t.west)}vProject(e,t){return t.south+e*(t.north-t.south)}computeShareableExtent(e){return{shareableExtent:new a.A(e.crs,{west:0,east:Math.abs(e.west-e.east),south:0,north:Math.abs(e.north-e.south)}),quaternion:l,position:this.center(e).clone()}}}class h extends i.A{constructor(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const{minSubdivisionLevel:o=0,maxSubdivisionLevel:a=5,...l}=i,c=[t.crs];s.af.get(t.crs)||s.af.set(t.crs,t);const h=new u({crs:t.crs});super(e,r||new n.Group,[t],h,{tileMatrixSets:c,...l}),this.isPlanarLayer=!0,this.extent=t,this.minSubdivisionLevel=o,this.maxSubdivisionLevel=a}}const d=h},8917:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var n=r(39437),i=r(84354),s=r(10733),o=r(72682),a=r(78682);class l extends i.A{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n.Object3D.DEFAULT_UP.set(0,0,1),super(t.crs,e,r),this.isPlanarView=!0;const i=t.planarDimensions(),l=Math.max(i.x,i.y);this.camera3D.near=.1,this.camera3D.far=this.camera3D.isOrthographicCamera?2e3:2*l,this.camera3D.updateProjectionMatrix();const c=new a.A("planar",t,r.object3d,r);this.mainLoop.gfxEngine.label2dRenderer.infoTileLayer=c.info,this.addLayer(c);const u=r.placement||{};u.isExtent||(u.coord=u.coord||t.center(),u.tilt=u.tilt||90,u.heading=u.heading||0,u.range=u.range||l),s.Ay.transformCameraToLookAtTarget(this,this.camera3D,u),r.noControls||(this.controls=new o.Ay(this,r.controls)),this.tileLayer=c}addLayer(e){return super.addLayer(e,this.tileLayer)}}const c=l},99487:(e,t,r)=>{"use strict";let n;r.d(t,{A:()=>s,W:()=>i});const i={INFINITE:1/0,TEXTURE:9e5,GEOMETRY:9e5},s=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.INFINITE;this.lifeTime=e,this.lastTimeFlush=Date.now(),this.data=new Map}getByArray(e){return this.get(e[0],e[1],e[2])}setByArray(e,t){return this.set(e,t[0],t[1],t[2])}get(e,t,r){const i=this.data.get(e);if(null!=i){if(null!=i.lastTimeUsed)n=i;else{const e=i.get(t);if(null==e)return;if(null!=e.lastTimeUsed)n=e;else{const t=e.get(r);if(null==t)return;n=t}}return n.value?(n.lastTimeUsed=Date.now(),n.value):void 0}}set(e,t,r,i){if(n={value:e,lastTimeUsed:Date.now()},null==r)return this.data.set(t,n),e;this.data.get(t)||this.data.set(t,new Map);const s=this.data.get(t);return null==i?(s.set(r,n),e):(s.get(r)||s.set(r,new Map),s.get(r).set(i,n),e)}delete(e,t,r){const n=this.data.get(e);if(void 0!==n)if(null!=n.lastTimeUsed)this.data.get(e),this.data.delete(e);else{const i=n.get(t);if(void 0===i)return;if(null!=i.lastTimeUsed)n.get(t),n.delete(t),0==n.size&&this.data.delete(e);else{if(void 0===i.get(r))return;i.get(r),i.delete(r),0==i.size&&(n.delete(t),0==n.size&&this.data.delete(e))}}}clear(){this.data.clear()}flush(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();this.lifeTime==i.INFINITE||this.lifeTime>e-this.lastTimeFlush||!this.data.size||(this.lastTimeFlush=1/0,this.data.forEach(((t,r)=>{this.lifeTime{this.lifeTime{this.lifeTime{"use strict";r.d(t,{J:()=>w,Ay:()=>S,Jn:()=>g});var n=r(36845),i=r(99487),s=r(7794),o=r(67373),a=r(39437);function l(e){let t,r,n,i=e.r||e[0]/255,s=e.g||e[1]/255,o=e.b||e[2]/255;return i=i>.04045?((i+.055)/1.055)**2.4:i/12.92,s=s>.04045?((s+.055)/1.055)**2.4:s/12.92,o=o>.04045?((o+.055)/1.055)**2.4:o/12.92,t=(.4124*i+.3576*s+.1805*o)/.95047,r=(.2126*i+.7152*s+.0722*o)/1,n=(.0193*i+.1192*s+.9505*o)/1.08883,t=t>.008856?t**(1/3):7.787*t+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,[116*r-16,500*(t-r),200*(r-n)]}function c(e,t){const r=l(e),n=l(t),i=r[0]-n[0],s=r[1]-n[1],o=r[2]-n[2],a=Math.sqrt(r[1]*r[1]+r[2]*r[2]),c=a-Math.sqrt(n[1]*n[1]+n[2]*n[2]);let u=s*s+o*o-c*c;u=u<0?0:Math.sqrt(u);const h=i/1,d=c/(1+.045*a),p=u/(1+.015*a),f=h*h+d*d+p*p;return f<0?0:Math.sqrt(f)}var u=r(52404);const h=new i.A,d=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGMatrix(),p=document.createElement("canvas"),f=1/255;function m(e,t){return t?.coordinates?.z||0}function g(e,t){if(e.expression)return e.expression.evaluate(t);if(e.stops){const r=e.stops;e=e.stops[0][1];for(let n=r.length-1;n>=0;n--){const i=r[n];if(t.zoom>=i[0]){e=i[1];break}}}return"string"==typeof e||e instanceof String?e.replace(/\{(.+?)\}/g,((e,r)=>t.properties[r]||"")).trim():e instanceof Function?e(t.properties,t):e}function A(e){if(!e)return{};if(e.stops||e.expression)return{color:e};if("string"==typeof e){const t=e.match(/(?:((hsl|rgb)a? *\(([\d.%]+(?:deg|g?rad|turn)?)[ ,]*([\d.%]+)[ ,]*([\d.%]+)[ ,/]*([\d.%]*)\))|(#((?:[\d\w]{3}){1,2})([\d\w]{1,2})?))/i);if(null===t)return{color:e,opacity:1};if(t[7]){let e=1;return t[9]&&(e=parseInt(1==t[9].length?`${t[9]}${t[9]}`:t[9],16)*f),{color:`#${t[8]}`,opacity:e}}if(t[1])return{color:`${t[2]}(${t[3]},${t[4]},${t[5]})`,opacity:t[6]?Number(t[6]):1}}}function y(e,t){if(null!=e)return o.dn.isExpression(e)?o.dn.createExpression(e,t).value:e}async function v(e){let t=h.get(e,"null");return t||(t=s.A.texture(e,{crossOrigin:"anonymous"}),h.set(t,e,"null")),(await t).image}function x(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{width:e.naturalWidth,height:e.naturalHeight};p.width=t.width,p.height=t.height;const r=p.getContext("2d",{willReadFrequently:!0});return r.drawImage(e,t.x||0,t.y||0,t.width,t.height,0,0,t.width,t.height),r.getImageData(0,0,t.width,t.height)}const _={left:[0,-.5],right:[-1,-.5],top:[-.5,0],bottom:[-.5,-1],"top-right":[-1,0],"bottom-left":[0,-1],"bottom-right":[-1,-1],center:[-.5,-.5],"top-left":[0,0]};function b(e,t,r,n,i){let s;Object.defineProperty(e[t],r,{enumerable:!0,get:()=>{if(null!=s)return s;if(null!=n)return g(n,e.context);const o=e.context.featureStyle?.[t]?.[r];return null!=o?g(o,e.context):i instanceof Function?i(e.context.properties,e.context):i},set:e=>{s=e}})}class w{#c=(()=>new u.A("EPSG:4326",0,0,0))();#u=(()=>new u.A("EPSG:4326",0,0,0))();#h=!0;#d={};#p={};setZoom(e){this.zoom=e}setFeature(e){this.#d=e}setGeometry(e){this.#p=e}setCollection(e){this.collection=e,this.#u.setCrs(e.crs)}setLocalCoordinatesFromArray(e,t){return this.#h=!1,this.#u.setFromArray(e,t)}get properties(){return this.#p.properties}get type(){return this.#d.type}get featureStyle(){let e=this.#d.style;return e instanceof Function&&(e=e(this.properties,this)),e}get coordinates(){return this.#h||(this.#h=!0,this.#c.copy(this.#u).applyMatrix4(this.collection.matrixWorld),"EPSG:4978"!=this.#u.crs)?this.#c:this.#c.as("EPSG:4326",this.#c)}}const E={itowns_stroke_single_before:".itowns-stroke-single:before {\n display: var(--text_stroke_display);\n content: attr(data-before);\n opacity: 1;\n position: absolute;\n -webkit-text-stroke-width: var(--text_stroke_width);\n -webkit-text-stroke-color: var(--text_stroke_color);\n left: 0;\n right: 0;\n bottom: 0;\n top: 0;\n z-index: -1;\n white-space: inherit;\n overflow-wrap: inherit;\n letter-spacing: inherit;\n text-align: inherit;\n padding: inherit;\n font-family: inherit;\n text-transform: inherit;\n max-width: inherit;\n font-size: inherit;\n}\n"},M=document.createElement("style");M.type="text/css",Object.keys(E).forEach((e=>{M.innerHTML+=`${E[e]}\n\n`})),"undefined"!=typeof document&&document.getElementsByTagName("head")[0].appendChild(M);const S=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.isStyle=!0,this.context=new w,this.order=e.order||0,e.zoom=e.zoom||{},e.fill=e.fill||{},e.stroke=e.stroke||{},e.point=e.point||{},e.text=e.text||{},e.icon=e.icon||{},this.zoom={},b(this,"zoom","min",e.zoom.min),b(this,"zoom","max",e.zoom.max),this.fill={},b(this,"fill","color",e.fill.color),b(this,"fill","opacity",e.fill.opacity,1),b(this,"fill","pattern",e.fill.pattern),b(this,"fill","base_altitude",e.fill.base_altitude,m),e.fill.extrusion_height&&b(this,"fill","extrusion_height",e.fill.extrusion_height),this.stroke={},b(this,"stroke","color",e.stroke.color),b(this,"stroke","opacity",e.stroke.opacity,1),b(this,"stroke","width",e.stroke.width,1),b(this,"stroke","dasharray",e.stroke.dasharray,[]),b(this,"stroke","base_altitude",e.stroke.base_altitude,m),this.point={},b(this,"point","color",e.point.color),b(this,"point","line",e.point.line),b(this,"point","opacity",e.point.opacity,1),b(this,"point","radius",e.point.radius,2),b(this,"point","width",e.point.width,0),b(this,"point","base_altitude",e.point.base_altitude,m),e.point.model&&b(this,"point","model",e.point.model),this.text={},b(this,"text","field",e.text.field),b(this,"text","zOrder",e.text.zOrder,"auto"),b(this,"text","color",e.text.color,"#000000"),b(this,"text","anchor",e.text.anchor,"center"),b(this,"text","offset",e.text.offset,[0,0]),b(this,"text","padding",e.text.padding,2),b(this,"text","size",e.text.size,16),b(this,"text","placement",e.text.placement,"point"),b(this,"text","rotation",e.text.rotation,"auto"),b(this,"text","wrap",e.text.wrap,10),b(this,"text","spacing",e.text.spacing,0),b(this,"text","transform",e.text.transform,"none"),b(this,"text","justify",e.text.justify,"center"),b(this,"text","opacity",e.text.opacity,1),b(this,"text","font",e.text.font,["Open Sans Regular","Arial Unicode MS Regular","sans-serif"]),b(this,"text","haloColor",e.text.haloColor,"#000000"),b(this,"text","haloWidth",e.text.haloWidth,0),b(this,"text","haloBlur",e.text.haloBlur,0),this.icon={},b(this,"icon","source",e.icon.source),e.icon.key&&(console.warn("'icon.key' is deprecated: use 'icon.id' instead"),e.icon.id=e.icon.key),b(this,"icon","id",e.icon.id),b(this,"icon","cropValues",e.icon.cropValues),b(this,"icon","anchor",e.icon.anchor,"center"),b(this,"icon","size",e.icon.size,1),b(this,"icon","color",e.icon.color),b(this,"icon","opacity",e.icon.opacity,1)}setContext(e){this.context=e}static setFromProperties(e,t){const r=t.type,i={};if(r===n.Xs.POINT){const t={...void 0!==e.fill&&{color:e.fill},...void 0!==e["fill-opacity"]&&{opacity:e["fill-opacity"]},...void 0!==e.stroke&&{line:e.stroke},...void 0!==e.radius&&{radius:e.radius}};Object.keys(t).length&&(i.point=t);const r={...void 0!==e["label-color"]&&{color:e["label-color"]},...void 0!==e["label-opacity"]&&{opacity:e["label-opacity"]},...void 0!==e["label-size"]&&{size:e["label-size"]}};Object.keys(t).length&&(i.text=r);const n={...void 0!==e.icon&&{source:e.icon},...void 0!==e["icon-scale"]&&{size:e["icon-scale"]},...void 0!==e["icon-opacity"]&&{opacity:e["icon-opacity"]},...void 0!==e["icon-color"]&&{color:e["icon-color"]}};Object.keys(n).length&&(i.icon=n)}else{const t={...void 0!==e.stroke&&{color:e.stroke},...void 0!==e["stroke-width"]&&{width:e["stroke-width"]},...void 0!==e["stroke-opacity"]&&{opacity:e["stroke-opacity"]}};if(Object.keys(t).length&&(i.stroke=t),r!==n.Xs.LINE){const t={...void 0!==e.fill&&{color:e.fill},...void 0!==e["fill-opacity"]&&{opacity:e["fill-opacity"]}};Object.keys(t).length&&(i.fill=t)}}return i}static setFromVectorTileLayer(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i={fill:{},stroke:{},point:{},text:{},icon:{}};if(e.layout=e.layout||{},e.paint=e.paint||{},i.order=r,"fill"===e.type){const{color:r,opacity:n}=A(y(e.paint["fill-color"]||e.paint["fill-pattern"],{type:"color"}));if(i.fill.color=r,i.fill.opacity=y(e.paint["fill-opacity"])||n,e.paint["fill-pattern"])try{i.fill.pattern={id:e.paint["fill-pattern"],source:t.source,cropValues:t[e.paint["fill-pattern"]]}}catch(t){throw t.message=`VTlayer '${e.id}': argument sprites must not be null when using layer.paint['fill-pattern']`,t}if(e.paint["fill-outline-color"]){const{color:t,opacity:r}=A(y(e.paint["fill-outline-color"],{type:"color"}));i.stroke.color=t,i.stroke.opacity=r,i.stroke.width=1,i.stroke.dasharray=[]}}else if("line"===e.type){const t=y(e.paint["line-color"],{type:"color"}),{color:r,opacity:n}=A(t);i.stroke.dasharray=y(e.paint["line-dasharray"]),i.stroke.color=r,i.stroke.lineCap=e.layout["line-cap"],i.stroke.width=y(e.paint["line-width"]),i.stroke.opacity=y(e.paint["line-opacity"])||n}else if("circle"===e.type||n){const{color:t,opacity:r}=A(y(e.paint["circle-color"],{type:"color"}));i.point.color=t,i.point.opacity=r,i.point.radius=y(e.paint["circle-radius"])}else if("symbol"===e.type){i.text.zOrder=y(e.layout["symbol-z-order"]),"auto"==i.text.zOrder?i.text.zOrder=y(e.layout["symbol-sort-key"])||"Y":"viewport-y"==i.text.zOrder?i.text.zOrder="Y":"source"==i.text.zOrder&&(i.text.zOrder=0),i.text.anchor=y(e.layout["text-anchor"]),i.text.offset=y(e.layout["text-offset"]),i.text.padding=y(e.layout["text-padding"]),i.text.size=y(e.layout["text-size"]),i.text.placement=y(e.layout["symbol-placement"]),i.text.rotation=y(e.layout["text-rotation-alignment"]),i.text.field=y(e.layout["text-field"]),i.text.wrap=y(e.layout["text-max-width"]),i.text.spacing=y(e.layout["text-letter-spacing"]),i.text.transform=y(e.layout["text-transform"]),i.text.justify=y(e.layout["text-justify"]);const{color:r,opacity:n}=A(y(e.paint["text-color"],{type:"color"}));i.text.color=r,i.text.opacity=y(e.paint["text-opacity"])||void 0!==n&&n,i.text.font=y(e.layout["text-font"]);const s=y(e.paint["text-halo-color"],{type:"color"});s&&(i.text.haloColor=s.color||s,i.text.haloWidth=y(e.paint["text-halo-width"]),i.text.haloBlur=y(e.paint["text-halo-blur"]));const o=y(e.layout["icon-image"]);if(o)try{if(i.icon.id=o,o.stops){const e={...void 0!==o.base&&{base:o.base},stops:o.stops.map((e=>{let r=t[e[1]];return e[1].includes("{")&&(r=function(n){const i=e[1].replace(/\{(.+?)\}/g,((e,t)=>n[t]||"")).trim();return r=t[i],t[i]}),[e[0],r]}))};i.icon.cropValues=e}else i.icon.cropValues=t[o],o[0].includes("{")&&(i.icon.cropValues=function(e){const r=o.replace(/\{(.+?)\}/g,((t,r)=>e[r]||"")).trim();return i.icon.cropValues=t[r],t[r]});i.icon.source=t.source,i.icon.size=y(e.layout["icon-size"])||1;const{color:r,opacity:n}=A(y(e.paint["icon-color"],{type:"color"}));i.icon.color=r,i.icon.opacity=y(e.paint["icon-opacity"])||void 0!==n&&n}catch(t){throw t.message=`VTlayer '${e.id}': argument sprites must not be null when using layer.layout['icon-image']`,t}}return i.zoom={min:e.minzoom||0,max:e.maxzoom||24},i}applyToCanvasPolygon(e,t,r,n){const i=this.context;this.stroke&&this._applyStrokeToPolygon(e,r,t,i),n&&this.fill&&this._applyFillToPolygon(e,r,t,i)}_applyStrokeToPolygon(e,t,r){e.strokeStyle!==this.stroke.color&&(e.strokeStyle=this.stroke.color);const n=(this.stroke.width||2)*t;e.lineWidth!==n&&(e.lineWidth=n);const i=null==this.stroke.opacity?1:this.stroke.opacity;i!==e.globalAlpha&&"number"==typeof i&&(e.globalAlpha=i),e.lineCap!==this.stroke.lineCap&&(e.lineCap=this.stroke.lineCap),e.setLineDash(this.stroke.dasharray.map((e=>e*t*2))),e.stroke(r)}async _applyFillToPolygon(e,t,r){if(this.fill.pattern){let r=this.fill.pattern;const n=this.fill.pattern.cropValues;this.fill.pattern.source&&(r=await v(this.fill.pattern.source)),x(r,n),e.fillStyle=e.createPattern(p,"repeat"),e.fillStyle.setTransform?e.fillStyle.setTransform(d.scale(t)):console.warn("Raster pattern isn't completely supported on Ie and edge",e.fillStyle)}else e.fillStyle!==this.fill.color&&(e.fillStyle=this.fill.color);this.fill.opacity!==e.globalAlpha&&(e.globalAlpha=this.fill.opacity),e.fill(r)}async applyToHTML(e){if(arguments.length>1&&console.warn("Deprecated argument sprites. Sprites must be configured in style."),e.style.padding=`${this.text.padding}px`,e.style.maxWidth=`${this.text.wrap}em`,e.style.color=this.text.color,this.text.size>0&&(e.style.fontSize=`${this.text.size}px`),e.style.fontFamily=this.text.font.join(","),e.style.textTransform=this.text.transform,e.style.letterSpacing=`${this.text.spacing}em`,e.style.textAlign=this.text.justify,e.style["white-space"]="pre-line",this.text.haloWidth>0&&(e.style.setProperty("--text_stroke_display","block"),e.style.setProperty("--text_stroke_width",`${this.text.haloWidth}px`),e.style.setProperty("--text_stroke_color",this.text.haloColor),e.setAttribute("data-before",e.textContent)),!this.icon.source)return;const t=document.createElement("img"),r=new Promise(((r,n)=>{const i={size:this.icon.size,color:this.icon.color,opacity:this.icon.opacity,anchor:this.icon.anchor};t.onload=()=>r(function(e,t,r){const n=e.cloneNode();switch(n.setAttribute("class","itowns-icon"),n.width=e.width*r.size,n.height=e.height*r.size,n.style.color=r.color,n.style.opacity=r.opacity,n.style.position="absolute",n.style.top="0",n.style.left="0",r.anchor){case"left":n.style.top=-.5*n.height+"px";break;case"right":n.style.top=-.5*n.height+"px",n.style.left=-n.width+"px";break;case"top":n.style.left=-.5*n.width+"px";break;case"bottom":n.style.top=-n.height+"px",n.style.left=-.5*n.width+"px";break;case"bottom-left":n.style.top=-n.height+"px";break;case"bottom-right":n.style.top=-n.height+"px",n.style.left=-n.width+"px";break;case"top-left":break;case"top-right":n.style.left=-n.width+"px";break;default:n.style.top=-.5*n.height+"px",n.style.left=-.5*n.width+"px"}return n.style["z-index"]=-1,t.appendChild(n),n}(t,e,i)),t.onerror=e=>n(e)}));if(this.icon.cropValues||this.icon.color){const e=this.icon.cropValues,r=this.icon.color,n=this.icon.id||this.icon.source,i=function(e,t,r){if(!t)return e;const n=h.get(r,t);if(!n){const n=e.data,i=new a.Color(t),s=new a.Color("white");for(let e=0,t=n.length;e{"use strict";r.d(t,{A:()=>l});let n=!1,i=8,s=4096;function o(e,t,r){const n=e.getContext(),i=n.createShader(t);return n.shaderSource(i,r),n.compileShader(i),i}function a(){return navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes("firefox")}const l={isLogDepthBufferSupported:()=>n,isFirefox:a,getMaxTextureUnitsCount:()=>i,getMaxTextureSize:()=>s,updateCapabilities(e){const t=e.getContext();i=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),s=t.getParameter(t.MAX_TEXTURE_SIZE);const r=t.createProgram(),l=o(e,t.VERTEX_SHADER,"void main() {\n gl_Position = vec4( 0.0, 0.0, 0.0, 1.0 );\n}");let c=`#define SAMPLE ${i}\n`;c+="uniform sampler2D uni[SAMPLE];\nvoid main() {\n gl_FragColor += texture2D(uni[SAMPLE-1], vec2(0));\n}";const u=o(e,t.FRAGMENT_SHADER,c);if(t.attachShader(r,l),t.attachShader(r,u),t.linkProgram(r),!1===t.getProgramParameter(r,t.LINK_STATUS)){if(!(i>16))throw new Error(`The GPU capabilities could not be determined accurately.\n Impossible to link a shader with the Maximum texture units ${i}`);{const e=t.getProgramInfoLog(r);console.warn(`${e}: using a maximum of 16 texture units instead of the reported value (${i})`),a()&&console.warn("It can come from a Mesa/Firefox bug;\n the shader compiles to an error when using more than 16 sampler uniforms,\n see https://bugzilla.mozilla.org/show_bug.cgi?id=777028"),i=16}}t.deleteProgram(r),t.deleteShader(l),t.deleteShader(u),n=e.capabilities.logarithmicDepthBuffer}}},86706:(e,t,r)=>{"use strict";r.d(t,{A:()=>A,m:()=>g});var n=r(39437),i=r(86406),s=r(52404),o=r(86215),a=r(48150);const l=new n.Vector2,c=new n.Vector2,u={row:0,col:0,invDiff:0};function h(e,t){const r=2**(e.zoom-t);return u.invDiff=1/r,u.row=(e.row-e.row%r)*u.invDiff,u.col=(e.col-e.col%r)*u.invDiff,u}const d=new o.A("EPSG:4326",[0,0,0,0]),p=new o.A("EPSG:4326",[0,0,0,0]),f=new s.A("EPSG:4326",0,0);class m{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.isTile=!0,this.crs=e,this.zoom=t,this.row=r,this.col=n}clone(){return new m(this.crs,this.zoom,this.row,this.col)}toExtent(e,t){i.isValid(e),t=t||new o.A("EPSG:4326",[0,0,0,0]);const{epsg:r,globalExtent:n,globalDimension:s}=(0,a.Tz)(this.crs),l=(0,a.nw)(this.crs,this.zoom);return c.set(1,1).divide(l).multiply(s),t.west=n.west+(s.x-c.x*(l.x-this.col)),t.east=t.west+c.x,t.south=n.south+c.y*(l.y-this.row-1),t.north=t.south+c.y,t.crs=r,t.zoom=this.zoom,e==r?t:t.as(e,t)}isInside(e){return this.zoom==e.zoom?this.row==e.row&&this.col==e.col:!(this.zoom1&&void 0!==arguments[1]?arguments[1]:new n.Vector4;if(this.crs!=e.crs)throw new Error("unsupported mix");return h(this,e.zoom),t.set(this.col*u.invDiff-u.col,this.row*u.invDiff-u.row,u.invDiff,u.invDiff)}tiledExtentParent(e){return e&&e0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.zoom=e,this.row=t,this.col=r,this}copy(e){return this.crs=e.crs,this.set(e.zoom,e.row,e.col)}toString(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return`${this.zoom}${e}${this.row}${e}${this.col}`}}function g(e,t){if("EPSG:4326"==e.crs&&"EPSG:3857"==t){const r=[],n=d.copy(e).as(t,p),{globalExtent:i,globalDimension:s,sTs:o}=(0,a.Tz)(t);n.clampByExtent(i),n.planarDimensions(c);const u=e.zoom+1||Math.floor(Math.log2(Math.round(s.x/(c.x*o.x)))),h=(0,a.nw)(t,u),g=n.center(f);l.x=g.x-i.west,l.y=i.north-n.north,l.divide(s).multiply(h).floor();for(let e=Math.ceil((i.north-n.south)/s.x*h.y)-1;e>=l.y;e--)r.push(new m(t,u,e,l.x));return r}{const r=new m(t,0,0,0),{globalExtent:n,globalDimension:i,sTs:s,isInverted:o}=(0,a.Tz)(e.crs),u=e.center(f);e.planarDimensions(c);const h=Math.floor(Math.log2(Math.round(i.x/(c.x*s.x)))),d=(0,a.nw)(t,h);return l.x=u.x-n.west,l.y=o?n.north-u.y:u.y-n.south,l.divide(i).multiply(d).floor(),r.set(h,l.y,l.x),[r]}}const A=m},48150:(e,t,r)=>{"use strict";r.d(t,{Tz:()=>h,af:()=>a,fm:()=>l,nw:()=>d});var n=r(39437),i=r(86215);const s=new n.Vector2,o=new n.Vector2,a=new Map,l=new Map,c=new i.A("EPSG:4326",-180,180,-90,90);a.set("EPSG:4326",c);const u=c.as("EPSG:3857");function h(e){const t=a.get(e),r=t.planarDimensions(o),n=l.get(e)||l.get("default"),i=!e.includes(":NI");return{epsg:e,globalExtent:t,globalDimension:r,sTs:n,isInverted:i}}function d(e,t){const r=l.get(e)||l.get("default"),n=2**t;return s.set(n,n).multiply(r),s}u.clampSouthNorth(u.west,u.east),a.set("EPSG:3857",u),l.set("default",new n.Vector2(1,1)),l.set("EPSG:3857",l.get("default")),l.set("EPSG:4326",new n.Vector2(2,1))},84354:(e,t,r)=>{"use strict";r.d(t,{G:()=>j,A:()=>ne});var n=r(39437),i=r(86406),s=r(93320);var o=r(87196),a=r(2015),l=r(33746),c=r(99234);const u=class{static isWebGL2Available(){try{const e=document.createElement("canvas");return!(!window.WebGL2RenderingContext||!e.getContext("webgl2"))}catch(e){return!1}}static isColorSpaceAvailable(e){try{const t=document.createElement("canvas"),r=window.WebGL2RenderingContext&&t.getContext("webgl2");return r.drawingBufferColorSpace=e,r.drawingBufferColorSpace===e}catch(e){return!1}}static getWebGL2ErrorMessage(){return this.getErrorMessage(2)}static getErrorMessage(e){const t={1:window.WebGLRenderingContext,2:window.WebGL2RenderingContext};let r='Your $0 does not seem to support $1';const n=document.createElement("div");return n.id="webglmessage",n.style.fontFamily="monospace",n.style.fontSize="13px",n.style.fontWeight="normal",n.style.textAlign="center",n.style.background="#fff",n.style.color="#000",n.style.padding="1.5em",n.style.width="400px",n.style.margin="5em auto 0",r=t[e]?r.replace("$0","graphics card"):r.replace("$0","browser"),r=r.replace("$1",{1:"WebGL",2:"WebGL 2"}[e]),n.innerHTML=r,n}static isWebGLAvailable(){console.warn("isWebGLAvailable() has been deprecated and will be removed in r178. Use isWebGL2Available() instead.");try{const e=document.createElement("canvas");return!(!window.WebGLRenderingContext||!e.getContext("webgl")&&!e.getContext("experimental-webgl"))}catch(e){return!1}}static getWebGLErrorMessage(){return console.warn("getWebGLErrorMessage() has been deprecated and will be removed in r178. Use getWebGL2ErrorMessage() instead."),this.getErrorMessage(1)}};var h=r(7296),d=r(47155);const p=new n.Vector4,f=class{constructor(e){let t,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,d.bf)(i),void 0===i.antialias&&(i.antialias=!0),void 0===i.alpha&&(i.alpha=!0),void 0===i.logarithmicDepthBuffer&&(i.logarithmicDepthBuffer=!0),e.domElement?(t=e,r=t.domElement instanceof HTMLDivElement?t.domElement:t.domElement.parentElement):r=e,this.width=r.clientWidth,this.height=r.clientHeight,this.positionBuffer=null,this._nextThreejsLayer=1,this.fullSizeRenderTarget=new n.WebGLRenderTarget(this.width,this.height),this.fullSizeRenderTarget.texture.minFilter=n.LinearFilter,this.fullSizeRenderTarget.texture.magFilter=n.NearestFilter,this.fullSizeRenderTarget.depthBuffer=!0,this.fullSizeRenderTarget.depthTexture=new n.DepthTexture,this.fullSizeRenderTarget.depthTexture.type=n.UnsignedShortType,this.renderView=function(e){this.renderer.clear(),this.renderer.render(e.scene,e.camera3D),e.tileLayer&&this.label2dRenderer.render(e.tileLayer.object3d,e.camera3D)}.bind(this),this.onWindowResize=function(e,t){this.width=e,this.height=t,this.fullSizeRenderTarget.setSize(this.width,this.height),this.renderer.setSize(this.width,this.height),this.label2dRenderer.setSize(this.width,this.height)}.bind(this);try{this.label2dRenderer=new h.A,this.label2dRenderer.setSize(this.width,this.height),r.appendChild(this.label2dRenderer.domElement),this.renderer=t||new n.WebGLRenderer({canvas:document.createElement("canvas"),antialias:i.antialias,alpha:i.alpha,logarithmicDepthBuffer:i.logarithmicDepthBuffer}),this.renderer.domElement.style.position="relative",this.renderer.domElement.style.zIndex=0,this.renderer.domElement.style.top=0}catch(e){throw u.isWebGL2Available()||r.appendChild(u.getErrorMessage(2)),e}-1===this.renderer.domElement.tabIndex&&(this.renderer.domElement.tabIndex=-1),a.A.updateCapabilities(this.renderer),this.renderer.setClearColor(197896),this.renderer.autoClear=!1,this.renderer.sortObjects=!0,this.renderer.debug.checkShaderErrors=!1,t||(this.renderer.setPixelRatio(r.devicePixelRatio),this.renderer.setSize(r.clientWidth,r.clientHeight),r.appendChild(this.renderer.domElement))}getWindowSize(){return new n.Vector2(this.width,this.height)}getRenderer(){return this.renderer}renderViewToBuffer(e,t){return t||(t={x:0,y:0,width:this.width,height:this.height}),t.buffer=t.buffer||new Uint8Array(4*t.width*t.height),this.renderViewToRenderTarget(e,this.fullSizeRenderTarget,t),this.renderer.readRenderTargetPixels(this.fullSizeRenderTarget,t.x,this.height-(t.y+t.height),t.width,t.height,t.buffer),t.buffer}renderViewToRenderTarget(e,t,r){t||(t=this.fullSizeRenderTarget);const n=this.renderer.getRenderTarget();return r&&(this.fullSizeRenderTarget.scissor.set(r.x,t.height-(r.y+r.height),r.width,r.height),this.fullSizeRenderTarget.scissorTest=!0),this.renderer.setRenderTarget(t),this.renderer.clear(!0,!0,!1),this.renderer.render(e.scene,e.camera.camera3D),this.renderer.setRenderTarget(n),this.fullSizeRenderTarget.scissorTest=!1,t}bufferToImage(e,t,r){const n=document.createElement("canvas"),i=n.getContext("2d",{willReadFrequently:!0});n.width=t,n.height=r;const s=i.getImageData(0,0,t,r);s.data.set(e),i.putImageData(s,0,0);const o=new Image;return o.src=n.toDataURL(),o}depthBufferRGBAValueToOrthoZ(e,t){if(p.fromArray(e).divideScalar(255),a.A.isLogDepthBufferSupported()&&"PerspectiveCamera"==t.type)return 2**(2*(0,c.RN)(p)/(2/(Math.log(t.far+1)/Math.LN2)));{let e=(0,c.RN)(p);return e=2*e-1,e}}};var m=r(12980),g=r(52404),A=r(19073),y=r(80061);const v={executeCommand(e){const t=e.layer,r=e.extentsSource,n=e.extentsDestination||r;return Promise.all(r.map(((e,r)=>t.getData(e,n[r]))))}},x=class{constructor(e){this.command=e,this.isCancelledCommandException=!0}toString(){return`Cancelled command ${this.command.requester.id}/${this.command.layer.id}`}},_={executeCommand(e){const t=[],r=e.layer,n=e.requester,i=e.extentsSource;if(n&&!n.material)return Promise.reject(new x(e));for(const e of i)t.push(r.convert(n,e));return Promise.all(t)}};var b=r(55540),w=r(34993);const E=new TextDecoder;var M=r(7794),S=r(70515),C=r(6425),T=r(49423);const I=new TextDecoder;function R(e,t,r){const i=n.LoaderUtils.extractUrlBase(r),s={gltfUpAxis:t.tileset.asset.gltfUpAxis,urlBase:i,overrideMaterials:t.overrideMaterials,doNotPatchMaterial:t.doNotPatchMaterial,registeredExtensions:t.registeredExtensions,layer:t};return b.A.parse(e,s).then((e=>({batchTable:e.batchTable,object3d:e.gltf.scene})))}function B(e,t,r){const i=n.LoaderUtils.extractUrlBase(r);return T.TK.parseAsync(e,i).then((e=>({object3d:e.scene})))}function P(e,t){return function(e,t){if(!e)throw new Error("No array buffer provided.");const r=new DataView(e);let i=0;const s={};let o={},a={};if(s.magic=E.decode(new Uint8Array(e,i,4)),i+=4,s.magic){s.version=r.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT,s.byteLength=r.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT,s.FTJSONLength=r.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT,s.FTBinaryLength=r.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT,s.BTJSONLength=r.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT,s.BTBinaryLength=r.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT;let l={};if(s.FTJSONLength>0){const t=i,r=e.slice(t,s.FTJSONLength+t),n=E.decode(new Uint8Array(r));l=JSON.parse(n)}if(s.FTBinaryLength>0&&(a=function(e,t,r){const i=new n.BufferGeometry,s=E.decode(new Uint8Array(e,t,r)),o=JSON.parse(s);let a;if(o.POINTS_LENGTH&&(a=o.POINTS_LENGTH),o.POSITION){const r=o.POSITION.byteOffset+s.length+t,l=new Float32Array(e,r,3*a);i.setAttribute("position",new n.BufferAttribute(l,3))}if(o.RGB){const r=o.RGB.byteOffset+s.length+t,l=new Uint8Array(e,r,3*a);i.setAttribute("color",new n.BufferAttribute(l,3,!0))}if(o.POSITION_QUANTIZED)throw new Error("For pnts loader, POSITION_QUANTIZED: not yet managed");if(o.RGBA)throw new Error("For pnts loader, RGBA: not yet managed");if(o.RGB565)throw new Error("For pnts loader, RGB565: not yet managed");if(o.NORMAL)throw new Error("For pnts loader, NORMAL: not yet managed");if(o.NORMAL_OCT16P)throw new Error("For pnts loader, NORMAL_OCT16P: not yet managed");if(o.BATCH_ID)throw new Error("For pnts loader, BATCH_ID: not yet managed");return{geometry:i,offset:o.RTC_CENTER?(new n.Vector3).fromArray(o.RTC_CENTER):void 0}}(e,i,s.FTJSONLength)),s.BTJSONLength>0){const r=i+s.FTJSONLength+s.FTBinaryLength,c=e.slice(r,s.BTJSONLength+s.BTBinaryLength+r);o=new w.A(c,s.BTJSONLength,s.BTBinaryLength,l.BATCH_ID&&l.BATCH_LENGTH?l.BATCH_LENGTH:l.POINTS_LENGTH,t),a=function(e,t){if(e.geometry)return t.content&&t.content.Classification&&e.geometry.setAttribute("classification",new n.BufferAttribute(new Uint8Array(t.content.Classification),1)),e}(a,o)}const c={point:a,batchTable:o};return Promise.resolve(c)}throw new Error("Invalid pnts file.")}(e,t.registeredExtensions).then((e=>{const r=t.material?t.material.clone():new C.Ay({size:1,mode:t.pntsMode,shape:t.pntsShape,classificationScheme:t.classification,sizeMode:t.pntsSizeMode,minAttenuatedSize:t.pntsMinAttenuatedSize,maxAttenuatedSize:t.pntsMaxAttenuatedSize});(0,S.A)(r,t);const i=new n.Points(e.point.geometry,r);return e.point.offset&&i.position.copy(e.point.offset),{object3d:i,batchTable:e.batchTable}}))}const L={executeCommand:function(e){const t=e.layer,r=e.metadata,i=new n.Object3D;!function(e,t,r,n){e.frustumCulled=!1,e.layer=t,r.transform&&e.applyMatrix4(r.transform),e.geometricError=r.geometricError,e.tileId=r.tileId,r.refine?e.additiveRefinement="ADD"===r.refine.toUpperCase():e.additiveRefinement=!!n&&n.additiveRefinement,e.viewerRequestVolume=r.viewerRequestVolume,e.boundingVolume=r.boundingVolume,e.updateMatrixWorld()}(i,t,r,e.requester);const s=r.content&&(r.content.url||r.content.uri),o=e=>{e.userData.metadata=r,e.layer=t};if(s){let e=s.startsWith("http")?s:r.baseURL+s;t.source.isC3DTilesGoogleSource&&(e=t.source.getTileUrl(e));const n={b3dm:R,pnts:P,gltf:B};return M.A.arrayBuffer(e,t.source.networkOptions).then((s=>{if(void 0!==s){let a;const l=I.decode(new Uint8Array(s,0,4));if("{"===l[0]){s=JSON.parse(I.decode(new Uint8Array(s)));const n=t.source.isC3DTilesGoogleSource?t.source.baseUrl:e.slice(0,e.lastIndexOf("/")+1);t.tileset.extendTileset(s,r.tileId,n,t.registeredExtensions)}else if("b3dm"==l)a=n.b3dm;else if("pnts"==l)t.hasPnts=!0,a=n.pnts;else{if("glTF"!=l)return Promise.reject(`Unsupported magic code ${l}`);a=n.gltf}if(a)return a(s,t,e).then((e=>(i.content=e.object3d,e.batchTable&&(i.batchTable=e.batchTable),i.add(e.object3d),i.traverse(o),i)))}return i.traverse(o),i}))}return i.traverse(o),Promise.resolve(i)}};var D=r(86215);let O=1;const N={executeCommand(e){const t=e.layer,r=e.requester;return r.load().then((i=>{const s=new n.Points(i,t.material);return function(e){const t=e.geometry.attributes.position.count,r=new Uint8Array(4*t),i=O++;if(t>65535||i>65535)return console.warn("Currently picking is limited to Points with less than 65535 elements and less than 65535 Points instances"),e;for(let e=0;e>24,r[4*e+1]=(16711680&t)>>16,r[4*e+2]=(65280&t)>>8,r[4*e+3]=255&t}e.baseId=i,e.geometry.setAttribute("unique_id",new n.BufferAttribute(r,4,!0))}(s),s.frustumCulled=!1,s.matrixAutoUpdate=!1,s.position.copy(i.userData.origin||r.bbox.min),s.scale.copy(t.scale),s.updateMatrix(),s.tightbbox=i.boundingBox.applyMatrix4(s.matrix),s.layer=t,s.extent=D.A.fromBox3(e.view.referenceCrs,r.bbox),s.userData.node=r,s}))}};var U=r(97709);function F(e,t){const r=t.priority-e.priority;return 0===r?t.timestamp-e.timestamp:r}function k(){return{queue(e){const t=e.layer;let r=this.storages.get(t.id);r||(r={q:new y({comparator:F}),priority:1,accumulator:0},this.storages.set(t.id,r)),r.priority=t.priority||1,r.q.queue(e),this.counters.pending++},storages:new Map,counters:{executing:0,executed:0,failed:0,cancelled:0,pending:0},execute(e,t){return this.counters.pending--,this.counters.executing++,t.executeCommand(e).then((t=>{this.counters.executing--,e.resolve(t),this.counters.executed++}),(t=>{this.counters.executing--,e.reject(t),this.counters.failed++}))}}}function z(){this.defaultQueue=k(),this.hostQueues=new Map,this.providers={},this.maxCommandsPerHost=6,this.initDefaultProviders()}z.prototype.constructor=z,z.prototype.initDefaultProviders=function(){this.addProtocolProvider("tile",_),this.addProtocolProvider("3d-tiles",L),this.addProtocolProvider("pointcloud",N)},z.prototype.runCommand=function(e,t,r){const n=this.getProtocolProvider(e.layer.protocol);if(!n)throw new Error(`No known provider for layer ${e.layer.id}`);t.execute(e,n,r).then((()=>{if(e.view.notifyChange(e.requester,e.redraw),t.counters.executing{e.resolve=t,e.reject=r})),r&&!this.hostQueues.has(r)&&this.hostQueues.set(r,k());const n=r?this.hostQueues.get(r):this.defaultQueue;return e.timestamp=Date.now(),n.queue(e),n.counters.executing{if(n.counters.executing0&&(n+=e.priority,e.accumulator+=e.priority,(!t||e.accumulator>r)&&(t=e,r=e.accumulator))}if(t)return t.accumulator-=n,t.q}(e.storages);for(;t&&t.length>0;){const r=t.dequeue();if(!r.earlyDropFunction||!r.earlyDropFunction(r))return r;e.counters.pending--,e.counters.cancelled++,r.reject(new x(r))}};const G=z;var Q=r(10456),V=r(87070),H=r(32060);const j={LAYERS_INITIALIZED:"layers-initialized",LAYER_REMOVED:"layer-removed",LAYER_ADDED:"layer-added",INITIALIZED:"initialized",COLOR_LAYERS_ORDER_CHANGED:l.x,CAMERA_MOVED:"camera-moved",DISPOSED:"disposed"},q=new n.Vector2,W=new n.Matrix4,Y=new n.Vector2,X=new n.Ray,K=new n.Vector3,$=new n.Vector3,J=new g.A("EPSG:4326"),Z=[];let ee,te=0;class re extends n.EventDispatcher{#f=[];#m=(()=>new Uint8Array(4))();#g;constructor(e,t){let r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)throw new Error("Invalid viewerDiv parameter (must non be null/undefined)");super(),this.domElement=t,this.id=te++,this.referenceCrs=e,r=i.renderer&&i.renderer.domElement?new f(i.renderer):new f(t,i.renderer),this.mainLoop=i.mainLoop||new o.Ay(new G,r),this.scene=i.scene3D||new n.Scene,i.scene3D||(this.scene.matrixWorldAutoUpdate=!1),this.camera=new s.A(this.referenceCrs,this.mainLoop.gfxEngine.getWindowSize().x,this.mainLoop.gfxEngine.getWindowSize().y,i.camera),this._frameRequesters={},this._resizeListener=()=>this.resize(),window.addEventListener("resize",this._resizeListener,!1),this._changeSources=new Set,this._delayedFrameRequesterRemoval=[],this._allLayersAreReadyCallback=()=>{this.getLayers().every((e=>e.ready))&&0==this.mainLoop.scheduler.commandsWaitingExecutionCount()&&this.mainLoop.renderingState==o.Es&&(this.dispatchEvent({type:j.LAYERS_INITIALIZED}),this.removeFrameRequester(o.n7.UPDATE_END,this._allLayersAreReadyCallback))},this.camera.resize(this.domElement.clientWidth,this.domElement.clientHeight);const a=()=>{this.removeEventListener(j.LAYERS_INITIALIZED,a),this.dispatchEvent({type:j.INITIALIZED})};let l;this.addEventListener(j.LAYERS_INITIALIZED,a),this.#g=new Uint8Array(4*this.camera.width*this.camera.height),this.domElement.tabIndex=-1,i.disableFocusOnStart||this.domElement.focus(),this.domElement.addEventListener("mouseup",(e=>{2===e.button&&(l&&e.timeStamp-l<500&&this.domElement.dispatchEvent(new MouseEvent("dblclick-right",e)),l=e.timeStamp)})),Z.push(this),i.webXR&&((e,t)=>{const r=t.scale||1,i=e.mainLoop.gfxEngine.renderer.xr;i.addEventListener("sessionstart",(()=>{const t=e.camera.camera3D,s=n=>{"Escape"===n.key&&(document.removeEventListener("keydown",s),i.enabled=!1,e.camera.camera3D=t,e.scene.scale.multiplyScalar(1/r),e.scene.updateMatrixWorld(),async function(e){e&&await e.end()}(i.getSession()),e.notifyChange(e.camera.camera3D,!0))};e.scene.scale.multiplyScalar(r),e.scene.updateMatrixWorld(),i.enabled=!0,i.getReferenceSpace("local");const o=e.camera.position(),a=(new n.Quaternion).setFromUnitVectors(new n.Vector3(0,0,1),o.geodesicNormal).invert(),l=new n.Quaternion(-1,0,0,1).normalize().multiply(a),c=t.position.clone().multiplyScalar(-r).applyQuaternion(l),u=new XRRigidTransform(c,l),h=i.getReferenceSpace().getOffsetReferenceSpace(u);i.setReferenceSpace(h),e.camera.camera3D=i.getCamera(),e.camera.resize(e.camera.width,e.camera.height),document.addEventListener("keydown",s,!1),i.setAnimationLoop((t=>{i.isPresenting&&e.camera.camera3D.cameras[0]&&(e.camera.camera3D.updateMatrix(),e.camera.camera3D.updateMatrixWorld(!0),e.notifyChange(e.camera.camera3D,!0)),e.mainLoop.step(e,t)}))}))})(this,i.webXR)}get renderer(){return this.mainLoop?.gfxEngine?.getRenderer()}get camera3D(){return this.camera?.camera3D}dispose(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=Z.indexOf(this);if(-1==t)return void console.warn("View already disposed");window.removeEventListener("resize",this._resizeListener),this.controls&&("function"==typeof this.controls.dispose&&this.controls.dispose(),delete this.controls),this.removeAllFrameRequesters();const r=this.getLayers((e=>!e.isTiledGeometryLayer&&!e.isAtmosphere));for(const t of r)this.removeLayer(t.id,e);const n=this.getLayers((e=>e.isAtmosphere));for(const t of n)this.removeLayer(t.id,e);const i=this.getLayers((e=>e.isTiledGeometryLayer));for(const t of i)this.removeLayer(t.id,e);Z.splice(t,1),this.scene.traverse(H.A.cleanup),this.dispatchEvent({type:j.DISPOSED}),this.removeAllEvents()}addLayer(e,t){if(!e||!e.isLayer)return Promise.reject(new Error("Add Layer type object"));if(this.getLayerById(e.id))return e._reject(new Error(`Invalid id '${e.id}': id already used`));if(e=function(e,t,r){const n=t.source;if(r&&!t.extent&&(t.extent=r.extent,n&&!n.extent&&(n.extent=r.extent)),t.isGeometryLayer&&!t.isLabelLayer?t.crs=e.referenceCrs:t.crs||(r&&r.tileMatrixSets&&r.tileMatrixSets.includes(n.crs)?t.crs=n.crs:t.crs=r&&r.extent.crs),t.isLabelLayer)e.mainLoop.gfxEngine.label2dRenderer.registerLayer(t);else if(t.labelEnabled||t.addLabelLayer){t.labelEnabled&&console.info("layer.labelEnabled is deprecated use addLabelLayer, instead of"),t.buildExtent=!0,t.structure="3d";const r=new V.A(`${t.id}-label`,{source:n,style:t.style,zoom:t.zoom,performance:t.addLabelLayer.performance,crs:n.crs,visible:t.visible,margin:15,forceClampToTerrain:t.addLabelLayer.forceClampToTerrain});t.addEventListener("visible-property-changed",(()=>{r.visible=t.visible}));const i=n=>{n.layerId===t.id&&e.removeLayer(r.id),e.removeEventListener(j.LAYER_REMOVED,i)};e.addEventListener(j.LAYER_REMOVED,i),t.whenReady=t.whenReady.then((()=>(e.addLayer(r),t)))}return t.isOGC3DTilesLayer&&t._setup(e),t}(this,e,t),t)if(e.isColorLayer){const r=this.getLayers((e=>e.isColorLayer));if(e.sequence=r.length,!(t.countColorLayersTextures(...r,e)<=(0,c.gL)()))return e._reject(new Error(`Cant add color layer ${e.id}: the maximum layer is reached`));t.attach(e)}else t.attach(e);else{if("function"!=typeof e.update)return e._reject(new Error("Cant add GeometryLayer: missing a update function"));if("function"!=typeof e.preUpdate)return e._reject(new Error("Cant add GeometryLayer: missing a preUpdate function"));this.#f.push(e)}return e.object3d&&!e.object3d.parent&&e.object3d!==this.scene&&this.scene.add(e.object3d),Promise.all(e._promises).then((()=>{e._resolve(),this.notifyChange(t||e,!1),this._frameRequesters[o.n7.UPDATE_END]&&this._frameRequesters[o.n7.UPDATE_END].includes(this._allLayersAreReadyCallback)||this.addFrameRequester(o.n7.UPDATE_END,this._allLayersAreReadyCallback),this.dispatchEvent({type:j.LAYER_ADDED,layerId:e.id})}),e._reject),e.whenReady}removeLayer(e,t){const r=this.getLayerById(e);if(r){const n=r.parent;if(r.delete(t),n&&!n.detach(r))throw new Error(`Error to detach ${e} from ${n.id}`);if(null==n&&this.#f.splice(this.#f.findIndex((t=>t.id==e)),1),r.isColorLayer){const e=this.getLayers((e=>e.isColorLayer));for(const t of e)t.sequence>r.sequence&&t.sequence--}let i=0;for(const e of Z)i+=e.getLayers((e=>e.source.uid==r.source.uid&&e.crs==r.crs)).length;return r.source.onLayerRemoved({unusedCrs:0==i?r.crs:void 0}),this.notifyChange(this.camera),this.dispatchEvent({type:j.LAYER_REMOVED,layerId:e}),!0}throw new Error(`${e} doesn't exist`)}notifyChange(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(this._changeSources.add(e),this.mainLoop.gfxEngine.renderer.xr.isPresenting||!e.isTileMesh&&!e.isCamera||(this.#g.needsUpdate=!0)),this.mainLoop.scheduleViewUpdate(this,t)}getLayers(e){const t=[];for(const r of this.#f)if(e&&!e(r)||t.push(r),r.attachedLayers)for(const n of r.attachedLayers)e&&!e(n,r)||t.push(n);return t}getLayerById(e){return this.getLayers((t=>t.id===e))[0]}addFrameRequester(e,t){if("function"!=typeof t)throw new Error("frameRequester must be a function");this._frameRequesters[e]?this._frameRequesters[e].push(t):this._frameRequesters[e]=[t]}removeFrameRequester(e,t){this._frameRequesters[e].includes(t)?this._delayedFrameRequesterRemoval.push({when:e,frameRequester:t}):console.error("Invalid call to removeFrameRequester: frameRequester isn't registered")}removeAllFrameRequesters(){for(const e in this._frameRequesters)if(Object.prototype.hasOwnProperty.call(this._frameRequesters,e)){const t=this._frameRequesters[e];for(const r of t)this.removeFrameRequester(e,r)}this._executeFrameRequestersRemovals()}removeAllEvents(){if(void 0!==this._listeners){for(const e in this._listeners)Object.prototype.hasOwnProperty.call(this._listeners,e)&&delete this._listeners[e];this._listeners=void 0}}_executeFrameRequestersRemovals(){for(const e of this._delayedFrameRequesterRemoval){const t=this._frameRequesters[e.when].indexOf(e.frameRequester);t>=0?this._frameRequesters[e.when].splice(t,1):console.warn("FrameReq has already been removed")}this._delayedFrameRequesterRemoval.length=0}execFrameRequesters(e,t,r){if(this._frameRequesters[e]){this._delayedFrameRequesterRemoval.length>0&&this._executeFrameRequestersRemovals();for(var n=arguments.length,i=new Array(n>3?n-3:0),s=3;s1&&void 0!==arguments[1]?arguments[1]:q,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=this.domElement.getBoundingClientRect();if(e.touches&&e.touches.length)return t.set(e.touches[r].clientX-n.x,e.touches[r].clientY-n.y);if(void 0!==e.offsetX&&void 0!==e.offsetY){const r=e.target.getBoundingClientRect();return t.set(r.x+e.offsetX-n.x,r.y+e.offsetY-n.y)}}eventToNormalizedCoords(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.viewToNormalizedCoords(this.eventToViewCoords(e,q,t))}viewToNormalizedCoords(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:q;return t.x=e.x/this.camera.width*2-1,t.y=e.y/this.camera.height*-2+1,t}normalizedToViewCoords(e){return q.x=.5*(e.x+1)*this.camera.width,q.y=-.5*(e.y-1)*this.camera.height,q}pickObjectsAt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0;const n=[];if(r&&0!==r.length||(r=this.getLayers((e=>e.isGeometryLayer))),Array.isArray(r)||(r=[r]),r.forEach((e=>{"string"==typeof e&&(e=this.getLayerById(e)),e&&(e.isGeometryLayer||e.isObject3D)&&n.push(e)})),0==n.length)return[];const i=[],s=e instanceof Event?this.eventToViewCoords(e):e;for(const e of n)if(!e.isAtmosphere)if(e.isGeometryLayer){if(!e.ready){console.warn("view.pickObjectAt : layer is not ready : ",e);continue}e.pickObjectsAt(this,s,t,i)}else Q.A.pickObjectsAt(this,s,t,e,i);return i}getScale(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.28;return this.camera3D.isOrthographicCamera?.001*e/this.getPixelsToMeters():this.getScaleFromDistance(e,this.getDistanceFromCamera())}getScaleFromDistance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.28,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;e/=1e3;const r=n.MathUtils.degToRad(this.camera3D.fov);return e*(this.camera.height/(2*t*Math.tan(.5*r)))}getDistanceFromCamera(e){return this.getPickingPositionFromDepth(e,$),this.camera3D.position.distanceTo($)}getPixelsToMeters(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1?arguments[1]:void 0;return this.camera3D.isOrthographicCamera?(ee=(this.camera3D.right-this.camera3D.left)/this.camera3D.zoom,e*ee/this.camera.width):this.getPixelsToMetersFromDistance(e,this.getDistanceFromCamera(t))}getPixelsToMetersFromDistance(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:1)*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1)/this.camera._preSSE}getMetersToPixels(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1?arguments[1]:void 0;return this.camera3D.isOrthographicCamera?(ee=(this.camera3D.right-this.camera3D.left)/this.camera3D.zoom,e*this.camera.width/ee):this.getMetersToPixelsFromDistance(e,this.getDistanceFromCamera(t))}getMetersToPixelsFromDistance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.camera._preSSE*e/t}pickFeaturesAt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;for(var r=arguments.length,n=new Array(r>2?r-2:0),s=2;se.isColorLayer||e.isGeometryLayer)):n).forEach((e=>{"string"==typeof e&&(e=this.getLayerById(e)),e&&e.isLayer&&(a[e.id]=[],e.isColorLayer&&o.push(e.id))}));const l=e instanceof Event?this.eventToViewCoords(e,q):e,c=this.pickObjectsAt(l,t,...n);if(c.length>0&&c.forEach((e=>a[e.layer.id].push(e))),0==o.length)return a;let u;this.getPickingPositionFromDepth(l,$),J.crs=this.referenceCrs,J.setFromVector3($);const h={M:this.getPixelsToMeters(t,l),D:.001*t};this.isPlanarView?h.D=h.M:this.getPixelsToDegrees&&(h.D=this.getMetersToDegrees(h.M));const d=Q.A.pickTilesAt(this,l,t,this.tileLayer);for(const e of d)if(e.object.material)for(const t of e.object.material.getLayers(o))for(const e of t.textures)e.features&&(u=i.isMetricUnit(e.features.crs)?h.M:h.D,A.A.filterFeaturesUnderCoordinate(J,e.features,u).forEach((e=>{a[t.id].find((t=>t.geometry===e.geometry))||a[t.id].push(e)})));return a}readDepthBuffer(e,t,r,n,i){const s=this.mainLoop.gfxEngine,o=this.tileLayer.wireframe,a=this.tileLayer.opacity,l=this.tileLayer.visible;o&&(this.tileLayer.wireframe=!1),a<1&&(this.tileLayer.opacity=1),l||(this.tileLayer.visible=!0);const c=this.tileLayer.level0Nodes.map((e=>m.A.push(e,m.A.MODES.DEPTH)));return i=s.renderViewToBuffer({camera:this.camera,scene:this.tileLayer.object3d},{x:e,y:t,width:r,height:n,buffer:i}),c.forEach((e=>e())),this.tileLayer.wireframe!==o&&(this.tileLayer.wireframe=o),this.tileLayer.opacity!==a&&(this.tileLayer.opacity=a),this.tileLayer.visible!==l&&(this.tileLayer.visible=l),i}getPickingPositionFromDepth(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Vector3;if(!this.tileLayer||0==this.tileLayer.level0Nodes.length||!this.tileLayer.level0Nodes[0])return void(t=void 0);const r=this.mainLoop,i=0==r.scheduler.commandsWaitingExecutionCount()&&r.renderingState==o.Es,s=r.gfxEngine,l=s.getWindowSize();let c;if((e=e||l.clone().multiplyScalar(.5)).x=Math.floor(e.x),e.y=Math.floor(e.y),i){this.#g.needsUpdate&&(this.readDepthBuffer(0,0,l.x,l.y,this.#g),this.#g.needsUpdate=!1);const t=4*((l.y-e.y-1)*l.x+e.x);c=this.#g.slice(t,t+4)}else c=this.readDepthBuffer(e.x,e.y,1,1,this.#m);if(Y.x=e.x/l.x*2-1,Y.y=-e.y/l.y*2+1,a.A.isLogDepthBufferSupported()&&"PerspectiveCamera"==this.camera3D.type){X.origin.copy(this.camera3D.position),X.direction.set(Y.x,Y.y,.5),W.multiplyMatrices(this.camera3D.matrixWorld,W.copy(this.camera3D.projectionMatrix).invert()),X.direction.applyMatrix4(W),X.direction.sub(X.origin),K.set(0,0,1),K.applyMatrix4(W),K.sub(X.origin);const e=K.angleTo(X.direction),r=s.depthBufferRGBAValueToOrthoZ(c,this.camera3D)/Math.cos(e);t.addVectors(this.camera3D.position,X.direction.setLength(r))}else{const e=s.depthBufferRGBAValueToOrthoZ(c,this.camera3D);t.set(Y.x,Y.y,e),t.unproject(this.camera3D)}return t.length()>1e7?void 0:t}pickTerrainCoordinates(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new g.A(this.referenceCrs);return e instanceof Event?this.eventToViewCoords(e):e&&void 0!==e.x&&void 0!==e.y?q.copy(e):q.set(this.mainLoop.gfxEngine.width/2,this.mainLoop.gfxEngine.height/2),this.getPickingPositionFromDepth(q,$),J.crs=this.referenceCrs,J.setFromVector3($),J.as(t.crs,t),t}pickCoordinates(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new g.A(this.referenceCrs);return console.warn("Deprecated, use View#pickTerrainCoordinates instead."),this.pickTerrainCoordinates(e,t)}resize(e,t){e<0||t<0?console.warn(`Trying to resize the View with negative height (${t}) or width (${e}). Skipping resize.`):(null==e&&(e=this.domElement.clientWidth),null==t&&(t=this.domElement.clientHeight),this.#g=new Uint8Array(4*e*t),this.mainLoop.gfxEngine.onWindowResize(e,t),0!==e&&0!==t&&(this.camera.resize(e,t),this.notifyChange(this.camera3D)))}}const ne=re},14333:(e,t,r)=>{"use strict";r.d(t,{A:()=>A,s:()=>d});var n=r(39437),i=r(80736),s=r(48542),o=r(80264),a=r(706),l=r(6425),c=r(48306),u=r(55536),h=r(20620);const d={ON_TILE_CONTENT_LOADED:"on-tile-content-loaded",ON_TILE_REQUESTED:"on-tile-requested"},p=(0,s.oS)();function f(e){let t=e,r=t.tileId;for(;isNaN(r)&&t.parent;)t=t.parent,r=t.tileId;return r}function m(e){return e.geometry&&e.geometry.attributes._BATCHID}class g extends i.A{#A;constructor(e,t,r){console.warn("C3DTilesLayer is deprecated and will be removed in iTowns 3.0 version. Use OGC3DTilesLayer instead."),super(e,new n.Group,{source:t.source}),this.isC3DTilesLayer=!0,this.sseThreshold=t.sseThreshold||16,this.cleanupDelay=t.cleanupDelay||1e3,this.protocol="3d-tiles",this.name=t.name,this.registeredExtensions=t.registeredExtensions||new a.A,this.pntsMode=l.qW.COLOR,this.pntsShape=l.cn.CIRCLE,this.classification=t.classification,this.pntsSizeMode=l.qU.VALUE,this.pntsMinAttenuatedSize=t.pntsMinAttenuatedSize||1,this.pntsMaxAttenuatedSize=t.pntsMaxAttenuatedSize||7,t.pntsMode&&(Object.values(l.qW).includes(t.pntsMode)?this.pntsMode=t.pntsMode:console.warn("The points cloud mode doesn't exist. Use 'COLOR' or 'CLASSIFICATION' instead.")),t.pntsShape&&(Object.values(l.cn).includes(t.pntsShape)?this.pntsShape=t.pntsShape:console.warn("The points cloud point shape doesn't exist. Use 'CIRCLE' or 'SQUARE' instead.")),t.pntsSizeMode&&(Object.values(l.qU).includes(t.pntsSizeMode)?this.pntsSizeMode=t.pntsSizeMode:console.warn("The points cloud size mode doesn't exist. Use 'VALUE' or 'ATTENUATED' instead.")),this._style=t.style||null,this.#A=new Map,this.tilesC3DTileFeatures=new Map,t.onTileContentLoaded&&(console.warn("DEPRECATED onTileContentLoaded should not be passed at the contruction, use C3DTILES_LAYER_EVENTS.ON_TILE_CONTENT_LOADED event instead"),this.addEventListener(d.ON_TILE_CONTENT_LOADED,t.onTileContentLoaded)),t.overrideMaterials&&(console.warn("overrideMaterials is deprecated, use style API instead"),this.overrideMaterials=t.overrideMaterials),this._cleanableTiles=[];const i=this.addInitializationStep();this.source.whenReady.then((e=>{if(this.tileset=new o.A(e,this.source.baseUrl,this.registeredExtensions),this.tileset.extensionsUsed)for(const e of this.tileset.extensionsUsed)this.registeredExtensions.isExtensionRegistered(e)||(this.tileset.extensionsRequired&&this.tileset.extensionsRequired.includes(e)?console.error(`3D Tiles tileset required extension "${e}" must be registered to the 3D Tiles layer of iTowns to be parsed and used.`):console.warn(`3D Tiles tileset used extension "${e}" must be registered to the 3D Tiles layer of iTowns to be parsed and used.`));(0,s.WD)(r,r.mainLoop.scheduler,this,e.root).then(i)}))}preUpdate(e){return s.LM.bind(this)(e)}update(e,t,r){return p(e,t,r)}getObjectToUpdateForAttachedLayers(e){if(e.content){const t=[];e.content.traverse((r=>{r.isObject3D&&r.material&&r.layer==e.layer&&t.push(r)}));const r=e.parent;return r&&r.content?{elements:t,parent:r.content}:{elements:t}}}getC3DTileFeatureFromIntersectsArray(e){let t=null;for(let r=0;r{if(m(t)){const r=t.geometry.getAttribute("_BATCHID");let n=r.getX(0),i=0,s=0;const o=()=>{if(this.tilesC3DTileFeatures.get(e.tileId).has(n))this.tilesC3DTileFeatures.get(e.tileId).get(n).groups.push({start:i,count:s});else{const r=new u.A(e.tileId,n,[{start:i,count:s}],{},t);this.tilesC3DTileFeatures.get(e.tileId).set(n,r)}},a=t.geometry.getAttribute("position"),l=a.count*a.itemSize;for(let e=0;e=l&&o()}}}))}updateStyle(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!this._style)return!1;if(!this.object3d)return!1;const t=[],r=new Map;this.object3d.traverse((t=>{if(m(t)){const n=f(t);if(e&&!e.includes(n))return;r.has(n)||r.set(n,[]),r.get(n).push(t)}}));for(const[e,i]of r){const r=this.tilesC3DTileFeatures.get(e);i.forEach((e=>{e.geometry.clearGroups(),e.material=[];for(const[,t]of r){if(t.object3d!=e)continue;this._style.context.setGeometry({properties:t});const r=new n.Color(this._style.fill.color),i=this._style.fill.opacity,s=r.getHexString()+i;let o=null;this.#A.has(s)?o=this.#A.get(s):(o=new n.MeshStandardMaterial({color:r,opacity:i,transparent:i<1,alphaTest:.09}),this.#A.set(s,o));let a=-1;for(let t=0;t{e.geometry.addGroup(t.start,t.count,a)}))}(0,h.W)(e),e.material instanceof Array?e.material.forEach((e=>{t.includes(e)||t.push(e)})):t.includes(e.material)||t.push(e.material)}))}for(const[e,r]of this.#A)t.includes(r)||(r.dispose(),this.#A.delete(e));return!0}get materialCount(){return this.#A.size}set style(e){e instanceof c.Ay?this._style=e:this._style=e?new c.Ay(e):null,this.updateStyle()}get style(){return this._style}}const A=g},45232:(e,t,r)=>{"use strict";r.d(t,{A:()=>a,h:()=>s});var n=r(61276),i=r(24184);function s(e){return e?.attachedLayers.filter((e=>e.isGeoidLayer))[0]?.visible}class o extends n.A{constructor(e){super(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),this.isGeoidLayer=!0,this.defineLayerProperty("visible",!0)}updateNodeZ(e){e.material.geoidHeight=this.visible?e.geoidHeight:0,e.obb.updateZ({geoidHeight:e.material.geoidHeight})}update(e,t,r,n){if(!n||!r.material)return;const s=r.getExtentsByProjection(t.crs),o=s[0].zoom;if(!(o>t.zoom.max||othis.updateNodeZ(r);t.addEventListener("visible-property-changed",e),r.addEventListener("dispose",(()=>{t.removeEventListener("visible-property-changed",e)}))}if(!t.frozen&&t.visible&&r.material.visible&&r.layerUpdateState[t.id].canTryUpdate())return r.layerUpdateState[t.id].newTry(),this.getData(r.extent,s).then((e=>{r.geoidHeight=e.getHeightAtCoordinates(r.extent.center()),this.updateNodeZ(r),r.layerUpdateState[t.id].noMoreUpdatePossible()}))}}}const a=o},80736:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var n=r(61276),i=r(10456),s=r(99487),o=r(32060);class a extends n.A{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{cacheLifeTime:n=s.W.GEOMETRY,visible:i=!0,opacity:o=1,...a}=r;if(super(e,{...a,cacheLifeTime:n}),this.isGeometryLayer=!0,!t||!t.isObject3D)throw new Error("Missing/Invalid object3d parameter (must be a\n three.js Object3D instance)");"Group"===t.type&&""===t.name&&(t.name=e),this.object3d=t,Object.defineProperty(this,"object3d",{writable:!1,configurable:!0}),this.opacity=o,this.wireframe=!1,this.attachedLayers=[],this.visible=i,Object.defineProperty(this.zoom,"max",{value:1/0,writable:!1}),this.filteringExtent=!this.source.isFileSource,this.structure="3d"}get visible(){return this.object3d.visible}set visible(e){if(this.object3d.visible!==e){const t={type:"visible-property-changed",previous:{},new:{}};t.previous.visible=this.object3d.visible,t.new.visible=e,this.dispatchEvent(t),this.object3d.visible=e}}getObjectToUpdateForAttachedLayers(e){if(e.parent&&e.material)return{element:e,parent:e.parent}}postUpdate(){}culling(){return!0}attach(e){if(!e.update)throw new Error(`Missing 'update' function -> can't attach layer\n ${e.id}`);this.attachedLayers.push(e),e.parent=this}detach(e){const t=this.attachedLayers.length;return this.attachedLayers=this.attachedLayers.filter((t=>t.id!=e.id)),e.parent=void 0,this.attachedLayers.length2&&void 0!==arguments[2]?arguments[2]:this.options.defaultPickingRadius,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return i.A.pickObjectsAt(e,t,r,this.object3d,n)}}const l=a},66924:(e,t,r)=>{"use strict";r.d(t,{A:()=>i,y:()=>s});var n=r(86215);class i{constructor(e){this.layer=e}clear(){}update(){}}class s extends i{constructor(e){super(e),this.displayed={tiles:new Set},Object.defineProperty(this.displayed,"layers",{get:()=>{let e=[];return this.displayed.tiles.forEach((t=>{const r=t.material;e=[...new Set([...e,...r.colorLayerIds.filter((e=>r.getLayer(e))),...r.elevationLayerIds])]})),this.layer.attachedLayers.filter((t=>e.includes(t.id)))}}),Object.defineProperty(this.displayed,"extent",{get:()=>{const e=new n.A(this.layer.extent.crs,1/0,-1/0,1/0,-1/0);return e.min=1/0,e.max=-1/0,this.displayed.tiles.forEach((t=>{e.union(t.extent),e.min=Math.min(t.obb.z.min,e.min),e.max=Math.max(t.obb.z.max,e.max)})),e}})}clear(){this.displayed.tiles.clear()}update(e){e.material.visible?this.displayed.tiles.add(e):this.displayed.tiles.delete(e)}}},87070:(e,t,r)=>{"use strict";r.d(t,{A:()=>b});var n=r(39437),i=r(24184),s=r(32060),o=r(80736),a=r(52404),l=r(86215),c=r(3837),u=r(36845),h=r(48306),d=r(7296);const p=new h.J,f=new a.A("EPSG:4326",0,0,0),m=new l.A("EPSG:4326",0,0,0,0),g=new n.Vector2,A=new n.Vector2,y=new n.Vector2;class v{#y=!1;constructor(){this.dom=document.createElement("div"),this.dom.style.display="none",this.visible=!0}get visible(){return this.#y}set visible(e){e!==this.#y&&(this.#y=e,this.dom.style.display=e?"block":"none")}hide(){this.visible=!1}show(){this.visible=!0}add(e){this.dom.append(e.dom)}}class x extends n.Group{constructor(e){super(),this.nodeParent=e,this.needsUpdate=!0}initializeDom(){this.domElements=new v,this.domElements.labels=new v,this.domElements.add(this.domElements.labels),this.domElements.labels.dom.style.opacity="0"}addLabel(e){this.add(e),this.domElements.labels.dom.append(e.content),e.initDimensions(),this.nodeParent.layer.isGlobeLayer&&this.nodeParent.level<4&&(e.horizonCullingPoint=new n.Vector3)}removeLabel(e){this.remove(e),this.domElements.labels.dom.removeChild(e.content)}updatePosition(e){this.needsUpdate&&(this.needsAltitude&&e.updateElevationFromLayer(this.nodeParent.layer,[this.nodeParent]),e.update3dPosition(this.nodeParent.layer.crs),e.updateHorizonCullingPoint())}count(){return this.children.length}get labels(){return this.children}}class _ extends o.A{#v=(()=>new d.N)();constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{domElement:r,performance:i=!0,forceClampToTerrain:s=!1,margin:o,...a}=t;super(e,t.object3d||new n.Group,a),this.isLabelLayer=!0,this.domElement=new v,this.domElement.show(),this.domElement.dom.id=`itowns-label-${this.id}`,this.buildExtent=!0,this.crs=t.source.crs,this.performance=i,this.forceClampToTerrain=s,this.margin=o,this.toHide=new n.Group,this.labelDomelement=r,this.margin=t.margin}get visible(){return super.visible}set visible(e){super.visible=e,e?this.domElement?.show():this.domElement?.hide()}get submittedLabelNodes(){return this.object3d.children}convert(e,t){const r=[];return t.isExtent?t.as(e.crs,m):t.toExtent(e.crs,m),f.crs=e.crs,p.setZoom(t.zoom),e.features.forEach((t=>{if(t.type!==u.Xs.POINT)return;p.setFeature(t);const n=t.style?.text?.field,i=t.style?.point?.base_altitude,s=i instanceof Function&&"baseAltitudeDefault"==i.name;r.needsAltitude=r.needsAltitude||!0===this.forceClampToTerrain||s&&!t.hasRawElevationData,t.geometries.forEach((i=>{if(f.setFromArray(t.vertices,i.size*i.indices[0].offset),f.applyMatrix4(e.matrixWorld),!m.isPointInside(f))return;const s=i.properties.style&&i.properties.style.text&&i.properties.style.text.field;let o;p.setGeometry(i),this.style.setContext(p);const a=this.style.text&&this.style.text.field;if(this.labelDomelement)o=(0,h.Jn)(this.labelDomelement,p);else if(!(s||n||a||i.properties.style&&(i.properties.style.icon.source||i.properties.style.icon.key)||t.style&&t.style.icon&&(t.style.icon.source||t.style.icon.key)||this.style.icon&&(this.style.icon.source||this.style.icon.key)))return;const l=new c.A(o,f.clone(),this.style);l.layerId=this.id,l.padding=this.margin||l.padding,r.push(l)}))})),r}preUpdate(e,t){t.has(this.parent)&&(this.object3d.clear(),this.#v.width=.5*this.parent.maxScreenSizeNode,this.#v.height=.5*this.parent.maxScreenSizeNode,this.#v.resize())}#x(e){this.object3d.add(e)}#_(e){this.toHide.add(e)}#b(e){return e.parent?.isTileMesh?e.parent.link[this.id]?.domElements||this.#b(e.parent):this.domElement}#w(e){return e.children.every((e=>e.layerUpdateState&&e.layerUpdateState[this.id]?.hasFinished()))}#E(e){const t=e.children.slice();this.#v.reset(),t.sort(((e,t)=>t.order-e.order)),t.forEach((t=>{e.nodeParent.extent.planarDimensions(g),f.crs=e.nodeParent.extent.crs,f.setFromValues(e.nodeParent.extent.west,e.nodeParent.extent.north,0).toVector3(A),f.copy(t.coordinates).as(e.nodeParent.extent.crs,f).toVector3(y),y.sub(A),y.y+=g.y,y.divide(g).multiplyScalar(this.#v.width),t.updateProjectedPosition(y.x,y.y),this.#v.insert(t)||e.removeLabel(t)}))}update(e,t,r,n){if(!n&&r.link[t.id])return void s.A.removeChildrenAndCleanupRecursively(this,r);const o=r.link[t.id]||new x(r);if(r.link[t.id]=o,this.frozen||!r.visible||!this.visible)return;if(!r.material.visible&&this.#w(r))return this.#_(o);const a=r.getExtentsByProjection(this.source.crs)||[r.extent],l=a[0].zoom;if(lt.zoom.max)return this.#_(o);if(void 0===r.layerUpdateState[this.id]&&(r.layerUpdateState[this.id]=new i.A),!this.source.extentInsideLimit(r.extent,l))return void r.layerUpdateState[this.id].noMoreUpdatePossible();if(this.#w(r.parent))return r.material.visible||(o.needsUpdate=!0),void this.#x(o);if(!r.layerUpdateState[this.id].canTryUpdate())return;r.layerUpdateState[this.id].newTry();const c={layer:this,extentsSource:a,view:e.view,requester:r};return e.scheduler.execute(c).then((t=>{if(!t)return;const n=e.view.mainLoop.gfxEngine.label2dRenderer;o.initializeDom(),this.#b(r).add(o.domElements),t.forEach((e=>{r.parent?(o.needsAltitude=o.needsAltitude||e.needsAltitude,e.forEach((e=>{r.extent.isPointInside(e.coordinates)&&o.addLabel(e)}))):e.forEach((e=>{s.A.removeChildrenAndCleanupRecursively(this,e),n.removeLabelDOM(e)}))})),o.count()&&(o.domElements.labels.hide(),o.domElements.labels.dom.style.opacity="1.0",r.addEventListener("show",(()=>o.domElements.labels.show())),r.addEventListener("hidden",(()=>this.#_(o))),r.addEventListener("removed",(()=>this.removeNodeDomElement(r))),o.needsAltitude&&r.material.getElevationLayer()&&r.material.getElevationLayer().addEventListener("rasterElevationLevelChanged",(()=>{o.needsUpdate=!0})),this.performance&&this.#E(o)),r.layerUpdateState[this.id].noMoreUpdatePossible()}))}removeLabelsFromNodeRecursive(e){e.children.forEach((e=>{e.link[this.id]&&delete e.link[this.id],this.removeLabelsFromNodeRecursive(e)})),this.removeNodeDomElement(e)}removeNodeDomElement(e){if(e.link[this.id]?.domElements){const t=e.link[this.id].domElements.dom;t.parentElement.removeChild(t),delete e.link[this.id].domElements}}delete(e){e&&this.cache.clear(),this.domElement.dom.parentElement.removeChild(this.domElement.dom),this.parent.level0Nodes.forEach((e=>this.removeLabelsFromNodeRecursive(e)))}}const b=_},61276:(e,t,r)=>{"use strict";r.d(t,{A:()=>u,p:()=>h});var n=r(39437),i=r(85524),s=r(66924),o=r(88326),a=r(99487),l=r(48306);class c extends n.EventDispatcher{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{source:r,name:n,style:c={},subdivisionThreshold:u=256,addLabelLayer:h=!1,cacheLifeTime:d,options:p={},updateStrategy:f,zoom:m,mergeFeatures:g=!0,crs:A}=t;if(super(),this.isLayer=!0,this.id=e,Object.defineProperty(this,"id",{writable:!1}),this.name=n,void 0===r||!0===r)throw new Error(`Layer ${e} needs Source`);this.source=r||new o.A({url:"none"}),this.crs=A,!c||c instanceof l.Ay?this.style=c||new l.Ay:("string"==typeof c.fill?.pattern&&(console.warn("Using style.fill.pattern = { source: Img|url } is adviced"),c.fill.pattern={source:c.fill.pattern}),this.style=new l.Ay(c)),this.subdivisionThreshold=u,this.sizeDiagonalTexture=(this.subdivisionThreshold*this.subdivisionThreshold*2)**.5,this.addLabelLayer=h,this.options=p,this.updateStrategy=f??{type:i.Uv,options:{}},this.defineLayerProperty("frozen",!1),this.zoom={min:m?.min??0,max:m?.max??1/0},this.info=new s.A(this),this.ready=!1,this._promises=[],this.whenReady=new Promise(((e,t)=>{this._resolve=e,this._reject=t})).then((()=>(this.ready=!0,this.source.onLayerAdded({out:this}),this))),this._promises.push(this.source.whenReady),this.cache=new a.A(d),this.mergeFeatures=g}addInitializationStep(){let e;return this._promises.push(new Promise((t=>{e=t}))),e}defineLayerProperty(e,t,r){const n=Object.getOwnPropertyDescriptor(this,e);if(!n||!n.set){let n=null==this[e]?t:this[e];Object.defineProperty(this,e,{get:()=>n,set:t=>{if(n!==t){const i={type:`${e}-property-changed`,previous:{},new:{}};i.previous[e]=n,i.new[e]=t,n=t,r&&r(this,e),this.dispatchEvent(i)}}})}}convert(e){return e}getData(e,t){const r=this.source.requestToKey(this.source.isVectorSource?t:e);let n=this.cache.getByArray(r);return n||(n=this.source.loadData(e,this).then((e=>this.convert(e,t)),(e=>{throw e})),this.cache.setByArray(n,r)),n}delete(){console.warn("Function delete doesn't exist for this layer")}}const u=c,h={moveLayerToIndex:function(e,t,r){t=Math.min(t,r.length-1),t=Math.max(t,0);const n=e.sequence;for(const i of r)i.id===e.id?i.sequence=t:i.sequence>n&&i.sequence<=t?i.sequence--:i.sequence>=t&&i.sequence0&&this.moveLayerToIndex(e,e.sequence-1,t)},moveLayerUp:function(e,t){const r=t.length-1;e.sequencee.sequence-t.sequence)),t.map((e=>e.id))}}},24184:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});const n=[1,3,7,60],i=class{constructor(){this.state=0,this.lastErrorTimestamp=0,this.errorCount=0,this.failureParams={lowestLevelError:1/0}}hasFinished(){return 4==this.state}canTryUpdate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();switch(this.state){case 0:return!0;case 3:case 1:case 4:return!1;default:return 1e3*this.secondsUntilNextTry()<=e-this.lastErrorTimestamp}}secondsUntilNextTry(){if(2!==this.state)return 0;const e=Math.max(0,Math.min(this.errorCount,n.length)-1);return n[e]}newTry(){this.state=1}success(){this.lastErrorTimestamp=0,this.state=0}noMoreUpdatePossible(){this.state=4}noData(e){this.state=0,this.failureParams.lowestLevelError=Math.min(e.targetLevel,this.failureParams.lowestLevelError)}failure(e,t,r){r&&null!=r.targetLevel&&(this.failureParams.lowestLevelError=Math.min(r.targetLevel,this.failureParams.lowestLevelError)),this.lastErrorTimestamp=e,this.state=t?3:2,this.errorCount++}inError(){return 3==this.state||2==this.state}}},85524:(e,t,r)=>{"use strict";r.d(t,{Uv:()=>i,a0:()=>s,fZ:()=>a,kb:()=>u,oN:()=>o});var n=r(24051);const i=0,s=1,o=2,a=3;function l(e,t){const r=t.groups.filter((t=>t<=e));return r.length?r[r.length-1]:t.groups[0]}function c(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t==n.WS?r.zoom?r.zoom.min:0:Math.min(e,Math.ceil((t+e)/2))}function u(e,t){let r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.level,i=arguments.length>3?arguments[3]:void 0,u=arguments.length>4?arguments[4]:void 0,h=arguments.length>5?arguments[5]:void 0;const d=u.source.zoom?u.source.zoom.max:1/0;if(h.lowestLevelError!=1/0)r=c(h.lowestLevelError,i,u.source),r=h.lowestLevelError==r?r-1:r,e==s&&(r=l(r,u.updateStrategy.options));else{switch(e){case s:r=l(n,u.updateStrategy.options);break;case o:r=function(e,t,r){return Math.min(e,t+(r.increment||1))}(n,i,u.updateStrategy.options);break;case a:r=c(n,i,u.source);break;default:r=function(e,t,r,n){return e.pendingSubdivision&&!n.isVectorTileSource?r:t}(t,n,i,u.source)}r=Math.min(r,d)}return r}},49423:(e,t,r)=>{"use strict";r.d(t,{uj:()=>Cn,Ay:()=>Bn,YC:()=>Tn,eU:()=>In,TK:()=>Sn});var n=r(39437);const i=new n.OrthographicCamera(-1,1,1,-1,0,1);class s extends n.BufferGeometry{constructor(){super(),this.setAttribute("position",new n.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new n.Float32BufferAttribute([0,2,0,0,2,0],2))}}const o=new s;class a{constructor(e){this._mesh=new n.Mesh(o,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,i)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}}const l=parseInt(n.REVISION)>=165,c=parseInt(n.REVISION)>=166,u=new n.Box2,h=new n.Vector4,d=new n.Vector2,p=new class{constructor(){this._renderer=new n.WebGLRenderer,this._target=new n.WebGLRenderTarget(1,1),this._texTarget=new n.WebGLRenderTarget,this._quad=new a(new n.ShaderMaterial({blending:n.CustomBlending,blendDst:n.ZeroFactor,blendSrc:n.OneFactor,uniforms:{map:{value:null},pixel:{value:new n.Vector2}},vertexShader:"\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\t\t\t\tuniform sampler2D map;\n\t\t\t\tuniform ivec2 pixel;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tgl_FragColor = texelFetch( map, pixel, 0 );\n\n\t\t\t\t}\n\t\t\t"}))}increaseSizeTo(e){this._target.setSize(Math.max(this._target.width,e),1)}readDataAsync(e){const{_renderer:t,_target:r}=this;return l?t.readRenderTargetPixelsAsync(r,0,0,e.length/4,1,e):Promise.resolve().then((()=>this.readData(e)))}readData(e){const{_renderer:t,_target:r}=this;t.readRenderTargetPixels(r,0,0,e.length/4,1,e)}renderPixelToTarget(e,t,r){const{_quad:n,_renderer:i,_target:s,_texTarget:o}=this;if(c)u.min.copy(t),u.max.copy(t),u.max.x+=1,u.max.y+=1,i.initRenderTarget(s),i.copyTextureToTexture(e,s.texture,u,r,0);else{const a=i.autoClear,c=i.getRenderTarget(),u=i.getScissorTest();i.getScissor(h),o.setSize(e.image.width,e.image.height),i.setRenderTarget(o),d.set(0,0),l?i.copyTextureToTexture(e,o.texture,null,d):i.copyTextureToTexture(d,e,o.texture),n.material.uniforms.map.value=o.texture,n.material.uniforms.pixel.value.copy(t),i.setRenderTarget(s),i.setScissorTest(!0),i.setScissor(r.x,r.y,1,1),i.autoClear=!1,n.render(i),i.setScissorTest(u),i.setScissor(h),i.setRenderTarget(c),i.autoClear=a,o.dispose()}}},f=new n.Vector2,m=new n.Vector2,g=new n.Vector2;function A(e,t,r=new Array(3)){let n=3*t,i=3*t+1,s=3*t+2;return e.index&&(n=e.index.getX(n),i=e.index.getX(i),s=e.index.getX(s)),r[0]=n,r[1]=i,r[2]=s,r}function y(e,t,r,n,i){const[s,o,a]=n,l=function(e,t){return 0===t?e.getAttribute("uv"):e.getAttribute(`uv${t}`)}(e,t);f.fromBufferAttribute(l,s),m.fromBufferAttribute(l,o),g.fromBufferAttribute(l,a),i.set(0,0,0).addScaledVector(f,r.x).addScaledVector(m,r.y).addScaledVector(g,r.z)}function v(e,t,r,n){const i=e.x-Math.floor(e.x),s=e.y-Math.floor(e.y),o=Math.floor(i*t%t),a=Math.floor(s*r%r);return n.set(o,a),n}const x=new n.Vector2,_=new n.Vector2,b=new n.Vector2;class w{constructor(e,t,r){this.geometry=e,this.textures=t,this.data=r,this._asyncRead=!1,this.featureIds=r.featureIds.map((e=>{const{texture:t,...r}=e,n={label:null,propertyTable:null,nullFeatureId:null,...r};return t&&(n.texture={texCoord:0,channels:[0],...t}),n}))}getTextures(){return this.textures}getFeatureInfo(){return this.featureIds}getFeaturesAsync(...e){this._asyncRead=!0;const t=this.getFeatures(...e);return this._asyncRead=!1,t}getFeatures(e,t){const{geometry:r,textures:n,featureIds:i}=this,s=new Array(i.length).fill(null),o=i.length;p.increaseSizeTo(o);const a=A(r,e),l=a[function(e){return e.x>e.y&&e.x>e.z?0:e.y>e.z?1:2}(t)];for(let e=0,o=i.length;e(u(),s))):(p.readData(c),u(),s);function u(){const e=new Uint32Array(1);for(let t=0,r=i.length;tc[4*t+e]));new Uint8Array(e.buffer).set(o);const a=e[0];a!==n&&(s[t]=a)}}}}dispose(){this.textures.forEach((e=>{e&&(e.dispose(),e.image instanceof ImageBitmap&&e.image.close())}))}}const E="EXT_mesh_features";function M(e,t,r){e.traverse((e=>{if(t.associations.has(e)){const{meshes:n,primitives:i}=t.associations.get(e),s=t.json.meshes[n].primitives[i];s&&s.extensions&&s.extensions[E]&&r(e,s.extensions[E])}}))}class S{constructor(e){this.parser=e,this.name=E}async afterRoot({scene:e,parser:t}){const r=t.json.extensionsUsed;if(!r||!r.includes(E))return;const n=t.json.textures?.length||0,i=new Array(n).fill(null);M(e,t,((e,{featureIds:r})=>{r.forEach((e=>{if(e.texture&&null===i[e.texture.index]){const r=e.texture.index;i[r]=t.loadTexture(r)}}))}));const s=await Promise.all(i);M(e,t,((e,t)=>{e.userData.meshFeatures=new w(e.geometry,s,t)}))}}class C{constructor(e,t,r,n){C.prototype.isMatrix2=!0,this.elements=[1,0,0,1],void 0!==e&&this.set(e,t,r,n)}identity(){return this.set(1,0,0,1),this}fromArray(e,t=0){for(let r=0;r<4;r++)this.elements[r]=e[r+t];return this}set(e,t,r,n){const i=this.elements;return i[0]=e,i[1]=r,i[2]=t,i[3]=n,this}}function T(e,t,r){return e&&t in e?e[t]:r}function I(e){return"BOOLEAN"!==e&&"STRING"!==e&&"ENUM"!==e}function R(e){return/^VEC/.test(e)}function B(e){return/^MATRIX/.test(e)}function P(e,t,r,n=null){return B(r)||R(r)?n.fromArray(e,t):e[t]}function L(e){const{type:t,componentType:r}=e;switch(t){case"SCALAR":return"INT64"===r?0n:0;case"VEC2":return new n.Vector2;case"VEC3":return new n.Vector3;case"VEC4":return new n.Vector4;case"MAT2":return new C;case"MAT3":return new n.Matrix3;case"MAT4":return new n.Matrix4;case"BOOLEAN":return!1;case"STRING":return"";case"ENUM":return 0}}function D(e,t){if(null==t)return!1;switch(e){case"SCALAR":case"ENUM":return"number"==typeof t||"bigint"==typeof t;case"VEC2":return t.isVector2;case"VEC3":return t.isVector3;case"VEC4":return t.isVector4;case"MAT2":return t.isMatrix2;case"MAT3":return t.isMatrix3;case"MAT4":return t.isMatrix4;case"BOOLEAN":return"boolean"==typeof t;case"STRING":return"string"==typeof t}throw new Error("ClassProperty: invalid type.")}function O(e,t=null){switch(e){case"INT8":return Int8Array;case"INT16":return Int16Array;case"INT32":return Int32Array;case"INT64":return BigInt64Array;case"UINT8":return Uint8Array;case"UINT16":return Uint16Array;case"UINT32":return Uint32Array;case"UINT64":return BigUint64Array;case"FLOAT32":return Float32Array;case"FLOAT64":return Float64Array}switch(t){case"BOOLEAN":case"STRING":return Uint8Array}throw new Error("ClassProperty: invalid type.")}function N(e,t=null){const r=e.default,n=e.type;if(t=t||L(e),null===r){switch(n){case"SCALAR":return 0;case"VEC2":return t.set(0,0);case"VEC3":return t.set(0,0,0);case"VEC4":return t.set(0,0,0,0);case"MAT2":case"MAT3":case"MAT4":return t.identity();case"BOOLEAN":return!1;case"STRING":case"ENUM":return""}throw new Error("ClassProperty: invalid type.")}if(B(n))t.fromArray(r);else{if(!R(n))return r;t.fromArray(r)}}function U(e,t,r=null){if(e.array){Array.isArray(t)||(t=new Array(e.count||0)),t.length=null!==r?r:e.count;for(let r=0,n=t.length;rt.value===e));return null===r?"":r.name}}adjustValueScaleOffset(e){return I(this.type)?function(e,t){const{type:r,componentType:n,scale:i,offset:s,normalized:o}=e;if(Array.isArray(t))for(let e=0,r=t.length;e=this.count)throw new Error("PropertyAttributeAccessor: Requested index is outside the range of the buffer.");const i=this.properties[e],s=i.type;if(!i)throw new Error("PropertyAttributeAccessor: Requested class property does not exist.");if(!this.definition.properties[e])return i.resolveDefault(n);n=i.shapeToProperty(n);const o=r.getAttribute(i.attribute.toLowerCase());if(B(s)){const e=n.elements;for(let r=0,n=e.length;r>t&1)}return n}getPropertyValue(e,t,r=null){if(t>=this.count)throw new Error("PropertyTableAccessor: Requested index is outside the range of the table.");const n=this.properties[e];if(!n)throw new Error("PropertyTableAccessor: Requested property does not exist.");if(!this.definition.properties[e])return n.resolveDefault(r);const i=n.array,s=this.data,o=n.getArrayLengthFromId(s,t);if(r=n.shapeToProperty(r,o),i)for(let n=0,i=r.length;nn[e]));return this.getPropertyValuesAtTexel(s,e,t,r,o),s.forEach(((e,t)=>n[e]=o[t])),n}async getDataAsync(e,t,r,n={}){const i=this.properties;F(i,n);const s=Object.keys(i),o=s.map((e=>n[e]));return await this.getPropertyValuesAtTexelAsync(s,e,t,r,o),s.forEach(((e,t)=>n[e]=o[t])),n}getPropertyValuesAtTexelAsync(...e){this._asyncRead=!0;const t=this.getPropertyValuesAtTexel(...e);return this._asyncRead=!1,t}getPropertyValuesAtTexel(e,t,r,n,i=[]){for(;i.length(u.call(this),i))):(p.readData(c),u.call(this),i);function u(){for(let t=0,r=e.length;tc[4*t+e])),h=new(O(n.componentType,s))(l);if(new Uint8Array(h.buffer).set(u),n.array){const e=i[t];for(let t=0,r=e.length;t{e&&(e.dispose(),e.image instanceof ImageBitmap&&e.image.close())}))}}class K{constructor(e,t,r,n=null,i=null){const{schema:s,propertyTables:o=[],propertyTextures:a=[],propertyAttributes:l=[]}=e,{enums:c,classes:u}=s,h=o.map((e=>new H(e,u,c,r)));let d=[],p=[];n&&(n.propertyTextures&&(d=n.propertyTextures.map((e=>new X(a[e],u,c,t)))),n.propertyAttributes&&(p=n.propertyAttributes.map((e=>new Q(l[e],u,c))))),this.schema=s,this.tableAccessors=h,this.textureAccessors=d,this.attributeAccessors=p,this.object=i,this.textures=t,this.nodeMetadata=n}getPropertyTableData(e,t,r=null){if(Array.isArray(e)&&Array.isArray(t)){r=r||[];const n=Math.min(e.length,t.length);r.length=n;for(let i=0;it))),Array.isArray(e))return e.map((e=>{const t=this.tableAccessors[e];return{name:t.name,className:t.definition.class}}));{const t=this.tableAccessors[e];return{name:t.name,className:t.definition.class}}}getPropertyTextureData(e,t,r=[]){const n=this.textureAccessors;r.length=n.length;for(let i=0;i{r[s]=e}));i.push(o)}return await Promise.all(i),r}getPropertyTextureInfo(){return this.textureAccessors}getPropertyAttributeData(e,t=[]){const r=this.attributeAccessors;t.length=r.length;for(let n=0;n({name:e.name,className:e.definition.class})))}dispose(){this.textureAccessors.forEach((e=>e.dispose())),this.tableAccessors.forEach((e=>e.dispose())),this.attributeAccessors.forEach((e=>e.dispose()))}}const $="EXT_structural_metadata";function J(e,t=[]){const r=e.json.textures?.length||0,n=new Array(r).fill(null);return t.forEach((({properties:t})=>{for(const r in t){const{index:i}=t[r];null===n[i]&&(n[i]=e.loadTexture(i))}})),Promise.all(n)}function Z(e,t=[]){const r=e.json.bufferViews?.length||0,n=new Array(r).fill(null);return t.forEach((({properties:t})=>{for(const r in t){const{values:i,arrayOffsets:s,stringOffsets:o}=t[r];null===n[i]&&(n[i]=e.loadBufferView(i)),null===n[s]&&(n[s]=e.loadBufferView(s)),null===n[o]&&(n[o]=e.loadBufferView(o))}})),Promise.all(n)}class ee{constructor(e){this.parser=e,this.name=$}async afterRoot({scene:e,parser:t}){const r=t.json.extensionsUsed;if(!r||!r.includes($))return;let i=null,s=t.json.extensions[$];if(s.schemaUri){const{manager:e,path:r,requestHeader:o,crossOrigin:a}=t.options,l=new URL(s.schemaUri,r).toString(),c=new n.FileLoader(e);c.setCrossOrigin(a),c.setResponseType("json"),c.setRequestHeader(o),i=c.loadAsync(l).then((e=>{s={...s,schema:e}}))}const[o,a]=await Promise.all([J(t,s.propertyTextures),Z(t,s.propertyTables),i]),l=new K(s,o,a);e.userData.structuralMetadata=l,e.traverse((e=>{if(t.associations.has(e)){const{meshes:r,primitives:n}=t.associations.get(e),i=t.json.meshes[r].primitives[n];if(i&&i.extensions&&i.extensions[$]){const t=i.extensions[$];e.userData.structuralMetadata=new K(s,o,a,t,e)}else e.userData.structuralMetadata=l}}))}}class te{constructor(){this.name="CESIUM_RTC"}afterRoot(e){if(e.parser.json.extensions&&e.parser.json.extensions.CESIUM_RTC){const{center:t}=e.parser.json.extensions.CESIUM_RTC;t&&(e.scene.position.x+=t[0],e.scene.position.y+=t[1],e.scene.position.z+=t[2])}}}function re(e){let t;try{t=new URL(e,"http://fakehost.com/")}catch(e){return null}const r=t.pathname.split("/").pop(),n=r.lastIndexOf(".");return-1===n||n===r.length-1?null:r.substring(n+1)}class ne{get unloadPriorityCallback(){return this._unloadPriorityCallback}set unloadPriorityCallback(e){1===e.length?(console.warn('LRUCache: "unloadPriorityCallback" function has been changed to take two arguments.'),this._unloadPriorityCallback=(t,r)=>{const n=e(t),i=e(r);return ni?1:0}):this._unloadPriorityCallback=e}constructor(){this.minSize=6e3,this.maxSize=8e3,this.minBytesSize=322122547.2,this.maxBytesSize=429496729.6,this.unloadPercent=.05,this.itemSet=new Map,this.itemList=[],this.usedSet=new Set,this.callbacks=new Map,this.markUnusedQueued=!1,this.unloadingHandle=-1,this.cachedBytes=0,this.bytesMap=new Map,this.loadedSet=new Set,this._unloadPriorityCallback=null,this.computeMemoryUsageCallback=()=>null;const e=this.itemSet;this.defaultPriorityCallback=t=>e.get(t)}isFull(){return this.itemSet.size>=this.maxSize||this.cachedBytes>=this.maxBytesSize}getMemoryUsage(e){return this.bytesMap.get(e)??null}add(e,t){this.markUnusedQueued&&this.markAllUnused();const r=this.itemSet;if(r.has(e))return!1;if(this.isFull())return!1;const n=this.usedSet,i=this.itemList,s=this.callbacks,o=this.bytesMap;i.push(e),n.add(e),r.set(e,Date.now()),s.set(e,t);const a=this.computeMemoryUsageCallback(e);return this.cachedBytes+=a||0,o.set(e,a),!0}remove(e){const t=this.usedSet,r=this.itemSet,n=this.itemList,i=this.bytesMap,s=this.callbacks,o=this.loadedSet;if(r.has(e)){this.cachedBytes-=i.get(e)||0,i.delete(e),s.get(e)(e);const a=n.indexOf(e);return n.splice(a,1),t.delete(e),r.delete(e),s.delete(e),o.delete(e),!0}return!1}setLoaded(e,t){const{itemSet:r,loadedSet:n}=this;r.has(e)&&(!0===t?n.add(e):n.delete(e))}updateMemoryUsage(e){const t=this.itemSet,r=this.bytesMap;if(!t.has(e))return;this.cachedBytes-=r.get(e)||0;const n=this.computeMemoryUsageCallback(e);r.set(e,n),this.cachedBytes+=n}markUsed(e){this.markUnusedQueued&&this.markAllUnused();const t=this.itemSet,r=this.usedSet;t.has(e)&&!r.has(e)&&(t.set(e,Date.now()),r.add(e))}markAllUnused(){this.usedSet.clear(),this.markUnusedQueued=!1,-1!==this.unloadingHandle&&(cancelAnimationFrame(this.unloadingHandle),this.unloadingHandle=-1)}unloadUnusedContent(){const{unloadPercent:e,minSize:t,maxSize:r,itemList:n,itemSet:i,usedSet:s,loadedSet:o,callbacks:a,bytesMap:l,minBytesSize:c,maxBytesSize:u}=this,h=n.length-s.size,d=n.length-o.size,p=Math.max(Math.min(n.length-t,h),0),f=this.cachedBytes-c,m=this.unloadPriorityCallback||this.defaultPriorityCallback;let g=!1;const A=p>0&&h>0||d&&n.length>r;if(h&&this.cachedBytes>c||d&&this.cachedBytes>u||A){n.sort(((e,t)=>{const r=s.has(e);if(r===s.has(t)){const r=o.has(e);return r===o.has(t)?-m(e,t):r?1:-1}return r?1:-1}));const d=Math.max(t*e,p*e),A=Math.ceil(Math.min(d,h,p)),y=Math.max(e*f,e*c),v=Math.min(y,f);let x=0,_=0;for(;this.cachedBytes-_>u||n.length-x>r;){const e=n[x],t=l.get(e)||0;if(s.has(e)&&o.has(e)||this.cachedBytes-_-t=A)break;_+=t,x++}n.splice(0,x).forEach((e=>{this.cachedBytes-=l.get(e)||0,a.get(e)(e),l.delete(e),i.delete(e),a.delete(e),o.delete(e),s.delete(e)})),g=x0}g&&(this.unloadingHandle=requestAnimationFrame((()=>this.scheduleUnload())))}scheduleUnload(){this.scheduled||(this.scheduled=!0,queueMicrotask((()=>{this.scheduled=!1,this.unloadUnusedContent(),this.markUnusedQueued=!0})))}}class ie{constructor(){this.maxJobs=6,this.items=[],this.callbacks=new Map,this.currJobs=0,this.scheduled=!1,this.autoUpdate=!0,this.priorityCallback=()=>{throw new Error("PriorityQueue: PriorityCallback function not defined.")},this.schedulingCallback=e=>{requestAnimationFrame(e)},this._runjobs=()=>{this.tryRunJobs(),this.scheduled=!1}}sort(){const e=this.priorityCallback;this.items.sort(e)}add(e,t){return new Promise(((r,n)=>{const i=this.items,s=this.callbacks;i.push(e),s.set(e,((...e)=>t(...e).then(r).catch(n))),this.autoUpdate&&this.scheduleJobRun()}))}remove(e){const t=this.items,r=this.callbacks,n=t.indexOf(e);-1!==n&&(t.splice(n,1),r.delete(e))}tryRunJobs(){this.sort();const e=this.items,t=this.callbacks,r=this.maxJobs;let n=this.currJobs;for(;r>n&&e.length>0;){n++;const r=e.pop(),i=t.get(r);t.delete(r),i(r).then((()=>{this.currJobs--,this.autoUpdate&&this.scheduleJobRun()})).catch((()=>{this.currJobs--,this.autoUpdate&&this.scheduleJobRun()}))}this.currJobs=n}scheduleJobRun(){this.scheduled||(this.schedulingCallback(this._runjobs),this.scheduled=!0)}}const se=6378137,oe=1738100;function ae(e){return 3===e||-1===e}function le(e,t){return e.__lastFrameVisited===t&&e.__used}function ce(e,t){e.__lastFrameVisited!==t.frameCount&&(e.__lastFrameVisited=t.frameCount,e.__used=!1,e.__inFrustum=!1,e.__isLeaf=!1,e.__visible=!1,e.__active=!1,e.__error=1/0,e.__distanceFromCamera=1/0,e.__childrenWereVisible=!1,e.__allChildrenLoaded=!1,e.__inFrustum=t.tileInView(e),t.calculateError(e))}function ue(e,t){if(t.ensureChildrenArePreprocessed(e),ce(e,t),de(e,t),!e.__hasRenderableContent){const r=e.children;for(let e=0,n=r.length;e0&&e.__depth+1>=t.maxDepth)}(e,t))return void de(e,t);let r=!1,n=!1;const i=e.children;for(let e=0,s=i.length;ee.__depthFromRenderedParent!==t.__depthFromRenderedParent?e.__depthFromRenderedParent>t.__depthFromRenderedParent?-1:1:e.__inFrustum!==t.__inFrustum?e.__inFrustum?1:-1:e.__used!==t.__used?e.__used?1:-1:e.__error!==t.__error?e.__error>t.__error?1:-1:e.__distanceFromCamera!==t.__distanceFromCamera?e.__distanceFromCamera>t.__distanceFromCamera?-1:1:0,xe=(e,t)=>e.__depthFromRenderedParent!==t.__depthFromRenderedParent?e.__depthFromRenderedParent>t.__depthFromRenderedParent?1:-1:e.__loadingState!==t.__loadingState?e.__loadingState>t.__loadingState?-1:1:e.__lastFrameVisited!==t.__lastFrameVisited?e.__lastFrameVisited>t.__lastFrameVisited?-1:1:e.__hasUnrenderableContent!==t.__hasUnrenderableContent?e.__hasUnrenderableContent?-1:1:e.__error!==t.__error?e.__error>t.__error?-1:1:0;class _e{get root(){const e=this.rootTileSet;return e?e.root:null}set loadSiblings(e){console.warn('TilesRenderer: "loadSiblings" option has been removed.')}set stopAtEmptyTiles(e){console.warn('TilesRenderer: "stopAtEmptyTiles" option has been removed.')}set preprocessURL(e){console.warn('TilesRendererBase: The "preprocessURL" callback has been deprecated. Use a plugin, instead.'),this._preprocessURL=e}get preprocessURL(){return this._preprocessURL}constructor(e=null){this.rootTileSetTriggered=!1,this.rootTileSet=null,this.rootURL=e,this.fetchOptions={},this.plugins=[],this.queuedTiles=[],this._preprocessURL=null;const t=new ne;t.unloadPriorityCallback=xe;const r=new ie;r.maxJobs=4,r.priorityCallback=ve;const n=new ie;n.maxJobs=1,n.priorityCallback=ve,this.lruCache=t,this.downloadQueue=r,this.parseQueue=n,this.stats={parsing:0,downloading:0,failed:0,inFrustum:0,used:0,active:0,visible:0},this.frameCount=0,this.errorTarget=6,this.errorThreshold=1/0,this.displayActiveTiles=!1,this.maxDepth=1/0}registerPlugin(e){if(!0===e[ye])throw new Error("TilesRendererBase: A plugin can only be registered to a single tile set");this.plugins.push(e),e[ye]=!0,e.init&&e.init(this)}unregisterPlugin(e){const t=this.plugins;if("string"==typeof e&&(e=this.getPluginByName(name)),t.includes(e)){const r=t.indexOf(e);return t.splice(r,1),e.dispose&&e.dispose(),!0}return!1}getPluginByName(e){return this.plugins.find((t=>t.name===e))||null}traverse(e,t){this.root&&pe(this.root,((t,...r)=>(this.ensureChildrenArePreprocessed(t),!!e&&e(t,...r))),t)}queueTileForDownload(e){this.queuedTiles.push(e)}update(){const e=this.stats,t=this.lruCache;if(this.rootTileSetTriggered||(this.rootTileSetTriggered=!0,this.invokeOnePlugin((e=>e.loadRootTileSet&&e.loadRootTileSet()))),!this.root)return;const r=this.root;e.inFrustum=0,e.used=0,e.active=0,e.visible=0,this.frameCount++,fe(r,this),me(r,this),ge(r,this),Ae(r,this);const n=this.queuedTiles;n.sort(t.unloadPriorityCallback);for(let e=0,r=n.length;e{-1===e.__loadingState&&(e.__loadingState=0)})),e.failed=0)}dispose(){this.invokeAllPlugins((e=>{e!==this&&e.dispose&&e.dispose()}));const e=this.lruCache,t=[];this.traverse((e=>(t.push(e),!1)));for(let r=0,n=t.length;r{n!==this&&n.preprocessNode&&n.preprocessNode(e,t,r)}))}setTileActive(e,t){}setTileVisible(e,t){}calculateError(e){return 0}tileInView(e){return!0}ensureChildrenArePreprocessed(e){const t=e.children;for(let r=0,n=t.length;rparseInt(e)));console.assert(i<=1,"TilesRenderer: asset.version is expected to be a 1.x or a compatible version."),1===i&&s>0&&console.warn("TilesRenderer: tiles versions at 1.1 or higher have limited support. Some new extensions and features may not be supported.");let o=t.replace(/\/[^/]*\/?$/,"");o=new URL(o,window.location.href).toString(),this.preprocessNode(e.root,o,r)}loadRootTileSet(){let e=this.rootURL;this.invokeAllPlugins((t=>e=t.preprocessURL?t.preprocessURL(e,null):e));const t=this.invokeOnePlugin((t=>t.fetchData&&t.fetchData(e,this.fetchOptions))).then((t=>{if(t.ok)return t.json();throw new Error(`TilesRenderer: Failed to load tileset "${e}" with status ${t.status} : ${t.statusText}`)})).then((t=>{this.preprocessTileSet(t,e),this.rootTileSet=t}));return t.catch((e=>{console.error(e),this.rootTileSet=null})),t}requestTileContents(e){if(0!==e.__loadingState)return;let t=!1,r=new URL(e.content.uri,e.__basePath+"/").toString();this.invokeAllPlugins((t=>r=t.preprocessURL?t.preprocessURL(r,e):r));const n=this.stats,i=this.lruCache,s=this.downloadQueue,o=this.parseQueue,a=re(r);if(!i.add(e,(e=>{1===e.__loadingState?(e.__loadAbort.abort(),e.__loadAbort=null):t?e.children.length=0:this.invokeAllPlugins((t=>{t.disposeTile&&t.disposeTile(e)})),1===e.__loadingState?n.downloading--:2===e.__loadingState&&n.parsing--,e.__loadingState=0,e.__loadIndex++,o.remove(e),s.remove(e)})))return;e.__loadIndex++;const l=e.__loadIndex,c=new AbortController,u=c.signal;return n.downloading++,e.__loadAbort=c,e.__loadingState=1,s.add(e,(e=>e.__loadIndex!==l?Promise.resolve():this.invokeOnePlugin((e=>e.fetchData&&e.fetchData(r,{...this.fetchOptions,signal:u}))))).then((t=>{if(e.__loadIndex===l){if(t.ok)return"json"===a?t.json():t.arrayBuffer();throw new Error(`Failed to load model with error code ${t.status}`)}})).then((i=>{if(e.__loadIndex===l)return n.downloading--,n.parsing++,e.__loadAbort=null,e.__loadingState=2,o.add(e,(n=>n.__loadIndex!==l?Promise.resolve():"json"===a&&i.root?(this.preprocessTileSet(i,r,e),e.children.push(i.root),t=!0,Promise.resolve()):this.invokeOnePlugin((e=>e.parseTile&&e.parseTile(i,n,a,r)))))})).then((()=>{e.__loadIndex===l&&(n.parsing--,e.__loadingState=3,i.setLoaded(e,!0),null===i.getMemoryUsage(e)&&(i.isFull()&&i.computeMemoryUsageCallback(e)>0?i.remove(e):i.updateMemoryUsage(e)))})).catch((t=>{e.__loadIndex===l&&("AbortError"!==t.name?(o.remove(e),s.remove(e),2===e.__loadingState?n.parsing--:1===e.__loadingState&&n.downloading--,n.failed++,console.error(`TilesRenderer : Failed to load tile at url "${e.content.uri}".`),console.error(t),e.__loadingState=-1,i.setLoaded(e,!0)):i.remove(e))}))}getAttributions(e=[]){return this.invokeAllPlugins((t=>t!==this&&t.getAttributions&&t.getAttributions(e))),e}invokeOnePlugin(e){const t=[...this.plugins,this];for(let r=0;ro+a)throw new Error("FeatureTable: Feature data read outside binary body length.");return d}}return s}getBuffer(e,t){const{buffer:r,binOffset:n}=this;return r.slice(n+e,n+e+t)}}class Se{constructor(e){this.batchTable=e;const t=e.header.extensions["3DTILES_batch_table_hierarchy"];this.classes=t.classes;for(const e of this.classes){const t=e.instances;for(const r in t)e.instances[r]=this._parseProperty(t[r],e.length,r)}if(this.instancesLength=t.instancesLength,this.classIds=this._parseProperty(t.classIds,this.instancesLength,"classIds"),t.parentCounts?this.parentCounts=this._parseProperty(t.parentCounts,this.instancesLength,"parentCounts"):this.parentCounts=new Array(this.instancesLength).fill(1),t.parentIds){const e=this.parentCounts.reduce(((e,t)=>e+t),0);this.parentIds=this._parseProperty(t.parentIds,e,"parentIds")}else this.parentIds=null;this.instancesIds=[];const r={};for(const e of this.classIds)r[e]=r[e]??0,this.instancesIds.push(r[e]),r[e]++}_parseProperty(e,t,r){if(Array.isArray(e))return e;{const{buffer:n,binOffset:i}=this.batchTable;return Ee(n,i+e.byteOffset,t,"SCALAR",e.componentType||"UNSIGNED_SHORT",r)}}getDataFromId(e,t={}){const r=this.parentCounts[e];if(this.parentIds&&r>0){let n=0;for(let t=0;t=this.count)throw new Error(`BatchTable: id value "${e}" out of bounds for "${this.count}" features number.`);for(const r of this.getKeys())"extensions"!==r&&(t[r]=super.getData(r,this.count)[e]);for(const r in this.extensions){const n=this.extensions[r];n.getDataFromId instanceof Function&&(t[r]=t[r]||{},n.getDataFromId(e,t[r]))}return t}getPropertyArray(e){return super.getData(e,this.count)}}class Te{constructor(){this.fetchOptions={},this.workingPath=""}load(e){return console.warn('Loader: "load" function has been deprecated in favor of "loadAsync".'),this.loadAsync(e)}loadAsync(e){return fetch(e,this.fetchOptions).then((t=>{if(!t.ok)throw new Error(`Failed to load file "${e}" with status ${t.status} : ${t.statusText}`);return t.arrayBuffer()})).then((t=>(""===this.workingPath&&(this.workingPath=this.workingPathForURL(e)),this.parse(t))))}resolveExternalURL(e){return/^[^\\/]/.test(e)&&!/^http/.test(e)?this.workingPath+"/"+e:e}workingPathForURL(e){const t=e.split(/[\\/]/g);return t.pop(),t.join("/")+"/"}parse(e){throw new Error("LoaderBase: Parse not implemented.")}}function Ie(e){let t;if(t=e instanceof DataView?e:new DataView(e),"{"===String.fromCharCode(t.getUint8(0)))return null;let r="";for(let e=0;e<4;e++)r+=String.fromCharCode(t.getUint8(e));return r}class Re extends Te{parse(e){const t=new DataView(e),r=Ie(t);console.assert("b3dm"===r);const n=t.getUint32(4,!0);console.assert(1===n);const i=t.getUint32(8,!0);console.assert(i===e.byteLength);const s=t.getUint32(12,!0),o=t.getUint32(16,!0),a=t.getUint32(20,!0),l=t.getUint32(24,!0),c=e.slice(28,28+s+o),u=new Me(c,0,s,o),h=28+s+o,d=e.slice(h,h+a+l),p=new Ce(d,u.getData("BATCH_LENGTH"),0,a,l),f=h+a+l;return{version:n,featureTable:u,batchTable:p,glbBytes:new Uint8Array(e,f,i-f)}}}function Be(e,t){if(t===n.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t===n.TriangleFanDrawMode||t===n.TriangleStripDrawMode){let r=e.getIndex();if(null===r){const t=[],n=e.getAttribute("position");if(void 0===n)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;e=2.0 are supported.")));const l=new bt(i,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e=0&&void 0===o[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}l.setExtensions(s),l.setPlugins(o),l.parse(r,n)}parseAsync(e,t){const r=this;return new Promise((function(n,i){r.parse(e,t,n,i)}))}}function Le(){let e={};return{get:function(t){return e[t]},add:function(t,r){e[t]=r},remove:function(t){delete e[t]},removeAll:function(){e={}}}}const De={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class Oe{constructor(e){this.parser=e,this.name=De.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let r=0,n=t.length;r=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,i.source,s)}}class Xe{constructor(e){this.parser=e,this.name=De.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,r=this.parser,n=r.json,i=n.textures[e];if(!i.extensions||!i.extensions[t])return null;const s=i.extensions[t],o=n.images[s.source];let a=r.textureLoader;if(o.uri){const e=r.options.manager.getHandler(o.uri);null!==e&&(a=e)}return this.detectSupport().then((function(i){if(i)return r.loadTextureImage(e,s.source,a);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(e)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}}class Ke{constructor(e){this.parser=e,this.name=De.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,r=this.parser,n=r.json,i=n.textures[e];if(!i.extensions||!i.extensions[t])return null;const s=i.extensions[t],o=n.images[s.source];let a=r.textureLoader;if(o.uri){const e=r.options.manager.getHandler(o.uri);null!==e&&(a=e)}return this.detectSupport().then((function(i){if(i)return r.loadTextureImage(e,s.source,a);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(e)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}}class $e{constructor(e){this.name=De.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,r=t.bufferViews[e];if(r.extensions&&r.extensions[this.name]){const e=r.extensions[this.name],n=this.parser.getDependency("buffer",e.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return n.then((function(t){const r=e.byteOffset||0,n=e.byteLength||0,s=e.count,o=e.byteStride,a=new Uint8Array(t,r,n);return i.decodeGltfBufferAsync?i.decodeGltfBufferAsync(s,o,a,e.mode,e.filter).then((function(e){return e.buffer})):i.ready.then((function(){const t=new ArrayBuffer(s*o);return i.decodeGltfBuffer(new Uint8Array(t),s,o,a,e.mode,e.filter),t}))}))}return null}}class Je{constructor(e){this.name=De.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,r=t.nodes[e];if(!r.extensions||!r.extensions[this.name]||void 0===r.mesh)return null;const i=t.meshes[r.mesh];for(const e of i.primitives)if(e.mode!==at.TRIANGLES&&e.mode!==at.TRIANGLE_STRIP&&e.mode!==at.TRIANGLE_FAN&&void 0!==e.mode)return null;const s=r.extensions[this.name].attributes,o=[],a={};for(const e in s)o.push(this.parser.getDependency("accessor",s[e]).then((t=>(a[e]=t,a[e]))));return o.length<1?null:(o.push(this.parser.createNodeMesh(e)),Promise.all(o).then((e=>{const t=e.pop(),r=t.isGroup?t.children:[t],i=e[0].count,s=[];for(const e of r){const t=new n.Matrix4,r=new n.Vector3,o=new n.Quaternion,l=new n.Vector3(1,1,1),c=new n.InstancedMesh(e.geometry,e.material,i);for(let e=0;e-1,o=s?e.match(/Firefox\/([0-9]+)\./)[1]:-1}"undefined"==typeof createImageBitmap||r&&i<17||s&&o<98?this.textureLoader=new n.TextureLoader(this.options.manager):this.textureLoader=new n.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new n.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const r=this,n=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll((function(e){return e._markDefs&&e._markDefs()})),Promise.all(this._invokeAll((function(e){return e.beforeRoot&&e.beforeRoot()}))).then((function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])})).then((function(t){const s={scene:t[0][n.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:n.asset,parser:r,userData:{}};return mt(i,s,n),gt(s,n),Promise.all(r._invokeAll((function(e){return e.afterRoot&&e.afterRoot(s)}))).then((function(){for(const e of s.scenes)e.updateMatrixWorld();e(s)}))})).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[];for(let r=0,n=t.length;r{const r=this.associations.get(e);null!=r&&this.associations.set(t,r);for(const[r,n]of e.children.entries())i(n,t.children[r])};return i(r,n),n.name+="_instance_"+e.uses[t]++,n}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let r=0;r=2&&f.setY(t,h[e*o+1]),o>=3&&f.setZ(t,h[e*o+2]),o>=4&&f.setW(t,h[e*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return f}))}loadTexture(e){const t=this.json,r=this.options,n=t.textures[e].source,i=t.images[n];let s=this.textureLoader;if(i.uri){const e=r.manager.getHandler(i.uri);null!==e&&(s=e)}return this.loadTextureImage(e,n,s)}loadTextureImage(e,t,r){const i=this,s=this.json,o=s.textures[e],a=s.images[t],l=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const c=this.loadImageSource(t,r).then((function(t){t.flipY=!1,t.name=o.name||a.name||"",""===t.name&&"string"==typeof a.uri&&!1===a.uri.startsWith("data:image/")&&(t.name=a.uri);const r=(s.samplers||{})[o.sampler]||{};return t.magFilter=ct[r.magFilter]||n.LinearFilter,t.minFilter=ct[r.minFilter]||n.LinearMipmapLinearFilter,t.wrapS=ut[r.wrapS]||n.RepeatWrapping,t.wrapT=ut[r.wrapT]||n.RepeatWrapping,i.associations.set(t,{textures:e}),t})).catch((function(){return null}));return this.textureCache[l]=c,c}loadImageSource(e,t){const r=this.json,i=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then((e=>e.clone()));const s=r.images[e],o=self.URL||self.webkitURL;let a=s.uri||"",l=!1;if(void 0!==s.bufferView)a=this.getDependency("bufferView",s.bufferView).then((function(e){l=!0;const t=new Blob([e],{type:s.mimeType});return a=o.createObjectURL(t),a}));else if(void 0===s.uri)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const c=Promise.resolve(a).then((function(e){return new Promise((function(r,s){let o=r;!0===t.isImageBitmapLoader&&(o=function(e){const t=new n.Texture(e);t.needsUpdate=!0,r(t)}),t.load(n.LoaderUtils.resolveURL(e,i.path),o,void 0,s)}))})).then((function(e){var t;return!0===l&&o.revokeObjectURL(a),gt(e,s),e.userData.mimeType=s.mimeType||((t=s.uri).search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/)?"image/jpeg":t.search(/\.webp($|\?)/i)>0||0===t.search(/^data\:image\/webp/)?"image/webp":"image/png"),e})).catch((function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",a),e}));return this.sourceCache[e]=c,c}assignTexture(e,t,r,n){const i=this;return this.getDependency("texture",r.index).then((function(s){if(!s)return null;if(void 0!==r.texCoord&&r.texCoord>0&&((s=s.clone()).channel=r.texCoord),i.extensions[De.KHR_TEXTURE_TRANSFORM]){const e=void 0!==r.extensions?r.extensions[De.KHR_TEXTURE_TRANSFORM]:void 0;if(e){const t=i.associations.get(s);s=i.extensions[De.KHR_TEXTURE_TRANSFORM].extendTexture(s,e),i.associations.set(s,t)}}return void 0!==n&&(s.colorSpace=n),e[t]=s,s}))}assignFinalMaterial(e){const t=e.geometry;let r=e.material;const i=void 0===t.attributes.tangent,s=void 0!==t.attributes.color,o=void 0===t.attributes.normal;if(e.isPoints){const e="PointsMaterial:"+r.uuid;let t=this.cache.get(e);t||(t=new n.PointsMaterial,n.Material.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,t.sizeAttenuation=!1,this.cache.add(e,t)),r=t}else if(e.isLine){const e="LineBasicMaterial:"+r.uuid;let t=this.cache.get(e);t||(t=new n.LineBasicMaterial,n.Material.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,this.cache.add(e,t)),r=t}if(i||s||o){let e="ClonedMaterial:"+r.uuid+":";i&&(e+="derivative-tangents:"),s&&(e+="vertex-colors:"),o&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=r.clone(),s&&(t.vertexColors=!0),o&&(t.flatShading=!0),i&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(r))),r=t}e.material=r}getMaterialType(){return n.MeshStandardMaterial}loadMaterial(e){const t=this,r=this.json,i=this.extensions,s=r.materials[e];let o;const a={},l=[];if((s.extensions||{})[De.KHR_MATERIALS_UNLIT]){const e=i[De.KHR_MATERIALS_UNLIT];o=e.getMaterialType(),l.push(e.extendParams(a,s,t))}else{const r=s.pbrMetallicRoughness||{};if(a.color=new n.Color(1,1,1),a.opacity=1,Array.isArray(r.baseColorFactor)){const e=r.baseColorFactor;a.color.setRGB(e[0],e[1],e[2],n.LinearSRGBColorSpace),a.opacity=e[3]}void 0!==r.baseColorTexture&&l.push(t.assignTexture(a,"map",r.baseColorTexture,n.SRGBColorSpace)),a.metalness=void 0!==r.metallicFactor?r.metallicFactor:1,a.roughness=void 0!==r.roughnessFactor?r.roughnessFactor:1,void 0!==r.metallicRoughnessTexture&&(l.push(t.assignTexture(a,"metalnessMap",r.metallicRoughnessTexture)),l.push(t.assignTexture(a,"roughnessMap",r.metallicRoughnessTexture))),o=this._invokeOne((function(t){return t.getMaterialType&&t.getMaterialType(e)})),l.push(Promise.all(this._invokeAll((function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,a)}))))}!0===s.doubleSided&&(a.side=n.DoubleSide);const c=s.alphaMode||"OPAQUE";if("BLEND"===c?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,"MASK"===c&&(a.alphaTest=void 0!==s.alphaCutoff?s.alphaCutoff:.5)),void 0!==s.normalTexture&&o!==n.MeshBasicMaterial&&(l.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new n.Vector2(1,1),void 0!==s.normalTexture.scale)){const e=s.normalTexture.scale;a.normalScale.set(e,e)}if(void 0!==s.occlusionTexture&&o!==n.MeshBasicMaterial&&(l.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),void 0!==s.occlusionTexture.strength&&(a.aoMapIntensity=s.occlusionTexture.strength)),void 0!==s.emissiveFactor&&o!==n.MeshBasicMaterial){const e=s.emissiveFactor;a.emissive=(new n.Color).setRGB(e[0],e[1],e[2],n.LinearSRGBColorSpace)}return void 0!==s.emissiveTexture&&o!==n.MeshBasicMaterial&&l.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture,n.SRGBColorSpace)),Promise.all(l).then((function(){const r=new o(a);return s.name&&(r.name=s.name),gt(r,s),t.associations.set(r,{materials:e}),s.extensions&&mt(i,r,s),r}))}createUniqueName(e){const t=n.PropertyBinding.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,r=this.extensions,i=this.primitiveCache;function s(e){return r[De.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(r){return wt(r,e,t)}))}const o=[];for(let r=0,a=e.length;r0&&At(d,s),d.name=t.createUniqueName(s.name||"mesh_"+e),gt(d,s),h.extensions&&mt(i,d,h),t.assignFinalMaterial(d),c.push(d)}for(let r=0,n=c.length;r1?new n.Group:1===t.length?t[0]:new n.Object3D,a!==t[0])for(let e=0,r=t.length;e{const t=new Map;for(const[e,r]of i.associations)(e instanceof n.Material||e instanceof n.Texture)&&t.set(e,r);return e.traverse((e=>{const r=i.associations.get(e);null!=r&&t.set(e,r)})),t})(s),s}))}_createAnimationTracks(e,t,r,i,s){const o=[],a=e.name?e.name:e.uuid,l=[];let c;switch(pt[s.path]===pt.weights?e.traverse((function(e){e.morphTargetInfluences&&l.push(e.name?e.name:e.uuid)})):l.push(a),pt[s.path]){case pt.weights:c=n.NumberKeyframeTrack;break;case pt.rotation:c=n.QuaternionKeyframeTrack;break;case pt.position:case pt.scale:c=n.VectorKeyframeTrack;break;default:c=1===r.itemSize?n.NumberKeyframeTrack:n.VectorKeyframeTrack}const u=void 0!==i.interpolation?ft[i.interpolation]:n.InterpolateLinear,h=this._getArrayFromAccessor(r);for(let e=0,r=l.length;e{const i=this.manager,s=this.fetchOptions,o=i.getHandler("path.gltf")||new Pe(i);"include"===s.credentials&&"cors"===s.mode&&o.setCrossOrigin("use-credentials"),"credentials"in s&&o.setWithCredentials("include"===s.credentials),s.headers&&o.setRequestHeader(s.headers);let a=this.workingPath;!/[\\/]$/.test(a)&&a.length&&(a+="/");const l=this.adjustmentTransform;o.parse(r,a,(r=>{const{batchTable:n,featureTable:i}=t,{scene:s}=r,o=i.getData("RTC_CENTER");o&&(s.position.x+=o[0],s.position.y+=o[1],s.position.z+=o[2]),r.scene.updateMatrix(),r.scene.matrix.multiply(l),r.scene.matrix.decompose(r.scene.position,r.scene.quaternion,r.scene.scale),r.batchTable=n,r.featureTable=i,s.batchTable=n,s.featureTable=i,e(r)}),n)}))}}class Mt extends Te{parse(e){const t=new DataView(e),r=Ie(t);console.assert("pnts"===r);const n=t.getUint32(4,!0);console.assert(1===n);const i=t.getUint32(8,!0);console.assert(i===e.byteLength);const s=t.getUint32(12,!0),o=t.getUint32(16,!0),a=t.getUint32(20,!0),l=t.getUint32(24,!0),c=e.slice(28,28+s+o),u=new Me(c,0,s,o),h=28+s+o,d=e.slice(h,h+a+l),p=new Ce(d,u.getData("BATCH_LENGTH")||u.getData("POINTS_LENGTH"),0,a,l);return Promise.resolve({version:n,featureTable:u,batchTable:p})}}function St(e){const t=e>>11,r=e>>5&63,n=31&e;return[Math.round(t/31*255),Math.round(r/63*255),Math.round(n/31*255)]}const Ct={RGB:"color",POSITION:"position"};class Tt extends Mt{constructor(e=n.DefaultLoadingManager){super(),this.manager=e}parse(e){return super.parse(e).then((async e=>{const{featureTable:t,batchTable:r}=e,i=new n.PointsMaterial,s=t.header.extensions,o=new n.Vector3;let a;if(s&&s["3DTILES_draco_point_compression"]){const{byteOffset:e,byteLength:r,properties:n}=s["3DTILES_draco_point_compression"],o=this.manager.getHandler("draco.drc");if(null==o)throw new Error("PNTSLoader: dracoLoader not available.");const l={};for(const e in n)e in Ct&&e in n&&(l[Ct[e]]=n[e]);const c={attributeIDs:l,attributeTypes:{position:"Float32Array",color:"Uint8Array"},useUniqueIDs:!0},u=t.getBuffer(e,r);a=await o.decodeGeometry(u,c),a.attributes.color&&(i.vertexColors=!0)}else{const e=t.getData("POINTS_LENGTH"),r=t.getData("POSITION",e,"FLOAT","VEC3"),s=t.getData("RGB",e,"UNSIGNED_BYTE","VEC3"),l=t.getData("RGBA",e,"UNSIGNED_BYTE","VEC4"),c=t.getData("RGB565",e,"UNSIGNED_SHORT","SCALAR"),u=t.getData("CONSTANT_RGBA",e,"UNSIGNED_BYTE","VEC4"),h=t.getData("POSITION_QUANTIZED",e,"UNSIGNED_SHORT","VEC3"),d=t.getData("QUANTIZED_VOLUME_SCALE",e,"FLOAT","VEC3"),p=t.getData("QUANTIZED_VOLUME_OFFSET",e,"FLOAT","VEC3");if(a=new n.BufferGeometry,h){const t=new Float32Array(3*e);for(let r=0;r{e in t.header&&console.warn(`PNTSLoader: Unsupported FeatureTable feature "${e}" detected.`)}));const l=new n.Points(a,i);l.position.copy(o),e.scene=l,e.scene.featureTable=t,e.scene.batchTable=r;const c=t.getData("RTC_CENTER");return c&&(e.scene.position.x+=c[0],e.scene.position.y+=c[1],e.scene.position.z+=c[2]),e}))}}class It extends Te{parse(e){const t=new DataView(e),r=Ie(t);console.assert("i3dm"===r);const n=t.getUint32(4,!0);console.assert(1===n);const i=t.getUint32(8,!0);console.assert(i===e.byteLength);const s=t.getUint32(12,!0),o=t.getUint32(16,!0),a=t.getUint32(20,!0),l=t.getUint32(24,!0),c=t.getUint32(28,!0),u=e.slice(32,32+s+o),h=new Me(u,0,s,o),d=32+s+o,p=e.slice(d,d+a+l),f=new Ce(p,h.getData("INSTANCES_LENGTH"),0,a,l),m=d+a+l,g=new Uint8Array(e,m,i-m);let A=null,y=null,v=null;if(c)A=g,y=Promise.resolve();else{const e=this.resolveExternalURL(we(g)),t=e.split(/[\\/]/g);t.pop(),v=t.join("/"),y=fetch(e,this.fetchOptions).then((t=>{if(!t.ok)throw new Error(`I3DMLoaderBase : Failed to load file "${e}" with status ${t.status} : ${t.statusText}`);return t.arrayBuffer()})).then((e=>{A=new Uint8Array(e)}))}return y.then((()=>({version:n,featureTable:h,batchTable:f,glbBytes:A,gltfWorkingPath:v})))}}const Rt=new n.Vector3,Bt=new n.Vector3,Pt=new n.Vector3,Lt=new n.Vector3,Dt=new n.Quaternion,Ot=new n.Vector3,Nt=new n.Matrix4,Ut=new n.Matrix4;class Ft extends It{constructor(e=n.DefaultLoadingManager){super(),this.manager=e,this.adjustmentTransform=new n.Matrix4}resolveExternalURL(e){return this.manager.resolveURL(super.resolveExternalURL(e))}parse(e){return super.parse(e).then((e=>{const{featureTable:t,batchTable:r}=e,i=e.glbBytes.slice().buffer;return new Promise(((s,o)=>{const a=this.fetchOptions,l=this.manager,c=l.getHandler("path.gltf")||new Pe(l);"include"===a.credentials&&"cors"===a.mode&&c.setCrossOrigin("use-credentials"),"credentials"in a&&c.setWithCredentials("include"===a.credentials),a.headers&&c.setRequestHeader(a.headers);let u=e.gltfWorkingPath??this.workingPath;/[\\/]$/.test(u)||(u+="/");const h=this.adjustmentTransform;c.parse(i,u,(e=>{const i=t.getData("INSTANCES_LENGTH"),o=t.getData("POSITION",i,"FLOAT","VEC3"),a=t.getData("NORMAL_UP",i,"FLOAT","VEC3"),l=t.getData("NORMAL_RIGHT",i,"FLOAT","VEC3"),c=t.getData("SCALE_NON_UNIFORM",i,"FLOAT","VEC3"),u=t.getData("SCALE",i,"FLOAT","SCALAR"),d=t.getData("RTC_CENTER");["QUANTIZED_VOLUME_OFFSET","QUANTIZED_VOLUME_SCALE","EAST_NORTH_UP","POSITION_QUANTIZED","NORMAL_UP_OCT32P","NORMAL_RIGHT_OCT32P"].forEach((e=>{e in t.header&&console.warn(`I3DMLoader: Unsupported FeatureTable feature "${e}" detected.`)}));const p=new n.Vector3;for(let e=0;e{if(e.isMesh){m.push(e);const{geometry:t,material:r}=e,s=new n.InstancedMesh(t,r,i);s.position.copy(p),d&&(s.position.x+=d[0],s.position.y+=d[1],s.position.z+=d[2]),f.push(s)}}));for(let e=0;e{const t=new n.Group;return e.forEach((e=>{t.add(e.scene)})),{tiles:e,scene:t}}))}}class Gt extends Te{constructor(e=n.DefaultLoadingManager){super(),this.manager=e}parse(e){return new Promise(((t,r)=>{const n=this.manager,i=this.fetchOptions;let s=n.getHandler("path.gltf")||n.getHandler("path.glb");s||(s=new Pe(n),s.register((()=>new te))),"include"===i.credentials&&"cors"===i.mode&&s.setCrossOrigin("use-credentials"),"credentials"in i&&s.setWithCredentials("include"===i.credentials),i.headers&&s.setRequestHeader(i.headers);let o=s.resourcePath||s.path||this.workingPath;!/[\\/]$/.test(o)&&o.length&&(o+="/"),s.parse(e,o,(e=>{t(e)}),r)}))}}const Qt=new n.Matrix4;class Vt extends n.Group{constructor(e){super(),this.name="TilesRenderer.TilesGroup",this.tilesRenderer=e}raycast(e,t){return!this.tilesRenderer.optimizeRaycast||(this.tilesRenderer.raycast(e,t),!1)}updateMatrixWorld(e){if(this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldNeedsUpdate||e){null===this.parent?Qt.copy(this.matrix):Qt.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1;const e=Qt.elements,t=this.matrixWorld.elements;let r=!1;for(let n=0;n<16;n++){const i=e[n],s=t[n];if(Math.abs(i-s)>Number.EPSILON){r=!0;break}}if(r){this.matrixWorld.copy(Qt);const e=this.children;for(let t=0,r=e.length;t{Object.getPrototypeOf(e).raycast.call(e,t,n)})),Yt.sort(Xt)):r.invokeOnePlugin((r=>r.raycastTile&&r.raycastTile(e,i,t,n)))||t.intersectObject(i,!0,n)}function $t(e,t,r,n=null){const{group:i,activeTiles:s}=e;e.ensureChildrenArePreprocessed(t),null===n&&(n=qt,jt.copy(i.matrixWorld).invert(),n.copy(r.ray).applyMatrix4(jt));const o=[],a=t.children;for(let e=0,t=a.length;ec)break;const u=$t(e,a,r,n);if(u){const e=u.distance*u.distance;enew n.Vector3)),this.planes=new Array(6).fill().map((()=>new n.Plane))}clampPoint(e,t){return t.copy(e).applyMatrix4(this.inverseTransform).clamp(this.box.min,this.box.max).applyMatrix4(this.transform)}distanceToPoint(e){return this.clampPoint(e,tr).distanceTo(e)}containsPoint(e){return tr.copy(e).applyMatrix4(this.inverseTransform),this.box.containsPoint(tr)}intersectsRay(e){return rr.copy(e).applyMatrix4(this.inverseTransform),rr.intersectsBox(this.box)}intersectRay(e,t){return rr.copy(e).applyMatrix4(this.inverseTransform),rr.intersectBox(this.box,t)?(t.applyMatrix4(this.transform),t):null}update(){const{points:e,inverseTransform:t,transform:r,box:n}=this;t.copy(r).invert();const{min:i,max:s}=n;let o=0;for(let t=-1;t<=1;t+=2)for(let n=-1;n<=1;n+=2)for(let a=-1;a<=1;a+=2)e[o].set(t<0?i.x:s.x,n<0?i.y:s.y,a<0?i.z:s.z).applyMatrix4(r),o++;this.updatePlanes()}updatePlanes(){Zt.copy(this.box.min).applyMatrix4(this.transform),er.copy(this.box.max).applyMatrix4(this.transform),tr.set(0,0,1).transformDirection(this.transform),this.planes[0].setFromNormalAndCoplanarPoint(tr,Zt),this.planes[1].setFromNormalAndCoplanarPoint(tr,er).negate(),tr.set(0,1,0).transformDirection(this.transform),this.planes[2].setFromNormalAndCoplanarPoint(tr,Zt),this.planes[3].setFromNormalAndCoplanarPoint(tr,er).negate(),tr.set(1,0,0).transformDirection(this.transform),this.planes[4].setFromNormalAndCoplanarPoint(tr,Zt),this.planes[5].setFromNormalAndCoplanarPoint(tr,er).negate()}intersectsFrustum(e){const{points:t}=this,{planes:r}=e;for(let e=0;e<6;e++){const n=r[e];let i=-1/0;for(let e=0;e<8;e++){const r=t[e],s=n.distanceToPoint(r);i=ii?n:i}intersectsFrustum(e){const t=this.obb||this.regionObb,r=this.sphere;return!(r&&!e.intersectsSphere(r))&&!(t&&!t.intersectsFrustum(e))&&Boolean(r||t)}getOBB(e,t){const r=this.obb||this.regionObb;r?(e.copy(r.box),t.copy(r.transform)):(this.getAABB(e),t.identity())}getAABB(e){if(this.sphere)this.sphere.getBoundingBox(e);else{const t=this.obb||this.regionObb;e.copy(t.box).applyMatrix4(t.transform)}}getSphere(e){if(this.sphere)e.copy(this.sphere);else if(this.region)this.region.getBoundingSphere(e);else{const t=this.obb||this.regionObb;t.box.getBoundingSphere(e),e.applyMatrix4(t.transform)}}setObbData(e,t){const r=new nr;sr.set(e[3],e[4],e[5]),or.set(e[6],e[7],e[8]),ar.set(e[9],e[10],e[11]);const n=sr.length(),i=or.length(),s=ar.length();sr.normalize(),or.normalize(),ar.normalize(),0===n&&sr.crossVectors(or,ar),0===i&&or.crossVectors(sr,ar),0===s&&ar.crossVectors(sr,or),r.transform.set(sr.x,or.x,ar.x,e[0],sr.y,or.y,ar.y,e[1],sr.z,or.z,ar.z,e[2],0,0,0,1).premultiply(t),r.box.min.set(-n,-i,-s),r.box.max.set(n,i,s),r.update(),this.obb=r}setSphereData(e,t,r,i,s){const o=new n.Sphere;o.center.set(e,t,r),o.radius=i,o.applyMatrix4(s),this.sphere=o}setRegionData(e,t,r,n,i,s,o){const a=new ir.M(...e.radius,r,i,t,n,s,o),l=new nr;a.getBoundingBox(l.box,l.transform),l.update(),this.region=a,this.regionObb=l}}const hr=new n.Matrix3;class dr extends n.Frustum{constructor(){super(),this.points=Array(8).fill().map((()=>new n.Vector3))}setFromProjectionMatrix(e,t){super.setFromProjectionMatrix(e,t),this.calculateFrustumPoints()}calculateFrustumPoints(){const{planes:e,points:t}=this;[[e[0],e[3],e[4]],[e[1],e[3],e[4]],[e[0],e[2],e[4]],[e[1],e[2],e[4]],[e[0],e[3],e[5]],[e[1],e[3],e[5]],[e[0],e[2],e[5]],[e[1],e[2],e[5]]].forEach(((e,r)=>{!function(e,t,r,n){const i=hr.set(e.normal.x,e.normal.y,e.normal.z,t.normal.x,t.normal.y,t.normal.z,r.normal.x,r.normal.y,r.normal.z);n.set(-e.constant,-t.constant,-r.constant),n.applyMatrix3(i.invert())}(e[0],e[1],e[2],t[r])}))}}var pr=r(52219);const fr=new pr.C1(se,se,6356752.314245179),mr=(new pr.C1(oe,oe,1736e3),new n.Matrix4),gr=new n.Euler,Ar=parseInt(n.REVISION)<165,yr=Symbol("INITIAL_FRUSTUM_CULLED"),vr=new n.Matrix4,xr=new n.Matrix4,_r=new n.Vector3,br=new n.Vector2,wr=new n.Vector3(1,0,0),Er=new n.Vector3(0,1,0);function Mr(e,t){e.traverse((e=>{e.frustumCulled=e[yr]&&t}))}class Sr extends _e{get autoDisableRendererCulling(){return this._autoDisableRendererCulling}set autoDisableRendererCulling(e){this._autoDisableRendererCulling!==e&&(super._autoDisableRendererCulling=e,this.forEachLoadedModel((t=>{Mr(t,!e)})))}constructor(...e){super(...e),this.group=new Vt(this),this.ellipsoid=fr.clone(),this.cameras=[],this.cameraMap=new Map,this.cameraInfo=[],this.activeTiles=new Set,this.visibleTiles=new Set,this.optimizeRaycast=!0,this._eventDispatcher=new n.EventDispatcher,this._upRotationMatrix=new n.Matrix4,this.lruCache.computeMemoryUsageCallback=e=>e.cached.bytesUsed??null,this._autoDisableRendererCulling=!0,this._loadingTiles=!1;const t=new n.LoadingManager;if(t.setURLModifier((e=>this.preprocessURL?this.preprocessURL(e):e)),this.manager=t,Ar){const e=this;this._overridenRaycast=function(t,r){e.optimizeRaycast||Object.getPrototypeOf(this).raycast.call(this,t,r)}}}addEventListener(...e){this._eventDispatcher.addEventListener(...e)}hasEventListener(...e){this._eventDispatcher.hasEventListener(...e)}removeEventListener(...e){this._eventDispatcher.removeEventListener(...e)}dispatchEvent(...e){this._eventDispatcher.dispatchEvent(...e)}getBounds(...e){return console.warn("TilesRenderer: getBounds has been renamed to getBoundingBox."),this.getBoundingBox(...e)}getOrientedBounds(...e){return console.warn("TilesRenderer: getOrientedBounds has been renamed to getOrientedBoundingBox."),this.getOrientedBoundingBox(...e)}getBoundingBox(e){if(!this.root)return!1;const t=this.root.cached.boundingVolume;return!!t&&(t.getAABB(e),!0)}getOrientedBoundingBox(e,t){if(!this.root)return!1;const r=this.root.cached.boundingVolume;return!!r&&(r.getOBB(e,t),!0)}getBoundingSphere(e){if(!this.root)return!1;const t=this.root.cached.boundingVolume;return!!t&&(t.getSphere(e),!0)}forEachLoadedModel(e){this.traverse((t=>{const r=t.cached.scene;r&&e(r,t)}))}raycast(e,t){if(this.root)if(e.firstHitOnly){const r=$t(this,this.root,e);r&&t.push(r)}else Jt(this,this.root,e,t)}hasCamera(e){return this.cameraMap.has(e)}setCamera(e){const t=this.cameras,r=this.cameraMap;return!r.has(e)&&(r.set(e,new n.Vector2),t.push(e),this.dispatchEvent({type:"add-camera",camera:e}),!0)}setResolution(e,t,r){const n=this.cameraMap;if(!n.has(e))return!1;const i=t.isVector2?t.x:t,s=t.isVector2?t.y:r,o=n.get(e);return o.width===i&&o.height===s||(o.set(i,s),this.dispatchEvent({type:"camera-resolution-change"})),!0}setResolutionFromRenderer(e,t){return t.getSize(br).multiplyScalar(t.getPixelRatio()),this.setResolution(e,br.x,br.y)}deleteCamera(e){const t=this.cameras,r=this.cameraMap;if(r.has(e)){const n=t.indexOf(e);return t.splice(n,1),r.delete(e),this.dispatchEvent({type:"delete-camera",camera:e}),!0}return!1}preprocessTileSet(e,t,r){super.preprocessTileSet(e,t,r),queueMicrotask((()=>{this.dispatchEvent({type:"load-tile-set",tileSet:e,url:t})}))}loadRootTileSet(...e){return super.loadRootTileSet(...e).then((()=>{switch((this.rootTileSet.asset&&this.rootTileSet.asset.gltfUpAxis||"y").toLowerCase()){case"x":this._upRotationMatrix.makeRotationAxis(Er,-Math.PI/2);break;case"y":this._upRotationMatrix.makeRotationAxis(wr,Math.PI/2)}this.dispatchEvent({type:"load-content"})})).catch((()=>{}))}update(){let e=null;if(this.invokeAllPlugins((t=>{if(t.doTilesNeedUpdate){const r=t.doTilesNeedUpdate();e=null===e?r:e||r}})),!1===e)return this.dispatchEvent({type:"update-before"}),void this.dispatchEvent({type:"update-after"});this.dispatchEvent({type:"update-before"});const t=this.group,r=this.cameras,i=this.cameraMap,s=this.cameraInfo;if(0!==r.length){for(;s.length>r.length;)s.pop();for(;s.length1e-6&&console.warn("ThreeTilesRenderer : Non uniform scale used for tile which may cause issues when calculating screen space error.");for(let e=0,n=s.length;ee.scene));break}case"gltf":case"glb":{const t=new Gt(c);t.workingPath=a,t.fetchOptions=l,h=t.parse(e);break}default:console.warn(`TilesRenderer: Content type "${f}" not supported.`),h=Promise.resolve(null)}const m=this.stats;!1===this._loadingTiles&&m.parsing+m.downloading>0&&(this.dispatchEvent({type:"tiles-load-start"}),this._loadingTiles=!0);const g=await h;let A,y;if(g.isObject3D?(A=g,y=null):(A=g.scene,y=g),await this.invokeAllPlugins((e=>e.processTileModel&&e.processTileModel(A,t))),s._loadIndex!==u)return;A.updateMatrix(),"glb"!==f&&"gltf"!==f||A.matrix.multiply(p),A.matrix.premultiply(d),A.matrix.decompose(A.position,A.quaternion,A.scale),A.traverse((e=>{e[yr]=e.frustumCulled})),Mr(A,!this.autoDisableRendererCulling),Ar&&A.traverse((e=>{e.raycast=this._overridenRaycast}));const v=[],x=[],_=[];A.traverse((e=>{if(e.geometry&&x.push(e.geometry),e.material){const t=e.material;v.push(e.material);for(const e in t){const r=t[e];r&&r.isTexture&&_.push(r)}}})),s.materials=v,s.geometry=x,s.textures=_,s.scene=A,s.metadata=y,s.bytesUsed=function(e){const{TextureUtils:t}=n;if(!t)return 0;const r=new Set;let i=0;return e.traverse((e=>{if(e.geometry&&!r.has(e.geometry)&&(i+=function(e){let t=0;for(const r in e.attributes){const n=e.getAttribute(r);t+=n.count*n.itemSize*n.array.BYTES_PER_ELEMENT}const r=e.getIndex();return t+=r?r.count*r.itemSize*r.array.BYTES_PER_ELEMENT:0,t}(e.geometry),r.add(e.geometry)),e.material){const n=e.material;for(const e in n){const s=n[e];if(s&&s.isTexture&&!r.has(s)){const{format:e,type:n,image:o}=s,{width:a,height:l}=o,c=t.getByteLength(a,l,e,n);i+=s.generateMipmaps?4*c/3:c,r.add(s)}}}})),i}(A),this.dispatchEvent({type:"load-model",scene:A,tile:t}),!0===this._loadingTiles&&m.parsing+m.downloading===1&&(this.dispatchEvent({type:"tiles-load-end"}),this._loadingTiles=!1)}disposeTile(e){super.disposeTile(e);const t=e.cached;if(t.scene){const r=t.materials,n=t.geometry,i=t.textures,s=t.scene.parent;t.scene.traverse((e=>{e.userData.meshFeatures&&e.userData.meshFeatures.dispose(),e.userData.structuralMetadata&&e.userData.structuralMetadata.dispose()}));for(let e=0,t=n.length;e{const r=Symbol(e);Object.defineProperty(Sr.prototype,e,{get(){return this[r]||null},set(n){console.warn(`TilesRenderer: "${e}" has been deprecated in favor of the "${t}" event.`),this[r]&&this.removeEventListener(t,this[r]),this[r]=n,this.addEventListener(t,n)}})}));class Cr{constructor(){this.creditsCount={}}_adjustAttributions(e,t){const r=this.creditsCount,n=e.split(/;/g);for(let e=0,i=n.length;e{const r=e[1];return t[1]-r})).map((e=>e[0])).join("; ")}}function Tr(e){let t=null;return pe(e,(e=>{if(e.content&&e.content.uri){const[,r]=e.content.uri.split("?");return t=new URLSearchParams(r).get("session"),!0}return!1})),t}class Ir{constructor({apiToken:e,autoRefreshToken:t=!1,logoUrl:r=null,useRecommendedSettings:n=!0}){this.name="GOOGLE_CLOUD_AUTH_PLUGIN",this.apiToken=e,this.autoRefreshToken=t,this.useRecommendedSettings=n,this.logoUrl=r,this.sessionToken=null,this.tiles=null,this._onLoadCallback=null,this._visibilityChangeCallback=null,this._tokenRefreshPromise=null,this._attributionsManager=new Cr,this._logoAttribution={value:"",type:"image",collapsible:!1},this._attribution={value:"",type:"string",collapsible:!0}}init(e){null!=e&&(null==e.rootURL&&(e.rootURL="https://tile.googleapis.com/v1/3dtiles/root.json"),this.useRecommendedSettings&&(e.parseQueue.maxJobs=10,e.downloadQueue.maxJobs=30,e.errorTarget=40),this.tiles=e,this._onLoadCallback=({tileSet:t})=>{this.sessionToken=Tr(t.root),e.removeEventListener("load-tile-set",this._onLoadCallback)},this._visibilityChangeCallback=({tile:e,visible:t})=>{const r=e.cached.metadata.asset.copyright||"";t?this._attributionsManager.addAttributions(r):this._attributionsManager.removeAttributions(r)},e.addEventListener("load-tile-set",this._onLoadCallback),e.addEventListener("tile-visibility-change",this._visibilityChangeCallback))}getAttributions(e){this.tiles.visibleTiles.size>0&&(this.logoUrl&&(this._logoAttribution.value=this.logoUrl,e.push(this._logoAttribution)),this._attribution.value=this._attributionsManager.toString(),e.push(this._attribution))}preprocessURL(e){return e=new URL(e),/^http/.test(e.protocol)&&(e.searchParams.append("key",this.apiToken),null!==this.sessionToken&&e.searchParams.append("session",this.sessionToken)),e.toString()}dispose(){const{tiles:e}=this;e.removeEventListener("load-tile-set",this._onLoadCallback),e.removeEventListener("tile-visibility-change",this._visibilityChangeCallback)}async fetchData(e,t){null!==this._tokenRefreshPromise&&(await this._tokenRefreshPromise,e=this.preprocessURL(e));const r=await fetch(e,t);return r.status>=400&&r.status<=499&&this.autoRefreshToken?(await this._refreshToken(t),fetch(this.preprocessURL(e),t)):r}_refreshToken(e){if(null===this._tokenRefreshPromise){const t=new URL(this.tiles.rootURL);t.searchParams.append("key",this.apiToken),this._tokenRefreshPromise=fetch(t,e).then((e=>e.json())).then((e=>{this.sessionToken=Tr(e.root),this._tokenRefreshPromise=null}))}return this._tokenRefreshPromise}}class Rr{constructor({apiToken:e,assetId:t=null,autoRefreshToken:r=!1}){this.name="CESIUM_ION_AUTH_PLUGIN",this.apiToken=e,this.assetId=t,this.autoRefreshToken=r,this.tiles=null,this.endpointURL=null,this._bearerToken=null,this._tileSetVersion=-1,this._tokenRefreshPromise=null,this._attributions=[]}init(e){null!==this.assetId&&(e.rootURL=`https://api.cesium.com/v1/assets/${this.assetId}/endpoint`),this.tiles=e,this.endpointURL=e.rootURL}loadRootTileSet(){return this._refreshToken().then((()=>this.tiles.loadRootTileSet()))}preprocessURL(e){return e=new URL(e),/^http/.test(e.protocol)&&-1!=this._tileSetVersion&&e.searchParams.append("v",this._tileSetVersion),e.toString()}fetchData(e,t){return null!==this.tiles.getPluginByName("GOOGLE_CLOUD_AUTH_PLUGIN")?null:Promise.resolve().then((async()=>{null!==this._tokenRefreshPromise&&(await this._tokenRefreshPromise,e=this.preprocessURL(e));const r=await fetch(e,t);return r.status>=400&&r.status<=499&&this.autoRefreshToken?(await this._refreshToken(t),fetch(this.preprocessURL(e),t)):r}))}getAttributions(e){this.tiles.visibleTiles.size>0&&e.push(...this._attributions)}_refreshToken(e){if(null===this._tokenRefreshPromise){const t=new URL(this.endpointURL);t.searchParams.append("access_token",this.apiToken),this._tokenRefreshPromise=fetch(t,e).then((e=>{if(!e.ok)throw new Error(`CesiumIonAuthPlugin: Failed to load data with error code ${e.status}`);return e.json()})).then((e=>{const r=this.tiles;if("externalType"in e){const t=new URL(e.options.url);r.rootURL=e.options.url,r.registerPlugin(new Ir({apiToken:t.searchParams.get("key")}))}else{if(r.rootURL=e.url,r.fetchOptions.headers=r.fetchOptions.headers||{},r.fetchOptions.headers.Authorization=`Bearer ${e.accessToken}`,t.searchParams.has("v")&&-1===this._tileSetVersion){const t=new URL(e.url);this._tileSetVersion=t.searchParams.get("v")}this._bearerToken=e.accessToken,e.attributions&&(this._attributions=e.attributions.map((e=>({value:e.html,type:"html",collapsible:e.collapsible}))))}return this._tokenRefreshPromise=null,e}))}return this._tokenRefreshPromise}}function Br(e){return"OCTREE"===e.__implicitRoot.implicitTiling.subdivisionScheme}function Pr(e){return Br(e)?8:4}class Lr{constructor(e,t){this.parent=e,this.children=[],this.__level=e.__level+1,this.__implicitRoot=e.__implicitRoot,this.__subtreeIdx=t,[this.__x,this.__y,this.__z]=function(e,t){return t?[2*t.__x+e.__subtreeIdx%2,2*t.__y+Math.floor(e.__subtreeIdx/2)%2,Br(e)?2*t.__z+Math.floor(e.__subtreeIdx/4)%2:0]:[0,0,0]}(this,e)}static copy(e){const t={children:[]};return t.__level=e.__level,t.__implicitRoot=e.__implicitRoot,t.__subtreeIdx=e.__subtreeIdx,[t.__x,t.__y,t.__z]=[e.__x,e.__y,e.__z],t.boundingVolume=e.boundingVolume,t.geometricError=e.geometricError,t}}class Dr extends Te{constructor(e){super(),this.tile=e,this.rootTile=e.__implicitRoot}parseBuffer(e){const t=new DataView(e);let r=0;const n=Ie(t);console.assert("subt"===n,'SUBTREELoader: The magic bytes equal "subt".'),r+=4;const i=t.getUint32(r,!0);console.assert(1===i,'SUBTREELoader: The version listed in the header is "1".'),r+=4;const s=t.getUint32(r,!0);r+=8;const o=t.getUint32(r,!0);r+=8;const a=JSON.parse(we(new Uint8Array(e,r,s)));return r+=s,{version:i,subtreeJson:a,subtreeByte:e.slice(r,r+o)}}parse(e){const t=this.parseBuffer(e),r=t.subtreeJson;r.contentAvailabilityHeaders=[].concat(r.contentAvailability);const n=this.preprocessBuffers(r.buffers),i=this.preprocessBufferViews(r.bufferViews,n);this.markActiveBufferViews(r,i);const s=this.requestActiveBuffers(n,t.subtreeByte),o=this.parseActiveBufferViews(i,s);this.parseAvailability(t,r,o),this.expandSubtree(this.tile,t)}markActiveBufferViews(e,t){let r;const n=e.tileAvailability;isNaN(n.bitstream)?isNaN(n.bufferView)||(r=t[n.bufferView]):r=t[n.bitstream],r&&(r.isActive=!0,r.bufferHeader.isActive=!0);const i=e.contentAvailabilityHeaders;for(let e=0;e>Math.log2(i)];if(!this.getBit(t._tileAvailability,o)){n.push(void 0);continue}const l=this.deriveChildTile(t,a,o,e);a.children.push(l),n.push(l)}r=n,n=[]}return r}deriveChildTile(e,t,r,n){const i=new Lr(t,n);i.boundingVolume=this.getTileBoundingVolume(i),i.geometricError=this.getGeometricError(i);for(let t=0;e&&t=e.lengthBits)throw new Error("Bit index out of bounds.");if(void 0!==e.constant)return e.constant;const r=t>>3,n=t%8;return 1==(new Uint8Array(e.bitstream)[r]>>n&1)}getTileBoundingVolume(e){const t={};if(this.rootTile.boundingVolume.region){const r=[...this.rootTile.boundingVolume.region],n=r[0],i=r[2],s=r[1],o=r[3],a=(i-n)/Math.pow(2,e.__level),l=(o-s)/Math.pow(2,e.__level);r[0]=n+a*e.__x,r[2]=n+a*(e.__x+1),r[1]=s+l*e.__y,r[3]=s+l*(e.__y+1);for(let e=0;e<4;e++){const t=r[e];t<-Math.PI?r[e]+=2*Math.PI:t>Math.PI&&(r[e]-=2*Math.PI)}if(Br(e)){const t=r[4],n=(r[5]-t)/Math.pow(2,e.__level);r[4]=t+n*e.__z,r[5]=t+n*(e.__z+1)}t.region=r}if(this.rootTile.boundingVolume.box){const r=[...this.rootTile.boundingVolume.box],n=2**e.__level-1,i=Math.pow(2,-e.__level),s=Br(e)?3:2;for(let t=0;t{this.parse(e,t,i)}),r,i)}parse(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>{};this.decodeDracoFile(e,t,null,null,n.SRGBColorSpace,r).catch(r)}decodeDracoFile(e,t,r,i){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:n.LinearSRGBColorSpace,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:()=>{};const a={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!r,vertexColorSpace:s};return this.decodeGeometry(e,a).then(t).catch(o)}decodeGeometry(e,t){const r=JSON.stringify(t);if(Fr.has(e)){const t=Fr.get(e);if(t.key===r)return t.promise;if(0===e.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let n;const i=this.workerNextTaskID++,s=e.byteLength,o=this._getWorker(i,s).then((r=>(n=r,new Promise(((r,s)=>{n._callbacks[i]={resolve:r,reject:s},n.postMessage({type:"decode",id:i,taskConfig:t,buffer:e},[e])}))))).then((e=>this._createGeometry(e.geometry)));return o.catch((()=>!0)).then((()=>{n&&i&&this._releaseTask(n,i)})),Fr.set(e,{key:r,promise:o}),o}_createGeometry(e){const t=new n.BufferGeometry;e.index&&t.setIndex(new n.BufferAttribute(e.index.array,1));for(let r=0;r{r.load(e,t,void 0,n)}))}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then((t=>{const r=t[0];e||(this.decoderConfig.wasmBinary=t[1]);const n=zr.toString(),i=["/* draco decoder */",r,"","/* worker */",n.substring(n.indexOf("{")+1,n.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([i]))})),this.decoderPending}_getWorker(e,t){return this._initDecoder().then((()=>{if(this.workerPool.lengtht._taskLoad?-1:1}));const r=this.workerPool[this.workerPool.length-1];return r._taskCosts[e]=t,r._taskLoad+=t,r}))}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map((e=>e._taskLoad)))}dispose(){for(let e=0;e{const t=e.draco,o=new t.Decoder;try{const e=function(e,t,n,i){const s=i.attributeIDs,o=i.attributeTypes;let a,l;const c=t.GetEncodedGeometryType(n);if(c===e.TRIANGULAR_MESH)a=new e.Mesh,l=t.DecodeArrayToMesh(n,n.byteLength,a);else{if(c!==e.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");a=new e.PointCloud,l=t.DecodeArrayToPointCloud(n,n.byteLength,a)}if(!l.ok()||0===a.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+l.error_msg());const u={index:null,attributes:[]};for(const n in s){const l=self[o[n]];let c,h;if(i.useUniqueIDs)h=s[n],c=t.GetAttributeByUniqueId(a,h);else{if(h=t.GetAttributeId(a,e[s[n]]),-1===h)continue;c=t.GetAttribute(a,h)}const d=r(e,t,a,n,l,c);"color"===n&&(d.vertexColorSpace=i.vertexColorSpace),u.attributes.push(d)}return c===e.TRIANGULAR_MESH&&(u.index=function(e,t,r){const n=3*r.num_faces(),i=4*n,s=e._malloc(i);t.GetTrianglesUInt32Array(r,i,s);const o=new Uint32Array(e.HEAPF32.buffer,s,n).slice();return e._free(s),{array:o,itemSize:1}}(e,t,a)),e.destroy(a),u}(t,o,new Int8Array(n),s),a=e.attributes.map((e=>e.array.buffer));e.index&&a.push(e.index.array.buffer),self.postMessage({type:"decode",id:i.id,geometry:e},a)}catch(e){console.error(e),self.postMessage({type:"error",id:i.id,error:e.message})}finally{t.destroy(o)}}))}}}class Gr{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:4;this.pool=e,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0}_initWorker(e){if(!this.workers[e]){const t=this.workerCreator();t.addEventListener("message",this._onMessage.bind(this,e)),this.workers[e]=t}}_getIdleWorker(){for(let e=0;e{const n=this._getIdleWorker();-1!==n?(this._initWorker(n),this.workerStatus|=1<e.terminate())),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}const Qr=9,Vr=15,Hr=16,jr=22,qr=37,Wr=43,Yr=76,Xr=83,Kr=97,$r=100,Jr=103,Zr=109,en=165,tn=166;class rn{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}}class nn{constructor(e,t,r,n){this._dataView=new DataView(e.buffer,e.byteOffset+t,r),this._littleEndian=n,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian)+2**32*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_nextInt32(){const e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_skip(e){return this._offset+=e,this}_scan(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=this._offset;let n=0;for(;this._dataView.getUint8(this._offset)!==t&&ne.arrayBuffer())).then((e=>WebAssembly.instantiate(e,un))).then(this._init):WebAssembly.instantiate(Buffer.from(dn,"base64"),un).then(this._init),an)}_init(e){ln=e.instance,un.env.emscripten_notify_memory_growth(0)}decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!ln)throw new Error("ZSTDDecoder: Await .init() before decoding.");const r=e.byteLength,n=ln.exports.malloc(r);cn.set(e,n),t=t||Number(ln.exports.ZSTD_findDecompressedSize(n,r));const i=ln.exports.malloc(t),s=ln.exports.ZSTD_decompress(i,t,n,r),o=cn.slice(i,i+s);return ln.exports.free(n),ln.exports.free(i),o}}const dn="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZACAAKAIAIAAoAgRBH3F0QQAgAWtBH3F2CwgAIABBiH9LC34BBH9BAyEBIAAoAgQiA0EgTQRAIAAoAggiASAAKAIQTwRAIAAQDQ8LIAAoAgwiAiABRgRAQQFBAiADQSBJGw8LIAAgASABIAJrIANBA3YiBCABIARrIAJJIgEbIgJrIgQ2AgggACADIAJBA3RrNgIEIAAgBCgAADYCAAsgAQsUAQF/IAAgARACIQIgACABEAEgAgv3AQECfyACRQRAIABCADcCACAAQQA2AhAgAEIANwIIQbh/DwsgACABNgIMIAAgAUEEajYCECACQQRPBEAgACABIAJqIgFBfGoiAzYCCCAAIAMoAAA2AgAgAUF/ai0AACIBBEAgAEEIIAEQFGs2AgQgAg8LIABBADYCBEF/DwsgACABNgIIIAAgAS0AACIDNgIAIAJBfmoiBEEBTQRAIARBAWtFBEAgACABLQACQRB0IANyIgM2AgALIAAgAS0AAUEIdCADajYCAAsgASACakF/ai0AACIBRQRAIABBADYCBEFsDwsgAEEoIAEQFCACQQN0ams2AgQgAgsWACAAIAEpAAA3AAAgACABKQAINwAICy8BAX8gAUECdEGgHWooAgAgACgCAEEgIAEgACgCBGprQR9xdnEhAiAAIAEQASACCyEAIAFCz9bTvtLHq9lCfiAAfEIfiUKHla+vmLbem55/fgsdAQF/IAAoAgggACgCDEYEfyAAKAIEQSBGBUEACwuCBAEDfyACQYDAAE8EQCAAIAEgAhBnIAAPCyAAIAJqIQMCQCAAIAFzQQNxRQRAAkAgAkEBSARAIAAhAgwBCyAAQQNxRQRAIAAhAgwBCyAAIQIDQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADTw0BIAJBA3ENAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgA0F8aiIEIABJBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAsMACAAIAEpAAA3AAALQQECfyAAKAIIIgEgACgCEEkEQEEDDwsgACAAKAIEIgJBB3E2AgQgACABIAJBA3ZrIgE2AgggACABKAAANgIAQQALDAAgACABKAIANgAAC/cCAQJ/AkAgACABRg0AAkAgASACaiAASwRAIAAgAmoiBCABSw0BCyAAIAEgAhALDwsgACABc0EDcSEDAkACQCAAIAFJBEAgAwRAIAAhAwwDCyAAQQNxRQRAIAAhAwwCCyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkF/aiECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YEQCAHQRhqIQcgBiAQSQR/IAZBAmoiBigAACAFdgUgBUEQaiEFIARBEHYLIQQMAQsLA0AgBEEDcSIIQQNGBEAgBUECaiEFIARBAnYhBCAHQQNqIQcMAQsLIAcgCGoiByAPSw0EIAVBAmohBQNAIAIgB0kEQCANIAJBAXRqQQA7AQAgAkEBaiECDAELCyAGIA5LQQAgBiAFQQN1aiIHIAxLG0UEQCAHKAAAIAVBB3EiBXYhBAwCCyAEQQJ2IQQLIAYhBwsCfyALQX9qIAQgAEF/anEiBiAAQQF0QX9qIgggCWsiEUkNABogBCAIcSIEQQAgESAEIABIG2shBiALCyEIIA0gAkEBdGogBkF/aiIEOwEAIAlBASAGayAEIAZBAUgbayEJA0AgCSAASARAIABBAXUhACALQX9qIQsMAQsLAn8gByAOS0EAIAcgBSAIaiIFQQN1aiIGIAxLG0UEQCAFQQdxDAELIAUgDCIGIAdrQQN0awshBSACQQFqIQIgBEUhCCAGKAAAIAVBH3F2IQQMAQsLQWwgCUEBRyAFQSBKcg0BGiABIAJBf2o2AgAgBiAFQQdqQQN1aiADawwBC0FQCyEAIApBEGokACAACwkAQQFBBSAAGwsMACAAIAEoAAA2AAALqgMBCn8jAEHwAGsiCiQAIAJBAWohDiAAQQhqIQtBgIAEIAVBf2p0QRB1IQxBACECQQEhBkEBIAV0IglBf2oiDyEIA0AgAiAORkUEQAJAIAEgAkEBdCINai8BACIHQf//A0YEQCALIAhBA3RqIAI2AgQgCEF/aiEIQQEhBwwBCyAGQQAgDCAHQRB0QRB1ShshBgsgCiANaiAHOwEAIAJBAWohAgwBCwsgACAFNgIEIAAgBjYCACAJQQN2IAlBAXZqQQNqIQxBACEAQQAhBkEAIQIDQCAGIA5GBEADQAJAIAAgCUYNACAKIAsgAEEDdGoiASgCBCIGQQF0aiICIAIvAQAiAkEBajsBACABIAUgAhAUayIIOgADIAEgAiAIQf8BcXQgCWs7AQAgASAEIAZBAnQiAmooAgA6AAIgASACIANqKAIANgIEIABBAWohAAwBCwsFIAEgBkEBdGouAQAhDUEAIQcDQCAHIA1ORQRAIAsgAkEDdGogBjYCBANAIAIgDGogD3EiAiAISw0ACyAHQQFqIQcMAQsLIAZBAWohBgwBCwsgCkHwAGokAAsjAEIAIAEQCSAAhUKHla+vmLbem55/fkLj3MqV/M7y9YV/fAsQACAAQn43AwggACABNgIACyQBAX8gAARAIAEoAgQiAgRAIAEoAgggACACEQEADwsgABAmCwsfACAAIAEgAi8BABAINgIAIAEQBBogACACQQRqNgIEC0oBAX9BoCAoAgAiASAAaiIAQX9MBEBBiCBBMDYCAEF/DwsCQCAAPwBBEHRNDQAgABBmDQBBiCBBMDYCAEF/DwtBoCAgADYCACABC9cBAQh/Qbp/IQoCQCACKAIEIgggAigCACIJaiIOIAEgAGtLDQBBbCEKIAkgBCADKAIAIgtrSw0AIAAgCWoiBCACKAIIIgxrIQ0gACABQWBqIg8gCyAJQQAQKSADIAkgC2o2AgACQAJAIAwgBCAFa00EQCANIQUMAQsgDCAEIAZrSw0CIAcgDSAFayIAaiIBIAhqIAdNBEAgBCABIAgQDxoMAgsgBCABQQAgAGsQDyEBIAIgACAIaiIINgIEIAEgAGshBAsgBCAPIAUgCEEBECkLIA4hCgsgCgubAgEBfyMAQYABayINJAAgDSADNgJ8AkAgAkEDSwRAQX8hCQwBCwJAAkACQAJAIAJBAWsOAwADAgELIAZFBEBBuH8hCQwEC0FsIQkgBS0AACICIANLDQMgACAHIAJBAnQiAmooAgAgAiAIaigCABA7IAEgADYCAEEBIQkMAwsgASAJNgIAQQAhCQwCCyAKRQRAQWwhCQwCC0EAIQkgC0UgDEEZSHINAUEIIAR0QQhqIQBBACECA0AgAiAATw0CIAJBQGshAgwAAAsAC0FsIQkgDSANQfwAaiANQfgAaiAFIAYQFSICEAMNACANKAJ4IgMgBEsNACAAIA0gDSgCfCAHIAggAxAYIAEgADYCACACIQkLIA1BgAFqJAAgCQsLACAAIAEgAhALGgsQACAALwAAIAAtAAJBEHRyCy8AAn9BuH8gAUEISQ0AGkFyIAAoAAQiAEF3Sw0AGkG4fyAAQQhqIgAgACABSxsLCwkAIAAgATsAAAsDAAELigYBBX8gACAAKAIAIgVBfnE2AgBBACAAIAVBAXZqQYQgKAIAIgQgAEYbIQECQAJAIAAoAgQiAkUNACACKAIAIgNBAXENACACQQhqIgUgA0EBdkF4aiIDQQggA0EISxtnQR9zQQJ0QYAfaiIDKAIARgRAIAMgAigCDDYCAAsgAigCCCIDBEAgAyACKAIMNgIECyACKAIMIgMEQCADIAIoAgg2AgALIAIgAigCACAAKAIAQX5xajYCAEGEICEAAkACQCABRQ0AIAEgAjYCBCABKAIAIgNBAXENASADQQF2QXhqIgNBCCADQQhLG2dBH3NBAnRBgB9qIgMoAgAgAUEIakYEQCADIAEoAgw2AgALIAEoAggiAwRAIAMgASgCDDYCBAsgASgCDCIDBEAgAyABKAIINgIAQYQgKAIAIQQLIAIgAigCACABKAIAQX5xajYCACABIARGDQAgASABKAIAQQF2akEEaiEACyAAIAI2AgALIAIoAgBBAXZBeGoiAEEIIABBCEsbZ0Efc0ECdEGAH2oiASgCACEAIAEgBTYCACACIAA2AgwgAkEANgIIIABFDQEgACAFNgIADwsCQCABRQ0AIAEoAgAiAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAigCACABQQhqRgRAIAIgASgCDDYCAAsgASgCCCICBEAgAiABKAIMNgIECyABKAIMIgIEQCACIAEoAgg2AgBBhCAoAgAhBAsgACAAKAIAIAEoAgBBfnFqIgI2AgACQCABIARHBEAgASABKAIAQQF2aiAANgIEIAAoAgAhAgwBC0GEICAANgIACyACQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgIoAgAhASACIABBCGoiAjYCACAAIAE2AgwgAEEANgIIIAFFDQEgASACNgIADwsgBUEBdkF4aiIBQQggAUEISxtnQR9zQQJ0QYAfaiICKAIAIQEgAiAAQQhqIgI2AgAgACABNgIMIABBADYCCCABRQ0AIAEgAjYCAAsLDgAgAARAIABBeGoQJQsLgAIBA38CQCAAQQ9qQXhxQYQgKAIAKAIAQQF2ayICEB1Bf0YNAAJAQYQgKAIAIgAoAgAiAUEBcQ0AIAFBAXZBeGoiAUEIIAFBCEsbZ0Efc0ECdEGAH2oiASgCACAAQQhqRgRAIAEgACgCDDYCAAsgACgCCCIBBEAgASAAKAIMNgIECyAAKAIMIgFFDQAgASAAKAIINgIAC0EBIQEgACAAKAIAIAJBAXRqIgI2AgAgAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAygCACECIAMgAEEIaiIDNgIAIAAgAjYCDCAAQQA2AgggAkUNACACIAM2AgALIAELtwIBA38CQAJAIABBASAAGyICEDgiAA0AAkACQEGEICgCACIARQ0AIAAoAgAiA0EBcQ0AIAAgA0EBcjYCACADQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgAgAEEIakYEQCABIAAoAgw2AgALIAAoAggiAQRAIAEgACgCDDYCBAsgACgCDCIBBEAgASAAKAIINgIACyACECchAkEAIQFBhCAoAgAhACACDQEgACAAKAIAQX5xNgIAQQAPCyACQQ9qQXhxIgMQHSICQX9GDQIgAkEHakF4cSIAIAJHBEAgACACaxAdQX9GDQMLAkBBhCAoAgAiAUUEQEGAICAANgIADAELIAAgATYCBAtBhCAgADYCACAAIANBAXRBAXI2AgAMAQsgAEUNAQsgAEEIaiEBCyABC7kDAQJ/IAAgA2ohBQJAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAFNBH8gACACakF/ai0AACIAQQNxQQJ0QaAeaigCACACaiAAQQZ2IgFBAnRBsB5qKAIAaiAAQSBxIgBFaiABRSAAQQV2cWoFQbh/CwsdACAAKAKQ4gEQWiAAQQA2AqDiASAAQgA3A5DiAQu1AwEFfyMAQZACayIKJABBuH8hBgJAIAVFDQAgBCwAACIIQf8BcSEHAkAgCEF/TARAIAdBgn9qQQF2IgggBU8NAkFsIQYgB0GBf2oiBUGAAk8NAiAEQQFqIQdBACEGA0AgBiAFTwRAIAUhBiAIIQcMAwUgACAGaiAHIAZBAXZqIgQtAABBBHY6AAAgACAGQQFyaiAELQAAQQ9xOgAAIAZBAmohBgwBCwAACwALIAcgBU8NASAAIARBAWogByAKEFMiBhADDQELIAYhBEEAIQYgAUEAQTQQECEJQQAhBQNAIAQgBkcEQCAAIAZqIggtAAAiAUELSwRAQWwhBgwDBSAJIAFBAnRqIgEgASgCAEEBajYCACAGQQFqIQZBASAILQAAdEEBdSAFaiEFDAILAAsLQWwhBiAFRQ0AIAUQFEEBaiIBQQxLDQAgAyABNgIAQQFBASABdCAFayIDEBQiAXQgA0cNACAAIARqIAFBAWoiADoAACAJIABBAnRqIgAgACgCAEEBajYCACAJKAIEIgBBAkkgAEEBcXINACACIARBAWo2AgAgB0EBaiEGCyAKQZACaiQAIAYLxhEBDH8jAEHwAGsiBSQAQWwhCwJAIANBCkkNACACLwAAIQogAi8AAiEJIAIvAAQhByAFQQhqIAQQDgJAIAMgByAJIApqakEGaiIMSQ0AIAUtAAohCCAFQdgAaiACQQZqIgIgChAGIgsQAw0BIAVBQGsgAiAKaiICIAkQBiILEAMNASAFQShqIAIgCWoiAiAHEAYiCxADDQEgBUEQaiACIAdqIAMgDGsQBiILEAMNASAAIAFqIg9BfWohECAEQQRqIQZBASELIAAgAUEDakECdiIDaiIMIANqIgIgA2oiDiEDIAIhBCAMIQcDQCALIAMgEElxBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgCS0AAyELIAcgBiAFQUBrIAgQAkECdGoiCS8BADsAACAFQUBrIAktAAIQASAJLQADIQogBCAGIAVBKGogCBACQQJ0aiIJLwEAOwAAIAVBKGogCS0AAhABIAktAAMhCSADIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgDS0AAyENIAAgC2oiCyAGIAVB2ABqIAgQAkECdGoiAC8BADsAACAFQdgAaiAALQACEAEgAC0AAyEAIAcgCmoiCiAGIAVBQGsgCBACQQJ0aiIHLwEAOwAAIAVBQGsgBy0AAhABIActAAMhByAEIAlqIgkgBiAFQShqIAgQAkECdGoiBC8BADsAACAFQShqIAQtAAIQASAELQADIQQgAyANaiIDIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgACALaiEAIAcgCmohByAEIAlqIQQgAyANLQADaiEDIAVB2ABqEA0gBUFAaxANciAFQShqEA1yIAVBEGoQDXJFIQsMAQsLIAQgDksgByACS3INAEFsIQsgACAMSw0BIAxBfWohCQNAQQAgACAJSSAFQdgAahAEGwRAIAAgBiAFQdgAaiAIEAJBAnRqIgovAQA7AAAgBUHYAGogCi0AAhABIAAgCi0AA2oiACAGIAVB2ABqIAgQAkECdGoiCi8BADsAACAFQdgAaiAKLQACEAEgACAKLQADaiEADAEFIAxBfmohCgNAIAVB2ABqEAQgACAKS3JFBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgACAJLQADaiEADAELCwNAIAAgCk0EQCAAIAYgBUHYAGogCBACQQJ0aiIJLwEAOwAAIAVB2ABqIAktAAIQASAAIAktAANqIQAMAQsLAkAgACAMTw0AIAAgBiAFQdgAaiAIEAIiAEECdGoiDC0AADoAACAMLQADQQFGBEAgBUHYAGogDC0AAhABDAELIAUoAlxBH0sNACAFQdgAaiAGIABBAnRqLQACEAEgBSgCXEEhSQ0AIAVBIDYCXAsgAkF9aiEMA0BBACAHIAxJIAVBQGsQBBsEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiIAIAYgBUFAayAIEAJBAnRqIgcvAQA7AAAgBUFAayAHLQACEAEgACAHLQADaiEHDAEFIAJBfmohDANAIAVBQGsQBCAHIAxLckUEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwNAIAcgDE0EQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwJAIAcgAk8NACAHIAYgBUFAayAIEAIiAEECdGoiAi0AADoAACACLQADQQFGBEAgBUFAayACLQACEAEMAQsgBSgCREEfSw0AIAVBQGsgBiAAQQJ0ai0AAhABIAUoAkRBIUkNACAFQSA2AkQLIA5BfWohAgNAQQAgBCACSSAFQShqEAQbBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2oiACAGIAVBKGogCBACQQJ0aiIELwEAOwAAIAVBKGogBC0AAhABIAAgBC0AA2ohBAwBBSAOQX5qIQIDQCAFQShqEAQgBCACS3JFBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsDQCAEIAJNBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsCQCAEIA5PDQAgBCAGIAVBKGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBKGogAi0AAhABDAELIAUoAixBH0sNACAFQShqIAYgAEECdGotAAIQASAFKAIsQSFJDQAgBUEgNgIsCwNAQQAgAyAQSSAFQRBqEAQbBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2oiACAGIAVBEGogCBACQQJ0aiICLwEAOwAAIAVBEGogAi0AAhABIAAgAi0AA2ohAwwBBSAPQX5qIQIDQCAFQRBqEAQgAyACS3JFBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsDQCADIAJNBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsCQCADIA9PDQAgAyAGIAVBEGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBEGogAi0AAhABDAELIAUoAhRBH0sNACAFQRBqIAYgAEECdGotAAIQASAFKAIUQSFJDQAgBUEgNgIUCyABQWwgBUHYAGoQCiAFQUBrEApxIAVBKGoQCnEgBUEQahAKcRshCwwJCwAACwALAAALAAsAAAsACwAACwALQWwhCwsgBUHwAGokACALC7UEAQ5/IwBBEGsiBiQAIAZBBGogABAOQVQhBQJAIARB3AtJDQAgBi0ABCEHIANB8ARqQQBB7AAQECEIIAdBDEsNACADQdwJaiIJIAggBkEIaiAGQQxqIAEgAhAxIhAQA0UEQCAGKAIMIgQgB0sNASADQdwFaiEPIANBpAVqIREgAEEEaiESIANBqAVqIQEgBCEFA0AgBSICQX9qIQUgCCACQQJ0aigCAEUNAAsgAkEBaiEOQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgASALaiAKNgIAIAVBAWohBSAKIAxqIQoMAQsLIAEgCjYCAEEAIQUgBigCCCELA0AgBSALRkUEQCABIAUgCWotAAAiDEECdGoiDSANKAIAIg1BAWo2AgAgDyANQQF0aiINIAw6AAEgDSAFOgAAIAVBAWohBQwBCwtBACEBIANBADYCqAUgBEF/cyAHaiEJQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgAyALaiABNgIAIAwgBSAJanQgAWohASAFQQFqIQUMAQsLIAcgBEEBaiIBIAJrIgRrQQFqIQgDQEEBIQUgBCAIT0UEQANAIAUgDk9FBEAgBUECdCIJIAMgBEE0bGpqIAMgCWooAgAgBHY2AgAgBUEBaiEFDAELCyAEQQFqIQQMAQsLIBIgByAPIAogESADIAIgARBkIAZBAToABSAGIAc6AAYgACAGKAIENgIACyAQIQULIAZBEGokACAFC8ENAQt/IwBB8ABrIgUkAEFsIQkCQCADQQpJDQAgAi8AACEKIAIvAAIhDCACLwAEIQYgBUEIaiAEEA4CQCADIAYgCiAMampBBmoiDUkNACAFLQAKIQcgBUHYAGogAkEGaiICIAoQBiIJEAMNASAFQUBrIAIgCmoiAiAMEAYiCRADDQEgBUEoaiACIAxqIgIgBhAGIgkQAw0BIAVBEGogAiAGaiADIA1rEAYiCRADDQEgACABaiIOQX1qIQ8gBEEEaiEGQQEhCSAAIAFBA2pBAnYiAmoiCiACaiIMIAJqIg0hAyAMIQQgCiECA0AgCSADIA9JcQRAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAACAGIAVBQGsgBxACQQF0aiIILQAAIQsgBUFAayAILQABEAEgAiALOgAAIAYgBUEoaiAHEAJBAXRqIggtAAAhCyAFQShqIAgtAAEQASAEIAs6AAAgBiAFQRBqIAcQAkEBdGoiCC0AACELIAVBEGogCC0AARABIAMgCzoAACAGIAVB2ABqIAcQAkEBdGoiCC0AACELIAVB2ABqIAgtAAEQASAAIAs6AAEgBiAFQUBrIAcQAkEBdGoiCC0AACELIAVBQGsgCC0AARABIAIgCzoAASAGIAVBKGogBxACQQF0aiIILQAAIQsgBUEoaiAILQABEAEgBCALOgABIAYgBUEQaiAHEAJBAXRqIggtAAAhCyAFQRBqIAgtAAEQASADIAs6AAEgA0ECaiEDIARBAmohBCACQQJqIQIgAEECaiEAIAkgBUHYAGoQDUVxIAVBQGsQDUVxIAVBKGoQDUVxIAVBEGoQDUVxIQkMAQsLIAQgDUsgAiAMS3INAEFsIQkgACAKSw0BIApBfWohCQNAIAVB2ABqEAQgACAJT3JFBEAgBiAFQdgAaiAHEAJBAXRqIggtAAAhCyAFQdgAaiAILQABEAEgACALOgAAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAASAAQQJqIQAMAQsLA0AgBUHYAGoQBCAAIApPckUEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCwNAIAAgCkkEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCyAMQX1qIQADQCAFQUBrEAQgAiAAT3JFBEAgBiAFQUBrIAcQAkEBdGoiCi0AACEJIAVBQGsgCi0AARABIAIgCToAACAGIAVBQGsgBxACQQF0aiIKLQAAIQkgBUFAayAKLQABEAEgAiAJOgABIAJBAmohAgwBCwsDQCAFQUBrEAQgAiAMT3JFBEAgBiAFQUBrIAcQAkEBdGoiAC0AACEKIAVBQGsgAC0AARABIAIgCjoAACACQQFqIQIMAQsLA0AgAiAMSQRAIAYgBUFAayAHEAJBAXRqIgAtAAAhCiAFQUBrIAAtAAEQASACIAo6AAAgAkEBaiECDAELCyANQX1qIQADQCAFQShqEAQgBCAAT3JFBEAgBiAFQShqIAcQAkEBdGoiAi0AACEKIAVBKGogAi0AARABIAQgCjoAACAGIAVBKGogBxACQQF0aiICLQAAIQogBUEoaiACLQABEAEgBCAKOgABIARBAmohBAwBCwsDQCAFQShqEAQgBCANT3JFBEAgBiAFQShqIAcQAkEBdGoiAC0AACECIAVBKGogAC0AARABIAQgAjoAACAEQQFqIQQMAQsLA0AgBCANSQRAIAYgBUEoaiAHEAJBAXRqIgAtAAAhAiAFQShqIAAtAAEQASAEIAI6AAAgBEEBaiEEDAELCwNAIAVBEGoQBCADIA9PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIAYgBUEQaiAHEAJBAXRqIgAtAAAhAiAFQRBqIAAtAAEQASADIAI6AAEgA0ECaiEDDAELCwNAIAVBEGoQBCADIA5PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIANBAWohAwwBCwsDQCADIA5JBEAgBiAFQRBqIAcQAkEBdGoiAC0AACECIAVBEGogAC0AARABIAMgAjoAACADQQFqIQMMAQsLIAFBbCAFQdgAahAKIAVBQGsQCnEgBUEoahAKcSAFQRBqEApxGyEJDAELQWwhCQsgBUHwAGokACAJC8oCAQR/IwBBIGsiBSQAIAUgBBAOIAUtAAIhByAFQQhqIAIgAxAGIgIQA0UEQCAEQQRqIQIgACABaiIDQX1qIQQDQCAFQQhqEAQgACAET3JFBEAgAiAFQQhqIAcQAkEBdGoiBi0AACEIIAVBCGogBi0AARABIAAgCDoAACACIAVBCGogBxACQQF0aiIGLQAAIQggBUEIaiAGLQABEAEgACAIOgABIABBAmohAAwBCwsDQCAFQQhqEAQgACADT3JFBEAgAiAFQQhqIAcQAkEBdGoiBC0AACEGIAVBCGogBC0AARABIAAgBjoAACAAQQFqIQAMAQsLA0AgACADT0UEQCACIAVBCGogBxACQQF0aiIELQAAIQYgBUEIaiAELQABEAEgACAGOgAAIABBAWohAAwBCwsgAUFsIAVBCGoQChshAgsgBUEgaiQAIAILtgMBCX8jAEEQayIGJAAgBkEANgIMIAZBADYCCEFUIQQCQAJAIANBQGsiDCADIAZBCGogBkEMaiABIAIQMSICEAMNACAGQQRqIAAQDiAGKAIMIgcgBi0ABEEBaksNASAAQQRqIQogBkEAOgAFIAYgBzoABiAAIAYoAgQ2AgAgB0EBaiEJQQEhBANAIAQgCUkEQCADIARBAnRqIgEoAgAhACABIAU2AgAgACAEQX9qdCAFaiEFIARBAWohBAwBCwsgB0EBaiEHQQAhBSAGKAIIIQkDQCAFIAlGDQEgAyAFIAxqLQAAIgRBAnRqIgBBASAEdEEBdSILIAAoAgAiAWoiADYCACAHIARrIQhBACEEAkAgC0EDTQRAA0AgBCALRg0CIAogASAEakEBdGoiACAIOgABIAAgBToAACAEQQFqIQQMAAALAAsDQCABIABPDQEgCiABQQF0aiIEIAg6AAEgBCAFOgAAIAQgCDoAAyAEIAU6AAIgBCAIOgAFIAQgBToABCAEIAg6AAcgBCAFOgAGIAFBBGohAQwAAAsACyAFQQFqIQUMAAALAAsgAiEECyAGQRBqJAAgBAutAQECfwJAQYQgKAIAIABHIAAoAgBBAXYiAyABa0F4aiICQXhxQQhHcgR/IAIFIAMQJ0UNASACQQhqC0EQSQ0AIAAgACgCACICQQFxIAAgAWpBD2pBeHEiASAAa0EBdHI2AgAgASAANgIEIAEgASgCAEEBcSAAIAJBAXZqIAFrIgJBAXRyNgIAQYQgIAEgAkH/////B3FqQQRqQYQgKAIAIABGGyABNgIAIAEQJQsLygIBBX8CQAJAAkAgAEEIIABBCEsbZ0EfcyAAaUEBR2oiAUEESSAAIAF2cg0AIAFBAnRB/B5qKAIAIgJFDQADQCACQXhqIgMoAgBBAXZBeGoiBSAATwRAIAIgBUEIIAVBCEsbZ0Efc0ECdEGAH2oiASgCAEYEQCABIAIoAgQ2AgALDAMLIARBHksNASAEQQFqIQQgAigCBCICDQALC0EAIQMgAUEgTw0BA0AgAUECdEGAH2ooAgAiAkUEQCABQR5LIQIgAUEBaiEBIAJFDQEMAwsLIAIgAkF4aiIDKAIAQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgBGBEAgASACKAIENgIACwsgAigCACIBBEAgASACKAIENgIECyACKAIEIgEEQCABIAIoAgA2AgALIAMgAygCAEEBcjYCACADIAAQNwsgAwvhCwINfwV+IwBB8ABrIgckACAHIAAoAvDhASIINgJcIAEgAmohDSAIIAAoAoDiAWohDwJAAkAgBUUEQCABIQQMAQsgACgCxOABIRAgACgCwOABIREgACgCvOABIQ4gAEEBNgKM4QFBACEIA0AgCEEDRwRAIAcgCEECdCICaiAAIAJqQazQAWooAgA2AkQgCEEBaiEIDAELC0FsIQwgB0EYaiADIAQQBhADDQEgB0EsaiAHQRhqIAAoAgAQEyAHQTRqIAdBGGogACgCCBATIAdBPGogB0EYaiAAKAIEEBMgDUFgaiESIAEhBEEAIQwDQCAHKAIwIAcoAixBA3RqKQIAIhRCEIinQf8BcSEIIAcoAkAgBygCPEEDdGopAgAiFUIQiKdB/wFxIQsgBygCOCAHKAI0QQN0aikCACIWQiCIpyEJIBVCIIghFyAUQiCIpyECAkAgFkIQiKdB/wFxIgNBAk8EQAJAIAZFIANBGUlyRQRAIAkgB0EYaiADQSAgBygCHGsiCiAKIANLGyIKEAUgAyAKayIDdGohCSAHQRhqEAQaIANFDQEgB0EYaiADEAUgCWohCQwBCyAHQRhqIAMQBSAJaiEJIAdBGGoQBBoLIAcpAkQhGCAHIAk2AkQgByAYNwNIDAELAkAgA0UEQCACBEAgBygCRCEJDAMLIAcoAkghCQwBCwJAAkAgB0EYakEBEAUgCSACRWpqIgNBA0YEQCAHKAJEQX9qIgMgA0VqIQkMAQsgA0ECdCAHaigCRCIJIAlFaiEJIANBAUYNAQsgByAHKAJINgJMCwsgByAHKAJENgJIIAcgCTYCRAsgF6chAyALBEAgB0EYaiALEAUgA2ohAwsgCCALakEUTwRAIAdBGGoQBBoLIAgEQCAHQRhqIAgQBSACaiECCyAHQRhqEAQaIAcgB0EYaiAUQhiIp0H/AXEQCCAUp0H//wNxajYCLCAHIAdBGGogFUIYiKdB/wFxEAggFadB//8DcWo2AjwgB0EYahAEGiAHIAdBGGogFkIYiKdB/wFxEAggFqdB//8DcWo2AjQgByACNgJgIAcoAlwhCiAHIAk2AmggByADNgJkAkACQAJAIAQgAiADaiILaiASSw0AIAIgCmoiEyAPSw0AIA0gBGsgC0Egak8NAQsgByAHKQNoNwMQIAcgBykDYDcDCCAEIA0gB0EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgHUIgiKchAgJAIB9CEIinQf8BcSIDQQJPBEACQCAGRSADQRlJckUEQCAIIAdBKGogA0EgIAcoAixrIg0gDSADSxsiDRAFIAMgDWsiA3RqIQggB0EoahAEGiADRQ0BIAdBKGogAxAFIAhqIQgMAQsgB0EoaiADEAUgCGohCCAHQShqEAQaCyAHKQJUISEgByAINgJUIAcgITcDWAwBCwJAIANFBEAgAgRAIAcoAlQhCAwDCyAHKAJYIQgMAQsCQAJAIAdBKGpBARAFIAggAkVqaiIDQQNGBEAgBygCVEF/aiIDIANFaiEIDAELIANBAnQgB2ooAlQiCCAIRWohCCADQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAg2AlQLICCnIQMgCQRAIAdBKGogCRAFIANqIQMLIAkgC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgAmohAgsgB0EoahAEGiAHIAcoAmggAmoiCSADajYCaCAKIAwgCCAJSxsoAgAhDSAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogB0EoaiAfQhiIp0H/AXEQCCEOIAdB8ABqIARBBHRqIgsgCSANaiAIazYCDCALIAg2AgggCyADNgIEIAsgAjYCACAHIA4gH6dB//8DcWo2AkQgBEEBaiEEDAELCyAEIBdIDQEgEkFgaiEYIAdB4ABqIRogB0HkAGohGyABIQMDQCAHQShqEARBAksgBCAFTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEIIAcoAkggBygCREEDdGopAgAiH0IgiKchCSAeQiCIISAgHUIgiKchDAJAIB9CEIinQf8BcSICQQJPBEACQCAGRSACQRlJckUEQCAJIAdBKGogAkEgIAcoAixrIgogCiACSxsiChAFIAIgCmsiAnRqIQkgB0EoahAEGiACRQ0BIAdBKGogAhAFIAlqIQkMAQsgB0EoaiACEAUgCWohCSAHQShqEAQaCyAHKQJUISEgByAJNgJUIAcgITcDWAwBCwJAIAJFBEAgDARAIAcoAlQhCQwDCyAHKAJYIQkMAQsCQAJAIAdBKGpBARAFIAkgDEVqaiICQQNGBEAgBygCVEF/aiICIAJFaiEJDAELIAJBAnQgB2ooAlQiCSAJRWohCSACQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAk2AlQLICCnIRQgCARAIAdBKGogCBAFIBRqIRQLIAggC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgDGohDAsgB0EoahAEGiAHIAcoAmggDGoiGSAUajYCaCAbIBogCSAZSxsoAgAhHCAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogByAHQShqIB9CGIinQf8BcRAIIB+nQf//A3FqNgJEIAcgB0HwAGogBEEDcUEEdGoiDSkDCCIdNwPIASAHIA0pAwAiHjcDwAECQAJAAkAgBygCvAEiDiAepyICaiIWIBNLDQAgAyAHKALEASIKIAJqIgtqIBhLDQAgEiADayALQSBqTw0BCyAHIAcpA8gBNwMQIAcgBykDwAE3AwggAyASIAdBCGogB0G8AWogEyAPIBUgERAeIQsMAQsgAiADaiEIIAMgDhAHIAJBEU8EQCADQRBqIQIDQCACIA5BEGoiDhAHIAJBEGoiAiAISQ0ACwsgCCAdpyIOayECIAcgFjYCvAEgDiAIIA9rSwRAIA4gCCAVa0sEQEFsIQsMAgsgESACIA9rIgJqIhYgCmogEU0EQCAIIBYgChAPGgwCCyAIIBZBACACaxAPIQggByACIApqIgo2AsQBIAggAmshCCAPIQILIA5BEE8EQCAIIApqIQoDQCAIIAIQByACQRBqIQIgCEEQaiIIIApJDQALDAELAkAgDkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgDkECdCIKQcAeaigCAGoiAhAXIAIgCkHgHmooAgBrIQIgBygCxAEhCgwBCyAIIAIQDAsgCkEJSQ0AIAggCmohCiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAKSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAKSQ0ACwsgCxADBEAgCyEQDAQFIA0gDDYCACANIBkgHGogCWs2AgwgDSAJNgIIIA0gFDYCBCAEQQFqIQQgAyALaiEDDAILAAsLIAQgBUgNASAEIBdrIQtBACEEA0AgCyAFSARAIAcgB0HwAGogC0EDcUEEdGoiAikDCCIdNwPIASAHIAIpAwAiHjcDwAECQAJAAkAgBygCvAEiDCAepyICaiIKIBNLDQAgAyAHKALEASIJIAJqIhBqIBhLDQAgEiADayAQQSBqTw0BCyAHIAcpA8gBNwMgIAcgBykDwAE3AxggAyASIAdBGGogB0G8AWogEyAPIBUgERAeIRAMAQsgAiADaiEIIAMgDBAHIAJBEU8EQCADQRBqIQIDQCACIAxBEGoiDBAHIAJBEGoiAiAISQ0ACwsgCCAdpyIGayECIAcgCjYCvAEgBiAIIA9rSwRAIAYgCCAVa0sEQEFsIRAMAgsgESACIA9rIgJqIgwgCWogEU0EQCAIIAwgCRAPGgwCCyAIIAxBACACaxAPIQggByACIAlqIgk2AsQBIAggAmshCCAPIQILIAZBEE8EQCAIIAlqIQYDQCAIIAIQByACQRBqIQIgCEEQaiIIIAZJDQALDAELAkAgBkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgBkECdCIGQcAeaigCAGoiAhAXIAIgBkHgHmooAgBrIQIgBygCxAEhCQwBCyAIIAIQDAsgCUEJSQ0AIAggCWohBiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAGSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAGSQ0ACwsgEBADDQMgC0EBaiELIAMgEGohAwwBCwsDQCAEQQNHBEAgACAEQQJ0IgJqQazQAWogAiAHaigCVDYCACAEQQFqIQQMAQsLIAcoArwBIQgLQbp/IRAgEyAIayIAIBIgA2tLDQAgAwR/IAMgCCAAEAsgAGoFQQALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY0AAQMyIFEAMiBg0AIANBHzYCfCADIANB/ABqIANB+ABqIAQgBCAFaiAGGyIEIAEgAmoiAiAEaxAVIgUQAw0AIAMoAnwiBkEfSw0AIAMoAngiB0EJTw0AIABBiCBqIAMgBkGAC0GADCAHEBggA0E0NgJ8IAMgA0H8AGogA0H4AGogBCAFaiIEIAIgBGsQFSIFEAMNACADKAJ8IgZBNEsNACADKAJ4IgdBCk8NACAAQZAwaiADIAZBgA1B4A4gBxAYIANBIzYCfCADIANB/ABqIANB+ABqIAQgBWoiBCACIARrEBUiBRADDQAgAygCfCIGQSNLDQAgAygCeCIHQQpPDQAgACADIAZBwBBB0BEgBxAYIAQgBWoiBEEMaiIFIAJLDQAgAiAFayEFQQAhAgNAIAJBA0cEQCAEKAAAIgZBf2ogBU8NAiAAIAJBAnRqQZzQAWogBjYCACACQQFqIQIgBEEEaiEEDAELCyAEIAFrIQgLIANBgAFqJAAgCAtGAQN/IABBCGohAyAAKAIEIQJBACEAA0AgACACdkUEQCABIAMgAEEDdGotAAJBFktqIQEgAEEBaiEADAELCyABQQggAmt0C4YDAQV/Qbh/IQcCQCADRQ0AIAItAAAiBEUEQCABQQA2AgBBAUG4fyADQQFGGw8LAn8gAkEBaiIFIARBGHRBGHUiBkF/Sg0AGiAGQX9GBEAgA0EDSA0CIAUvAABBgP4BaiEEIAJBA2oMAQsgA0ECSA0BIAItAAEgBEEIdHJBgIB+aiEEIAJBAmoLIQUgASAENgIAIAVBAWoiASACIANqIgNLDQBBbCEHIABBEGogACAFLQAAIgVBBnZBI0EJIAEgAyABa0HAEEHQEUHwEiAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBmCBqIABBCGogBUEEdkEDcUEfQQggASABIAZqIAgbIgEgAyABa0GAC0GADEGAFyAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBoDBqIABBBGogBUECdkEDcUE0QQkgASABIAZqIAgbIgEgAyABa0GADUHgDkGQGSAAKAKM4QEgACgCnOIBIAQQHyIAEAMNACAAIAFqIAJrIQcLIAcLrQMBCn8jAEGABGsiCCQAAn9BUiACQf8BSw0AGkFUIANBDEsNABogAkEBaiELIABBBGohCUGAgAQgA0F/anRBEHUhCkEAIQJBASEEQQEgA3QiB0F/aiIMIQUDQCACIAtGRQRAAkAgASACQQF0Ig1qLwEAIgZB//8DRgRAIAkgBUECdGogAjoAAiAFQX9qIQVBASEGDAELIARBACAKIAZBEHRBEHVKGyEECyAIIA1qIAY7AQAgAkEBaiECDAELCyAAIAQ7AQIgACADOwEAIAdBA3YgB0EBdmpBA2ohBkEAIQRBACECA0AgBCALRkUEQCABIARBAXRqLgEAIQpBACEAA0AgACAKTkUEQCAJIAJBAnRqIAQ6AAIDQCACIAZqIAxxIgIgBUsNAAsgAEEBaiEADAELCyAEQQFqIQQMAQsLQX8gAg0AGkEAIQIDfyACIAdGBH9BAAUgCCAJIAJBAnRqIgAtAAJBAXRqIgEgAS8BACIBQQFqOwEAIAAgAyABEBRrIgU6AAMgACABIAVB/wFxdCAHazsBACACQQFqIQIMAQsLCyEFIAhBgARqJAAgBQvjBgEIf0FsIQcCQCACQQNJDQACQAJAAkACQCABLQAAIgNBA3EiCUEBaw4DAwEAAgsgACgCiOEBDQBBYg8LIAJBBUkNAkEDIQYgASgAACEFAn8CQAJAIANBAnZBA3EiCEF+aiIEQQFNBEAgBEEBaw0BDAILIAVBDnZB/wdxIQQgBUEEdkH/B3EhAyAIRQwCCyAFQRJ2IQRBBCEGIAVBBHZB//8AcSEDQQAMAQsgBUEEdkH//w9xIgNBgIAISw0DIAEtAARBCnQgBUEWdnIhBEEFIQZBAAshBSAEIAZqIgogAksNAgJAIANBgQZJDQAgACgCnOIBRQ0AQQAhAgNAIAJBg4ABSw0BIAJBQGshAgwAAAsACwJ/IAlBA0YEQCABIAZqIQEgAEHw4gFqIQIgACgCDCEGIAUEQCACIAMgASAEIAYQXwwCCyACIAMgASAEIAYQXQwBCyAAQbjQAWohAiABIAZqIQEgAEHw4gFqIQYgAEGo0ABqIQggBQRAIAggBiADIAEgBCACEF4MAQsgCCAGIAMgASAEIAIQXAsQAw0CIAAgAzYCgOIBIABBATYCiOEBIAAgAEHw4gFqNgLw4QEgCUECRgRAIAAgAEGo0ABqNgIMCyAAIANqIgBBiOMBakIANwAAIABBgOMBakIANwAAIABB+OIBakIANwAAIABB8OIBakIANwAAIAoPCwJ/AkACQAJAIANBAnZBA3FBf2oiBEECSw0AIARBAWsOAgACAQtBASEEIANBA3YMAgtBAiEEIAEvAABBBHYMAQtBAyEEIAEQIUEEdgsiAyAEaiIFQSBqIAJLBEAgBSACSw0CIABB8OIBaiABIARqIAMQCyEBIAAgAzYCgOIBIAAgATYC8OEBIAEgA2oiAEIANwAYIABCADcAECAAQgA3AAggAEIANwAAIAUPCyAAIAM2AoDiASAAIAEgBGo2AvDhASAFDwsCfwJAAkACQCADQQJ2QQNxQX9qIgRBAksNACAEQQFrDgIAAgELQQEhByADQQN2DAILQQIhByABLwAAQQR2DAELIAJBBEkgARAhIgJBj4CAAUtyDQFBAyEHIAJBBHYLIQIgAEHw4gFqIAEgB2otAAAgAkEgahAQIQEgACACNgKA4gEgACABNgLw4QEgB0EBaiEHCyAHC0sAIABC+erQ0OfJoeThADcDICAAQgA3AxggAELP1tO+0ser2UI3AxAgAELW64Lu6v2J9eAANwMIIABCADcDACAAQShqQQBBKBAQGgviAgICfwV+IABBKGoiASAAKAJIaiECAn4gACkDACIDQiBaBEAgACkDECIEQgeJIAApAwgiBUIBiXwgACkDGCIGQgyJfCAAKQMgIgdCEol8IAUQGSAEEBkgBhAZIAcQGQwBCyAAKQMYQsXP2bLx5brqJ3wLIAN8IQMDQCABQQhqIgAgAk0EQEIAIAEpAAAQCSADhUIbiUKHla+vmLbem55/fkLj3MqV/M7y9YV/fCEDIAAhAQwBCwsCQCABQQRqIgAgAksEQCABIQAMAQsgASgAAK1Ch5Wvr5i23puef34gA4VCF4lCz9bTvtLHq9lCfkL5893xmfaZqxZ8IQMLA0AgACACSQRAIAAxAABCxc/ZsvHluuonfiADhUILiUKHla+vmLbem55/fiEDIABBAWohAAwBCwsgA0IhiCADhULP1tO+0ser2UJ+IgNCHYggA4VC+fPd8Zn2masWfiIDQiCIIAOFC+8CAgJ/BH4gACAAKQMAIAKtfDcDAAJAAkAgACgCSCIDIAJqIgRBH00EQCABRQ0BIAAgA2pBKGogASACECAgACgCSCACaiEEDAELIAEgAmohAgJ/IAMEQCAAQShqIgQgA2ogAUEgIANrECAgACAAKQMIIAQpAAAQCTcDCCAAIAApAxAgACkAMBAJNwMQIAAgACkDGCAAKQA4EAk3AxggACAAKQMgIABBQGspAAAQCTcDICAAKAJIIQMgAEEANgJIIAEgA2tBIGohAQsgAUEgaiACTQsEQCACQWBqIQMgACkDICEFIAApAxghBiAAKQMQIQcgACkDCCEIA0AgCCABKQAAEAkhCCAHIAEpAAgQCSEHIAYgASkAEBAJIQYgBSABKQAYEAkhBSABQSBqIgEgA00NAAsgACAFNwMgIAAgBjcDGCAAIAc3AxAgACAINwMICyABIAJPDQEgAEEoaiABIAIgAWsiBBAgCyAAIAQ2AkgLCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQEBogAwVBun8LCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQCxogAwVBun8LC6gCAQZ/IwBBEGsiByQAIABB2OABaikDAEKAgIAQViEIQbh/IQUCQCAEQf//B0sNACAAIAMgBBBCIgUQAyIGDQAgACgCnOIBIQkgACAHQQxqIAMgAyAFaiAGGyIKIARBACAFIAYbayIGEEAiAxADBEAgAyEFDAELIAcoAgwhBCABRQRAQbp/IQUgBEEASg0BCyAGIANrIQUgAyAKaiEDAkAgCQRAIABBADYCnOIBDAELAkACQAJAIARBBUgNACAAQdjgAWopAwBCgICACFgNAAwBCyAAQQA2ApziAQwBCyAAKAIIED8hBiAAQQA2ApziASAGQRRPDQELIAAgASACIAMgBSAEIAgQOSEFDAELIAAgASACIAMgBSAEIAgQOiEFCyAHQRBqJAAgBQtnACAAQdDgAWogASACIAAoAuzhARAuIgEQAwRAIAEPC0G4fyECAkAgAQ0AIABB7OABaigCACIBBEBBYCECIAAoApjiASABRw0BC0EAIQIgAEHw4AFqKAIARQ0AIABBkOEBahBDCyACCycBAX8QVyIERQRAQUAPCyAEIAAgASACIAMgBBBLEE8hACAEEFYgAAs/AQF/AkACQAJAIAAoAqDiAUEBaiIBQQJLDQAgAUEBaw4CAAECCyAAEDBBAA8LIABBADYCoOIBCyAAKAKU4gELvAMCB38BfiMAQRBrIgkkAEG4fyEGAkAgBCgCACIIQQVBCSAAKALs4QEiBRtJDQAgAygCACIHQQFBBSAFGyAFEC8iBRADBEAgBSEGDAELIAggBUEDakkNACAAIAcgBRBJIgYQAw0AIAEgAmohCiAAQZDhAWohCyAIIAVrIQIgBSAHaiEHIAEhBQNAIAcgAiAJECwiBhADDQEgAkF9aiICIAZJBEBBuH8hBgwCCyAJKAIAIghBAksEQEFsIQYMAgsgB0EDaiEHAn8CQAJAAkAgCEEBaw4CAgABCyAAIAUgCiAFayAHIAYQSAwCCyAFIAogBWsgByAGEEcMAQsgBSAKIAVrIActAAAgCSgCCBBGCyIIEAMEQCAIIQYMAgsgACgC8OABBEAgCyAFIAgQRQsgAiAGayECIAYgB2ohByAFIAhqIQUgCSgCBEUNAAsgACkD0OABIgxCf1IEQEFsIQYgDCAFIAFrrFINAQsgACgC8OABBEBBaiEGIAJBBEkNASALEEQhDCAHKAAAIAynRw0BIAdBBGohByACQXxqIQILIAMgBzYCACAEIAI2AgAgBSABayEGCyAJQRBqJAAgBgsuACAAECsCf0EAQQAQAw0AGiABRSACRXJFBEBBYiAAIAEgAhA9EAMNARoLQQALCzcAIAEEQCAAIAAoAsTgASABKAIEIAEoAghqRzYCnOIBCyAAECtBABADIAFFckUEQCAAIAEQWwsL0QIBB38jAEEQayIGJAAgBiAENgIIIAYgAzYCDCAFBEAgBSgCBCEKIAUoAgghCQsgASEIAkACQANAIAAoAuzhARAWIQsCQANAIAQgC0kNASADKAAAQXBxQdDUtMIBRgRAIAMgBBAiIgcQAw0EIAQgB2shBCADIAdqIQMMAQsLIAYgAzYCDCAGIAQ2AggCQCAFBEAgACAFEE5BACEHQQAQA0UNAQwFCyAAIAogCRBNIgcQAw0ECyAAIAgQUCAMQQFHQQAgACAIIAIgBkEMaiAGQQhqEEwiByIDa0EAIAMQAxtBCkdyRQRAQbh/IQcMBAsgBxADDQMgAiAHayECIAcgCGohCEEBIQwgBigCDCEDIAYoAgghBAwBCwsgBiADNgIMIAYgBDYCCEG4fyEHIAQNASAIIAFrIQcMAQsgBiADNgIMIAYgBDYCCAsgBkEQaiQAIAcLRgECfyABIAAoArjgASICRwRAIAAgAjYCxOABIAAgATYCuOABIAAoArzgASEDIAAgATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEEdCAAbiECCyAAQQh2IgEgAkEYbCIAQYwIaigCAGwgAEGICGooAgBqIgJBA3YgAmogAEGACGooAgAgAEGECGooAgAgAWxqSQs3ACAAIAMgBCAFQYAQEDMiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQMgVBuH8LC78DAQN/IwBBIGsiBSQAIAVBCGogAiADEAYiAhADRQRAIAAgAWoiB0F9aiEGIAUgBBAOIARBBGohAiAFLQACIQMDQEEAIAAgBkkgBUEIahAEGwRAIAAgAiAFQQhqIAMQAkECdGoiBC8BADsAACAFQQhqIAQtAAIQASAAIAQtAANqIgQgAiAFQQhqIAMQAkECdGoiAC8BADsAACAFQQhqIAAtAAIQASAEIAAtAANqIQAMAQUgB0F+aiEEA0AgBUEIahAEIAAgBEtyRQRAIAAgAiAFQQhqIAMQAkECdGoiBi8BADsAACAFQQhqIAYtAAIQASAAIAYtAANqIQAMAQsLA0AgACAES0UEQCAAIAIgBUEIaiADEAJBAnRqIgYvAQA7AAAgBUEIaiAGLQACEAEgACAGLQADaiEADAELCwJAIAAgB08NACAAIAIgBUEIaiADEAIiA0ECdGoiAC0AADoAACAALQADQQFGBEAgBUEIaiAALQACEAEMAQsgBSgCDEEfSw0AIAVBCGogAiADQQJ0ai0AAhABIAUoAgxBIUkNACAFQSA2AgwLIAFBbCAFQQhqEAobIQILCwsgBUEgaiQAIAILkgIBBH8jAEFAaiIJJAAgCSADQTQQCyEDAkAgBEECSA0AIAMgBEECdGooAgAhCSADQTxqIAgQIyADQQE6AD8gAyACOgA+QQAhBCADKAI8IQoDQCAEIAlGDQEgACAEQQJ0aiAKNgEAIARBAWohBAwAAAsAC0EAIQkDQCAGIAlGRQRAIAMgBSAJQQF0aiIKLQABIgtBAnRqIgwoAgAhBCADQTxqIAotAABBCHQgCGpB//8DcRAjIANBAjoAPyADIAcgC2siCiACajoAPiAEQQEgASAKa3RqIQogAygCPCELA0AgACAEQQJ0aiALNgEAIARBAWoiBCAKSQ0ACyAMIAo2AgAgCUEBaiEJDAELCyADQUBrJAALowIBCX8jAEHQAGsiCSQAIAlBEGogBUE0EAsaIAcgBmshDyAHIAFrIRADQAJAIAMgCkcEQEEBIAEgByACIApBAXRqIgYtAAEiDGsiCGsiC3QhDSAGLQAAIQ4gCUEQaiAMQQJ0aiIMKAIAIQYgCyAPTwRAIAAgBkECdGogCyAIIAUgCEE0bGogCCAQaiIIQQEgCEEBShsiCCACIAQgCEECdGooAgAiCEEBdGogAyAIayAHIA4QYyAGIA1qIQgMAgsgCUEMaiAOECMgCUEBOgAPIAkgCDoADiAGIA1qIQggCSgCDCELA0AgBiAITw0CIAAgBkECdGogCzYBACAGQQFqIQYMAAALAAsgCUHQAGokAA8LIAwgCDYCACAKQQFqIQoMAAALAAs0ACAAIAMgBCAFEDYiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQNAVBuH8LCyMAIAA/AEEQdGtB//8DakEQdkAAQX9GBEBBAA8LQQAQAEEBCzsBAX8gAgRAA0AgACABIAJBgCAgAkGAIEkbIgMQCyEAIAFBgCBqIQEgAEGAIGohACACIANrIgINAAsLCwYAIAAQAwsLqBUJAEGICAsNAQAAAAEAAAACAAAAAgBBoAgLswYBAAAAAQAAAAIAAAACAAAAJgAAAIIAAAAhBQAASgAAAGcIAAAmAAAAwAEAAIAAAABJBQAASgAAAL4IAAApAAAALAIAAIAAAABJBQAASgAAAL4IAAAvAAAAygIAAIAAAACKBQAASgAAAIQJAAA1AAAAcwMAAIAAAACdBQAASgAAAKAJAAA9AAAAgQMAAIAAAADrBQAASwAAAD4KAABEAAAAngMAAIAAAABNBgAASwAAAKoKAABLAAAAswMAAIAAAADBBgAATQAAAB8NAABNAAAAUwQAAIAAAAAjCAAAUQAAAKYPAABUAAAAmQQAAIAAAABLCQAAVwAAALESAABYAAAA2gQAAIAAAABvCQAAXQAAACMUAABUAAAARQUAAIAAAABUCgAAagAAAIwUAABqAAAArwUAAIAAAAB2CQAAfAAAAE4QAAB8AAAA0gIAAIAAAABjBwAAkQAAAJAHAACSAAAAAAAAAAEAAAABAAAABQAAAA0AAAAdAAAAPQAAAH0AAAD9AAAA/QEAAP0DAAD9BwAA/Q8AAP0fAAD9PwAA/X8AAP3/AAD9/wEA/f8DAP3/BwD9/w8A/f8fAP3/PwD9/38A/f//AP3//wH9//8D/f//B/3//w/9//8f/f//P/3//38AAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABEAAAASAAAAEwAAABQAAAAVAAAAFgAAABcAAAAYAAAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAKAAAACwAAAAwAAAANAAAADgAAAA8AAAAQAAAAEQAAABIAAAATAAAAFAAAABUAAAAWAAAAFwAAABgAAAAZAAAAGgAAABsAAAAcAAAAHQAAAB4AAAAfAAAAIAAAACEAAAAiAAAAIwAAACUAAAAnAAAAKQAAACsAAAAvAAAAMwAAADsAAABDAAAAUwAAAGMAAACDAAAAAwEAAAMCAAADBAAAAwgAAAMQAAADIAAAA0AAAAOAAAADAAEAQeAPC1EBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAEAAAABQAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAABAAQcQQC4sBAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABIAAAAUAAAAFgAAABgAAAAcAAAAIAAAACgAAAAwAAAAQAAAAIAAAAAAAQAAAAIAAAAEAAAACAAAABAAAAAgAAAAQAAAAIAAAAAAAQBBkBIL5gQBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAAAEAAAAEAAAACAAAAAAAAAABAAEBBgAAAAAAAAQAAAAAEAAABAAAAAAgAAAFAQAAAAAAAAUDAAAAAAAABQQAAAAAAAAFBgAAAAAAAAUHAAAAAAAABQkAAAAAAAAFCgAAAAAAAAUMAAAAAAAABg4AAAAAAAEFEAAAAAAAAQUUAAAAAAABBRYAAAAAAAIFHAAAAAAAAwUgAAAAAAAEBTAAAAAgAAYFQAAAAAAABwWAAAAAAAAIBgABAAAAAAoGAAQAAAAADAYAEAAAIAAABAAAAAAAAAAEAQAAAAAAAAUCAAAAIAAABQQAAAAAAAAFBQAAACAAAAUHAAAAAAAABQgAAAAgAAAFCgAAAAAAAAULAAAAAAAABg0AAAAgAAEFEAAAAAAAAQUSAAAAIAABBRYAAAAAAAIFGAAAACAAAwUgAAAAAAADBSgAAAAAAAYEQAAAABAABgRAAAAAIAAHBYAAAAAAAAkGAAIAAAAACwYACAAAMAAABAAAAAAQAAAEAQAAACAAAAUCAAAAIAAABQMAAAAgAAAFBQAAACAAAAUGAAAAIAAABQgAAAAgAAAFCQAAACAAAAULAAAAIAAABQwAAAAAAAAGDwAAACAAAQUSAAAAIAABBRQAAAAgAAIFGAAAACAAAgUcAAAAIAADBSgAAAAgAAQFMAAAAAAAEAYAAAEAAAAPBgCAAAAAAA4GAEAAAAAADQYAIABBgBcLhwIBAAEBBQAAAAAAAAUAAAAAAAAGBD0AAAAAAAkF/QEAAAAADwX9fwAAAAAVBf3/HwAAAAMFBQAAAAAABwR9AAAAAAAMBf0PAAAAABIF/f8DAAAAFwX9/38AAAAFBR0AAAAAAAgE/QAAAAAADgX9PwAAAAAUBf3/DwAAAAIFAQAAABAABwR9AAAAAAALBf0HAAAAABEF/f8BAAAAFgX9/z8AAAAEBQ0AAAAQAAgE/QAAAAAADQX9HwAAAAATBf3/BwAAAAEFAQAAABAABgQ9AAAAAAAKBf0DAAAAABAF/f8AAAAAHAX9//8PAAAbBf3//wcAABoF/f//AwAAGQX9//8BAAAYBf3//wBBkBkLhgQBAAEBBgAAAAAAAAYDAAAAAAAABAQAAAAgAAAFBQAAAAAAAAUGAAAAAAAABQgAAAAAAAAFCQAAAAAAAAULAAAAAAAABg0AAAAAAAAGEAAAAAAAAAYTAAAAAAAABhYAAAAAAAAGGQAAAAAAAAYcAAAAAAAABh8AAAAAAAAGIgAAAAAAAQYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",pn=new WeakMap;let fn,mn=0;class gn extends n.Loader{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new Gr,this.workerSourceURL="",this.workerConfig=null,"undefined"!=typeof MSC_TRANSCODER&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(e){return this.transcoderPath=e,this}setWorkerLimit(e){return this.workerPool.setWorkerLimit(e),this}async detectSupportAsync(e){return this.workerConfig={astcSupported:await e.hasFeatureAsync("texture-compression-astc"),etc1Supported:await e.hasFeatureAsync("texture-compression-etc1"),etc2Supported:await e.hasFeatureAsync("texture-compression-etc2"),dxtSupported:await e.hasFeatureAsync("texture-compression-bc"),bptcSupported:await e.hasFeatureAsync("texture-compression-bptc"),pvrtcSupported:await e.hasFeatureAsync("texture-compression-pvrtc")},this}detectSupport(e){return!0===e.isWebGPURenderer?this.workerConfig={astcSupported:e.hasFeature("texture-compression-astc"),etc1Supported:e.hasFeature("texture-compression-etc1"),etc2Supported:e.hasFeature("texture-compression-etc2"),dxtSupported:e.hasFeature("texture-compression-bc"),bptcSupported:e.hasFeature("texture-compression-bptc"),pvrtcSupported:e.hasFeature("texture-compression-pvrtc")}:this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),etc1Supported:e.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:e.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:e.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:e.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:e.extensions.has("WEBGL_compressed_texture_pvrtc")||e.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},this}init(){if(!this.transcoderPending){const e=new n.FileLoader(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),r=new n.FileLoader(this.manager);r.setPath(this.transcoderPath),r.setResponseType("arraybuffer"),r.setWithCredentials(this.withCredentials);const i=r.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,i]).then((e=>{let[t,r]=e;const n=gn.BasisWorker.toString(),i=["/* constants */","let _EngineFormat = "+JSON.stringify(gn.EngineFormat),"let _TranscoderFormat = "+JSON.stringify(gn.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(gn.BasisFormat),"/* basis_transcoder.js */",t,"/* worker */",n.substring(n.indexOf("{")+1,n.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([i])),this.transcoderBinary=r,this.workerPool.setWorkerCreator((()=>{const e=new Worker(this.workerSourceURL),t=this.transcoderBinary.slice(0);return e.postMessage({type:"init",config:this.workerConfig,transcoderBinary:t},[t]),e}))})),mn>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),mn++}return this.transcoderPending}load(e,t,r,i){if(null===this.workerConfig)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const s=new n.FileLoader(this.manager);s.setResponseType("arraybuffer"),s.setWithCredentials(this.withCredentials),s.load(e,(e=>{this.parse(e,t,i)}),r,i)}parse(e,t,r){if(null===this.workerConfig)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");if(pn.has(e))return pn.get(e).promise.then(t).catch(r);this._createTexture(e).then((e=>t?t(e):null)).catch(r)}_createTextureFrom(e,t){const{faces:r,width:i,height:s,format:o,type:a,error:l,dfdFlags:c}=e;if("error"===a)return Promise.reject(l);let u;if(6===t.faceCount)u=new n.CompressedCubeTexture(r,o,n.UnsignedByteType);else{const e=r[0].mipmaps;u=t.layerCount>1?new n.CompressedArrayTexture(e,i,s,t.layerCount,o,n.UnsignedByteType):new n.CompressedTexture(e,i,s,o,n.UnsignedByteType)}return u.minFilter=1===r[0].mipmaps.length?n.LinearFilter:n.LinearMipmapLinearFilter,u.magFilter=n.LinearFilter,u.generateMipmaps=!1,u.needsUpdate=!0,u.colorSpace=xn(t),u.premultiplyAlpha=!!(1&c),u}async _createTexture(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=function(e){const t=new Uint8Array(e.buffer,e.byteOffset,sn.length);if(t[0]!==sn[0]||t[1]!==sn[1]||t[2]!==sn[2]||t[3]!==sn[3]||t[4]!==sn[4]||t[5]!==sn[5]||t[6]!==sn[6]||t[7]!==sn[7]||t[8]!==sn[8]||t[9]!==sn[9]||t[10]!==sn[10]||t[11]!==sn[11])throw new Error("Missing KTX 2.0 identifier.");const r=new rn,n=17*Uint32Array.BYTES_PER_ELEMENT,i=new nn(e,sn.length,n,!0);r.vkFormat=i._nextUint32(),r.typeSize=i._nextUint32(),r.pixelWidth=i._nextUint32(),r.pixelHeight=i._nextUint32(),r.pixelDepth=i._nextUint32(),r.layerCount=i._nextUint32(),r.faceCount=i._nextUint32();const s=i._nextUint32();r.supercompressionScheme=i._nextUint32();const o=i._nextUint32(),a=i._nextUint32(),l=i._nextUint32(),c=i._nextUint32(),u=i._nextUint64(),h=i._nextUint64(),d=new nn(e,sn.length+n,3*s*8,!0);for(let t=0;t{const t=new hn;await t.init(),e(t)}))),r=await fn);const i=[];for(let s=0;s>s),a=Math.max(1,e.pixelHeight>>s),l=e.pixelDepth?Math.max(1,e.pixelDepth>>s):0,c=e.levels[s];let u,h;if(0===e.supercompressionScheme)u=c.levelData;else{if(2!==e.supercompressionScheme)throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");u=r.decode(c.levelData,c.uncompressedByteLength)}h=vn[t]===n.FloatType?new Float32Array(u.buffer,u.byteOffset,u.byteLength/Float32Array.BYTES_PER_ELEMENT):vn[t]===n.HalfFloatType?new Uint16Array(u.buffer,u.byteOffset,u.byteLength/Uint16Array.BYTES_PER_ELEMENT):u,i.push({data:h,width:o,height:a,depth:l})}let s;if(An.has(yn[t]))s=0===e.pixelDepth?new n.DataTexture(i[0].data,e.pixelWidth,e.pixelHeight):new n.Data3DTexture(i[0].data,e.pixelWidth,e.pixelHeight,e.pixelDepth);else{if(e.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");s=new n.CompressedTexture(i,e.pixelWidth,e.pixelHeight)}return s.mipmaps=i,s.type=vn[t],s.format=yn[t],s.colorSpace=xn(e),s.needsUpdate=!0,Promise.resolve(s)}(r);const i=this.init().then((()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:t},[e]))).then((e=>this._createTextureFrom(e.data,r)));return pn.set(e,{promise:i}),i}dispose(){return this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),mn--,this}}gn.BasisFormat={ETC1S:0,UASTC_4x4:1},gn.TranscoderFormat={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16},gn.EngineFormat={RGBAFormat:n.RGBAFormat,RGBA_ASTC_4x4_Format:n.RGBA_ASTC_4x4_Format,RGBA_BPTC_Format:n.RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:n.RGBA_ETC2_EAC_Format,RGBA_PVRTC_4BPPV1_Format:n.RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT5_Format:n.RGBA_S3TC_DXT5_Format,RGB_ETC1_Format:n.RGB_ETC1_Format,RGB_ETC2_Format:n.RGB_ETC2_Format,RGB_PVRTC_4BPPV1_Format:n.RGB_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT1_Format:n.RGBA_S3TC_DXT1_Format},gn.BasisWorker=function(){let e,t,r;const n=_EngineFormat,i=_TranscoderFormat,s=_BasisFormat;self.addEventListener("message",(function(o){const h=o.data;switch(h.type){case"init":e=h.config,d=h.transcoderBinary,t=new Promise((e=>{r={wasmBinary:d,onRuntimeInitialized:e},BASIS(r)})).then((()=>{r.initializeBasis(),void 0===r.KTX2File&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")}));break;case"transcode":t.then((()=>{try{const{faces:t,buffers:o,width:d,height:p,hasAlpha:f,format:m,dfdFlags:g}=function(t){const o=new r.KTX2File(new Uint8Array(t));function h(){o.close(),o.delete()}if(!o.isValid())throw h(),new Error("THREE.KTX2Loader:\tInvalid or unsupported .ktx2 file");const d=o.isUASTC()?s.UASTC_4x4:s.ETC1S,p=o.getWidth(),f=o.getHeight(),m=o.getLayers()||1,g=o.getLevels(),A=o.getFaces(),y=o.getHasAlpha(),v=o.getDFDFlags(),{transcoderFormat:x,engineFormat:_}=function(t,r,o,u){let h,d;const p=t===s.ETC1S?a:l;for(let n=0;n1?(i=a.origWidth,s=a.origHeight):(i=a.width,s=a.height);const l=new Uint8Array(o.getImageTranscodedSizeInBytes(r,t,0,x));if(!o.transcodeImage(l,r,t,e,x,0,-1,-1))throw h(),new Error("THREE.KTX2Loader: .transcodeImage failed.");n.push(l)}const a=u(n);t.push({data:a,width:i,height:s}),w.push(a.buffer)}b.push({mipmaps:t,width:p,height:f,format:_})}return h(),{faces:b,buffers:w,width:p,height:f,hasAlpha:y,format:_,dfdFlags:v}}(h.buffer);self.postMessage({type:"transcode",id:h.id,faces:t,width:d,height:p,hasAlpha:f,format:m,dfdFlags:g},o)}catch(e){console.error(e),self.postMessage({type:"error",id:h.id,error:e.message})}}))}var d}));const o=[{if:"astcSupported",basisFormat:[s.UASTC_4x4],transcoderFormat:[i.ASTC_4x4,i.ASTC_4x4],engineFormat:[n.RGBA_ASTC_4x4_Format,n.RGBA_ASTC_4x4_Format],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.BC7_M5,i.BC7_M5],engineFormat:[n.RGBA_BPTC_Format,n.RGBA_BPTC_Format],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.BC1,i.BC3],engineFormat:[n.RGBA_S3TC_DXT1_Format,n.RGBA_S3TC_DXT5_Format],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.ETC1,i.ETC2],engineFormat:[n.RGB_ETC2_Format,n.RGBA_ETC2_EAC_Format],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.ETC1],engineFormat:[n.RGB_ETC1_Format],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.PVRTC1_4_RGB,i.PVRTC1_4_RGBA],engineFormat:[n.RGB_PVRTC_4BPPV1_Format,n.RGBA_PVRTC_4BPPV1_Format],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0}],a=o.sort((function(e,t){return e.priorityETC1S-t.priorityETC1S})),l=o.sort((function(e,t){return e.priorityUASTC-t.priorityUASTC}));function c(e){return e<=2||!(e&e-1)&&0!==e}function u(e){if(1===e.length)return e[0];let t=0;for(let r=0;rnew S)),Sn.register((()=>new ee)),Sn.register((()=>new te));const Cn={LOAD_TILE_SET:"load-tile-set",LOAD_MODEL:"load-model",DISPOSE_MODEL:"dispose-model",TILE_VISIBILITY_CHANGE:"tile-visibility-change",TILES_LOAD_START:"tiles-load-start",TILES_LOAD_END:"tiles-load-end"};function Tn(e,t){if(!e)throw new Error("Path to draco folder is mandatory");const r=new kr;r.setDecoderPath(e),t&&r.setDecoderConfig(t),Sn.setDRACOLoader(r)}function In(e,t){if(!e||!t)throw new Error("Path to ktx2 folder and renderer are mandatory");const r=new gn;r.setTranscoderPath(e),r.detectSupport(t),Sn.setKTX2Loader(r)}class Rn extends Nr.A{constructor(e,t){super(e,new n.Group,{source:t.source}),this.isOGC3DTilesLayer=!0,this._handlePointsMaterialConfig(t),this.tilesRenderer=new Sr(this.source.url),t.source.isOGC3DTilesIonSource?this.tilesRenderer.registerPlugin(new Rr({apiToken:t.source.accessToken,assetId:t.source.assetId,autoRefreshToken:!0})):t.source.isOGC3DTilesGoogleSource&&this.tilesRenderer.registerPlugin(new Ir({apiToken:t.source.key,autoRefreshToken:!0})),this.tilesRenderer.registerPlugin(new Or),this.tilesRenderer.manager.addHandler(/\.gltf$/,Sn),this.object3d.add(this.tilesRenderer.group),this._res=this.addInitializationStep(),this.sseThreshold=this.tilesRenderer.errorTarget,Object.defineProperty(this,"sseThreshold",{get(){return this.tilesRenderer.errorTarget},set(e){this.tilesRenderer.errorTarget=e}}),t.sseThreshold&&(this.sseThreshold=t.sseThreshold)}_handlePointsMaterialConfig(e){this.pntsMode=e.pntsMode??bn.qW.COLOR,this.pntsShape=e.pntsShape??bn.cn.CIRCLE,this.classification=e.classification??bn.MY.DEFAULT,this.pntsSizeMode=e.pntsSizeMode??bn.qU.VALUE,this.pntsMinAttenuatedSize=e.pntsMinAttenuatedSize||3,this.pntsMaxAttenuatedSize=e.pntsMaxAttenuatedSize||10}_setupCacheAndQueues(e){const t=e.id;Mn[t]?(this.tilesRenderer.lruCache=Mn[t].lruCache,this.tilesRenderer.downloadQueue=Mn[t].downloadQueue,this.tilesRenderer.parseQueue=Mn[t].parseQueue):(Mn[t]={lruCache:this.tilesRenderer.lruCache,downloadQueue:this.tilesRenderer.downloadQueue,parseQueue:this.tilesRenderer.parseQueue},e.addEventListener(wn.G.DISPOSED,(e=>{delete Mn[e.target.id]})))}_setupEvents(){for(const e of Object.values(Cn))this.tilesRenderer.addEventListener(e,(e=>{this.dispatchEvent(e)}))}_setup(e){this.tilesRenderer.setCamera(e.camera3D),this.tilesRenderer.setResolutionFromRenderer(e.camera3D,e.renderer);let t=!1;this.tilesRenderer.addEventListener("load-tile-set",(()=>{e.notifyChange(this),t||(t=!0,this._res())})),this.tilesRenderer.addEventListener("load-model",(t=>{let{scene:r}=t;r.traverse((e=>{this._assignFinalMaterial(e),this._assignFinalAttributes(e)})),e.notifyChange(this)})),this._setupCacheAndQueues(e),this._setupEvents(),this.tilesRenderer.update()}_assignFinalMaterial(e){let t=e.material;if(e.isPoints){const e=new bn.Ay({mode:this.pntsMode,shape:this.pntsShape,classificationScheme:this.classification,sizeMode:this.pntsSizeMode,minAttenuatedSize:this.pntsMinAttenuatedSize,maxAttenuatedSize:this.pntsMaxAttenuatedSize});e.copy(t),t=e}t&&(0,_n.A)(t,this),e.material=t}_assignFinalAttributes(e){const t=e.geometry,r=e.batchTable;if(e.isPoints){const e=r?.getPropertyArray("Classification");e&&t.setAttribute("classification",new n.BufferAttribute(e,1))}}preUpdate(e){return this.scale=e.camera._preSSE,this.tilesRenderer.update(),null}update(){}delete(){this.tilesRenderer.dispose()}getC3DTileFeatureFromIntersectsArray(e){if(!e.length)return null;const{face:t,index:r,object:n,instanceId:i}=e[0];let s;if(n.isPoints&&r?s=n.geometry.getAttribute("_BATCHID")?.getX(r)??r:n.isMesh&&t&&(s=n.geometry.getAttribute("_BATCHID")?.getX(t.a)??i),void 0===s)return null;let o=n;for(;!o.batchTable;)o=o.parent;return o.batchTable.getDataFromId(s)}pickObjectsAt(e,t){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];const n=e.camera.camera3D;En.setFromCamera(e.viewToNormalizedCoords(t),n),En.near=n.near,En.far=n.far,En.firstHitOnly=!0;const i=En.intersectObject(this.tilesRenderer.group,!0);return i.forEach((e=>{e.layer=this})),r.push(...i),r}attach(){console.warn("[OGC3DTilesLayer]: Attaching / detaching layers is not yet implemented for OGC3DTilesLayer.")}detach(){return console.warn("[OGC3DTilesLayer]: Attaching / detaching layers is not yet implemented for OGC3DTilesLayer."),!0}getObjectToUpdateForAttachedLayers(){return null}forEachTile(e){this.tilesRenderer.traverse((t=>{e(t,t.cached.scene)}))}}const Bn=Rn},70515:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});const n=function(e,t){if(t&&t.isGeometryLayer){let r=e.transparent;e.layer=t,e.uniforms&&null!=e.uniforms.opacity?Object.defineProperty(e.uniforms.opacity,"value",{get:()=>e.layer.opacity}):null!=e.opacity&&Object.defineProperty(e,"opacity",{get:()=>e.layer.opacity}),e.uniforms&&null!=e.uniforms.mode&&Object.defineProperty(e.uniforms.mode,"value",{get:()=>e.layer.pntsMode}),e.uniforms&&null!=e.uniforms.shape&&Object.defineProperty(e.uniforms.shape,"value",{get:()=>e.layer.pntsShape}),e.uniforms&&null!=e.uniforms.sizeMode&&Object.defineProperty(e.uniforms.sizeMode,"value",{get:()=>e.layer.pntsSizeMode}),e.uniforms&&null!=e.uniforms.minAttenuatedSize&&Object.defineProperty(e.uniforms.minAttenuatedSize,"value",{get:()=>e.layer.pntsMinAttenuatedSize}),e.uniforms&&null!=e.uniforms.maxAttenuatedSize&&Object.defineProperty(e.uniforms.maxAttenuatedSize,"value",{get:()=>e.layer.pntsMaxAttenuatedSize}),e.uniforms&&null!=e.uniforms.scale&&Object.defineProperty(e.uniforms.scale,"value",{get:()=>e.layer.scale}),Object.defineProperty(e,"wireframe",{get:()=>e.layer.wireframe}),Object.defineProperty(e,"transparent",{get:()=>{const t=e.userData.needTransparency?.[e.mode]||e.layer.opacity<1;return r!=t&&(e.needsUpdate=!0,r=t),r}})}return e}},76932:(e,t,r)=>{"use strict";r.d(t,{A:()=>S});var n=r(39437),i=r(80736),s=r(66924),o=r(10456),a=r(45232),l=r(86706);class c extends n.Mesh{#M=(()=>new Map)();#S=!0;constructor(e,t,r,i){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(super(e,t),!i)throw new Error("extent is mandatory to build a TileMesh");this.layer=r,this.extent=i,this.extent.zoom=s,this.level=s,this.material.objectId=this.id,this.obb=this.geometry.OBB.clone(),this.boundingSphere=new n.Sphere,this.obb.box3D.getBoundingSphere(this.boundingSphere);for(const e of r.tileMatrixSets)this.#M.set(e,(0,l.m)(this.extent,e));this.frustumCulled=!1,this.matrixAutoUpdate=!1,this.rotationAutoUpdate=!1,this.layerUpdateState={},this.isTileMesh=!0,this.geoidHeight=0,this.link={},Object.defineProperty(this,"visible",{get(){return this.#S},set(e){this.#S!=e&&(this.#S=e,this.dispatchEvent({type:e?"shown":"hidden"}))}})}setBBoxZ(e){e.geoidHeight=(0,a.h)(this.layer)?this.geoidHeight:0,this.obb.updateZ(e),this.horizonCullingPointElevationScaled&&this.horizonCullingPointElevationScaled.setLength(this.obb.z.delta+this.horizonCullingPoint.length()),this.obb.box3D.getBoundingSphere(this.boundingSphere)}getExtentsByProjection(e){return this.#M.get(e)}findCommonAncestor(e){if(e)return e.level==this.level?e.id==this.id?e:0!=e.level?this.parent.findCommonAncestor(e.parent):void 0:e.level{c=e})),A.set(l,o,t.level,a),t.extent=r,t.center=e.center(t.extent).clone();let u,h=g.get(a);t.buildIndexAndUv_0=!h;try{u=(0,f.t)(e,t)}catch(e){return Promise.reject(e)}h||(h={},h.index=new n.BufferAttribute(u.index,1),h.uv=new n.BufferAttribute(u.uvs[0],2),g.set(a,h));const p={index:h.index,uvs:[h.uv,...void 0!==u.uvs[1]?[new n.BufferAttribute(u.uvs[1],1)]:[]],position:new n.BufferAttribute(u.position,3),normal:new n.BufferAttribute(u.normal,3)},y=new d.p(e,t,p);return y.OBB=new m.A(y.boundingBox.min,y.boundingBox.max),y.initRefCount(A,[o,t.level,a]),c(y),Promise.resolve({geometry:y,quaternion:i,position:s})}return l.then((e=>({geometry:e,quaternion:i,position:s})))}(i,l).then((e=>{e.geometry.increaseRefCount();const l=r.tileMatrixSets.length,c=new h.Ay(r.materialOptions,l);(0,y.A)(c,r);const d=new u(e.geometry,c,r,t,o);if(s&&s.isTileMesh){const t=i.computeShareableExtent(s.extent);e.position.sub(t.position).applyQuaternion(t.quaternion.invert()),e.quaternion.premultiply(t.quaternion)}if(d.position.copy(e.position),d.quaternion.copy(e.quaternion),d.visible=!1,d.updateMatrix(),function(e,t){if(t.diffuse&&(e.material.diffuse=t.diffuse),t.isGlobeLayer){e.horizonCullingPoint=e.extent.center().as("EPSG:4978").toVector3(),e.extent.planarDimensions(v).multiplyScalar(n.MathUtils.DEG2RAD);const t=v.length(),r=Math.abs(1/Math.cos(.5*t));e.horizonCullingPoint.setLength(r*e.horizonCullingPoint.length()),e.horizonCullingPointElevationScaled=e.horizonCullingPoint.clone()}}(d,r),s){d.geoidHeight=s.geoidHeight;const e=(0,a.h)(r)?d.geoidHeight:0;d.setBBoxZ({min:s.obb.z.min,max:s.obb.z.max,geoidHeight:e}),d.material.geoidHeight=e}return d}))}};var _=r(32060),b=r(61276);const w=new n.Vector3,E=new n.Vector3;class M extends i.A{constructor(e,t,r,n,i){const{sseSubdivisionThreshold:o=1,minSubdivisionLevel:a,maxSubdivisionLevel:l,maxDeltaElevationLevel:c,tileMatrixSets:u,diffuse:h,showOutline:d=!1,segments:f,disableSkirt:m=!1,materialOptions:g,...A}=i;if(super(e,t,{...A,cacheLifeTime:p.W.INFINITE,source:!1}),this.isTiledGeometryLayer=!0,this.protocol="tile",this.object3d.geoidHeight=0,this.disableSkirt=m,this._hideSkirt=!!i.hideSkirt,this.sseSubdivisionThreshold=o,this.minSubdivisionLevel=a,this.maxSubdivisionLevel=l,this.maxDeltaElevationLevel=c,this.segments=f,this.schemeTile=r,this.builder=n,this.info=new s.y(this),!this.schemeTile)throw new Error(`Cannot init tiled layer without schemeTile for layer ${this.id}`);if(!this.builder)throw new Error(`Cannot init tiled layer without builder for layer ${this.id}`);this.maxScreenSizeNode=this.sseSubdivisionThreshold*(2*this.sizeDiagonalTexture),this.tileMatrixSets=u,this.materialOptions=g,this.showOutline=d,this.diffuse=h,this.level0Nodes=[];const y=[];for(const e of this.schemeTile)y.push(this.convert(void 0,e));this._promises.push(Promise.all(y).then((e=>{this.level0Nodes=e,this.object3d.add(...e),this.object3d.updateMatrixWorld()})))}get hideSkirt(){return this._hideSkirt}set hideSkirt(e){if(this.level0Nodes){this._hideSkirt=e;for(const t of this.level0Nodes)t.traverse((t=>{t.isTileMesh&&(t.geometry.hideSkirt=e)}))}}pickObjectsAt(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.options.defaultPickingRadius,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return o.A.pickTilesAt(e,t,r,this,n)}preUpdate(e,t){if(t.has(void 0)||0==t.size)return this.level0Nodes;e.colorLayers=e.view.getLayers(((e,t)=>t&&t.id==this.id&&e.isColorLayer)),e.elevationLayers=e.view.getLayers(((e,t)=>t&&t.id==this.id&&e.isElevationLayer)),e.maxElevationLevel=-1;for(const t of e.elevationLayers)e.maxElevationLevel=Math.max(t.source.zoom.max,e.maxElevationLevel);let r;-1==e.maxElevationLevel&&(e.maxElevationLevel=1/0),this.colorLayersOrder=b.p.getColorLayersIdOrderedBySequence(e.colorLayers);for(const e of t.values()){if(e.isCamera)return this.level0Nodes;if(e.layer===this){if(r){if(r=e.findCommonAncestor(r),!r)return this.level0Nodes}else r=e;null==r.material&&(r=void 0)}}return r?[r]:this.level0Nodes}update(e,t,r){if(!r.parent)return _.A.removeChildrenAndCleanup(this,r);if(r.parent.pendingSubdivision)return r.visible=!1,r.material.visible=!1,void this.info.update(r);if(r.visible=!this.culling(r,e.camera),r.visible){let t=!1;return r.material.visible=!0,this.info.update(r),(r.pendingSubdivision||M.hasEnoughTexturesToSubdivide(e,r)&&this.subdivision(e,this,r))&&(this.subdivideNode(e,r),r.material.visible=r.pendingSubdivision,this.info.update(r),t=!0),r.material.visible&&!t?_.A.removeChildren(this,r):t?r.children.filter((e=>e.layer==this)):void 0}return r.material.visible=!1,this.info.update(r),_.A.removeChildren(this,r)}convert(e,t){return x.convert(e,t,this)}countColorLayersTextures(){return arguments.length}culling(e,t){return!t.isBox3Visible(e.obb.box3D,e.matrixWorld)}static hasEnoughTexturesToSubdivide(e,t){const r=t.layerUpdateState||{};let n=t.material.getElevationLayer();for(const i of e.elevationLayers){const e=t.getExtentsByProjection(i.crs)[0].zoom;if(!(e>i.zoom.max||ei.zoom.max||ee.layer==this))){const r=t.extent.subdivision();t.pendingSubdivision=!0;const n={view:e.view,requester:t,layer:this,priority:1e4,extentsSource:r,redraw:!1};return e.scheduler.execute(n).then((r=>{for(const e of r)t.add(e),e.updateMatrixWorld(!0);t.pendingSubdivision=!1,e.view.notifyChange(t,!1)}),(e=>{if(t.pendingSubdivision=!1,!e.isCancelledCommandException)throw new Error(e)}))}}subdivision(e,t,r){if(r.level{"use strict";r.r(t),r.d(t,{$3dTilesCulling:()=>bs.Li,$3dTilesSubdivisionControl:()=>bs.cG,B3dmParser:()=>ps.A,C3DTBatchTable:()=>ys.A,C3DTBatchTableHierarchyExtension:()=>_s,C3DTBoundingVolume:()=>As.A,C3DTExtensions:()=>vs.A,C3DTFeature:()=>ms.A,C3DTILES_LAYER_EVENTS:()=>Or.s,C3DTilesBoundingVolumeTypes:()=>xs.h,C3DTilesGoogleSource:()=>mi,C3DTilesIonSource:()=>pi,C3DTilesLayer:()=>Or.A,C3DTilesSource:()=>di,C3DTilesTypes:()=>xs.A,C3DTileset:()=>gs.A,CAMERA_TYPE:()=>It.d,CONTROL_EVENTS:()=>D.W,CRS:()=>l,CameraCalibrationParser:()=>Yr,CameraUtils:()=>wt.Ay,Capabilities:()=>Tt.A,ClassificationScheme:()=>L.MY,ColorLayer:()=>tr,ColorLayersOrdering:()=>en.A,Coordinates:()=>o.A,CopcLayer:()=>_n,CopcSource:()=>Ti,DEMUtils:()=>bt.A,ElevationLayer:()=>rr,Ellipsoid:()=>c.A,EntwinePointTileLayer:()=>pn,EntwinePointTileSource:()=>Si,Extent:()=>s.A,FEATURE_TYPES:()=>ke.Xs,Feature:()=>ke.Ay,Feature2Mesh:()=>xt,FeatureCollection:()=>ke.ZC,FeatureGeometry:()=>ke.fj,FeatureGeometryLayer:()=>sr,FeatureProcessing:()=>_,FeaturesUtils:()=>_t.A,Fetcher:()=>d.A,FileSource:()=>En,FirstPersonControls:()=>te,FlyControls:()=>H,GDFParser:()=>hs.A,GLOBE_VIEW_EVENTS:()=>u.S,GTXParser:()=>ds.Ay,GeoJsonParser:()=>jr.A,GeoidGrid:()=>a.A,GeoidLayer:()=>v.A,GeometryLayer:()=>nr.A,GlobeControls:()=>D.A,GlobeLayer:()=>tn.A,GlobeView:()=>u.A,GpxParser:()=>Ri.A,ISGParser:()=>us.A,ImageryLayers:()=>Bt.p,KMLParser:()=>Bi.A,LASParser:()=>Ei,Label:()=>Rt.A,LabelLayer:()=>nn.A,Layer:()=>Bt.A,MAIN_LOOP_EVENTS:()=>p.n7,OGC3DTILES_LAYER_EVENTS:()=>Nr.uj,OGC3DTilesGoogleSource:()=>vi,OGC3DTilesIonSource:()=>yi,OGC3DTilesLayer:()=>Nr.Ay,OGC3DTilesSource:()=>Ai,OrientationUtils:()=>$e,OrientedImageCamera:()=>P,OrientedImageLayer:()=>Zr,OrientedImageSource:()=>$n,PLANAR_CONTROL_EVENT:()=>pe.w7,PNTS_MODE:()=>L.qW,PNTS_SHAPE:()=>L.cn,PNTS_SIZE_MODE:()=>L.qU,PlanarControls:()=>pe.Ay,PlanarLayer:()=>rn.A,PlanarView:()=>h.A,PointCloudLayer:()=>gr,PointsMaterial:()=>L.Ay,Potree2Layer:()=>Dr,Potree2Source:()=>ui,PotreeLayer:()=>Er,PotreeSource:()=>ri,REVISION:()=>ws,STRATEGY_DICHOTOMY:()=>b.fZ,STRATEGY_GROUP:()=>b.a0,STRATEGY_MIN_NETWORK_TRAFFIC:()=>b.Uv,STRATEGY_PROGRESSIVE:()=>b.oN,ShaderChunk:()=>St,ShapefileParser:()=>cs,Source:()=>bn.A,StreetControls:()=>de,Style:()=>Je.Ay,THREE:()=>n,TMSSource:()=>Rn,TiledGeometryLayer:()=>Ur.A,VIEW_EVENTS:()=>f.G,VectorTilesSource:()=>Xn,View:()=>f.A,WFSSource:()=>Ln,WMSSource:()=>Un,WMTSSource:()=>Fn,colorLayerEffects:()=>Ct.Ll,ellipsoidSizes:()=>c.Q,enableDracoLoader:()=>Nr.YC,enableKtx2Loader:()=>Nr.eU,getMaxColorSamplerUnitsCount:()=>Ct.gL,iGLTFLoader:()=>fs.A,process3dTilesNode:()=>bs.oS,proj4:()=>i.A,updateLayeredMaterialNodeElevation:()=>C,updateLayeredMaterialNodeImagery:()=>S});var n=r(39437),i=r(68721),s=r(86215),o=r(52404),a=r(77855),l=r(86406),c=r(96027),u=r(86397),h=r(8917),d=r(7794),p=r(87196),f=r(84354),m=r(24184),g=r(32060);const A=4;function y(e,t,r,n,i){if(t.layerUpdateState[r.id])if(e.isCancelledCommandException)t.layerUpdateState[r.id].success();else if(e instanceof SyntaxError)t.layerUpdateState[r.id].failure(0,!0);else{const e=t.layerUpdateState[r.id].errorCount>A;t.layerUpdateState[r.id].failure(Date.now(),e,{targetLevel:n}),e||window.setTimeout((()=>{i.notifyChange(t,!1)}),1e3*t.layerUpdateState[r.id].secondsUntilNextTry())}}var v=r(45232);const x=new o.A("EPSG:4326",0,0,0),_={update(e,t,r){if(!r.parent&&r.children.length)return void g.A.removeChildrenAndCleanupRecursively(t,r);if(!r.visible)return;if(void 0===r.layerUpdateState[t.id])r.layerUpdateState[t.id]=new m.A;else if(!r.layerUpdateState[t.id].canTryUpdate())return void r.link[t.id]?.forEach((e=>{e.layer.object3d.add(e),e.meshes.position.z=(0,v.h)(t.parent)?r.geoidHeight:0,e.meshes.updateMatrixWorld()}));const n=r.getExtentsByProjection(t.source.crs)||[r.extent],i=n[0].zoom;if(i!=t.zoom.min||!this.source.extentInsideLimit(r.extent,i)||t.source.isFileSource&&!r.extent.isPointInside(t.source.extent.center(x)))return void r.layerUpdateState[t.id].noMoreUpdatePossible();r.layerUpdateState[t.id].newTry();const s={layer:t,extentsSource:n,view:e.view,requester:r};return e.scheduler.execute(s).then((n=>{r.layerUpdateState[t.id].noMoreUpdatePossible(),n.forEach((n=>{n?(r.link[t.id]=r.link[t.id]||[],n.as(e.view.referenceCrs),n.meshes.position.z=(0,v.h)(t.parent)?r.geoidHeight:0,n.updateMatrixWorld(),t.onMeshCreated&&t.onMeshCreated(n,e),r.parent?(t.object3d.add(n),r.link[t.id].push(n)):g.A.removeChildrenAndCleanupRecursively(t,n),n.layer=t):r.layerUpdateState[t.id].failure(1,!0)}))}),(n=>y(n,r,t,r.level,e.view)))}};var b=r(85524);function w(e){return e.visible?100:10}function E(e){return!(e.requester.parent&&e.requester.material&&!(e.layer.isElevationLayer&&e.requester.material.getElevationLayer()&&e.targetLevel<=e.requester.material.getElevationLayer().level)&&e.requester.layerUpdateState[e.layer.id]&&e.layer.source._featuresCaches[e.layer.crs]&&e.requester.material.visible)}function M(e,t,r,n,i){return{view:e,layer:t,extentsSource:r,extentsDestination:n,requester:i,priority:w(i.material),earlyDropFunction:E}}function S(e,t,r,n){const i=r.material;if(!n||!i)return;const s=r.getExtentsByProjection(t.crs),o=s[0].zoom;if(o>t.zoom.max||o=t.source.zoom.min)return void e.view.notifyChange(r,!1)}if(!i.visible)return;if(!t.visible||!r.layerUpdateState[t.id].canTryUpdate())return;if(a.level>=s[0].zoom)return void r.layerUpdateState[t.id].noMoreUpdatePossible();if(t.frozen)return;const l=r.layerUpdateState[t.id].failureParams,c=s[0].zoom||r.level,u=(0,b.kb)(t.updateStrategy.type,r,c,a.level,t,l);if(!t.source.isVectorSource&&u<=a.level||u>c)return void(l.lowestLevelError!=1/0&&r.layerUpdateState[t.id].noMoreUpdatePossible());if(!t.source.extentInsideLimit(r.extent,u))return r.layerUpdateState[t.id].noData({targetLevel:u}),void e.view.notifyChange(r,!1);const h=s.map((e=>e.tiledExtentParent(u)));r.layerUpdateState[t.id].newTry();const d=M(e.view,t,h,s,r);return e.scheduler.execute(d).then((e=>{if(!r.layerUpdateState[t.id])return;const n=s.map(((t,r)=>t.offsetToParent(e[r].extent,a.offsetScales[r])));a.setTextures(e,n),r.layerUpdateState[t.id].success()}),(n=>y(n,r,t,u,e.view)))}function C(e,t,r,n){const i=r.material;if(!n||!i)return;const s=r.getExtentsByProjection(t.crs),o=s[0].zoom;if(o>t.zoom.max||o=t.source.zoom.min)return void e.view.notifyChange(r,!1)}if(t.frozen||!i.visible||!r.layerUpdateState[t.id].canTryUpdate())return;const l=r.layerUpdateState[t.id].failureParams,c=(0,b.kb)(t.updateStrategy.type,r,s[0].zoom,a.level,t,l);if(c<=a.level||c>s[0].zoom)return void r.layerUpdateState[t.id].noMoreUpdatePossible();if(!t.source.extentInsideLimit(r.extent,c))return r.layerUpdateState[t.id].noData({targetLevel:c}),void e.view.notifyChange(r,!1);const u=s.map((e=>e.tiledExtentParent(c)));r.layerUpdateState[t.id].newTry();const h=M(e.view,t,u,s,r);return e.scheduler.execute(h).then((e=>{if(!r.layerUpdateState[t.id])return;if(c<=a.level)return void r.layerUpdateState[t.id].noMoreUpdatePossible();const n=s.map(((t,r)=>t.offsetToParent(e[r].extent,a.offsetScales[r])));a.setTextures(e,n),r.layerUpdateState[t.id].success()}),(n=>y(n,r,t,c,e.view)))}function T(e){return function(t){t.material?.removeLayer&&(t.material.elevationLayerIds.indexOf(e)>-1&&t.setBBoxZ({min:0,max:0}),t.material.removeLayer(e)),t.layerUpdateState&&t.layerUpdateState[e]&&delete t.layerUpdateState[e]}}class I{constructor(e){this.size=e,this.pps=null,this.polynom=null,this.l1l2=null}setFromMicmacCalibration(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.pps=(new n.Vector2).fromArray(e.pps),this.polynom=(new n.Vector4).fromArray(e.poly357),this.l1l2=new n.Vector3,this.pps.y=t?this.size.y-this.pps.y:this.pps.y,this.polynom.w=e.limit**2,e.l1l2&&(this.l1l2.fromArray(e.l1l2),this.l1l2.z=e.etats)}clone(){const e=new I(this.size.clone());return e.pps=this.pps.clone(),e.polynom=this.polynom.clone(),e.l1l2=this.l1l2.clone(),e}}const R=new n.Vector3;class B extends n.PerspectiveCamera{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1024,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1024,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1e4,o=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0;e=e.isVector2?e:new n.Vector2(e,e),a=a||e.x/e.y,super(void 0,a,i,s),this.size=e,this.focal=t.isVector2?t:new n.Vector2(t,t),this.center=r||e.clone().multiplyScalar(.5),this.skew=o||0,this.textureMatrixWorldInverse=new n.Matrix4,Object.defineProperty(this,"fov",{get:()=>2*n.MathUtils.radToDeg(Math.atan2(this.size.y,2*this.focal.y)),set:e=>{const t=.5*this.size.y/Math.tan(n.MathUtils.degToRad(.5*e));this.focal.x=t,this.focal.y=t}}),this.distortion=new I(this.size),this.maskPath=void 0,this.mask=void 0,this.updateProjectionMatrix()}updateProjectionMatrix(){if(!this.focal)return;const e=this.near,t=e/this.focal.x,r=e/this.focal.y,n=-t*this.center.x,i=-r*this.center.y,s=n+t*this.size.x,o=i+r*this.size.y;this.projectionMatrix.makePerspective(n,s,o,i,e,this.far),this.projectionMatrix.elements[4]=2*this.skew/this.size.x;const a=this.size.x/this.size.y,l=this.aspect/a;R.set(this.zoom,this.zoom,1),l>1?R.x/=l:R.y*=l,this.projectionMatrix.scale(R)}copy(e,t){return super.copy(e,t),this.size=e.size.clone(),this.focal=e.focal.clone(),this.center=e.center.clone(),this.distortion=e.distortion.clone(),this.textureMatrixWorldInverse=e.textureMatrixWorldInverse.clone(),this.skew=e.skew,this.maskPath=e.maskPath,this.mask=e.mask,this}}const P=B;var L=r(6425),D=r(98211);const O={38:{method:"translateZ",sign:-1},40:{method:"translateZ",sign:1},37:{method:"translateX",sign:-1},39:{method:"translateX",sign:1},33:{method:"rotateZ",sign:1,noSpeed:!0},34:{method:"rotateZ",sign:-1,noSpeed:!0},wheelup:{method:"translateZ",sign:1,oneshot:!0},wheeldown:{method:"translateZ",sign:-1,oneshot:!0}};function N(e){e.preventDefault(),this._isMouseDown=!0;const t=this.view.eventToViewCoords(e);this._onMouseDownMouseX=t.x,this._onMouseDownMouseY=t.y}function U(e){e.preventDefault(),this._isMouseDown=!0,this._onMouseDownMouseX=e.touches[0].pageX,this._onMouseDownMouseY=e.touches[0].pageY}function F(e){if(!0===this._isMouseDown){const t=this.view.eventToViewCoords(e),r=n.MathUtils.degToRad(this._camera3D.fov)/this.view.mainLoop.gfxEngine.height;this._camera3D.rotateY((t.x-this._onMouseDownMouseX)*r),this._camera3D.rotateX((t.y-this._onMouseDownMouseY)*r),this._onMouseDownMouseX=t.x,this._onMouseDownMouseY=t.y,this.view.notifyChange(this._camera3D,!1)}}function k(){this._isMouseDown=!1}function z(e){const t=O[e.keyCode];t&&(this.moves.delete(t),e.preventDefault())}function G(e){const t=O[e.keyCode];t&&(this.moves.add(t),this.view.notifyChange(this._camera3D,!1),e.preventDefault())}function Q(e){-e.deltaY<0?this.moves.add(O.wheelup):this.moves.add(O.wheeldown),this.view.notifyChange(this._camera3D,!1)}class V extends n.EventDispatcher{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),this.view=e,this.options=t,this._camera3D=e.camera3D,this.moves=new Set,this.moveSpeed=10,this._onMouseDownMouseX=0,this._onMouseDownMouseY=0,this._isMouseDown=!1,e.domElement.addEventListener("mousedown",N.bind(this),!1),e.domElement.addEventListener("touchstart",U.bind(this),!1);const r=F.bind(this);e.domElement.addEventListener("mousemove",r,!1),e.domElement.addEventListener("touchmove",r,!1),e.domElement.addEventListener("mouseup",k.bind(this),!1),e.domElement.addEventListener("touchend",k.bind(this),!1),e.domElement.addEventListener("wheel",Q.bind(this),!1),e.domElement.addEventListener("keyup",z.bind(this),!0),e.domElement.addEventListener("keydown",G.bind(this),!0),this.view.addFrameRequester(p.n7.AFTER_CAMERA_UPDATE,this.update.bind(this)),t.focusOnMouseOver&&e.domElement.addEventListener("mouseover",(()=>e.domElement.focus())),t.focusOnClick&&e.domElement.addEventListener("click",(()=>e.domElement.focus()))}isUserInteracting(){return 0!==this.moves.size||this._isMouseDown}update(e,t){t&&(e=16);for(const t of this.moves)this._camera3D[t.method](t.sign*(t.noSpeed?1:this.moveSpeed)*e/1e3);if(this.moves.size>0||this._isMouseDown){this.view.notifyChange(this._camera3D);for(const e of this.moves)e.oneshot&&this.moves.delete(e)}}}const H=V;function j(e,t,r){const i=.5*n.MathUtils.degToRad(r-e.fov);return n.MathUtils.clamp(t,-i,i)}const q=new n.Vector3(0,1,0);function W(e,t,r){t.quaternion.setFromUnitVectors(q,t.up),t.rotateY(r.rotateY),t.rotateX(r.rotateX),e.notifyChange(e.camera3D)}const Y={38:{method:"translateZ",sign:-1},40:{method:"translateZ",sign:1},37:{method:"translateX",sign:-1},39:{method:"translateX",sign:1},33:{method:"translateY",sign:1},34:{method:"translateY",sign:-1}};function X(e){this.camera.position.z+=e}const K=new n.Vector3,$=new n.Quaternion,J=new n.Euler(0,0,0,"YXZ");function Z(e){K.copy(this.camera.position),K.normalize(),this.camera.position.add(K.multiplyScalar(e))}class ee extends n.EventDispatcher{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(super(),this.isFirstPersonControls=!0,this.camera=e.camera3D,this.view=e,this.moves=new Set,t.panoramaRatio){const e=200*t.panoramaRatio/(2*Math.PI);t.verticalFOV=2==t.panoramaRatio?180:n.MathUtils.radToDeg(2*Math.atan(200/(2*e)))}t.verticalFOV=t.verticalFOV||180,t.moveSpeed=void 0===t.moveSpeed?10:t.moveSpeed,this.options=t,this._isMouseDown=!1,this._onMouseDownMouseX=0,this._onMouseDownMouseY=0,this._state={rotateX:0,rotateY:0,snapshot(){return{rotateX:this.rotateX,rotateY:this.rotateY}}},this.reset(),this.eventListeners=t.disableEventListeners,t.disableEventListeners||(this._onMouseDown=this.onMouseDown.bind(this),this._onMouseMove=this.onMouseMove.bind(this),this._onMouseUp=this.onMouseUp.bind(this),this._onMouseWheel=this.onMouseWheel.bind(this),this._onKeyUp=this.onKeyUp.bind(this),this._onKeyDown=this.onKeyDown.bind(this),this._onContextMenu=this.onContextMenu.bind(this),e.domElement.addEventListener("mousedown",this._onMouseDown,!1),e.domElement.addEventListener("touchstart",this._onMouseDown,!1),e.domElement.addEventListener("mousemove",this._onMouseMove,!1),e.domElement.addEventListener("touchmove",this._onMouseMove,!1),e.domElement.addEventListener("mouseup",this._onMouseUp,!1),e.domElement.addEventListener("touchend",this._onMouseUp,!1),e.domElement.addEventListener("wheel",this._onMouseWheel,!1),e.domElement.addEventListener("contextmenu",this._onContextMenu,!1),document.addEventListener("keydown",this._onKeyDown,!1),document.addEventListener("keyup",this._onKeyUp,!1)),this.view.addFrameRequester(p.n7.AFTER_CAMERA_UPDATE,this.update.bind(this)),this._onFocus=()=>e.domElement.focus(),this.focusOnMouseOver=t.focusOnMouseOver,t.focusOnMouseOver&&e.domElement.addEventListener("mouseover",this._onFocus),this.focusOnClick=t.focusOnClick,t.focusOnClick&&e.domElement.addEventListener("click",this._onFocus),"EPSG:4978"==e.referenceCrs?this.moveCameraVertical=Z:this.moveCameraVertical=X}isUserInteracting(){return 0!==this.moves.size&&!this._isMouseDown}reset(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];$.setFromUnitVectors(q,this.camera.up),$.invert(),$.multiply(this.camera.quaternion),J.setFromQuaternion($),e||(this._state.rotateX=J.x),this._state.rotateY=J.y}update(e,t,r){if(0!=this.enabled){t&&(e=16);for(const t of this.moves)"translateY"===t.method?this.moveCameraVertical(t.sign*this.options.moveSpeed*e/1e3):this.camera[t.method](t.sign*this.options.moveSpeed*e/1e3);!0!==this._isMouseDown&&!0!==r||W(this.view,this.camera,this._state),this.moves.size&&this.view.notifyChange(this.camera)}}onMouseDown(e){if(0==this.enabled)return;this._isMouseDown=!0;const t=this.view.eventToViewCoords(e);this._onMouseDownMouseX=t.x,this._onMouseDownMouseY=t.y,this._stateOnMouseDown=this._state.snapshot()}onMouseUp(){0!=this.enabled&&(this._isMouseDown=!1)}onMouseMove(e){if(0!=this.enabled&&!0===this._isMouseDown){const t=n.MathUtils.degToRad(this.camera.fov)/this.view.mainLoop.gfxEngine.height,r=this.view.eventToViewCoords(e);this._state.rotateY=(r.x-this._onMouseDownMouseX)*t+this._stateOnMouseDown.rotateY,this._state.rotateX=j(this.camera,(r.y-this._onMouseDownMouseY)*t+this._stateOnMouseDown.rotateX,this.options.verticalFOV),W(this.view,this.camera,this._state)}}onMouseWheel(e){if(0==this.enabled)return;const t=e.deltaY;this.camera.fov=n.MathUtils.clamp(this.camera.fov+Math.sign(t),10,Math.min(100,this.options.verticalFOV)),this.camera.updateProjectionMatrix(),this._state.rotateX=j(this.camera,this._state.rotateX,this.options.verticalFOV),W(this.view,this.camera,this._state)}onKeyUp(e){if(0==this.enabled)return;const t=Y[e.keyCode];t&&(this.moves.delete(t),this.view.notifyChange(void 0,!1),e.preventDefault())}onKeyDown(e){if(0==this.enabled)return;const t=Y[e.keyCode];t&&(this.moves.add(t),this.view.notifyChange(void 0,!1),e.preventDefault())}onContextMenu(e){e.preventDefault()}dispose(){this.eventListeners||(this.view.domElement.removeEventListener("mousedown",this._onMouseDown,!1),this.view.domElement.removeEventListener("touchstart",this._onMouseDown,!1),this.view.domElement.removeEventListener("mousemove",this._onMouseMove,!1),this.view.domElement.removeEventListener("touchmove",this._onMouseMove,!1),this.view.domElement.removeEventListener("mouseup",this._onMouseUp,!1),this.view.domElement.removeEventListener("touchend",this._onMouseUp,!1),this.view.domElement.removeEventListener("wheel",this._onMouseWheel,!1),this.view.domElement.removeEventListener("contextmenu",this._onContextMenu,!1),document.removeEventListener("keydown",this._onKeyDown,!1),document.removeEventListener("keyup",this._onKeyUp,!1)),this.focusOnMouseOver&&this.view.domElement.removeEventListener("mouseover",this._onFocus),this.focusOnClick&&this.view.domElement.removeEventListener("click",this._onFocus),this.dispatchEvent({type:"dispose"})}}const te=ee;var re=r(50040);const ne=new n.MeshBasicMaterial({color:16777215,depthTest:!1,transparent:!0,opacity:.5});function ie(e,t,r){e.position.copy(t),e.up.copy(t).normalize(),e.lookAt(r),e.updateMatrixWorld(!0)}const se=new n.Vector3,oe=new n.Vector3,ae=new n.Matrix3,le=new n.Vector3,ce=new n.Quaternion;function ue(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:()=>{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:()=>{},s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:()=>{};t.getPickingPositionFromDepth(t.eventToViewCoords(e),se);const o=t.camera3D.position.distanceTo(se),a=r?t.pickObjectsAt(e,-1,r):[];a.length&&a[0].distance1&&void 0!==arguments[1]?arguments[1]:{};super(e,t),this.isStreetControls=!0,this._onMouseOut=super.onMouseUp.bind(this),e.domElement.addEventListener("mouseout",this._onMouseOut),this.previousPosition=void 0,this.currentPosition=void 0,this.nextPosition=void 0,this.keyGoToNextPosition=90,this.keyGoToPreviousPosition=83,this.keySetCameraToCurrentPositionAndLookAtNext=65,this.keySetCameraToCurrentPositionAndLookAtPrevious=81,this.tweenGroup=new re.Ay.Group,this.surfaceGround=t.surfaceGround||function(){const e=new n.CircleGeometry(1,32);return new n.Mesh(e,ne)}(),this.surfaceWall=t.surfaceWall||function(){const e=new n.PlaneGeometry(4,2,1),t=new n.Mesh(e,ne);return t.rotateX(.5*-Math.PI),t}(),this.surfaces=new n.Object3D,this.surfaces.add(this.surfaceGround),this.surfaces.add(this.surfaceWall),this.view.scene.add(this.surfaces),this.wallMaxDistance=t.wallMaxDistance||1e3,this.animationDurationWall=t.animationDurationWall||200,this.buildingsLayer=t.buildingsLayer,this.computeTime=t.computeTime||he,this.offset=t.offset||4,this.transformationPositionPickOnTheGround=t.transformationPositionPickOnTheGround||(e=>e),this.end=this.camera.clone()}setCurrentPosition(e){this.currentPosition=e}setNextPosition(e){this.nextPosition=e}setPreviousPosition(e){this.previousPosition=e}onMouseUp(e){0!=this.enabled&&(super.onMouseUp(),this._stateOnMouseDrag?this._stateOnMouseDrag=!1:ue(e,this.view,this.buildingsLayer,this.onClickOnGround.bind(this),this.onClickOnWall.bind(this)))}onMouseMove(e){0!=this.enabled&&(super.onMouseMove(e),this._isMouseDown?(this._stateOnMouseDrag=!0,this.stopAnimations()):this.tween||(ue(e,this.view,this.buildingsLayer,((e,t)=>{ie(this.surfaces,e,t),this.surfaceGround.visible=!0,this.surfaceWall.visible=!1}),((e,t)=>{ie(this.surfaces,e,t),this.surfaceWall.visible=!0,this.surfaceGround.visible=!1})),this.view.notifyChange(this.surfaces)))}setCameraToCurrentPosition(e){e?this.setCameraOnPosition(this.currentPosition,this.previousPosition):this.setCameraOnPosition(this.currentPosition,this.nextPosition)}setCameraOnPosition(e,t){e&&t&&(this.camera.position.copy(e),this.view.tileLayer&&this.view.tileLayer.isGlobeLayer?this.camera.up.copy(e).normalize():this.camera.up.set(0,0,1),this.camera.lookAt(t),this.camera.updateMatrixWorld(),this.reset())}onClickOnGround(e){e=this.transformationPositionPickOnTheGround(e),this.view.tileLayer&&this.view.tileLayer.isGlobeLayer?le.copy(e).normalize():le.set(0,0,1),e.add(le.multiplyScalar(this.offset));const t=this.camera.position.distanceTo(e),r=this.computeTime(t);this.moveCameraTo(e,r)}onClickOnWall(e){this.camera.position.distanceTo(e){this.stopAnimations()})).onUpdate((e=>{this.camera.quaternion.slerpQuaternions(ce,this.end.quaternion,e.t)})).start(),this.tweenGroup.add(this.tween),this.animationFrameRequester=()=>{this.tweenGroup.update(),this.reset(),this.view.notifyChange(this.camera)},this.view.addFrameRequester(p.n7.BEFORE_RENDER,this.animationFrameRequester),this.view.notifyChange(this.camera)}moveCameraTo(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;if(!e)return Promise.resolve();const n=new Promise((e=>{t=e}));return this.stopAnimations(),this.tween=new re.Ay.Tween(this.camera.position).to(e.clone(),r).easing(re.Ay.Easing.Quadratic.Out).onComplete((()=>{this.stopAnimations(),t()})).start(),this.tweenGroup.add(this.tween),this.animationFrameRequester=()=>{this.tweenGroup.update(),this.view.notifyChange(this.camera)},this.view.addFrameRequester(p.n7.BEFORE_RENDER,this.animationFrameRequester),this.view.notifyChange(this.camera),n}stopAnimations(){this.tween&&(this.tween.stop(),this.tween=void 0,this.tweenGroup.removeAll()),this.animationFrameRequester&&(this.view.removeFrameRequester(p.n7.BEFORE_RENDER,this.animationFrameRequester),this.animationFrameRequester=null)}moveCameraToCurrentPosition(){this.moveCameraTo(this.currentPosition)}onKeyDown(e){0!=this.enabled&&(super.onKeyDown(e),e.keyCode==this.keyGoToNextPosition&&this.moveCameraTo(this.nextPosition),e.keyCode==this.keyGoToPreviousPosition&&this.moveCameraTo(this.previousPosition),e.keyCode==this.keySetCameraToCurrentPositionAndLookAtNext&&(this.setCameraToCurrentPosition(),this.view.notifyChange(this.view.camera3D)),e.keyCode==this.keySetCameraToCurrentPositionAndLookAtPrevious&&(this.setCameraToCurrentPosition(!0),this.view.notifyChange(this.view.camera3D)))}dispose(){this.view.domElement.removeEventListener("mouseout",this._onMouseOut,!1),super.dispose()}};var pe=r(72682);function fe(e,t,r=2){const n=t&&t.length,i=n?t[0]*r:e.length;let s=me(e,0,i,r,!0);const o=[];if(!s||s.next===s.prev)return o;let a,l,c;if(n&&(s=function(e,t,r,n){const i=[];for(let r=0,s=t.length;r80*r){a=1/0,l=1/0;let t=-1/0,n=-1/0;for(let s=r;st&&(t=r),i>n&&(n=i)}c=Math.max(t-a,n-l),c=0!==c?32767/c:0}return Ae(s,o,r,a,l,c,0),o}function me(e,t,r,n,i){let s;if(i===function(e,t,r,n){let i=0;for(let s=t,o=r-n;s0)for(let i=t;i=t;i-=n)s=Ne(i/n|0,e[i],e[i+1],s);return s&&Re(s,s.next)&&(Ue(s),s=s.next),s}function ge(e,t){if(!e)return e;t||(t=e);let r,n=e;do{if(r=!1,n.steiner||!Re(n,n.next)&&0!==Ie(n.prev,n,n.next))n=n.next;else{if(Ue(n),n=t=n.prev,n===n.next)break;r=!0}}while(r||n!==t);return t}function Ae(e,t,r,n,i,s,o){if(!e)return;!o&&s&&function(e,t,r,n){let i=e;do{0===i.z&&(i.z=Me(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){let t,r=1;do{let n,i=e;e=null;let s=null;for(t=0;i;){t++;let o=i,a=0;for(let e=0;e0||l>0&&o;)0!==a&&(0===l||!o||i.z<=o.z)?(n=i,i=i.nextZ,a--):(n=o,o=o.nextZ,l--),s?s.nextZ=n:e=n,n.prevZ=s,s=n;i=o}s.nextZ=null,r*=2}while(t>1)}(i)}(e,n,i,s);let a=e;for(;e.prev!==e.next;){const l=e.prev,c=e.next;if(s?ve(e,n,i,s):ye(e))t.push(l.i,e.i,c.i),Ue(e),e=c.next,a=c.next;else if((e=c)===a){o?1===o?Ae(e=xe(ge(e),t),t,r,n,i,s,2):2===o&&_e(e,t,r,n,i,s):Ae(ge(e),t,r,n,i,s,1);break}}}function ye(e){const t=e.prev,r=e,n=e.next;if(Ie(t,r,n)>=0)return!1;const i=t.x,s=r.x,o=n.x,a=t.y,l=r.y,c=n.y,u=is?i>o?i:o:s>o?s:o,p=a>l?a>c?a:c:l>c?l:c;let f=n.next;for(;f!==t;){if(f.x>=u&&f.x<=d&&f.y>=h&&f.y<=p&&Ce(i,a,s,l,o,c,f.x,f.y)&&Ie(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function ve(e,t,r,n){const i=e.prev,s=e,o=e.next;if(Ie(i,s,o)>=0)return!1;const a=i.x,l=s.x,c=o.x,u=i.y,h=s.y,d=o.y,p=al?a>c?a:c:l>c?l:c,g=u>h?u>d?u:d:h>d?h:d,A=Me(p,f,t,r,n),y=Me(m,g,t,r,n);let v=e.prevZ,x=e.nextZ;for(;v&&v.z>=A&&x&&x.z<=y;){if(v.x>=p&&v.x<=m&&v.y>=f&&v.y<=g&&v!==i&&v!==o&&Ce(a,u,l,h,c,d,v.x,v.y)&&Ie(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==i&&x!==o&&Ce(a,u,l,h,c,d,x.x,x.y)&&Ie(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;v&&v.z>=A;){if(v.x>=p&&v.x<=m&&v.y>=f&&v.y<=g&&v!==i&&v!==o&&Ce(a,u,l,h,c,d,v.x,v.y)&&Ie(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;x&&x.z<=y;){if(x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==i&&x!==o&&Ce(a,u,l,h,c,d,x.x,x.y)&&Ie(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function xe(e,t){let r=e;do{const n=r.prev,i=r.next.next;!Re(n,i)&&Be(n,r,r.next,i)&&De(n,i)&&De(i,n)&&(t.push(n.i,r.i,i.i),Ue(r),Ue(r.next),r=e=i),r=r.next}while(r!==e);return ge(r)}function _e(e,t,r,n,i,s){let o=e;do{let e=o.next.next;for(;e!==o.prev;){if(o.i!==e.i&&Te(o,e)){let a=Oe(o,e);return o=ge(o,o.next),a=ge(a,a.next),Ae(o,t,r,n,i,s,0),void Ae(a,t,r,n,i,s,0)}e=e.next}o=o.next}while(o!==e)}function be(e,t){return e.x-t.x}function we(e,t){const r=function(e,t){let r=t;const n=e.x,i=e.y;let s,o=-1/0;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){const e=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(e<=n&&e>o&&(o=e,s=r.x=r.x&&r.x>=l&&n!==r.x&&Ce(is.x||r.x===s.x&&Ee(s,r)))&&(s=r,u=t)}r=r.next}while(r!==a);return s}(e,t);if(!r)return t;const n=Oe(r,e);return ge(n,n.next),ge(r,r.next)}function Ee(e,t){return Ie(e.prev,e,t.prev)<0&&Ie(t.next,e,e.next)<0}function Me(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Se(e){let t=e,r=e;do{(t.x=(e-o)*(s-a)&&(e-o)*(n-a)>=(r-o)*(t-a)&&(r-o)*(s-a)>=(i-o)*(n-a)}function Te(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&Be(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(De(e,t)&&De(t,e)&&function(e,t){let r=e,n=!1;const i=(e.x+t.x)/2,s=(e.y+t.y)/2;do{r.y>s!=r.next.y>s&&r.next.y!==r.y&&i<(r.next.x-r.x)*(s-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(Ie(e.prev,e,t.prev)||Ie(e,t.prev,t))||Re(e,t)&&Ie(e.prev,e,e.next)>0&&Ie(t.prev,t,t.next)>0)}function Ie(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Re(e,t){return e.x===t.x&&e.y===t.y}function Be(e,t,r,n){const i=Le(Ie(e,t,r)),s=Le(Ie(e,t,n)),o=Le(Ie(r,n,e)),a=Le(Ie(r,n,t));return i!==s&&o!==a||!(0!==i||!Pe(e,r,t))||!(0!==s||!Pe(e,n,t))||!(0!==o||!Pe(r,e,n))||!(0!==a||!Pe(r,t,n))}function Pe(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function Le(e){return e>0?1:e<0?-1:0}function De(e,t){return Ie(e.prev,e,e.next)<0?Ie(e,t,e.next)>=0&&Ie(e,e.prev,t)>=0:Ie(e,t,e.prev)<0||Ie(e,e.next,t)<0}function Oe(e,t){const r=Fe(e.i,e.x,e.y),n=Fe(t.i,t.x,t.y),i=e.next,s=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,s.next=n,n.prev=s,n}function Ne(e,t,r,n){const i=Fe(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Ue(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Fe(e,t,r){return{i:e,x:t,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}var ke=r(36845),ze=r(70515),Ge=r(47155);const Qe=n.MathUtils.DEG2RAD,Ve=new n.Matrix4,He=new n.Vector3,je=new n.Vector3,qe=(new n.Vector3).set(0,0,1),We=new o.A("EPSG:4326",0,0,0),Ye=new n.Euler,Xe=new n.Quaternion;function Ke(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Quaternion;return e?t.set(0,0,0,1):Ke}const $e={quaternionFromRollPitchHeading(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new n.Quaternion;return e*=Qe,t*=Qe,r*=Qe,i.setFromEuler(Ye.set(-t,-e,-r,"YXZ"))},quaternionFromOmegaPhiKappa(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new n.Quaternion;return e*=Qe,t*=Qe,r*=Qe,i.setFromEuler(Ye.set(e,t,r,"XYZ")),i.set(i.w,i.z,-i.y,-i.x),i},quaternionFromAttitude(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Quaternion;return void 0!==e.roll||void 0!==e.pitch||void 0!==e.heading?this.quaternionFromRollPitchHeading(e.roll,e.pitch,e.heading,t):void 0!==e.omega||void 0!==e.phi||void 0!==e.kappa?this.quaternionFromOmegaPhiKappa(e.omega,e.phi,e.kappa,t):t.set(0,0,0,1)},quaternionFromEnuToGeocent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Quaternion;return e?this.quaternionFromEnuToGeocent()(e,t):function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Quaternion;const r=e.geodesicNormal;return 0==r.x&&0==r.y?t.set(0,0,0,1):(je.set(-r.y,r.x,0).normalize(),He.crossVectors(r,je),Ve.makeBasis(je,He,r),t.setFromRotationMatrix(Ve))}},quaternionFromGeocentToEnu(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Quaternion;if(e)return this.quaternionFromGeocentToEnu()(e,t);const r=this.quaternionFromEnuToGeocent();return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Quaternion;return r(e,t).conjugate()}},quaternionFromLCCToEnu(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new n.Quaternion;if(t)return this.quaternionFromLCCToEnu(e)(t,r);const i=Math.sin(e.lat0);return function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Quaternion;const s=t.as(We.crs,We).longitude*Qe;return r.setFromAxisAngle(qe,i*(e.long0-s))}},quaternionFromEnuToLCC(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new n.Quaternion;if(t)return this.quaternionFromEnuToLCC(e)(t,r);const i=this.quaternionFromLCCToEnu(e);return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Quaternion;return i(e,t).conjugate()}},quaternionFromTMercToEnu(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new n.Quaternion;if(t)return this.quaternionFromTMercToEnu(e)(t,r);const i=e.a*e.a,s=e.b*e.b,o=e.e*e.e,a=e.e?o/(1-o):i/s-1;return function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Quaternion;t.as(We.crs,We);const i=We.longitude*Qe,s=We.latitude*Qe,o=e.long0-i,l=Math.cos(s),c=Math.sin(s),u=l*l,h=o*o*u,d=a*u;return r.setFromAxisAngle(qe,o*c*(1+h/3*(1+3*d+2*d*d)+h*h*(2-c/l)/15))}},quaternionFromEnuToTMerc(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new n.Quaternion;if(t)return this.quaternionFromEnuToTMerc(e)(t,r);const i=this.quaternionFromTMercToEnu(e);return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Quaternion;return i(e,t).conjugate()}},quaternionFromLongLatToEnu(e){return Ke(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Quaternion)},quaternionFromEnuToLongLat(e){return Ke(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Quaternion)},quaternionUnimplemented(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new n.Quaternion;return console.warn("This quaternion function is not implemented for projections of type",e.projName),Ke(t,r)},quaternionFromEnuToCRS(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new n.Quaternion;if(t)return this.quaternionFromEnuToCRS(e)(t,r);const s=e.projName?e:i.A.defs(e);switch(s.projName){case"geocent":return this.quaternionFromEnuToGeocent();case"lcc":return this.quaternionFromEnuToLCC(s);case"tmerc":return this.quaternionFromEnuToTMerc(s);case"longlat":return this.quaternionFromEnuToLongLat();default:return this.quaternionUnimplemented(s)}},quaternionFromCRSToEnu(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new n.Quaternion;if(t)return this.quaternionFromCRSToEnu(e)(t,r);const s=e.projName?e:i.A.defs(e);switch(s.projName){case"geocent":return this.quaternionFromGeocentToEnu();case"lcc":return this.quaternionFromLCCToEnu(s);case"tmerc":return this.quaternionFromTMercToEnu(s);case"longlat":return this.quaternionFromLongLatToEnu();default:return this.quaternionUnimplemented(s)}},quaternionFromCRSToCRS(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new n.Quaternion;if(r)return this.quaternionFromCRSToCRS(e,t)(r,i);if(e==t)return function(){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Quaternion).set(0,0,0,1)};const s=this.quaternionFromCRSToEnu(e),o=this.quaternionFromEnuToCRS(t);return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Quaternion;return o(e,t).multiply(s(e,Xe))}}};var Je=r(48306);const Ze=new o.A("EPSG:4326",0,0,0),et=new Je.J,tt=new Je.Ay;let rt;const nt=new n.Vector2,it=new n.Vector2,st=new n.Vector3,ot=new n.Vector3,at=new n.Vector3,lt=new n.Vector3,ct=new s.A("EPSG:4326",0,0,0,0),ut=new n.Color,ht="EPSG:4326";class dt extends n.Group{#C;#T;#I=(()=>new n.Group)();#R=(()=>new n.Group)();constructor(e,t){super(),this.meshes=(new n.Group).add(...e),this.#I=(new n.Group).add(this.meshes),this.#I.quaternion.copy(t.quaternion),this.#I.position.copy(t.position),this.#I.scale.copy(t.scale),this.#I.updateMatrix(),this.#T=t.crs,this.#C=this.#T,this.extent=t.extent,this.add(this.#R.add(this.#I))}as(e){if(this.#C!==e)if(this.#C=e,e==this.#T)this.place.position.set(0,0,0),this.position.set(0,0,0),this.scale.set(1,1,1),this.quaternion.identity();else{Ze.crs=this.#T,this.extent.isExtent?(ct.copy(this.extent).applyMatrix4(this.#I.matrix),ct.as(Ze.crs,ct)):this.extent.toExtent(Ze.crs,ct),ct.spatialEuclideanDimensions(nt),ct.planarDimensions(it),it.x&&it.y&&this.scale.copy(nt).divide(it).setZ(1),this.#R.position.copy(this.#I.position).negate(),Ze.setFromVector3(this.#I.position);const t="EPSG:3857"==this.#T?ht:this.#T;$e.quaternionFromCRSToCRS(t,e)(Ze.as(ht),this.quaternion),Ze.as(e,Ze).toVector3(this.position)}return this}}function pt(e){return e?"Color"==e.type?e:ut.set(e):ut.set(16777215*Math.random())}function ft(e,t){return t<=255?new Uint8Array(e):t<=65535?new Uint16Array(e):new Uint32Array(e)}function mt(e,t,r,n,i){const s=e.length;e.length+=6*(n-1);for(let o=r,a=s;ot);let a=0;const l=new Float32Array(r);lt.setFromMatrixScale(et.collection.matrixWorldInverse),st.set(0,0,1).multiply(lt);const c=[];et.setFeature(e);for(const t of e.geometries){const r=t.indices[0].offset,n=t.indices[0].count,u=o(t.properties,a);et.setGeometry(t);for(let t=3*r,o=r;o1&&console.warn("Too many differents point.radius, only the first one will be used"),new n.Points(u,t.pointMaterial)}function At(e,t,r){const n=(t*=3)+3*r;let i=0;for(let r=n-3,s=t;s{e instanceof n.Mesh&&(e.updateMatrixWorld(),e.geometry.applyMatrix4(e.matrixWorld),t.push(e))})),t}(i).forEach((n=>e.add(yt(n,r,t)))),e}throw new Error("The format of the model object provided in the style (layer.style.point.model.object) is not supported. Only THREE.Mesh or THREE.Object3D are supported.")}(e),r.isInstancedMesh=!0}catch(n){r=gt(e,t)}else r=gt(e,t);break;case ke.Xs.LINE:r=function(e,t){const r=e.vertices,i=new Uint8Array(r.length),s=r.length/3,o=new Uint32Array(s),a=t.batchId||((e,t)=>t);let l=0;const c=new Float32Array(r.length),u=new n.BufferGeometry,h=[];et.setFeature(e);const d=ft(2*(s-e.geometries.length),s);let p=0;lt.setFromMatrixScale(et.collection.matrixWorldInverse),st.set(0,0,1).multiply(lt);for(const t of e.geometries){et.setGeometry(t);const r=a(t.properties,l),n=t.indices[0].offset;if(n>65535){console.warn("Feature to Line: integer overflow, too many points in lines");break}const s=n+t.indices[0].count;for(let t=3*n,a=n;a1&&console.warn("Too many differents stroke.width, only the first one will be used"),u.setAttribute("position",new n.BufferAttribute(c,3)),u.setAttribute("color",new n.BufferAttribute(i,3,!0)),u.setAttribute("batchId",new n.BufferAttribute(o,1)),u.setIndex(new n.BufferAttribute(d,1)),new n.LineSegments(u,t.lineMaterial)}(e,t);break;case ke.Xs.POLYGON:r=rt.fill&&Object.keys(rt.fill).includes("extrusion_height")?function(e,t){const r=e.vertices,i=new Float32Array(2*r.length),s=r.length/3,o=new Uint8Array(2*r.length),a=[],l=new Uint32Array(i.length/3),c=t.batchId||((e,t)=>t);let u=0;et.setFeature(e),lt.setFromMatrixScale(et.collection.matrixWorldInverse),st.set(0,0,1).multiply(lt),Ze.setCrs(et.collection.crs);for(const t of e.geometries){et.setGeometry(t);const n=t.indices[0].offset,h=t.indices.slice(-1)[0],d=h.offset+h.count,p=d-n,f=t.indices[0].ccw??At(r,n,p)<0,m=3*n,g=n+s,A=c(t.properties,u);for(let t=m,a=m+r.length,c=n;te.offset-n)).slice(1),3),v=a.length;a.length+=y.length;for(let e=0;et);et.setFeature(e),lt.setFromMatrixScale(et.collection.matrixWorldInverse),st.set(0,0,1).multiply(lt);let l=0;for(const t of e.geometries){const n=t.indices[0].offset;if(n>4294967295){console.warn("Feature to Polygon: integer overflow, too many points in polygons");break}et.setGeometry(t);const c=t.indices.slice(-1)[0],u=c.offset+c.count,h=3*n,d=a(t.properties,l);for(let t=h,s=n;te.offset-n)).slice(1),3),f=s.length;s.length+=p.length;for(let e=0;e0&&void 0!==arguments[0]?arguments[0]:{};return(0,Ge.nt)(e),function(t){if(!t)return;e.pointMaterial||(e.pointMaterial=(0,ze.A)(new n.PointsMaterial,this),e.lineMaterial=(0,ze.A)(new n.LineBasicMaterial,this),e.polygonMaterial=(0,ze.A)(new n.MeshBasicMaterial,this)),rt=this?.style||(e.style?new Je.Ay(e.style):tt),et.setCollection(t);const r=t.features;if(!r||0==r.length)return;const i=r.map((t=>{const r=vt(t,e);return r.layer=this,r}));return new dt(i,t)}}};var _t=r(19073),bt=r(18590),wt=r(10733);const Et={color_layers_pars_fragment:"struct Layer {\n int textureOffset;\n int crs;\n int effect_type;\n float effect_parameter;\n float opacity;\n bool transparent;\n};\n\n#include \n\nuniform sampler2D colorTextures[NUM_FS_TEXTURES];\nuniform vec4 colorOffsetScales[NUM_FS_TEXTURES];\nuniform Layer colorLayers[NUM_FS_TEXTURES];\nuniform int colorTextureCount;\n\nvec3 uvs[NUM_CRS];\n\nfloat getBorderDistance(vec2 uv) {\n vec2 p2 = min(uv, 1. -uv);\n return min(p2.x, p2.y);\n}\n\nfloat tolerance = 0.99;\n\nvec4 applyWhiteToInvisibleEffect(vec4 color) {\n float a = dot(color.rgb, vec3(0.333333333));\n if (a >= tolerance) {\n color.a = 0.0;\n }\n return color;\n}\n\nvec4 applyLightColorToInvisibleEffect(vec4 color, float intensity) {\n float a = max(0.05,1. - length(color.xyz - 1.));\n color.a *= 1.0 - pow(abs(a), intensity);\n color.rgb *= color.rgb * color.rgb;\n return color;\n}\n\n#if defined(DEBUG)\nuniform bool showOutline;\nuniform vec3 outlineColors[NUM_CRS];\nuniform float outlineWidth;\n\nvec4 getOutlineColor(vec3 outlineColor, vec2 uv) {\n float alpha = 1. - clamp(getBorderDistance(uv) / outlineWidth, 0., 1.);\n return vec4(outlineColor, alpha);\n}\n#endif\n\nuniform float minBorderDistance;\nvec4 getLayerColor(int textureOffset, sampler2D tex, vec4 offsetScale, Layer layer) {\n if ( textureOffset >= colorTextureCount ) return vec4(0);\n\n vec3 uv;\n // #pragma unroll_loop\n for ( int i = 0; i < NUM_CRS; i ++ ) {\n if ( i == layer.crs ) uv = uvs[ i ];\n }\n\n float borderDistance = getBorderDistance(uv.xy);\n if (textureOffset != layer.textureOffset + int(uv.z) || borderDistance < minBorderDistance ) return vec4(0);\n vec4 color = texture2D(tex, pitUV(uv.xy, offsetScale));\n if (layer.effect_type == 3) {\n #include \n } else {\n if (layer.transparent && color.a != 0.0) {\n color.rgb /= color.a;\n }\n\n if (layer.effect_type == 1) {\n color = applyLightColorToInvisibleEffect(color, layer.effect_parameter);\n } else if (layer.effect_type == 2) {\n color = applyWhiteToInvisibleEffect(color);\n }\n }\n color.a *= layer.opacity;\n return color;\n}\n",custom_body_colorLayer:"// no custom body",custom_header_colorLayer:"// no custom header",elevation_pars_vertex:"#if NUM_VS_TEXTURES > 0\n struct Layer {\n float scale;\n float bias;\n int mode;\n float zmin;\n float zmax;\n };\n\n uniform Layer elevationLayers[NUM_VS_TEXTURES];\n uniform sampler2D elevationTextures[NUM_VS_TEXTURES];\n uniform vec4 elevationOffsetScales[NUM_VS_TEXTURES];\n uniform int elevationTextureCount;\n uniform float geoidHeight;\n\n highp float decode32(highp vec4 rgba) {\n highp float Sign = 1.0 - step(128.0,rgba[0])*2.0;\n highp float Exponent = 2.0 * mod(rgba[0],128.0) + step(128.0,rgba[1]) - 127.0;\n highp float Mantissa = mod(rgba[1],128.0)*65536.0 + rgba[2]*256.0 +rgba[3] + float(0x800000);\n highp float Result = Sign * exp2(Exponent) * (Mantissa * exp2(-23.0 ));\n return Result;\n }\n\n float getElevationMode(vec2 uv, sampler2D tex, int mode) {\n if (mode == ELEVATION_RGBA)\n return decode32(texture2D( tex, uv ).abgr * 255.0);\n if (mode == ELEVATION_DATA || mode == ELEVATION_COLOR)\n return texture2D( tex, uv ).r;\n return 0.;\n }\n\n float getElevation(vec2 uv, sampler2D tex, vec4 offsetScale, Layer layer) {\n // Elevation textures are inverted along the y-axis\n uv = vec2(uv.x, 1.0 - uv.y);\n uv = uv * offsetScale.zw + offsetScale.xy;\n float d = clamp(getElevationMode(uv, tex, layer.mode), layer.zmin, layer.zmax);\n return d * layer.scale + layer.bias;\n }\n#endif\n",elevation_vertex:"#if NUM_VS_TEXTURES > 0\n if(elevationTextureCount > 0) {\n float elevation = getElevation(uv, elevationTextures[0], elevationOffsetScales[0], elevationLayers[0]);\n transformed += elevation * normal;\n }\n#endif\n",geoid_vertex:"transformed += geoidHeight * normal;\n",fog_fragment:"#if defined(USE_FOG)\n float fogFactor = 1. - min( exp(-vFogDepth / fogDistance), 1.);\n gl_FragColor.rgb = mix(gl_FragColor.rgb, fogColor, fogFactor);\n#endif\n",fog_pars_fragment:"#if defined(USE_FOG)\nuniform vec3 fogColor;\nuniform float fogDistance;\nvarying float vFogDepth;\n#endif\n",lighting_fragment:"if (lightingEnabled) {\n float light = min(2. * dot(vNormal, lightPosition), 1.);\n gl_FragColor.rgb *= light;\n}\n",lighting_pars_fragment:"uniform bool lightingEnabled;\nuniform vec3 lightPosition;\nvarying vec3 vNormal;\n",mode_depth_fragment:"#if defined(USE_LOGDEPTHBUF)\ngl_FragColor = packDepthToRGBA(gl_FragDepthEXT);\n#else\nfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\ngl_FragColor = packDepthToRGBA(fragCoordZ);\n#endif\n",mode_id_fragment:"// 16777216.0 == 256.0 * 256.0 * 256.0\ngl_FragColor = packDepthToRGBA(float(objectId) / 16777216.0);\n",mode_pars_fragment:"#if MODE == MODE_ID || MODE == MODE_DEPTH\n#include \n#endif\n\n#if MODE == MODE_ID\nuniform int objectId;\n#endif\n",overlay_fragment:"gl_FragColor.rgb = mix(gl_FragColor.rgb, overlayColor, overlayAlpha);\n",overlay_pars_fragment:"uniform vec3 overlayColor;\nuniform float overlayAlpha;\n",pitUV:"vec2 pitUV(vec2 uv, vec4 pit)\n{\n return uv * pit.zw + vec2(pit.x, 1.0 - pit.w - pit.y);\n}\n\n",precision_qualifier:"precision highp float;\nprecision highp int;\n",projective_texturing_vertex:"for(int i = 0; i < ORIENTED_IMAGES_COUNT; ++i)\n projectiveTextureCoords[i] = projectiveTextureMatrix[i] * mvPosition;\n",projective_texturing_pars_vertex:"uniform mat4 projectiveTextureMatrix[ORIENTED_IMAGES_COUNT];\nvarying vec4 projectiveTextureCoords[ORIENTED_IMAGES_COUNT];\n",projective_texturing_pars_fragment:"uniform sampler2D projectiveTexture[ORIENTED_IMAGES_COUNT];\nuniform sampler2D mask[ORIENTED_IMAGES_COUNT];\nvarying vec4 projectiveTextureCoords[ORIENTED_IMAGES_COUNT];\nuniform float projectiveTextureAlphaBorder;\nuniform float opacity;\nuniform bool boostLight;\n\nstruct Distortion {\n vec2 size;\n#if USE_DISTORTION\n vec2 pps;\n vec4 polynom;\n vec3 l1l2;\n#endif\n};\n\nuniform Distortion projectiveTextureDistortion[ORIENTED_IMAGES_COUNT];\n\nfloat getAlphaBorder(vec2 p)\n{\n vec2 d = clamp(projectiveTextureAlphaBorder * min(p, 1. - p), 0., 1.);\n return min(d.x, d.y);\n}\n\n#if USE_DISTORTION\nvoid distort(inout vec2 p, vec4 polynom, vec2 pps)\n{\n vec2 v = p - pps;\n float v2 = dot(v, v);\n if (v2 > polynom.w) {\n p = vec2(-1.);\n }\n else {\n p += (v2 * (polynom.x + v2 * (polynom.y + v2 * polynom.z) ) ) * v;\n }\n}\n\nvoid distort(inout vec2 p, vec4 polynom, vec3 l1l2, vec2 pps)\n{\n if ((l1l2.x == 0.) && (l1l2.y == 0.)) {\n distort(p, polynom, pps);\n } else {\n vec2 AB = (p - pps) / l1l2.z;\n float R = length(AB);\n float lambda = atan(R) / R;\n vec2 ab = lambda * AB;\n float rho2 = dot(ab, ab);\n float r357 = 1. + rho2* (polynom.x + rho2* (polynom.y + rho2 * polynom.z));\n p = pps + l1l2.z * (r357 * ab + vec2(dot(l1l2.xy, ab), l1l2.y * ab.x));\n }\n}\n#endif\n\nvec4 mixBaseColor(vec4 aColor, vec4 baseColor) {\n #ifdef USE_BASE_MATERIAL\n baseColor.rgb = aColor.a == 1.0 ? aColor.rgb : mix(baseColor, aColor, aColor.a).rgb;\n baseColor.a = min(1.0, aColor.a + baseColor.a);\n #else\n baseColor.rgb += aColor.rgb * aColor.a;\n baseColor.a += aColor.a;\n #endif\n return baseColor;\n}\n\nvec4 projectiveTextureColor(vec4 coords, Distortion distortion, sampler2D tex, sampler2D mask, vec4 baseColor) {\n vec3 p = coords.xyz / coords.w;\n if(p.z * p.z < 1.) {\n#if USE_DISTORTION\n p.xy *= distortion.size;\n distort(p.xy, distortion.polynom, distortion.l1l2, distortion.pps);\n p.xy /= distortion.size;\n#endif\n\n float d = getAlphaBorder(p.xy) * texture2D(mask, p.xy).r;\n\n if(d > 0.) {\n\n#if DEBUG_ALPHA_BORDER\n vec3 r = texture2D(tex, p.xy).rgb;\n return mixBaseColor(vec4( r.r * d, r.g, r.b, 1.0), baseColor);\n#else\n vec4 color = texture2D(tex, p.xy);\n color.a *= d;\n if (boostLight) {\n return mixBaseColor(vec4(sqrt(color.rgb), color.a), baseColor);\n } else {\n return mixBaseColor(color, baseColor);\n }\n#endif\n\n }\n }\n return mixBaseColor(vec4(0.), baseColor);\n}\n"},Mt=new class{constructor(e,t){this.path=t,this.target=e,this.install()}customHeaderColorLayer(e){Et.custom_header_colorLayer=e,this.target[`${this.path}custom_header_colorLayer`]=e}customBodyColorLayer(e){Et.custom_body_colorLayer=e,this.target[`${this.path}custom_body_colorLayer`]=e}install(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.target,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Et,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.path;return Object.keys(t).forEach((n=>{Object.defineProperty(this,n,{get:()=>t[n]}),e[r+n]=t[n]})),e}}(n.ShaderChunk,"itowns/"),St=Mt;var Ct=r(99234),Tt=r(2015),It=r(93320),Rt=r(3837),Bt=r(61276);const Pt=new Je.Ay,Lt=new Je.J;let Dt;function Ot(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[{offset:0,count:1}],n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0;if(0===t.length)return;const l=new Path2D;for(const e of r)if(e.extent&&s.A.intersectsExtent(e.extent,i)){const r=e.offset*n,i=r+e.count*n;l.moveTo(t[r],t[r+1]);for(let e=r+n;e(e.generateMipmaps=!1,e.magFilter=t.magFilter||n.LinearFilter,e.minFilter=t.minFilter||n.LinearFilter,e),Kt={convert(e,t,r){let i;if(e.isFeatureCollection){const s=r.source.backgroundLayer,o=s&&s.paint?new n.Color(s.paint["background-color"]):void 0;t.toExtent(r.crs,Yt),i=Wt.createTextureFromFeature(e,Yt,r.subdivisionThreshold,r.style,o),i.features=e,i.extent=t}else{if(!e.isTexture)throw new Error("Data type is not supported to convert into texture");i=e}return r.isColorLayer?function(e,t){return e.anisotropy=16,e.premultiplyAlpha=t.transparent,Xt(e,t)}(i,r):r.isElevationLayer?(i.flipY&&(i.flipY=!1),Xt(i,r)):void 0}};var $t=r(99487);class Jt extends Bt.A{constructor(e,t){const{cacheLifeTime:r=$t.W.TEXTURE,minFilter:n,magFilter:i,...s}=t;super(e,{...s,cacheLifeTime:r}),this.minFilter=n,this.magFilter=i}convert(e,t){return Kt.convert(e,t,this)}delete(e){e&&this.cache.clear();for(const e of this.parent.level0Nodes)e.traverse(T(this.id))}}const Zt=Jt;var er=r(24051);const tr=class extends Zt{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,Ge.K3)(t);const{effect_type:r=0,effect_parameter:n=1,transparent:i,...s}=t;super(e,s),this.isColorLayer=!0,this.visible=!0,this.defineLayerProperty("visible",this.visible),this.opacity=1,this.defineLayerProperty("opacity",this.opacity),this.sequence=0,this.defineLayerProperty("sequence",this.sequence),this.transparent=i||this.opacity<1,this.noTextureParentOutsideLimit=!!t.source&&t.source.isFileSource,this.effect_type=r,this.effect_parameter=n,this.buildExtent=!0,this.structure="2d"}setupRasterNode(e){const t=new er.p7(e.material,this);return e.material.addLayer(t),e.material.setSequence(this.parent.colorLayersOrder),t}update(e,t,r,n){return S(e,this,r,n)}},rr=class extends Zt{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{scale:r=1,noDataValue:n,clampValues:i,useRgbaTextureElevation:s,useColorTextureElevation:o,colorTextureElevationMinZ:a,colorTextureElevationMaxZ:l,bias:c,mode:u,...h}=t;super(e,h),this.isElevationLayer=!0,this.noDataValue=n,(t.zmin||t.zmax)&&console.warn("Config using zmin and zmax are deprecated, use {clampValues: {min, max}} structure."),this.zmin=i?.min??t.zmin,this.zmax=i?.max??t.zmax,this.defineLayerProperty("scale",r),this.useRgbaTextureElevation=s,this.useColorTextureElevation=o,this.colorTextureElevationMinZ=a,this.colorTextureElevationMaxZ=l,this.bias=c,this.mode=u}setupRasterNode(e){const t=new er.Is(e.material,this);e.material.addLayer(t),e.material.setSequenceElevation(this.id);const r=()=>e.setBBoxZ({min:t.min,max:t.max,scale:this.scale});return r(),t.addEventListener("rasterElevationLevelChanged",r),this.addEventListener("scale-property-changed",r),e.addEventListener("dispose",(()=>{this.removeEventListener("scale-property-changed",r)})),t}update(e,t,r,n){return C(e,this,r,n)}};var nr=r(80736);class ir extends nr.A{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{object3d:r,batchId:i,onMeshCreated:s,accurate:o=!0,filter:a,...l}=t;super(e,r||new n.Group,l),this.update=_.update,this.convert=xt.convert({batchId:i}),this.onMeshCreated=s,this.isFeatureGeometryLayer=!0,this.accurate=o,this.buildExtent=!this.accurate,this.filter=a}preUpdate(e,t){t.has(this.parent)&&this.object3d.clear()}}const sr=ir;var or=r(10456);const ar=new n.Vector3,lr=new n.Mesh,cr=new n.Box3;function ur(e,t,r,i,s){return e.camera.camera3D.isOrthographicCamera?function(e,t,r,i){const s=r/2**i.depth,o=new n.Vector4(s);o.applyMatrix4(e.camera.camera3D.projectionMatrix);const a=.5*o.x*e.camera.width,l=.5*o.y*e.camera.height,c=Math.sqrt(a*a+l*l);return Math.max(0,c-t)}(e,t,r,i):function(e,t,r,n,i){if(i<=0)return 1/0;const s=r/2**n.depth,o=e.camera.preSSE*s/i;return Math.max(0,o-t)}(e,t,r,i,s)}function hr(e){e.obj&&(e.obj.visible=!1),e.notVisibleSince||(e.notVisibleSince=Date.now(),e.sse=-1);for(const t of e.children)hr(t)}function dr(e){e.material.intensityRange?.set(e.minIntensityRange,e.maxIntensityRange)}function pr(e){e.material.elevationRange?.set(e.minElevationRange,e.maxElevationRange)}function fr(e){e.material.angleRange?.set(e.minAngleRange,e.maxAngleRange)}lr.geometry.boundingBox=cr;class mr extends nr.A{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{object3d:r=new n.Group,group:i=new n.Group,bboxes:s=new n.Group,octreeDepthLimit:o=-1,pointBudget:a=2e6,pointSize:l=2,sseThreshold:c=2,minIntensityRange:u=1,maxIntensityRange:h=65536,minElevationRange:d=0,maxElevationRange:p=1e3,minAngleRange:f=-90,maxAngleRange:m=90,material:g={},mode:A=L.qW.COLOR,...y}=t;super(e,r,y),this.isPointCloudLayer=!0,this.protocol="pointcloud",this.group=i,this.object3d.add(this.group),this.bboxes=s||new n.Group,this.bboxes.visible=!1,this.object3d.add(this.bboxes),this.group.updateMatrixWorld(),this.octreeDepthLimit=o,this.pointBudget=a,this.pointSize=l,this.sseThreshold=c,this.defineLayerProperty("minIntensityRange",u,dr),this.defineLayerProperty("maxIntensityRange",h,dr),this.defineLayerProperty("minElevationRange",d,pr),this.defineLayerProperty("maxElevationRange",p,pr),this.defineLayerProperty("minAngleRange",f,fr),this.defineLayerProperty("maxAngleRange",m,fr),this.material=g,this.material.isMaterial||(this.material.intensityRange=new n.Vector2(this.minIntensityRange,this.maxIntensityRange),this.material.elevationRange=new n.Vector2(this.minElevationRange,this.maxElevationRange),this.material.angleRange=new n.Vector2(this.minAngleRange,this.maxAngleRange),this.material=new L.Ay(this.material)),this.mode=A||L.qW.COLOR,this.root=void 0}preUpdate(e,t){let r;e.camera.preSSE=e.camera.height/(2*Math.tan(.5*n.MathUtils.degToRad(e.camera.camera3D.fov))),this.material&&(this.material.visible=this.visible,this.material.opacity=this.opacity,this.material.transparent=this.opacity<1||this.material.userData.needTransparency[this.material.mode],this.material.size=this.pointSize,this.material.scale=e.camera.preSSE,this.material.updateUniforms&&this.material.updateUniforms());for(const e of t.values()){if(e.isCamera||e==this)return[this.root];if(void 0!==e.obj&&e.obj.isPoints&&e.obj.layer==this)if(r){if(r=e.findCommonAncestor(r),!r)return[this.root]}else r=e}return r?[r]:[this.root]}update(e,t,r){if(r.visible=!1,this.octreeDepthLimit>=0&&this.octreeDepthLimit!e.requester.visible||!this.visible}).then((e=>{r.obj=e,r.tightbbox=e.tightbbox,this.group.add(r.obj),r.obj.updateMatrixWorld(!0)})).catch((e=>{if(!e.isCancelledCommandException)return e})).finally((()=>{r.promise=null}))}if(r.children&&r.children.length){const n=i.distanceToPoint(ar);if(r.sse=ur(e,t.pointSize,t.spacing,r,n)/this.sseThreshold,r.sse>=1)return r.children;for(const e of r.children)hr(e)}}else hr(r)}postUpdate(){this.displayedCount=0;for(const e of this.group.children)if(e.visible){const t=e.geometry.attributes.position.count;e.geometry.setDrawRange(0,t),this.displayedCount+=t}if(this.displayedCount>this.pointBudget)if(this.supportsProgressiveDisplay){const e=this.pointBudget/this.displayedCount;for(const t of this.group.children)if(t.visible){const r=Math.floor(t.geometry.drawRange.count*e);r>0?t.geometry.setDrawRange(0,r):t.visible=!1}this.displayedCount*=e}else{this.group.children.sort(((e,t)=>t.userData.node.sse-e.userData.node.sse));let e=!1;this.displayedCount=0;for(const t of this.group.children){const r=t.geometry.attributes.position.count;e||this.displayedCount+r>this.pointBudget?(t.visible=!1,e=!0):this.displayedCount+=r}}const e=Date.now();for(let t=this.group.children.length-1;t>=0;t--){const r=this.group.children[t];!r.visible&&e-r.userData.node.notVisibleSince>1e4&&(this.group.children.splice(t,1),r.geometry.dispose(),r.material=null,r.geometry=null,r.userData.node.obj=null)}}pickObjectsAt(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return or.A.pickPointsAt(e,t,r,this,n)}getObjectToUpdateForAttachedLayers(e){if(e.obj){const t=e.parent;return t&&t.obj?{element:e.obj,parent:t.obj}:{element:e.obj}}}}const gr=mr;class Ar extends n.EventDispatcher{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;super(),this.numPoints=e,this.layer=t,this.children=[],this.bbox=new n.Box3,this.sse=-1}add(e,t){this.children.push(e),e.parent=this,this.createChildAABB(e,t)}load(){return this.octreeIsLoaded||this.loadOctree(),this.layer.source.fetcher(this.url,this.layer.source.networkOptions).then((e=>this.layer.source.parse(e,{out:this.layer,in:this.layer.source})))}findCommonAncestor(e){return e.depth!=this.depth?e.depth1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2?arguments[2]:void 0;super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t),this.childrenBitField=e,this.id="",this.depth=0,this.baseurl=t.source.baseurl}add(e,t,r){super.add(e,t),e.id=this.id+t,e.depth=e.id.length,e.id.length%this.layer.hierarchyStepSize==0?e.baseurl=`${r.baseurl}/${e.id.substr(r.id.length)}`:e.baseurl=r.baseurl}createChildAABB(e,t){e.bbox.copy(this.bbox),this.bbox.getCenter(e.bbox.max),vr.copy(e.bbox.max).sub(this.bbox.min),1===t?(e.bbox.min.z+=vr.z,e.bbox.max.z+=vr.z):3===t?(e.bbox.min.z+=vr.z,e.bbox.max.z+=vr.z,e.bbox.min.y+=vr.y,e.bbox.max.y+=vr.y):0===t||(2===t?(e.bbox.min.y+=vr.y,e.bbox.max.y+=vr.y):5===t?(e.bbox.min.z+=vr.z,e.bbox.max.z+=vr.z,e.bbox.min.x+=vr.x,e.bbox.max.x+=vr.x):7===t?(e.bbox.min.add(vr),e.bbox.max.add(vr)):4===t?(e.bbox.min.x+=vr.x,e.bbox.max.x+=vr.x):6===t&&(e.bbox.min.y+=vr.y,e.bbox.max.y+=vr.y,e.bbox.min.x+=vr.x,e.bbox.max.x+=vr.x))}get octreeIsLoaded(){return!(this.childrenBitField&&0===this.children.length)}get url(){return`${this.baseurl}/r${this.id}.${this.layer.source.extension}`}loadOctree(){const e=`${this.baseurl}/r${this.id}.${this.layer.source.extensionOctree}`;return this.layer.source.fetcher(e,this.layer.source.networkOptions).then((e=>{const t=new DataView(e),r=[];let n=0;for(this.childrenBitField=t.getUint8(0),n+=1,this.numPoints=t.getUint32(1,!0),n+=4,r.push(this);r.length&&n{this.scale=(new n.Vector3).addScalar(e.scale),this.spacing=e.spacing,this.hierarchyStepSize=e.hierarchyStepSize;const t=Array.isArray(e.pointAttributes)&&e.pointAttributes.find((e=>e.startsWith("NORMAL")));return t&&(this.material.defines[t]=1),this.supportsProgressiveDisplay="cin"===this.source.extension,this.root=new _r(0,0,this),this.root.bbox.min.set(e.boundingBox.lx,e.boundingBox.ly,e.boundingBox.lz),this.root.bbox.max.set(e.boundingBox.ux,e.boundingBox.uy,e.boundingBox.uz),this.extent=s.A.fromBox3(this.source.crs||"EPSG:4326",this.root.bbox),this.root.loadOctree().then(r)}))}},Mr=new n.Vector3;class Sr extends yr{constructor(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2?arguments[2]:void 0;super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t),this.childrenBitField=e,this.id="",this.depth=0,this.baseurl=t.source.baseurl}add(e,t){super.add(e,t),e.id=this.id+t,e.depth=this.depth+1}createChildAABB(e,t){e.bbox.copy(this.bbox),this.bbox.getCenter(e.bbox.max),Mr.copy(e.bbox.max).sub(this.bbox.min),1===t?(e.bbox.min.z+=Mr.z,e.bbox.max.z+=Mr.z):3===t?(e.bbox.min.z+=Mr.z,e.bbox.max.z+=Mr.z,e.bbox.min.y+=Mr.y,e.bbox.max.y+=Mr.y):0===t||(2===t?(e.bbox.min.y+=Mr.y,e.bbox.max.y+=Mr.y):5===t?(e.bbox.min.z+=Mr.z,e.bbox.max.z+=Mr.z,e.bbox.min.x+=Mr.x,e.bbox.max.x+=Mr.x):7===t?(e.bbox.min.add(Mr),e.bbox.max.add(Mr)):4===t?(e.bbox.min.x+=Mr.x,e.bbox.max.x+=Mr.x):6===t&&(e.bbox.min.y+=Mr.y,e.bbox.max.y+=Mr.y,e.bbox.min.x+=Mr.x,e.bbox.max.x+=Mr.x))}get octreeIsLoaded(){return!(this.childrenBitField&&0===this.children.length)}get url(){return`${this.baseurl}/octree.bin`}networkOptions(e,t){const r=e;return{...this.layer.source.networkOptions,headers:{...this.layer.source.networkOptions.headers,...this.url.startsWith("https://raw.githubusercontent.com")?{}:{"content-type":"multipart/byteranges"},Range:`bytes=${r}-${r+t-1n}`}}}async load(){return this.octreeIsLoaded||await this.loadOctree(),this.layer.source.fetcher(this.url,this.networkOptions(this.byteOffset,this.byteSize)).then((e=>this.layer.source.parser(e,{in:{source:this.layer.source,bbox:this.bbox,numPoints:this.numPoints},out:this.layer}))).then((e=>(this.loaded=!0,this.loading=!1,e.geometry)))}async loadOctree(){if(!this.loaded&&!this.loading)return this.loading=!0,2===this.nodeType?this.loadHierarchy():Promise.resolve()}async loadHierarchy(){const e=`${this.baseurl}/hierarchy.bin`,t=await this.layer.source.fetcher(e,this.networkOptions(this.hierarchyByteOffset,this.hierarchyByteSize));this.parseHierarchy(t)}parseHierarchy(e){const t=new DataView(e),r=e.byteLength/22,n=[];n.push(this);for(let e=0;e{Tr[t]=Tr[e]}));class Ir{constructor(e,t,r){this.name=e,this.type=t,this.numElements=r,this.byteSize=this.numElements*this.type.size,this.description="",this.range=[1/0,-1/0]}}Ir.POSITION_CARTESIAN=new Ir("POSITION_CARTESIAN",Tr.DATA_TYPE_FLOAT,3),Ir.RGBA_PACKED=new Ir("COLOR_PACKED",Tr.DATA_TYPE_INT8,4),Ir.COLOR_PACKED=Ir.RGBA_PACKED,Ir.RGB_PACKED=new Ir("COLOR_PACKED",Tr.DATA_TYPE_INT8,3),Ir.NORMAL_FLOATS=new Ir("NORMAL_FLOATS",Tr.DATA_TYPE_FLOAT,3),Ir.INTENSITY=new Ir("INTENSITY",Tr.DATA_TYPE_UINT16,1),Ir.CLASSIFICATION=new Ir("CLASSIFICATION",Tr.DATA_TYPE_UINT8,1),Ir.NORMAL_SPHEREMAPPED=new Ir("NORMAL_SPHEREMAPPED",Tr.DATA_TYPE_UINT8,2),Ir.NORMAL_OCT16=new Ir("NORMAL_OCT16",Tr.DATA_TYPE_UINT8,2),Ir.NORMAL=new Ir("NORMAL",Tr.DATA_TYPE_FLOAT,3),Ir.RETURN_NUMBER=new Ir("RETURN_NUMBER",Tr.DATA_TYPE_UINT8,1),Ir.NUMBER_OF_RETURNS=new Ir("NUMBER_OF_RETURNS",Tr.DATA_TYPE_UINT8,1),Ir.SOURCE_ID=new Ir("SOURCE_ID",Tr.DATA_TYPE_UINT16,1),Ir.INDICES=new Ir("INDICES",Tr.DATA_TYPE_UINT32,1),Ir.SPACING=new Ir("SPACING",Tr.DATA_TYPE_FLOAT,1),Ir.GPS_TIME=new Ir("GPS_TIME",Tr.DATA_TYPE_DOUBLE,1);class Rr{constructor(){this.attributes=[],this.byteSize=0,this.size=0,this.vectors=[]}add(e){this.attributes.push(e),this.byteSize+=e.byteSize,this.size++}addVector(e){this.vectors.push(e)}hasNormals(){for(let e=0;e{this.scale=new n.Vector3(1,1,1),this.metadata=e,this.pointAttributes=function(e){const t=new Rr,r={rgb:"rgba"};for(const n of e){const{name:e,numElements:i,min:s,max:o}=n,a=Lr[n.type],l=new Ir(r[e]?r[e]:e,a,i);l.range=1===i?[s[0],o[0]]:[s,o],"gps-time"===e&&l.range[0]===l.range[1]&&(l.range[1]+=1),l.initialRange=l.range,t.add(l)}return void 0!==t.attributes.find((e=>"NormalX"===e.name))&&void 0!==t.attributes.find((e=>"NormalY"===e.name))&&void 0!==t.attributes.find((e=>"NormalZ"===e.name))&&t.addVector({name:"NORMAL",attributes:["NormalX","NormalY","NormalZ"]}),t}(e.attributes),this.spacing=e.spacing;const t=Array.isArray(this.pointAttributes.attributes)&&this.pointAttributes.attributes.find((e=>e.name.startsWith("NORMAL")));t&&(this.material.defines[t.name]=1);const i=new n.Vector3(...e.boundingBox.min),o=new n.Vector3(...e.boundingBox.max),a=new n.Box3(i,o),l=new Cr(0,0,this);return l.bbox=a,l.boundingSphere=a.getBoundingSphere(new n.Sphere),l.id="r",l.depth=0,l.nodeType=2,l.hierarchyByteOffset=0n,l.hierarchyByteSize=BigInt(e.hierarchy.firstChunkSize),l.byteOffset=0,this.root=l,this.extent=s.A.fromBox3(this.source.crs||"EPSG:4326",a),this.root.loadOctree().then(r)}))}};var Or=r(14333),Nr=r(49423),Ur=r(76932),Fr=r(21311);const kr=new n.Matrix4(1,0,0,1,0,1,0,1,0,0,2,0,0,0,0,2),zr=new n.DataTexture(new Uint8Array([255,255,255,255]),1,1,n.RGBAFormat,n.UnsignedByteType);zr.needsUpdate=!0;const Gr=new n.Texture,Qr=new n.ShaderMaterial;class Vr extends n.ShaderMaterial{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.side=t.side??n.DoubleSide,t.transparent=t.transparent??!0,t.opacity=t.opacity??1;const r={};for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&void 0!==Qr[e]&&(r[e]=t[e]);super(r),this.defines.ORIENTED_IMAGES_COUNT=t.OrientedImagesCount??e.length;const i=Tt.A.getMaxTextureUnitsCount();this.defines.ORIENTED_IMAGES_COUNT>i&&(console.warn(`OrientedImageMaterial: Can't project ${e.length} textures, because it's more than GPU capabilities maximum texture units (${i})`),this.defines.ORIENTED_IMAGES_COUNT=i-1,console.warn(`OrientedImageMaterial: We'll use only the first ${this.defines.ORIENTED_IMAGES_COUNT} cameras.`)),t.useBaseMaterial&&(this.defines.USE_BASE_MATERIAL=!0),this.defines.USE_DISTORTION=Number(e.some((e=>null!==e.distortion.pps))),this.alphaBorder=20|t.alphaBorder,this.defines.DEBUG_ALPHA_BORDER=0|t.debugAlphaBorder,this.cameras=e;const s=[],o=[],a=[],l=[];this.group=new n.Group;for(let t=0;t\n#include \n#include \nvarying vec3 vNormal;\n\n#ifdef USE_BASE_MATERIAL\nstruct noPT {\n vec3 lightDirection;\n vec3 ambient;\n float opacity;\n};\n\nuniform noPT noProjectiveMaterial;\n#endif\n\nvoid main(void)\n{\n #include \n #ifdef USE_BASE_MATERIAL\n float nDotVP = (max(0.1, dot(vNormal, normalize(noProjectiveMaterial.lightDirection))));\n vec4 color = vec4(noProjectiveMaterial.ambient + nDotVP, 0.0);\n #else\n vec4 color = vec4(0.0);\n #endif\n\n #pragma unroll_loop\n for (int i = 0; i < ORIENTED_IMAGES_COUNT; i++) {\n color = projectiveTextureColor(projectiveTextureCoords[ ORIENTED_IMAGES_COUNT - 1 - i ], projectiveTextureDistortion[ ORIENTED_IMAGES_COUNT - 1 - i ], projectiveTexture[ ORIENTED_IMAGES_COUNT - 1 - i ], mask[ORIENTED_IMAGES_COUNT - 1 - i], color);\n }\n\n #ifdef USE_BASE_MATERIAL\n color.a = color.a < 1.0 ? max(noProjectiveMaterial.opacity, color.a) : 1.0 ;\n gl_FragColor = vec4(color.rgb, color.a * opacity);\n #else\n gl_FragColor = vec4(color.rgb / color.a, opacity);\n #endif\n\n}\n",this.defines)}setTextures(e,t,r){if(e){this.group.position.copy(t.position),this.group.quaternion.copy(t.quaternion);for(let t=0;te.name===r[t]));this.uniforms.mask.value[t]=e.maskTexture||zr,this.uniforms.mask.value[t].needsUpdate=!0,this.uniforms.projectiveTextureDistortion.value[t]=e.distortion,this.group.children[t]=e,e.parent=this.group}}this.group.children[t].needsUpdate=!0}this.group.updateMatrixWorld(!0)}}updateUniforms(e){for(let t=0;t1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=JSON.parse(e)),Promise.all(e.map((e=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=null==t.useMask||t.useMask,i=null==t.imageYDown||t.imageYDown,s=e.projection,o=(new n.Vector2).fromArray(e.size),a=new n.Vector2(s[0],s[4]),l=new n.Vector2(s[2],i?o.y-s[5]:s[5]),c=s[1],u=new P(o,a,l,t.near,t.far,c);u.position.fromArray(e.position);const h=Wr.fromArray(e.rotation);let d;u.matrix.setFromMatrix3(h),u.quaternion.setFromRotationMatrix(u.matrix),u.rotateX(Math.PI),e.distortion&&u.distortion.setFromMicmacCalibration(e.distortion,i),u.maskPath=e.mask,u.name=e.id;const p=new Promise((e=>{d=e}));return r&&u.maskPath?qr.load(u.maskPath,(e=>{u.maskTexture=e,d(u)})):d(u),p}(e,t))))}},Xr=new o.A("EPSG:4978",0,0,0),Kr=e=>e.requester.id!==e.layer.currentPano.id;function $r(e){if(!e||e<=0)return;const t=new n.SphereGeometry(e,32,32),r=new n.MeshPhongMaterial({color:7829503,side:n.DoubleSide,transparent:!0,opacity:.5,wireframe:!0}),i=new n.Mesh(t,r);return i.visible=!0,i.name="OrientedImageBackground",i}class Jr extends nr.A{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{backgroundDistance:r,background:i=$r(r),onPanoChanged:s=()=>{},getCamerasNameFromFeature:o=()=>{},...a}=t;t.projection&&(console.warn("OrientedImageLayer projection parameter is deprecated, use crs instead."),t.crs=t.crs||t.projection),super(e,new n.Group,a),this.isOrientedImageLayer=!0,this.background=i,this.background&&(this.background.layer=this.background.layer??{},this.background.layer.id=this.background.layer.id??e,this.object3d.add(this.background)),this.currentPano=void 0,this.onPanoChanged=s,this.getCamerasNameFromFeature=o;const l=this.addInitializationStep();this.mergeFeatures=!1,this.filteringExtent=!1,this.accurate=!0;const c={out:this};this.source.whenReady.then((e=>jr.A.parse(t.orientation||e.orientation,c).then((e=>{this.panos=e.features;const r=c.in.crs,i=t.crs,s=$e.quaternionFromCRSToCRS(r,i),o=new n.Quaternion;let a=0;for(const t of this.panos)Xr.crs=t.crs,Xr.setFromArray(t.vertices).applyMatrix4(e.matrix),t.position=Xr.toVector3(),s(Xr,o),t.quaternion=$e.quaternionFromAttitude(t.geometries[0].properties).premultiply(o),t.id=t.geometries[0].properties.id,t.index=a++})).then((()=>{Yr.parse(t.calibration||e.calibration,t).then((e=>{this.cameras=e,this.material=new Hr(this.cameras,t),l()}))}))))}update(){}set boostLight(e){this.material.uniforms.boostLight.value=e}get boostLight(){return this.material.uniforms.boostLight.value}preUpdate(e){var t;!function(e,t,r){const n=r.mostNearPano(t.position),i=r.currentPano?r.currentPano.id:void 0;if(n&&i!=n.id){r.currentPano=n,r.onPanoChanged({previousPanoPosition:r.getPreviousPano()?r.getPreviousPano().position:void 0,currentPanoPosition:r.getCurrentPano().position,nextPanoPosition:r.getNextPano().position});const t=n.geometries[0].properties.idSensors,i=r.cameras.map((e=>({cameraId:e.name,panoId:n.id,as:()=>{}}))).filter((e=>!t||t.includes(e.cameraId))),s={layer:r,extentsSource:i,view:e.view,requester:n,earlyDropFunction:Kr};e.scheduler.execute(s).then((t=>{n.id===r.currentPano.id&&(r.material.setTextures(t,n,r.getCamerasNameFromFeature(n)),r.material.updateUniforms(e.camera.camera3D),e.view.notifyChange(r,!0))}),(()=>{}))}}(e,e.camera.camera3D,this),this.material.updateUniforms(e.camera.camera3D),(t=this).background&&t.currentPano&&(t.background.position.copy(t.currentPano.position),t.background.updateMatrixWorld(),t.background.material=t.material||t.background.material)}getNextPano(){const e=(this.currentPano.index+1)%this.panos.length;return this.panos[e]}getCurrentPano(){return this.currentPano}getPreviousPano(){const e=(this.currentPano.index-1)%this.panos.length;return this.panos[e]}delete(e){this.background&&super.delete(),e&&this.cache.clear(),this.material.visible=!1,console.warn("You need to replace OrientedImageLayer.material applied on each object. This issue will be fixed when OrientedImageLayer will be a ColorLayer. the material visibility is set to false. To follow issue see https://github.com/iTowns/itowns/issues/1018")}mostNearPano(e){let t,r=1/0;for(const n of this.panos){const i=e.distanceTo(n.position);i5&&void 0!==arguments[5]?arguments[5]:0,i),this.isEntwinePointTileNode=!0,this.depth=e,this.x=t,this.y=r,this.z=n,this.id=ln(e,t,r,n),this.url=`${this.layer.source.url}/ept-data/${this.id}.${this.layer.source.extension}`}createChildAABB(e){const t=2**(e.depth-this.depth);this.bbox.getSize(sn).divideScalar(t),e.bbox.min.copy(this.bbox.min),on.copy(this).multiplyScalar(t),an.subVectors(e,on).multiply(sn),e.bbox.min.add(an),e.bbox.max.copy(e.bbox.min).add(sn)}get octreeIsLoaded(){return this.numPoints>=0}loadOctree(){return d.A.json(`${this.layer.source.url}/ept-hierarchy/${this.id}.json`,this.layer.source.networkOptions).then((e=>{this.numPoints=e[this.id];const t=[];for(t.push(this);t.length;){const r=t.shift(),n=r.depth+1,i=2*r.x,s=2*r.y,o=2*r.z;r.findAndCreateChild(n,i,s,o,e,t),r.findAndCreateChild(n,i+1,s,o,e,t),r.findAndCreateChild(n,i,s+1,o,e,t),r.findAndCreateChild(n,i+1,s+1,o,e,t),r.findAndCreateChild(n,i,s,o+1,e,t),r.findAndCreateChild(n,i+1,s,o+1,e,t),r.findAndCreateChild(n,i,s+1,o+1,e,t),r.findAndCreateChild(n,i+1,s+1,o+1,e,t)}}))}findAndCreateChild(e,t,r,n,i,s){const o=i[ln(e,t,r,n)];if("number"==typeof o){const i=new cn(e,t,r,n,this.layer,o);this.add(i),s.push(i)}}}const un=cn,hn=new n.Mesh,dn=new n.Box3;hn.geometry.boundingBox=dn;const pn=class extends gr{constructor(e,t){super(e,t),this.isEntwinePointTileLayer=!0,this.scale=new n.Vector3(1,1,1);const r=this.addInitializationStep();this.whenReady=this.source.whenReady.then((()=>(this.root=new un(0,0,0,0,this,-1),this.root.bbox.min.fromArray(this.source.boundsConforming,0),this.root.bbox.max.fromArray(this.source.boundsConforming,3),this.minElevationRange=this.source.boundsConforming[2],this.maxElevationRange=this.source.boundsConforming[5],this.extent=s.A.fromBox3(t.crs||"EPSG:4326",this.root.bbox),this.root.loadOctree().then(r))))}get spacing(){return this.source.spacing}};var fn=r(15234);const mn=new n.Vector3,gn=new n.Vector3,An=new n.Vector3;function yn(e,t,r,n){return`${e}-${t}-${r}-${n}`}class vn extends yr{constructor(e,t,r,n,i,s,o){super(arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,o),this.isCopcNode=!0,this.entryOffset=i,this.entryLength=s,this.layer=o,this.depth=e,this.x=t,this.y=r,this.z=n}get id(){return yn(this.depth,this.x,this.y,this.z)}get octreeIsLoaded(){return this.numPoints>=0}async _fetch(e,t){return this.layer.source.fetcher(this.layer.source.url,{...this.layer.source.networkOptions,headers:{...this.layer.source.networkOptions.headers,range:`bytes=${e}-${e+t-1}`}})}createChildAABB(e){const t=2**(e.depth-this.depth);this.bbox.getSize(mn).divideScalar(t),e.bbox.min.copy(this.bbox.min),gn.copy(this).multiplyScalar(t),An.subVectors(e,gn).multiply(mn),e.bbox.min.add(An),e.bbox.max.copy(e.bbox.min).add(mn)}findAndCreateChild(e,t,r,n,i,s){const o=yn(e,t,r,n);let a,l,c;const u=i.nodes[o];if(u)a=u.pointCount,l=u.pointDataOffset,c=u.pointDataLength;else{const e=i.pages[o];if(!e)return;a=-1,l=e.pageOffset,c=e.pageLength}const h=new vn(e,t,r,n,l,c,this.layer,a);this.add(h),s.push(h)}async loadOctree(){const e=await this._fetch(this.entryOffset,this.entryLength),t=await fn.Hierarchy.parse(new Uint8Array(e)),r=t.nodes[this.id];if(!r)return Promise.reject("[CopcNode]: Ill-formed data, entry not found in hierarchy.");this.numPoints=r.pointCount,this.entryOffset=r.pointDataOffset,this.entryLength=r.pointDataLength;const n=[];for(n.push(this);n.length;){const e=n.shift(),r=e.depth+1,i=2*e.x,s=2*e.y,o=2*e.z;e.findAndCreateChild(r,i,s,o,t,n),e.findAndCreateChild(r,i+1,s,o,t,n),e.findAndCreateChild(r,i,s+1,o,t,n),e.findAndCreateChild(r,i+1,s+1,o,t,n),e.findAndCreateChild(r,i,s,o+1,t,n),e.findAndCreateChild(r,i+1,s,o+1,t,n),e.findAndCreateChild(r,i,s+1,o+1,t,n),e.findAndCreateChild(r,i+1,s+1,o+1,t,n)}}async load(){this.octreeIsLoaded||await this.loadOctree();const e=await this._fetch(this.entryOffset,this.entryLength);return await this.layer.source.parser(e,{in:{...this.layer.source,pointCount:this.numPoints},out:this.layer})}}const xn=vn,_n=class extends gr{constructor(e,t){super(e,t),this.isCopcLayer=!0;const r=()=>this;this.whenReady=this.source.whenReady.then((e=>{const{cube:t,rootHierarchyPage:i}=e.info,{pageOffset:s,pageLength:o}=i;return this.root=new xn(0,0,0,0,s,o,this,-1),this.root.bbox.min.fromArray(t,0),this.root.bbox.max.fromArray(t,3),this.minElevationRange=e.header.min[2],this.maxElevationRange=e.header.max[2],this.scale=new n.Vector3(1,1,1),this.offset=new n.Vector3(0,0,0),this.root.loadOctree().then(r)}))}get spacing(){return this.source.info.spacing}};var bn=r(88326);class wn extends bn.A{constructor(e){if(e.parsedData&&(console.warn("FileSource parsedData parameter is deprecated, use features instead of."),e.features=e.features||e.parsedData),e.projection&&(console.warn("FileSource projection parameter is deprecated, use crs instead."),e.crs=e.crs||e.projection),!e.crs){if(!e.features||!e.features.crs)throw new Error("source.crs is required in FileSource");e.crs=e.features.crs}if(!e.url&&!e.fetchedData&&!e.features)throw new Error("url, fetchedData and features are not set in\n FileSource; at least one needs to be present");e.url=e.url||"none",super(e),this.isFileSource=!0,this.fetchedData=e.fetchedData,this.fetchedData||e.features?e.features&&(this._featuresCaches[e.features.crs]=new $t.A,this._featuresCaches[e.features.crs].setByArray(Promise.resolve(e.features),[0])):this.whenReady=this.fetcher(this.urlFromExtent(),this.networkOptions).then((e=>{this.fetchedData=e})),this.whenReady.then((()=>this.fetchedData)),this.zoom={min:0,max:1/0}}urlFromExtent(){return this.url}onLayerAdded(e){e.in=this,super.onLayerAdded(e);let t=this._featuresCaches[e.out.crs].getByArray([0]);t||(e.out.buildExtent="EPSG:4978"!=this.crs,e.out.buildExtent&&(e.out.forcedExtentCrs="EPSG:4978"!=e.out.crs?e.out.crs:this.crs),t=this.parser(this.fetchedData,e),this._featuresCaches[e.out.crs].setByArray(t,[0])),t.then((e=>{e.extent&&(this.extent=e.extent.clone(),this.extent.crs==e.crs&&this.extent.applyMatrix4(e.matrixWorld))}))}loadData(e,t){return this._featuresCaches[t.crs].getByArray([0])}extentInsideLimit(e){return this.extent.intersectsExtent(e)}}const En=wn;var Mn=r(97709),Sn=r(86706),Cn=r(48150);const Tn=new Sn.A("EPSG:4326",0,0,0);class In extends bn.A{constructor(e){if(e.format=e.format||"image/png",super(e),!e.crs)throw new Error("New TMSSource/WMTSSource: crs is required");if(this.isTMSSource=!0,e.extent||(this.extent=Cn.af.get(e.crs)),this.zoom=e.zoom,this.isInverted=e.isInverted||!1,this.crs=e.crs,this.tileMatrixSetLimits=e.tileMatrixSetLimits,this.extentSetlimits={},this.tileMatrixCallback=e.tileMatrixCallback||(e=>e),!this.zoom)if(this.tileMatrixSetLimits){const e=Object.keys(this.tileMatrixSetLimits),t=e.length,r=Number(e[t-1]);this.zoom={min:r-t+1,max:r}}else this.zoom={min:0,max:1/0}}urlFromExtent(e){return Mn.A.xyz(e,this)}onLayerAdded(e){super.onLayerAdded(e);const t=e.out.parent,r=t?t.extent.crs:e.out.crs;if(this.tileMatrixSetLimits&&!this.extentSetlimits[r]){this.extentSetlimits[r]={},Tn.crs=this.crs;for(let e=this.zoom.max;e>=this.zoom.min;e--){const t=this.tileMatrixSetLimits[e],{west:n,north:i}=Tn.set(e,t.minTileRow,t.minTileCol).toExtent(r),{east:o,south:a}=Tn.set(e,t.maxTileRow,t.maxTileCol).toExtent(r);this.extentSetlimits[r][e]=new s.A(r,n,o,a,i)}}}extentInsideLimit(e,t){return t>=this.zoom.min&&t<=this.zoom.max&&(null==this.extentSetlimits[e.crs]||this.extentSetlimits[e.crs][t].intersectsExtent(e))}}const Rn=In,Bn=new s.A("EPSG:4326",[0,0,0,0]);class Pn extends bn.A{constructor(e){if(e.projection&&(console.warn("WFSSource projection parameter is deprecated, use crs instead."),e.crs=e.crs||e.projection),!e.typeName)throw new Error("source.typeName is required in wfs source.");if(!e.crs)throw new Error("source.crs is required in wfs source");e.format=e.format||"application/json",super(e),this.isWFSSource=!0,this.typeName=e.typeName,this.version=e.version||"2.0.2",this.bboxDigits=e.bboxDigits,this.zoom={min:0,max:1/0};const t=new URL(e.url);t.searchParams.set("SERVICE","WFS"),t.searchParams.set("REQUEST","GetFeature"),t.searchParams.set("typeName",this.typeName),t.searchParams.set("VERSION",this.version),t.searchParams.set("SRSNAME",this.crs),t.searchParams.set("outputFormat",this.format),t.searchParams.set("BBOX",`%bbox,${this.crs}`),this.vendorSpecific=e.vendorSpecific;for(const e in this.vendorSpecific)Object.prototype.hasOwnProperty.call(this.vendorSpecific,e)&&t.searchParams.set(e,this.vendorSpecific[e]);this.url=decodeURIComponent(t.toString())}handlingError(e){return e.response&&400==e.response.status?e.response.text().then((t=>{const r=`${this.url}SERVICE=WFS&REQUEST=GetCapabilities&VERSION=${this.version}`,n=(new DOMParser).parseFromString(t,"application/xml").querySelector("Exception"),i=n.getAttribute("exceptionCode"),s=n.querySelector("ExceptionText").textContent;console.error(`Source ${this.typeName}: bad request when fetching data. Server says: "${i}: ${s}". \nReviewing ${r} may help.`,e)})):super.handlingError(e)}requestToKey(e){return e.isTile?super.requestToKey(e):[e.zoom,e.south,e.west]}urlFromExtent(e){const t=e.isExtent?e.as(this.crs,Bn):e.toExtent(this.crs,Bn);return Mn.A.bbox(t,this)}extentInsideLimit(e){return this.extent.intersectsExtent(e)}}const Ln=Pn,Dn=new s.A("EPSG:4326",[0,0,0,0]),On={en:"wsen",es:"wnes",wn:"eswn",ws:"enws",ne:"swne",se:"nwse",nw:"senw",sw:"nesw"};class Nn extends bn.A{constructor(e){if(!e.name)throw new Error("source.name is required.");if(!e.extent)throw new Error("source.extent is required");if(!e.crs&&!e.projection)throw new Error("source.crs is required");var t;e.format=e.format||"image/png",super(e),this.isWMSSource=!0,this.name=e.name,this.zoom={min:0,max:1/0},this.style=e.style||"",this.width=e.width||e.height||256,this.height=e.height||e.width||256,this.version=e.version||"1.3.0",this.transparent=e.transparent||!1,this.bboxDigits=e.bboxDigits,e.axisOrder?this.axisOrder=e.axisOrder:"1.3.0"===this.version?this.axisOrder=(t=l.axisOrder(this.crs))&&On[t.slice(0,2)]||"wsen":this.axisOrder="wsen";const r="1.3.0"===this.version?"CRS":"SRS",n=new URL(this.url);n.searchParams.set("SERVICE","WMS"),n.searchParams.set("REQUEST","GetMap"),n.searchParams.set("LAYERS",this.name),n.searchParams.set("VERSION",this.version),n.searchParams.set("STYLES",this.style),n.searchParams.set("FORMAT",this.format),n.searchParams.set("TRANSPARENT",this.transparent),n.searchParams.set("BBOX","%bbox"),n.searchParams.set(r,this.crs),n.searchParams.set("WIDTH",this.width),n.searchParams.set("HEIGHT",this.height),this.vendorSpecific=e.vendorSpecific;for(const e in this.vendorSpecific)Object.prototype.hasOwnProperty.call(this.vendorSpecific,e)&&n.searchParams.set(e,this.vendorSpecific[e]);this.url=decodeURIComponent(n.toString())}urlFromExtent(e){const t=e.isExtent?e.as(this.crs,Dn):e.toExtent(this.crs,Dn);return Mn.A.bbox(t,this)}extentInsideLimit(e){return this.extent.intersectsExtent(e)}}const Un=Nn,Fn=class extends Rn{constructor(e){if(!e.name)throw new Error("New WMTSSource: name is required");super(e),this.isWMTSSource=!0;const t=new URL(this.url);t.searchParams.set("LAYER",e.name),t.searchParams.set("FORMAT",this.format),t.searchParams.set("SERVICE","WMTS"),t.searchParams.set("VERSION",e.version||"1.0.0"),t.searchParams.set("REQUEST","GetTile"),t.searchParams.set("STYLE",e.style||"normal"),t.searchParams.set("TILEMATRIXSET",e.tileMatrixSet),t.searchParams.set("TILEMATRIX","%TILEMATRIX"),t.searchParams.set("TILEROW","%ROW"),t.searchParams.set("TILECOL","%COL"),this.vendorSpecific=e.vendorSpecific;for(const e in this.vendorSpecific)Object.prototype.hasOwnProperty.call(this.vendorSpecific,e)&&t.searchParams.set(e,this.vendorSpecific[e]);this.url=decodeURIComponent(t.toString())}};var kn=r(67373);const zn=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Gn(e){const t=e.params.length?`?${e.params.join("&")}`:"";return`${e.protocol}://${e.authority}${e.path}${t}`}function Qn(e,t){const r=Hn("https://api.mapbox.com");if(e.protocol=r.protocol,e.authority=r.authority,"http"===e.protocol){const t=e.params.indexOf("secure");t>=0&&e.params.splice(t,1)}if("/"!==r.path&&(e.path=`${r.path}${e.path}`),!(t=t||null))throw new Error("An API access token is required");if("s"===t[0])throw new Error("Use a public access token (pk.*), not a secret access token (sk.*).");return e.params=e.params.filter((e=>-1===e.indexOf("access_token"))),e.params.push(`access_token=${t}`),Gn(e)}function Vn(e){return 0===e.indexOf("mapbox:")}function Hn(e){const t=e.match(zn);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}const jn=function(e,t){if(!Vn(e))return e;const r=Hn(e);return r.path=`/styles/v1${r.path}`,Qn(r,t)},qn=function(e,t){if(!Vn(e))return e;const r=Hn(e);return r.path=`/v4/${r.authority}.json`,r.params.push("secure"),Qn(r,t)},Wn=function(e,t,r,n){const i=Hn(e);return Vn(e)?(i.path=`/styles/v1${i.path}/sprite${t}${r}`,Qn(i,n)):(i.path+=`${t}${r}`,Gn(i))};function Yn(e){return e.replace(/\{/g,"${")}const Xn=class extends Rn{constructor(e){e.format="application/x-protobuf;type=mapbox-vector",e.crs="EPSG:3857",e.isInverted=!0,e.url=e.url||".",super(e);const t=e.filter||(()=>!0);let r;if(this.urls=[],this.layers={},this.styles={},this.isVectorTileSource=!0,this.accessToken=e.accessToken,!e.style)throw new Error("New VectorTilesSource: style is required");if("string"==typeof e.style){const t=jn(e.style,this.accessToken);r=d.A.json(t,this.networkOptions)}else r=Promise.resolve(e.style);this.whenReady=r.then((t=>{this.jsonStyle=t;const r=e.sprite||t.sprite;if(r){const e=Wn(r,"",".json",this.accessToken);return d.A.json(e,this.networkOptions).then((e=>{this.sprites=e;const n=Wn(r,"",".png",this.accessToken);return this.sprites.source=n,t}))}return t})).then((e=>{if(e.layers.forEach(((e,r)=>{if(e.sourceUid=this.uid,"background"===e.type)this.backgroundLayer=e;else if(t(e)){const t=Je.Ay.setFromVectorTileLayer(e,this.sprites,r,this.symbolToCircle);this.styles[e.id]=t,this.layers[e["source-layer"]]||(this.layers[e["source-layer"]]=[]),this.layers[e["source-layer"]].push({id:e.id,order:r,filterExpression:(0,kn.fC)(e.filter),zoom:{min:e.minzoom||0,max:e.maxzoom||24}})}})),"."==this.url){const t=Object.values(e.sources).map((e=>{if(e.url){const t=qn(e.url,this.accessToken);return d.A.json(t,this.networkOptions).then((e=>{if(e.tiles[0])return Yn(e.tiles[0])}))}return e.tiles?Promise.resolve(Yn(e.tiles[0])):Promise.reject()}));return Promise.all(t)}return Promise.resolve([this.url])})).then((e=>{this.urls=Array.from(new Set(e))}))}urlFromExtent(e,t){return Mn.A.xyz(e,{tileMatrixCallback:this.tileMatrixCallback,url:t})}onLayerAdded(e){super.onLayerAdded(e),e.out.style&&e.out.isFeatureGeometryLayer&&e.out.accurate&&(console.warn("With VectorTilesSource and FeatureGeometryLayer, the accurate option is always false"),e.out.accurate=!1)}loadData(e,t){const r=this._featuresCaches[t.crs],n=this.requestToKey(e);let i=r.getByArray(n);return i||(i=r.setByArray(Promise.all(this.urls.map((r=>this.fetcher(this.urlFromExtent(e,r),this.networkOptions).then((r=>this.parser(r,{out:t,in:this,extent:e})))))).then((e=>function(e){const t=e[0];return e.forEach(((e,r)=>{0!==r&&e.features.forEach((e=>{t.features.push(e)}))})),t}(e))).catch((e=>this.handlingError(e))),n),this.onParsedFile&&i.then((e=>(this.onParsedFile(e),console.warn("Source.onParsedFile was deprecated"),e)))),i}};class Kn extends bn.A{constructor(e){super(e),this.isOrientedImageSource=!0;const t=[];t.push(e.orientationsUrl?d.A.json(e.orientationsUrl,this.networkOptions):Promise.resolve()),t.push(e.calibrationUrl?d.A.json(e.calibrationUrl,this.networkOptions):Promise.resolve()),this.whenReady=Promise.all(t).then((e=>({orientation:e[0],calibration:e[1]})))}urlFromExtent(e){return this.imageUrl(e.cameraId,e.panoId)}requestToKey(e){return[e.cameraId,e.panoId]}imageUrl(e,t){return this.url.replace("{cameraId}",e).replace("{panoId}",t)}}const $n=Kn,Jn={POSITION_CARTESIAN:{numElements:3,arrayType:Float32Array,attributeName:"position"},COLOR_PACKED:{numElements:4,arrayType:Uint8Array,attributeName:"color",normalized:!0},INTENSITY:{numElements:1,numByte:2,arrayType:Uint16Array,attributeName:"intensity",normalized:!0},CLASSIFICATION:{numElements:1,arrayType:Uint8Array,attributeName:"classification",normalized:!0},NORMAL_SPHEREMAPPED:{numElements:2,arrayType:Uint8Array,attributeName:"sphereMappedNormal"},NORMAL_OCT16:{numElements:2,arrayType:Uint8Array,attributeName:"oct16Normal"},NORMAL:{numElements:3,arrayType:Float32Array,attributeName:"normal"}};for(const e of Object.keys(Jn)){const t=Jn[e];t.potreeName=e,t.numByte=t.numByte||t.arrayType.BYTES_PER_ELEMENT,t.byteSize=t.numElements*t.numByte,t.normalized=t.normalized||!1;const r="getUint"+8*t.numByte;t.getValue=1===t.numByte?function(e,t){return e[r](t)}:function(e,t){return e[r](t,!0)}}const Zn={parse:function(e,t){if(!e)throw new Error("No array buffer provided.");const r=new DataView(e);let i=0;for(const e of t.in.pointAttributes)i+=Jn[e].byteSize;const s=Math.floor(e.byteLength/i),o=new n.BufferGeometry;let a=0,l=0;for(const e of t.in.pointAttributes){const t=Jn[e],c=t.numElements*s,u=new t.arrayType(c);for(let e=0;e(this.pointAttributes=e.pointAttributes,this.baseurl=`${this.url}/${e.octreeDir}/r`,this.extension="CIN"===e.pointAttributes?"cin":"bin",this.parse="cin"===this.extension?ei.parse:Zn.parse,e)))}}const ri=ti;var ni=r(40447);ni.registerSerializer;const ii=ni.spawn,si=(ni.BlobWorker,ni.DefaultSerializer,ni.Pool,ni.Thread),oi=ni.Transfer;let ai;ni.Worker;const li={terminate(){const e=ai;return ai=void 0,si.terminate(e)},parse:async function(e,t){const i=t.in.source.metadata,s=t.out.pointAttributes,o=i.scale,a=t.in.bbox,l=a.min,c=a.max.clone().sub(a.min),u=a.max,h=i.offset,d=t.in.numPoints,p=function(e,t){return"BROTLI"===t.encoding?e.parseBrotli:e.parse}(await async function(){return ai||(ai=await ii(new Worker(new URL(r.p+r.u(343),r.b),{type:void 0})),ai)}(),i),f=await p(oi(e),{pointAttributes:s,scale:o,min:l,max:u,size:c,offset:h,numPoints:d}),m=f.attributeBuffers,g=new n.BufferGeometry;return Object.keys(m).forEach((e=>{const t=m[e].buffer;if("position"===e)g.setAttribute("position",new n.BufferAttribute(new Float32Array(t),3));else if("rgba"===e)g.setAttribute("color",new n.BufferAttribute(new Uint8Array(t),4,!0));else if("NORMAL"===e)g.setAttribute("normal",new n.BufferAttribute(new Float32Array(t),3));else if("INDICES"===e){const e=new n.BufferAttribute(new Uint8Array(t),4);e.normalized=!0,g.setAttribute("indices",e)}else{const r=new n.BufferAttribute(new Float32Array(t),1),i=m[e].attribute;r.potree={offset:m[e].offset,scale:m[e].scale,preciseBuffer:m[e].preciseBuffer,range:i.range},g.setAttribute(e,r)}})),g.computeBoundingBox(),{geometry:g,density:f.density}}};class ci extends bn.A{constructor(e){if(!e.file)throw new Error("New Potree2Source: file is required");super(e),this.file=e.file,this.fetcher=d.A.arrayBuffer,this.whenReady=(e.metadata?Promise.resolve(e.metadata):d.A.json(`${this.url}/${this.file}`,this.networkOptions)).then((e=>(this.metadata=e,this.pointAttributes=e.attributes,this.baseurl=`${this.url}`,this.extension="bin",this.parser=li.parse,e)))}}const ui=ci;class hi extends bn.A{constructor(e){super(e),this.isC3DTilesSource=!0,this.baseUrl=this.url.slice(0,this.url.lastIndexOf("/")+1),this.whenReady=d.A.json(this.url,this.networkOptions)}}const di=hi,pi=class extends di{constructor(e){if(!e.accessToken)throw new Error("New 3D Tiles Ion Source: access token is required");if(!e.assetId)throw new Error("New 3D Tiles Ion Source: asset id is required");e.url=`https://api.cesium.com/v1/assets/${e.assetId}/endpoint?access_token=${e.accessToken}`,super(e),this.isC3DTilesIonSource=!0,this.accessToken=e.accessToken,this.assetId=e.assetId,this.whenReady=d.A.json(e.url,this.networkOptions).then((e=>{if("3DTILES"!==e.type)throw new Error(`${e.type} datasets from Cesium ion are not supported with C3DTilesIonSource. Only 3D Tiles datasets are supported.`);return this.url=e.url,this.baseUrl=e.url.slice(0,e.url.lastIndexOf("/")+1),this.networkOptions.headers={},this.networkOptions.headers.Authorization=`Bearer ${e.accessToken}`,this.attribution=e.attributions,d.A.json(this.url,this.networkOptions)}))}};function fi(e){if(!e)return null;if(e.content&&e.content.uri)return new URLSearchParams(e.content.uri.slice(e.content.uri.indexOf("?")+1)).get("session");if(e.children&&e.children.length>0)for(const t of e.children){const e=fi(t);if(e)return e}return null}const mi=class extends di{constructor(e){if(!e.key)throw new Error("[C3DTilesGoogleSource]: A API key for the google map tiles API is required");e.url=`https://tile.googleapis.com/v1/3dtiles/root.json?key=${e.key}`,super(e),this.isC3DTilesGoogleSource=!0,this.baseUrl="https://tile.googleapis.com",this.key=e.key,this.whenReady=d.A.json(e.url,this.networkOptions).then((e=>{if(e&&e.root&&(this.sessionId=fi(e.root),null===this.sessionId))throw new Error("[C3DTilesGoogleSource]: Cannot find sessionId from the tileset while it is mandatory to request tiles.");return e}))}getTileUrl(e){const t=`key=${this.key}&session=${this.sessionId}`;return/\?/.test(e)?`${e}&${t}`:`${e}?${t}`}};class gi extends bn.A{constructor(e){super(e),this.isOGC3DTilesSource=!0}}const Ai=gi,yi=class extends Ai{constructor(e){if(!e.accessToken)throw new Error("[OGC3DTilesIonSource]: accessToken is required");if(!e.assetId)throw new Error("[OGC3DTilesIonSource]: assetId is required");e.url=`https://api.cesium.com/v1/assets/${e.assetId}/endpoint?access_token=${e.accessToken}`,super(e),this.isOGC3DTilesIonSource=!0,this.accessToken=e.accessToken,this.assetId=e.assetId}},vi=class extends Ai{constructor(e){if(!e.key)throw new Error("[OGC3DTilesGoogleSource]: A API key for the google map tiles API is required");e.url=`https://tile.googleapis.com/v1/3dtiles/root.json?key=${e.key}`,super(e),this.isOGC3DTilesGoogleSource=!0,this.key=e.key}};let xi,_i;async function bi(){return _i||(_i=await ii(new Worker(new URL(r.p+r.u(899),r.b),{type:void 0})),xi&&_i.lazPerf(xi),_i)}function wi(e){const t=new n.BufferGeometry,r=new n.BufferAttribute(e.position,3);t.setAttribute("position",r);const i=new n.BufferAttribute(e.intensity,1);t.setAttribute("intensity",i);const s=new n.BufferAttribute(e.returnNumber,1);t.setAttribute("returnNumber",s);const o=new n.BufferAttribute(e.numberOfReturns,1);t.setAttribute("numberOfReturns",o);const a=new n.BufferAttribute(e.classification,1);t.setAttribute("classification",a);const l=new n.BufferAttribute(e.pointSourceID,1);if(t.setAttribute("pointSourceID",l),e.color){const r=new n.BufferAttribute(e.color,4,!0);t.setAttribute("color",r)}const c=new n.BufferAttribute(e.scanAngle,1);return t.setAttribute("scanAngle",c),t.userData.origin=(new n.Vector3).fromArray(e.origin),t}const Ei={enableLazPerf(e){if(!e)throw new Error("Path to laz-perf is mandatory");xi=e},terminate(){const e=_i;return _i=void 0,si.terminate(e)},async parseChunk(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=await bi(),n=wi((await r.parseChunk(oi(e),{pointCount:t.in.pointCount,header:t.in.header,eb:t.eb,colorDepth:t.in.colorDepth})).attributes);return n.computeBoundingBox(),n},async parse(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.out?.skip&&console.warn("Warning: options 'skip' not supported anymore");const r=t.in,n=await bi(),i=await n.parseFile(oi(e),{colorDepth:r?.colorDepth}),s=wi(i.attributes);return s.userData.header=i.header,s.computeBoundingBox(),s}};class Mi extends bn.A{constructor(e){super(e),this.isEntwinePointTileSource=!0,this.colorDepth=e.colorDepth,this.url=this.url.replace("/ept.json",""),this.whenReady=d.A.json(`${this.url}/ept.json`,this.networkOptions).then((e=>{if(this.parse="laszip"===e.dataType?Ei.parse:Zn.parse,this.extension="laszip"===e.dataType?"laz":"bin",e.srs){if(e.srs.authority&&e.srs.horizontal)this.crs=`${e.srs.authority}:${e.srs.horizontal}`,i.A.defs(this.crs)||i.A.defs(this.crs,e.srs.wkt);else if(e.srs.wkt){i.A.defs("unknown",e.srs.wkt);const t=i.A.defs("unknown");this.crs=t.title||t.name,this.crs in i.A.defs||i.A.defs(this.crs,t)}e.srs.vertical&&e.srs.vertical!==e.srs.horizontal&&console.warn("EntwinePointTileSource: Vertical coordinates system code is not yet supported.")}return this.spacing=(Math.abs(e.boundsConforming[3]-e.boundsConforming[0])+Math.abs(e.boundsConforming[4]-e.boundsConforming[1]))/(2*e.span),this.boundsConforming=e.boundsConforming,this.bounds=e.bounds,this.span=e.span,this})),this.fetcher=d.A.arrayBuffer}}const Si=Mi;class Ci extends bn.A{constructor(e){super(e),this.isCopcSource=!0,this.parser=Ei.parseChunk,this.fetcher=d.A.arrayBuffer,this.colorDepth=e.colorDepth??16,this.whenReady=async function(e){const t=fn.Las.Header.parse(await e(0,fn.Las.Constants.minHeaderLength)),r=await fn.Las.Vlr.walk(e,t),n=fn.Las.Vlr.find(r,"copc",1);if(!n)return Promise.reject("COPC info VLR is required");const i=fn.Info.parse(await fn.Las.Vlr.fetch(e,n)),s=fn.Las.Vlr.find(r,"LASF_Projection",2112);if(!s)return Promise.reject("LAS1.4 WKT VLR is required");const o=fn.Binary.toCString(await fn.Las.Vlr.fetch(e,s)),a=fn.Las.Vlr.find(r,"LASF_Spec",4);return{header:t,info:i,wkt:o,eb:a?fn.Las.ExtraBytes.parse(await fn.Las.Vlr.fetch(e,a)):[]}}(((e,t)=>this.fetcher(this.url,{...this.networkOptions,headers:{...this.networkOptions.headers,range:`bytes=${e}-${t-1}`}}).then((e=>new Uint8Array(e))))).then((e=>{let t;this.header=e.header,this.info=e.info,this.eb=e.eb,i.A.defs("unknown",e.wkt),"COMPD_CS"===i.A.defs("unknown").type?(console.warn("CopcSource: compound coordinate system is not yet supported."),t=i.A.defs("unknown").PROJCS):t=i.A.defs("unknown"),this.crs=t.title||t.name||"EPSG:4326",this.crs in i.A.defs||i.A.defs(this.crs,t);const r=new n.Box3;return r.min.fromArray(this.info.cube,0),r.max.fromArray(this.info.cube,3),this.extent=s.A.fromBox3(this.crs,r),this}))}}const Ti=Ci;var Ii,Ri=r(62873),Bi=r(68632),Pi="deflate-raw",Li=self.DecompressionStream;try{new Li(Pi),Ii=async e=>{let t=new Li(Pi),r=t.writable.getWriter(),n=t.readable.getReader();r.write(e),r.close();let i,s,o=[],a=0,l=0;for(;!(s=await n.read()).done;)i=s.value,o.push(i),a+=i.length;return o.length-1?(i=new Uint8Array(a),o.map((e=>{i.set(e,l),l+=e.length})),i):o[0]}}catch{}var Di=new TextDecoder,Oi=e=>{throw new Error("but-unzip~"+e)},Ni=e=>Di.decode(e);const Ui=/.+\.(shp|dbf|json|prj|cpg)$/i,Fi=globalThis.URL;async function ki(e,t){const r=((e,t)=>{if(!t)return e;const r=new Fi(e);return r.pathname=`${r.pathname}.${t}`,r.href})(e,t),n="prj"===t||"cpg"===t;try{const e=await fetch(r);if(e.status>399)throw new Error(e.statusText);if(n)return e.text();const t=await e.arrayBuffer();return new DataView(t)}catch(e){if(n||"dbf"===t)return!1;throw e}}function zi(e){let t=0,r=1;const n=e.length;let i,s;const o=[e[0][0],e[0][1],e[0][0],e[0][1]];for(;ro[2]&&(o[2]=s[0]),s[1]>o[3]&&(o[3]=s[1]);return{ring:e,clockWise:t>0,bbox:o,children:[]}}function Gi(e,t){return!(e.bbox[0]>t.bbox[0]||e.bbox[1]>t.bbox[1]||e.bbox[2]20&&(t-=20),!(t in Qi))throw new Error(`I don't know shp type "${t}"`);var r;this.parseFunc=this[Qi[t]],this.parseCoord=(r=e)?function(e,t){const n=[e.getFloat64(t,!0),e.getFloat64(t+8,!0)];return r.inverse(n)}:function(e,t){return[e.getFloat64(t,!0),e.getFloat64(t+8,!0)]}},Vi.prototype.getShpCode=function(){return this.parseHeader().shpCode},Vi.prototype.parseHeader=function(){const e=this.buffer;return{length:e.getInt32(24)<<1,version:e.getInt32(28,!0),shpCode:e.getInt32(32,!0),bbox:[e.getFloat64(36,!0),e.getFloat64(44,!0),e.getFloat64(52,!0),e.getFloat64(60,!0)]}},Vi.prototype.getRows=function(){let e=100;const t=this.buffer.byteLength-8,r=[];let n;for(;e<=t&&(n=this.getRow(e),n);)e+=8,e+=n.len,n.type?r.push(this.parseFunc(n.data)):r.push(null);return r},Vi.prototype.getRow=function(e){const t=this.buffer.getInt32(e),r=this.buffer.getInt32(e+4)<<1;return 0===r?{id:t,len:r,type:0}:e+r+8>this.buffer.byteLength?void 0:{id:t,len:r,data:new DataView(this.buffer.buffer,this.buffer.byteOffset+e+12,r-4),type:this.buffer.getInt32(e+8,!0)}};var ji=/^(?:ANSI\s)?(\d+)$/m;function qi(e,t){if(!e)return n;try{new TextDecoder(e.trim())}catch(i){var r=ji.exec(e);return r&&!t?qi("windows-"+r[1],!0):(e=void 0,n)}return n;function n(t){var r=new TextDecoder(e||void 0);return(r.decode(t,{stream:!0})+r.decode()).replace(/\0/g,"").trim()}}function Wi(e,t,r,n,i){var s=i(new Uint8Array(e.buffer.slice(e.byteOffset+t,e.byteOffset+t+r)));switch(n){case"N":case"F":case"O":return parseFloat(s,10);case"D":return new Date(s.slice(0,4),parseInt(s.slice(4,6),10)-1,s.slice(6,8));case"L":return"y"===s.toLowerCase()||"t"===s.toLowerCase();default:return s}}function Yi(e,t,r,n){for(var i,s,o={},a=0,l=r.length;a{if(e)return"string"==typeof e?e:es(e)||ArrayBuffer.isView(e)||ts(e)?$i.decode(e):void 0},Zi=e=>{if(!e)throw new Error("forgot to pass buffer");if(ts(e))return e;if(es(e))return new DataView(e);if(es(e.buffer))return new DataView(e.buffer,e.byteOffset,e.byteLength);throw new Error("invalid buffer like object")};function es(e){return e instanceof globalThis.ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(e)}function ts(e){return e instanceof globalThis.DataView||"[object DataView]"===Object.prototype.toString.call(e)}const rs=function([e,t]){const r={type:"FeatureCollection",features:[]};let n=0;const i=e.length;for(t||(t=[]);n{if(!e)throw new Error("forgot to pass buffer");if(es(e))return new Uint8Array(e);if(es(e.buffer))return 1===e.BYTES_PER_ELEMENT?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("invalid buffer like object")})(e);const n=await(async e=>{const t={},r=[];for(const n of function*(e,t=Ii){let r=(e=>{let t=e.length-20,r=Math.max(t-65516,2);for(;-1!==(t=e.lastIndexOf(80,t-1))&&(75!==e[t+1]||5!==e[t+2]||6!==e[t+3])&&t>r;);return t})(e);-1===r&&Oi(2);let n=(t,n)=>e.subarray(r+=t,r+=n),i=new DataView(e.buffer,e.byteOffset),s=e=>i.getUint16(e+r,!0),o=e=>i.getUint32(e+r,!0),a=s(10);for(a!==s(8)&&Oi(3),r=o(16);a--;){let e,i=s(10),a=s(28),l=s(30),c=s(32),u=o(20),h=o(42),d=Ni(n(46,a)),p=Ni(n(l,c)),f=r;r=h,e=n(30+s(26)+s(28),u),yield{filename:d,comment:p,read:()=>8&i?t(e):i?Oi(1):e},r=f}}(e))Ui.test(n.filename)&&r.push(Promise.resolve(n.read()).then((e=>t[n.filename]=e)));await Promise.all(r);const n={},i=new TextDecoder;for(const[e,r]of Object.entries(t))"shp"===e.slice(-3).toLowerCase()||"dbf"===e.slice(-3).toLowerCase()?n[e]=new DataView(r.buffer,r.byteOffset,r.byteLength):n[e]=i.decode(r);return n})(e),s=[];for(r in t=t||[],n)-1===r.indexOf("__MACOSX")&&(".shp"===r.slice(-4).toLowerCase()?(s.push(r.slice(0,-4)),n[r.slice(0,-3)+r.slice(-3).toLowerCase()]=n[r]):".prj"===r.slice(-4).toLowerCase()?n[r.slice(0,-3)+r.slice(-3).toLowerCase()]=(0,i.A)(n[r]):".json"===r.slice(-5).toLowerCase()||t.indexOf(r.split(".").pop())>-1?s.push(r.slice(0,-3)+r.slice(-3).toLowerCase()):".dbf"!==r.slice(-4).toLowerCase()&&".cpg"!==r.slice(-4).toLowerCase()||(n[r.slice(0,-3)+r.slice(-3).toLowerCase()]=n[r]));if(!s.length)throw new Error("no layers founds");const o=s.map((function(e){let r,i;const s=e.lastIndexOf(".");return s>-1&&e.slice(s).indexOf("json")>-1?(r=JSON.parse(n[e]),r.fileName=e.slice(0,s)):t.indexOf(e.slice(s+1))>-1?(r=n[e],r.fileName=e):(n[e+".dbf"]&&(i=Xi(n[e+".dbf"],n[e+".cpg"])),r=rs([Hi(n[e+".shp"],n[e+".prj"]),i]),r.fileName=e),r}));return 1===o.length?o[0]:o},is=async e=>{const t=await Promise.all([ki(e,"shp"),ki(e,"prj")]);let r=!1;try{t[1]&&(r=(0,i.A)(t[1]))}catch(e){r=!1}return Hi(t[0],r)},ss=async e=>{const[t,r]=await Promise.all([ki(e,"dbf"),ki(e,"cpg")]);if(t)return Xi(t,r)},os=(e,t)=>new Ki(e,globalThis?.document?.location).pathname.slice(-4).toLowerCase()===t,as=function(e,t){if(e=Zi(e),"string"==typeof(t=Ji(t)))try{t=(0,i.A)(t)}catch(e){t=!1}return Hi(e,t)},ls=async function(e,t){if("string"!=typeof e){if(es(e)||ArrayBuffer.isView(e)||ts(e))return ns(e);if(e.shp)return(({shp:e,dbf:t,cpg:r,prj:n})=>{const i=[as(e,n)];return t&&i.push(function(e,t){return Xi(e=Zi(e),t=Ji(t))}(t,r)),rs(i)})(e);throw new TypeError("must be a string, some sort of Buffer, or an object with at least a .shp property")}if(os(e,".zip"))return async function(e,t){const r=await ki(e);return ns(r,t)}(e,t);os(e,".shp")&&(e=e.slice(0,-4));const r=await Promise.all([is(e),ss(e)]);return rs(r)},cs={parse(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r=(0,Ge.zv)(r),e.zip?t=ls(e.zip):e.shp&&e.shx&&e.dbf&&(t=ls(e)),r.in=r.in||{},r.in.crs=e.prj?(0,i.A)(e.prj).oProj.datumName:r.in.crs,Promise.resolve(t).then((e=>jr.A.parse(e,r)))}};var us=r(18625),hs=r(8123),ds=r(51429),ps=r(55540),fs=r(57669),ms=r(55536),gs=r(80264),As=r(34422),ys=r(34993),vs=r(706),xs=r(25847);const _s=class{constructor(e){this.classes=e.classes,this.inverseHierarchy={},this.instancesIdxs=[];const t={};let r=0,n=e.parentCounts;void 0===n&&(n=new Array(e.instancesLength),n.fill(1));for(let i=0;i{"use strict";r.d(t,{A:()=>f});var n=r(39437),i=r(34993),s=r(2015),o=r(20620),a=r(21311),l=r(70515),c=r(49423);const u=(new n.Matrix4).makeRotationX(Math.PI/2),h=(new n.Matrix4).makeRotationZ(-Math.PI/2),d=new TextDecoder;function p(e){const t=["MODELVIEW","MODELVIEWINVERSETRANSPOSE","PROJECTION","JOINTMATRIX"];if(e.gltfShader){const r=[];for(const t in e.gltfShader.boundUniforms)r.push(t);for(const n of r){const r=e.gltfShader.boundUniforms[n].semantic;t.includes(r)||delete e.gltfShader.boundUniforms[n]}}}const f={parse(e,t){const r=!0===t.frustumCulled;if(!e)throw new Error("No array buffer provided.");const f=new DataView(e,4);let m=0;const g={};if(g.magic=d.decode(new Uint8Array(e,0,4)),g.magic){g.version=f.getUint32(m,!0),m+=Uint32Array.BYTES_PER_ELEMENT,g.byteLength=f.getUint32(m,!0),m+=Uint32Array.BYTES_PER_ELEMENT,g.FTJSONLength=f.getUint32(m,!0),m+=Uint32Array.BYTES_PER_ELEMENT,g.FTBinaryLength=f.getUint32(m,!0),m+=Uint32Array.BYTES_PER_ELEMENT,g.BTJSONLength=f.getUint32(m,!0),m+=Uint32Array.BYTES_PER_ELEMENT,g.BTBinaryLength=f.getUint32(m,!0),m+=Uint32Array.BYTES_PER_ELEMENT;const A=m+4,y=[];let v={};const x=new n.Vector3;if(g.FTJSONLength>0){const t=A,r=e.slice(t,g.FTJSONLength+t),n=d.decode(new Uint8Array(r));v=JSON.parse(n),v.RTC_CENTER?x.fromArray(v.RTC_CENTER):x.set(0,0,0)}if(g.FTBinaryLength>0&&console.warn("3D Tiles feature table binary not supported yet."),g.BTJSONLength>0){const r=A+g.FTJSONLength+g.FTBinaryLength,n=e.slice(r,r+g.BTJSONLength+g.BTBinaryLength);y.push(Promise.resolve(new i.A(n,g.BTJSONLength,g.BTBinaryLength,v.BATCH_LENGTH,t.registeredExtensions)))}else y.push(Promise.resolve(new i.A));const _=A+g.FTJSONLength+g.FTBinaryLength+g.BTJSONLength+g.BTBinaryLength,b=e.slice(_),w=function(e){if(e.frustumCulled=r,e.material){if(t.overrideMaterials){const r=e.material;"object"==typeof t.overrideMaterials&&t.overrideMaterials.isMaterial?e.material=t.overrideMaterials:e.material=new n.MeshBasicMaterial,(0,o.A)(r)}else s.A.isLogDepthBufferSupported()&&e.material.isRawShaderMaterial&&!t.doNotPatchMaterial&&(a.A.patchMaterialForLogDepthSupport(e.material),console.warn("glTF shader has been patched to add log depth buffer support"));(0,l.A)(e.material,t.layer)}};return y.push(c.TK.parseAsync(b,t).then((e=>{for(const t of e.scenes)t.traverse(p);var r,n;r=e.scene,(n=t.gltfUpAxis)&&"Y"!==n?"X"===n&&r.applyMatrix4(h):r.applyMatrix4(u);const i=s.A.isLogDepthBufferSupported()&&!t.doNotPatchMaterial;return(!1===t.frustumCulling||t.overrideMaterials||i||t.layer)&&e.scene.traverse(w),e.scene.position.copy(x),e})).catch((e=>{throw new Error(e)}))),Promise.all(y).then((e=>({gltf:e[1],batchTable:e[0]}))).catch((e=>{throw new Error(e)}))}throw new Error("Invalid b3dm file.")}}},8123:(e,t,r)=>{"use strict";r.d(t,{A:()=>l,i:()=>a});var n=r(39437),i=r(77855),s=r(86215),o=r(51429);function a(e,t){const r=e[e.indexOf(e.find((e=>e.includes(t))))].split(" ").filter((e=>""!==e));return parseFloat(r[r.length-1])}const l={parse(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{in:{}};const r=e.split("\n"),l=r.indexOf(r.find((e=>e.includes("end_of_head"))))+1,c=r.slice(0,l),u={minX:a(c,"longlimit_west"),maxX:a(c,"longlimit_east"),minY:a(c,"latlimit_south"),maxY:a(c,"latlimit_north"),stepX:a(c,"gridstep"),stepY:a(c,"gridstep"),nRows:a(c,"latitude_parallels"),nColumns:a(c,"longitude_parallels")},h=new DataView(new ArrayBuffer(o.mo*u.nRows*u.nColumns));let d=0;for(let e of r.slice(l,r.length))e=e.split(" ").filter((e=>""!==e)),e.length&&(h.setFloat64(d*o.mo,parseFloat(e[2])),d++);const p=new s.A(t.in.crs||"EPSG:4326",u.minX,u.maxX,u.minY,u.maxY),f=new n.Vector2(u.stepX,u.stepY);return Promise.resolve(new i.A(p,f,((e,t)=>h.getFloat64((u.nColumns*(u.nRows-e-1)+t)*o.mo))))}}},51429:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>a,mo:()=>o});var n=r(39437),i=r(77855),s=r(86215);const o=8,a={parse(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{in:{}};const r=t.in.dataType||"float";if(!["float","double"].includes(r))throw new Error("`dataType` parameter is incorrect for GTXParser.parse method. This parameter must be either `double` or `float`.");const a=new DataView(e,0,40),l={minX:a.getFloat64(8),minY:a.getFloat64(0),stepX:a.getFloat64(24),stepY:a.getFloat64(16),nColumns:a.getInt32(36),nRows:a.getInt32(32)},c=new DataView(e,40),u=l.minX+l.stepX*(l.nColumns-1),h=l.minY+l.stepY*(l.nRows-1),d=new s.A(t.in.crs||"EPSG:4326",l.minX,u,l.minY,h),p=new n.Vector2(l.stepX,l.stepY);return Promise.resolve(new i.A(d,p,((e,t)=>"float"===r?c.getFloat32(4*(l.nColumns*e+t)):"double"===r?c.getFloat64((l.nColumns*e+t)*o):void 0)))}}},89191:(e,t,r)=>{"use strict";r.d(t,{A:()=>m});var n=r(52404),i=r(36845),s=r(47155);const o=new n.A("EPSG:4978",0,0,0),a=new n.A("EPSG:4978",0,0,0),l=new n.A("EPSG:4978",0,0,0),c=(e,t,r)=>(o.crs=r,o.setFromArray(t[0]),!e.isPointInside(o)),u={populateGeometry(e,t,r,n){r.startSubGeometry(t.length,n),o.crs=e;for(const e of t)o.setFromValues(e[0],e[1],e[2]),r.pushCoordinates(n,o);r.updateExtent()},populateGeometryWithCCW(e,t,r,n){r.startSubGeometry(t.length,n),o.crs=e;let i=0;l.setFromValues(t[0][0],t[0][1],t[0][2]),a.copy(l);for(let e=0;evoid 0===e||Array.isArray(e)&&!isNaN(e[0])?e:d(e[0]);function p(e,t,r){if(!t.geometry?.type)return console.warn("No geometry provided"),null;const n=t.geometry.type.toLowerCase(),s=function(e){switch(e){case"point":case"multipoint":return i.Xs.POINT;case"linestring":case"multilinestring":return i.Xs.LINE;case"polygon":case"multipolygon":return i.Xs.POLYGON;default:throw new Error(`Unhandled geometry type ${e}`)}}(n),o=r.requestFeatureByType(s),a="point"!=n?t.geometry.coordinates:[t.geometry.coordinates],l=t.properties||{};o.hasRawElevationData=3===d(a)?.length;for(const e of Object.keys(t))h.includes(e.toLowerCase())||(l.geojson=l.geojson||{},l.geojson[e]=t[e]);return function(e,t,r,n,i,s){if(0!=n.length)switch(e){case"point":case"linestring":return u.default(t,r,n,i,s);case"multipoint":return u.multi("point",t,r,n,i,s);case"multilinestring":return u.multi("default",t,r,n,i,s);case"polygon":return u.polygon(t,r,n,i,s);case"multipolygon":return u.multi("polygon",t,r,n,i,s);default:throw new Error(`Unhandled geojson type ${t.type}`)}}(n,o,e,a,r,l),o}function f(e,t,r){const n=new i.ZC(r),s=r.filter||(()=>!0);for(const r of t)s(r.properties,r.geometry)&&p(e,r,n);return n.removeEmptyFeature(),n.updateExtent(),n}const m={parse(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=(0,s.zv)(t),t.in=t.in||{};const r=t.out,n=t.in;switch("string"==typeof e&&(e=JSON.parse(e)),n.crs=n.crs||function(e){if(e.crs){if("epsg"==e.crs.type.toLowerCase())return`EPSG:${e.crs.properties.code}`;if("name"==e.crs.type.toLowerCase()){if(e.crs.properties.name.toLowerCase().includes("epsg:")){const t=e.crs.properties.name.lastIndexOf(":");if(t>0)return`EPSG:${e.crs.properties.name.substr(t+1)}`}throw new Error(`Unsupported CRS authority '${e.crs.properties.name}'`)}throw new Error(`Unsupported CRS type '${e.crs}'`)}return"EPSG:4326"}(e),r.filteringExtent&&("boolean"==typeof r.filteringExtent?r.filterExtent=t.extent.isExtent?t.extent.as(n.crs):t.extent.toExtent(n.crs):r.filteringExtent.isExtent&&(r.filterExtent=r.filteringExtent)),e.type.toLowerCase()){case"featurecollection":return Promise.resolve(f(n.crs,e.features,r));case"feature":return Promise.resolve(f(n.crs,[e],r));default:throw new Error(`Unsupported GeoJSON type: '${e.type}`)}}}},62873:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(20992),i=r(89191),s=r(47155);const o={parse:(e,t)=>(t=(0,s.zv)(t),i.A.parse((0,n.GN)(e),t))}},18625:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var n=r(39437),i=r(77855),s=r(86215),o=r(8123),a=r(51429);const l={parse(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{in:{}};const r=e.split("\n"),l=r.indexOf(r.find((e=>e.includes("end_of_head"))))+1,c=r.slice(0,l),u={minX:(0,o.i)(c,"lon min"),maxX:(0,o.i)(c,"lon max"),minY:(0,o.i)(c,"lat min"),maxY:(0,o.i)(c,"lat max"),stepX:(0,o.i)(c,"delta lon"),stepY:(0,o.i)(c,"delta lat"),nRows:(0,o.i)(c,"nrows"),nColumns:(0,o.i)(c,"ncols")},h=new DataView(new ArrayBuffer(a.mo*u.nRows*u.nColumns));let d=0;for(let e of r.slice(l,r.length))if(e=e.split(" ").filter((e=>""!==e)),e.length)for(const t of e)h.setFloat64(d*a.mo,parseFloat(t)),d++;const p=new s.A(t.in.crs||"EPSG:4326",u.minX+u.stepX/2,u.maxX-u.stepX/2,u.minY+u.stepY/2,u.maxY-u.stepY/2),f=new n.Vector2(u.stepX,u.stepY);return Promise.resolve(new i.A(p,f,((e,t)=>h.getFloat64((u.nColumns*e+t)*a.mo))))}}},68632:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(20992),i=r(89191),s=r(47155);const o={parse:(e,t)=>(t=(0,s.zv)(t),i.A.parse((0,n.bW)(e),t))}},57669:(e,t,r)=>{"use strict";r.d(t,{A:()=>ee});var n=r(39437);const i={};i.LegacyGLTFLoader=function(){class e extends n.Loader{constructor(e){super(e)}load(e,t,r,i){var s,o=this;s=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:n.LoaderUtils.extractUrlBase(e);var a=new n.FileLoader(o.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.load(e,(function(e){o.parse(e,s,t)}),r,i)}parse(e,t,r){var a,u={};n.LoaderUtils.decodeText(new Uint8Array(e,0,4))===o.magic?(u[i.KHR_BINARY_GLTF]=new l(e),a=u[i.KHR_BINARY_GLTF].content):a=n.LoaderUtils.decodeText(new Uint8Array(e));var h=JSON.parse(a);h.extensionsUsed&&h.extensionsUsed.indexOf(i.KHR_MATERIALS_COMMON)>=0&&(u[i.KHR_MATERIALS_COMMON]=new s(h)),h.extensionsUsed&&h.extensionsUsed.indexOf(i.CESIUM_RTC)>=0&&(u[i.CESIUM_RTC]=new c(h)),new T(h,u,{crossOrigin:this.crossOrigin,manager:this.manager,path:t||this.resourcePath||""}).parse((function(e,t,n,i){r({scene:e,scenes:t,cameras:n,animations:i})}))}}function t(){var e={};return{get:function(t){return e[t]},add:function(t,r){e[t]=r},remove:function(t){delete e[t]},removeAll:function(){e={}},update:function(t,r){for(var n in e){var i=e[n];i.update&&i.update(t,r)}}}}function r(e,t){var r={},i=e.material.uniforms;for(var s in i){var o=i[s];if(o.semantic){var a=o.node,l=e;a&&(l=t[a]),r[s]={semantic:o.semantic,sourceNode:l,targetNode:e,uniform:o}}}this.boundUniforms=r,this._m4=new n.Matrix4}e.Shaders={update:function(){console.warn("threeExamples.LegacyGLTFLoader.Shaders has been deprecated, and now updates automatically.")}},r.prototype.update=function(e,t){var r=this.boundUniforms;for(var n in r){var i=r[n];switch(i.semantic){case"MODELVIEW":i.uniform.value.multiplyMatrices(t.matrixWorldInverse,i.sourceNode.matrixWorld);break;case"MODELVIEWINVERSETRANSPOSE":var s=i.uniform.value;this._m4.multiplyMatrices(t.matrixWorldInverse,i.sourceNode.matrixWorld),s.getNormalMatrix(this._m4);break;case"PROJECTION":i.uniform.value.copy(t.projectionMatrix);break;case"JOINTMATRIX":for(var o=i.uniform.value,a=0;a=2.0 are supported.")));const l=new $(i,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e=0&&void 0===o[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}l.setExtensions(s),l.setPlugins(o),l.parse(r,n)}parseAsync(e,t){const r=this;return new Promise((function(n,i){r.parse(e,t,n,i)}))}}function l(){let e={};return{get:function(t){return e[t]},add:function(t,r){e[t]=r},remove:function(t){delete e[t]},removeAll:function(){e={}}}}const c={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class u{constructor(e){this.parser=e,this.name=c.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let r=0,n=t.length;r=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,i.source,s)}}class E{constructor(e){this.parser=e,this.name=c.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,r=this.parser,n=r.json,i=n.textures[e];if(!i.extensions||!i.extensions[t])return null;const s=i.extensions[t],o=n.images[s.source];let a=r.textureLoader;if(o.uri){const e=r.options.manager.getHandler(o.uri);null!==e&&(a=e)}return this.detectSupport().then((function(i){if(i)return r.loadTextureImage(e,s.source,a);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(e)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}}class M{constructor(e){this.parser=e,this.name=c.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,r=this.parser,n=r.json,i=n.textures[e];if(!i.extensions||!i.extensions[t])return null;const s=i.extensions[t],o=n.images[s.source];let a=r.textureLoader;if(o.uri){const e=r.options.manager.getHandler(o.uri);null!==e&&(a=e)}return this.detectSupport().then((function(i){if(i)return r.loadTextureImage(e,s.source,a);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(e)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}}class S{constructor(e){this.name=c.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,r=t.bufferViews[e];if(r.extensions&&r.extensions[this.name]){const e=r.extensions[this.name],n=this.parser.getDependency("buffer",e.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return n.then((function(t){const r=e.byteOffset||0,n=e.byteLength||0,s=e.count,o=e.byteStride,a=new Uint8Array(t,r,n);return i.decodeGltfBufferAsync?i.decodeGltfBufferAsync(s,o,a,e.mode,e.filter).then((function(e){return e.buffer})):i.ready.then((function(){const t=new ArrayBuffer(s*o);return i.decodeGltfBuffer(new Uint8Array(t),s,o,a,e.mode,e.filter),t}))}))}return null}}class C{constructor(e){this.name=c.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,r=t.nodes[e];if(!r.extensions||!r.extensions[this.name]||void 0===r.mesh)return null;const i=t.meshes[r.mesh];for(const e of i.primitives)if(e.mode!==N.TRIANGLES&&e.mode!==N.TRIANGLE_STRIP&&e.mode!==N.TRIANGLE_FAN&&void 0!==e.mode)return null;const s=r.extensions[this.name].attributes,o=[],a={};for(const e in s)o.push(this.parser.getDependency("accessor",s[e]).then((t=>(a[e]=t,a[e]))));return o.length<1?null:(o.push(this.parser.createNodeMesh(e)),Promise.all(o).then((e=>{const t=e.pop(),r=t.isGroup?t.children:[t],i=e[0].count,s=[];for(const e of r){const t=new n.Matrix4,r=new n.Vector3,o=new n.Quaternion,l=new n.Vector3(1,1,1),c=new n.InstancedMesh(e.geometry,e.material,i);for(let e=0;e0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new l,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let r=!1,i=-1,s=!1,o=-1;if("undefined"!=typeof navigator){const e=navigator.userAgent;r=!0===/^((?!chrome|android).)*safari/i.test(e);const t=e.match(/Version\/(\d+)/);i=r&&t?parseInt(t[1],10):-1,s=e.indexOf("Firefox")>-1,o=s?e.match(/Firefox\/([0-9]+)\./)[1]:-1}"undefined"==typeof createImageBitmap||r&&i<17||s&&o<98?this.textureLoader=new n.TextureLoader(this.options.manager):this.textureLoader=new n.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new n.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const r=this,n=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll((function(e){return e._markDefs&&e._markDefs()})),Promise.all(this._invokeAll((function(e){return e.beforeRoot&&e.beforeRoot()}))).then((function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])})).then((function(t){const s={scene:t[0][n.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:n.asset,parser:r,userData:{}};return H(i,s,n),j(s,n),Promise.all(r._invokeAll((function(e){return e.afterRoot&&e.afterRoot(s)}))).then((function(){for(const e of s.scenes)e.updateMatrixWorld();e(s)}))})).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[];for(let r=0,n=t.length;r{const r=this.associations.get(e);null!=r&&this.associations.set(t,r);for(const[r,n]of e.children.entries())i(n,t.children[r])};return i(r,n),n.name+="_instance_"+e.uses[t]++,n}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let r=0;r=2&&p.setY(t,h[e*o+1]),o>=3&&p.setZ(t,h[e*o+2]),o>=4&&p.setW(t,h[e*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return p}))}loadTexture(e){const t=this.json,r=this.options,n=t.textures[e].source,i=t.images[n];let s=this.textureLoader;if(i.uri){const e=r.manager.getHandler(i.uri);null!==e&&(s=e)}return this.loadTextureImage(e,n,s)}loadTextureImage(e,t,r){const i=this,s=this.json,o=s.textures[e],a=s.images[t],l=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const c=this.loadImageSource(t,r).then((function(t){t.flipY=!1,t.name=o.name||a.name||"",""===t.name&&"string"==typeof a.uri&&!1===a.uri.startsWith("data:image/")&&(t.name=a.uri);const r=(s.samplers||{})[o.sampler]||{};return t.magFilter=F[r.magFilter]||n.LinearFilter,t.minFilter=F[r.minFilter]||n.LinearMipmapLinearFilter,t.wrapS=k[r.wrapS]||n.RepeatWrapping,t.wrapT=k[r.wrapT]||n.RepeatWrapping,i.associations.set(t,{textures:e}),t})).catch((function(){return null}));return this.textureCache[l]=c,c}loadImageSource(e,t){const r=this.json,i=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then((e=>e.clone()));const s=r.images[e],o=self.URL||self.webkitURL;let a=s.uri||"",l=!1;if(void 0!==s.bufferView)a=this.getDependency("bufferView",s.bufferView).then((function(e){l=!0;const t=new Blob([e],{type:s.mimeType});return a=o.createObjectURL(t),a}));else if(void 0===s.uri)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const c=Promise.resolve(a).then((function(e){return new Promise((function(r,s){let o=r;!0===t.isImageBitmapLoader&&(o=function(e){const t=new n.Texture(e);t.needsUpdate=!0,r(t)}),t.load(n.LoaderUtils.resolveURL(e,i.path),o,void 0,s)}))})).then((function(e){var t;return!0===l&&o.revokeObjectURL(a),j(e,s),e.userData.mimeType=s.mimeType||((t=s.uri).search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/)?"image/jpeg":t.search(/\.webp($|\?)/i)>0||0===t.search(/^data\:image\/webp/)?"image/webp":"image/png"),e})).catch((function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",a),e}));return this.sourceCache[e]=c,c}assignTexture(e,t,r,n){const i=this;return this.getDependency("texture",r.index).then((function(s){if(!s)return null;if(void 0!==r.texCoord&&r.texCoord>0&&((s=s.clone()).channel=r.texCoord),i.extensions[c.KHR_TEXTURE_TRANSFORM]){const e=void 0!==r.extensions?r.extensions[c.KHR_TEXTURE_TRANSFORM]:void 0;if(e){const t=i.associations.get(s);s=i.extensions[c.KHR_TEXTURE_TRANSFORM].extendTexture(s,e),i.associations.set(s,t)}}return void 0!==n&&(s.colorSpace=n),e[t]=s,s}))}assignFinalMaterial(e){const t=e.geometry;let r=e.material;const i=void 0===t.attributes.tangent,s=void 0!==t.attributes.color,o=void 0===t.attributes.normal;if(e.isPoints){const e="PointsMaterial:"+r.uuid;let t=this.cache.get(e);t||(t=new n.PointsMaterial,n.Material.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,t.sizeAttenuation=!1,this.cache.add(e,t)),r=t}else if(e.isLine){const e="LineBasicMaterial:"+r.uuid;let t=this.cache.get(e);t||(t=new n.LineBasicMaterial,n.Material.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,this.cache.add(e,t)),r=t}if(i||s||o){let e="ClonedMaterial:"+r.uuid+":";i&&(e+="derivative-tangents:"),s&&(e+="vertex-colors:"),o&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=r.clone(),s&&(t.vertexColors=!0),o&&(t.flatShading=!0),i&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(r))),r=t}e.material=r}getMaterialType(){return n.MeshStandardMaterial}loadMaterial(e){const t=this,r=this.json,i=this.extensions,s=r.materials[e];let o;const a={},l=[];if((s.extensions||{})[c.KHR_MATERIALS_UNLIT]){const e=i[c.KHR_MATERIALS_UNLIT];o=e.getMaterialType(),l.push(e.extendParams(a,s,t))}else{const r=s.pbrMetallicRoughness||{};if(a.color=new n.Color(1,1,1),a.opacity=1,Array.isArray(r.baseColorFactor)){const e=r.baseColorFactor;a.color.setRGB(e[0],e[1],e[2],n.LinearSRGBColorSpace),a.opacity=e[3]}void 0!==r.baseColorTexture&&l.push(t.assignTexture(a,"map",r.baseColorTexture,n.SRGBColorSpace)),a.metalness=void 0!==r.metallicFactor?r.metallicFactor:1,a.roughness=void 0!==r.roughnessFactor?r.roughnessFactor:1,void 0!==r.metallicRoughnessTexture&&(l.push(t.assignTexture(a,"metalnessMap",r.metallicRoughnessTexture)),l.push(t.assignTexture(a,"roughnessMap",r.metallicRoughnessTexture))),o=this._invokeOne((function(t){return t.getMaterialType&&t.getMaterialType(e)})),l.push(Promise.all(this._invokeAll((function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,a)}))))}!0===s.doubleSided&&(a.side=n.DoubleSide);const u=s.alphaMode||"OPAQUE";if("BLEND"===u?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,"MASK"===u&&(a.alphaTest=void 0!==s.alphaCutoff?s.alphaCutoff:.5)),void 0!==s.normalTexture&&o!==n.MeshBasicMaterial&&(l.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new n.Vector2(1,1),void 0!==s.normalTexture.scale)){const e=s.normalTexture.scale;a.normalScale.set(e,e)}if(void 0!==s.occlusionTexture&&o!==n.MeshBasicMaterial&&(l.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),void 0!==s.occlusionTexture.strength&&(a.aoMapIntensity=s.occlusionTexture.strength)),void 0!==s.emissiveFactor&&o!==n.MeshBasicMaterial){const e=s.emissiveFactor;a.emissive=(new n.Color).setRGB(e[0],e[1],e[2],n.LinearSRGBColorSpace)}return void 0!==s.emissiveTexture&&o!==n.MeshBasicMaterial&&l.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture,n.SRGBColorSpace)),Promise.all(l).then((function(){const r=new o(a);return s.name&&(r.name=s.name),j(r,s),t.associations.set(r,{materials:e}),s.extensions&&H(i,r,s),r}))}createUniqueName(e){const t=n.PropertyBinding.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,r=this.extensions,i=this.primitiveCache;function s(e){return r[c.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(r){return J(r,e,t)}))}const o=[];for(let r=0,a=e.length;r0&&q(p,s),p.name=t.createUniqueName(s.name||"mesh_"+e),j(p,s),d.extensions&&H(i,p,d),t.assignFinalMaterial(p),u.push(p)}for(let r=0,n=u.length;r1?new n.Group:1===t.length?t[0]:new n.Object3D,a!==t[0])for(let e=0,r=t.length;e{const t=new Map;for(const[e,r]of i.associations)(e instanceof n.Material||e instanceof n.Texture)&&t.set(e,r);return e.traverse((e=>{const r=i.associations.get(e);null!=r&&t.set(e,r)})),t})(s),s}))}_createAnimationTracks(e,t,r,i,s){const o=[],a=e.name?e.name:e.uuid,l=[];let c;switch(Q[s.path]===Q.weights?e.traverse((function(e){e.morphTargetInfluences&&l.push(e.name?e.name:e.uuid)})):l.push(a),Q[s.path]){case Q.weights:c=n.NumberKeyframeTrack;break;case Q.rotation:c=n.QuaternionKeyframeTrack;break;case Q.position:case Q.scale:c=n.VectorKeyframeTrack;break;default:c=1===r.itemSize?n.NumberKeyframeTrack:n.VectorKeyframeTrack}const u=void 0!==i.interpolation?V[i.interpolation]:n.InterpolateLinear,h=this._getArrayFromAccessor(r);for(let e=0,r=l.length;e{i?i(t):console.error(t),s.manager.itemError(e),s.manager.itemEnd(e)},l=new n.FileLoader(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,(r=>{try{s.parse(r,o,(r=>{t(r),s.manager.itemEnd(e)}),a)}catch(e){a(e)}}),r,a)}setDRACOLoader(e){this.glTFLoader.setDRACOLoader(e)}setKTX2Loader(e){this.glTFLoader.setKTX2Loader(e)}setMeshoptDecoder(e){this.glTFLoader.setMeshoptDecoder(e)}register(e){this.glTFLoader.register(e)}unregister(e){this.glTFLoader.unregister(e)}parse(e,t,r,n){e&&t?1===new DataView(e,0,20).getUint32(4,!0)?this.legacyGLTFLoader.parse(e,t,r,n):this.glTFLoader.parse(e,t,r,n):n("[iGLTFLoader]: Buffer and path are mandatory to parse a glTF.")}parseAsync(e,t){const r=this;return new Promise(((n,i)=>{r.parse(e,t,n,i)}))}}const ee=Z},48542:(e,t,r)=>{"use strict";r.d(t,{LM:()=>d,Li:()=>u,WD:()=>m,cG:()=>v,oS:()=>y});var n=r(39437),i=r(32060),s=r(25847),o=r(14333);function a(e,t,r,n,i,s){const a={view:e,requester:i,layer:r,priority:i?1/(i.distance+1):100,metadata:n,redraw:s};return r.dispatchEvent({type:o.s.ON_TILE_REQUESTED,metadata:n}),t.execute(a)}function l(e){return e.children.filter((t=>t.layer==e.layer&&t.tileId))}const c=new n.Matrix4;function u(e,t,r,n){return!(!r.viewerRequestVolume||!r.viewerRequestVolume.viewerRequestVolumeCulling(t,n))||!(!r.boundingVolume||!r.boundingVolume.boundingVolumeCulling(t,n))}function h(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=t.additiveRefinement||r>0;for(let s=0;sthis.cleanupDelay){this.root.cleanableSince=void 0;let e=0;for(;ethis.cleanupDelay))break;h(this,r)}this._cleanableTiles.splice(0,e)}return[this.root]}const p=new n.Box3,f=new n.Sphere;function m(e,t,r,n){return a(e,t,r,n,void 0,!0).then((e=>{r.object3d.add(e),e.updateMatrixWorld(),r.tileset.tiles[e.tileId].loaded=!0,r.root=e,r.onTileContentLoaded(e)}))}function g(e,t){e.content&&(e.content.visible=t)}function A(e,t){t.cleanableSince||(t.cleanableSince=Date.now(),e._cleanableTiles.push(t))}function y(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v;return function(r,n,i){if(i.parent.pendingSubdivision&&!i.parent.additiveRefinement)return void(i.visible=!1);const s=!e||!e(n,r.camera,i,i.matrixWorld);if(i.visible=s,s){let s;if(i.cleanableSince&&(n._cleanableTiles.splice(n._cleanableTiles.indexOf(i),1),i.cleanableSince=void 0),i.pendingSubdivision||t(r,n,i))(function(e,t,r,n){r.additiveRefinement?function(e,t,r,n){for(const i of t.tileset.tiles[r.tileId].children){if(i.promise||i.loaded)continue;let s=r.matrixWorld;i.transform&&(s=c.multiplyMatrices(r.matrixWorld,i.transform)),(!n||!n(t,e.camera,i,s))&&(i.promise=a(e.view,e.scheduler,t,i,r,!0).then((n=>{r.add(n),n.updateMatrixWorld(),t.onTileContentLoaded(n),e.view.notifyChange(i),i.loaded=!0,delete i.promise})))}}(e,t,r,n):function(e,t,r){if(!r.pendingSubdivision&&0==l(r).length){const n=t.tileset.tiles[r.tileId].children;if(void 0===n||0===n.length)return;r.pendingSubdivision=!0;const i=[];for(let s=0;s{n[s].loaded=!0,r.add(i),i.updateMatrixWorld(),r.additiveRefinement&&e.view.notifyChange(r),t.tileset.tiles[i.tileId].loaded=!0,t.onTileContentLoaded(i)})));Promise.all(i).then((()=>{r.pendingSubdivision=!1,e.view.notifyChange(r)}))}}(e,t,r)})(r,n,i,e),g(i,i.pendingSubdivision||i.additiveRefinement),s=l(i);else{g(i,!0);for(const e of l(i))e.visible=!1,A(n,e)}return s}A(n,i)}}function v(e,t,r){if(void 0===t.tileset.tiles[r.tileId].children)return!1;if(t.tileset.tiles[r.tileId].isTileset)return!0;const n=function(e,t){if(t.distance=0,t.boundingVolume.initialVolumeType===s.h.box)p.copy(t.boundingVolume.volume),p.applyMatrix4(t.matrixWorld),t.distance=p.distanceToPoint(e.camera3D.position);else{if(t.boundingVolume.initialVolumeType!==s.h.sphere&&t.boundingVolume.initialVolumeType!==s.h.region)return 1/0;f.copy(t.boundingVolume.volume),f.applyMatrix4(t.matrixWorld),t.distance=Math.max(0,f.distanceToPoint(e.camera3D.position))}return 0===t.distance?1/0:e._preSSE*(t.geometricError/t.distance)}(e.camera,r);return n>t.sseThreshold}},32060:(e,t,r)=>{"use strict";function n(e){e.dispose();for(const t of Object.keys(e)){const r=e[t];r&&r.isTexture&&r.dispose()}}r.d(t,{A:()=>i});const i={cleanup(e){if(e.layer=null,e.isScene||"function"!=typeof e.dispose){if(e.geometry&&e.geometry.dispose(),e.material)if(Array.isArray(e.material))for(const t of e.material)n(t);else n(e.material);e.dispatchEvent({type:"dispose"})}else e.dispose()},removeChildren(e,t){const r=t.children.filter((t=>(t.layer&&t.layer.id)===e.id));return t.remove(...r),r},removeChildrenAndCleanup(e,t){const r=t.children.filter((t=>(t.layer&&t.layer.id)===e.id));return t.remove(...r),t.layer===e&&this.cleanup(t),r},removeChildrenAndCleanupRecursively(e,t){let r=t.children.filter((t=>t.layer&&t.layer.id===e.id));const n=t.link&&t.link[e.id];n?.children.length&&(r=r.concat(n.children),delete t.link[e.id]);for(const t of r)this.removeChildrenAndCleanupRecursively(e,t);return t.remove(...r),t.layer&&t.layer.id===e.id&&this.cleanup(t),r}}},7794:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(39437);const i=new n.TextureLoader;function s(e){if(!e.ok){const t=new Error(`Error loading ${e.url}: status ${e.status}`);throw t.response=e,t}}const o=function(e){return fetch(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).then((e=>(s(e),e.arrayBuffer())))},a={text(e){return fetch(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).then((e=>(s(e),e.text())))},json(e){return fetch(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).then((e=>(s(e),e.json())))},xml(e){return fetch(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).then((e=>(s(e),e.text()))).then((e=>(new window.DOMParser).parseFromString(e,"text/xml")))},texture(e){let t,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i.crossOrigin=n.crossOrigin;const s=new Promise(((e,n)=>{t=e,r=n}));return i.load(e,t,(()=>{}),(t=>{const n=new Error(`Failed to load texture from URL: \`${e}\``);n.originalEvent=t,r(n)})),s},arrayBuffer:o,textureFloat(e){return o(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).then((e=>{const t=function(e){const t=new n.DataTexture(e,256,256,n.RedFormat,n.FloatType);return t.internalFormat="R32F",t.needsUpdate=!0,t}(new Float32Array(e));return t}))},multiple(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=[];let i;for(const s in t){if(!this[s])throw new Error(`${s} is not a valid Fetcher method.`);for(const o of t[s])i=`${e}.${o}`,n.push(this[s](i,r).then((e=>({type:o,result:e}))))}return Promise.all(n).then((e=>{const t={};for(const r of e)t[r.type]=r.result;return Promise.resolve(t)}))},get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const[t,r]=e.split("/");switch(t){case"application":switch(r){case"geo+json":case"json":return this.json;case"kml":case"gpx":return this.xml;case"x-protobuf;type=mapbox-vector":case"gtx":return this.arrayBuffer;default:return this.text}case"image":return"x-bil;bits=32"===r?this.textureFloat:this.texture;default:return this.texture}}}},97709:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let n=0;function i(e){const t=/\$\{u:([\w-_.|]+)\}/.exec(e);if(!t)return e;const r=t[1].split("|");return e.replace(t[0],r[n++%r.length])}const s={subDomains:i,xyz:function(e,t){return i(t.url.replace(/(\$\{z\}|%TILEMATRIX)/,t.tileMatrixCallback(e.zoom)).replace(/(\$\{y\}|%ROW)/,e.row).replace(/(\$\{x\}|%COL)/,e.col))},bbox:function(e,t){let r="EPSG:4326"==t.crs?9:2;void 0!==t.bboxDigits&&(r=t.bboxDigits);const n=e.west.toFixed(r),s=e.south.toFixed(r),o=e.east.toFixed(r),a=e.north.toFixed(r);let l=t.axisOrder||"wsen";return l=l.replace("w",`${n},`).replace("s",`${s},`).replace("e",`${o},`).replace("n",`${a},`).slice(0,-1),i(t.url.replace("%bbox",l))}}},93320:(e,t,r)=>{"use strict";r.d(t,{A:()=>h,d:()=>o});var n=r(39437),i=r(52404),s=r(18590);const o={PERSPECTIVE:0,ORTHOGRAPHIC:1},a={frustum:new n.Frustum,matrix:new n.Matrix4,box3:new n.Box3},l=new n.Box3(new n.Vector3(-1,-1,-1),new n.Vector3(1,1,1));function c(e,t,r){if(e.camera3D.isOrthographicCamera)e._preSSE=t;else{const i=n.MathUtils.degToRad(r);e._preSSE=t/(2*Math.tan(.5*i))}}const u=[new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3],h=class{#B=!0;#P=(()=>new n.Matrix4)();constructor(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(this.crs=e,i.isCamera)console.warn("options.camera parameter is deprecated. Use options.camera.cameraThree to place a custom camera as a parameter. See the documentation of Camera."),this.camera3D=i;else if(i.cameraThree)this.camera3D=i.cameraThree;else switch(i.type){case o.ORTHOGRAPHIC:this.camera3D=new n.OrthographicCamera;break;case o.PERSPECTIVE:default:this.camera3D=new n.PerspectiveCamera(30)}if(this.camera3D.aspect=this.camera3D.aspect??1,this.width=t,this.height=r,this.resize(t,r),this._preSSE=1/0,this.camera3D.isPerspectiveCamera){let e=this.camera3D.fov;Object.defineProperty(this.camera3D,"fov",{get:()=>e,set:t=>{e=t,c(this,this.height,e)}})}}resize(e,t){if(!e||e<=0||!t||t<=0)return void console.warn(`Trying to resize the Camera with invalid height (${t}) or width (${e}). Skipping resize.`);const r=e/t;if(this.camera3D.aspect!==r){if(this.camera3D.isOrthographicCamera){this.camera3D.zoom*=this.width/e;const t=this.camera3D.top*this.camera3D.aspect/r;this.camera3D.bottom=-t,this.camera3D.top=t}else this.camera3D.isPerspectiveCamera&&(this.camera3D.fov=2*n.MathUtils.radToDeg(Math.atan(t/this.height*Math.tan(n.MathUtils.degToRad(this.camera3D.fov)/2))));this.camera3D.aspect=r}this.width=e,this.height=t,c(this,this.height,this.camera3D.fov),this.camera3D.updateProjectionMatrix&&(this.camera3D.updateProjectionMatrix(),this.#B=!0)}update(){this.camera3D.updateMatrixWorld(),this.#B=!0}position(e){return new i.A(this.crs,this.camera3D.position).as(e||this.crs)}setPosition(e){this.camera3D.position.copy(e.as(this.crs))}isBox3Visible(e,t){return this.box3SizeOnScreen(e,t).intersectsBox(l)}isSphereVisible(e,t){return this.#B&&(this.#P.multiplyMatrices(this.camera3D.projectionMatrix,this.camera3D.matrixWorldInverse),this.#B=!1),t?(a.matrix.multiplyMatrices(this.#P,t),a.frustum.setFromProjectionMatrix(a.matrix)):a.frustum.setFromProjectionMatrix(this.#P),a.frustum.intersectsSphere(e)}box3SizeOnScreen(e,t){const r=function(e,t,r){let n=e.camera3D.matrixWorldInverse;r&&(n=a.matrix.multiplyMatrices(e.camera3D.matrixWorldInverse,r)),u[0].set(t.min.x,t.min.y,t.min.z).applyMatrix4(n),u[1].set(t.min.x,t.min.y,t.max.z).applyMatrix4(n),u[2].set(t.min.x,t.max.y,t.min.z).applyMatrix4(n),u[3].set(t.min.x,t.max.y,t.max.z).applyMatrix4(n),u[4].set(t.max.x,t.min.y,t.min.z).applyMatrix4(n),u[5].set(t.max.x,t.min.y,t.max.z).applyMatrix4(n),u[6].set(t.max.x,t.max.y,t.min.z).applyMatrix4(n),u[7].set(t.max.x,t.max.y,t.max.z).applyMatrix4(n);let i=!1;for(let t=0;t<8;t++)u[t].z<=-e.camera3D.near?i=!0:u[t].z=-e.camera3D.near;return i?u:void 0}(this,e,t);if(!r)return a.box3.makeEmpty();for(let e=0;e<8;e++)r[e].applyMatrix4(this.camera3D.projectionMatrix);return a.box3.setFromPoints(r)}adjustAltitudeToAvoidCollisionWithLayer(e,t,r){const n=e.camera.position().as("EPSG:4326");if(void 0!==t){const i=s.A.getElevationValueAt(t,n);void 0!==i&&n.altitude-(i+r)<0&&(n.altitude=i+r,e.camera3D.position.copy(n.as(e.referenceCrs)),e.notifyChange(this.camera3D))}}}},33746:(e,t,r)=>{"use strict";r.d(t,{A:()=>o,x:()=>s});var n=r(61276);function i(e,t){const r=n.p.getColorLayersIdOrderedBySequence(t),i=function(e){e.material?.setSequence&&e.material.setSequence(r)};for(const t of e.level0Nodes)t.traverse(i)}const s="layers-order-changed",o={moveLayerUp(e,t){const r=e.getLayers((e=>e.isColorLayer)),o=e.getLayerById(t);if(!o)throw new Error(`${t} isn't color layer`);{const t=n.p.getColorLayersIdOrderedBySequence(r);n.p.moveLayerUp(o,r),i(e.tileLayer,r),e.dispatchEvent({type:s,previous:{sequence:t},new:{sequence:n.p.getColorLayersIdOrderedBySequence(r)}}),e.notifyChange(e.tileLayer)}},moveLayerDown(e,t){const r=e.getLayers((e=>e.isColorLayer)),o=e.getLayerById(t);if(!o)throw new Error(`${t} isn't color layer`);{const t=n.p.getColorLayersIdOrderedBySequence(r);n.p.moveLayerDown(o,r),i(e.tileLayer,r),e.dispatchEvent({type:s,previous:{sequence:t},new:{sequence:n.p.getColorLayersIdOrderedBySequence(r)}}),e.notifyChange(e.tileLayer)}},moveLayerToIndex(e,t,r){const o=e.getLayers((e=>e.isColorLayer)),a=e.getLayerById(t);if(!a)throw new Error(`${t} isn't color layer`);{const t=n.p.getColorLayersIdOrderedBySequence(o);n.p.moveLayerToIndex(a,r,o),i(e.tileLayer,o),e.dispatchEvent({type:s,previous:{sequence:t},new:{sequence:n.p.getColorLayersIdOrderedBySequence(o)}}),e.notifyChange(e.tileLayer)}}}},68983:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n=r(39437);const i={setDefineMapping(e,t,r){Object.keys(r).forEach((n=>{e.defines[`${t}_${n}`]=r[n]}))},setDefineProperty(e,t,r,n){e.defines[r]=n,Object.defineProperty(e,t,{get:()=>e.defines[r],set:t=>{e.defines[r]!=t&&(e.defines[r]=t,e.needsUpdate=!0)}})},setUniformProperty(e,t,r){e.uniforms[t]=new n.Uniform(r),Object.defineProperty(e,t,{get:()=>e.uniforms[t].value,set:r=>{e.uniforms[t].value!=r&&(e.uniforms[t].value=r)}})}}},7296:(e,t,r)=>{"use strict";r.d(t,{A:()=>l,N:()=>o});var n=r(39437),i=r(4660);const s=new n.Frustum;class o{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;this.x=e,this.y=t,this.grid=[],this.visible=[],this.resize(),this.reset(),this.width=r,this.height=n}reset(){for(let e=0;e0&&this.grid[s][t].some((t=>{return r=t.boundaries,n=e.boundaries,!(r.left>n.right||r.rightn.bottom||r.bottome.isLabelLayer&&e.visible));0!=r.length&&(this.grid.reset(),s.setFromProjectionMatrix(t.projectionMatrix),r.forEach((e=>{e.submittedLabelNodes.forEach((e=>{e.labels.forEach((r=>{e.updatePosition(r),this.culling(r,t)})),e.domElements.labels.show(),e.needsUpdate=!1}))})),this.grid.visible.sort(((e,t)=>{const r=t.order-e.order;return 0==r?!e.visible&&t.visible?1:-1:r})),this.grid.visible.forEach((e=>{this.grid.insert(e)?(e.visible=!0,e.updateCSSPosition()):e.visible=!1})),r.forEach((e=>{e.toHide.children.forEach((e=>e.domElements?.labels.hide())),e.toHide.clear()})))}culling(e,t){e.getWorldPosition(a),!s.containsPoint(a.applyMatrix4(t.matrixWorldInverse))||e.horizonCullingPoint&&i.A.horizonCulling(e.horizonCullingPoint)||this.grid.visible.some((t=>{const r=e.content.textContent;return""!==r&&t.content.textContent.toLowerCase()==r.toLowerCase()}))?e.visible=!1:(a.applyMatrix4(t.projectionMatrix),e.updateProjectedPosition(a.x*this.halfWidth+this.halfWidth,-a.y*this.halfHeight+this.halfHeight),this.grid.visible.push(e))}removeLabelDOM(e){this.garbage.appendChild(e.content),this.garbage.innerHTML=""}}},99234:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>w,Ll:()=>g,RN:()=>d,gL:()=>m,zY:()=>v});var n=r(39437),i=r(21311),s=r(2015),o=r(12980),a=r(68983);const l=new n.Vector4(0,0,1,1),c=new n.Texture,u=255/256,h=new n.Vector4(u,.0038909912109375,u/65536,5.9371814131736755e-8);function d(e,t){return t?h.dot(e)*t:h.dot(e)}const p=15,f=1;function m(){const e=s.A.getMaxTextureUnitsCount();return Math.min(e-f,p)}const g={noEffect:0,removeLightColor:1,removeWhiteColor:2,customEffect:3},A={bias:0,noDataValue:-99999,zmin:0,zmax:0,scale:0,mode:0,textureOffset:0,opacity:0,crs:0,effect_parameter:0,effect_type:g.noEffect,transparent:!1};function y(e,t,r){const n=e.layers.value,i=e.textures.value,s=e.offsetScales.value,o=e.textureCount;let a=0;for(const e of t){e.textureOffset=a;for(let t=0,o=e.textures.length;tr&&console.warn(`LayeredMaterial: Not enough texture units (${r} < ${a}), excess textures have been discarded.`),o.value=a;for(let e=a;e1?arguments[1]:void 0;super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),x=x||[f,m()],this.defines.NUM_VS_TEXTURES=x[0],this.defines.NUM_FS_TEXTURES=x[1],this.defines.USE_FOG=1,this.defines.NUM_CRS=e,a.A.setDefineMapping(this,"ELEVATION",v),a.A.setDefineMapping(this,"MODE",o.A.MODES),a.A.setDefineProperty(this,"mode","MODE",o.A.MODES.FINAL),this.vertexShader="#include \n#include \n#include \n#include \n#if NUM_CRS > 1\nattribute float uv_1;\n#endif\n\nuniform bool lightingEnabled;\nvarying vec2 vHighPrecisionZW;\n\n#if MODE == MODE_FINAL\n#include \nvarying vec3 vUv;\nvarying vec3 vNormal;\n#endif\nvoid main() {\n #include \n #include \n #include \n #include \n #include \n vHighPrecisionZW = gl_Position.zw;\n#if MODE == MODE_FINAL\n #include \n #if NUM_CRS > 1\n vUv = vec3(uv, (uv_1 > 0.) ? uv_1 : uv.y); // set uv_1 = uv if uv_1 is undefined\n #else\n vUv = vec3(uv, 0.0);\n #endif\n vNormal = normalize ( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );\n#endif\n}\n",_[e]=_[e]||i.A.unrollLoops("#include \n#include \n#include \n#include \n#if MODE == MODE_FINAL\n#include \n#include \n#include \n#endif\n#include \n\nuniform vec3 diffuse;\nuniform float opacity;\nvarying vec3 vUv; // uv.x/uv_1.x, uv.y, uv_1.y\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n #include \n\n#if MODE == MODE_ID\n\n #include \n\n#elif MODE == MODE_DEPTH\n\n #include \n\n#else\n\n gl_FragColor = vec4(diffuse, opacity);\n\n uvs[0] = vec3(vUv.xy, 0.);\n\n#if NUM_CRS > 1\n uvs[1] = vec3(vUv.x, fract(vUv.z), floor(vUv.z));\n#endif\n\n vec4 color;\n #pragma unroll_loop\n for ( int i = 0; i < NUM_FS_TEXTURES; i ++ ) {\n color = getLayerColor( i , colorTextures[ i ], colorOffsetScales[ i ], colorLayers[ i ]);\n gl_FragColor.rgb = mix(gl_FragColor.rgb, color.rgb, color.a);\n }\n\n #if defined(DEBUG)\n if (showOutline) {\n #pragma unroll_loop\n for ( int i = 0; i < NUM_CRS; i ++) {\n color = getOutlineColor( outlineColors[ i ], uvs[ i ].xy);\n gl_FragColor.rgb = mix(gl_FragColor.rgb, color.rgb, color.a);\n }\n }\n #endif\n\n #include \n #include \n #include \n\n#endif\n}\n",this.defines),this.fragmentShader=_[e],a.A.setUniformProperty(this,"diffuse",new n.Color(.04,.23,.35)),a.A.setUniformProperty(this,"opacity",this.opacity),a.A.setUniformProperty(this,"lightingEnabled",!1),a.A.setUniformProperty(this,"lightPosition",new n.Vector3(-.5,0,1)),a.A.setUniformProperty(this,"fogDistance",1e9),a.A.setUniformProperty(this,"fogColor",new n.Color(.76,.85,1)),a.A.setUniformProperty(this,"overlayAlpha",0),a.A.setUniformProperty(this,"overlayColor",new n.Color(1,.3,0)),a.A.setUniformProperty(this,"objectId",0),a.A.setUniformProperty(this,"geoidHeight",0),a.A.setUniformProperty(this,"minBorderDistance",-.01),this.layers=[],this.elevationLayerIds=[],this.colorLayerIds=[],this.uniforms.elevationLayers=new n.Uniform(new Array(x[0]).fill(A)),this.uniforms.elevationTextures=new n.Uniform(new Array(x[0]).fill(c)),this.uniforms.elevationOffsetScales=new n.Uniform(new Array(x[0]).fill(l)),this.uniforms.elevationTextureCount=new n.Uniform(0),this.uniforms.colorLayers=new n.Uniform(new Array(x[1]).fill(A)),this.uniforms.colorTextures=new n.Uniform(new Array(x[1]).fill(c)),this.uniforms.colorOffsetScales=new n.Uniform(new Array(x[1]).fill(l)),this.uniforms.colorTextureCount=new n.Uniform(0),Object.defineProperty(this,"visible",{get(){return this.#L},set(e){this.#L!=e&&(this.#L=e,this.dispatchEvent({type:e?"shown":"hidden"}))}})}getUniformByType(e){return{layers:this.uniforms[`${e}Layers`],textures:this.uniforms[`${e}Textures`],offsetScales:this.uniforms[`${e}OffsetScales`],textureCount:this.uniforms[`${e}TextureCount`]}}updateLayersUniforms(){const e=this.layers.filter((e=>this.colorLayerIds.includes(e.id)&&e.visible&&e.opacity>0));if(e.sort(((e,t)=>this.colorLayerIds.indexOf(e.id)-this.colorLayerIds.indexOf(t.id))),y(this.getUniformByType("color"),e,this.defines.NUM_FS_TEXTURES),this.elevationLayerIds.some((e=>this.getLayer(e)))||this.uniforms.elevationTextureCount.value&&!this.elevationLayerIds.length){const e=this.getElevationLayer()?[this.getElevationLayer()]:[];y(this.getUniformByType("elevation"),e,this.defines.NUM_VS_TEXTURES)}this.layersNeedUpdate=!1}dispose(){this.dispatchEvent({type:"dispose"}),this.layers.forEach((e=>e.dispose(!0))),this.layers.length=0,this.layersNeedUpdate=!0}setSequence(e){this.colorLayerIds=e,this.layersNeedUpdate=!0}setSequenceElevation(e){this.elevationLayerIds[0]=e,this.layersNeedUpdate=!0}removeLayer(e){const t=this.layers.findIndex((t=>t.id===e));if(t>-1){this.layers[t].dispose(),this.layers.splice(t,1);const r=this.colorLayerIds.indexOf(e);r>-1?this.colorLayerIds.splice(r,1):this.elevationLayerIds=[]}}addLayer(e){e.layer.id in this.layers&&console.warn('The "{layer.id}" layer was already present in the material, overwritting.'),this.layers.push(e)}getLayer(e){return this.layers.find((t=>t.id===e))}getLayers(e){return this.layers.filter((t=>e.includes(t.id)))}getElevationLayer(){return this.layers.find((e=>e.id===this.elevationLayerIds[0]))}setElevationScale(e){this.elevationLayerIds.length&&(this.getElevationLayer().scale=e)}}const w=b},41466:(e,t,r)=>{"use strict";r.d(t,{A:()=>m});var n=r(39437),i=r(86406),s=r(66124),o=r(28611),a=r(52404);const l=new o.r({uvCount:1}),c=new n.Vector3,u=new n.Vector2,h=new n.Vector3,d=new a.A("EPSG:4326",0,0,0);let p;class f extends n.Object3D{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new n.Vector3(1/0,1/0,1/0),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Vector3(-1/0,-1/0,-1/0);super(),this.box3D=new n.Box3(e.clone(),t.clone()),this.natBox=this.box3D.clone(),this.z={min:0,max:0,scale:1}}clone(){return(new f).copy(this)}copy(e){return super.copy(e),this.box3D.copy(e.box3D),this.natBox.copy(e.natBox),this.z.min=e.z.min,this.z.max=e.z.max,this.z.scale=e.z.scale,this}updateZ(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.z.min=e.min??this.z.min,this.z.max=e.max??this.z.max,this.z.scale=e.scale>0?e.scale:this.z.scale,this.z.delta=Math.abs(this.z.max-this.z.min)*this.z.scale;const t=e.geoidHeight||0;this.box3D.min.z=this.natBox.min.z+this.z.min*this.z.scale+t,this.box3D.max.z=this.natBox.max.z+this.z.max*this.z.scale+t}isSphereAboveXYBox(e){const t=this.worldToLocal(e.center),r=Math.max(this.box3D.min.x,Math.min(t.x,this.box3D.max.x)),n=Math.max(this.box3D.min.y,Math.min(t.y,this.box3D.max.y));return Math.sqrt((r-t.x)*(r-t.x)+(n-t.y)*(n-t.y))1&&void 0!==arguments[1]?arguments[1]:e.min||0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.max||0;if("EPSG:4326"==e.crs){const{shareableExtent:n,quaternion:i,position:o}=l.computeShareableExtent(e),a=Math.max(Math.floor(n.planarDimensions(u).x/90+1),2),c=new s.p(l,{extent:n,level:0,segments:a,disableSkirt:!0});p.box3D.copy(c.boundingBox),p.natBox.copy(c.boundingBox),this.copy(p),this.updateZ({min:t,max:r}),this.position.copy(o),this.quaternion.copy(i),this.updateMatrixWorld(!0)}else{if(!i.isMetricUnit(e.crs))throw new Error("Unsupported extent crs");e.center(d).toVector3(this.position),e.planarDimensions(u),c.set(u.x,u.y,Math.abs(r-t)),this.box3D.setFromCenterAndSize(h,c),this.updateMatrixWorld(!0)}return this}}p=new f;const m=f},6425:(e,t,r)=>{"use strict";r.d(t,{MY:()=>u,qW:()=>o,cn:()=>a,qU:()=>l,Ay:()=>f});var n=r(39437),i=r(68983);const s={SPECTRAL:[[0,new n.Color(.3686,.3098,.6353)],[.1,new n.Color(.1961,.5333,.7412)],[.2,new n.Color(.4,.7608,.6471)],[.3,new n.Color(.6706,.8667,.6431)],[.4,new n.Color(.902,.9608,.5961)],[.5,new n.Color(1,1,.749)],[.6,new n.Color(.9961,.8784,.5451)],[.7,new n.Color(.9922,.6824,.3804)],[.8,new n.Color(.9569,.4275,.2627)],[.9,new n.Color(.8353,.2431,.3098)],[1,new n.Color(.6196,.0039,.2588)]],PLASMA:[[0,new n.Color(.241,.015,.61)],[.1,new n.Color(.387,.001,.654)],[.2,new n.Color(.524,.025,.653)],[.3,new n.Color(.651,.125,.596)],[.4,new n.Color(.752,.227,.513)],[.5,new n.Color(.837,.329,.431)],[.6,new n.Color(.907,.435,.353)],[.7,new n.Color(.963,.554,.272)],[.8,new n.Color(.992,.681,.195)],[.9,new n.Color(.987,.822,.144)],[1,new n.Color(.94,.975,.131)]],YELLOW_GREEN:[[0,new n.Color(.1647,.2824,.3451)],[.1,new n.Color(.1338,.3555,.4227)],[.2,new n.Color(.061,.4319,.4864)],[.3,new n.Color(0,.5099,.5319)],[.4,new n.Color(0,.5881,.5569)],[.5,new n.Color(.137,.665,.5614)],[.6,new n.Color(.2906,.7395,.5477)],[.7,new n.Color(.4453,.8099,.5201)],[.8,new n.Color(.6102,.8748,.485)],[.9,new n.Color(.7883,.9323,.4514)],[1,new n.Color(.9804,.9804,.4314)]],VIRIDIS:[[0,new n.Color(.267,.005,.329)],[.1,new n.Color(.283,.141,.458)],[.2,new n.Color(.254,.265,.53)],[.3,new n.Color(.207,.372,.553)],[.4,new n.Color(.164,.471,.558)],[.5,new n.Color(.128,.567,.551)],[.6,new n.Color(.135,.659,.518)],[.7,new n.Color(.267,.749,.441)],[.8,new n.Color(.478,.821,.318)],[.9,new n.Color(.741,.873,.15)],[1,new n.Color(.993,.906,.144)]],INFERNO:[[0,new n.Color(.077,.042,.206)],[.1,new n.Color(.225,.036,.388)],[.2,new n.Color(.373,.074,.432)],[.3,new n.Color(.522,.128,.42)],[.4,new n.Color(.665,.182,.37)],[.5,new n.Color(.797,.255,.287)],[.6,new n.Color(.902,.364,.184)],[.7,new n.Color(.969,.516,.063)],[.8,new n.Color(.988,.683,.072)],[.9,new n.Color(.961,.859,.298)],[1,new n.Color(.988,.998,.645)]],GRAYSCALE:[[0,new n.Color(0,0,0)],[1,new n.Color(1,1,1)]],TURBO:[[0,new n.Color(.18995,.07176,.23217)],[.07,new n.Color(.25107,.25237,.63374)],[.13,new n.Color(.27628,.42118,.89123)],[.2,new n.Color(.25862,.57958,.99876)],[.27,new n.Color(.15844,.73551,.92305)],[.33,new n.Color(.09267,.86554,.7623)],[.4,new n.Color(.19659,.94901,.59466)],[.47,new n.Color(.42778,.99419,.38575)],[.53,new n.Color(.64362,.98999,.23356)],[.6,new n.Color(.80473,.92452,.20459)],[.67,new n.Color(.93301,.81236,.22667)],[.73,new n.Color(.99314,.67408,.20348)],[.8,new n.Color(.9836,.49291,.12849)],[.87,new n.Color(.92105,.31489,.05475)],[.93,new n.Color(.81608,.18462,.01809)],[1,new n.Color(.66449,.08436,.00424)]],RAINBOW:[[0,new n.Color(.278,0,.714)],[1/6,new n.Color(0,0,1)],[2/6,new n.Color(0,1,1)],[.5,new n.Color(0,1,0)],[4/6,new n.Color(1,1,0)],[5/6,new n.Color(1,.64,0)],[1,new n.Color(1,0,0)]],CONTOUR:[[0,new n.Color(0,0,0)],[.03,new n.Color(0,0,0)],[.04,new n.Color(1,1,1)],[1,new n.Color(1,1,1)]]},o={COLOR:0,INTENSITY:1,CLASSIFICATION:2,ELEVATION:3,RETURN_NUMBER:4,RETURN_TYPE:5,RETURN_COUNT:6,POINT_SOURCE_ID:7,SCAN_ANGLE:8,NORMAL:9},a={CIRCLE:0,SQUARE:1},l={VALUE:0,ATTENUATED:1},c=new n.Color(1,1,1),u={DEFAULT:{0:{visible:!0,name:"never classified",color:new n.Color(.5,.5,.5),opacity:1},1:{visible:!0,name:"unclassified",color:new n.Color(.5,.5,.5),opacity:1},2:{visible:!0,name:"ground",color:new n.Color(.63,.32,.18),opacity:1},3:{visible:!0,name:"low vegetation",color:new n.Color(0,1,0),opacity:1},4:{visible:!0,name:"medium vegetation",color:new n.Color(0,.8,0),opacity:1},5:{visible:!0,name:"high vegetation",color:new n.Color(0,.6,0),opacity:1},6:{visible:!0,name:"building",color:new n.Color(1,.66,0),opacity:1},7:{visible:!0,name:"low point(noise)",color:new n.Color(1,0,1),opacity:1},8:{visible:!0,name:"key-point",color:new n.Color(1,0,0),opacity:1},9:{visible:!0,name:"water",color:new n.Color(0,0,1),opacity:1},10:{visible:!0,name:"rail",color:new n.Color(.8,.8,1),opacity:1},11:{visible:!0,name:"road Surface",color:new n.Color(.4,.4,.7),opacity:1},12:{visible:!0,name:"overlap",color:new n.Color(1,1,0),opacity:1},DEFAULT:{visible:!0,name:"default",color:new n.Color(.3,.6,.6),opacity:1}}},h={DEFAULT:{0:{visible:!0,name:"0",color:new n.Color("rgb(67, 99, 216)"),opacity:1},1:{visible:!0,name:"1",color:new n.Color("rgb(60, 180, 75);"),opacity:1},2:{visible:!0,name:"2",color:new n.Color("rgb(255, 255, 25)"),opacity:1},3:{visible:!0,name:"3",color:new n.Color("rgb(145, 30, 180)"),opacity:1},4:{visible:!0,name:"4",color:new n.Color("rgb(245, 130, 49)"),opacity:1},5:{visible:!0,name:"5",color:new n.Color("rgb(230, 25, 75)"),opacity:1},6:{visible:!0,name:"6",color:new n.Color("rgb(66, 212, 244)"),opacity:1},7:{visible:!0,name:"7",color:new n.Color("rgb(240, 50, 230)"),opacity:1},DEFAULT:{visible:!0,name:"default",color:c,opacity:1}}};function d(e,t,r){let n;const i=t.image.data,s=t.image.width;r||(r=Object.keys(e).length);for(let t=0;t0&&void 0!==arguments[0]?arguments[0]:{};const t={...e.gradient,...s};e.gradient=Object.values(t)[0];const{intensityRange:r=new n.Vector2(1,65536),elevationRange:c=new n.Vector2(0,1e3),angleRange:d=new n.Vector2(-90,90),classificationScheme:p=u.DEFAULT,discreteScheme:f=h.DEFAULT,size:m=1,mode:g=o.COLOR,shape:A=a.CIRCLE,sizeMode:y=l.ATTENUATED,minAttenuatedSize:v=3,maxAttenuatedSize:x=10,gradient:_,scale:b=.025/Math.tan(.5),...w}=e;super({...w,fog:!0,precision:"highp",vertexColors:!0}),this.uniforms=n.UniformsUtils.merge([n.UniformsLib.points,n.UniformsLib.fog]),this.vertexShader="#include \n#include \n#include \n#include \n#include \nvarying vec4 vColor; // color_pars_vertex\n\n#ifdef USE_POINTS_UV\n varying vec2 vUv;\n uniform mat3 uvTransform;\n#endif\n\n#define NB_CLASS 8.\n\nuniform float size;\nuniform float scale;\n\nuniform bool picking;\nuniform int mode;\n\nuniform vec2 elevationRange;\nuniform vec2 intensityRange;\nuniform vec2 angleRange;\n\nuniform sampler2D classificationTexture;\nuniform sampler2D discreteTexture;\nuniform sampler2D gradientTexture;\nuniform int sizeMode;\nuniform float minAttenuatedSize;\nuniform float maxAttenuatedSize;\n\nattribute vec4 unique_id;\nattribute float intensity;\nattribute float classification;\nattribute float pointSourceID;\n\nattribute float returnNumber;\nattribute float numberOfReturns;\nattribute float scanAngle;\n\nvoid main() {\n vColor = vec4(1.0);\n if (picking) {\n vColor = unique_id;\n } else {\n if (mode == PNTS_MODE_CLASSIFICATION) {\n vec2 uv = vec2(classification/255., 0.5);\n vColor = texture2D(classificationTexture, uv);\n } else if (mode == PNTS_MODE_NORMAL) {\n vColor.rgb = abs(normal);\n } else if (mode == PNTS_MODE_COLOR) {\n#if defined(USE_COLOR)\n vColor.rgb = color.rgb;\n#elif defined(USE_COLOR_ALPHA)\n vColor = color;\n#endif\n } else if (mode == PNTS_MODE_RETURN_NUMBER) {\n vec2 uv = vec2(returnNumber/255., 0.5);\n vColor = texture2D(discreteTexture, uv);\n } else if (mode == PNTS_MODE_RETURN_TYPE) {\n float returnType;\n if (returnNumber > numberOfReturns) {\n returnType = 4.;\n } else if (returnNumber == 1.) {\n if (numberOfReturns == 1.) {\n // single\n returnType = 0.;\n } else {\n // first\n returnType = 1.;\n }\n } else {\n if (returnNumber == numberOfReturns) {\n // last\n returnType = 3.;\n } else {\n // intermediate\n returnType = 2.;\n }\n }\n vec2 uv = vec2(returnType/255., 0.5);\n vColor = texture2D(discreteTexture, uv);\n } else if (mode == PNTS_MODE_RETURN_COUNT) {\n vec2 uv = vec2(numberOfReturns/255., 0.5);\n vColor = texture2D(discreteTexture, uv);\n } else if (mode == PNTS_MODE_POINT_SOURCE_ID) {\n vec2 uv = vec2(mod(pointSourceID, NB_CLASS)/255., 0.5);\n vColor = texture2D(discreteTexture, uv);\n } else if (mode == PNTS_MODE_SCAN_ANGLE) {\n float i = (scanAngle - angleRange.x) / (angleRange.y - angleRange.x);\n vec2 uv = vec2(i, (1. - i));\n vColor = texture2D(gradientTexture, uv);\n } else if (mode == PNTS_MODE_INTENSITY) {\n float i = (intensity - intensityRange.x) / (intensityRange.y - intensityRange.x);\n vec2 uv = vec2(i, (1. - i));\n vColor = texture2D(gradientTexture, uv);\n } else if (mode == PNTS_MODE_ELEVATION) {\n float z = (modelMatrix * vec4(position, 1.0)).z;\n float i = (z - elevationRange.x) / (elevationRange.y - elevationRange.x);\n vec2 uv = vec2(i, (1. - i));\n vColor = texture2D(gradientTexture, uv);\n }\n }\n\n#define USE_COLOR_ALPHA\n#include \n#include \n#include \n#include \n\n gl_PointSize = size;\n\n if (sizeMode == PNTS_SIZE_MODE_ATTENUATED) {\n bool isPerspective = isPerspectiveMatrix(projectionMatrix);\n\n if (isPerspective) {\n gl_PointSize *= scale / -mvPosition.z;\n gl_PointSize = clamp(gl_PointSize, minAttenuatedSize, maxAttenuatedSize);\n }\n }\n\n#include \n#include \n#include \n#include \n}\n",this.fragmentShader="#define USE_COLOR_ALPHA\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nuniform vec3 diffuse;\nuniform float opacity;\n\nuniform bool picking;\nuniform int shape;\n\nvoid main() {\n\n// Early discard (clipping planes and shape)\n#include \n if (shape == PNTS_SHAPE_CIRCLE) {\n //circular rendering in glsl\n if ((length(gl_PointCoord - 0.5) > 0.5)) {\n discard;\n }\n }\n\n#include \n\n vec4 diffuseColor = vec4(diffuse, opacity);\n#include \n#include \n\n#include \n#include \n\n vec3 outgoingLight = diffuseColor.rgb;\n#include // gl_FragColor\n#include \n#include \n#include \n\n}\n",this.userData.needTransparency={},this.gradients=t,this.gradientTexture=new n.CanvasTexture,i.A.setDefineMapping(this,"PNTS_MODE",o),i.A.setDefineMapping(this,"PNTS_SHAPE",a),i.A.setDefineMapping(this,"PNTS_SIZE_MODE",l),this.size=m,i.A.setUniformProperty(this,"mode",g),i.A.setUniformProperty(this,"shape",A),i.A.setUniformProperty(this,"picking",!1),i.A.setUniformProperty(this,"opacity",this.opacity),i.A.setUniformProperty(this,"intensityRange",r),i.A.setUniformProperty(this,"elevationRange",c),i.A.setUniformProperty(this,"angleRange",d),i.A.setUniformProperty(this,"sizeMode",y),i.A.setUniformProperty(this,"scale",b),i.A.setUniformProperty(this,"minAttenuatedSize",v),i.A.setUniformProperty(this,"maxAttenuatedSize",x);const E=new Uint8Array(1024),M=new n.DataTexture(E,256,1,n.RGBAFormat);M.needsUpdate=!0,M.magFilter=n.NearestFilter,i.A.setUniformProperty(this,"classificationTexture",M);const S=new Uint8Array(1024),C=new n.DataTexture(S,256,1,n.RGBAFormat);C.needsUpdate=!0,C.magFilter=n.NearestFilter,i.A.setUniformProperty(this,"discreteTexture",C),this.classificationScheme=p,this.discreteScheme=f,this.recomputeClassification(),this.recomputeDiscreteTexture(),this.gradient=_,i.A.setUniformProperty(this,"gradientTexture",this.gradientTexture)}copy(e){const t=void 0!==e.userData.needTransparency?e.userData.needTransparency:this.userData.needTransparency;return e.isShaderMaterial?super.copy(e):n.Material.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this.userData.needTransparency=t,this}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value.copy(e)}get map(){return this.uniforms.map.value}set map(e){this.uniforms.map.value=e,e&&(e.matrixAutoUpdate&&e.updateMatrix(),this.uniforms.uvTransform.value.copy(e.matrix))}get alphaMap(){return this.uniforms.alphaMap.value}set alphaMap(e){this.uniforms.alphaMap.value=e,e&&(e.matrixAutoUpdate&&e.updateMatrix(),this.uniforms.alphaMapTransform.value.copy(e.matrix))}get size(){return this.uniforms.size.value}set size(e){this.uniforms.size.value=e}get sizeAttenuation(){return this.sizeMode!==l.VALUE}set sizeAttenuation(e){this.sizeMode=e?l.ATTENUATED:l.VALUE}recomputeClassification(){const e=d(this.classificationScheme,this.classificationTexture,256);this.userData.needTransparency[o.CLASSIFICATION]=e,this.dispatchEvent({type:"material_property_changed",target:this.uniforms})}recomputeDiscreteTexture(){const e=d(this.discreteScheme,this.discreteTexture);this.userData.needTransparency[o.RETURN_NUMBER]=e,this.userData.needTransparency[o.RETURN_TYPE]=e,this.userData.needTransparency[o.RETURN_COUNT]=e,this.userData.needTransparency[o.POINT_SOURCE_ID]=e,this.dispatchEvent({type:"material_property_changed",target:this.uniforms})}enablePicking(e){this.picking=e,this.blending=e?n.NoBlending:n.NormalBlending}set gradient(e){this.gradientTexture=function(e){const t=64,r=document.createElement("canvas");r.width=t,r.height=t;const i=r.getContext("2d");i.rect(0,0,t,t);const s=i.createLinearGradient(0,0,t,t);for(let t=0;t{"use strict";r.d(t,{WS:()=>o,p7:()=>c,Is:()=>u});var n=r(39437),i=r(99234),s=r(18590);const o=-1,a=new n.Vector4;class l extends n.EventDispatcher{constructor(e,t){super(),this.layer=t,this.crs=t.parent.tileMatrixSets.indexOf(t.crs),-1==this.crs&&console.error("Unknown crs:",t.crs),this.textures=[],this.offsetScales=[],this.level=o,this.material=e,this._handlerCBEvent=()=>{this.material.layersNeedUpdate=!0},t.addEventListener("visible-property-changed",this._handlerCBEvent),t.addEventListener("opacity-property-changed",this._handlerCBEvent)}get id(){return this.layer.id}get opacity(){return this.layer.opacity}get visible(){return this.layer.visible}initFromParent(e,t){if(e&&e.level>this.level){let r=0;for(const n of t)for(const t of e.textures)if(n.isInside(t.extent)){this.setTexture(r++,t,n.offsetToParent(t.extent));break}}}dispose(){(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&(this.layer.removeEventListener("visible-property-changed",this._handlerCBEvent),this.layer.removeEventListener("opacity-property-changed",this._handlerCBEvent),this._listeners={});for(const e of this.textures)e.isTexture&&e.dispose();this.level=o,this.textures=[],this.offsetScales=[],this.material.layersNeedUpdate=!0}setTexture(e,t,r){this.level=t&&t.extent&&0==e?t.extent.zoom:this.level,this.textures[e]=t||null,this.offsetScales[e]=r,this.material.layersNeedUpdate=!0}setTextures(e,t){this.dispose(!1);for(let r=0,n=e.length;rnull!=e));return a.length?{min:Math.min(...a),max:Math.max(...a)}:{min:1/0,max:-1/0}}(e,t,r);const c=Math.floor(t.z*n);if(c>2){const e=Math.floor(t.z*i),s=Math.floor(t.x*n),u=Math.floor(t.y*i),h=Math.max(Math.floor(c/32),2);for(let t=u;tr.zmax&&(a=r.zmax),l>r.zmax&&(l=r.zmax)),l===-1/0||a===1/0?{min:null,max:null}:{min:a,max:l}}(this.textures[0],this.offsetScales[0],{noDataValue:this.layer.noDataValue,zmin:this.layer.zmin,zmax:this.layer.zmax});this.min==e&&this.max==t||(this.min=e,this.max=t)}}replaceNoDataValueFromTexture(e){const t=this.layer.noDataValue;if(null==t)return;const r=this.textures[0],n=r&&r.image&&r.image.data,i=e.image&&e.image.data;i&&!function(e,t){const r=e.length;return e[0]>t&&e[r-1]>t&&e[Math.sqrt(r)-1]>t&&e[r-Math.sqrt(r)]>t}(i,t)&&function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>0,r=arguments.length>2?arguments[2]:void 0;for(let n=0,i=e.length;nr[function(e,t,r){const n=Math.floor(e/r)/r,i=t.x+e%r/r*t.z,s=t.y+n*t.w;return Math.floor(s*r)*r+Math.floor(i*r)}(e,n,256)]}(e,r,n,a),t)}}},12980:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});const n={FINAL:0,DEPTH:1,ID:2},i={MODES:n,push:function(e,t){const r=e.mode??n.FINAL;if(r==t)return()=>{};const i=e=>t=>{const r=t.material;r&&(r.mode=e)};return e.traverse(i(t)),()=>{e.traverse(i(r))}}}},21311:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});const n=new RegExp("gl_Position.*(?![^]*gl_Position)"),i=new RegExp("[^\\w]*main[^\\w]*(void)?[^\\w]*{"),s={patchMaterialForLogDepthSupport(e){if(e.vertexShader.includes("USE_LOGDEPTHBUF")||e.vertexShader.includes("logdepthbuf_pars_vertex"))return;e.vertexShader=`#include \n#define EPSILON 1e-6\n${e.vertexShader}`;let t=n.exec(e.vertexShader),r=t[0].length+t.index;e.vertexShader=`${e.vertexShader.slice(0,r)}\n#include \n${e.vertexShader.slice(r)}`,e.fragmentShader=`#include \n${e.fragmentShader}`,t=i.exec(e.fragmentShader),r=t[0].length+t.index,e.fragmentShader=`${e.fragmentShader.slice(0,r)}\n#include \n${e.fragmentShader.slice(r)}`,e.defines={USE_LOGDEPTHBUF:1,USE_LOGDEPTHBUF_EXT:1}},unrollLoops:(e,t)=>e.replace(/#pragma unroll_loop\s+for\s*\(\s*int\s+i\s*=\s*([\w\d]+);\s*i\s+<\s+([\w\d]+);\s*i\s*\+\+\s*\)\s*\{\n([^}]*)\}/g,(function(e,r,n,i){let s="";r=r in t?t[r]:parseInt(r,10),n=n in t?t[n]:parseInt(n,10);for(let e=r;e{"use strict";r.d(t,{A:()=>J});var n=r(86406),i=r(86215),s=r(89191),o=r(68632),a=r(8123),l=r(62873),c=r(51429),u=r(18625),h=r(39437);const d=4294967296,p=1/d,f="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8");class m{constructor(e=new Uint8Array(16)){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(e,t,r=this.length){for(;this.pos>3,i=this.pos;this.type=7&r,e(n,t,this),this.pos===i&&this.skip(r)}return t}readMessage(e,t){return this.readFields(e,t,this.readVarint()+this.pos)}readFixed32(){const e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){const e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*d;return this.pos+=8,e}readSFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*d;return this.pos+=8,e}readFloat(){const e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){const e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){const t=this.buf;let r,n;return n=t[this.pos++],r=127&n,n<128?r:(n=t[this.pos++],r|=(127&n)<<7,n<128?r:(n=t[this.pos++],r|=(127&n)<<14,n<128?r:(n=t[this.pos++],r|=(127&n)<<21,n<128?r:(n=t[this.pos],r|=(15&n)<<28,function(e,t,r){const n=r.buf;let i,s;if(s=n[r.pos++],i=(112&s)>>4,s<128)return g(e,i,t);if(s=n[r.pos++],i|=(127&s)<<3,s<128)return g(e,i,t);if(s=n[r.pos++],i|=(127&s)<<10,s<128)return g(e,i,t);if(s=n[r.pos++],i|=(127&s)<<17,s<128)return g(e,i,t);if(s=n[r.pos++],i|=(127&s)<<24,s<128)return g(e,i,t);if(s=n[r.pos++],i|=(1&s)<<31,s<128)return g(e,i,t);throw new Error("Expected varint not more than 10 bytes")}(r,e,this)))))}readVarint64(){return this.readVarint(!0)}readSVarint(){const e=this.readVarint();return e%2==1?(e+1)/-2:e/2}readBoolean(){return Boolean(this.readVarint())}readString(){const e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&f?f.decode(this.buf.subarray(t,e)):function(e,t,r){let n="",i=t;for(;i239?4:t>223?3:t>191?2:1;if(i+c>r)break;1===c?t<128&&(l=t):2===c?(s=e[i+1],128==(192&s)&&(l=(31&t)<<6|63&s,l<=127&&(l=null))):3===c?(s=e[i+1],o=e[i+2],128==(192&s)&&128==(192&o)&&(l=(15&t)<<12|(63&s)<<6|63&o,(l<=2047||l>=55296&&l<=57343)&&(l=null))):4===c&&(s=e[i+1],o=e[i+2],a=e[i+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&(l=(15&t)<<18|(63&s)<<12|(63&o)<<6|63&a,(l<=65535||l>=1114112)&&(l=null))),null===l?(l=65533,c=1):l>65535&&(l-=65536,n+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),n+=String.fromCharCode(l),i+=c}return n}(this.buf,t,e)}readBytes(){const e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t}readPackedVarint(e=[],t){const r=this.readPackedEnd();for(;this.pos127;);else if(2===t)this.pos=this.readVarint()+this.pos;else if(5===t)this.pos+=4;else{if(1!==t)throw new Error(`Unimplemented type: ${t}`);this.pos+=8}}writeTag(e,t){this.writeVarint(e<<3|t)}realloc(e){let t=this.length||16;for(;t268435455||e<0?function(e,t){let r,n;if(e>=0?(r=e%4294967296|0,n=e/4294967296|0):(r=~(-e%4294967296),n=~(-e/4294967296),4294967295^r?r=r+1|0:(r=0,n=n+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,r){r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos]=127&e}(r,0,t),function(e,t){const r=(7&e)<<4;t.buf[t.pos++]|=r|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}(n,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))}writeSVarint(e){this.writeVarint(e<0?2*-e-1:2*e)}writeBoolean(e){this.writeVarint(+e)}writeString(e){e=String(e),this.realloc(4*e.length),this.pos++;const t=this.pos;this.pos=function(e,t,r){for(let n,i,s=0;s55295&&n<57344){if(!i){n>56319||s+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):i=n;continue}if(n<56320){e[r++]=239,e[r++]=191,e[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(e[r++]=239,e[r++]=191,e[r++]=189,i=null);n<128?e[r++]=n:(n<2048?e[r++]=n>>6|192:(n<65536?e[r++]=n>>12|224:(e[r++]=n>>18|240,e[r++]=n>>12&63|128),e[r++]=n>>6&63|128),e[r++]=63&n|128)}return r}(this.buf,e,this.pos);const r=this.pos-t;r>=128&&A(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r}writeFloat(e){this.realloc(4),this.dataView.setFloat32(this.pos,e,!0),this.pos+=4}writeDouble(e){this.realloc(8),this.dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeBytes(e){const t=e.length;this.writeVarint(t),this.realloc(t);for(let r=0;r=128&&A(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n}writeMessage(e,t,r){this.writeTag(e,2),this.writeRawMessage(t,r)}writePackedVarint(e,t){t.length&&this.writeMessage(e,y,t)}writePackedSVarint(e,t){t.length&&this.writeMessage(e,v,t)}writePackedBoolean(e,t){t.length&&this.writeMessage(e,b,t)}writePackedFloat(e,t){t.length&&this.writeMessage(e,x,t)}writePackedDouble(e,t){t.length&&this.writeMessage(e,_,t)}writePackedFixed32(e,t){t.length&&this.writeMessage(e,w,t)}writePackedSFixed32(e,t){t.length&&this.writeMessage(e,E,t)}writePackedFixed64(e,t){t.length&&this.writeMessage(e,M,t)}writePackedSFixed64(e,t){t.length&&this.writeMessage(e,S,t)}writeBytesField(e,t){this.writeTag(e,2),this.writeBytes(t)}writeFixed32Field(e,t){this.writeTag(e,5),this.writeFixed32(t)}writeSFixed32Field(e,t){this.writeTag(e,5),this.writeSFixed32(t)}writeFixed64Field(e,t){this.writeTag(e,1),this.writeFixed64(t)}writeSFixed64Field(e,t){this.writeTag(e,1),this.writeSFixed64(t)}writeVarintField(e,t){this.writeTag(e,0),this.writeVarint(t)}writeSVarintField(e,t){this.writeTag(e,0),this.writeSVarint(t)}writeStringField(e,t){this.writeTag(e,2),this.writeString(t)}writeFloatField(e,t){this.writeTag(e,5),this.writeFloat(t)}writeDoubleField(e,t){this.writeTag(e,1),this.writeDouble(t)}writeBooleanField(e,t){this.writeVarintField(e,+t)}}function g(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function A(e,t,r){const n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(n);for(let t=r.pos-1;t>=e;t--)r.buf[t+n]=r.buf[t]}function y(e,t){for(let r=0;r>3}if(s--,1===i||2===i)o+=e.readSVarint(),a+=e.readSVarint(),1===i&&(n&&r.push(n),n=[]),n&&n.push(new C(o,a));else{if(7!==i)throw new Error(`unknown command ${i}`);n&&n.push(n[0].clone())}}return n&&r.push(n),r}bbox(){const e=this._pbf;e.pos=this._geometry;const t=e.readVarint()+e.pos;let r=1,n=0,i=0,s=0,o=1/0,a=-1/0,l=1/0,c=-1/0;for(;e.pos>3}if(n--,1===r||2===r)i+=e.readSVarint(),s+=e.readSVarint(),ia&&(a=i),sc&&(c=s);else if(7!==r)throw new Error(`unknown command ${r}`)}return[o,l,a,c]}toGeoJSON(e,t,r){const n=this.extent*Math.pow(2,r),i=this.extent*e,s=this.extent*t,o=this.loadGeometry();function a(e){return[360*(e.x+i)/n-180,360/Math.PI*Math.atan(Math.exp((1-2*(e.y+s)/n)*Math.PI))-90]}function l(e){return e.map(a)}let c;if(1===this.type){const e=[];for(const t of o)e.push(t[0]);const t=l(e);c=1===e.length?{type:"Point",coordinates:t[0]}:{type:"MultiPoint",coordinates:t}}else if(2===this.type){const e=o.map(l);c=1===e.length?{type:"LineString",coordinates:e[0]}:{type:"MultiLineString",coordinates:e}}else{if(3!==this.type)throw new Error("unknown feature type");{const e=function(e){const t=e.length;if(t<=1)return[e];const r=[];let n,i;for(let s=0;s=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];const t=this._pbf.readVarint()+this._pbf.pos;return new T(this._pbf,t,this.extent,this._keys,this._values)}}function P(e,t,r){15===e?t.version=r.readVarint():1===e?t.name=r.readString():5===e?t.extent=r.readVarint():2===e?t._features.push(r.pos):3===e?t._keys.push(r.readString()):4===e&&t._values.push(function(e){let t=null;const r=e.readVarint()+e.pos;for(;e.pos>3;t=1===r?e.readString():2===r?e.readFloat():3===r?e.readDouble():4===r?e.readVarint64():5===r?e.readVarint():6===r?e.readSVarint():7===r?e.readBoolean():null}return t}(r))}class L{constructor(e,t){this.layers=e.readFields(D,{},t)}}function D(e,t,r){if(3===e){const e=new B(r,r.readVarint()+r.pos);e.length&&(t[e.name]=e)}}var O=r(48150),N=r(36845),U=r(47155),F=r(52404);const k=O.af.get("EPSG:3857").planarDimensions(),z=new h.Vector3(k.x,k.y,1),G=new h.Vector2,Q=new h.Vector2;function V(e,t,r,n){const i=n*2**r.z,s=n*r.x,o=n*r.y;return new F.A("EPSG:4326",360*(e+s)/i-180,360/Math.PI*Math.atan(Math.exp((180-360*(t+o)/i)*Math.PI/180))-90)}function H(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=t.bindNewGeometry();const i=t.type===N.Xs.POLYGON;r=r&&i,n.properties=e.properties;const s=e._pbf;s.pos=e._geometry;const o=s.readVarint()+s.pos;let a=1,l=0,c=0,u=0,h=0,d=0;for(;s.pos>3}if(l--,1===a||2===a){c+=s.readSVarint(),u+=s.readSVarint(),1===a&&(h&&(r&&d>0&&n.indices.length>0&&(t.updateExtent(n),n=t.bindNewGeometry(),n.properties=e.properties),n.closeSubGeometry(h,t),n.getLastSubGeometry().ccw=d<0),h=0,d=0),h++;const o=V(c,u,e.tileNumbers,e.extent);n.pushCoordinatesValues(t,{x:c,y:u},o),1==h?(Q.set(c,u),Q.coordProj=o,G.set(c,u)):i&&h>1&&(d+=(G.x-c)*(G.y+u),G.set(c,u))}else{if(7!==a)throw new Error(`unknown command ${a}`);h&&(h++,n.pushCoordinatesValues(t,{x:Q.x,y:Q.y},Q.coordProj),i&&(d+=(G.x-Q.x)*(G.y+Q.y)))}}h&&(r&&d>0&&n.indices.length>0&&(t.updateExtent(n),n=t.bindNewGeometry(),n.properties=e.properties),n.closeSubGeometry(h,t),n.getLastSubGeometry().ccw=d<0),t.updateExtent(n)}const j={parse:(e,t)=>(t=(0,U.zv)(t),Promise.resolve(function(e,t){t.out=t.out||{};const r=new L(new m(e)),n=Object.keys(r.layers);if(n.length<1)return;const i=t.extent.col,s=t.extent.zoom,o=t.in.isInverted?t.extent.row:(1<{if(!t.in.layers[e])return;const n=r.layers[e];for(let r=n.length-1;r>=0;r--){const o=n.feature(r);o.tileNumbers={x:i,y:t.extent.row,z:s};const l=t.in.layers[e].filter((e=>e.filterExpression.filter({zoom:s},o)&&s>=e.zoom.min&&st.id===e.id))||(c=a.newFeatureByReference(c),c.id=e.id,c.order=e.order,c.style=t.in.styles[c.id]):(c=a.requestFeatureById(e.id,o.type-1),c.id=e.id,c.order=e.order,c.style=t.in.styles[c.id],H(o,c))}})),a.removeEmptyFeature(),a.features.sort(((e,t)=>e.order-t.order)),a.updateExtent(),a.extent=t.extent,a.isInverted=t.in.isInverted,Promise.resolve(a)}(e,t)))};var q=r(7794),W=r(99487);const Y=new Map([["application/geo+json",s.A.parse],["application/json",s.A.parse],["application/kml",o.A.parse],["application/gpx",l.A.parse],["application/x-protobuf;type=mapbox-vector",j.parse],["application/gtx",c.Ay.parse],["application/isg",u.A.parse],["application/gdf",a.A.parse]]),X={getByArray:()=>{},setByArray:e=>e,clear:()=>{}};class K{constructor(e){e.projection&&(console.warn("Source projection parameter is deprecated, use crs instead."),e.crs=e.crs||e.projection),e.crs&&n.isValid(e.crs),this.crs=e.crs}}let $=0;const J=class extends K{constructor(e){if(super(e),this.isSource=!0,!e.url)throw new Error("New Source: url is required");this.uid=$++,this.url=e.url,this.format=e.format,this.fetcher=e.fetcher||q.A.get(e.format),this.parser=e.parser||Y.get(e.format)||((e,t)=>(e.extent=t.extent,e)),this.isVectorSource=null!=(e.parser||Y.get(e.format)),this.networkOptions=e.networkOptions||{crossOrigin:"anonymous"},this.attribution=e.attribution,this.whenReady=Promise.resolve(),this._featuresCaches={},e.extent&&!e.extent.isExtent?this.extent=new i.A(this.crs,e.extent):this.extent=e.extent}handlingError(e){throw new Error(e)}urlFromExtent(){throw new Error("In extended Source, you have to implement the method urlFromExtent!")}requestToKey(e){return[e.zoom,e.row,e.col]}loadData(e,t){const r=this._featuresCaches[t.crs],n=this.requestToKey(e);let i=r.getByArray(n);return i||(i=r.setByArray(this.fetcher(this.urlFromExtent(e),this.networkOptions).then((r=>this.parser(r,{out:t,in:this,extent:e}))).catch((e=>this.handlingError(e))),n),this.onParsedFile&&i.then((e=>(this.onParsedFile(e),console.warn("Source.onParsedFile was deprecated"),e)))),i}onLayerAdded(e){this._featuresCaches[e.out.crs]||(this._featuresCaches[e.out.crs]=this.isVectorSource?new W.A:X)}onLayerRemoved(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=this._featuresCaches[e.unusedCrs];t&&(t.clear(),delete this._featuresCaches[e.unusedCrs])}extentInsideLimit(){throw new Error("In extented Source, you have to implement the method extentInsideLimit!")}}},10733:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>_});var n=r(39437),i=r(50040),s=r(18590),o=r(87196),a=r(52404),l=r(96027),c=r(41466),u=r(84354);n.Object3D.DEFAULT_UP.set(0,0,1);const h=new n.Vector3,d=new a.A("EPSG:4326",0,0,0),p=new l.A,f=[],m=new c.A,g=new n.Vector3;function A(e){return e-360*Math.floor((e+180)/360)}function y(e){return e.getLayers((e=>e.isTiledGeometryLayer))[0]}class v extends n.Object3D{constructor(){super(),this.seaLevel=new n.Object3D,this.target=new n.Object3D,this.target.rotation.order="ZXY",this.camera=new n.Camera,this.add(this.seaLevel),this.seaLevel.add(this.target),this.target.add(this.camera),this.coord=new a.A("EPSG:4978",0,0),this.targetWorldPosition=new n.Vector3,this.removeAll=()=>{},this._onChangeCallback=null}applyTransformToCamera(e,t){this.proxy?(t.quaternion._onChange(this._onChangeCallback),this.camera.matrixWorld.decompose(this.proxy.position,t.quaternion,t.scale),t.quaternion._onChange((()=>this.removeProxy(e,t)))):this.camera.matrixWorld.decompose(t.position,t.quaternion,t.scale),e.dispatchEvent({type:u.G.CAMERA_MOVED,coord:this.coord,range:this.range,heading:this.heading,tilt:this.tilt})}setProxy(e,t){!this.proxy&&e&&t&&(this.proxy={position:new n.Vector3},Object.keys(t.position).forEach((r=>function(e,t,r,n){r.proxy.position[n]=t.position[n],Object.defineProperty(t.position,n,{get:()=>r.proxy.position[n],set:i=>{r.removeProxy(e,t),t.position[n]=i}})}(e,t,this,r))),this._onChangeCallback=t.quaternion._onChangeCallback,t.quaternion._onChange((()=>this.removeProxy(e,t))))}removeProxy(e,t){this.stop(e),this.proxy&&e&&t&&(Object.keys(t.position).forEach((e=>Object.defineProperty(t.position,e,{value:this.proxy.position[e],writable:!0}))),t.quaternion._onChange(this._onChangeCallback),this.proxy=null)}setTargetFromCoordinate(e,t){t.as(y(e).extent.crs,this.coord);const r=Math.max(0,s.A.getElevationValueAt(y(e),this.coord,s.A.PRECISE_READ_Z)||this.coord.z);this.coord.z=r,this.coord.as(e.referenceCrs).toVector3(h),"EPSG:4978"==e.referenceCrs?(this.lookAt(h),this.seaLevel.position.set(0,0,h.length()-r)):(this.position.set(h.x,h.y,0),this.seaLevel.position.set(0,0,0)),this.target.position.set(0,0,r)}setFromPositions(e,t){this.setTargetFromCoordinate(e,new a.A(e.referenceCrs,h)),this.target.rotation.set(0,0,0),this.updateMatrixWorld(!0),this.camera.position.copy(t),this.target.worldToLocal(this.camera.position);const r=this.camera.position.length();this.target.rotation.x=Math.asin(this.camera.position.z/r);const i=n.MathUtils.clamp(this.camera.position.y/(Math.cos(this.target.rotation.x)*r),-1,1);this.target.rotation.z=Math.sign(-this.camera.position.x||1)*Math.acos(i),this.camera.position.set(0,r,0)}applyParams(e,t){t.coord&&this.setTargetFromCoordinate(e,t.coord),null!=t.tilt&&(this.target.rotation.x=n.MathUtils.degToRad(t.tilt)),null!=t.heading&&(this.target.rotation.z=n.MathUtils.degToRad(-A(t.heading+180))),t.range&&this.camera.position.set(0,t.range,0),this.camera.rotation.set(.5*-Math.PI,0,Math.PI),this.updateMatrixWorld(!0),this.targetWorldPosition.setFromMatrixPosition(this.seaLevel.matrixWorld)}getParams(){return{coord:this.coord.clone(),tilt:this.tilt,heading:this.heading,range:this.range,targetWorldPosition:this.targetWorldPosition}}setfromCamera(e,t,r){t.updateMatrixWorld(!0),null==r&&(r=e.getPickingPositionFromDepth()||function(e,t){const r=new n.Vector3(0,0,.5);if(r.unproject(t),r.sub(t.position).normalize(),"EPSG:4978"==e.referenceCrs)return p.intersection({direction:r,origin:t.position});{const e=t.position.z/r.z;return r.multiplyScalar(e).add(t.position)}}(e,t));const i=r&&!isNaN(r.x)?t.position.distanceTo(r):100;t.localToWorld(h.set(0,0,-i)),this.setFromPositions(e,t.position)}copyObject3D(e){return this.copy(e,!1),this.seaLevel.copy(e.seaLevel,!1),this.target.copy(e.target,!1),this.camera.copy(e.camera),this}animateCameraToLookAtTarget(e,t,r){r.easing=r.easing||i.Ay.Easing.Quartic.InOut,this.setfromCamera(e,t);const s=new i.Ay.Group;this.start=(this.start||new v).copyObject3D(this),this.end=(this.end||new v).copyObject3D(this);const a=r.time||2500,l={t:0},c=[],u=(()=>{let e,t;return{promise:new Promise(((r,n)=>{e=r,t=n})),resolve:e,reject:t}})();this.addPlaceTargetOnGround(e,t,r.coord,l),this.end.applyParams(e,r);const h=this.end.target.rotation.z-this.start.target.rotation.z;return Math.abs(h)>Math.PI&&(this.end.target.rotation.z=this.start.target.rotation.z+h-2*Math.sign(h)*Math.PI),c.push(new i.Ay.Tween(l).to({t:1},a).easing(r.easing).onUpdate((t=>{"EPSG:4978"==e.referenceCrs&&this.quaternion.slerpQuaternions(this.start.quaternion,this.end.quaternion,t.t),this.camera.quaternion.slerpQuaternions(this.start.camera.quaternion,this.end.camera.quaternion,t.t),this.target.rotation.set(0,0,0),this.target.rotateZ(n.MathUtils.lerp(this.start.target.rotation.z,this.end.target.rotation.z,t.t)),this.target.rotateX(n.MathUtils.lerp(this.start.target.rotation.x,this.end.target.rotation.x,t.t))}))),"EPSG:4978"!=e.referenceCrs&&c.push(new i.Ay.Tween(this.position).to(this.end.position,a).easing(r.easing)),c.push(new i.Ay.Tween(this.seaLevel.position).to(this.end.seaLevel.position,a).easing(r.easing)),c.push(new i.Ay.Tween(this.camera.position).to(this.end.camera.position,a).easing(r.easing)),s.add(...c),this.animationFrameRequester=()=>{s.update(),this.updateMatrixWorld(!0),this.applyTransformToCamera(e,t),this.targetWorldPosition.setFromMatrixPosition(this.seaLevel.matrixWorld),r.callback&&r.callback(this),d.crs=e.referenceCrs,d.setFromVector3(this.targetWorldPosition).as(y(e).extent.crs,this.coord),e.notifyChange(t)},this.removeAll=function(t){this.removeAll=()=>{},s.removeAll(),this.animationFrameRequester&&e.removeFrameRequester(o.n7.BEFORE_RENDER,this.animationFrameRequester),u.resolve(void 0!==t),this.animationFrameRequester=null},c[c.length-1].onComplete(this.removeAll),c.forEach((e=>e.start())),e.addFrameRequester(o.n7.BEFORE_RENDER,this.animationFrameRequester),e.notifyChange(t),u}stop(e){this.removePlaceTargetOnGround(e),this.removeAll()}addPlaceTargetOnGround(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{t:1};if(this.removePlaceTargetOnGround(e),e&&t){const i=this.target.position.z;this.placeTargetOnGround=()=>{const o=Math.max(0,s.A.getElevationValueAt(y(e),r||this.coord,s.A.PRECISE_READ_Z)||0);this.target.position.z=i*(1-n.t)+o*n.t,this.target.updateMatrixWorld(!0),this.applyTransformToCamera(e,t)},this.placeTargetOnGround(),e.addFrameRequester(o.n7.BEFORE_RENDER,this.placeTargetOnGround)}}removePlaceTargetOnGround(e){e&&this.placeTargetOnGround&&(e.removeFrameRequester(o.n7.BEFORE_RENDER,this.placeTargetOnGround),this.placeTargetOnGround=null)}get tilt(){return n.MathUtils.radToDeg(this.target.rotation.x)}get heading(){return-A(n.MathUtils.radToDeg(this.target.rotation.z)+180)}get range(){return this.camera.position.y}}function x(e){return f[e.uuid]=f[e.uuid]||new v,f[e.uuid]}const _={defaultStopPlaceOnGroundAtEnd:!1,Easing:i.Ay.Easing,stop(e,t){x(t).stop(e)},getTransformCameraLookingAtTarget(e,t,r){const n=x(t);return n.setfromCamera(e,t,r),n.getParams()},transformCameraToLookAtTarget(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r.isExtent&&(r=this.getCameraTransformOptionsFromExtent(e,t,r)),r.proxy=void 0===r.proxy||r.proxy;const n=x(t);return n.stop(e),n.setfromCamera(e,t),r.proxy&&n.setProxy(e,t),n.applyParams(e,r),n.addPlaceTargetOnGround(e,t,r.coord),n.applyTransformToCamera(e,t),e.notifyChange(t),Promise.resolve(n.getParams())},getCameraTransformOptionsFromExtent(e,t,r){const i={coord:new a.A(r.crs,0,0,0),heading:0,tilt:e.isPlanarView?90:89.9};let s;if(e.isGlobeView?(r=r.as("EPSG:4326"),m.setFromExtent(r),m.box3D.getSize(g),s={x:g.y,y:g.x}):s=(r=r.as(e.referenceCrs)).planarDimensions(),r.center(i.coord),t.isOrthographicCamera)s.x/s.y>t.aspect?t.zoom=(t.right-t.left)/s.x:t.zoom=(t.top-t.bottom)/s.y,t.updateProjectionMatrix(),i.range=1e3;else if(t.isPerspectiveCamera){const r=n.MathUtils.degToRad(t.fov);if(s.x/s.y>t.aspect){const t=.5*e.domElement.clientHeight/Math.tan(.5*r),n=2*Math.atan(.5*e.domElement.clientWidth/t);i.range=s.x/(2*Math.tan(.5*n))}else i.range=s.y/(2*Math.tan(.5*r))}return i},animateCameraToLookAtTarget(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r.proxy=void 0===r.proxy||r.proxy;const n=x(t);return n.stop(e),r.proxy&&n.setProxy(e,t),n.animateCameraToLookAtTarget(e,t,r).promise.then((t=>{const i=void 0===r.stopPlaceOnGroundAtEnd?this.defaultStopPlaceOnGroundAtEnd:r.stopPlaceOnGroundAtEnd,s=n.getParams();return i&&n.stop(e),s.finished=t,s}))},sequenceAnimationsToLookAtTarget(e,t){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:[{}]).map((r=>()=>this.animateCameraToLookAtTarget(e,t,r))).reduce(((e,t)=>e.then((e=>!e.length||e[e.length-1].finished?t().then(Array.prototype.concat.bind(e)):Promise.resolve([{finished:!1}])))),Promise.resolve([]))},getDiffParams(e,t){if(!e||!t)return;let r;return Math.abs(e.range-t.range)/e.range>.001&&(r=r||{},r.range={previous:e.range,new:t.range}),Math.abs(e.tilt-t.tilt)>.1&&(r=r||{},r.tilt={previous:e.tilt,new:t.tilt}),Math.abs(e.heading-t.heading)>.1&&(r=r||{},r.heading={previous:e.heading,new:t.heading}),(Math.abs(e.coord.x-t.coord.x)>1e-6||Math.abs(e.coord.y-t.coord.y)>1e-6)&&(r=r||{},r.coord={previous:e.coord,new:t.coord}),r}}},18590:(e,t,r)=>{"use strict";r.d(t,{A:()=>a,N:()=>p});var n=r(39437),i=r(52404);const s={v:new n.Vector3,coord1:new i.A("EPSG:4978"),coord2:new i.A("EPSG:4978"),offset:new n.Vector2};function o(e,t,r,n,o,l){let c=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{},u=arguments.length>8?arguments[8]:void 0;const h=(arguments.length>7?arguments[7]:void 0)||new i.A(n);c.worldFromLocal?h.setFromVector3(s.v.copy(o).applyMatrix4(c.worldFromLocal)):h.setFromVector3(o);const d=a.getTerrainObjectAt(e,h,t,r,u);if(d)return d.coord.z+=l,d.coord.as(n,s.coord2).toVector3(o),c.localFromWorld&&o.applyMatrix4(c.localFromWorld),{id:d.texture.id,version:d.texture.version,tile:d.tile}}const a={getElevationValueAt(e,t){const r=A(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,t,(arguments.length>3?arguments[3]:void 0)||e.level0Nodes);if(r)return r.coord.z},getTerrainObjectAt(e,t){let r=arguments.length>4?arguments[4]:void 0;return A(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,t,(arguments.length>3?arguments[3]:void 0)||e.level0Nodes,r)},FAST_READ_Z:0,PRECISE_READ_Z:1,placeObjectOnGround:function(e,t,r){let s,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},c=arguments.length>4?arguments[4]:void 0;if(console.warn("placeObjectOnGround has been deprecated because it needs review and test"),s=c?c.concat(e.level0Nodes):e.level0Nodes,l.modifyGeometry){const c={worldFromLocal:r.matrixWorld,localFromWorld:(new n.Matrix4).copy(r.matrixWorld).invert()},u=r.geometry;if(u.vertices){l.cache&&(l.cache.length=u.vertices.length);let r=!0;const n=new i.A(t);for(let i=0;i=0?t:void 0}}let c;function u(e,t){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;s2&&void 0!==arguments[2]?arguments[2]:new n.Vector2;if(e.crs!=t.crs)throw new Error(`Unsupported mix: ${e.crs} and ${t.crs}`);t.planarDimensions(g);const i=(e.x-t.west)/g.x,s=(t.north-e.y)/g.y;r.set(i,s)}(o,a.extent,m.offset),o.z=1==t?function(e,t,r,i,s){const o=i.x/s.x/16;let a=Math.floor(r.x/o)*o,l=Math.floor(r.y/o)*o;1==a&&(a-=o),1==l&&(l-=o);const c=a,u=a+o,h=l,d=l+o,m=(r.x-a)/o,g=(r.y-l)/o,A=new n.Triangle(new n.Vector3(c,d),new n.Vector3(u,h),1==g||m/(1-g)>=1?new n.Vector3(u,d):new n.Vector3(c,h));A.getBarycoord(new n.Vector3(r.x,r.y),f);const y=e.attachedLayers.filter((e=>e.isElevationLayer))[0],v=p(y,t,A.a.x,A.a.y),x=p(y,t,A.b.x,A.b.y),_=p(y,t,A.c.x,A.c.y);return v*f.x+x*f.y+_*f.z}(e,A,m.offset,c.extent.planarDimensions(),a.extent.planarDimensions()):function(e,t,r){return function(e,t,r,n){const i=h(t,r,n);return u(e,t,i.wu<=0?i.u1:i.u2,i.wv<=0?i.v1:i.v2)}(e.attachedLayers.filter((e=>e.isElevationLayer))[0],t,r.x,r.y)}(e,A,m.offset),null!=o.z?{coord:o,texture:A,tile:c}:void 0}},19073:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var n=r(36845);function i(e,t,r,n,i,s){const o=e.x,a=e.y;for(let e=n+s,l=n;e=-r&&p<=d+r&&Math.abs(h*o-u*a+s*i-c*n)/d<=r)return!0}return!1}function s(e,t,r,s,o,a,l){if(t==n.Xs.LINE&&i(e,r,s,o,a,l))return!0;if(t==n.Xs.POLYGON&&function(e,t,r,n,s,o){const a=e.x,l=e.y;let c=!1;for(let u=n,h=n+s-o;ul!=d>l&&a<(o-n)*(l-s)/(d-s)+n&&(c=!c)}return c}(e,r,s,o,a,l))return!0;if(t==n.Xs.POINT){const t=function(e,t,r,n,i,s){const o=e.x,a=e.y;let l,c=r*r;for(let e=n;e2&&void 0!==arguments[2]?arguments[2]:.1;const n=[];if(e.as(t.crs,a),a.applyMatrix4(t.matrixWorldInverse),t.extent.isPointInside(a,r))if(t.isFeatureCollection){r*=Math.sqrt(t.scale.x**2+t.scale.y**2);for(const e of t.features)e.extent&&!e.extent.isPointInside(a,r)||o(a,e,r,n)}else t.geometries&&o(a,t,r,n);return n}}},20620:(e,t,r)=>{"use strict";function n(e){const t=function(e){const t=[];return e.alphaMap&&t.push(e.map),e.aoMap&&t.push(e.map),e.bumpMap&&t.push(e.bumpMap),e.displacementMap&&t.push(e.bumpMap),e.emissiveMap&&t.push(e.emissiveMap),e.envMap&&t.push(e.envMap),e.lightMap&&t.push(e.envMap),e.map&&t.push(e.map),e.metalnessMap&&t.push(e.map),e.normalMap&&t.push(e.map),e.roughnessMap&&t.push(e.map),e.specularMap&&t.push(e.specularMap),t}(e);if(Array.isArray(e))for(const t of e)t.dispose();else e.dispose();for(let e=0;e-1*(e.start-t.start)));const t=e.geometry.groups.length-1;let r=e.geometry.groups[t].materialIndex;const n=[r];for(let i=t-1;i>=0;i--){const t=e.geometry.groups[i];t.materialIndex===r?(e.geometry.groups[i+1].count+=t.count,e.geometry.groups.splice(i,1)):(r=t.materialIndex,n.push(r))}for(let t=e.material.length-1;t>=0;t--)n.includes(t)||(e.geometry.groups.forEach((e=>{e.materialIndex>t&&(e.materialIndex-=1)})),e.material.splice(t,1))}r.d(t,{A:()=>n,W:()=>i})},39437:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ACESFilmicToneMapping:()=>ie,AddEquation:()=>w,AddOperation:()=>Z,AdditiveAnimationBlendMode:()=>Qt,AdditiveBlending:()=>v,AgXToneMapping:()=>oe,AlphaFormat:()=>Ge,AlwaysCompare:()=>Rr,AlwaysDepth:()=>H,AlwaysStencilFunc:()=>br,AmbientLight:()=>vp,AnimationAction:()=>cf,AnimationClip:()=>Vd,AnimationLoader:()=>Jd,AnimationMixer:()=>hf,AnimationObjectGroup:()=>lf,AnimationUtils:()=>Rd,ArcCurve:()=>Xu,ArrayCamera:()=>Xl,ArrowHelper:()=>im,AttachedBindMode:()=>le,Audio:()=>qp,AudioAnalyser:()=>Jp,AudioContext:()=>Lp,AudioListener:()=>jp,AudioLoader:()=>Dp,AxesHelper:()=>sm,BackSide:()=>m,BasicDepthPacking:()=>qt,BasicShadowMap:()=>u,BatchedMesh:()=>vu,Bone:()=>Gc,BooleanKeyframeTrack:()=>Nd,Box2:()=>Mf,Box3:()=>Fn,Box3Helper:()=>Zf,BoxGeometry:()=>Xs,BoxHelper:()=>Jf,BufferAttribute:()=>ds,BufferGeometry:()=>Is,BufferGeometryLoader:()=>Sp,ByteType:()=>Re,Cache:()=>jd,Camera:()=>to,CameraHelper:()=>Xf,CanvasTexture:()=>qu,CapsuleGeometry:()=>gh,CatmullRomCurve3:()=>th,CineonToneMapping:()=>ne,CircleGeometry:()=>Ah,ClampToEdgeWrapping:()=>Ae,Clock:()=>kp,Color:()=>es,ColorKeyframeTrack:()=>Ud,ColorManagement:()=>An,CompressedArrayTexture:()=>Hu,CompressedCubeTexture:()=>ju,CompressedTexture:()=>Vu,CompressedTextureLoader:()=>Zd,ConeGeometry:()=>vh,ConstantAlphaFactor:()=>G,ConstantColorFactor:()=>k,Controls:()=>am,CubeCamera:()=>ao,CubeReflectionMapping:()=>he,CubeRefractionMapping:()=>de,CubeTexture:()=>lo,CubeTextureLoader:()=>tp,CubeUVReflectionMapping:()=>me,CubicBezierCurve:()=>sh,CubicBezierCurve3:()=>oh,CubicInterpolant:()=>Pd,CullFaceBack:()=>a,CullFaceFront:()=>l,CullFaceFrontBack:()=>c,CullFaceNone:()=>o,Curve:()=>Wu,CurvePath:()=>ph,CustomBlending:()=>b,CustomToneMapping:()=>se,CylinderGeometry:()=>yh,Cylindrical:()=>bf,Data3DTexture:()=>Pn,DataArrayTexture:()=>Rn,DataTexture:()=>Qc,DataTextureLoader:()=>rp,DataUtils:()=>cs,DecrementStencilOp:()=>hr,DecrementWrapStencilOp:()=>pr,DefaultLoadingManager:()=>Wd,DepthFormat:()=>qe,DepthStencilFormat:()=>We,DepthTexture:()=>ra,DetachedBindMode:()=>ce,DirectionalLight:()=>yp,DirectionalLightHelper:()=>qf,DiscreteInterpolant:()=>Dd,DisplayP3ColorSpace:()=>tr,DodecahedronGeometry:()=>_h,DoubleSide:()=>g,DstAlphaFactor:()=>D,DstColorFactor:()=>N,DynamicCopyUsage:()=>Fr,DynamicDrawUsage:()=>Pr,DynamicReadUsage:()=>Or,EdgesGeometry:()=>Sh,EllipseCurve:()=>Yu,EqualCompare:()=>Mr,EqualDepth:()=>W,EqualStencilFunc:()=>Ar,EquirectangularReflectionMapping:()=>pe,EquirectangularRefractionMapping:()=>fe,Euler:()=>_i,EventDispatcher:()=>Hr,ExtrudeGeometry:()=>td,FileLoader:()=>$d,Float16BufferAttribute:()=>xs,Float32BufferAttribute:()=>_s,FloatType:()=>Oe,Fog:()=>ac,FogExp2:()=>oc,FramebufferTexture:()=>Qu,FrontSide:()=>f,Frustum:()=>Ao,GLBufferAttribute:()=>gf,GLSL1:()=>zr,GLSL3:()=>Gr,GreaterCompare:()=>Cr,GreaterDepth:()=>X,GreaterEqualCompare:()=>Ir,GreaterEqualDepth:()=>Y,GreaterEqualStencilFunc:()=>_r,GreaterStencilFunc:()=>vr,GridHelper:()=>Gf,Group:()=>Kl,HalfFloatType:()=>Ne,HemisphereLight:()=>sp,HemisphereLightHelper:()=>zf,IcosahedronGeometry:()=>nd,ImageBitmapLoader:()=>Bp,ImageLoader:()=>ep,ImageUtils:()=>_n,IncrementStencilOp:()=>ur,IncrementWrapStencilOp:()=>dr,InstancedBufferAttribute:()=>qc,InstancedBufferGeometry:()=>Mp,InstancedInterleavedBuffer:()=>mf,InstancedMesh:()=>eu,Int16BufferAttribute:()=>gs,Int32BufferAttribute:()=>ys,Int8BufferAttribute:()=>ps,IntType:()=>Le,InterleavedBuffer:()=>cc,InterleavedBufferAttribute:()=>hc,Interpolant:()=>Bd,InterpolateDiscrete:()=>Ot,InterpolateLinear:()=>Nt,InterpolateSmooth:()=>Ut,InvertStencilOp:()=>fr,KeepStencilOp:()=>lr,KeyframeTrack:()=>Od,LOD:()=>Rc,LatheGeometry:()=>mh,Layers:()=>bi,LessCompare:()=>Er,LessDepth:()=>j,LessEqualCompare:()=>Sr,LessEqualDepth:()=>q,LessEqualStencilFunc:()=>yr,LessStencilFunc:()=>gr,Light:()=>ip,LightProbe:()=>bp,Line:()=>Tu,Line3:()=>Tf,LineBasicMaterial:()=>xu,LineCurve:()=>ah,LineCurve3:()=>lh,LineDashedMaterial:()=>Ed,LineLoop:()=>Lu,LineSegments:()=>Pu,LinearDisplayP3ColorSpace:()=>rr,LinearFilter:()=>Ee,LinearInterpolant:()=>Ld,LinearMipMapLinearFilter:()=>Te,LinearMipMapNearestFilter:()=>Se,LinearMipmapLinearFilter:()=>Ce,LinearMipmapNearestFilter:()=>Me,LinearSRGBColorSpace:()=>er,LinearToneMapping:()=>te,LinearTransfer:()=>nr,Loader:()=>Yd,LoaderUtils:()=>Ep,LoadingManager:()=>qd,LoopOnce:()=>Pt,LoopPingPong:()=>Dt,LoopRepeat:()=>Lt,LuminanceAlphaFormat:()=>je,LuminanceFormat:()=>He,MOUSE:()=>i,Material:()=>ns,MaterialLoader:()=>wp,MathUtils:()=>tn,Matrix2:()=>wf,Matrix3:()=>nn,Matrix4:()=>hi,MaxEquation:()=>C,Mesh:()=>Ws,MeshBasicMaterial:()=>is,MeshDepthMaterial:()=>Gl,MeshDistanceMaterial:()=>Ql,MeshLambertMaterial:()=>bd,MeshMatcapMaterial:()=>wd,MeshNormalMaterial:()=>_d,MeshPhongMaterial:()=>vd,MeshPhysicalMaterial:()=>yd,MeshStandardMaterial:()=>Ad,MeshToonMaterial:()=>xd,MinEquation:()=>S,MirroredRepeatWrapping:()=>ye,MixOperation:()=>J,MultiplyBlending:()=>_,MultiplyOperation:()=>$,NearestFilter:()=>ve,NearestMipMapLinearFilter:()=>we,NearestMipMapNearestFilter:()=>_e,NearestMipmapLinearFilter:()=>be,NearestMipmapNearestFilter:()=>xe,NeutralToneMapping:()=>ae,NeverCompare:()=>wr,NeverDepth:()=>V,NeverStencilFunc:()=>mr,NoBlending:()=>A,NoColorSpace:()=>Jt,NoToneMapping:()=>ee,NormalAnimationBlendMode:()=>Gt,NormalBlending:()=>y,NotEqualCompare:()=>Tr,NotEqualDepth:()=>K,NotEqualStencilFunc:()=>xr,NumberKeyframeTrack:()=>Fd,Object3D:()=>Fi,ObjectLoader:()=>Cp,ObjectSpaceNormalMap:()=>$t,OctahedronGeometry:()=>id,OneFactor:()=>I,OneMinusConstantAlphaFactor:()=>Q,OneMinusConstantColorFactor:()=>z,OneMinusDstAlphaFactor:()=>O,OneMinusDstColorFactor:()=>U,OneMinusSrcAlphaFactor:()=>L,OneMinusSrcColorFactor:()=>B,OrthographicCamera:()=>Lo,P3Primaries:()=>or,PCFShadowMap:()=>h,PCFSoftShadowMap:()=>d,PMREMGenerator:()=>Ho,Path:()=>fh,PerspectiveCamera:()=>so,Plane:()=>fo,PlaneGeometry:()=>xo,PlaneHelper:()=>em,PointLight:()=>gp,PointLightHelper:()=>Nf,Points:()=>ku,PointsMaterial:()=>Du,PolarGridHelper:()=>Qf,PolyhedronGeometry:()=>xh,PositionalAudio:()=>$p,PropertyBinding:()=>af,PropertyMixer:()=>Zp,QuadraticBezierCurve:()=>ch,QuadraticBezierCurve3:()=>uh,Quaternion:()=>Dn,QuaternionKeyframeTrack:()=>zd,QuaternionLinearInterpolant:()=>kd,RED_GREEN_RGTC2_Format:()=>Rt,RED_RGTC1_Format:()=>Tt,REVISION:()=>n,RGBADepthPacking:()=>Wt,RGBAFormat:()=>Ve,RGBAIntegerFormat:()=>Ze,RGBA_ASTC_10x10_Format:()=>bt,RGBA_ASTC_10x5_Format:()=>vt,RGBA_ASTC_10x6_Format:()=>xt,RGBA_ASTC_10x8_Format:()=>_t,RGBA_ASTC_12x10_Format:()=>wt,RGBA_ASTC_12x12_Format:()=>Et,RGBA_ASTC_4x4_Format:()=>ht,RGBA_ASTC_5x4_Format:()=>dt,RGBA_ASTC_5x5_Format:()=>pt,RGBA_ASTC_6x5_Format:()=>ft,RGBA_ASTC_6x6_Format:()=>mt,RGBA_ASTC_8x5_Format:()=>gt,RGBA_ASTC_8x6_Format:()=>At,RGBA_ASTC_8x8_Format:()=>yt,RGBA_BPTC_Format:()=>Mt,RGBA_ETC2_EAC_Format:()=>ut,RGBA_PVRTC_2BPPV1_Format:()=>at,RGBA_PVRTC_4BPPV1_Format:()=>ot,RGBA_S3TC_DXT1_Format:()=>tt,RGBA_S3TC_DXT3_Format:()=>rt,RGBA_S3TC_DXT5_Format:()=>nt,RGBDepthPacking:()=>Yt,RGBFormat:()=>Qe,RGBIntegerFormat:()=>Je,RGB_BPTC_SIGNED_Format:()=>St,RGB_BPTC_UNSIGNED_Format:()=>Ct,RGB_ETC1_Format:()=>lt,RGB_ETC2_Format:()=>ct,RGB_PVRTC_2BPPV1_Format:()=>st,RGB_PVRTC_4BPPV1_Format:()=>it,RGB_S3TC_DXT1_Format:()=>et,RGDepthPacking:()=>Xt,RGFormat:()=>Ke,RGIntegerFormat:()=>$e,RawShaderMaterial:()=>gd,Ray:()=>ui,Raycaster:()=>yf,Rec709Primaries:()=>sr,RectAreaLight:()=>xp,RedFormat:()=>Ye,RedIntegerFormat:()=>Xe,ReinhardToneMapping:()=>re,RenderTarget:()=>Tn,RepeatWrapping:()=>ge,ReplaceStencilOp:()=>cr,ReverseSubtractEquation:()=>M,RingGeometry:()=>sd,SIGNED_RED_GREEN_RGTC2_Format:()=>Bt,SIGNED_RED_RGTC1_Format:()=>It,SRGBColorSpace:()=>Zt,SRGBTransfer:()=>ir,Scene:()=>lc,ShaderChunk:()=>_o,ShaderLib:()=>wo,ShaderMaterial:()=>eo,ShadowMaterial:()=>md,Shape:()=>Ch,ShapeGeometry:()=>od,ShapePath:()=>om,ShapeUtils:()=>Jh,ShortType:()=>Be,Skeleton:()=>jc,SkeletonHelper:()=>Df,SkinnedMesh:()=>zc,Source:()=>wn,Sphere:()=>ri,SphereGeometry:()=>ad,Spherical:()=>_f,SphericalHarmonics3:()=>_p,SplineCurve:()=>hh,SpotLight:()=>hp,SpotLightHelper:()=>Rf,Sprite:()=>Sc,SpriteMaterial:()=>dc,SrcAlphaFactor:()=>P,SrcAlphaSaturateFactor:()=>F,SrcColorFactor:()=>R,StaticCopyUsage:()=>Ur,StaticDrawUsage:()=>Br,StaticReadUsage:()=>Dr,StereoCamera:()=>Fp,StreamCopyUsage:()=>kr,StreamDrawUsage:()=>Lr,StreamReadUsage:()=>Nr,StringKeyframeTrack:()=>Gd,SubtractEquation:()=>E,SubtractiveBlending:()=>x,TOUCH:()=>s,TangentSpaceNormalMap:()=>Kt,TetrahedronGeometry:()=>ld,Texture:()=>Sn,TextureLoader:()=>np,TextureUtils:()=>ql,TorusGeometry:()=>cd,TorusKnotGeometry:()=>ud,Triangle:()=>Xi,TriangleFanDrawMode:()=>jt,TriangleStripDrawMode:()=>Ht,TrianglesDrawMode:()=>Vt,TubeGeometry:()=>hd,UVMapping:()=>ue,Uint16BufferAttribute:()=>As,Uint32BufferAttribute:()=>vs,Uint8BufferAttribute:()=>fs,Uint8ClampedBufferAttribute:()=>ms,Uniform:()=>df,UniformsGroup:()=>ff,UniformsLib:()=>bo,UniformsUtils:()=>Zs,UnsignedByteType:()=>Ie,UnsignedInt248Type:()=>ke,UnsignedInt5999Type:()=>ze,UnsignedIntType:()=>De,UnsignedShort4444Type:()=>Ue,UnsignedShort5551Type:()=>Fe,UnsignedShortType:()=>Pe,VSMShadowMap:()=>p,Vector2:()=>rn,Vector3:()=>On,Vector4:()=>Cn,VectorKeyframeTrack:()=>Qd,VideoTexture:()=>Gu,WebGL3DRenderTarget:()=>Ln,WebGLArrayRenderTarget:()=>Bn,WebGLCoordinateSystem:()=>Qr,WebGLCubeRenderTarget:()=>co,WebGLMultipleRenderTargets:()=>lm,WebGLRenderTarget:()=>In,WebGLRenderer:()=>sc,WebGLUtils:()=>Yl,WebGPUCoordinateSystem:()=>Vr,WireframeGeometry:()=>dd,WrapAroundEnding:()=>zt,ZeroCurvatureEnding:()=>Ft,ZeroFactor:()=>T,ZeroSlopeEnding:()=>kt,ZeroStencilOp:()=>ar,createCanvasElement:()=>un});const n="168",i={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},s={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},o=0,a=1,l=2,c=3,u=0,h=1,d=2,p=3,f=0,m=1,g=2,A=0,y=1,v=2,x=3,_=4,b=5,w=100,E=101,M=102,S=103,C=104,T=200,I=201,R=202,B=203,P=204,L=205,D=206,O=207,N=208,U=209,F=210,k=211,z=212,G=213,Q=214,V=0,H=1,j=2,q=3,W=4,Y=5,X=6,K=7,$=0,J=1,Z=2,ee=0,te=1,re=2,ne=3,ie=4,se=5,oe=6,ae=7,le="attached",ce="detached",ue=300,he=301,de=302,pe=303,fe=304,me=306,ge=1e3,Ae=1001,ye=1002,ve=1003,xe=1004,_e=1004,be=1005,we=1005,Ee=1006,Me=1007,Se=1007,Ce=1008,Te=1008,Ie=1009,Re=1010,Be=1011,Pe=1012,Le=1013,De=1014,Oe=1015,Ne=1016,Ue=1017,Fe=1018,ke=1020,ze=35902,Ge=1021,Qe=1022,Ve=1023,He=1024,je=1025,qe=1026,We=1027,Ye=1028,Xe=1029,Ke=1030,$e=1031,Je=1032,Ze=1033,et=33776,tt=33777,rt=33778,nt=33779,it=35840,st=35841,ot=35842,at=35843,lt=36196,ct=37492,ut=37496,ht=37808,dt=37809,pt=37810,ft=37811,mt=37812,gt=37813,At=37814,yt=37815,vt=37816,xt=37817,_t=37818,bt=37819,wt=37820,Et=37821,Mt=36492,St=36494,Ct=36495,Tt=36283,It=36284,Rt=36285,Bt=36286,Pt=2200,Lt=2201,Dt=2202,Ot=2300,Nt=2301,Ut=2302,Ft=2400,kt=2401,zt=2402,Gt=2500,Qt=2501,Vt=0,Ht=1,jt=2,qt=3200,Wt=3201,Yt=3202,Xt=3203,Kt=0,$t=1,Jt="",Zt="srgb",er="srgb-linear",tr="display-p3",rr="display-p3-linear",nr="linear",ir="srgb",sr="rec709",or="p3",ar=0,lr=7680,cr=7681,ur=7682,hr=7683,dr=34055,pr=34056,fr=5386,mr=512,gr=513,Ar=514,yr=515,vr=516,xr=517,_r=518,br=519,wr=512,Er=513,Mr=514,Sr=515,Cr=516,Tr=517,Ir=518,Rr=519,Br=35044,Pr=35048,Lr=35040,Dr=35045,Or=35049,Nr=35041,Ur=35046,Fr=35050,kr=35042,zr="100",Gr="300 es",Qr=2e3,Vr=2001;class Hr{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});const r=this._listeners;void 0===r[e]&&(r[e]=[]),-1===r[e].indexOf(t)&&r[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;const r=this._listeners;return void 0!==r[e]&&-1!==r[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;const r=this._listeners[e];if(void 0!==r){const e=r.indexOf(t);-1!==e&&r.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;const t=this._listeners[e.type];if(void 0!==t){e.target=this;const r=t.slice(0);for(let t=0,n=r.length;t>8&255]+jr[e>>16&255]+jr[e>>24&255]+"-"+jr[255&t]+jr[t>>8&255]+"-"+jr[t>>16&15|64]+jr[t>>24&255]+"-"+jr[63&r|128]+jr[r>>8&255]+"-"+jr[r>>16&255]+jr[r>>24&255]+jr[255&n]+jr[n>>8&255]+jr[n>>16&255]+jr[n>>24&255]).toLowerCase()}function Kr(e,t,r){return Math.max(t,Math.min(r,e))}function $r(e,t){return(e%t+t)%t}function Jr(e,t,r){return(1-r)*e+r*t}function Zr(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}function en(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(4294967295*e);case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int32Array:return Math.round(2147483647*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw new Error("Invalid component type.")}}const tn={DEG2RAD:Wr,RAD2DEG:Yr,generateUUID:Xr,clamp:Kr,euclideanModulo:$r,mapLinear:function(e,t,r,n,i){return n+(e-t)*(i-n)/(r-t)},inverseLerp:function(e,t,r){return e!==t?(r-e)/(t-e):0},lerp:Jr,damp:function(e,t,r,n){return Jr(e,t,1-Math.exp(-r*n))},pingpong:function(e,t=1){return t-Math.abs($r(e,2*t)-t)},smoothstep:function(e,t,r){return e<=t?0:e>=r?1:(e=(e-t)/(r-t))*e*(3-2*e)},smootherstep:function(e,t,r){return e<=t?0:e>=r?1:(e=(e-t)/(r-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){void 0!==e&&(qr=e);let t=qr+=1831565813;return t=Math.imul(t^t>>>15,1|t),t^=t+Math.imul(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296},degToRad:function(e){return e*Wr},radToDeg:function(e){return e*Yr},isPowerOfTwo:function(e){return!(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,r,n,i){const s=Math.cos,o=Math.sin,a=s(r/2),l=o(r/2),c=s((t+n)/2),u=o((t+n)/2),h=s((t-n)/2),d=o((t-n)/2),p=s((n-t)/2),f=o((n-t)/2);switch(i){case"XYX":e.set(a*u,l*h,l*d,a*c);break;case"YZY":e.set(l*d,a*u,l*h,a*c);break;case"ZXZ":e.set(l*h,l*d,a*u,a*c);break;case"XZX":e.set(a*u,l*f,l*p,a*c);break;case"YXY":e.set(l*p,a*u,l*f,a*c);break;case"ZYZ":e.set(l*f,l*p,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}},normalize:en,denormalize:Zr};class rn{constructor(e=0,t=0){rn.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,r=this.y,n=e.elements;return this.x=n[0]*t+n[3]*r+n[6],this.y=n[1]*t+n[4]*r+n[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}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=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const r=this.dot(e)/t;return Math.acos(Kr(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y;return t*t+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const r=Math.cos(t),n=Math.sin(t),i=this.x-e.x,s=this.y-e.y;return this.x=i*r-s*n+e.x,this.y=i*n+s*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class nn{constructor(e,t,r,n,i,s,o,a,l){nn.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,t,r,n,i,s,o,a,l)}set(e,t,r,n,i,s,o,a,l){const c=this.elements;return c[0]=e,c[1]=n,c[2]=o,c[3]=t,c[4]=i,c[5]=a,c[6]=r,c[7]=s,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],this}extractBasis(e,t,r){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const r=e.elements,n=t.elements,i=this.elements,s=r[0],o=r[3],a=r[6],l=r[1],c=r[4],u=r[7],h=r[2],d=r[5],p=r[8],f=n[0],m=n[3],g=n[6],A=n[1],y=n[4],v=n[7],x=n[2],_=n[5],b=n[8];return i[0]=s*f+o*A+a*x,i[3]=s*m+o*y+a*_,i[6]=s*g+o*v+a*b,i[1]=l*f+c*A+u*x,i[4]=l*m+c*y+u*_,i[7]=l*g+c*v+u*b,i[2]=h*f+d*A+p*x,i[5]=h*m+d*y+p*_,i[8]=h*g+d*v+p*b,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],r=e[1],n=e[2],i=e[3],s=e[4],o=e[5],a=e[6],l=e[7],c=e[8];return t*s*c-t*o*l-r*i*c+r*o*a+n*i*l-n*s*a}invert(){const e=this.elements,t=e[0],r=e[1],n=e[2],i=e[3],s=e[4],o=e[5],a=e[6],l=e[7],c=e[8],u=c*s-o*l,h=o*a-c*i,d=l*i-s*a,p=t*u+r*h+n*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const f=1/p;return e[0]=u*f,e[1]=(n*l-c*r)*f,e[2]=(o*r-n*s)*f,e[3]=h*f,e[4]=(c*t-n*a)*f,e[5]=(n*i-o*t)*f,e[6]=d*f,e[7]=(r*a-l*t)*f,e[8]=(s*t-r*i)*f,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,r,n,i,s,o){const a=Math.cos(i),l=Math.sin(i);return this.set(r*a,r*l,-r*(a*s+l*o)+s+e,-n*l,n*a,-n*(-l*s+a*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(sn.makeScale(e,t)),this}rotate(e){return this.premultiply(sn.makeRotation(-e)),this}translate(e,t){return this.premultiply(sn.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,r,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,r=e.elements;for(let e=0;e<9;e++)if(t[e]!==r[e])return!1;return!0}fromArray(e,t=0){for(let r=0;r<9;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e}clone(){return(new this.constructor).fromArray(this.elements)}}const sn=new nn;function on(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}const an={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function ln(e,t){return new an[e](t)}function cn(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function un(){const e=cn("canvas");return e.style.display="block",e}const hn={};function dn(e){e in hn||(hn[e]=!0,console.warn(e))}const pn=(new nn).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),fn=(new nn).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),mn={[er]:{transfer:nr,primaries:sr,luminanceCoefficients:[.2126,.7152,.0722],toReference:e=>e,fromReference:e=>e},[Zt]:{transfer:ir,primaries:sr,luminanceCoefficients:[.2126,.7152,.0722],toReference:e=>e.convertSRGBToLinear(),fromReference:e=>e.convertLinearToSRGB()},[rr]:{transfer:nr,primaries:or,luminanceCoefficients:[.2289,.6917,.0793],toReference:e=>e.applyMatrix3(fn),fromReference:e=>e.applyMatrix3(pn)},[tr]:{transfer:ir,primaries:or,luminanceCoefficients:[.2289,.6917,.0793],toReference:e=>e.convertSRGBToLinear().applyMatrix3(fn),fromReference:e=>e.applyMatrix3(pn).convertLinearToSRGB()}},gn=new Set([er,rr]),An={enabled:!0,_workingColorSpace:er,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(e){if(!gn.has(e))throw new Error(`Unsupported working color space, "${e}".`);this._workingColorSpace=e},convert:function(e,t,r){if(!1===this.enabled||t===r||!t||!r)return e;const n=mn[t].toReference;return(0,mn[r].fromReference)(n(e))},fromWorkingColorSpace:function(e,t){return this.convert(e,this._workingColorSpace,t)},toWorkingColorSpace:function(e,t){return this.convert(e,t,this._workingColorSpace)},getPrimaries:function(e){return mn[e].primaries},getTransfer:function(e){return e===Jt?nr:mn[e].transfer},getLuminanceCoefficients:function(e,t=this._workingColorSpace){return e.fromArray(mn[t].luminanceCoefficients)}};function yn(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function vn(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}let xn;class _n{static getDataURL(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===xn&&(xn=cn("canvas")),xn.width=e.width,xn.height=e.height;const r=xn.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),t=xn}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const t=cn("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const n=r.getImageData(0,0,e.width,e.height),i=n.data;for(let e=0;e0&&(r.userData=this.userData),t||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==ue)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case ge:e.x=e.x-Math.floor(e.x);break;case Ae:e.x=e.x<0?0:1;break;case ye:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case ge:e.y=e.y-Math.floor(e.y);break;case Ae:e.y=e.y<0?0:1;break;case ye:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){!0===e&&this.pmremVersion++}}Sn.DEFAULT_IMAGE=null,Sn.DEFAULT_MAPPING=ue,Sn.DEFAULT_ANISOTROPY=1;class Cn{constructor(e=0,t=0,r=0,n=1){Cn.prototype.isVector4=!0,this.x=e,this.y=t,this.z=r,this.w=n}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,r,n){return this.x=e,this.y=t,this.z=r,this.w=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){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: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,r=this.y,n=this.z,i=this.w,s=e.elements;return this.x=s[0]*t+s[4]*r+s[8]*n+s[12]*i,this.y=s[1]*t+s[5]*r+s[9]*n+s[13]*i,this.z=s[2]*t+s[6]*r+s[10]*n+s[14]*i,this.w=s[3]*t+s[7]*r+s[11]*n+s[15]*i,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,r,n,i;const s=.01,o=.1,a=e.elements,l=a[0],c=a[4],u=a[8],h=a[1],d=a[5],p=a[9],f=a[2],m=a[6],g=a[10];if(Math.abs(c-h)a&&e>A?eA?a=0?1:-1,n=1-t*t;if(n>Number.EPSILON){const i=Math.sqrt(n),s=Math.atan2(i,t*r);e=Math.sin(e*s)/i,o=Math.sin(o*s)/i}const i=o*r;if(a=a*e+h*i,l=l*e+d*i,c=c*e+p*i,u=u*e+f*i,e===1-o){const e=1/Math.sqrt(a*a+l*l+c*c+u*u);a*=e,l*=e,c*=e,u*=e}}e[t]=a,e[t+1]=l,e[t+2]=c,e[t+3]=u}static multiplyQuaternionsFlat(e,t,r,n,i,s){const o=r[n],a=r[n+1],l=r[n+2],c=r[n+3],u=i[s],h=i[s+1],d=i[s+2],p=i[s+3];return e[t]=o*p+c*u+a*d-l*h,e[t+1]=a*p+c*h+l*u-o*d,e[t+2]=l*p+c*d+o*h-a*u,e[t+3]=c*p-o*u-a*h-l*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,r,n){return this._x=e,this._y=t,this._z=r,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const r=e._x,n=e._y,i=e._z,s=e._order,o=Math.cos,a=Math.sin,l=o(r/2),c=o(n/2),u=o(i/2),h=a(r/2),d=a(n/2),p=a(i/2);switch(s){case"XYZ":this._x=h*c*u+l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u-h*d*p;break;case"YXZ":this._x=h*c*u+l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u+h*d*p;break;case"ZXY":this._x=h*c*u-l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u-h*d*p;break;case"ZYX":this._x=h*c*u-l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u+h*d*p;break;case"YZX":this._x=h*c*u+l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u-h*d*p;break;case"XZY":this._x=h*c*u-l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u+h*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!0===t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const r=t/2,n=Math.sin(r);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,r=t[0],n=t[4],i=t[8],s=t[1],o=t[5],a=t[9],l=t[2],c=t[6],u=t[10],h=r+o+u;if(h>0){const e=.5/Math.sqrt(h+1);this._w=.25/e,this._x=(c-a)*e,this._y=(i-l)*e,this._z=(s-n)*e}else if(r>o&&r>u){const e=2*Math.sqrt(1+r-o-u);this._w=(c-a)/e,this._x=.25*e,this._y=(n+s)/e,this._z=(i+l)/e}else if(o>u){const e=2*Math.sqrt(1+o-r-u);this._w=(i-l)/e,this._x=(n+s)/e,this._y=.25*e,this._z=(a+c)/e}else{const e=2*Math.sqrt(1+u-r-o);this._w=(s-n)/e,this._x=(i+l)/e,this._y=(a+c)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let r=e.dot(t)+1;return rMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Kr(this.dot(e),-1,1)))}rotateTowards(e,t){const r=this.angleTo(e);if(0===r)return this;const n=Math.min(1,t/r);return this.slerp(e,n),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(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._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 e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const r=e._x,n=e._y,i=e._z,s=e._w,o=t._x,a=t._y,l=t._z,c=t._w;return this._x=r*c+s*o+n*l-i*a,this._y=n*c+s*a+i*o-r*l,this._z=i*c+s*l+r*a-n*o,this._w=s*c-r*o-n*a-i*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const r=this._x,n=this._y,i=this._z,s=this._w;let o=s*e._w+r*e._x+n*e._y+i*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=s,this._x=r,this._y=n,this._z=i,this;const a=1-o*o;if(a<=Number.EPSILON){const e=1-t;return this._w=e*s+t*this._w,this._x=e*r+t*this._x,this._y=e*n+t*this._y,this._z=e*i+t*this._z,this.normalize(),this}const l=Math.sqrt(a),c=Math.atan2(l,o),u=Math.sin((1-t)*c)/l,h=Math.sin(t*c)/l;return this._w=s*u+this._w*h,this._x=r*u+this._x*h,this._y=n*u+this._y*h,this._z=i*u+this._z*h,this._onChangeCallback(),this}slerpQuaternions(e,t,r){return this.copy(e).slerp(t,r)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),r=Math.random(),n=Math.sqrt(1-r),i=Math.sqrt(r);return this.set(n*Math.sin(e),n*Math.cos(e),i*Math.sin(t),i*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class On{constructor(e=0,t=0,r=0){On.prototype.isVector3=!0,this.x=e,this.y=t,this.z=r}set(e,t,r){return void 0===r&&(r=this.z),this.x=e,this.y=t,this.z=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(Un.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Un.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,r=this.y,n=this.z,i=e.elements;return this.x=i[0]*t+i[3]*r+i[6]*n,this.y=i[1]*t+i[4]*r+i[7]*n,this.z=i[2]*t+i[5]*r+i[8]*n,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,r=this.y,n=this.z,i=e.elements,s=1/(i[3]*t+i[7]*r+i[11]*n+i[15]);return this.x=(i[0]*t+i[4]*r+i[8]*n+i[12])*s,this.y=(i[1]*t+i[5]*r+i[9]*n+i[13])*s,this.z=(i[2]*t+i[6]*r+i[10]*n+i[14])*s,this}applyQuaternion(e){const t=this.x,r=this.y,n=this.z,i=e.x,s=e.y,o=e.z,a=e.w,l=2*(s*n-o*r),c=2*(o*t-i*n),u=2*(i*r-s*t);return this.x=t+a*l+s*u-o*c,this.y=r+a*c+o*l-i*u,this.z=n+a*u+i*c-s*l,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,r=this.y,n=this.z,i=e.elements;return this.x=i[0]*t+i[4]*r+i[8]*n,this.y=i[1]*t+i[5]*r+i[9]*n,this.z=i[2]*t+i[6]*r+i[10]*n,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}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=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.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(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const r=e.x,n=e.y,i=e.z,s=t.x,o=t.y,a=t.z;return this.x=n*a-i*o,this.y=i*s-r*a,this.z=r*o-n*s,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const r=e.dot(this)/t;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return Nn.copy(this).projectOnVector(e),this.sub(Nn)}reflect(e){return this.sub(Nn.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const r=this.dot(e)/t;return Math.acos(Kr(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y,n=this.z-e.z;return t*t+r*r+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,r){const n=Math.sin(t)*e;return this.x=n*Math.sin(r),this.y=Math.cos(t)*e,this.z=n*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,r){return this.x=e*Math.sin(t),this.y=r,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=r,this.z=n,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=2*Math.random()-1,r=Math.sqrt(1-t*t);return this.x=r*Math.cos(e),this.y=t,this.z=r*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Nn=new On,Un=new Dn;class Fn{constructor(e=new On(1/0,1/0,1/0),t=new On(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,r=e.length;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,zn),zn.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,r;return e.normal.x>0?(t=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),t<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Yn),Xn.subVectors(this.max,Yn),Qn.subVectors(e.a,Yn),Vn.subVectors(e.b,Yn),Hn.subVectors(e.c,Yn),jn.subVectors(Vn,Qn),qn.subVectors(Hn,Vn),Wn.subVectors(Qn,Hn);let t=[0,-jn.z,jn.y,0,-qn.z,qn.y,0,-Wn.z,Wn.y,jn.z,0,-jn.x,qn.z,0,-qn.x,Wn.z,0,-Wn.x,-jn.y,jn.x,0,-qn.y,qn.x,0,-Wn.y,Wn.x,0];return!!Jn(t,Qn,Vn,Hn,Xn)&&(t=[1,0,0,0,1,0,0,0,1],!!Jn(t,Qn,Vn,Hn,Xn)&&(Kn.crossVectors(jn,qn),t=[Kn.x,Kn.y,Kn.z],Jn(t,Qn,Vn,Hn,Xn)))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,zn).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(zn).length()),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(kn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),kn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),kn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),kn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),kn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),kn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),kn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),kn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(kn)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const kn=[new On,new On,new On,new On,new On,new On,new On,new On],zn=new On,Gn=new Fn,Qn=new On,Vn=new On,Hn=new On,jn=new On,qn=new On,Wn=new On,Yn=new On,Xn=new On,Kn=new On,$n=new On;function Jn(e,t,r,n,i){for(let s=0,o=e.length-3;s<=o;s+=3){$n.fromArray(e,s);const o=i.x*Math.abs($n.x)+i.y*Math.abs($n.y)+i.z*Math.abs($n.z),a=t.dot($n),l=r.dot($n),c=n.dot($n);if(Math.max(-Math.max(a,l,c),Math.min(a,l,c))>o)return!1}return!0}const Zn=new Fn,ei=new On,ti=new On;class ri{constructor(e=new On,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const r=this.center;void 0!==t?r.copy(t):Zn.setFromPoints(e).getCenter(r);let n=0;for(let t=0,i=e.length;tthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;ei.subVectors(e,this.center);const t=ei.lengthSq();if(t>this.radius*this.radius){const e=Math.sqrt(t),r=.5*(e-this.radius);this.center.addScaledVector(ei,r/e),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(ti.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(ei.copy(e.center).add(ti)),this.expandByPoint(ei.copy(e.center).sub(ti))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const ni=new On,ii=new On,si=new On,oi=new On,ai=new On,li=new On,ci=new On;class ui{constructor(e=new On,t=new On(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,ni)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const r=t.dot(this.direction);return r<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=ni.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(ni.copy(this.origin).addScaledVector(this.direction,t),ni.distanceToSquared(e))}distanceSqToSegment(e,t,r,n){ii.copy(e).add(t).multiplyScalar(.5),si.copy(t).sub(e).normalize(),oi.copy(this.origin).sub(ii);const i=.5*e.distanceTo(t),s=-this.direction.dot(si),o=oi.dot(this.direction),a=-oi.dot(si),l=oi.lengthSq(),c=Math.abs(1-s*s);let u,h,d,p;if(c>0)if(u=s*a-o,h=s*o-a,p=i*c,u>=0)if(h>=-p)if(h<=p){const e=1/c;u*=e,h*=e,d=u*(u+s*h+2*o)+h*(s*u+h+2*a)+l}else h=i,u=Math.max(0,-(s*h+o)),d=-u*u+h*(h+2*a)+l;else h=-i,u=Math.max(0,-(s*h+o)),d=-u*u+h*(h+2*a)+l;else h<=-p?(u=Math.max(0,-(-s*i+o)),h=u>0?-i:Math.min(Math.max(-i,-a),i),d=-u*u+h*(h+2*a)+l):h<=p?(u=0,h=Math.min(Math.max(-i,-a),i),d=h*(h+2*a)+l):(u=Math.max(0,-(s*i+o)),h=u>0?i:Math.min(Math.max(-i,-a),i),d=-u*u+h*(h+2*a)+l);else h=s>0?-i:i,u=Math.max(0,-(s*h+o)),d=-u*u+h*(h+2*a)+l;return r&&r.copy(this.origin).addScaledVector(this.direction,u),n&&n.copy(ii).addScaledVector(si,h),d}intersectSphere(e,t){ni.subVectors(e.center,this.origin);const r=ni.dot(this.direction),n=ni.dot(ni)-r*r,i=e.radius*e.radius;if(n>i)return null;const s=Math.sqrt(i-n),o=r-s,a=r+s;return a<0?null:o<0?this.at(a,t):this.at(o,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/t;return r>=0?r:null}intersectPlane(e,t){const r=this.distanceToPlane(e);return null===r?null:this.at(r,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let r,n,i,s,o,a;const l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,h=this.origin;return l>=0?(r=(e.min.x-h.x)*l,n=(e.max.x-h.x)*l):(r=(e.max.x-h.x)*l,n=(e.min.x-h.x)*l),c>=0?(i=(e.min.y-h.y)*c,s=(e.max.y-h.y)*c):(i=(e.max.y-h.y)*c,s=(e.min.y-h.y)*c),r>s||i>n?null:((i>r||isNaN(r))&&(r=i),(s=0?(o=(e.min.z-h.z)*u,a=(e.max.z-h.z)*u):(o=(e.max.z-h.z)*u,a=(e.min.z-h.z)*u),r>a||o>n?null:((o>r||r!=r)&&(r=o),(a=0?r:n,t)))}intersectsBox(e){return null!==this.intersectBox(e,ni)}intersectTriangle(e,t,r,n,i){ai.subVectors(t,e),li.subVectors(r,e),ci.crossVectors(ai,li);let s,o=this.direction.dot(ci);if(o>0){if(n)return null;s=1}else{if(!(o<0))return null;s=-1,o=-o}oi.subVectors(this.origin,e);const a=s*this.direction.dot(li.crossVectors(oi,li));if(a<0)return null;const l=s*this.direction.dot(ai.cross(oi));if(l<0)return null;if(a+l>o)return null;const c=-s*oi.dot(ci);return c<0?null:this.at(c/o,i)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class hi{constructor(e,t,r,n,i,s,o,a,l,c,u,h,d,p,f,m){hi.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,t,r,n,i,s,o,a,l,c,u,h,d,p,f,m)}set(e,t,r,n,i,s,o,a,l,c,u,h,d,p,f,m){const g=this.elements;return g[0]=e,g[4]=t,g[8]=r,g[12]=n,g[1]=i,g[5]=s,g[9]=o,g[13]=a,g[2]=l,g[6]=c,g[10]=u,g[14]=h,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(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],this}copyPosition(e){const t=this.elements,r=e.elements;return t[12]=r[12],t[13]=r[13],t[14]=r[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,r){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,t,r){return this.set(e.x,t.x,r.x,0,e.y,t.y,r.y,0,e.z,t.z,r.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,r=e.elements,n=1/di.setFromMatrixColumn(e,0).length(),i=1/di.setFromMatrixColumn(e,1).length(),s=1/di.setFromMatrixColumn(e,2).length();return t[0]=r[0]*n,t[1]=r[1]*n,t[2]=r[2]*n,t[3]=0,t[4]=r[4]*i,t[5]=r[5]*i,t[6]=r[6]*i,t[7]=0,t[8]=r[8]*s,t[9]=r[9]*s,t[10]=r[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,r=e.x,n=e.y,i=e.z,s=Math.cos(r),o=Math.sin(r),a=Math.cos(n),l=Math.sin(n),c=Math.cos(i),u=Math.sin(i);if("XYZ"===e.order){const e=s*c,r=s*u,n=o*c,i=o*u;t[0]=a*c,t[4]=-a*u,t[8]=l,t[1]=r+n*l,t[5]=e-i*l,t[9]=-o*a,t[2]=i-e*l,t[6]=n+r*l,t[10]=s*a}else if("YXZ"===e.order){const e=a*c,r=a*u,n=l*c,i=l*u;t[0]=e+i*o,t[4]=n*o-r,t[8]=s*l,t[1]=s*u,t[5]=s*c,t[9]=-o,t[2]=r*o-n,t[6]=i+e*o,t[10]=s*a}else if("ZXY"===e.order){const e=a*c,r=a*u,n=l*c,i=l*u;t[0]=e-i*o,t[4]=-s*u,t[8]=n+r*o,t[1]=r+n*o,t[5]=s*c,t[9]=i-e*o,t[2]=-s*l,t[6]=o,t[10]=s*a}else if("ZYX"===e.order){const e=s*c,r=s*u,n=o*c,i=o*u;t[0]=a*c,t[4]=n*l-r,t[8]=e*l+i,t[1]=a*u,t[5]=i*l+e,t[9]=r*l-n,t[2]=-l,t[6]=o*a,t[10]=s*a}else if("YZX"===e.order){const e=s*a,r=s*l,n=o*a,i=o*l;t[0]=a*c,t[4]=i-e*u,t[8]=n*u+r,t[1]=u,t[5]=s*c,t[9]=-o*c,t[2]=-l*c,t[6]=r*u+n,t[10]=e-i*u}else if("XZY"===e.order){const e=s*a,r=s*l,n=o*a,i=o*l;t[0]=a*c,t[4]=-u,t[8]=l*c,t[1]=e*u+i,t[5]=s*c,t[9]=r*u-n,t[2]=n*u-r,t[6]=o*c,t[10]=i*u+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(fi,e,mi)}lookAt(e,t,r){const n=this.elements;return yi.subVectors(e,t),0===yi.lengthSq()&&(yi.z=1),yi.normalize(),gi.crossVectors(r,yi),0===gi.lengthSq()&&(1===Math.abs(r.z)?yi.x+=1e-4:yi.z+=1e-4,yi.normalize(),gi.crossVectors(r,yi)),gi.normalize(),Ai.crossVectors(yi,gi),n[0]=gi.x,n[4]=Ai.x,n[8]=yi.x,n[1]=gi.y,n[5]=Ai.y,n[9]=yi.y,n[2]=gi.z,n[6]=Ai.z,n[10]=yi.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const r=e.elements,n=t.elements,i=this.elements,s=r[0],o=r[4],a=r[8],l=r[12],c=r[1],u=r[5],h=r[9],d=r[13],p=r[2],f=r[6],m=r[10],g=r[14],A=r[3],y=r[7],v=r[11],x=r[15],_=n[0],b=n[4],w=n[8],E=n[12],M=n[1],S=n[5],C=n[9],T=n[13],I=n[2],R=n[6],B=n[10],P=n[14],L=n[3],D=n[7],O=n[11],N=n[15];return i[0]=s*_+o*M+a*I+l*L,i[4]=s*b+o*S+a*R+l*D,i[8]=s*w+o*C+a*B+l*O,i[12]=s*E+o*T+a*P+l*N,i[1]=c*_+u*M+h*I+d*L,i[5]=c*b+u*S+h*R+d*D,i[9]=c*w+u*C+h*B+d*O,i[13]=c*E+u*T+h*P+d*N,i[2]=p*_+f*M+m*I+g*L,i[6]=p*b+f*S+m*R+g*D,i[10]=p*w+f*C+m*B+g*O,i[14]=p*E+f*T+m*P+g*N,i[3]=A*_+y*M+v*I+x*L,i[7]=A*b+y*S+v*R+x*D,i[11]=A*w+y*C+v*B+x*O,i[15]=A*E+y*T+v*P+x*N,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],r=e[4],n=e[8],i=e[12],s=e[1],o=e[5],a=e[9],l=e[13],c=e[2],u=e[6],h=e[10],d=e[14];return e[3]*(+i*a*u-n*l*u-i*o*h+r*l*h+n*o*d-r*a*d)+e[7]*(+t*a*d-t*l*h+i*s*h-n*s*d+n*l*c-i*a*c)+e[11]*(+t*l*u-t*o*d-i*s*u+r*s*d+i*o*c-r*l*c)+e[15]*(-n*o*c-t*a*u+t*o*h+n*s*u-r*s*h+r*a*c)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,r){const n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=t,n[14]=r),this}invert(){const e=this.elements,t=e[0],r=e[1],n=e[2],i=e[3],s=e[4],o=e[5],a=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11],p=e[12],f=e[13],m=e[14],g=e[15],A=u*m*l-f*h*l+f*a*d-o*m*d-u*a*g+o*h*g,y=p*h*l-c*m*l-p*a*d+s*m*d+c*a*g-s*h*g,v=c*f*l-p*u*l+p*o*d-s*f*d-c*o*g+s*u*g,x=p*u*a-c*f*a-p*o*h+s*f*h+c*o*m-s*u*m,_=t*A+r*y+n*v+i*x;if(0===_)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const b=1/_;return e[0]=A*b,e[1]=(f*h*i-u*m*i-f*n*d+r*m*d+u*n*g-r*h*g)*b,e[2]=(o*m*i-f*a*i+f*n*l-r*m*l-o*n*g+r*a*g)*b,e[3]=(u*a*i-o*h*i-u*n*l+r*h*l+o*n*d-r*a*d)*b,e[4]=y*b,e[5]=(c*m*i-p*h*i+p*n*d-t*m*d-c*n*g+t*h*g)*b,e[6]=(p*a*i-s*m*i-p*n*l+t*m*l+s*n*g-t*a*g)*b,e[7]=(s*h*i-c*a*i+c*n*l-t*h*l-s*n*d+t*a*d)*b,e[8]=v*b,e[9]=(p*u*i-c*f*i-p*r*d+t*f*d+c*r*g-t*u*g)*b,e[10]=(s*f*i-p*o*i+p*r*l-t*f*l-s*r*g+t*o*g)*b,e[11]=(c*o*i-s*u*i-c*r*l+t*u*l+s*r*d-t*o*d)*b,e[12]=x*b,e[13]=(c*f*n-p*u*n+p*r*h-t*f*h-c*r*m+t*u*m)*b,e[14]=(p*o*n-s*f*n-p*r*a+t*f*a+s*r*m-t*o*m)*b,e[15]=(s*u*n-c*o*n+c*r*a-t*u*a-s*r*h+t*o*h)*b,this}scale(e){const t=this.elements,r=e.x,n=e.y,i=e.z;return t[0]*=r,t[4]*=n,t[8]*=i,t[1]*=r,t[5]*=n,t[9]*=i,t[2]*=r,t[6]*=n,t[10]*=i,t[3]*=r,t[7]*=n,t[11]*=i,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,r,n))}makeTranslation(e,t,r){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,r,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,t,-r,0,0,r,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,0,r,0,0,1,0,0,-r,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,0,r,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const r=Math.cos(t),n=Math.sin(t),i=1-r,s=e.x,o=e.y,a=e.z,l=i*s,c=i*o;return this.set(l*s+r,l*o-n*a,l*a+n*o,0,l*o+n*a,c*o+r,c*a-n*s,0,l*a-n*o,c*a+n*s,i*a*a+r,0,0,0,0,1),this}makeScale(e,t,r){return this.set(e,0,0,0,0,t,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,t,r,n,i,s){return this.set(1,r,i,0,e,1,s,0,t,n,1,0,0,0,0,1),this}compose(e,t,r){const n=this.elements,i=t._x,s=t._y,o=t._z,a=t._w,l=i+i,c=s+s,u=o+o,h=i*l,d=i*c,p=i*u,f=s*c,m=s*u,g=o*u,A=a*l,y=a*c,v=a*u,x=r.x,_=r.y,b=r.z;return n[0]=(1-(f+g))*x,n[1]=(d+v)*x,n[2]=(p-y)*x,n[3]=0,n[4]=(d-v)*_,n[5]=(1-(h+g))*_,n[6]=(m+A)*_,n[7]=0,n[8]=(p+y)*b,n[9]=(m-A)*b,n[10]=(1-(h+f))*b,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this}decompose(e,t,r){const n=this.elements;let i=di.set(n[0],n[1],n[2]).length();const s=di.set(n[4],n[5],n[6]).length(),o=di.set(n[8],n[9],n[10]).length();this.determinant()<0&&(i=-i),e.x=n[12],e.y=n[13],e.z=n[14],pi.copy(this);const a=1/i,l=1/s,c=1/o;return pi.elements[0]*=a,pi.elements[1]*=a,pi.elements[2]*=a,pi.elements[4]*=l,pi.elements[5]*=l,pi.elements[6]*=l,pi.elements[8]*=c,pi.elements[9]*=c,pi.elements[10]*=c,t.setFromRotationMatrix(pi),r.x=i,r.y=s,r.z=o,this}makePerspective(e,t,r,n,i,s,o=Qr){const a=this.elements,l=2*i/(t-e),c=2*i/(r-n),u=(t+e)/(t-e),h=(r+n)/(r-n);let d,p;if(o===Qr)d=-(s+i)/(s-i),p=-2*s*i/(s-i);else{if(o!==Vr)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);d=-s/(s-i),p=-s*i/(s-i)}return a[0]=l,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=p,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,r,n,i,s,o=Qr){const a=this.elements,l=1/(t-e),c=1/(r-n),u=1/(s-i),h=(t+e)*l,d=(r+n)*c;let p,f;if(o===Qr)p=(s+i)*u,f=-2*u;else{if(o!==Vr)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);p=i*u,f=-1*u}return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=f,a[14]=-p,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){const t=this.elements,r=e.elements;for(let e=0;e<16;e++)if(t[e]!==r[e])return!1;return!0}fromArray(e,t=0){for(let r=0;r<16;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e[t+9]=r[9],e[t+10]=r[10],e[t+11]=r[11],e[t+12]=r[12],e[t+13]=r[13],e[t+14]=r[14],e[t+15]=r[15],e}}const di=new On,pi=new hi,fi=new On(0,0,0),mi=new On(1,1,1),gi=new On,Ai=new On,yi=new On,vi=new hi,xi=new Dn;class _i{constructor(e=0,t=0,r=0,n=_i.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=r,this._order=n}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,r,n=this._order){return this._x=e,this._y=t,this._z=r,this._order=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,r=!0){const n=e.elements,i=n[0],s=n[4],o=n[8],a=n[1],l=n[5],c=n[9],u=n[2],h=n[6],d=n[10];switch(t){case"XYZ":this._y=Math.asin(Kr(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-s,i)):(this._x=Math.atan2(h,l),this._z=0);break;case"YXZ":this._x=Math.asin(-Kr(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(o,d),this._z=Math.atan2(a,l)):(this._y=Math.atan2(-u,i),this._z=0);break;case"ZXY":this._x=Math.asin(Kr(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-u,d),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(a,i));break;case"ZYX":this._y=Math.asin(-Kr(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(h,d),this._z=Math.atan2(a,i)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(Kr(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-u,i)):(this._x=0,this._y=Math.atan2(o,d));break;case"XZY":this._z=Math.asin(-Kr(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(h,l),this._y=Math.atan2(o,i)):(this._x=Math.atan2(-c,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===r&&this._onChangeCallback(),this}setFromQuaternion(e,t,r){return vi.makeRotationFromQuaternion(e),this.setFromRotationMatrix(vi,t,r)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return xi.setFromEuler(this),this.setFromQuaternion(xi,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}_i.DEFAULT_ORDER="XYZ";class bi{constructor(){this.mask=1}set(e){this.mask=1<>>0}enable(e){this.mask|=1<1){for(let e=0;e1){for(let e=0;e0&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),n.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(n.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(n.type="BatchedMesh",n.perObjectFrustumCulled=this.perObjectFrustumCulled,n.sortObjects=this.sortObjects,n.drawRanges=this._drawRanges,n.reservedRanges=this._reservedRanges,n.visibility=this._visibility,n.active=this._active,n.bounds=this._bounds.map((e=>({boxInitialized:e.boxInitialized,boxMin:e.box.min.toArray(),boxMax:e.box.max.toArray(),sphereInitialized:e.sphereInitialized,sphereRadius:e.sphere.radius,sphereCenter:e.sphere.center.toArray()}))),n.maxInstanceCount=this._maxInstanceCount,n.maxVertexCount=this._maxVertexCount,n.maxIndexCount=this._maxIndexCount,n.geometryInitialized=this._geometryInitialized,n.geometryCount=this._geometryCount,n.matricesTexture=this._matricesTexture.toJSON(e),null!==this._colorsTexture&&(n.colorsTexture=this._colorsTexture.toJSON(e)),null!==this.boundingSphere&&(n.boundingSphere={center:n.boundingSphere.center.toArray(),radius:n.boundingSphere.radius}),null!==this.boundingBox&&(n.boundingBox={min:n.boundingBox.min.toArray(),max:n.boundingBox.max.toArray()})),this.isScene)this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(n.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){n.geometry=i(e.geometries,this.geometry);const t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){const r=t.shapes;if(Array.isArray(r))for(let t=0,n=r.length;t0){n.children=[];for(let t=0;t0){n.animations=[];for(let t=0;t0&&(r.geometries=t),n.length>0&&(r.materials=n),i.length>0&&(r.textures=i),o.length>0&&(r.images=o),a.length>0&&(r.shapes=a),l.length>0&&(r.skeletons=l),c.length>0&&(r.animations=c),u.length>0&&(r.nodes=u)}return r.object=n,r;function s(e){const t=[];for(const r in e){const n=e[r];delete n.metadata,t.push(n)}return t}}clone(e){return(new this.constructor).copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t0?n.multiplyScalar(1/Math.sqrt(i)):n.set(0,0,0)}static getBarycoord(e,t,r,n,i){ki.subVectors(n,t),zi.subVectors(r,t),Gi.subVectors(e,t);const s=ki.dot(ki),o=ki.dot(zi),a=ki.dot(Gi),l=zi.dot(zi),c=zi.dot(Gi),u=s*l-o*o;if(0===u)return i.set(0,0,0),null;const h=1/u,d=(l*a-o*c)*h,p=(s*c-o*a)*h;return i.set(1-d-p,p,d)}static containsPoint(e,t,r,n){return null!==this.getBarycoord(e,t,r,n,Qi)&&Qi.x>=0&&Qi.y>=0&&Qi.x+Qi.y<=1}static getInterpolation(e,t,r,n,i,s,o,a){return null===this.getBarycoord(e,t,r,n,Qi)?(a.x=0,a.y=0,"z"in a&&(a.z=0),"w"in a&&(a.w=0),null):(a.setScalar(0),a.addScaledVector(i,Qi.x),a.addScaledVector(s,Qi.y),a.addScaledVector(o,Qi.z),a)}static isFrontFacing(e,t,r,n){return ki.subVectors(r,t),zi.subVectors(e,t),ki.cross(zi).dot(n)<0}set(e,t,r){return this.a.copy(e),this.b.copy(t),this.c.copy(r),this}setFromPointsAndIndices(e,t,r,n){return this.a.copy(e[t]),this.b.copy(e[r]),this.c.copy(e[n]),this}setFromAttributeAndIndices(e,t,r,n){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,r),this.c.fromBufferAttribute(e,n),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return ki.subVectors(this.c,this.b),zi.subVectors(this.a,this.b),.5*ki.cross(zi).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Xi.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Xi.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,r,n,i){return Xi.getInterpolation(e,this.a,this.b,this.c,t,r,n,i)}containsPoint(e){return Xi.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Xi.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const r=this.a,n=this.b,i=this.c;let s,o;Vi.subVectors(n,r),Hi.subVectors(i,r),qi.subVectors(e,r);const a=Vi.dot(qi),l=Hi.dot(qi);if(a<=0&&l<=0)return t.copy(r);Wi.subVectors(e,n);const c=Vi.dot(Wi),u=Hi.dot(Wi);if(c>=0&&u<=c)return t.copy(n);const h=a*u-c*l;if(h<=0&&a>=0&&c<=0)return s=a/(a-c),t.copy(r).addScaledVector(Vi,s);Yi.subVectors(e,i);const d=Vi.dot(Yi),p=Hi.dot(Yi);if(p>=0&&d<=p)return t.copy(i);const f=d*l-a*p;if(f<=0&&l>=0&&p<=0)return o=l/(l-p),t.copy(r).addScaledVector(Hi,o);const m=c*p-d*u;if(m<=0&&u-c>=0&&d-p>=0)return ji.subVectors(i,n),o=(u-c)/(u-c+(d-p)),t.copy(n).addScaledVector(ji,o);const g=1/(m+f+h);return s=f*g,o=h*g,t.copy(r).addScaledVector(Vi,s).addScaledVector(Hi,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const Ki={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},$i={h:0,s:0,l:0},Ji={h:0,s:0,l:0};function Zi(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+6*(t-e)*(2/3-r):e}class es{constructor(e,t,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,r)}set(e,t,r){if(void 0===t&&void 0===r){const t=e;t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t)}else this.setRGB(e,t,r);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Zt){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,An.toWorkingColorSpace(this,t),this}setRGB(e,t,r,n=An.workingColorSpace){return this.r=e,this.g=t,this.b=r,An.toWorkingColorSpace(this,n),this}setHSL(e,t,r,n=An.workingColorSpace){if(e=$r(e,1),t=Kr(t,0,1),r=Kr(r,0,1),0===t)this.r=this.g=this.b=r;else{const n=r<=.5?r*(1+t):r+t-r*t,i=2*r-n;this.r=Zi(i,n,e+1/3),this.g=Zi(i,n,e),this.b=Zi(i,n,e-1/3)}return An.toWorkingColorSpace(this,n),this}setStyle(e,t=Zt){function r(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^(\w+)\(([^\)]*)\)/.exec(e)){let i;const s=n[1],o=n[2];switch(s){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(i[4]),this.setRGB(Math.min(255,parseInt(i[1],10))/255,Math.min(255,parseInt(i[2],10))/255,Math.min(255,parseInt(i[3],10))/255,t);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(i[4]),this.setRGB(Math.min(100,parseInt(i[1],10))/100,Math.min(100,parseInt(i[2],10))/100,Math.min(100,parseInt(i[3],10))/100,t);break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=n[1],i=r.length;if(3===i)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(6===i)return this.setHex(parseInt(r,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Zt){const r=Ki[e.toLowerCase()];return void 0!==r?this.setHex(r,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=yn(e.r),this.g=yn(e.g),this.b=yn(e.b),this}copyLinearToSRGB(e){return this.r=vn(e.r),this.g=vn(e.g),this.b=vn(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Zt){return An.fromWorkingColorSpace(ts.copy(this),e),65536*Math.round(Kr(255*ts.r,0,255))+256*Math.round(Kr(255*ts.g,0,255))+Math.round(Kr(255*ts.b,0,255))}getHexString(e=Zt){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=An.workingColorSpace){An.fromWorkingColorSpace(ts.copy(this),t);const r=ts.r,n=ts.g,i=ts.b,s=Math.max(r,n,i),o=Math.min(r,n,i);let a,l;const c=(o+s)/2;if(o===s)a=0,l=0;else{const e=s-o;switch(l=c<=.5?e/(s+o):e/(2-s-o),s){case r:a=(n-i)/e+(n0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(const t in e){const r=e[t];if(void 0===r){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const n=this[t];void 0!==n?n&&n.isColor?n.set(r):n&&n.isVector3&&r&&r.isVector3?n.copy(r):this[t]=r:console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`)}}toJSON(e){const t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});const r={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function n(e){const t=[];for(const r in e){const n=e[r];delete n.metadata,t.push(n)}return t}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),void 0!==this.roughness&&(r.roughness=this.roughness),void 0!==this.metalness&&(r.metalness=this.metalness),void 0!==this.sheen&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(r.shininess=this.shininess),void 0!==this.clearcoat&&(r.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.dispersion&&(r.dispersion=this.dispersion),void 0!==this.iridescence&&(r.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(r.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),void 0!==this.anisotropy&&(r.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(r.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(r.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(r.combine=this.combine)),void 0!==this.envMapRotation&&(r.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(r.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(r.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(r.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(r.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(r.size=this.size),null!==this.shadowSide&&(r.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==y&&(r.blending=this.blending),this.side!==f&&(r.side=this.side),!0===this.vertexColors&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),!0===this.transparent&&(r.transparent=!0),this.blendSrc!==P&&(r.blendSrc=this.blendSrc),this.blendDst!==L&&(r.blendDst=this.blendDst),this.blendEquation!==w&&(r.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(r.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(r.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(r.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(r.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(r.blendAlpha=this.blendAlpha),this.depthFunc!==q&&(r.depthFunc=this.depthFunc),!1===this.depthTest&&(r.depthTest=this.depthTest),!1===this.depthWrite&&(r.depthWrite=this.depthWrite),!1===this.colorWrite&&(r.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(r.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==br&&(r.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(r.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(r.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==lr&&(r.stencilFail=this.stencilFail),this.stencilZFail!==lr&&(r.stencilZFail=this.stencilZFail),this.stencilZPass!==lr&&(r.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(r.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(r.rotation=this.rotation),!0===this.polygonOffset&&(r.polygonOffset=!0),0!==this.polygonOffsetFactor&&(r.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(r.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(r.linewidth=this.linewidth),void 0!==this.dashSize&&(r.dashSize=this.dashSize),void 0!==this.gapSize&&(r.gapSize=this.gapSize),void 0!==this.scale&&(r.scale=this.scale),!0===this.dithering&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),!0===this.alphaHash&&(r.alphaHash=!0),!0===this.alphaToCoverage&&(r.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(r.premultipliedAlpha=!0),!0===this.forceSinglePass&&(r.forceSinglePass=!0),!0===this.wireframe&&(r.wireframe=!0),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(r.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(r.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(r.flatShading=!0),!1===this.visible&&(r.visible=!1),!1===this.toneMapped&&(r.toneMapped=!1),!1===this.fog&&(r.fog=!1),Object.keys(this.userData).length>0&&(r.userData=this.userData),t){const t=n(e.textures),i=n(e.images);t.length>0&&(r.textures=t),i.length>0&&(r.images=i)}return r}clone(){return(new this.constructor).copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let r=null;if(null!==t){const e=t.length;r=new Array(e);for(let n=0;n!==e;++n)r[n]=t[n].clone()}return this.clippingPlanes=r,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class is extends ns{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new es(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.envMapRotation=new _i,this.combine=$,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const ss=os();function os(){const e=new ArrayBuffer(4),t=new Float32Array(e),r=new Uint32Array(e),n=new Uint32Array(512),i=new Uint32Array(512);for(let e=0;e<256;++e){const t=e-127;t<-27?(n[e]=0,n[256|e]=32768,i[e]=24,i[256|e]=24):t<-14?(n[e]=1024>>-t-14,n[256|e]=1024>>-t-14|32768,i[e]=-t-1,i[256|e]=-t-1):t<=15?(n[e]=t+15<<10,n[256|e]=t+15<<10|32768,i[e]=13,i[256|e]=13):t<128?(n[e]=31744,n[256|e]=64512,i[e]=24,i[256|e]=24):(n[e]=31744,n[256|e]=64512,i[e]=13,i[256|e]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,r=0;for(;!(8388608&t);)t<<=1,r-=8388608;t&=-8388609,r+=947912704,s[e]=t|r}for(let e=1024;e<2048;++e)s[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)o[e]=e<<23;o[31]=1199570944,o[32]=2147483648;for(let e=33;e<63;++e)o[e]=2147483648+(e-32<<23);o[63]=3347054592;for(let e=1;e<64;++e)32!==e&&(a[e]=1024);return{floatView:t,uint32View:r,baseTable:n,shiftTable:i,mantissaTable:s,exponentTable:o,offsetTable:a}}function as(e){Math.abs(e)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),e=Kr(e,-65504,65504),ss.floatView[0]=e;const t=ss.uint32View[0],r=t>>23&511;return ss.baseTable[r]+((8388607&t)>>ss.shiftTable[r])}function ls(e){const t=e>>10;return ss.uint32View[0]=ss.mantissaTable[ss.offsetTable[t]+(1023&e)]+ss.exponentTable[t],ss.floatView[0]}const cs={toHalfFloat:as,fromHalfFloat:ls},us=new On,hs=new rn;class ds{constructor(e,t,r=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=r,this.usage=Br,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Oe,this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}get updateRange(){return dn("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,r){e*=this.itemSize,r*=t.itemSize;for(let n=0,i=this.itemSize;n0&&(e.userData=this.userData),void 0!==this.parameters){const t=this.parameters;for(const r in t)void 0!==t[r]&&(e[r]=t[r]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const r=this.attributes;for(const t in r){const n=r[t];e.data.attributes[t]=n.toJSON(e.data)}const n={};let i=!1;for(const t in this.morphAttributes){const r=this.morphAttributes[t],s=[];for(let t=0,n=r.length;t0&&(n[t]=s,i=!0)}i&&(e.data.morphAttributes=n,e.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));const o=this.boundingSphere;return null!==o&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),e}clone(){return(new this.constructor).copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const r=e.index;null!==r&&this.setIndex(r.clone(t));const n=e.attributes;for(const e in n){const r=n[e];this.setAttribute(e,r.clone(t))}const i=e.morphAttributes;for(const e in i){const r=[],n=i[e];for(let e=0,i=n.length;e0){const r=e[t[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=r.length;e(e.far-e.near)**2)return}Rs.copy(i).invert(),Bs.copy(e.ray).applyMatrix4(Rs),null!==r.boundingBox&&!1===Bs.intersectsBox(r.boundingBox)||this._computeIntersections(e,t,Bs)}}_computeIntersections(e,t,r){let n;const i=this.geometry,s=this.material,o=i.index,a=i.attributes.position,l=i.attributes.uv,c=i.attributes.uv1,u=i.attributes.normal,h=i.groups,d=i.drawRange;if(null!==o)if(Array.isArray(s))for(let i=0,a=h.length;ir.far?null:{distance:c,point:qs.clone(),object:e}}(e,t,r,n,Ds,Os,Ns,js);if(u){i&&(ks.fromBufferAttribute(i,a),zs.fromBufferAttribute(i,l),Gs.fromBufferAttribute(i,c),u.uv=Xi.getInterpolation(js,Ds,Os,Ns,ks,zs,Gs,new rn)),s&&(ks.fromBufferAttribute(s,a),zs.fromBufferAttribute(s,l),Gs.fromBufferAttribute(s,c),u.uv1=Xi.getInterpolation(js,Ds,Os,Ns,ks,zs,Gs,new rn)),o&&(Qs.fromBufferAttribute(o,a),Vs.fromBufferAttribute(o,l),Hs.fromBufferAttribute(o,c),u.normal=Xi.getInterpolation(js,Ds,Os,Ns,Qs,Vs,Hs,new On),u.normal.dot(n.direction)>0&&u.normal.multiplyScalar(-1));const e={a,b:l,c,normal:new On,materialIndex:0};Xi.getNormal(Ds,Os,Ns,e.normal),u.face=e}return u}class Xs extends Is{constructor(e=1,t=1,r=1,n=1,i=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:r,widthSegments:n,heightSegments:i,depthSegments:s};const o=this;n=Math.floor(n),i=Math.floor(i),s=Math.floor(s);const a=[],l=[],c=[],u=[];let h=0,d=0;function p(e,t,r,n,i,s,p,f,m,g,A){const y=s/m,v=p/g,x=s/2,_=p/2,b=f/2,w=m+1,E=g+1;let M=0,S=0;const C=new On;for(let s=0;s0?1:-1,c.push(C.x,C.y,C.z),u.push(a/m),u.push(1-s/g),M+=1}}for(let e=0;e0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const r={};for(const e in this.extensions)!0===this.extensions[e]&&(r[e]=!0);return Object.keys(r).length>0&&(t.extensions=r),t}}class to extends Fi{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new hi,this.projectionMatrix=new hi,this.projectionMatrixInverse=new hi,this.coordinateSystem=Qr}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}const ro=new On,no=new rn,io=new rn;class so extends to{constructor(e=50,t=1,r=.1,n=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=n,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=2*Yr*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*Wr*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*Yr*Math.atan(Math.tan(.5*Wr*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,r){ro.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(ro.x,ro.y).multiplyScalar(-e/ro.z),ro.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),r.set(ro.x,ro.y).multiplyScalar(-e/ro.z)}getViewSize(e,t){return this.getViewBounds(e,no,io),t.subVectors(io,no)}setViewOffset(e,t,r,n,i,s){this.aspect=e/t,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=e,this.view.fullHeight=t,this.view.offsetX=r,this.view.offsetY=n,this.view.width=i,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*Wr*this.fov)/this.zoom,r=2*t,n=this.aspect*r,i=-.5*n;const s=this.view;if(null!==this.view&&this.view.enabled){const e=s.fullWidth,o=s.fullHeight;i+=s.offsetX*n/e,t-=s.offsetY*r/o,n*=s.width/e,r*=s.height/o}const o=this.filmOffset;0!==o&&(i+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+n,t,t-r,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const oo=-90;class ao extends Fi{constructor(e,t,r){super(),this.type="CubeCamera",this.renderTarget=r,this.coordinateSystem=null,this.activeMipmapLevel=0;const n=new so(oo,1,e,t);n.layers=this.layers,this.add(n);const i=new so(oo,1,e,t);i.layers=this.layers,this.add(i);const s=new so(oo,1,e,t);s.layers=this.layers,this.add(s);const o=new so(oo,1,e,t);o.layers=this.layers,this.add(o);const a=new so(oo,1,e,t);a.layers=this.layers,this.add(a);const l=new so(oo,1,e,t);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[r,n,i,s,o,a]=t;for(const e of t)this.remove(e);if(e===Qr)r.up.set(0,1,0),r.lookAt(1,0,0),n.up.set(0,1,0),n.lookAt(-1,0,0),i.up.set(0,0,-1),i.lookAt(0,1,0),s.up.set(0,0,1),s.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),a.up.set(0,1,0),a.lookAt(0,0,-1);else{if(e!==Vr)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);r.up.set(0,-1,0),r.lookAt(-1,0,0),n.up.set(0,-1,0),n.lookAt(1,0,0),i.up.set(0,0,1),i.lookAt(0,1,0),s.up.set(0,0,-1),s.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),a.up.set(0,-1,0),a.lookAt(0,0,-1)}for(const e of t)this.add(e),e.updateMatrixWorld()}update(e,t){null===this.parent&&this.updateMatrixWorld();const{renderTarget:r,activeMipmapLevel:n}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[i,s,o,a,l,c]=this.children,u=e.getRenderTarget(),h=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;const f=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0,n),e.render(t,i),e.setRenderTarget(r,1,n),e.render(t,s),e.setRenderTarget(r,2,n),e.render(t,o),e.setRenderTarget(r,3,n),e.render(t,a),e.setRenderTarget(r,4,n),e.render(t,l),r.texture.generateMipmaps=f,e.setRenderTarget(r,5,n),e.render(t,c),e.setRenderTarget(u,h,d),e.xr.enabled=p,r.texture.needsPMREMUpdate=!0}}class lo extends Sn{constructor(e,t,r,n,i,s,o,a,l,c){super(e=void 0!==e?e:[],t=void 0!==t?t:he,r,n,i,s,o,a,l,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class co extends In{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},n=[r,r,r,r,r,r];this.texture=new lo(n,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==t.generateMipmaps&&t.generateMipmaps,this.texture.minFilter=void 0!==t.minFilter?t.minFilter:Ee}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const r={tEquirect:{value:null}},n="\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 \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",i="\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \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",s=new Xs(5,5,5),o=new eo({name:"CubemapFromEquirect",uniforms:Ks(r),vertexShader:n,fragmentShader:i,side:m,blending:A});o.uniforms.tEquirect.value=t;const a=new Ws(s,o),l=t.minFilter;return t.minFilter===Ce&&(t.minFilter=Ee),new ao(1,10,this).update(e,a),t.minFilter=l,a.geometry.dispose(),a.material.dispose(),this}clear(e,t,r,n){const i=e.getRenderTarget();for(let i=0;i<6;i++)e.setRenderTarget(this,i),e.clear(t,r,n);e.setRenderTarget(i)}}const uo=new On,ho=new On,po=new nn;class fo{constructor(e=new On(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,r,n){return this.normal.set(e,t,r),this.constant=n,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,r){const n=uo.subVectors(r,t).cross(ho.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(n,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const r=e.delta(uo),n=this.normal.dot(r);if(0===n)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;const i=-(e.start.dot(this.normal)+this.constant)/n;return i<0||i>1?null:t.copy(e.start).addScaledVector(r,i)}intersectsLine(e){const t=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return t<0&&r>0||r<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const r=t||po.getNormalMatrix(e),n=this.coplanarPoint(uo).applyMatrix4(e),i=this.normal.applyMatrix3(r).normalize();return this.constant=-n.dot(i),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const mo=new ri,go=new On;class Ao{constructor(e=new fo,t=new fo,r=new fo,n=new fo,i=new fo,s=new fo){this.planes=[e,t,r,n,i,s]}set(e,t,r,n,i,s){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(r),o[3].copy(n),o[4].copy(i),o[5].copy(s),this}copy(e){const t=this.planes;for(let r=0;r<6;r++)t[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e,t=Qr){const r=this.planes,n=e.elements,i=n[0],s=n[1],o=n[2],a=n[3],l=n[4],c=n[5],u=n[6],h=n[7],d=n[8],p=n[9],f=n[10],m=n[11],g=n[12],A=n[13],y=n[14],v=n[15];if(r[0].setComponents(a-i,h-l,m-d,v-g).normalize(),r[1].setComponents(a+i,h+l,m+d,v+g).normalize(),r[2].setComponents(a+s,h+c,m+p,v+A).normalize(),r[3].setComponents(a-s,h-c,m-p,v-A).normalize(),r[4].setComponents(a-o,h-u,m-f,v-y).normalize(),t===Qr)r[5].setComponents(a+o,h+u,m+f,v+y).normalize();else{if(t!==Vr)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);r[5].setComponents(o,u,f,y).normalize()}return this}intersectsObject(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),mo.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),mo.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(mo)}intersectsSprite(e){return mo.center.set(0,0,0),mo.radius=.7071067811865476,mo.applyMatrix4(e.matrixWorld),this.intersectsSphere(mo)}intersectsSphere(e){const t=this.planes,r=e.center,n=-e.radius;for(let e=0;e<6;e++)if(t[e].distanceToPoint(r)0?e.max.x:e.min.x,go.y=n.normal.y>0?e.max.y:e.min.y,go.z=n.normal.z>0?e.max.z:e.min.z,n.distanceToPoint(go)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let r=0;r<6;r++)if(t[r].distanceToPoint(e)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function yo(){let e=null,t=!1,r=null,n=null;function i(t,s){r(t,s),n=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==r&&(n=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(n),t=!1},setAnimationLoop:function(e){r=e},setContext:function(t){e=t}}}function vo(e){const t=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),t.get(e)},remove:function(r){r.isInterleavedBufferAttribute&&(r=r.data);const n=t.get(r);n&&(e.deleteBuffer(n.buffer),t.delete(r))},update:function(r,n){if(r.isInterleavedBufferAttribute&&(r=r.data),r.isGLBufferAttribute){const e=t.get(r);return void((!e||e.version 0\n\tvec4 plane;\n\t#ifdef ALPHA_TO_COVERAGE\n\t\tfloat distanceToPlane, distanceGradient;\n\t\tfloat clipOpacity = 1.0;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\tif ( clipOpacity == 0.0 ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tfloat unionClipOpacity = 1.0;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\t\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tclipOpacity *= 1.0 - unionClipOpacity;\n\t\t#endif\n\t\tdiffuseColor.a *= clipOpacity;\n\t\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tbool clipped = true;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tif ( clipped ) discard;\n\t\t#endif\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_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\n#ifdef USE_BATCHING_COLOR\n\tvec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );\n\tvColor.xyz *= batchingColor.xyz;\n#endif",common:"#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};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\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}\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}\nvec3 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} // validated",cube_uv_reflection_fragment:"#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_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\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",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n\tmat3 bm = mat3( batchingMatrix );\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n\ttransformedNormal = bm * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = bm * transformedTangent;\n\t#endif\n#endif\n#ifdef USE_INSTANCING\n\tmat3 im = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n\ttransformedNormal = im * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = im * transformedTangent;\n\t#endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"\nconst mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(\n\tvec3( 0.8224621, 0.177538, 0.0 ),\n\tvec3( 0.0331941, 0.9668058, 0.0 ),\n\tvec3( 0.0170827, 0.0723974, 0.9105199 )\n);\nconst mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.2249401, - 0.2249404, 0.0 ),\n\tvec3( - 0.0420569, 1.0420571, 0.0 ),\n\tvec3( - 0.0196376, - 0.0786361, 1.0982735 )\n);\nvec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );\n}\nvec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );\n}\nvec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferOETF( 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}",envmap_fragment:"#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, envMapRotation * 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",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform mat3 envMapRotation;\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",envmap_pars_fragment:"#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",envmap_pars_vertex:"#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",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * 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#ifdef 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, envMapRotation * 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\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif",envmap_vertex:"#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",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#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",fog_pars_fragment:"#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",gradientmap_pars_fragment:"#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}",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, 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 vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, 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",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\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\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif ( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\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, 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 vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\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 vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\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",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, 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",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"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 vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, 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",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\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 USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\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, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).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_DISPERSION\n\tmaterial.dispersion = dispersion;\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, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).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_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tif( material.anisotropy == 0.0 ) {\n\t\tanisotropyV = vec2( 1.0, 0.0 );\n\t} else {\n\t\tanisotropyV /= material.anisotropy;\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\n\t}\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\tfloat dispersion;\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\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\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}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\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 = F_Schlick( f0, f90, dotVH );\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\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.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\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\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}\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\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 vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\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 vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, 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 vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, 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( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, 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}",lights_fragment_begin:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n\tgeometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\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, geometryPosition, 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.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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, geometryPosition, 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.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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, 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.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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\t#if defined( USE_LIGHT_PROBES )\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\t#endif\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 ], geometryNormal );\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",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\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( geometryNormal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tgl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvFragDepth = 1.0 + gl_Position.w;\n\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\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\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\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",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphinstance_vertex:"#ifdef USE_INSTANCING_MORPH\n\tfloat morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\tfloat morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tmorphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n\t}\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS )\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",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_INSTANCING_MORPH\n\t\tuniform float morphTargetBaseInfluence;\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t#endif\n\tuniform sampler2DArray morphTargetsTexture;\n\tuniform ivec2 morphTargetsTextureSize;\n\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t}\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif",normal_fragment_begin:"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 *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 nonPerturbedNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).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( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#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",normal_pars_vertex:"#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",normal_vertex:"#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",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.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 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"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.;const float ShiftRight8 = 1. / 256.;\nconst float Inv255 = 1. / 255.;\nconst vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\nconst vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );\nconst vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );\nconst vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );\nvec4 packDepthToRGBA( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec4( 0., 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec4( 1., 1., 1., 1. );\n\tfloat vuf;\n\tfloat af = modf( v * PackFactors.a, vuf );\n\tfloat bf = modf( vuf * ShiftRight8, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );\n}\nvec3 packDepthToRGB( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec3( 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec3( 1., 1., 1. );\n\tfloat vuf;\n\tfloat bf = modf( v * PackFactors.b, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec3( vuf * Inv255, gf * PackUpscale, bf );\n}\nvec2 packDepthToRG( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec2( 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec2( 1., 1. );\n\tfloat vuf;\n\tfloat gf = modf( v * 256., vuf );\n\treturn vec2( vuf * Inv255, gf );\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors4 );\n}\nfloat unpackRGBToDepth( const in vec3 v ) {\n\treturn dot( v, UnpackFactors3 );\n}\nfloat unpackRGToDepth( const in vec2 v ) {\n\treturn v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;\n}\nvec4 pack2HalfToRGBA( const in 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( const in 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 depth, const in float near, const in float far ) {\n\treturn depth * ( 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 depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n\tmvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#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",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform 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 shadowIntensity;\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 shadowIntensity;\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 shadowIntensity;\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 shadowIntensity, 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 mix( 1.0, shadow, shadowIntensity );\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 shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tfloat shadow = 1.0;\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\t\n\t\tfloat lightToPositionLength = length( lightToPosition );\n\t\tif ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n\t\t\tfloat dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\t\tdp += shadowBias;\n\t\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\t\tshadow = (\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t\t) * ( 1.0 / 9.0 );\n\t\t\t#else\n\t\t\t\tshadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying 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 shadowIntensity;\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 shadowIntensity;\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 shadowIntensity;\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",shadowmap_vertex:"#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",shadowmask_pars_fragment:"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.shadowIntensity, 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.shadowIntensity, 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.shadowIntensity, 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}",skinbase_vertex:"#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",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tint size = textureSize( boneTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",skinning_vertex:"#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",skinnormal_vertex:"#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",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 CineonToneMapping( 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}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n\tvec3( 0.6274, 0.0691, 0.0164 ),\n\tvec3( 0.3293, 0.9195, 0.0880 ),\n\tvec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n\tvec3 x2 = x * x;\n\tvec3 x4 = x2 * x2;\n\treturn + 15.5 * x4 * x2\n\t\t- 40.14 * x4 * x\n\t\t+ 31.96 * x4\n\t\t- 6.868 * x2 * x\n\t\t+ 0.4298 * x2\n\t\t+ 0.1191 * x\n\t\t- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n\tconst mat3 AgXInsetMatrix = mat3(\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n\t);\n\tconst mat3 AgXOutsetMatrix = mat3(\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n\t);\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\n\tcolor *= toneMappingExposure;\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor = AgXInsetMatrix * color;\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n\tcolor = clamp( color, 0.0, 1.0 );\n\tcolor = agxDefaultContrastApprox( color );\n\tcolor = AgXOutsetMatrix * color;\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n\tcolor = clamp( color, 0.0, 1.0 );\n\treturn color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n\tconst float StartCompression = 0.8 - 0.04;\n\tconst float Desaturation = 0.15;\n\tcolor *= toneMappingExposure;\n\tfloat x = min( color.r, min( color.g, color.b ) );\n\tfloat offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n\tcolor -= offset;\n\tfloat peak = max( color.r, max( color.g, color.b ) );\n\tif ( peak < StartCompression ) return color;\n\tfloat d = 1. - StartCompression;\n\tfloat newPeak = 1. - d * d / ( peak + d - StartCompression );\n\tcolor *= newPeak / peak;\n\tfloat g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n\treturn mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#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, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#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\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\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 lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\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 dispersion, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec4 transmittedLight;\n\t\tvec3 transmittance;\n\t\t#ifdef USE_DISPERSION\n\t\t\tfloat halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n\t\t\tvec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n\t\t\tfor ( int i = 0; i < 3; i ++ ) {\n\t\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n\t\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\n\t\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\t\trefractionCoords += 1.0;\n\t\t\t\trefractionCoords /= 2.0;\n\t\t\n\t\t\t\tvec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n\t\t\t\ttransmittedLight[ i ] = transmissionSample[ i ];\n\t\t\t\ttransmittedLight.a += transmissionSample.a;\n\t\t\t\ttransmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n\t\t\t}\n\t\t\ttransmittedLight.a /= 3.0;\n\t\t\n\t\t#else\n\t\t\n\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\trefractionCoords += 1.0;\n\t\t\trefractionCoords /= 2.0;\n\t\t\ttransmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\t\ttransmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\t\n\t\t#endif\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#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_BATCHING\n\t\tworldPosition = batchingMatrix * worldPosition;\n\t#endif\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"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}",background_frag:"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 \n\t#include \n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#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;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, backgroundRotation * 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 \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"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 \n\t#include \n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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#elif DEPTH_PACKING == 3202\n\t\tgl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\n\t#elif DEPTH_PACKING == 3203\n\t\tgl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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, vLightMapUv );\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 \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_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 USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_DISPERSION\n\tuniform float dispersion;\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_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \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 + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\t#include \n\t#include \n\t#include \n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n}"},bo={common:{diffuse:{value:new es(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new nn},alphaMap:{value:null},alphaMapTransform:{value:new nn},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new nn}},envmap:{envMap:{value:null},envMapRotation:{value:new nn},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new nn}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new nn}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new nn},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new nn},normalScale:{value:new rn(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new nn},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new nn}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new nn}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new nn}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new es(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,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 es(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new nn},alphaTest:{value:0},uvTransform:{value:new nn}},sprite:{diffuse:{value:new es(16777215)},opacity:{value:1},center:{value:new rn(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new nn},alphaMap:{value:null},alphaMapTransform:{value:new nn},alphaTest:{value:0}}},wo={basic:{uniforms:$s([bo.common,bo.specularmap,bo.envmap,bo.aomap,bo.lightmap,bo.fog]),vertexShader:_o.meshbasic_vert,fragmentShader:_o.meshbasic_frag},lambert:{uniforms:$s([bo.common,bo.specularmap,bo.envmap,bo.aomap,bo.lightmap,bo.emissivemap,bo.bumpmap,bo.normalmap,bo.displacementmap,bo.fog,bo.lights,{emissive:{value:new es(0)}}]),vertexShader:_o.meshlambert_vert,fragmentShader:_o.meshlambert_frag},phong:{uniforms:$s([bo.common,bo.specularmap,bo.envmap,bo.aomap,bo.lightmap,bo.emissivemap,bo.bumpmap,bo.normalmap,bo.displacementmap,bo.fog,bo.lights,{emissive:{value:new es(0)},specular:{value:new es(1118481)},shininess:{value:30}}]),vertexShader:_o.meshphong_vert,fragmentShader:_o.meshphong_frag},standard:{uniforms:$s([bo.common,bo.envmap,bo.aomap,bo.lightmap,bo.emissivemap,bo.bumpmap,bo.normalmap,bo.displacementmap,bo.roughnessmap,bo.metalnessmap,bo.fog,bo.lights,{emissive:{value:new es(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:_o.meshphysical_vert,fragmentShader:_o.meshphysical_frag},toon:{uniforms:$s([bo.common,bo.aomap,bo.lightmap,bo.emissivemap,bo.bumpmap,bo.normalmap,bo.displacementmap,bo.gradientmap,bo.fog,bo.lights,{emissive:{value:new es(0)}}]),vertexShader:_o.meshtoon_vert,fragmentShader:_o.meshtoon_frag},matcap:{uniforms:$s([bo.common,bo.bumpmap,bo.normalmap,bo.displacementmap,bo.fog,{matcap:{value:null}}]),vertexShader:_o.meshmatcap_vert,fragmentShader:_o.meshmatcap_frag},points:{uniforms:$s([bo.points,bo.fog]),vertexShader:_o.points_vert,fragmentShader:_o.points_frag},dashed:{uniforms:$s([bo.common,bo.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:_o.linedashed_vert,fragmentShader:_o.linedashed_frag},depth:{uniforms:$s([bo.common,bo.displacementmap]),vertexShader:_o.depth_vert,fragmentShader:_o.depth_frag},normal:{uniforms:$s([bo.common,bo.bumpmap,bo.normalmap,bo.displacementmap,{opacity:{value:1}}]),vertexShader:_o.meshnormal_vert,fragmentShader:_o.meshnormal_frag},sprite:{uniforms:$s([bo.sprite,bo.fog]),vertexShader:_o.sprite_vert,fragmentShader:_o.sprite_frag},background:{uniforms:{uvTransform:{value:new nn},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:_o.background_vert,fragmentShader:_o.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new nn}},vertexShader:_o.backgroundCube_vert,fragmentShader:_o.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:_o.cube_vert,fragmentShader:_o.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:_o.equirect_vert,fragmentShader:_o.equirect_frag},distanceRGBA:{uniforms:$s([bo.common,bo.displacementmap,{referencePosition:{value:new On},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:_o.distanceRGBA_vert,fragmentShader:_o.distanceRGBA_frag},shadow:{uniforms:$s([bo.lights,bo.fog,{color:{value:new es(0)},opacity:{value:1}}]),vertexShader:_o.shadow_vert,fragmentShader:_o.shadow_frag}};wo.physical={uniforms:$s([wo.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new nn},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new nn},clearcoatNormalScale:{value:new rn(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new nn},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new nn},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new nn},sheen:{value:0},sheenColor:{value:new es(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new nn},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new nn},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new nn},transmissionSamplerSize:{value:new rn},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new nn},attenuationDistance:{value:0},attenuationColor:{value:new es(0)},specularColor:{value:new es(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new nn},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new nn},anisotropyVector:{value:new rn},anisotropyMap:{value:null},anisotropyMapTransform:{value:new nn}}]),vertexShader:_o.meshphysical_vert,fragmentShader:_o.meshphysical_frag};const Eo={r:0,b:0,g:0},Mo=new _i,So=new hi;function Co(e,t,r,n,i,s,o){const a=new es(0);let l,c,u=!0===s?0:1,h=null,d=0,p=null;function g(e){let n=!0===e.isScene?e.background:null;return n&&n.isTexture&&(n=(e.backgroundBlurriness>0?r:t).get(n)),n}function A(t,r){t.getRGB(Eo,Js(e)),n.buffers.color.setClear(Eo.r,Eo.g,Eo.b,r,o)}return{getClearColor:function(){return a},setClearColor:function(e,t=1){a.set(e),u=t,A(a,u)},getClearAlpha:function(){return u},setClearAlpha:function(e){u=e,A(a,u)},render:function(t){let r=!1;const i=g(t);null===i?A(a,u):i&&i.isColor&&(A(i,1),r=!0);const s=e.xr.getEnvironmentBlendMode();"additive"===s?n.buffers.color.setClear(0,0,0,1,o):"alpha-blend"===s&&n.buffers.color.setClear(0,0,0,0,o),(e.autoClear||r)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil))},addToRenderList:function(t,r){const n=g(r);n&&(n.isCubeTexture||n.mapping===me)?(void 0===c&&(c=new Ws(new Xs(1,1,1),new eo({name:"BackgroundCubeMaterial",uniforms:Ks(wo.backgroundCube.uniforms),vertexShader:wo.backgroundCube.vertexShader,fragmentShader:wo.backgroundCube.fragmentShader,side:m,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(e,t,r){this.matrixWorld.copyPosition(r.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(c)),Mo.copy(r.backgroundRotation),Mo.x*=-1,Mo.y*=-1,Mo.z*=-1,n.isCubeTexture&&!1===n.isRenderTargetTexture&&(Mo.y*=-1,Mo.z*=-1),c.material.uniforms.envMap.value=n,c.material.uniforms.flipEnvMap.value=n.isCubeTexture&&!1===n.isRenderTargetTexture?-1:1,c.material.uniforms.backgroundBlurriness.value=r.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=r.backgroundIntensity,c.material.uniforms.backgroundRotation.value.setFromMatrix4(So.makeRotationFromEuler(Mo)),c.material.toneMapped=An.getTransfer(n.colorSpace)!==ir,h===n&&d===n.version&&p===e.toneMapping||(c.material.needsUpdate=!0,h=n,d=n.version,p=e.toneMapping),c.layers.enableAll(),t.unshift(c,c.geometry,c.material,0,0,null)):n&&n.isTexture&&(void 0===l&&(l=new Ws(new xo(2,2),new eo({name:"BackgroundMaterial",uniforms:Ks(wo.background.uniforms),vertexShader:wo.background.vertexShader,fragmentShader:wo.background.fragmentShader,side:f,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(l)),l.material.uniforms.t2D.value=n,l.material.uniforms.backgroundIntensity.value=r.backgroundIntensity,l.material.toneMapped=An.getTransfer(n.colorSpace)!==ir,!0===n.matrixAutoUpdate&&n.updateMatrix(),l.material.uniforms.uvTransform.value.copy(n.matrix),h===n&&d===n.version&&p===e.toneMapping||(l.material.needsUpdate=!0,h=n,d=n.version,p=e.toneMapping),l.layers.enableAll(),t.unshift(l,l.geometry,l.material,0,0,null))}}}function To(e,t){const r=e.getParameter(e.MAX_VERTEX_ATTRIBS),n={},i=c(null);let s=i,o=!1;function a(t){return e.bindVertexArray(t)}function l(t){return e.deleteVertexArray(t)}function c(e){const t=[],n=[],i=[];for(let e=0;e=0){const r=i[t];let n=o[t];if(void 0===n&&("instanceMatrix"===t&&e.instanceMatrix&&(n=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(n=e.instanceColor)),void 0===r)return!0;if(r.attribute!==n)return!0;if(n&&r.data!==n.data)return!0;a++}return s.attributesNum!==a||s.index!==n}(r,m,l,g),A&&function(e,t,r,n){const i={},o=t.attributes;let a=0;const l=r.getAttributes();for(const t in l)if(l[t].location>=0){let r=o[t];void 0===r&&("instanceMatrix"===t&&e.instanceMatrix&&(r=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(r=e.instanceColor));const n={};n.attribute=r,r&&r.data&&(n.data=r.data),i[t]=n,a++}s.attributes=i,s.attributesNum=a,s.index=n}(r,m,l,g),null!==g&&t.update(g,e.ELEMENT_ARRAY_BUFFER),(A||o)&&(o=!1,function(r,n,i,s){u();const o=s.attributes,a=i.getAttributes(),l=n.defaultAttributeValues;for(const n in a){const i=a[n];if(i.location>=0){let a=o[n];if(void 0===a&&("instanceMatrix"===n&&r.instanceMatrix&&(a=r.instanceMatrix),"instanceColor"===n&&r.instanceColor&&(a=r.instanceColor)),void 0!==a){const n=a.normalized,o=a.itemSize,l=t.get(a);if(void 0===l)continue;const c=l.buffer,u=l.type,p=l.bytesPerElement,m=u===e.INT||u===e.UNSIGNED_INT||a.gpuType===Le;if(a.isInterleavedBufferAttribute){const t=a.data,l=t.stride,g=a.offset;if(t.isInstancedInterleavedBuffer){for(let e=0;e0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let o=void 0!==r.precision?r.precision:"highp";const a=s(o);a!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",a,"instead."),o=a);const l=!0===r.logarithmicDepthBuffer,c=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),u=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS);return{isWebGL2:!0,getMaxAnisotropy:function(){if(void 0!==i)return i;if(!0===t.has("EXT_texture_filter_anisotropic")){const r=t.get("EXT_texture_filter_anisotropic");i=e.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i},getMaxPrecision:s,textureFormatReadable:function(t){return t===Ve||n.convert(t)===e.getParameter(e.IMPLEMENTATION_COLOR_READ_FORMAT)},textureTypeReadable:function(r){const i=r===Ne&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return!(r!==Ie&&n.convert(r)!==e.getParameter(e.IMPLEMENTATION_COLOR_READ_TYPE)&&r!==Oe&&!i)},precision:o,logarithmicDepthBuffer:l,maxTextures:c,maxVertexTextures:u,maxTextureSize:e.getParameter(e.MAX_TEXTURE_SIZE),maxCubemapSize:e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),maxAttributes:e.getParameter(e.MAX_VERTEX_ATTRIBS),maxVertexUniforms:e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),maxVaryings:e.getParameter(e.MAX_VARYING_VECTORS),maxFragmentUniforms:e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),vertexTextures:u>0,maxSamples:e.getParameter(e.MAX_SAMPLES)}}function Bo(e){const t=this;let r=null,n=0,i=!1,s=!1;const o=new fo,a=new nn,l={value:null,needsUpdate:!1};function c(e,r,n,i){const s=null!==e?e.length:0;let c=null;if(0!==s){if(c=l.value,!0!==i||null===c){const t=n+4*s,i=r.matrixWorldInverse;a.getNormalMatrix(i),(null===c||c.length0),t.numPlanes=n,t.numIntersection=0);else{const e=s?0:n,t=4*e;let i=f.clippingState||null;l.value=i,i=c(h,a,t,u);for(let e=0;e!==t;++e)i[e]=r[e];f.clippingState=i,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=e}}}function Po(e){let t=new WeakMap;function r(e,t){return t===pe?e.mapping=he:t===fe&&(e.mapping=de),e}function n(e){const r=e.target;r.removeEventListener("dispose",n);const i=t.get(r);void 0!==i&&(t.delete(r),i.dispose())}return{get:function(i){if(i&&i.isTexture){const s=i.mapping;if(s===pe||s===fe){if(t.has(i))return r(t.get(i).texture,i.mapping);{const s=i.image;if(s&&s.height>0){const o=new co(s.height);return o.fromEquirectangularTexture(e,i),t.set(i,o),i.addEventListener("dispose",n),r(o.texture,i.mapping)}return null}}}return i},dispose:function(){t=new WeakMap}}}class Lo extends to{constructor(e=-1,t=1,r=1,n=-1,i=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=r,this.bottom=n,this.near=i,this.far=s,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,r,n,i,s){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=e,this.view.fullHeight=t,this.view.offsetX=r,this.view.offsetY=n,this.view.width=i,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,n=(this.top+this.bottom)/2;let i=r-e,s=r+e,o=n+t,a=n-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=e*this.view.offsetX,s=i+e*this.view.width,o-=t*this.view.offsetY,a=o-t*this.view.height}this.projectionMatrix.makeOrthographic(i,s,o,a,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}const Do=[.125,.215,.35,.446,.526,.582],Oo=new Lo,No=new es;let Uo=null,Fo=0,ko=0,zo=!1;const Go=(1+Math.sqrt(5))/2,Qo=1/Go,Vo=[new On(-Go,Qo,0),new On(Go,Qo,0),new On(-Qo,0,Go),new On(Qo,0,Go),new On(0,Go,-Qo),new On(0,Go,Qo),new On(-1,1,-1),new On(1,1,-1),new On(-1,1,1),new On(1,1,1)];class Ho{constructor(e){this._renderer=e,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(e,t=0,r=.1,n=100){Uo=this._renderer.getRenderTarget(),Fo=this._renderer.getActiveCubeFace(),ko=this._renderer.getActiveMipmapLevel(),zo=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const i=this._allocateTargets();return i.depthBuffer=!0,this._sceneToCubeUV(e,r,n,i),t>0&&this._blur(i,0,0,t),this._applyPMREM(i),this._cleanup(i),i}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=Yo(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=Wo(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;ee-4?a=Do[o-e+4-1]:0===o&&(a=0),n.push(a);const l=1/(s-2),c=-l,u=1+l,h=[c,c,u,c,u,u,c,c,u,u,c,u],d=6,p=6,f=3,m=2,g=1,A=new Float32Array(f*p*d),y=new Float32Array(m*p*d),v=new Float32Array(g*p*d);for(let e=0;e2?0:-1,n=[t,r,0,t+2/3,r,0,t+2/3,r+1,0,t,r,0,t+2/3,r+1,0,t,r+1,0];A.set(n,f*p*e),y.set(h,m*p*e);const i=[e,e,e,e,e,e];v.set(i,g*p*e)}const x=new Is;x.setAttribute("position",new ds(A,f)),x.setAttribute("uv",new ds(y,m)),x.setAttribute("faceIndex",new ds(v,g)),t.push(x),i>4&&i--}return{lodPlanes:t,sizeLods:r,sigmas:n}}(n)),this._blurMaterial=function(e,t,r){const n=new Float32Array(20),i=new On(0,1,0);return new eo({name:"SphericalGaussianBlur",defines:{n:20,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/r,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:"\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",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 \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:A,depthTest:!1,depthWrite:!1})}(n,e,t)}return n}_compileMaterial(e){const t=new Ws(this._lodPlanes[0],e);this._renderer.compile(t,Oo)}_sceneToCubeUV(e,t,r,n){const i=new so(90,1,t,r),s=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],a=this._renderer,l=a.autoClear,c=a.toneMapping;a.getClearColor(No),a.toneMapping=ee,a.autoClear=!1;const u=new is({name:"PMREM.Background",side:m,depthWrite:!1,depthTest:!1}),h=new Ws(new Xs,u);let d=!1;const p=e.background;p?p.isColor&&(u.color.copy(p),e.background=null,d=!0):(u.color.copy(No),d=!0);for(let t=0;t<6;t++){const r=t%3;0===r?(i.up.set(0,s[t],0),i.lookAt(o[t],0,0)):1===r?(i.up.set(0,0,s[t]),i.lookAt(0,o[t],0)):(i.up.set(0,s[t],0),i.lookAt(0,0,o[t]));const l=this._cubeSize;qo(n,r*l,t>2?l:0,l,l),a.setRenderTarget(n),d&&a.render(h,i),a.render(e,i)}h.geometry.dispose(),h.material.dispose(),a.toneMapping=c,a.autoClear=l,e.background=p}_textureToCubeUV(e,t){const r=this._renderer,n=e.mapping===he||e.mapping===de;n?(null===this._cubemapMaterial&&(this._cubemapMaterial=Yo()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=Wo());const i=n?this._cubemapMaterial:this._equirectMaterial,s=new Ws(this._lodPlanes[0],i);i.uniforms.envMap.value=e;const o=this._cubeSize;qo(t,0,0,3*o,2*o),r.setRenderTarget(t),r.render(s,Oo)}_applyPMREM(e){const t=this._renderer,r=t.autoClear;t.autoClear=!1;const n=this._lodPlanes.length;for(let t=1;t20&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);const m=[];let g=0;for(let e=0;e<20;++e){const t=e/p,r=Math.exp(-t*t/2);m.push(r),0===e?g+=r:eA-4?n-A+4:0),4*(this._cubeSize-y),3*y,2*y),a.setRenderTarget(t),a.render(c,Oo)}}function jo(e,t,r){const n=new In(e,t,r);return n.texture.mapping=me,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function qo(e,t,r,n,i){e.viewport.set(t,r,n,i),e.scissor.set(t,r,n,i)}function Wo(){return new eo({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:"\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",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 \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:A,depthTest:!1,depthWrite:!1})}function Yo(){return new eo({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:"\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",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:A,depthTest:!1,depthWrite:!1})}function Xo(e){let t=new WeakMap,r=null;function n(e){const r=e.target;r.removeEventListener("dispose",n);const i=t.get(r);void 0!==i&&(t.delete(r),i.dispose())}return{get:function(i){if(i&&i.isTexture){const s=i.mapping,o=s===pe||s===fe,a=s===he||s===de;if(o||a){let s=t.get(i);const l=void 0!==s?s.texture.pmremVersion:0;if(i.isRenderTargetTexture&&i.pmremVersion!==l)return null===r&&(r=new Ho(e)),s=o?r.fromEquirectangular(i,s):r.fromCubemap(i,s),s.texture.pmremVersion=i.pmremVersion,t.set(i,s),s.texture;if(void 0!==s)return s.texture;{const l=i.image;return o&&l&&l.height>0||a&&l&&function(e){let t=0;for(let r=0;r<6;r++)void 0!==e[r]&&t++;return 6===t}(l)?(null===r&&(r=new Ho(e)),s=o?r.fromEquirectangular(i):r.fromCubemap(i),s.texture.pmremVersion=i.pmremVersion,t.set(i,s),i.addEventListener("dispose",n),s.texture):null}}}return i},dispose:function(){t=new WeakMap,null!==r&&(r.dispose(),r=null)}}}function Ko(e){const t={};function r(r){if(void 0!==t[r])return t[r];let n;switch(r){case"WEBGL_depth_texture":n=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=e.getExtension(r)}return t[r]=n,n}return{has:function(e){return null!==r(e)},init:function(){r("EXT_color_buffer_float"),r("WEBGL_clip_cull_distance"),r("OES_texture_float_linear"),r("EXT_color_buffer_half_float"),r("WEBGL_multisampled_render_to_texture"),r("WEBGL_render_shared_exponent")},get:function(e){const t=r(e);return null===t&&dn("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function $o(e,t,r,n){const i={},s=new WeakMap;function o(e){const a=e.target;null!==a.index&&t.remove(a.index);for(const e in a.attributes)t.remove(a.attributes[e]);for(const e in a.morphAttributes){const r=a.morphAttributes[e];for(let e=0,n=r.length;et.maxTextureSize&&(x=Math.ceil(v/t.maxTextureSize),v=t.maxTextureSize);const _=new Float32Array(v*x*4*u),b=new Rn(_,v,x,u);b.type=Oe,b.needsUpdate=!0;const w=4*y;for(let M=0;M0)return e;const i=t*r;let s=la[i];if(void 0===s&&(s=new Float32Array(i),la[i]=s),0!==t){n.toArray(s,0);for(let n=1,i=0;n!==t;++n)i+=r,e[n].toArray(s,i)}return s}function fa(e,t){if(e.length!==t.length)return!1;for(let r=0,n=e.length;r":" "} ${i}: ${r[e]}`)}return n.join("\n")}(e.getShaderSource(t),n)}return i}function hl(e,t){const r=function(e){const t=An.getPrimaries(An.workingColorSpace),r=An.getPrimaries(e);let n;switch(t===r?n="":t===or&&r===sr?n="LinearDisplayP3ToLinearSRGB":t===sr&&r===or&&(n="LinearSRGBToLinearDisplayP3"),e){case er:case rr:return[n,"LinearTransferOETF"];case Zt:case tr:return[n,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",e),[n,"LinearTransferOETF"]}}(t);return`vec4 ${e}( vec4 value ) { return ${r[0]}( ${r[1]}( value ) ); }`}function dl(e,t){let r;switch(t){case te:r="Linear";break;case re:r="Reinhard";break;case ne:r="Cineon";break;case ie:r="ACESFilmic";break;case oe:r="AgX";break;case ae:r="Neutral";break;case se:r="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),r="Linear"}return"vec3 "+e+"( vec3 color ) { return "+r+"ToneMapping( color ); }"}const pl=new On;function fl(e){return""!==e}function ml(e,t){const r=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,r).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function gl(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const Al=/^[ \t]*#include +<([\w\d./]+)>/gm;function yl(e){return e.replace(Al,xl)}const vl=new Map;function xl(e,t){let r=_o[t];if(void 0===r){const e=vl.get(t);if(void 0===e)throw new Error("Can not resolve #include <"+t+">");r=_o[e],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,e)}return yl(r)}const _l=/#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 bl(e){return e.replace(_l,wl)}function wl(e,t,r,n){let i="";for(let e=parseInt(t);e0&&(v+="\n"),x=["#define SHADER_TYPE "+r.shaderType,"#define SHADER_NAME "+r.shaderName,A].filter(fl).join("\n"),x.length>0&&(x+="\n")):(v=[El(r),"#define SHADER_TYPE "+r.shaderType,"#define SHADER_NAME "+r.shaderName,A,r.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",r.batching?"#define USE_BATCHING":"",r.batchingColor?"#define USE_BATCHING_COLOR":"",r.instancing?"#define USE_INSTANCING":"",r.instancingColor?"#define USE_INSTANCING_COLOR":"",r.instancingMorph?"#define USE_INSTANCING_MORPH":"",r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+u:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",r.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",r.displacementMap?"#define USE_DISPLACEMENTMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.anisotropy?"#define USE_ANISOTROPY":"",r.anisotropyMap?"#define USE_ANISOTROPYMAP":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",r.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",r.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.alphaHash?"#define USE_ALPHAHASH":"",r.transmission?"#define USE_TRANSMISSION":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.thicknessMap?"#define USE_THICKNESSMAP":"",r.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",r.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",r.mapUv?"#define MAP_UV "+r.mapUv:"",r.alphaMapUv?"#define ALPHAMAP_UV "+r.alphaMapUv:"",r.lightMapUv?"#define LIGHTMAP_UV "+r.lightMapUv:"",r.aoMapUv?"#define AOMAP_UV "+r.aoMapUv:"",r.emissiveMapUv?"#define EMISSIVEMAP_UV "+r.emissiveMapUv:"",r.bumpMapUv?"#define BUMPMAP_UV "+r.bumpMapUv:"",r.normalMapUv?"#define NORMALMAP_UV "+r.normalMapUv:"",r.displacementMapUv?"#define DISPLACEMENTMAP_UV "+r.displacementMapUv:"",r.metalnessMapUv?"#define METALNESSMAP_UV "+r.metalnessMapUv:"",r.roughnessMapUv?"#define ROUGHNESSMAP_UV "+r.roughnessMapUv:"",r.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+r.anisotropyMapUv:"",r.clearcoatMapUv?"#define CLEARCOATMAP_UV "+r.clearcoatMapUv:"",r.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+r.clearcoatNormalMapUv:"",r.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+r.clearcoatRoughnessMapUv:"",r.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+r.iridescenceMapUv:"",r.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+r.iridescenceThicknessMapUv:"",r.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+r.sheenColorMapUv:"",r.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+r.sheenRoughnessMapUv:"",r.specularMapUv?"#define SPECULARMAP_UV "+r.specularMapUv:"",r.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+r.specularColorMapUv:"",r.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+r.specularIntensityMapUv:"",r.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+r.transmissionMapUv:"",r.thicknessMapUv?"#define THICKNESSMAP_UV "+r.thicknessMapUv:"",r.vertexTangents&&!1===r.flatShading?"#define USE_TANGENT":"",r.vertexColors?"#define USE_COLOR":"",r.vertexAlphas?"#define USE_COLOR_ALPHA":"",r.vertexUv1s?"#define USE_UV1":"",r.vertexUv2s?"#define USE_UV2":"",r.vertexUv3s?"#define USE_UV3":"",r.pointsUvs?"#define USE_POINTS_UV":"",r.flatShading?"#define FLAT_SHADED":"",r.skinning?"#define USE_SKINNING":"",r.morphTargets?"#define USE_MORPHTARGETS":"",r.morphNormals&&!1===r.flatShading?"#define USE_MORPHNORMALS":"",r.morphColors?"#define USE_MORPHCOLORS":"",r.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+r.morphTextureStride:"",r.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+r.morphTargetsCount:"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+l:"",r.sizeAttenuation?"#define USE_SIZEATTENUATION":"",r.numLightProbes>0?"#define USE_LIGHT_PROBES":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","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","#ifdef USE_INSTANCING_MORPH","\tuniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","\tattribute vec2 uv1;","#endif","#ifdef USE_UV2","\tattribute vec2 uv2;","#endif","#ifdef USE_UV3","\tattribute vec2 uv3;","#endif","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(fl).join("\n"),x=[El(r),"#define SHADER_TYPE "+r.shaderType,"#define SHADER_NAME "+r.shaderName,A,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",r.map?"#define USE_MAP":"",r.matcap?"#define USE_MATCAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+c:"",r.envMap?"#define "+u:"",r.envMap?"#define "+f:"",m?"#define CUBEUV_TEXEL_WIDTH "+m.texelWidth:"",m?"#define CUBEUV_TEXEL_HEIGHT "+m.texelHeight:"",m?"#define CUBEUV_MAX_MIP "+m.maxMip+".0":"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",r.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.anisotropy?"#define USE_ANISOTROPY":"",r.anisotropyMap?"#define USE_ANISOTROPYMAP":"",r.clearcoat?"#define USE_CLEARCOAT":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.dispersion?"#define USE_DISPERSION":"",r.iridescence?"#define USE_IRIDESCENCE":"",r.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",r.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",r.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.alphaTest?"#define USE_ALPHATEST":"",r.alphaHash?"#define USE_ALPHAHASH":"",r.sheen?"#define USE_SHEEN":"",r.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",r.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",r.transmission?"#define USE_TRANSMISSION":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.thicknessMap?"#define USE_THICKNESSMAP":"",r.vertexTangents&&!1===r.flatShading?"#define USE_TANGENT":"",r.vertexColors||r.instancingColor||r.batchingColor?"#define USE_COLOR":"",r.vertexAlphas?"#define USE_COLOR_ALPHA":"",r.vertexUv1s?"#define USE_UV1":"",r.vertexUv2s?"#define USE_UV2":"",r.vertexUv3s?"#define USE_UV3":"",r.pointsUvs?"#define USE_POINTS_UV":"",r.gradientMap?"#define USE_GRADIENTMAP":"",r.flatShading?"#define FLAT_SHADED":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+l:"",r.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",r.numLightProbes>0?"#define USE_LIGHT_PROBES":"",r.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",r.toneMapping!==ee?"#define TONE_MAPPING":"",r.toneMapping!==ee?_o.tonemapping_pars_fragment:"",r.toneMapping!==ee?dl("toneMapping",r.toneMapping):"",r.dithering?"#define DITHERING":"",r.opaque?"#define OPAQUE":"",_o.colorspace_pars_fragment,hl("linearToOutputTexel",r.outputColorSpace),(An.getLuminanceCoefficients(pl),["float luminance( const in vec3 rgb ) {",`\tconst vec3 weights = vec3( ${pl.x.toFixed(4)}, ${pl.y.toFixed(4)}, ${pl.z.toFixed(4)} );`,"\treturn dot( weights, rgb );","}"].join("\n")),r.useDepthPacking?"#define DEPTH_PACKING "+r.depthPacking:"","\n"].filter(fl).join("\n")),o=yl(o),o=ml(o,r),o=gl(o,r),a=yl(a),a=ml(a,r),a=gl(a,r),o=bl(o),a=bl(a),!0!==r.isRawShaderMaterial&&(_="#version 300 es\n",v=[g,"#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+v,x=["#define varying in",r.glslVersion===Gr?"":"layout(location = 0) out highp vec4 pc_fragColor;",r.glslVersion===Gr?"":"#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"+x);const b=_+v+o,w=_+x+a,E=ll(i,i.VERTEX_SHADER,b),M=ll(i,i.FRAGMENT_SHADER,w);function S(t){if(e.debug.checkShaderErrors){const r=i.getProgramInfoLog(y).trim(),n=i.getShaderInfoLog(E).trim(),s=i.getShaderInfoLog(M).trim();let o=!0,a=!0;if(!1===i.getProgramParameter(y,i.LINK_STATUS))if(o=!1,"function"==typeof e.debug.onShaderError)e.debug.onShaderError(i,y,E,M);else{const e=ul(i,E,"vertex"),n=ul(i,M,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(y,i.VALIDATE_STATUS)+"\n\nMaterial Name: "+t.name+"\nMaterial Type: "+t.type+"\n\nProgram Info Log: "+r+"\n"+e+"\n"+n)}else""!==r?console.warn("THREE.WebGLProgram: Program Info Log:",r):""!==n&&""!==s||(a=!1);a&&(t.diagnostics={runnable:o,programLog:r,vertexShader:{log:n,prefix:v},fragmentShader:{log:s,prefix:x}})}i.deleteShader(E),i.deleteShader(M),C=new al(i,y),T=function(e,t){const r={},n=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let i=0;i0,X=s.clearcoat>0,K=s.dispersion>0,$=s.iridescence>0,J=s.sheen>0,Z=s.transmission>0,te=Y&&!!s.anisotropyMap,re=X&&!!s.clearcoatMap,ne=X&&!!s.clearcoatNormalMap,ie=X&&!!s.clearcoatRoughnessMap,se=$&&!!s.iridescenceMap,oe=$&&!!s.iridescenceThicknessMap,ae=J&&!!s.sheenColorMap,le=J&&!!s.sheenRoughnessMap,ce=!!s.specularMap,ue=!!s.specularColorMap,he=!!s.specularIntensityMap,de=Z&&!!s.transmissionMap,pe=Z&&!!s.thicknessMap,fe=!!s.gradientMap,ge=!!s.alphaMap,Ae=s.alphaTest>0,ye=!!s.alphaHash,ve=!!s.extensions;let xe=ee;s.toneMapped&&(null!==D&&!0!==D.isXRRenderTarget||(xe=e.toneMapping));const _e={shaderID:S,shaderType:s.type,shaderName:s.name,vertexShader:I,fragmentShader:R,defines:s.defines,customVertexShaderID:B,customFragmentShaderID:P,isRawShaderMaterial:!0===s.isRawShaderMaterial,glslVersion:s.glslVersion,precision:p,batching:N,batchingColor:N&&null!==x._colorsTexture,instancing:O,instancingColor:O&&null!==x.instanceColor,instancingMorph:O&&null!==x.morphTexture,supportsVertexTextures:d,outputColorSpace:null===D?e.outputColorSpace:!0===D.isXRRenderTarget?D.texture.colorSpace:er,alphaToCoverage:!!s.alphaToCoverage,map:U,matcap:F,envMap:k,envMapMode:k&&E.mapping,envMapCubeUVHeight:M,aoMap:z,lightMap:G,bumpMap:Q,normalMap:V,displacementMap:d&&H,emissiveMap:j,normalMapObjectSpace:V&&s.normalMapType===$t,normalMapTangentSpace:V&&s.normalMapType===Kt,metalnessMap:q,roughnessMap:W,anisotropy:Y,anisotropyMap:te,clearcoat:X,clearcoatMap:re,clearcoatNormalMap:ne,clearcoatRoughnessMap:ie,dispersion:K,iridescence:$,iridescenceMap:se,iridescenceThicknessMap:oe,sheen:J,sheenColorMap:ae,sheenRoughnessMap:le,specularMap:ce,specularColorMap:ue,specularIntensityMap:he,transmission:Z,transmissionMap:de,thicknessMap:pe,gradientMap:fe,opaque:!1===s.transparent&&s.blending===y&&!1===s.alphaToCoverage,alphaMap:ge,alphaTest:Ae,alphaHash:ye,combine:s.combine,mapUv:U&&A(s.map.channel),aoMapUv:z&&A(s.aoMap.channel),lightMapUv:G&&A(s.lightMap.channel),bumpMapUv:Q&&A(s.bumpMap.channel),normalMapUv:V&&A(s.normalMap.channel),displacementMapUv:H&&A(s.displacementMap.channel),emissiveMapUv:j&&A(s.emissiveMap.channel),metalnessMapUv:q&&A(s.metalnessMap.channel),roughnessMapUv:W&&A(s.roughnessMap.channel),anisotropyMapUv:te&&A(s.anisotropyMap.channel),clearcoatMapUv:re&&A(s.clearcoatMap.channel),clearcoatNormalMapUv:ne&&A(s.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ie&&A(s.clearcoatRoughnessMap.channel),iridescenceMapUv:se&&A(s.iridescenceMap.channel),iridescenceThicknessMapUv:oe&&A(s.iridescenceThicknessMap.channel),sheenColorMapUv:ae&&A(s.sheenColorMap.channel),sheenRoughnessMapUv:le&&A(s.sheenRoughnessMap.channel),specularMapUv:ce&&A(s.specularMap.channel),specularColorMapUv:ue&&A(s.specularColorMap.channel),specularIntensityMapUv:he&&A(s.specularIntensityMap.channel),transmissionMapUv:de&&A(s.transmissionMap.channel),thicknessMapUv:pe&&A(s.thicknessMap.channel),alphaMapUv:ge&&A(s.alphaMap.channel),vertexTangents:!!b.attributes.tangent&&(V||Y),vertexColors:s.vertexColors,vertexAlphas:!0===s.vertexColors&&!!b.attributes.color&&4===b.attributes.color.itemSize,pointsUvs:!0===x.isPoints&&!!b.attributes.uv&&(U||ge),fog:!!_,useFog:!0===s.fog,fogExp2:!!_&&_.isFogExp2,flatShading:!0===s.flatShading,sizeAttenuation:!0===s.sizeAttenuation,logarithmicDepthBuffer:h,skinning:!0===x.isSkinnedMesh,morphTargets:void 0!==b.morphAttributes.position,morphNormals:void 0!==b.morphAttributes.normal,morphColors:void 0!==b.morphAttributes.color,morphTargetsCount:T,morphTextureStride:L,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numSpotLightMaps:a.spotLightMap.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numDirLightShadows:a.directionalShadowMap.length,numPointLightShadows:a.pointShadowMap.length,numSpotLightShadows:a.spotShadowMap.length,numSpotLightShadowsWithMaps:a.numSpotLightShadowsWithMaps,numLightProbes:a.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:s.dithering,shadowMapEnabled:e.shadowMap.enabled&&u.length>0,shadowMapType:e.shadowMap.type,toneMapping:xe,decodeVideoTexture:U&&!0===s.map.isVideoTexture&&An.getTransfer(s.map.colorSpace)===ir,premultipliedAlpha:s.premultipliedAlpha,doubleSided:s.side===g,flipSided:s.side===m,useDepthPacking:s.depthPacking>=0,depthPacking:s.depthPacking||0,index0AttributeName:s.index0AttributeName,extensionClipCullDistance:ve&&!0===s.extensions.clipCullDistance&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(ve&&!0===s.extensions.multiDraw||N)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:s.customProgramCacheKey()};return _e.vertexUv1s=c.has(1),_e.vertexUv2s=c.has(2),_e.vertexUv3s=c.has(3),c.clear(),_e},getProgramCacheKey:function(t){const r=[];if(t.shaderID?r.push(t.shaderID):(r.push(t.customVertexShaderID),r.push(t.customFragmentShaderID)),void 0!==t.defines)for(const e in t.defines)r.push(e),r.push(t.defines[e]);return!1===t.isRawShaderMaterial&&(function(e,t){e.push(t.precision),e.push(t.outputColorSpace),e.push(t.envMapMode),e.push(t.envMapCubeUVHeight),e.push(t.mapUv),e.push(t.alphaMapUv),e.push(t.lightMapUv),e.push(t.aoMapUv),e.push(t.bumpMapUv),e.push(t.normalMapUv),e.push(t.displacementMapUv),e.push(t.emissiveMapUv),e.push(t.metalnessMapUv),e.push(t.roughnessMapUv),e.push(t.anisotropyMapUv),e.push(t.clearcoatMapUv),e.push(t.clearcoatNormalMapUv),e.push(t.clearcoatRoughnessMapUv),e.push(t.iridescenceMapUv),e.push(t.iridescenceThicknessMapUv),e.push(t.sheenColorMapUv),e.push(t.sheenRoughnessMapUv),e.push(t.specularMapUv),e.push(t.specularColorMapUv),e.push(t.specularIntensityMapUv),e.push(t.transmissionMapUv),e.push(t.thicknessMapUv),e.push(t.combine),e.push(t.fogExp2),e.push(t.sizeAttenuation),e.push(t.morphTargetsCount),e.push(t.morphAttributeCount),e.push(t.numDirLights),e.push(t.numPointLights),e.push(t.numSpotLights),e.push(t.numSpotLightMaps),e.push(t.numHemiLights),e.push(t.numRectAreaLights),e.push(t.numDirLightShadows),e.push(t.numPointLightShadows),e.push(t.numSpotLightShadows),e.push(t.numSpotLightShadowsWithMaps),e.push(t.numLightProbes),e.push(t.shadowMapType),e.push(t.toneMapping),e.push(t.numClippingPlanes),e.push(t.numClipIntersection),e.push(t.depthPacking)}(r,t),function(e,t){a.disableAll(),t.supportsVertexTextures&&a.enable(0),t.instancing&&a.enable(1),t.instancingColor&&a.enable(2),t.instancingMorph&&a.enable(3),t.matcap&&a.enable(4),t.envMap&&a.enable(5),t.normalMapObjectSpace&&a.enable(6),t.normalMapTangentSpace&&a.enable(7),t.clearcoat&&a.enable(8),t.iridescence&&a.enable(9),t.alphaTest&&a.enable(10),t.vertexColors&&a.enable(11),t.vertexAlphas&&a.enable(12),t.vertexUv1s&&a.enable(13),t.vertexUv2s&&a.enable(14),t.vertexUv3s&&a.enable(15),t.vertexTangents&&a.enable(16),t.anisotropy&&a.enable(17),t.alphaHash&&a.enable(18),t.batching&&a.enable(19),t.dispersion&&a.enable(20),t.batchingColor&&a.enable(21),e.push(a.mask),a.disableAll(),t.fog&&a.enable(0),t.useFog&&a.enable(1),t.flatShading&&a.enable(2),t.logarithmicDepthBuffer&&a.enable(3),t.skinning&&a.enable(4),t.morphTargets&&a.enable(5),t.morphNormals&&a.enable(6),t.morphColors&&a.enable(7),t.premultipliedAlpha&&a.enable(8),t.shadowMapEnabled&&a.enable(9),t.doubleSided&&a.enable(10),t.flipSided&&a.enable(11),t.useDepthPacking&&a.enable(12),t.dithering&&a.enable(13),t.transmission&&a.enable(14),t.sheen&&a.enable(15),t.opaque&&a.enable(16),t.pointsUvs&&a.enable(17),t.decodeVideoTexture&&a.enable(18),t.alphaToCoverage&&a.enable(19),e.push(a.mask)}(r,t),r.push(e.outputColorSpace)),r.push(t.customProgramCacheKey),r.join()},getUniforms:function(e){const t=f[e.type];let r;if(t){const e=wo[t];r=Zs.clone(e.uniforms)}else r=e.uniforms;return r},acquireProgram:function(t,r){let n;for(let e=0,t=u.length;e0?n.push(u):!0===o.transparent?i.push(u):r.push(u)},unshift:function(e,t,o,a,l,c){const u=s(e,t,o,a,l,c);o.transmission>0?n.unshift(u):!0===o.transparent?i.unshift(u):r.unshift(u)},finish:function(){for(let r=t,n=e.length;r1&&r.sort(e||Bl),n.length>1&&n.sort(t||Pl),i.length>1&&i.sort(t||Pl)}}}function Dl(){let e=new WeakMap;return{get:function(t,r){const n=e.get(t);let i;return void 0===n?(i=new Ll,e.set(t,[i])):r>=n.length?(i=new Ll,n.push(i)):i=n[r],i},dispose:function(){e=new WeakMap}}}function Ol(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let r;switch(t.type){case"DirectionalLight":r={direction:new On,color:new es};break;case"SpotLight":r={position:new On,direction:new On,color:new es,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":r={position:new On,color:new es,distance:0,decay:0};break;case"HemisphereLight":r={direction:new On,skyColor:new es,groundColor:new es};break;case"RectAreaLight":r={color:new es,position:new On,halfWidth:new On,halfHeight:new On}}return e[t.id]=r,r}}}let Nl=0;function Ul(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function Fl(e){const t=new Ol,r=function(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let r;switch(t.type){case"DirectionalLight":case"SpotLight":r={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new rn};break;case"PointLight":r={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new rn,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=r,r}}}(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-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,numLightProbes:0};for(let e=0;e<9;e++)n.probe.push(new On);const i=new On,s=new hi,o=new hi;return{setup:function(i){let s=0,o=0,a=0;for(let e=0;e<9;e++)n.probe[e].set(0,0,0);let l=0,c=0,u=0,h=0,d=0,p=0,f=0,m=0,g=0,A=0,y=0;i.sort(Ul);for(let e=0,v=i.length;e0&&(!0===e.has("OES_texture_float_linear")?(n.rectAreaLTC1=bo.LTC_FLOAT_1,n.rectAreaLTC2=bo.LTC_FLOAT_2):(n.rectAreaLTC1=bo.LTC_HALF_1,n.rectAreaLTC2=bo.LTC_HALF_2)),n.ambient[0]=s,n.ambient[1]=o,n.ambient[2]=a;const v=n.hash;v.directionalLength===l&&v.pointLength===c&&v.spotLength===u&&v.rectAreaLength===h&&v.hemiLength===d&&v.numDirectionalShadows===p&&v.numPointShadows===f&&v.numSpotShadows===m&&v.numSpotMaps===g&&v.numLightProbes===y||(n.directional.length=l,n.spot.length=u,n.rectArea.length=h,n.point.length=c,n.hemi.length=d,n.directionalShadow.length=p,n.directionalShadowMap.length=p,n.pointShadow.length=f,n.pointShadowMap.length=f,n.spotShadow.length=m,n.spotShadowMap.length=m,n.directionalShadowMatrix.length=p,n.pointShadowMatrix.length=f,n.spotLightMatrix.length=m+g-A,n.spotLightMap.length=g,n.numSpotLightShadowsWithMaps=A,n.numLightProbes=y,v.directionalLength=l,v.pointLength=c,v.spotLength=u,v.rectAreaLength=h,v.hemiLength=d,v.numDirectionalShadows=p,v.numPointShadows=f,v.numSpotShadows=m,v.numSpotMaps=g,v.numLightProbes=y,n.version=Nl++)},setupView:function(e,t){let r=0,a=0,l=0,c=0,u=0;const h=t.matrixWorldInverse;for(let t=0,d=e.length;t=i.length?(s=new kl(e),i.push(s)):s=i[n],s},dispose:function(){t=new WeakMap}}}class Gl extends ns{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=qt,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class Ql extends ns{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}function Vl(e,t,r){let n=new Ao;const i=new rn,s=new rn,o=new Cn,a=new Gl({depthPacking:Wt}),l=new Ql,c={},u=r.maxTextureSize,d={[f]:m,[m]:f,[g]:g},y=new eo({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new rn},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \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}"}),v=y.clone();v.defines.HORIZONTAL_PASS=1;const x=new Is;x.setAttribute("position",new ds(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new Ws(x,y),b=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=h;let w=this.type;function E(r,n){const s=t.update(_);y.defines.VSM_SAMPLES!==r.blurSamples&&(y.defines.VSM_SAMPLES=r.blurSamples,v.defines.VSM_SAMPLES=r.blurSamples,y.needsUpdate=!0,v.needsUpdate=!0),null===r.mapPass&&(r.mapPass=new In(i.x,i.y)),y.uniforms.shadow_pass.value=r.map.texture,y.uniforms.resolution.value=r.mapSize,y.uniforms.radius.value=r.radius,e.setRenderTarget(r.mapPass),e.clear(),e.renderBufferDirect(n,null,s,y,_,null),v.uniforms.shadow_pass.value=r.mapPass.texture,v.uniforms.resolution.value=r.mapSize,v.uniforms.radius.value=r.radius,e.setRenderTarget(r.map),e.clear(),e.renderBufferDirect(n,null,s,v,_,null)}function M(t,r,n,i){let s=null;const o=!0===n.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(void 0!==o)s=o;else if(s=!0===n.isPointLight?l:a,e.localClippingEnabled&&!0===r.clipShadows&&Array.isArray(r.clippingPlanes)&&0!==r.clippingPlanes.length||r.displacementMap&&0!==r.displacementScale||r.alphaMap&&r.alphaTest>0||r.map&&r.alphaTest>0){const e=s.uuid,t=r.uuid;let n=c[e];void 0===n&&(n={},c[e]=n);let i=n[t];void 0===i&&(i=s.clone(),n[t]=i,r.addEventListener("dispose",C)),s=i}return s.visible=r.visible,s.wireframe=r.wireframe,s.side=i===p?null!==r.shadowSide?r.shadowSide:r.side:null!==r.shadowSide?r.shadowSide:d[r.side],s.alphaMap=r.alphaMap,s.alphaTest=r.alphaTest,s.map=r.map,s.clipShadows=r.clipShadows,s.clippingPlanes=r.clippingPlanes,s.clipIntersection=r.clipIntersection,s.displacementMap=r.displacementMap,s.displacementScale=r.displacementScale,s.displacementBias=r.displacementBias,s.wireframeLinewidth=r.wireframeLinewidth,s.linewidth=r.linewidth,!0===n.isPointLight&&!0===s.isMeshDistanceMaterial&&(e.properties.get(s).light=n),s}function S(r,i,s,o,a){if(!1===r.visible)return;if(r.layers.test(i.layers)&&(r.isMesh||r.isLine||r.isPoints)&&(r.castShadow||r.receiveShadow&&a===p)&&(!r.frustumCulled||n.intersectsObject(r))){r.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,r.matrixWorld);const n=t.update(r),l=r.material;if(Array.isArray(l)){const t=n.groups;for(let c=0,u=t.length;cu||i.y>u)&&(i.x>u&&(s.x=Math.floor(u/g.x),i.x=s.x*g.x,h.mapSize.x=s.x),i.y>u&&(s.y=Math.floor(u/g.y),i.y=s.y*g.y,h.mapSize.y=s.y)),null===h.map||!0===f||!0===m){const e=this.type!==p?{minFilter:ve,magFilter:ve}:{};null!==h.map&&h.map.dispose(),h.map=new In(i.x,i.y,e),h.map.texture.name=c.name+".shadowMap",h.camera.updateProjectionMatrix()}e.setRenderTarget(h.map),e.clear();const A=h.getViewportCount();for(let e=0;e=1):-1!==me.indexOf("OpenGL ES")&&(fe=parseFloat(/^OpenGL ES (\d)/.exec(me)[1]),pe=fe>=2);let ge=null,Ae={};const ye=e.getParameter(e.SCISSOR_BOX),ve=e.getParameter(e.VIEWPORT),xe=(new Cn).fromArray(ye),_e=(new Cn).fromArray(ve);function be(t,r,n,i){const s=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let o=0;ot?(e.repeat.x=1,e.repeat.y=r/t,e.offset.x=0,e.offset.y=(1-e.repeat.y)/2):(e.repeat.x=t/r,e.repeat.y=1,e.offset.x=(1-e.repeat.x)/2,e.offset.y=0),e},cover:function(e,t){const r=e.image&&e.image.width?e.image.width/e.image.height:1;return r>t?(e.repeat.x=t/r,e.repeat.y=1,e.offset.x=(1-e.repeat.x)/2,e.offset.y=0):(e.repeat.x=1,e.repeat.y=r/t,e.offset.x=0,e.offset.y=(1-e.repeat.y)/2),e},fill:function(e){return e.repeat.x=1,e.repeat.y=1,e.offset.x=0,e.offset.y=0,e},getByteLength:jl};function Wl(e,t,r,n,i,s,o){const a=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,l="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),c=new rn,u=new WeakMap;let h;const d=new WeakMap;let p=!1;try{p="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}function f(e,t){return p?new OffscreenCanvas(e,t):cn("canvas")}function m(e,t,r){let n=1;const i=z(e);if((i.width>r||i.height>r)&&(n=r/Math.max(i.width,i.height)),n<1){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof VideoFrame&&e instanceof VideoFrame){const r=Math.floor(n*i.width),s=Math.floor(n*i.height);void 0===h&&(h=f(r,s));const o=t?f(r,s):h;return o.width=r,o.height=s,o.getContext("2d").drawImage(e,0,0,r,s),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+i.width+"x"+i.height+") to ("+r+"x"+s+")."),o}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+i.width+"x"+i.height+")."),e}return e}function g(e){return e.generateMipmaps&&e.minFilter!==ve&&e.minFilter!==Ee}function A(t){e.generateMipmap(t)}function y(r,n,i,s,o=!1){if(null!==r){if(void 0!==e[r])return e[r];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+r+"'")}let a=n;if(n===e.RED&&(i===e.FLOAT&&(a=e.R32F),i===e.HALF_FLOAT&&(a=e.R16F),i===e.UNSIGNED_BYTE&&(a=e.R8)),n===e.RED_INTEGER&&(i===e.UNSIGNED_BYTE&&(a=e.R8UI),i===e.UNSIGNED_SHORT&&(a=e.R16UI),i===e.UNSIGNED_INT&&(a=e.R32UI),i===e.BYTE&&(a=e.R8I),i===e.SHORT&&(a=e.R16I),i===e.INT&&(a=e.R32I)),n===e.RG&&(i===e.FLOAT&&(a=e.RG32F),i===e.HALF_FLOAT&&(a=e.RG16F),i===e.UNSIGNED_BYTE&&(a=e.RG8)),n===e.RG_INTEGER&&(i===e.UNSIGNED_BYTE&&(a=e.RG8UI),i===e.UNSIGNED_SHORT&&(a=e.RG16UI),i===e.UNSIGNED_INT&&(a=e.RG32UI),i===e.BYTE&&(a=e.RG8I),i===e.SHORT&&(a=e.RG16I),i===e.INT&&(a=e.RG32I)),n===e.RGB&&i===e.UNSIGNED_INT_5_9_9_9_REV&&(a=e.RGB9_E5),n===e.RGBA){const t=o?nr:An.getTransfer(s);i===e.FLOAT&&(a=e.RGBA32F),i===e.HALF_FLOAT&&(a=e.RGBA16F),i===e.UNSIGNED_BYTE&&(a=t===ir?e.SRGB8_ALPHA8:e.RGBA8),i===e.UNSIGNED_SHORT_4_4_4_4&&(a=e.RGBA4),i===e.UNSIGNED_SHORT_5_5_5_1&&(a=e.RGB5_A1)}return a!==e.R16F&&a!==e.R32F&&a!==e.RG16F&&a!==e.RG32F&&a!==e.RGBA16F&&a!==e.RGBA32F||t.get("EXT_color_buffer_float"),a}function v(t,r){let n;return t?null===r||r===De||r===ke?n=e.DEPTH24_STENCIL8:r===Oe?n=e.DEPTH32F_STENCIL8:r===Pe&&(n=e.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):null===r||r===De||r===ke?n=e.DEPTH_COMPONENT24:r===Oe?n=e.DEPTH_COMPONENT32F:r===Pe&&(n=e.DEPTH_COMPONENT16),n}function x(e,t){return!0===g(e)||e.isFramebufferTexture&&e.minFilter!==ve&&e.minFilter!==Ee?Math.log2(Math.max(t.width,t.height))+1:void 0!==e.mipmaps&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function _(e){const t=e.target;t.removeEventListener("dispose",_),function(e){const t=n.get(e);if(void 0===t.__webglInit)return;const r=e.source,i=d.get(r);if(i){const n=i[t.__cacheKey];n.usedTimes--,0===n.usedTimes&&w(e),0===Object.keys(i).length&&d.delete(r)}n.remove(e)}(t),t.isVideoTexture&&u.delete(t)}function b(t){const r=t.target;r.removeEventListener("dispose",b),function(t){const r=n.get(t);if(t.depthTexture&&t.depthTexture.dispose(),t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++){if(Array.isArray(r.__webglFramebuffer[t]))for(let n=0;n0&&s.__version!==t.version){const e=t.image;if(null===e)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==e.complete)return void B(s,t,i);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}r.bindTexture(e.TEXTURE_2D,s.__webglTexture,e.TEXTURE0+i)}const S={[ge]:e.REPEAT,[Ae]:e.CLAMP_TO_EDGE,[ye]:e.MIRRORED_REPEAT},C={[ve]:e.NEAREST,[xe]:e.NEAREST_MIPMAP_NEAREST,[be]:e.NEAREST_MIPMAP_LINEAR,[Ee]:e.LINEAR,[Me]:e.LINEAR_MIPMAP_NEAREST,[Ce]:e.LINEAR_MIPMAP_LINEAR},T={[wr]:e.NEVER,[Rr]:e.ALWAYS,[Er]:e.LESS,[Sr]:e.LEQUAL,[Mr]:e.EQUAL,[Ir]:e.GEQUAL,[Cr]:e.GREATER,[Tr]:e.NOTEQUAL};function I(r,s){if(s.type!==Oe||!1!==t.has("OES_texture_float_linear")||s.magFilter!==Ee&&s.magFilter!==Me&&s.magFilter!==be&&s.magFilter!==Ce&&s.minFilter!==Ee&&s.minFilter!==Me&&s.minFilter!==be&&s.minFilter!==Ce||console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),e.texParameteri(r,e.TEXTURE_WRAP_S,S[s.wrapS]),e.texParameteri(r,e.TEXTURE_WRAP_T,S[s.wrapT]),r!==e.TEXTURE_3D&&r!==e.TEXTURE_2D_ARRAY||e.texParameteri(r,e.TEXTURE_WRAP_R,S[s.wrapR]),e.texParameteri(r,e.TEXTURE_MAG_FILTER,C[s.magFilter]),e.texParameteri(r,e.TEXTURE_MIN_FILTER,C[s.minFilter]),s.compareFunction&&(e.texParameteri(r,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(r,e.TEXTURE_COMPARE_FUNC,T[s.compareFunction])),!0===t.has("EXT_texture_filter_anisotropic")){if(s.magFilter===ve)return;if(s.minFilter!==be&&s.minFilter!==Ce)return;if(s.type===Oe&&!1===t.has("OES_texture_float_linear"))return;if(s.anisotropy>1||n.get(s).__currentAnisotropy){const o=t.get("EXT_texture_filter_anisotropic");e.texParameterf(r,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,i.getMaxAnisotropy())),n.get(s).__currentAnisotropy=s.anisotropy}}}function R(t,r){let n=!1;void 0===t.__webglInit&&(t.__webglInit=!0,r.addEventListener("dispose",_));const i=r.source;let s=d.get(i);void 0===s&&(s={},d.set(i,s));const a=function(e){const t=[];return t.push(e.wrapS),t.push(e.wrapT),t.push(e.wrapR||0),t.push(e.magFilter),t.push(e.minFilter),t.push(e.anisotropy),t.push(e.internalFormat),t.push(e.format),t.push(e.type),t.push(e.generateMipmaps),t.push(e.premultiplyAlpha),t.push(e.flipY),t.push(e.unpackAlignment),t.push(e.colorSpace),t.join()}(r);if(a!==t.__cacheKey){void 0===s[a]&&(s[a]={texture:e.createTexture(),usedTimes:0},o.memory.textures++,n=!0),s[a].usedTimes++;const i=s[t.__cacheKey];void 0!==i&&(s[t.__cacheKey].usedTimes--,0===i.usedTimes&&w(r)),t.__cacheKey=a,t.__webglTexture=s[a].texture}return n}function B(t,o,a){let l=e.TEXTURE_2D;(o.isDataArrayTexture||o.isCompressedArrayTexture)&&(l=e.TEXTURE_2D_ARRAY),o.isData3DTexture&&(l=e.TEXTURE_3D);const c=R(t,o),u=o.source;r.bindTexture(l,t.__webglTexture,e.TEXTURE0+a);const h=n.get(u);if(u.version!==h.__version||!0===c){r.activeTexture(e.TEXTURE0+a);const t=An.getPrimaries(An.workingColorSpace),n=o.colorSpace===Jt?null:An.getPrimaries(o.colorSpace),d=o.colorSpace===Jt||t===n?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,d);let p=m(o.image,!1,i.maxTextureSize);p=k(o,p);const f=s.convert(o.format,o.colorSpace),_=s.convert(o.type);let b,w=y(o.internalFormat,f,_,o.colorSpace,o.isVideoTexture);I(l,o);const E=o.mipmaps,M=!0!==o.isVideoTexture,S=void 0===h.__version||!0===c,C=u.dataReady,T=x(o,p);if(o.isDepthTexture)w=v(o.format===We,o.type),S&&(M?r.texStorage2D(e.TEXTURE_2D,1,w,p.width,p.height):r.texImage2D(e.TEXTURE_2D,0,w,p.width,p.height,0,f,_,null));else if(o.isDataTexture)if(E.length>0){M&&S&&r.texStorage2D(e.TEXTURE_2D,T,w,E[0].width,E[0].height);for(let t=0,n=E.length;t0){const n=jl(b.width,b.height,o.format,o.type);for(const i of o.layerUpdates){const s=b.data.subarray(i*n/b.data.BYTES_PER_ELEMENT,(i+1)*n/b.data.BYTES_PER_ELEMENT);r.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,i,b.width,b.height,1,f,s,0,0)}o.clearLayerUpdates()}else r.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,b.width,b.height,p.depth,f,b.data,0,0)}else r.compressedTexImage3D(e.TEXTURE_2D_ARRAY,t,w,b.width,b.height,p.depth,0,b.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else M?C&&r.texSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,b.width,b.height,p.depth,f,_,b.data):r.texImage3D(e.TEXTURE_2D_ARRAY,t,w,b.width,b.height,p.depth,0,f,_,b.data)}else{M&&S&&r.texStorage2D(e.TEXTURE_2D,T,w,E[0].width,E[0].height);for(let t=0,n=E.length;t0){const t=jl(p.width,p.height,o.format,o.type);for(const n of o.layerUpdates){const i=p.data.subarray(n*t/p.data.BYTES_PER_ELEMENT,(n+1)*t/p.data.BYTES_PER_ELEMENT);r.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,n,p.width,p.height,1,f,_,i)}o.clearLayerUpdates()}else r.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,p.width,p.height,p.depth,f,_,p.data)}else r.texImage3D(e.TEXTURE_2D_ARRAY,0,w,p.width,p.height,p.depth,0,f,_,p.data);else if(o.isData3DTexture)M?(S&&r.texStorage3D(e.TEXTURE_3D,T,w,p.width,p.height,p.depth),C&&r.texSubImage3D(e.TEXTURE_3D,0,0,0,0,p.width,p.height,p.depth,f,_,p.data)):r.texImage3D(e.TEXTURE_3D,0,w,p.width,p.height,p.depth,0,f,_,p.data);else if(o.isFramebufferTexture){if(S)if(M)r.texStorage2D(e.TEXTURE_2D,T,w,p.width,p.height);else{let t=p.width,n=p.height;for(let i=0;i>=1,n>>=1}}else if(E.length>0){if(M&&S){const t=z(E[0]);r.texStorage2D(e.TEXTURE_2D,T,w,t.width,t.height)}for(let t=0,n=E.length;t>u),n=Math.max(1,i.height>>u);c===e.TEXTURE_3D||c===e.TEXTURE_2D_ARRAY?r.texImage3D(c,u,p,t,n,i.depth,0,h,d,null):r.texImage2D(c,u,p,t,n,0,h,d,null)}r.bindFramebuffer(e.FRAMEBUFFER,t),F(i)?a.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,l,c,n.get(o).__webglTexture,0,U(i)):(c===e.TEXTURE_2D||c>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&c<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,l,c,n.get(o).__webglTexture,u),r.bindFramebuffer(e.FRAMEBUFFER,null)}function L(t,r,n){if(e.bindRenderbuffer(e.RENDERBUFFER,t),r.depthBuffer){const i=r.depthTexture,s=i&&i.isDepthTexture?i.type:null,o=v(r.stencilBuffer,s),l=r.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,c=U(r);F(r)?a.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,c,o,r.width,r.height):n?e.renderbufferStorageMultisample(e.RENDERBUFFER,c,o,r.width,r.height):e.renderbufferStorage(e.RENDERBUFFER,o,r.width,r.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,l,e.RENDERBUFFER,t)}else{const t=r.textures;for(let i=0;i{delete i.__boundDepthTexture,delete i.__depthDisposeCallback,e.removeEventListener("dispose",t)};e.addEventListener("dispose",t),i.__depthDisposeCallback=t}i.__boundDepthTexture=e}if(t.depthTexture&&!i.__autoAllocateDepthBuffer){if(s)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,i){if(i&&i.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(r.bindFramebuffer(e.FRAMEBUFFER,t),!i.depthTexture||!i.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");n.get(i.depthTexture).__webglTexture&&i.depthTexture.image.width===i.width&&i.depthTexture.image.height===i.height||(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),M(i.depthTexture,0);const s=n.get(i.depthTexture).__webglTexture,o=U(i);if(i.depthTexture.format===qe)F(i)?a.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,s,0,o):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,s,0);else{if(i.depthTexture.format!==We)throw new Error("Unknown depthTexture format");F(i)?a.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,s,0,o):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,s,0)}}(i.__webglFramebuffer,t)}else if(s){i.__webglDepthbuffer=[];for(let n=0;n<6;n++)if(r.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[n]),void 0===i.__webglDepthbuffer[n])i.__webglDepthbuffer[n]=e.createRenderbuffer(),L(i.__webglDepthbuffer[n],t,!1);else{const r=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,s=i.__webglDepthbuffer[n];e.bindRenderbuffer(e.RENDERBUFFER,s),e.framebufferRenderbuffer(e.FRAMEBUFFER,r,e.RENDERBUFFER,s)}}else if(r.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer),void 0===i.__webglDepthbuffer)i.__webglDepthbuffer=e.createRenderbuffer(),L(i.__webglDepthbuffer,t,!1);else{const r=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,n=i.__webglDepthbuffer;e.bindRenderbuffer(e.RENDERBUFFER,n),e.framebufferRenderbuffer(e.FRAMEBUFFER,r,e.RENDERBUFFER,n)}r.bindFramebuffer(e.FRAMEBUFFER,null)}const O=[],N=[];function U(e){return Math.min(i.maxSamples,e.samples)}function F(e){const r=n.get(e);return e.samples>0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==r.__useRenderToTexture}function k(e,t){const r=e.colorSpace,n=e.format,i=e.type;return!0===e.isCompressedTexture||!0===e.isVideoTexture||r!==er&&r!==Jt&&(An.getTransfer(r)===ir?n===Ve&&i===Ie||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",r)),t}function z(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?(c.width=e.naturalWidth||e.width,c.height=e.naturalHeight||e.height):"undefined"!=typeof VideoFrame&&e instanceof VideoFrame?(c.width=e.displayWidth,c.height=e.displayHeight):(c.width=e.width,c.height=e.height),c}this.allocateTextureUnit=function(){const e=E;return e>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+i.maxTextures),E+=1,e},this.resetTextureUnits=function(){E=0},this.setTexture2D=M,this.setTexture2DArray=function(t,i){const s=n.get(t);t.version>0&&s.__version!==t.version?B(s,t,i):r.bindTexture(e.TEXTURE_2D_ARRAY,s.__webglTexture,e.TEXTURE0+i)},this.setTexture3D=function(t,i){const s=n.get(t);t.version>0&&s.__version!==t.version?B(s,t,i):r.bindTexture(e.TEXTURE_3D,s.__webglTexture,e.TEXTURE0+i)},this.setTextureCube=function(t,o){const a=n.get(t);t.version>0&&a.__version!==t.version?function(t,o,a){if(6!==o.image.length)return;const l=R(t,o),c=o.source;r.bindTexture(e.TEXTURE_CUBE_MAP,t.__webglTexture,e.TEXTURE0+a);const u=n.get(c);if(c.version!==u.__version||!0===l){r.activeTexture(e.TEXTURE0+a);const t=An.getPrimaries(An.workingColorSpace),n=o.colorSpace===Jt?null:An.getPrimaries(o.colorSpace),h=o.colorSpace===Jt||t===n?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,h);const d=o.isCompressedTexture||o.image[0].isCompressedTexture,p=o.image[0]&&o.image[0].isDataTexture,f=[];for(let e=0;e<6;e++)f[e]=d||p?p?o.image[e].image:o.image[e]:m(o.image[e],!0,i.maxCubemapSize),f[e]=k(o,f[e]);const v=f[0],_=s.convert(o.format,o.colorSpace),b=s.convert(o.type),w=y(o.internalFormat,_,b,o.colorSpace),E=!0!==o.isVideoTexture,M=void 0===u.__version||!0===l,S=c.dataReady;let C,T=x(o,v);if(I(e.TEXTURE_CUBE_MAP,o),d){E&&M&&r.texStorage2D(e.TEXTURE_CUBE_MAP,T,w,v.width,v.height);for(let t=0;t<6;t++){C=f[t].mipmaps;for(let n=0;n0&&T++;const t=z(f[0]);r.texStorage2D(e.TEXTURE_CUBE_MAP,T,w,t.width,t.height)}for(let t=0;t<6;t++)if(p){E?S&&r.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,f[t].width,f[t].height,_,b,f[t].data):r.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,w,f[t].width,f[t].height,0,_,b,f[t].data);for(let n=0;n1;if(h||(void 0===l.__webglTexture&&(l.__webglTexture=e.createTexture()),l.__version=i.version,o.memory.textures++),u){a.__webglFramebuffer=[];for(let t=0;t<6;t++)if(i.mipmaps&&i.mipmaps.length>0){a.__webglFramebuffer[t]=[];for(let r=0;r0){a.__webglFramebuffer=[];for(let t=0;t0&&!1===F(t)){a.__webglMultisampledFramebuffer=e.createFramebuffer(),a.__webglColorRenderbuffer=[],r.bindFramebuffer(e.FRAMEBUFFER,a.__webglMultisampledFramebuffer);for(let r=0;r0)for(let n=0;n0)for(let r=0;r0)if(!1===F(t)){const i=t.textures,s=t.width,o=t.height;let a=e.COLOR_BUFFER_BIT;const c=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,u=n.get(t),h=i.length>1;if(h)for(let t=0;ta+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&o<=a-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==a&&e.gripSpace&&(i=t.getPose(e.gripSpace,r),null!==i&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,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));null!==o&&(n=t.getPose(e.targetRaySpace,r),null===n&&null!==i&&(n=i),null!==n&&(o.matrix.fromArray(n.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,n.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(n.linearVelocity)):o.hasLinearVelocity=!1,n.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(n.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent($l)))}return null!==o&&(o.visible=null!==n),null!==a&&(a.visible=null!==i),null!==l&&(l.visible=null!==s),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){const r=new Kl;r.matrixAutoUpdate=!1,r.visible=!1,e.joints[t.jointName]=r,e.add(r)}return e.joints[t.jointName]}}class Zl{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,r){if(null===this.texture){const n=new Sn;e.properties.get(n).__webglTexture=t.texture,t.depthNear==r.depthNear&&t.depthFar==r.depthFar||(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=n}}getMesh(e){if(null!==this.texture&&null===this.mesh){const t=e.cameras[0].viewport,r=new eo({vertexShader:"\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}",fragmentShader:"\nuniform sampler2DArray depthColor;\nuniform float depthWidth;\nuniform float depthHeight;\n\nvoid main() {\n\n\tvec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\n\n\tif ( coord.x >= 1.0 ) {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n\t} else {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\n\n\t}\n\n}",uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Ws(new xo(20,20),r)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class ec extends Hr{constructor(e,t){super();const r=this;let n=null,i=1,s=null,o="local-floor",a=1,l=null,c=null,u=null,h=null,d=null,p=null;const f=new Zl,m=t.getContextAttributes();let g=null,A=null;const y=[],v=[],x=new rn;let _=null;const b=new so;b.layers.enable(1),b.viewport=new Cn;const w=new so;w.layers.enable(2),w.viewport=new Cn;const E=[b,w],M=new Xl;M.layers.enable(1),M.layers.enable(2);let S=null,C=null;function T(e){const t=v.indexOf(e.inputSource);if(-1===t)return;const r=y[t];void 0!==r&&(r.update(e.inputSource,e.frame,l||s),r.dispatchEvent({type:e.type,data:e.inputSource}))}function I(){n.removeEventListener("select",T),n.removeEventListener("selectstart",T),n.removeEventListener("selectend",T),n.removeEventListener("squeeze",T),n.removeEventListener("squeezestart",T),n.removeEventListener("squeezeend",T),n.removeEventListener("end",I),n.removeEventListener("inputsourceschange",R);for(let e=0;e=0&&(v[n]=null,y[n].disconnect(r))}for(let t=0;t=v.length){v.push(r),n=e;break}if(null===v[e]){v[e]=r,n=e;break}}if(-1===n)break}const i=y[n];i&&i.connect(r)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=y[e];return void 0===t&&(t=new Jl,y[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=y[e];return void 0===t&&(t=new Jl,y[e]=t),t.getGripSpace()},this.getHand=function(e){let t=y[e];return void 0===t&&(t=new Jl,y[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){i=e,!0===r.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){o=e,!0===r.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||s},this.setReferenceSpace=function(e){l=e},this.getBaseLayer=function(){return null!==h?h:d},this.getBinding=function(){return u},this.getFrame=function(){return p},this.getSession=function(){return n},this.setSession=async function(c){if(n=c,null!==n){if(g=e.getRenderTarget(),n.addEventListener("select",T),n.addEventListener("selectstart",T),n.addEventListener("selectend",T),n.addEventListener("squeeze",T),n.addEventListener("squeezestart",T),n.addEventListener("squeezeend",T),n.addEventListener("end",I),n.addEventListener("inputsourceschange",R),!0!==m.xrCompatible&&await t.makeXRCompatible(),_=e.getPixelRatio(),e.getSize(x),void 0===n.renderState.layers){const r={antialias:m.antialias,alpha:!0,depth:m.depth,stencil:m.stencil,framebufferScaleFactor:i};d=new XRWebGLLayer(n,t,r),n.updateRenderState({baseLayer:d}),e.setPixelRatio(1),e.setSize(d.framebufferWidth,d.framebufferHeight,!1),A=new In(d.framebufferWidth,d.framebufferHeight,{format:Ve,type:Ie,colorSpace:e.outputColorSpace,stencilBuffer:m.stencil})}else{let r=null,s=null,o=null;m.depth&&(o=m.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,r=m.stencil?We:qe,s=m.stencil?ke:De);const a={colorFormat:t.RGBA8,depthFormat:o,scaleFactor:i};u=new XRWebGLBinding(n,t),h=u.createProjectionLayer(a),n.updateRenderState({layers:[h]}),e.setPixelRatio(1),e.setSize(h.textureWidth,h.textureHeight,!1),A=new In(h.textureWidth,h.textureHeight,{format:Ve,type:Ie,depthTexture:new ra(h.textureWidth,h.textureHeight,s,void 0,void 0,void 0,void 0,void 0,void 0,r),stencilBuffer:m.stencil,colorSpace:e.outputColorSpace,samples:m.antialias?4:0,resolveDepthBuffer:!1===h.ignoreDepthValues})}A.isXRRenderTarget=!0,this.setFoveation(a),l=null,s=await n.requestReferenceSpace(o),O.setContext(n),O.start(),r.isPresenting=!0,r.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==n)return n.environmentBlendMode},this.getDepthTexture=function(){return f.getDepthTexture()};const B=new On,P=new On;function L(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(null===n)return;let t=e.near,r=e.far;null!==f.texture&&(f.depthNear>0&&(t=f.depthNear),f.depthFar>0&&(r=f.depthFar)),M.near=w.near=b.near=t,M.far=w.far=b.far=r,S===M.near&&C===M.far||(n.updateRenderState({depthNear:M.near,depthFar:M.far}),S=M.near,C=M.far);const i=e.parent,s=M.cameras;L(M,i);for(let e=0;e0&&(e.alphaTest.value=n.alphaTest);const i=t.get(n),s=i.envMap,o=i.envMapRotation;s&&(e.envMap.value=s,tc.copy(o),tc.x*=-1,tc.y*=-1,tc.z*=-1,s.isCubeTexture&&!1===s.isRenderTargetTexture&&(tc.y*=-1,tc.z*=-1),e.envMapRotation.value.setFromMatrix4(rc.makeRotationFromEuler(tc)),e.flipEnvMap.value=s.isCubeTexture&&!1===s.isRenderTargetTexture?-1:1,e.reflectivity.value=n.reflectivity,e.ior.value=n.ior,e.refractionRatio.value=n.refractionRatio),n.lightMap&&(e.lightMap.value=n.lightMap,e.lightMapIntensity.value=n.lightMapIntensity,r(n.lightMap,e.lightMapTransform)),n.aoMap&&(e.aoMap.value=n.aoMap,e.aoMapIntensity.value=n.aoMapIntensity,r(n.aoMap,e.aoMapTransform))}return{refreshFogUniforms:function(t,r){r.color.getRGB(t.fogColor.value,Js(e)),r.isFog?(t.fogNear.value=r.near,t.fogFar.value=r.far):r.isFogExp2&&(t.fogDensity.value=r.density)},refreshMaterialUniforms:function(e,i,s,o,a){i.isMeshBasicMaterial||i.isMeshLambertMaterial?n(e,i):i.isMeshToonMaterial?(n(e,i),function(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(e,i)):i.isMeshPhongMaterial?(n(e,i),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}(e,i)):i.isMeshStandardMaterial?(n(e,i),function(e,t){e.metalness.value=t.metalness,t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap,r(t.metalnessMap,e.metalnessMapTransform)),e.roughness.value=t.roughness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap,r(t.roughnessMap,e.roughnessMapTransform)),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}(e,i),i.isMeshPhysicalMaterial&&function(e,t,n){e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap,r(t.sheenColorMap,e.sheenColorMapTransform)),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap,r(t.sheenRoughnessMap,e.sheenRoughnessMapTransform))),t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap,r(t.clearcoatMap,e.clearcoatMapTransform)),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap,r(t.clearcoatRoughnessMap,e.clearcoatRoughnessMapTransform)),t.clearcoatNormalMap&&(e.clearcoatNormalMap.value=t.clearcoatNormalMap,r(t.clearcoatNormalMap,e.clearcoatNormalMapTransform),e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),t.side===m&&e.clearcoatNormalScale.value.negate())),t.dispersion>0&&(e.dispersion.value=t.dispersion),t.iridescence>0&&(e.iridescence.value=t.iridescence,e.iridescenceIOR.value=t.iridescenceIOR,e.iridescenceThicknessMinimum.value=t.iridescenceThicknessRange[0],e.iridescenceThicknessMaximum.value=t.iridescenceThicknessRange[1],t.iridescenceMap&&(e.iridescenceMap.value=t.iridescenceMap,r(t.iridescenceMap,e.iridescenceMapTransform)),t.iridescenceThicknessMap&&(e.iridescenceThicknessMap.value=t.iridescenceThicknessMap,r(t.iridescenceThicknessMap,e.iridescenceThicknessMapTransform))),t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=n.texture,e.transmissionSamplerSize.value.set(n.width,n.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap,r(t.transmissionMap,e.transmissionMapTransform)),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap,r(t.thicknessMap,e.thicknessMapTransform)),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor)),t.anisotropy>0&&(e.anisotropyVector.value.set(t.anisotropy*Math.cos(t.anisotropyRotation),t.anisotropy*Math.sin(t.anisotropyRotation)),t.anisotropyMap&&(e.anisotropyMap.value=t.anisotropyMap,r(t.anisotropyMap,e.anisotropyMapTransform))),e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap,r(t.specularColorMap,e.specularColorMapTransform)),t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap,r(t.specularIntensityMap,e.specularIntensityMapTransform))}(e,i,a)):i.isMeshMatcapMaterial?(n(e,i),function(e,t){t.matcap&&(e.matcap.value=t.matcap)}(e,i)):i.isMeshDepthMaterial?n(e,i):i.isMeshDistanceMaterial?(n(e,i),function(e,r){const n=t.get(r).light;e.referencePosition.value.setFromMatrixPosition(n.matrixWorld),e.nearDistance.value=n.shadow.camera.near,e.farDistance.value=n.shadow.camera.far}(e,i)):i.isMeshNormalMaterial?n(e,i):i.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,t.map&&(e.map.value=t.map,r(t.map,e.mapTransform))}(e,i),i.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,i)):i.isPointsMaterial?function(e,t,n,i){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*n,e.scale.value=.5*i,t.map&&(e.map.value=t.map,r(t.map,e.uvTransform)),t.alphaMap&&(e.alphaMap.value=t.alphaMap,r(t.alphaMap,e.alphaMapTransform)),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}(e,i,s,o):i.isSpriteMaterial?function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map,r(t.map,e.mapTransform)),t.alphaMap&&(e.alphaMap.value=t.alphaMap,r(t.alphaMap,e.alphaMapTransform)),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}(e,i):i.isShadowMaterial?(e.color.value.copy(i.color),e.opacity.value=i.opacity):i.isShaderMaterial&&(i.uniformsNeedUpdate=!1)}}}function ic(e,t,r,n){let i={},s={},o=[];const a=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function l(e,t,r,n){const i=e.value,s=t+"_"+r;if(void 0===n[s])return n[s]="number"==typeof i||"boolean"==typeof i?i:i.clone(),!0;{const e=n[s];if("number"==typeof i||"boolean"==typeof i){if(e!==i)return n[s]=i,!0}else if(!1===e.equals(i))return e.copy(i),!0}return!1}function c(e){const t={boundary:0,storage:0};return"number"==typeof e||"boolean"==typeof e?(t.boundary=4,t.storage=4):e.isVector2?(t.boundary=8,t.storage=8):e.isVector3||e.isColor?(t.boundary=16,t.storage=12):e.isVector4?(t.boundary=16,t.storage=16):e.isMatrix3?(t.boundary=48,t.storage=48):e.isMatrix4?(t.boundary=64,t.storage=64):e.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",e),t}function u(t){const r=t.target;r.removeEventListener("dispose",u);const n=o.indexOf(r.__bindingPointIndex);o.splice(n,1),e.deleteBuffer(i[r.id]),delete i[r.id],delete s[r.id]}return{bind:function(e,t){const r=t.program;n.uniformBlockBinding(e,r)},update:function(r,h){let d=i[r.id];void 0===d&&(function(e){const t=e.uniforms;let r=0;for(let e=0,n=t.length;e0&&(r+=16-n),e.__size=r,e.__cache={}}(r),d=function(t){const r=function(){for(let e=0;e0),h=!!r.morphAttributes.position,d=!!r.morphAttributes.normal,p=!!r.morphAttributes.color;let f=ee;n.toneMapped&&(null!==S&&!0!==S.isXRRenderTarget||(f=b.toneMapping));const m=r.morphAttributes.position||r.morphAttributes.normal||r.morphAttributes.color,g=void 0!==m?m.length:0,A=re.get(n),y=v.state.lights;if(!0===V&&(!0===H||e!==T)){const t=e===T&&n.id===C;pe.setState(n,e,t)}let x=!1;n.version===A.__version?A.needsLights&&A.lightsStateVersion!==y.state.version||A.outputColorSpace!==a||i.isBatchedMesh&&!1===A.batching?x=!0:i.isBatchedMesh||!0!==A.batching?i.isBatchedMesh&&!0===A.batchingColor&&null===i.colorTexture||i.isBatchedMesh&&!1===A.batchingColor&&null!==i.colorTexture||i.isInstancedMesh&&!1===A.instancing?x=!0:i.isInstancedMesh||!0!==A.instancing?i.isSkinnedMesh&&!1===A.skinning?x=!0:i.isSkinnedMesh||!0!==A.skinning?i.isInstancedMesh&&!0===A.instancingColor&&null===i.instanceColor||i.isInstancedMesh&&!1===A.instancingColor&&null!==i.instanceColor||i.isInstancedMesh&&!0===A.instancingMorph&&null===i.morphTexture||i.isInstancedMesh&&!1===A.instancingMorph&&null!==i.morphTexture||A.envMap!==l||!0===n.fog&&A.fog!==s?x=!0:void 0===A.numClippingPlanes||A.numClippingPlanes===pe.numPlanes&&A.numIntersection===pe.numIntersection?(A.vertexAlphas!==c||A.vertexTangents!==u||A.morphTargets!==h||A.morphNormals!==d||A.morphColors!==p||A.toneMapping!==f||A.morphTargetsCount!==g)&&(x=!0):x=!0:x=!0:x=!0:x=!0:(x=!0,A.__version=n.version);let _=A.currentProgram;!0===x&&(_=Ye(n,t,i));let w=!1,E=!1,M=!1;const I=_.getUniforms(),R=A.uniforms;if(Z.useProgram(_.program)&&(w=!0,E=!0,M=!0),n.id!==C&&(C=n.id,E=!0),w||T!==e){I.setValue(be,"projectionMatrix",e.projectionMatrix),I.setValue(be,"viewMatrix",e.matrixWorldInverse);const t=I.map.cameraPosition;void 0!==t&&t.setValue(be,q.setFromMatrixPosition(e.matrixWorld)),J.logarithmicDepthBuffer&&I.setValue(be,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&I.setValue(be,"isOrthographic",!0===e.isOrthographicCamera),T!==e&&(T=e,E=!0,M=!0)}if(i.isSkinnedMesh){I.setOptional(be,i,"bindMatrix"),I.setOptional(be,i,"bindMatrixInverse");const e=i.skeleton;e&&(null===e.boneTexture&&e.computeBoneTexture(),I.setValue(be,"boneTexture",e.boneTexture,ne))}i.isBatchedMesh&&(I.setOptional(be,i,"batchingTexture"),I.setValue(be,"batchingTexture",i._matricesTexture,ne),I.setOptional(be,i,"batchingIdTexture"),I.setValue(be,"batchingIdTexture",i._indirectTexture,ne),I.setOptional(be,i,"batchingColorTexture"),null!==i._colorsTexture&&I.setValue(be,"batchingColorTexture",i._colorsTexture,ne));const B=r.morphAttributes;var P,L;if(void 0===B.position&&void 0===B.normal&&void 0===B.color||ge.update(i,r,_),(E||A.receiveShadow!==i.receiveShadow)&&(A.receiveShadow=i.receiveShadow,I.setValue(be,"receiveShadow",i.receiveShadow)),n.isMeshGouraudMaterial&&null!==n.envMap&&(R.envMap.value=l,R.flipEnvMap.value=l.isCubeTexture&&!1===l.isRenderTargetTexture?-1:1),n.isMeshStandardMaterial&&null===n.envMap&&null!==t.environment&&(R.envMapIntensity.value=t.environmentIntensity),E&&(I.setValue(be,"toneMappingExposure",b.toneMappingExposure),A.needsLights&&(L=M,(P=R).ambientLightColor.needsUpdate=L,P.lightProbe.needsUpdate=L,P.directionalLights.needsUpdate=L,P.directionalLightShadows.needsUpdate=L,P.pointLights.needsUpdate=L,P.pointLightShadows.needsUpdate=L,P.spotLights.needsUpdate=L,P.spotLightShadows.needsUpdate=L,P.rectAreaLights.needsUpdate=L,P.hemisphereLights.needsUpdate=L),s&&!0===n.fog&&ue.refreshFogUniforms(R,s),ue.refreshMaterialUniforms(R,n,N,O,v.state.transmissionRenderTarget[e.id]),al.upload(be,Ke(A),R,ne)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(al.upload(be,Ke(A),R,ne),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&I.setValue(be,"center",i.center),I.setValue(be,"modelViewMatrix",i.modelViewMatrix),I.setValue(be,"normalMatrix",i.normalMatrix),I.setValue(be,"modelMatrix",i.matrixWorld),n.isShaderMaterial||n.isRawShaderMaterial){const e=n.uniformsGroups;for(let t=0,r=e.length;t{function r(){n.forEach((function(e){re.get(e).currentProgram.isReady()&&n.delete(e)})),0!==n.size?setTimeout(r,10):t(e)}null!==$.get("KHR_parallel_shader_compile")?r():setTimeout(r,10)}))};let Oe=null;function ze(){Qe.stop()}function Ge(){Qe.start()}const Qe=new yo;function Ve(e,t,r,n){if(!1===e.visible)return;if(e.layers.test(t.layers))if(e.isGroup)r=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)v.pushLight(e),e.castShadow&&v.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||Q.intersectsSprite(e)){n&&W.setFromMatrixPosition(e.matrixWorld).applyMatrix4(j);const t=le.update(e),i=e.material;i.visible&&y.push(e,t,i,r,W.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||Q.intersectsObject(e))){const t=le.update(e),i=e.material;if(n&&(void 0!==e.boundingSphere?(null===e.boundingSphere&&e.computeBoundingSphere(),W.copy(e.boundingSphere.center)):(null===t.boundingSphere&&t.computeBoundingSphere(),W.copy(t.boundingSphere.center)),W.applyMatrix4(e.matrixWorld).applyMatrix4(j)),Array.isArray(i)){const n=t.groups;for(let s=0,o=n.length;s0&&qe(i,t,r),s.length>0&&qe(s,t,r),o.length>0&&qe(o,t,r),Z.buffers.depth.setTest(!0),Z.buffers.depth.setMask(!0),Z.buffers.color.setMask(!0),Z.setPolygonOffset(!1)}function je(e,t,r,n){if(null!==(!0===r.isScene?r.overrideMaterial:null))return;void 0===v.state.transmissionRenderTarget[n.id]&&(v.state.transmissionRenderTarget[n.id]=new In(1,1,{generateMipmaps:!0,type:$.has("EXT_color_buffer_half_float")||$.has("EXT_color_buffer_float")?Ne:Ie,minFilter:Ce,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:An.workingColorSpace}));const i=v.state.transmissionRenderTarget[n.id],o=n.viewport||I;i.setSize(o.z,o.w);const a=b.getRenderTarget();b.setRenderTarget(i),b.getClearColor(P),L=b.getClearAlpha(),L<1&&b.setClearColor(16777215,.5),b.clear(),X&&me.render(r);const l=b.toneMapping;b.toneMapping=ee;const c=n.viewport;if(void 0!==n.viewport&&(n.viewport=void 0),v.setupLightsView(n),!0===V&&pe.setGlobalState(b.clippingPlanes,n),qe(e,r,n),ne.updateMultisampleRenderTarget(i),ne.updateRenderTargetMipmap(i),!1===$.has("WEBGL_multisampled_render_to_texture")){let e=!1;for(let i=0,s=t.length;i0)for(let t=0,s=r.length;t0&&je(n,i,e,t),X&&me.render(e),He(y,e,t);null!==S&&(ne.updateMultisampleRenderTarget(S),ne.updateRenderTargetMipmap(S)),!0===e.isScene&&e.onAfterRender(b,e,t),xe.resetDefaultState(),C=-1,T=null,_.pop(),_.length>0?(v=_[_.length-1],!0===V&&pe.setGlobalState(b.clippingPlanes,v.state.camera)):v=null,x.pop(),y=x.length>0?x[x.length-1]:null},this.getActiveCubeFace=function(){return E},this.getActiveMipmapLevel=function(){return M},this.getRenderTarget=function(){return S},this.setRenderTargetTextures=function(e,t,r){re.get(e.texture).__webglTexture=t,re.get(e.depthTexture).__webglTexture=r;const n=re.get(e);n.__hasExternalTextures=!0,n.__autoAllocateDepthBuffer=void 0===r,n.__autoAllocateDepthBuffer||!0===$.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),n.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(e,t){const r=re.get(e);r.__webglFramebuffer=t,r.__useDefaultFramebuffer=void 0===t},this.setRenderTarget=function(e,t=0,r=0){S=e,E=t,M=r;let n=!0,i=null,s=!1,o=!1;if(e){const a=re.get(e);if(void 0!==a.__useDefaultFramebuffer)Z.bindFramebuffer(be.FRAMEBUFFER,null),n=!1;else if(void 0===a.__webglFramebuffer)ne.setupRenderTarget(e);else if(a.__hasExternalTextures)ne.rebindTextures(e,re.get(e.texture).__webglTexture,re.get(e.depthTexture).__webglTexture);else if(e.depthBuffer){const t=e.depthTexture;if(a.__boundDepthTexture!==t){if(null!==t&&re.has(t)&&(e.width!==t.image.width||e.height!==t.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");ne.setupDepthRenderbuffer(e)}}const l=e.texture;(l.isData3DTexture||l.isDataArrayTexture||l.isCompressedArrayTexture)&&(o=!0);const c=re.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(i=Array.isArray(c[t])?c[t][r]:c[t],s=!0):i=e.samples>0&&!1===ne.useMultisampledRTT(e)?re.get(e).__webglMultisampledFramebuffer:Array.isArray(c)?c[r]:c,I.copy(e.viewport),R.copy(e.scissor),B=e.scissorTest}else I.copy(k).multiplyScalar(N).floor(),R.copy(z).multiplyScalar(N).floor(),B=G;if(Z.bindFramebuffer(be.FRAMEBUFFER,i)&&n&&Z.drawBuffers(e,i),Z.viewport(I),Z.scissor(R),Z.setScissorTest(B),s){const n=re.get(e.texture);be.framebufferTexture2D(be.FRAMEBUFFER,be.COLOR_ATTACHMENT0,be.TEXTURE_CUBE_MAP_POSITIVE_X+t,n.__webglTexture,r)}else if(o){const n=re.get(e.texture),i=t||0;be.framebufferTextureLayer(be.FRAMEBUFFER,be.COLOR_ATTACHMENT0,n.__webglTexture,r||0,i)}C=-1},this.readRenderTargetPixels=function(e,t,r,n,i,s,o){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let a=re.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(a=a[o]),a){Z.bindFramebuffer(be.FRAMEBUFFER,a);try{const o=e.texture,a=o.format,l=o.type;if(!J.textureFormatReadable(a))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!J.textureTypeReadable(l))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");t>=0&&t<=e.width-n&&r>=0&&r<=e.height-i&&be.readPixels(t,r,n,i,ve.convert(a),ve.convert(l),s)}finally{const e=null!==S?re.get(S).__webglFramebuffer:null;Z.bindFramebuffer(be.FRAMEBUFFER,e)}}},this.readRenderTargetPixelsAsync=async function(e,t,r,n,i,s,o){if(!e||!e.isWebGLRenderTarget)throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let a=re.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(a=a[o]),a){Z.bindFramebuffer(be.FRAMEBUFFER,a);try{const o=e.texture,a=o.format,l=o.type;if(!J.textureFormatReadable(a))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!J.textureTypeReadable(l))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(t>=0&&t<=e.width-n&&r>=0&&r<=e.height-i){const e=be.createBuffer();be.bindBuffer(be.PIXEL_PACK_BUFFER,e),be.bufferData(be.PIXEL_PACK_BUFFER,s.byteLength,be.STREAM_READ),be.readPixels(t,r,n,i,ve.convert(a),ve.convert(l),0),be.flush();const o=be.fenceSync(be.SYNC_GPU_COMMANDS_COMPLETE,0);await function(e,t){return new Promise((function(r,n){setTimeout((function i(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:n();break;case e.TIMEOUT_EXPIRED:setTimeout(i,4);break;default:r()}}),4)}))}(be,o);try{be.bindBuffer(be.PIXEL_PACK_BUFFER,e),be.getBufferSubData(be.PIXEL_PACK_BUFFER,0,s)}finally{be.deleteBuffer(e),be.deleteSync(o)}return s}}finally{const e=null!==S?re.get(S).__webglFramebuffer:null;Z.bindFramebuffer(be.FRAMEBUFFER,e)}}},this.copyFramebufferToTexture=function(e,t=null,r=0){!0!==e.isTexture&&(dn("WebGLRenderer: copyFramebufferToTexture function signature has changed."),t=arguments[0]||null,e=arguments[1]);const n=Math.pow(2,-r),i=Math.floor(e.image.width*n),s=Math.floor(e.image.height*n),o=null!==t?t.x:0,a=null!==t?t.y:0;ne.setTexture2D(e,0),be.copyTexSubImage2D(be.TEXTURE_2D,r,0,0,o,a,i,s),Z.unbindTexture()},this.copyTextureToTexture=function(e,t,r=null,n=null,i=0){let s,o,a,l,c,u;!0!==e.isTexture&&(dn("WebGLRenderer: copyTextureToTexture function signature has changed."),n=arguments[0]||null,e=arguments[1],t=arguments[2],i=arguments[3]||0,r=null),null!==r?(s=r.max.x-r.min.x,o=r.max.y-r.min.y,a=r.min.x,l=r.min.y):(s=e.image.width,o=e.image.height,a=0,l=0),null!==n?(c=n.x,u=n.y):(c=0,u=0);const h=ve.convert(t.format),d=ve.convert(t.type);ne.setTexture2D(t,0),be.pixelStorei(be.UNPACK_FLIP_Y_WEBGL,t.flipY),be.pixelStorei(be.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),be.pixelStorei(be.UNPACK_ALIGNMENT,t.unpackAlignment);const p=be.getParameter(be.UNPACK_ROW_LENGTH),f=be.getParameter(be.UNPACK_IMAGE_HEIGHT),m=be.getParameter(be.UNPACK_SKIP_PIXELS),g=be.getParameter(be.UNPACK_SKIP_ROWS),A=be.getParameter(be.UNPACK_SKIP_IMAGES),y=e.isCompressedTexture?e.mipmaps[i]:e.image;be.pixelStorei(be.UNPACK_ROW_LENGTH,y.width),be.pixelStorei(be.UNPACK_IMAGE_HEIGHT,y.height),be.pixelStorei(be.UNPACK_SKIP_PIXELS,a),be.pixelStorei(be.UNPACK_SKIP_ROWS,l),e.isDataTexture?be.texSubImage2D(be.TEXTURE_2D,i,c,u,s,o,h,d,y.data):e.isCompressedTexture?be.compressedTexSubImage2D(be.TEXTURE_2D,i,c,u,y.width,y.height,h,y.data):be.texSubImage2D(be.TEXTURE_2D,i,c,u,s,o,h,d,y),be.pixelStorei(be.UNPACK_ROW_LENGTH,p),be.pixelStorei(be.UNPACK_IMAGE_HEIGHT,f),be.pixelStorei(be.UNPACK_SKIP_PIXELS,m),be.pixelStorei(be.UNPACK_SKIP_ROWS,g),be.pixelStorei(be.UNPACK_SKIP_IMAGES,A),0===i&&t.generateMipmaps&&be.generateMipmap(be.TEXTURE_2D),Z.unbindTexture()},this.copyTextureToTexture3D=function(e,t,r=null,n=null,i=0){let s,o,a,l,c,u,h,d,p;!0!==e.isTexture&&(dn("WebGLRenderer: copyTextureToTexture3D function signature has changed."),r=arguments[0]||null,n=arguments[1]||null,e=arguments[2],t=arguments[3],i=arguments[4]||0);const f=e.isCompressedTexture?e.mipmaps[i]:e.image;null!==r?(s=r.max.x-r.min.x,o=r.max.y-r.min.y,a=r.max.z-r.min.z,l=r.min.x,c=r.min.y,u=r.min.z):(s=f.width,o=f.height,a=f.depth,l=0,c=0,u=0),null!==n?(h=n.x,d=n.y,p=n.z):(h=0,d=0,p=0);const m=ve.convert(t.format),g=ve.convert(t.type);let A;if(t.isData3DTexture)ne.setTexture3D(t,0),A=be.TEXTURE_3D;else{if(!t.isDataArrayTexture&&!t.isCompressedArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");ne.setTexture2DArray(t,0),A=be.TEXTURE_2D_ARRAY}be.pixelStorei(be.UNPACK_FLIP_Y_WEBGL,t.flipY),be.pixelStorei(be.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),be.pixelStorei(be.UNPACK_ALIGNMENT,t.unpackAlignment);const y=be.getParameter(be.UNPACK_ROW_LENGTH),v=be.getParameter(be.UNPACK_IMAGE_HEIGHT),x=be.getParameter(be.UNPACK_SKIP_PIXELS),_=be.getParameter(be.UNPACK_SKIP_ROWS),b=be.getParameter(be.UNPACK_SKIP_IMAGES);be.pixelStorei(be.UNPACK_ROW_LENGTH,f.width),be.pixelStorei(be.UNPACK_IMAGE_HEIGHT,f.height),be.pixelStorei(be.UNPACK_SKIP_PIXELS,l),be.pixelStorei(be.UNPACK_SKIP_ROWS,c),be.pixelStorei(be.UNPACK_SKIP_IMAGES,u),e.isDataTexture||e.isData3DTexture?be.texSubImage3D(A,i,h,d,p,s,o,a,m,g,f.data):t.isCompressedArrayTexture?be.compressedTexSubImage3D(A,i,h,d,p,s,o,a,m,f.data):be.texSubImage3D(A,i,h,d,p,s,o,a,m,g,f),be.pixelStorei(be.UNPACK_ROW_LENGTH,y),be.pixelStorei(be.UNPACK_IMAGE_HEIGHT,v),be.pixelStorei(be.UNPACK_SKIP_PIXELS,x),be.pixelStorei(be.UNPACK_SKIP_ROWS,_),be.pixelStorei(be.UNPACK_SKIP_IMAGES,b),0===i&&t.generateMipmaps&&be.generateMipmap(A),Z.unbindTexture()},this.initRenderTarget=function(e){void 0===re.get(e).__webglFramebuffer&&ne.setupRenderTarget(e)},this.initTexture=function(e){e.isCubeTexture?ne.setTextureCube(e,0):e.isData3DTexture?ne.setTexture3D(e,0):e.isDataArrayTexture||e.isCompressedArrayTexture?ne.setTexture2DArray(e,0):ne.setTexture2D(e,0),Z.unbindTexture()},this.resetState=function(){E=0,M=0,S=null,Z.reset(),xe.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Qr}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===tr?"display-p3":"srgb",t.unpackColorSpace=An.workingColorSpace===rr?"display-p3":"srgb"}}class oc{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new es(e),this.density=t}clone(){return new oc(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class ac{constructor(e,t=1,r=1e3){this.isFog=!0,this.name="",this.color=new es(e),this.near=t,this.far=r}clone(){return new ac(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class lc extends Fi{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new _i,this.environmentIntensity=1,this.environmentRotation=new _i,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class cc{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=Br,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Xr()}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}get updateRange(){return dn("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,r){e*=this.stride,r*=t.stride;for(let n=0,i=this.stride;ne.far||t.push({distance:a,point:fc.clone(),uv:Xi.getInterpolation(fc,xc,_c,bc,wc,Ec,Mc,new rn),face:null,object:this})}copy(e,t){return super.copy(e,t),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}}function Cc(e,t,r,n,i,s){Ac.subVectors(e,r).addScalar(.5).multiply(n),void 0!==i?(yc.x=s*Ac.x-i*Ac.y,yc.y=i*Ac.x+s*Ac.y):yc.copy(Ac),e.copy(t),e.x+=yc.x,e.y+=yc.y,e.applyMatrix4(vc)}const Tc=new On,Ic=new On;class Rc extends Fi{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let e=0,r=t.length;e0){let r,n;for(r=1,n=t.length;r0){Tc.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(Tc);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Tc.setFromMatrixPosition(e.matrixWorld),Ic.setFromMatrixPosition(this.matrixWorld);const r=Tc.distanceTo(Ic)/e.zoom;let n,i;for(t[0].object.visible=!0,n=1,i=t.length;n=e))break;t[n-1].object.visible=!1,t[n].object.visible=!0}for(this._currentLevel=n-1;n=n.length&&n.push({start:-1,count:-1,z:-1,index:-1});const s=n[this.index];i.push(s),this.index++,s.start=e.start,s.count=e.count,s.z=t,s.index=r}reset(){this.list.length=0,this.index=0}}const iu=new hi,su=new hi,ou=new hi,au=new es(1,1,1),lu=new hi,cu=new Ao,uu=new Fn,hu=new ri,du=new On,pu=new On,fu=new On,mu=new nu,gu=new Ws,Au=[];function yu(e,t,r=0){const n=t.itemSize;if(e.isInterleavedBufferAttribute||e.array.constructor!==t.array.constructor){const i=e.count;for(let s=0;s65535?new Uint32Array(n):new Uint16Array(n);t.setIndex(new ds(e,1))}this._geometryInitialized=!0}}_validateGeometry(e){const t=this.geometry;if(Boolean(e.getIndex())!==Boolean(t.getIndex()))throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const r in t.attributes){if(!e.hasAttribute(r))throw new Error(`BatchedMesh: Added geometry missing "${r}". All geometries must have consistent attributes.`);const n=e.getAttribute(r),i=t.getAttribute(r);if(n.itemSize!==i.itemSize||n.normalized!==i.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new Fn);const e=this.boundingBox,t=this._drawInfo;e.makeEmpty();for(let r=0,n=t.length;r=this._maxInstanceCount)throw new Error("BatchedMesh: Maximum item count reached.");this._drawInfo.push({visible:!0,active:!0,geometryIndex:e});const t=this._drawInfo.length-1,r=this._matricesTexture,n=r.image.data;ou.toArray(n,16*t),r.needsUpdate=!0;const i=this._colorsTexture;return i&&(au.toArray(i.image.data,4*t),i.needsUpdate=!0),t}addGeometry(e,t=-1,r=-1){if(this._initializeGeometry(e),this._validateGeometry(e),this._drawInfo.length>=this._maxInstanceCount)throw new Error("BatchedMesh: Maximum item count reached.");const n={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let i=null;const s=this._reservedRanges,o=this._drawRanges,a=this._bounds;0!==this._geometryCount&&(i=s[s.length-1]),n.vertexCount=-1===t?e.getAttribute("position").count:t,n.vertexStart=null===i?0:i.vertexStart+i.vertexCount;const l=e.getIndex(),c=null!==l;if(c&&(n.indexCount=-1===r?l.count:r,n.indexStart=null===i?0:i.indexStart+i.indexCount),-1!==n.indexStart&&n.indexStart+n.indexCount>this._maxIndexCount||n.vertexStart+n.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const u=this._geometryCount;return this._geometryCount++,s.push(n),o.push({start:c?n.indexStart:n.vertexStart,count:-1}),a.push({boxInitialized:!1,box:new Fn,sphereInitialized:!1,sphere:new ri}),this.setGeometryAt(u,e),u}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const r=this.geometry,n=null!==r.getIndex(),i=r.getIndex(),s=t.getIndex(),o=this._reservedRanges[e];if(n&&s.count>o.indexCount||t.attributes.position.count>o.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const a=o.vertexStart,l=o.vertexCount;for(const e in r.attributes){const n=t.getAttribute(e),i=r.getAttribute(e);yu(n,i,a);const s=n.itemSize;for(let e=n.count,t=l;e=this._geometryCount)return null;const r=this._bounds[e],n=r.box,i=this.geometry;if(!1===r.boxInitialized){n.makeEmpty();const t=i.index,s=i.attributes.position,o=this._drawRanges[e];for(let e=o.start,r=o.start+o.count;e=this._geometryCount)return null;const r=this._bounds[e],n=r.sphere,i=this.geometry;if(!1===r.sphereInitialized){n.makeEmpty(),this.getBoundingBoxAt(e,uu),uu.getCenter(n.center);const t=i.index,s=i.attributes.position,o=this._drawRanges[e];let a=0;for(let e=o.start,r=o.start+o.count;e=r.length||!1===r[e].active||(t.toArray(i,16*e),n.needsUpdate=!0),this}getMatrixAt(e,t){const r=this._drawInfo,n=this._matricesTexture.image.data;return e>=r.length||!1===r[e].active?null:t.fromArray(n,16*e)}setColorAt(e,t){null===this._colorsTexture&&this._initColorsTexture();const r=this._colorsTexture,n=this._colorsTexture.image.data,i=this._drawInfo;return e>=i.length||!1===i[e].active||(t.toArray(n,4*e),r.needsUpdate=!0),this}getColorAt(e,t){const r=this._colorsTexture.image.data,n=this._drawInfo;return e>=n.length||!1===n[e].active?null:t.fromArray(r,4*e)}setVisibleAt(e,t){const r=this._drawInfo;return e>=r.length||!1===r[e].active||r[e].visible===t||(r[e].visible=t,this._visibilityChanged=!0),this}getVisibleAt(e){const t=this._drawInfo;return!(e>=t.length||!1===t[e].active)&&t[e].visible}raycast(e,t){const r=this._drawInfo,n=this._drawRanges,i=this.matrixWorld,s=this.geometry;gu.material=this.material,gu.geometry.index=s.index,gu.geometry.attributes=s.attributes,null===gu.geometry.boundingBox&&(gu.geometry.boundingBox=new Fn),null===gu.geometry.boundingSphere&&(gu.geometry.boundingSphere=new ri);for(let s=0,o=r.length;s({...e}))),this._reservedRanges=e._reservedRanges.map((e=>({...e}))),this._drawInfo=e._drawInfo.map((e=>({...e}))),this._bounds=e._bounds.map((e=>({boxInitialized:e.boxInitialized,box:e.box.clone(),sphereInitialized:e.sphereInitialized,sphere:e.sphere.clone()}))),this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),null!==this._colorsTexture&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,null!==this._colorsTexture&&(this._colorsTexture.dispose(),this._colorsTexture=null),this}onBeforeRender(e,t,r,n,i){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const s=n.getIndex(),o=null===s?1:s.array.BYTES_PER_ELEMENT,a=this._drawInfo,l=this._multiDrawStarts,c=this._multiDrawCounts,u=this._drawRanges,h=this.perObjectFrustumCulled,d=this._indirectTexture,p=d.image.data;h&&(lu.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse).multiply(this.matrixWorld),cu.setFromProjectionMatrix(lu,e.coordinateSystem));let f=0;if(this.sortObjects){su.copy(this.matrixWorld).invert(),du.setFromMatrixPosition(r.matrixWorld).applyMatrix4(su),pu.set(0,0,-1).transformDirection(r.matrixWorld).transformDirection(su);for(let e=0,t=a.length;e0){const r=e[t[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=r.length;en)return;Su.applyMatrix4(e.matrixWorld);const a=t.ray.origin.distanceTo(Su);return at.far?void 0:{distance:a,point:Cu.clone().applyMatrix4(e.matrixWorld),index:i,face:null,faceIndex:null,object:e}}const Ru=new On,Bu=new On;class Pu extends Tu{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,r=[];for(let e=0,n=t.count;e0){const r=e[t[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=r.length;ei.far)return;s.push({distance:l,distanceToRay:Math.sqrt(a),point:r,index:t,face:null,object:o})}}class Gu extends Sn{constructor(e,t,r,n,i,s,o,a,l){super(e,t,r,n,i,s,o,a,l),this.isVideoTexture=!0,this.minFilter=void 0!==s?s:Ee,this.magFilter=void 0!==i?i:Ee,this.generateMipmaps=!1;const c=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function t(){c.needsUpdate=!0,e.requestVideoFrameCallback(t)}))}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;!1=="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class Qu extends Sn{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=ve,this.minFilter=ve,this.generateMipmaps=!1,this.needsUpdate=!0}}class Vu extends Sn{constructor(e,t,r,n,i,s,o,a,l,c,u,h){super(null,s,o,a,l,c,n,i,u,h),this.isCompressedTexture=!0,this.image={width:t,height:r},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class Hu extends Vu{constructor(e,t,r,n,i,s){super(e,t,r,i,s),this.isCompressedArrayTexture=!0,this.image.depth=n,this.wrapR=Ae,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class ju extends Vu{constructor(e,t,r){super(void 0,e[0].width,e[0].height,t,r,he),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class qu extends Sn{constructor(e,t,r,n,i,s,o,a,l){super(e,t,r,n,i,s,o,a,l),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Wu{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const r=this.getUtoTmapping(e);return this.getPoint(r,t)}getPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPoint(r/e));return t}getSpacedPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPointAt(r/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let r,n=this.getPoint(0),i=0;t.push(0);for(let s=1;s<=e;s++)r=this.getPoint(s/e),i+=r.distanceTo(n),t.push(i),n=r;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const r=this.getLengths();let n=0;const i=r.length;let s;s=t||e*r[i-1];let o,a=0,l=i-1;for(;a<=l;)if(n=Math.floor(a+(l-a)/2),o=r[n]-s,o<0)a=n+1;else{if(!(o>0)){l=n;break}l=n-1}if(n=l,r[n]===s)return n/(i-1);const c=r[n];return(n+(s-c)/(r[n+1]-c))/(i-1)}getTangent(e,t){const r=1e-4;let n=e-r,i=e+r;n<0&&(n=0),i>1&&(i=1);const s=this.getPoint(n),o=this.getPoint(i),a=t||(s.isVector2?new rn:new On);return a.copy(o).sub(s).normalize(),a}getTangentAt(e,t){const r=this.getUtoTmapping(e);return this.getTangent(r,t)}computeFrenetFrames(e,t){const r=new On,n=[],i=[],s=[],o=new On,a=new hi;for(let t=0;t<=e;t++){const r=t/e;n[t]=this.getTangentAt(r,new On)}i[0]=new On,s[0]=new On;let l=Number.MAX_VALUE;const c=Math.abs(n[0].x),u=Math.abs(n[0].y),h=Math.abs(n[0].z);c<=l&&(l=c,r.set(1,0,0)),u<=l&&(l=u,r.set(0,1,0)),h<=l&&r.set(0,0,1),o.crossVectors(n[0],r).normalize(),i[0].crossVectors(n[0],o),s[0].crossVectors(n[0],i[0]);for(let t=1;t<=e;t++){if(i[t]=i[t-1].clone(),s[t]=s[t-1].clone(),o.crossVectors(n[t-1],n[t]),o.length()>Number.EPSILON){o.normalize();const e=Math.acos(Kr(n[t-1].dot(n[t]),-1,1));i[t].applyMatrix4(a.makeRotationAxis(o,e))}s[t].crossVectors(n[t],i[t])}if(!0===t){let t=Math.acos(Kr(i[0].dot(i[e]),-1,1));t/=e,n[0].dot(o.crossVectors(i[0],i[e]))>0&&(t=-t);for(let r=1;r<=e;r++)i[r].applyMatrix4(a.makeRotationAxis(n[r],t*r)),s[r].crossVectors(n[r],i[r])}return{tangents:n,normals:i,binormals:s}}clone(){return(new this.constructor).copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Yu extends Wu{constructor(e=0,t=0,r=1,n=1,i=0,s=2*Math.PI,o=!1,a=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=r,this.yRadius=n,this.aStartAngle=i,this.aEndAngle=s,this.aClockwise=o,this.aRotation=a}getPoint(e,t=new rn){const r=t,n=2*Math.PI;let i=this.aEndAngle-this.aStartAngle;const s=Math.abs(i)n;)i-=n;i0?0:(Math.floor(Math.abs(l)/i)+1)*i:0===c&&l===i-1&&(l=i-2,c=1),this.closed||l>0?o=n[(l-1)%i]:($u.subVectors(n[0],n[1]).add(n[0]),o=$u);const u=n[l%i],h=n[(l+1)%i];if(this.closed||l+2n.length-2?n.length-1:s+1],u=n[s>n.length-3?n.length-1:s+2];return r.set(rh(o,a.x,l.x,c.x,u.x),rh(o,a.y,l.y,c.y,u.y)),r}copy(e){super.copy(e),this.points=[];for(let t=0,r=e.points.length;t=r){const e=n[i]-r,s=this.curves[i],o=s.getLength(),a=0===o?0:1-e/o;return s.getPointAt(a,t)}i++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let r=0,n=this.curves.length;r1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,r=e.curves.length;t0){const e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class mh extends Is{constructor(e=[new rn(0,-.5),new rn(.5,0),new rn(0,.5)],t=12,r=0,n=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:r,phiLength:n},t=Math.floor(t),n=Kr(n,0,2*Math.PI);const i=[],s=[],o=[],a=[],l=[],c=1/t,u=new On,h=new rn,d=new On,p=new On,f=new On;let m=0,g=0;for(let t=0;t<=e.length-1;t++)switch(t){case 0:m=e[t+1].x-e[t].x,g=e[t+1].y-e[t].y,d.x=1*g,d.y=-m,d.z=0*g,f.copy(d),d.normalize(),a.push(d.x,d.y,d.z);break;case e.length-1:a.push(f.x,f.y,f.z);break;default:m=e[t+1].x-e[t].x,g=e[t+1].y-e[t].y,d.x=1*g,d.y=-m,d.z=0*g,p.copy(d),d.x+=f.x,d.y+=f.y,d.z+=f.z,d.normalize(),a.push(d.x,d.y,d.z),f.copy(p)}for(let i=0;i<=t;i++){const d=r+i*c*n,p=Math.sin(d),f=Math.cos(d);for(let r=0;r<=e.length-1;r++){u.x=e[r].x*p,u.y=e[r].y,u.z=e[r].x*f,s.push(u.x,u.y,u.z),h.x=i/t,h.y=r/(e.length-1),o.push(h.x,h.y);const n=a[3*r+0]*p,c=a[3*r+1],d=a[3*r+0]*f;l.push(n,c,d)}}for(let r=0;r0&&A(!0),t>0&&A(!1)),this.setIndex(c),this.setAttribute("position",new _s(u,3)),this.setAttribute("normal",new _s(h,3)),this.setAttribute("uv",new _s(d,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new yh(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class vh extends yh{constructor(e=1,t=1,r=32,n=1,i=!1,s=0,o=2*Math.PI){super(0,e,t,r,n,i,s,o),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:r,heightSegments:n,openEnded:i,thetaStart:s,thetaLength:o}}static fromJSON(e){return new vh(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class xh extends Is{constructor(e=[],t=[],r=1,n=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:r,detail:n};const i=[],s=[];function o(e,t,r,n){const i=n+1,s=[];for(let n=0;n<=i;n++){s[n]=[];const o=e.clone().lerp(r,n/i),a=t.clone().lerp(r,n/i),l=i-n;for(let e=0;e<=l;e++)s[n][e]=0===e&&n===i?o:o.clone().lerp(a,e/l)}for(let e=0;e.9&&o<.1&&(t<.2&&(s[e+0]+=1),r<.2&&(s[e+2]+=1),n<.2&&(s[e+4]+=1))}}()}(),this.setAttribute("position",new _s(i,3)),this.setAttribute("normal",new _s(i.slice(),3)),this.setAttribute("uv",new _s(s,2)),0===n?this.computeVertexNormals():this.normalizeNormals()}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new xh(e.vertices,e.indices,e.radius,e.details)}}class _h extends xh{constructor(e=1,t=0){const r=(1+Math.sqrt(5))/2,n=1/r;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-n,-r,0,-n,r,0,n,-r,0,n,r,-n,-r,0,-n,r,0,n,-r,0,n,r,0,-r,0,-n,r,0,-n,-r,0,n,r,0,n],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new _h(e.radius,e.detail)}}const bh=new On,wh=new On,Eh=new On,Mh=new Xi;class Sh extends Is{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},null!==e){const r=4,n=Math.pow(10,r),i=Math.cos(Wr*t),s=e.getIndex(),o=e.getAttribute("position"),a=s?s.count:o.count,l=[0,0,0],c=["a","b","c"],u=new Array(3),h={},d=[];for(let e=0;e0)for(s=t;s=t;s-=n)o=Xh(s,e[s],e[s+1],o);return o&&Vh(o,o.next)&&(Kh(o),o=o.next),o}function Ih(e,t){if(!e)return e;t||(t=e);let r,n=e;do{if(r=!1,n.steiner||!Vh(n,n.next)&&0!==Qh(n.prev,n,n.next))n=n.next;else{if(Kh(n),n=t=n.prev,n===n.next)break;r=!0}}while(r||n!==t);return t}function Rh(e,t,r,n,i,s,o){if(!e)return;!o&&s&&function(e,t,r,n){let i=e;do{0===i.z&&(i.z=Fh(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){let t,r,n,i,s,o,a,l,c=1;do{for(r=e,e=null,s=null,o=0;r;){for(o++,n=r,a=0,t=0;t0||l>0&&n;)0!==a&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,a--):(i=n,n=n.nextZ,l--),s?s.nextZ=i:e=i,i.prevZ=s,s=i;r=n}s.nextZ=null,c*=2}while(o>1)}(i)}(e,n,i,s);let a,l,c=e;for(;e.prev!==e.next;)if(a=e.prev,l=e.next,s?Ph(e,n,i,s):Bh(e))t.push(a.i/r|0),t.push(e.i/r|0),t.push(l.i/r|0),Kh(e),e=l.next,c=l.next;else if((e=l)===c){o?1===o?Rh(e=Lh(Ih(e),t,r),t,r,n,i,s,2):2===o&&Dh(e,t,r,n,i,s):Rh(Ih(e),t,r,n,i,s,1);break}}function Bh(e){const t=e.prev,r=e,n=e.next;if(Qh(t,r,n)>=0)return!1;const i=t.x,s=r.x,o=n.x,a=t.y,l=r.y,c=n.y,u=is?i>o?i:o:s>o?s:o,p=a>l?a>c?a:c:l>c?l:c;let f=n.next;for(;f!==t;){if(f.x>=u&&f.x<=d&&f.y>=h&&f.y<=p&&zh(i,a,s,l,o,c,f.x,f.y)&&Qh(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function Ph(e,t,r,n){const i=e.prev,s=e,o=e.next;if(Qh(i,s,o)>=0)return!1;const a=i.x,l=s.x,c=o.x,u=i.y,h=s.y,d=o.y,p=al?a>c?a:c:l>c?l:c,g=u>h?u>d?u:d:h>d?h:d,A=Fh(p,f,t,r,n),y=Fh(m,g,t,r,n);let v=e.prevZ,x=e.nextZ;for(;v&&v.z>=A&&x&&x.z<=y;){if(v.x>=p&&v.x<=m&&v.y>=f&&v.y<=g&&v!==i&&v!==o&&zh(a,u,l,h,c,d,v.x,v.y)&&Qh(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==i&&x!==o&&zh(a,u,l,h,c,d,x.x,x.y)&&Qh(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;v&&v.z>=A;){if(v.x>=p&&v.x<=m&&v.y>=f&&v.y<=g&&v!==i&&v!==o&&zh(a,u,l,h,c,d,v.x,v.y)&&Qh(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;x&&x.z<=y;){if(x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==i&&x!==o&&zh(a,u,l,h,c,d,x.x,x.y)&&Qh(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function Lh(e,t,r){let n=e;do{const i=n.prev,s=n.next.next;!Vh(i,s)&&Hh(i,n,n.next,s)&&Wh(i,s)&&Wh(s,i)&&(t.push(i.i/r|0),t.push(n.i/r|0),t.push(s.i/r|0),Kh(n),Kh(n.next),n=e=s),n=n.next}while(n!==e);return Ih(n)}function Dh(e,t,r,n,i,s){let o=e;do{let e=o.next.next;for(;e!==o.prev;){if(o.i!==e.i&&Gh(o,e)){let a=Yh(o,e);return o=Ih(o,o.next),a=Ih(a,a.next),Rh(o,t,r,n,i,s,0),void Rh(a,t,r,n,i,s,0)}e=e.next}o=o.next}while(o!==e)}function Oh(e,t){return e.x-t.x}function Nh(e,t){const r=function(e,t){let r,n=t,i=-1/0;const s=e.x,o=e.y;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){const e=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=s&&e>i&&(i=e,r=n.x=n.x&&n.x>=l&&s!==n.x&&zh(or.x||n.x===r.x&&Uh(r,n)))&&(r=n,h=u)),n=n.next}while(n!==a);return r}(e,t);if(!r)return t;const n=Yh(r,e);return Ih(n,n.next),Ih(r,r.next)}function Uh(e,t){return Qh(e.prev,e,t.prev)<0&&Qh(t.next,e,e.next)<0}function Fh(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function kh(e){let t=e,r=e;do{(t.x=(e-o)*(s-a)&&(e-o)*(n-a)>=(r-o)*(t-a)&&(r-o)*(s-a)>=(i-o)*(n-a)}function Gh(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&Hh(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(Wh(e,t)&&Wh(t,e)&&function(e,t){let r=e,n=!1;const i=(e.x+t.x)/2,s=(e.y+t.y)/2;do{r.y>s!=r.next.y>s&&r.next.y!==r.y&&i<(r.next.x-r.x)*(s-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(Qh(e.prev,e,t.prev)||Qh(e,t.prev,t))||Vh(e,t)&&Qh(e.prev,e,e.next)>0&&Qh(t.prev,t,t.next)>0)}function Qh(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Vh(e,t){return e.x===t.x&&e.y===t.y}function Hh(e,t,r,n){const i=qh(Qh(e,t,r)),s=qh(Qh(e,t,n)),o=qh(Qh(r,n,e)),a=qh(Qh(r,n,t));return i!==s&&o!==a||!(0!==i||!jh(e,r,t))||!(0!==s||!jh(e,n,t))||!(0!==o||!jh(r,e,n))||!(0!==a||!jh(r,t,n))}function jh(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function qh(e){return e>0?1:e<0?-1:0}function Wh(e,t){return Qh(e.prev,e,e.next)<0?Qh(e,t,e.next)>=0&&Qh(e,e.prev,t)>=0:Qh(e,t,e.prev)<0||Qh(e,e.next,t)<0}function Yh(e,t){const r=new $h(e.i,e.x,e.y),n=new $h(t.i,t.x,t.y),i=e.next,s=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,s.next=n,n.prev=s,n}function Xh(e,t,r,n){const i=new $h(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Kh(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function $h(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}class Jh{static area(e){const t=e.length;let r=0;for(let n=t-1,i=0;i80*r){a=c=e[0],l=u=e[1];for(let t=r;tc&&(c=h),d>u&&(u=d);p=Math.max(c-a,u-l),p=0!==p?32767/p:0}return Rh(s,o,r,a,l,p,0),o}(r,n);for(let e=0;e2&&e[t-1].equals(e[0])&&e.pop()}function ed(e,t){for(let r=0;rNumber.EPSILON){const h=Math.sqrt(u),d=Math.sqrt(l*l+c*c),p=t.x-a/h,f=t.y+o/h,m=((r.x-c/d-p)*c-(r.y+l/d-f)*l)/(o*c-a*l);n=p+o*m-e.x,i=f+a*m-e.y;const g=n*n+i*i;if(g<=2)return new rn(n,i);s=Math.sqrt(g/2)}else{let e=!1;o>Number.EPSILON?l>Number.EPSILON&&(e=!0):o<-Number.EPSILON?l<-Number.EPSILON&&(e=!0):Math.sign(a)===Math.sign(c)&&(e=!0),e?(n=-a,i=o,s=Math.sqrt(u)):(n=o,i=a,s=Math.sqrt(u/2))}return new rn(n/s,i/s)}const B=[];for(let e=0,t=S.length,r=t-1,n=e+1;e=0;e--){const t=e/p,r=u*Math.cos(t*Math.PI/2),n=h*Math.sin(t*Math.PI/2)+d;for(let e=0,t=S.length;e=0;){const n=r;let i=r-1;i<0&&(i=e.length-1);for(let e=0,r=a+2*p;e0)&&d.push(t,i,l),(e!==r-1||a0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class vd extends ns{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new es(16777215),this.specular=new es(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new es(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Kt,this.normalScale=new rn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new _i,this.combine=$,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(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class xd extends ns{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new es(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new es(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Kt,this.normalScale=new rn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class _d extends ns{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Kt,this.normalScale=new rn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class bd extends ns{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new es(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new es(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Kt,this.normalScale=new rn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new _i,this.combine=$,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(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class wd extends ns{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new es(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Kt,this.normalScale=new rn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Ed extends xu{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function Md(e,t,r){return!e||!r&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)}function Sd(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Cd(e){const t=e.length,r=new Array(t);for(let e=0;e!==t;++e)r[e]=e;return r.sort((function(t,r){return e[t]-e[r]})),r}function Td(e,t,r){const n=e.length,i=new e.constructor(n);for(let s=0,o=0;o!==n;++s){const n=r[s]*t;for(let r=0;r!==t;++r)i[o++]=e[n+r]}return i}function Id(e,t,r,n){let i=1,s=e[0];for(;void 0!==s&&void 0===s[n];)s=e[i++];if(void 0===s)return;let o=s[n];if(void 0!==o)if(Array.isArray(o))do{o=s[n],void 0!==o&&(t.push(s.time),r.push.apply(r,o)),s=e[i++]}while(void 0!==s);else if(void 0!==o.toArray)do{o=s[n],void 0!==o&&(t.push(s.time),o.toArray(r,r.length)),s=e[i++]}while(void 0!==s);else do{o=s[n],void 0!==o&&(t.push(s.time),r.push(o)),s=e[i++]}while(void 0!==s)}const Rd={convertArray:Md,isTypedArray:Sd,getKeyframeOrder:Cd,sortedArray:Td,flattenJSON:Id,subclip:function(e,t,r,n,i=30){const s=e.clone();s.name=t;const o=[];for(let e=0;e=n)){l.push(t.times[e]);for(let r=0;rs.tracks[e].times[0]&&(a=s.tracks[e].times[0]);for(let e=0;e=n.times[h]){const e=h*l+a,t=e+l-a;d=n.values.slice(e,t)}else{const e=n.createInterpolant(),t=a,r=l-a;e.evaluate(s),d=e.resultBuffer.slice(t,r)}"quaternion"===i&&(new Dn).fromArray(d).normalize().conjugate().toArray(d);const p=o.times.length;for(let e=0;e=i)break e;{const o=t[1];e=i)break t}s=r,r=0}}for(;r>>1;et;)--s;if(++s,0!==i||s!==n){i>=s&&(s=Math.max(s,1),i=s-1);const e=this.getValueSize();this.times=r.slice(i,s),this.values=this.values.slice(i*e,s*e)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const r=this.times,n=this.values,i=r.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let s=null;for(let t=0;t!==i;t++){const n=r[t];if("number"==typeof n&&isNaN(n)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,t,n),e=!1;break}if(null!==s&&s>n){console.error("THREE.KeyframeTrack: Out of order keys.",this,t,n,s),e=!1;break}s=n}if(void 0!==n&&Sd(n))for(let t=0,r=n.length;t!==r;++t){const r=n[t];if(isNaN(r)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,t,r),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),r=this.getValueSize(),n=this.getInterpolation()===Ut,i=e.length-1;let s=1;for(let o=1;o0){e[s]=e[i];for(let e=i*r,n=s*r,o=0;o!==r;++o)t[n+o]=t[e+o];++s}return s!==e.length?(this.times=e.slice(0,s),this.values=t.slice(0,s*r)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),r=new(0,this.constructor)(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}Od.prototype.TimeBufferType=Float32Array,Od.prototype.ValueBufferType=Float32Array,Od.prototype.DefaultInterpolation=Nt;class Nd extends Od{constructor(e,t,r){super(e,t,r)}}Nd.prototype.ValueTypeName="bool",Nd.prototype.ValueBufferType=Array,Nd.prototype.DefaultInterpolation=Ot,Nd.prototype.InterpolantFactoryMethodLinear=void 0,Nd.prototype.InterpolantFactoryMethodSmooth=void 0;class Ud extends Od{}Ud.prototype.ValueTypeName="color";class Fd extends Od{}Fd.prototype.ValueTypeName="number";class kd extends Bd{constructor(e,t,r,n){super(e,t,r,n)}interpolate_(e,t,r,n){const i=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=(r-t)/(n-t);let l=e*o;for(let e=l+o;l!==e;l+=4)Dn.slerpFlat(i,0,s,l-o,s,l,a);return i}}class zd extends Od{InterpolantFactoryMethodLinear(e){return new kd(this.times,this.values,this.getValueSize(),e)}}zd.prototype.ValueTypeName="quaternion",zd.prototype.InterpolantFactoryMethodSmooth=void 0;class Gd extends Od{constructor(e,t,r){super(e,t,r)}}Gd.prototype.ValueTypeName="string",Gd.prototype.ValueBufferType=Array,Gd.prototype.DefaultInterpolation=Ot,Gd.prototype.InterpolantFactoryMethodLinear=void 0,Gd.prototype.InterpolantFactoryMethodSmooth=void 0;class Qd extends Od{}Qd.prototype.ValueTypeName="vector";class Vd{constructor(e="",t=-1,r=[],n=Gt){this.name=e,this.tracks=r,this.duration=t,this.blendMode=n,this.uuid=Xr(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],r=e.tracks,n=1/(e.fps||1);for(let e=0,i=r.length;e!==i;++e)t.push(Hd(r[e]).scale(n));const i=new this(e.name,e.duration,t,e.blendMode);return i.uuid=e.uuid,i}static toJSON(e){const t=[],r=e.tracks,n={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let e=0,n=r.length;e!==n;++e)t.push(Od.toJSON(r[e]));return n}static CreateFromMorphTargetSequence(e,t,r,n){const i=t.length,s=[];for(let e=0;e1){const e=s[1];let t=n[e];t||(n[e]=t=[]),t.push(r)}}const s=[];for(const e in n)s.push(this.CreateFromMorphTargetSequence(e,n[e],t,r));return s}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(e,t,r,n,i){if(0!==r.length){const s=[],o=[];Id(r,s,o,n),0!==s.length&&i.push(new e(t,s,o))}},n=[],i=e.name||"default",s=e.fps||30,o=e.blendMode;let a=e.length||-1;const l=e.hierarchy||[];for(let e=0;e{t&&t(i),this.manager.itemEnd(e)}),0),i;if(void 0!==Xd[e])return void Xd[e].push({onLoad:t,onProgress:r,onError:n});Xd[e]=[],Xd[e].push({onLoad:t,onProgress:r,onError:n});const s=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,a=this.responseType;fetch(s).then((t=>{if(200===t.status||0===t.status){if(0===t.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===t.body||void 0===t.body.getReader)return t;const r=Xd[e],n=t.body.getReader(),i=t.headers.get("X-File-Size")||t.headers.get("Content-Length"),s=i?parseInt(i):0,o=0!==s;let a=0;const l=new ReadableStream({start(e){!function t(){n.read().then((({done:n,value:i})=>{if(n)e.close();else{a+=i.byteLength;const n=new ProgressEvent("progress",{lengthComputable:o,loaded:a,total:s});for(let e=0,t=r.length;e{e.error(t)}))}()}});return new Response(l)}throw new Kd(`fetch for "${t.url}" responded with ${t.status}: ${t.statusText}`,t)})).then((e=>{switch(a){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"document":return e.text().then((e=>(new DOMParser).parseFromString(e,o)));case"json":return e.json();default:if(void 0===o)return e.text();{const t=/charset="?([^;"\s]*)"?/i.exec(o),r=t&&t[1]?t[1].toLowerCase():void 0,n=new TextDecoder(r);return e.arrayBuffer().then((e=>n.decode(e)))}}})).then((t=>{jd.add(e,t);const r=Xd[e];delete Xd[e];for(let e=0,n=r.length;e{const r=Xd[e];if(void 0===r)throw this.manager.itemError(e),t;delete Xd[e];for(let e=0,n=r.length;e{this.manager.itemEnd(e)})),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class Jd extends Yd{constructor(e){super(e)}load(e,t,r,n){const i=this,s=new $d(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(r){try{t(i.parse(JSON.parse(r)))}catch(t){n?n(t):console.error(t),i.manager.itemError(e)}}),r,n)}parse(e){const t=[];for(let r=0;r0:n.vertexColors=e.vertexColors),void 0!==e.uniforms)for(const t in e.uniforms){const i=e.uniforms[t];switch(n.uniforms[t]={},i.type){case"t":n.uniforms[t].value=r(i.value);break;case"c":n.uniforms[t].value=(new es).setHex(i.value);break;case"v2":n.uniforms[t].value=(new rn).fromArray(i.value);break;case"v3":n.uniforms[t].value=(new On).fromArray(i.value);break;case"v4":n.uniforms[t].value=(new Cn).fromArray(i.value);break;case"m3":n.uniforms[t].value=(new nn).fromArray(i.value);break;case"m4":n.uniforms[t].value=(new hi).fromArray(i.value);break;default:n.uniforms[t].value=i.value}}if(void 0!==e.defines&&(n.defines=e.defines),void 0!==e.vertexShader&&(n.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(n.fragmentShader=e.fragmentShader),void 0!==e.glslVersion&&(n.glslVersion=e.glslVersion),void 0!==e.extensions)for(const t in e.extensions)n.extensions[t]=e.extensions[t];if(void 0!==e.lights&&(n.lights=e.lights),void 0!==e.clipping&&(n.clipping=e.clipping),void 0!==e.size&&(n.size=e.size),void 0!==e.sizeAttenuation&&(n.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(n.map=r(e.map)),void 0!==e.matcap&&(n.matcap=r(e.matcap)),void 0!==e.alphaMap&&(n.alphaMap=r(e.alphaMap)),void 0!==e.bumpMap&&(n.bumpMap=r(e.bumpMap)),void 0!==e.bumpScale&&(n.bumpScale=e.bumpScale),void 0!==e.normalMap&&(n.normalMap=r(e.normalMap)),void 0!==e.normalMapType&&(n.normalMapType=e.normalMapType),void 0!==e.normalScale){let t=e.normalScale;!1===Array.isArray(t)&&(t=[t,t]),n.normalScale=(new rn).fromArray(t)}return void 0!==e.displacementMap&&(n.displacementMap=r(e.displacementMap)),void 0!==e.displacementScale&&(n.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(n.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(n.roughnessMap=r(e.roughnessMap)),void 0!==e.metalnessMap&&(n.metalnessMap=r(e.metalnessMap)),void 0!==e.emissiveMap&&(n.emissiveMap=r(e.emissiveMap)),void 0!==e.emissiveIntensity&&(n.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(n.specularMap=r(e.specularMap)),void 0!==e.specularIntensityMap&&(n.specularIntensityMap=r(e.specularIntensityMap)),void 0!==e.specularColorMap&&(n.specularColorMap=r(e.specularColorMap)),void 0!==e.envMap&&(n.envMap=r(e.envMap)),void 0!==e.envMapRotation&&n.envMapRotation.fromArray(e.envMapRotation),void 0!==e.envMapIntensity&&(n.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(n.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(n.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(n.lightMap=r(e.lightMap)),void 0!==e.lightMapIntensity&&(n.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(n.aoMap=r(e.aoMap)),void 0!==e.aoMapIntensity&&(n.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(n.gradientMap=r(e.gradientMap)),void 0!==e.clearcoatMap&&(n.clearcoatMap=r(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(n.clearcoatRoughnessMap=r(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(n.clearcoatNormalMap=r(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(n.clearcoatNormalScale=(new rn).fromArray(e.clearcoatNormalScale)),void 0!==e.iridescenceMap&&(n.iridescenceMap=r(e.iridescenceMap)),void 0!==e.iridescenceThicknessMap&&(n.iridescenceThicknessMap=r(e.iridescenceThicknessMap)),void 0!==e.transmissionMap&&(n.transmissionMap=r(e.transmissionMap)),void 0!==e.thicknessMap&&(n.thicknessMap=r(e.thicknessMap)),void 0!==e.anisotropyMap&&(n.anisotropyMap=r(e.anisotropyMap)),void 0!==e.sheenColorMap&&(n.sheenColorMap=r(e.sheenColorMap)),void 0!==e.sheenRoughnessMap&&(n.sheenRoughnessMap=r(e.sheenRoughnessMap)),n}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){return new{ShadowMaterial:md,SpriteMaterial:dc,RawShaderMaterial:gd,ShaderMaterial:eo,PointsMaterial:Du,MeshPhysicalMaterial:yd,MeshStandardMaterial:Ad,MeshPhongMaterial:vd,MeshToonMaterial:xd,MeshNormalMaterial:_d,MeshLambertMaterial:bd,MeshDepthMaterial:Gl,MeshDistanceMaterial:Ql,MeshBasicMaterial:is,MeshMatcapMaterial:wd,LineDashedMaterial:Ed,LineBasicMaterial:xu,Material:ns}[e]}}class Ep{static decodeText(e){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);let t="";for(let r=0,n=e.length;r0){const r=new qd(t);i=new ep(r),i.setCrossOrigin(this.crossOrigin);for(let t=0,r=e.length;t0){n=new ep(this.manager),n.setCrossOrigin(this.crossOrigin);for(let t=0,n=e.length;t{const t=new Fn;t.min.fromArray(e.boxMin),t.max.fromArray(e.boxMax);const r=new ri;return r.radius=e.sphereRadius,r.center.fromArray(e.sphereCenter),{boxInitialized:e.boxInitialized,box:t,sphereInitialized:e.sphereInitialized,sphere:r}})),s._maxInstanceCount=e.maxInstanceCount,s._maxVertexCount=e.maxVertexCount,s._maxIndexCount=e.maxIndexCount,s._geometryInitialized=e.geometryInitialized,s._geometryCount=e.geometryCount,s._matricesTexture=u(e.matricesTexture.uuid),void 0!==e.colorsTexture&&(s._colorsTexture=u(e.colorsTexture.uuid));break;case"LOD":s=new Rc;break;case"Line":s=new Tu(l(e.geometry),c(e.material));break;case"LineLoop":s=new Lu(l(e.geometry),c(e.material));break;case"LineSegments":s=new Pu(l(e.geometry),c(e.material));break;case"PointCloud":case"Points":s=new ku(l(e.geometry),c(e.material));break;case"Sprite":s=new Sc(c(e.material));break;case"Group":s=new Kl;break;case"Bone":s=new Gc;break;default:s=new Fi}if(s.uuid=e.uuid,void 0!==e.name&&(s.name=e.name),void 0!==e.matrix?(s.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(s.matrixAutoUpdate=e.matrixAutoUpdate),s.matrixAutoUpdate&&s.matrix.decompose(s.position,s.quaternion,s.scale)):(void 0!==e.position&&s.position.fromArray(e.position),void 0!==e.rotation&&s.rotation.fromArray(e.rotation),void 0!==e.quaternion&&s.quaternion.fromArray(e.quaternion),void 0!==e.scale&&s.scale.fromArray(e.scale)),void 0!==e.up&&s.up.fromArray(e.up),void 0!==e.castShadow&&(s.castShadow=e.castShadow),void 0!==e.receiveShadow&&(s.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.intensity&&(s.shadow.intensity=e.shadow.intensity),void 0!==e.shadow.bias&&(s.shadow.bias=e.shadow.bias),void 0!==e.shadow.normalBias&&(s.shadow.normalBias=e.shadow.normalBias),void 0!==e.shadow.radius&&(s.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&s.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(s.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(s.visible=e.visible),void 0!==e.frustumCulled&&(s.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(s.renderOrder=e.renderOrder),void 0!==e.userData&&(s.userData=e.userData),void 0!==e.layers&&(s.layers.mask=e.layers),void 0!==e.children){const o=e.children;for(let e=0;e{t&&t(r),i.manager.itemEnd(e)})).catch((e=>{n&&n(e)})):(setTimeout((function(){t&&t(s),i.manager.itemEnd(e)}),0),s);const o={};o.credentials="anonymous"===this.crossOrigin?"same-origin":"include",o.headers=this.requestHeader;const a=fetch(e,o).then((function(e){return e.blob()})).then((function(e){return createImageBitmap(e,Object.assign(i.options,{colorSpaceConversion:"none"}))})).then((function(r){return jd.add(e,r),t&&t(r),i.manager.itemEnd(e),r})).catch((function(t){n&&n(t),jd.remove(e),i.manager.itemError(e),i.manager.itemEnd(e)}));jd.add(e,a),i.manager.itemStart(e)}}let Pp;class Lp{static getContext(){return void 0===Pp&&(Pp=new(window.AudioContext||window.webkitAudioContext)),Pp}static setContext(e){Pp=e}}class Dp extends Yd{constructor(e){super(e)}load(e,t,r,n){const i=this,s=new $d(this.manager);function o(t){n?n(t):console.error(t),i.manager.itemError(e)}s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(e){try{const r=e.slice(0);Lp.getContext().decodeAudioData(r,(function(e){t(e)})).catch(o)}catch(e){o(e)}}),r,n)}}const Op=new hi,Np=new hi,Up=new hi;class Fp{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new so,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new so,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,Up.copy(e.projectionMatrix);const r=t.eyeSep/2,n=r*t.near/t.focus,i=t.near*Math.tan(Wr*t.fov*.5)/t.zoom;let s,o;Np.elements[12]=-r,Op.elements[12]=r,s=-i*t.aspect+n,o=i*t.aspect+n,Up.elements[0]=2*t.near/(o-s),Up.elements[8]=(o+s)/(o-s),this.cameraL.projectionMatrix.copy(Up),s=-i*t.aspect-n,o=i*t.aspect-n,Up.elements[0]=2*t.near/(o-s),Up.elements[8]=(o+s)/(o-s),this.cameraR.projectionMatrix.copy(Up)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Np),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Op)}}class kp{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=zp(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=zp();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function zp(){return("undefined"==typeof performance?Date:performance).now()}const Gp=new On,Qp=new Dn,Vp=new On,Hp=new On;class jp extends Fi{constructor(){super(),this.type="AudioListener",this.context=Lp.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new kp}getInput(){return this.gain}removeFilter(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,r=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Gp,Qp,Vp),Hp.set(0,0,-1).applyQuaternion(Qp),t.positionX){const e=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Gp.x,e),t.positionY.linearRampToValueAtTime(Gp.y,e),t.positionZ.linearRampToValueAtTime(Gp.z,e),t.forwardX.linearRampToValueAtTime(Hp.x,e),t.forwardY.linearRampToValueAtTime(Hp.y,e),t.forwardZ.linearRampToValueAtTime(Hp.z,e),t.upX.linearRampToValueAtTime(r.x,e),t.upY.linearRampToValueAtTime(r.y,e),t.upZ.linearRampToValueAtTime(r.z,e)}else t.setPosition(Gp.x,Gp.y,Gp.z),t.setOrientation(Hp.x,Hp.y,Hp.z,r.x,r.y,r.z)}}class qp extends Fi{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}stop(){if(!1!==this.hasPlaybackControl)return this._progress=0,null!==this.source&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(r,n,this._addIndex*t,1,t);for(let e=t,i=t+t;e!==i;++e)if(r[e]!==r[e+t]){o.setValue(r,n);break}}saveOriginalState(){const e=this.binding,t=this.buffer,r=this.valueSize,n=r*this._origIndex;e.getValue(t,n);for(let e=r,i=n;e!==i;++e)t[e]=t[n+e%r];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=3*this.valueSize;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let r=e;r=.5)for(let n=0;n!==i;++n)e[t+n]=e[r+n]}_slerp(e,t,r,n){Dn.slerpFlat(e,t,e,t,e,r,n)}_slerpAdditive(e,t,r,n,i){const s=this._workIndex*i;Dn.multiplyQuaternionsFlat(e,s,e,t,e,r),Dn.slerpFlat(e,t,e,t,e,s,n)}_lerp(e,t,r,n,i){const s=1-n;for(let o=0;o!==i;++o){const i=t+o;e[i]=e[i]*s+e[r+o]*n}}_lerpAdditive(e,t,r,n,i){for(let s=0;s!==i;++s){const i=t+s;e[i]=e[i]+e[r+s]*n}}}const ef="\\[\\]\\.:\\/",tf=new RegExp("["+ef+"]","g"),rf="[^"+ef+"]",nf="[^"+ef.replace("\\.","")+"]",sf=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",rf)+/(WCOD+)?/.source.replace("WCOD",nf)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",rf)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",rf)+"$"),of=["material","materials","bones","map"];class af{constructor(e,t,r){this.path=t,this.parsedPath=r||af.parseTrackName(t),this.node=af.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,r){return e&&e.isAnimationObjectGroup?new af.Composite(e,t,r):new af(e,t,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(tf,"")}static parseTrackName(e){const t=sf.exec(e);if(null===t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const r={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},n=r.nodeName&&r.nodeName.lastIndexOf(".");if(void 0!==n&&-1!==n){const e=r.nodeName.substring(n+1);-1!==of.indexOf(e)&&(r.nodeName=r.nodeName.substring(0,n),r.objectName=e)}if(null===r.propertyName||0===r.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,t){if(void 0===t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){const r=e.skeleton.getBoneByName(t);if(void 0!==r)return r}if(e.children){const r=function(e){for(let n=0;n=i){const s=i++,c=e[s];t[c.uuid]=l,e[l]=c,t[a]=s,e[s]=o;for(let e=0,t=n;e!==t;++e){const t=r[e],n=t[s],i=t[l];t[l]=n,t[s]=i}}}this.nCachedObjects_=i}uncache(){const e=this._objects,t=this._indicesByUUID,r=this._bindings,n=r.length;let i=this.nCachedObjects_,s=e.length;for(let o=0,a=arguments.length;o!==a;++o){const a=arguments[o].uuid,l=t[a];if(void 0!==l)if(delete t[a],l0&&(t[o.uuid]=l),e[l]=o,e.pop();for(let e=0,t=n;e!==t;++e){const t=r[e];t[l]=t[i],t.pop()}}}this.nCachedObjects_=i}subscribe_(e,t){const r=this._bindingsIndicesByPath;let n=r[e];const i=this._bindings;if(void 0!==n)return i[n];const s=this._paths,o=this._parsedPaths,a=this._objects,l=a.length,c=this.nCachedObjects_,u=new Array(l);n=i.length,r[e]=n,s.push(e),o.push(t),i.push(u);for(let r=c,n=a.length;r!==n;++r){const n=a[r];u[r]=new af(n,e,t)}return u}unsubscribe_(e){const t=this._bindingsIndicesByPath,r=t[e];if(void 0!==r){const n=this._paths,i=this._parsedPaths,s=this._bindings,o=s.length-1,a=s[o];t[e[o]]=r,s[r]=a,s.pop(),i[r]=i[o],i.pop(),n[r]=n[o],n.pop()}}}class cf{constructor(e,t,r=null,n=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=r,this.blendMode=n;const i=t.tracks,s=i.length,o=new Array(s),a={endingStart:Ft,endingEnd:Ft};for(let e=0;e!==s;++e){const t=i[e].createInterpolant(null);o[e]=t,t.settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Lt,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,r){if(e.fadeOut(t),this.fadeIn(t),r){const r=this._clip.duration,n=e._clip.duration,i=n/r,s=r/n;e.warp(1,i,t),this.warp(s,1,t)}return this}crossFadeTo(e,t,r){return e.crossFadeFrom(this,t,r)}stopFading(){const e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,r){const n=this._mixer,i=n.time,s=this.timeScale;let o=this._timeScaleInterpolant;null===o&&(o=n._lendControlInterpolant(),this._timeScaleInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=i,a[1]=i+r,l[0]=e/s,l[1]=t/s,this}stopWarping(){const e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,r,n){if(!this.enabled)return void this._updateWeight(e);const i=this._startTime;if(null!==i){const n=(e-i)*r;n<0||0===r?t=0:(this._startTime=null,t=r*n)}t*=this._updateTimeScale(e);const s=this._updateTime(t),o=this._updateWeight(e);if(o>0){const e=this._interpolants,t=this._propertyBindings;if(this.blendMode===Qt)for(let r=0,n=e.length;r!==n;++r)e[r].evaluate(s),t[r].accumulateAdditive(o);else for(let r=0,i=e.length;r!==i;++r)e[r].evaluate(s),t[r].accumulate(n,o)}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const r=this._weightInterpolant;if(null!==r){const n=r.evaluate(e)[0];t*=n,e>r.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const r=this._timeScaleInterpolant;null!==r&&(t*=r.evaluate(e)[0],e>r.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,r=this.loop;let n=this.time+e,i=this._loopCount;const s=r===Dt;if(0===e)return-1===i||!s||1&~i?n:t-n;if(r===Pt){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(n>=t)n=t;else{if(!(n<0)){this.time=n;break e}n=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),n>=t||n<0){const r=Math.floor(n/t);n-=t*r,i+=Math.abs(r);const o=this.repetitions-i;if(o<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=e>0?t:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===o){const t=e<0;this._setEndings(t,!t,s)}else this._setEndings(!1,!1,s);this._loopCount=i,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:r})}}else this.time=n;if(s&&!(1&~i))return t-n}return n}_setEndings(e,t,r){const n=this._interpolantSettings;r?(n.endingStart=kt,n.endingEnd=kt):(n.endingStart=e?this.zeroSlopeAtStart?kt:Ft:zt,n.endingEnd=t?this.zeroSlopeAtEnd?kt:Ft:zt)}_scheduleFading(e,t,r){const n=this._mixer,i=n.time;let s=this._weightInterpolant;null===s&&(s=n._lendControlInterpolant(),this._weightInterpolant=s);const o=s.parameterPositions,a=s.sampleValues;return o[0]=i,a[0]=t,o[1]=i+e,a[1]=r,this}}const uf=new Float32Array(1);class hf extends Hr{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const r=e._localRoot||this._root,n=e._clip.tracks,i=n.length,s=e._propertyBindings,o=e._interpolants,a=r.uuid,l=this._bindingsByRootAndName;let c=l[a];void 0===c&&(c={},l[a]=c);for(let e=0;e!==i;++e){const i=n[e],l=i.name;let u=c[l];if(void 0!==u)++u.referenceCount,s[e]=u;else{if(u=s[e],void 0!==u){null===u._cacheIndex&&(++u.referenceCount,this._addInactiveBinding(u,a,l));continue}const n=t&&t._propertyBindings[e].binding.parsedPath;u=new Zp(af.create(r,l,n),i.ValueTypeName,i.getValueSize()),++u.referenceCount,this._addInactiveBinding(u,a,l),s[e]=u}o[e].resultBuffer=u.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){const t=(e._localRoot||this._root).uuid,r=e._clip.uuid,n=this._actionsByClip[r];this._bindAction(e,n&&n.knownActions[0]),this._addInactiveAction(e,r,t)}const t=e._propertyBindings;for(let e=0,r=t.length;e!==r;++e){const r=t[e];0==r.useCount++&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let e=0,r=t.length;e!==r;++e){const r=t[e];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return null!==t&&t=0;--t)e[t].stop();return this}update(e){e*=this.timeScale;const t=this._actions,r=this._nActiveActions,n=this.time+=e,i=Math.sign(e),s=this._accuIndex^=1;for(let o=0;o!==r;++o)t[o]._update(n,e,i,s);const o=this._bindings,a=this._nActiveBindings;for(let e=0;e!==a;++e)o[e].apply(s);return this}setTime(e){this.time=0;for(let e=0;e=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Ef).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const Sf=new On,Cf=new On;class Tf{constructor(e=new On,t=new On){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){Sf.subVectors(e,this.start),Cf.subVectors(this.end,this.start);const r=Cf.dot(Cf);let n=Cf.dot(Sf)/r;return t&&(n=Kr(n,0,1)),n}closestPointToPoint(e,t,r){const n=this.closestPointToPointParameter(e,t);return this.delta(r).multiplyScalar(n).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}}const If=new On;class Rf extends Fi{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const r=new Is,n=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let e=0,t=1,r=32;e1)for(let r=0;r.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{tm.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(tm,t)}}setLength(e,t=.2*e,r=.2*t){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(r,t,r),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class sm extends Pu{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],r=new Is;r.setAttribute("position",new _s(t,3)),r.setAttribute("color",new _s([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),super(r,new xu({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(e,t,r){const n=new es,i=this.geometry.attributes.color.array;return n.set(e),n.toArray(i,0),n.toArray(i,3),n.set(t),n.toArray(i,6),n.toArray(i,9),n.set(r),n.toArray(i,12),n.toArray(i,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class om{constructor(){this.type="ShapePath",this.color=new es,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new fh,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,r,n){return this.currentPath.quadraticCurveTo(e,t,r,n),this}bezierCurveTo(e,t,r,n,i,s){return this.currentPath.bezierCurveTo(e,t,r,n,i,s),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(e,t){const r=t.length;let n=!1;for(let i=r-1,s=0;sNumber.EPSILON){if(l<0&&(r=t[s],a=-a,o=t[i],l=-l),e.yo.y)continue;if(e.y===r.y){if(e.x===r.x)return!0}else{const t=l*(e.x-r.x)-a*(e.y-r.y);if(0===t)return!0;if(t<0)continue;n=!n}}else{if(e.y!==r.y)continue;if(o.x<=e.x&&e.x<=r.x||r.x<=e.x&&e.x<=o.x)return!0}}return n}const r=Jh.isClockWise,n=this.subPaths;if(0===n.length)return[];let i,s,o;const a=[];if(1===n.length)return s=n[0],o=new Ch,o.curves=s.curves,a.push(o),a;let l=!r(n[0].getPoints());l=e?!l:l;const c=[],u=[];let h,d,p=[],f=0;u[f]=void 0,p[f]=[];for(let t=0,o=n.length;t1){let e=!1,r=0;for(let e=0,t=u.length;e0&&!1===e&&(p=c)}for(let e=0,t=u.length;e{if(!r){var o=1/0;for(u=0;u=s)&&Object.keys(n.O).every((e=>n.O[e](r[l])))?r.splice(l--,1):(a=!1,s0&&e[u-1][2]>s;u--)e[u]=e[u-1];e[u]=[r,i,s]},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.u=e=>({343:"itowns_potree2worker",899:"itowns_lasparser"}[e]+".js"),n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var i=r.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=r[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{n.b=document.baseURI||self.location.href;var e={403:0};n.O.j=t=>0===e[t];var t=(t,r)=>{var i,s,[o,a,l]=r,c=0;if(o.some((t=>0!==e[t]))){for(i in a)n.o(a,i)&&(n.m[i]=a[i]);if(l)var u=l(n)}for(t&&t(r);c